webamp 1.4.3-beta.5 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/README.md +20 -0
  2. package/built/types/js/Disposable.d.ts +11 -0
  3. package/built/types/js/actionCreators/equalizer.d.ts +8 -0
  4. package/built/types/js/actionCreators/files.d.ts +24 -0
  5. package/built/types/js/actionCreators/index.d.ts +22 -0
  6. package/built/types/js/actionCreators/media.d.ts +20 -0
  7. package/built/types/js/actionCreators/milkdrop.d.ts +13 -0
  8. package/built/types/js/actionCreators/playlist.d.ts +16 -0
  9. package/built/types/js/actionCreators/windows.d.ts +27 -0
  10. package/built/types/js/actionTypes.d.ts +87 -0
  11. package/built/types/js/components/App.d.ts +12 -0
  12. package/built/types/js/components/Balance.d.ts +8 -0
  13. package/built/types/js/components/Character.d.ts +9 -0
  14. package/built/types/js/components/CharacterString.d.ts +6 -0
  15. package/built/types/js/components/ClickedDiv.d.ts +8 -0
  16. package/built/types/js/components/ClipPaths.d.ts +8 -0
  17. package/built/types/js/components/ContextMenu.d.ts +31 -0
  18. package/built/types/js/components/ContextMenuTarget.d.ts +9 -0
  19. package/built/types/js/components/ContextMenuWrapper.d.ts +7 -0
  20. package/built/types/js/components/Css.d.ts +7 -0
  21. package/built/types/js/components/DropTarget.d.ts +13 -0
  22. package/built/types/js/components/EqualizerWindow/Band.d.ts +14 -0
  23. package/built/types/js/components/EqualizerWindow/EqAuto.d.ts +3 -0
  24. package/built/types/js/components/EqualizerWindow/EqGraph.d.ts +2 -0
  25. package/built/types/js/components/EqualizerWindow/EqOn.d.ts +2 -0
  26. package/built/types/js/components/EqualizerWindow/EqTitleButtons.d.ts +1 -0
  27. package/built/types/js/components/EqualizerWindow/EqualizerShade.d.ts +2 -0
  28. package/built/types/js/components/EqualizerWindow/PresetsContextMenu.d.ts +2 -0
  29. package/built/types/js/components/EqualizerWindow/index.d.ts +2 -0
  30. package/built/types/js/components/EqualizerWindow/spline.d.ts +1 -0
  31. package/built/types/js/components/FFTNullsoft.d.ts +16 -0
  32. package/built/types/js/components/FocusTarget.d.ts +9 -0
  33. package/built/types/js/components/Fullscreen.d.ts +8 -0
  34. package/built/types/js/components/GenWindow/index.d.ts +14 -0
  35. package/built/types/js/components/MainWindow/ActionButtons.d.ts +3 -0
  36. package/built/types/js/components/MainWindow/Close.d.ts +3 -0
  37. package/built/types/js/components/MainWindow/ClutterBar.d.ts +3 -0
  38. package/built/types/js/components/MainWindow/Eject.d.ts +3 -0
  39. package/built/types/js/components/MainWindow/EqToggleButton.d.ts +3 -0
  40. package/built/types/js/components/MainWindow/Kbps.d.ts +3 -0
  41. package/built/types/js/components/MainWindow/Khz.d.ts +3 -0
  42. package/built/types/js/components/MainWindow/MainBalance.d.ts +4 -0
  43. package/built/types/js/components/MainWindow/MainContextMenu.d.ts +7 -0
  44. package/built/types/js/components/MainWindow/MainVolume.d.ts +3 -0
  45. package/built/types/js/components/MainWindow/Marquee.d.ts +7 -0
  46. package/built/types/js/components/MainWindow/Minimize.d.ts +3 -0
  47. package/built/types/js/components/MainWindow/MonoStereo.d.ts +3 -0
  48. package/built/types/js/components/MainWindow/PlaylistToggleButton.d.ts +3 -0
  49. package/built/types/js/components/MainWindow/Position.d.ts +3 -0
  50. package/built/types/js/components/MainWindow/Repeat.d.ts +3 -0
  51. package/built/types/js/components/MainWindow/Shade.d.ts +3 -0
  52. package/built/types/js/components/MainWindow/Shuffle.d.ts +3 -0
  53. package/built/types/js/components/MainWindow/Time.d.ts +3 -0
  54. package/built/types/js/components/MainWindow/index.d.ts +8 -0
  55. package/built/types/js/components/MilkdropWindow/Background.d.ts +7 -0
  56. package/built/types/js/components/MilkdropWindow/Desktop.d.ts +7 -0
  57. package/built/types/js/components/MilkdropWindow/MilkdropContextMenu.d.ts +6 -0
  58. package/built/types/js/components/MilkdropWindow/PresetOverlay.d.ts +7 -0
  59. package/built/types/js/components/MilkdropWindow/Visualizer.d.ts +7 -0
  60. package/built/types/js/components/MilkdropWindow/index.d.ts +5 -0
  61. package/built/types/js/components/MiniTime.d.ts +2 -0
  62. package/built/types/js/components/OptionsContextMenu.d.ts +2 -0
  63. package/built/types/js/components/PlaybackContextMenu.d.ts +2 -0
  64. package/built/types/js/components/PlaylistWindow/AddMenu.d.ts +2 -0
  65. package/built/types/js/components/PlaylistWindow/ListMenu.d.ts +1 -0
  66. package/built/types/js/components/PlaylistWindow/MiscMenu.d.ts +2 -0
  67. package/built/types/js/components/PlaylistWindow/MiscOptionsContextMenu.d.ts +2 -0
  68. package/built/types/js/components/PlaylistWindow/PlaylistActionArea.d.ts +2 -0
  69. package/built/types/js/components/PlaylistWindow/PlaylistMenu.d.ts +8 -0
  70. package/built/types/js/components/PlaylistWindow/PlaylistMenuEntry.d.ts +7 -0
  71. package/built/types/js/components/PlaylistWindow/PlaylistResizeTarget.d.ts +5 -0
  72. package/built/types/js/components/PlaylistWindow/PlaylistScrollBar.d.ts +1 -0
  73. package/built/types/js/components/PlaylistWindow/PlaylistShade.d.ts +2 -0
  74. package/built/types/js/components/PlaylistWindow/RemoveMenu.d.ts +2 -0
  75. package/built/types/js/components/PlaylistWindow/RunningTimeDisplay.d.ts +2 -0
  76. package/built/types/js/components/PlaylistWindow/SelectionMenu.d.ts +1 -0
  77. package/built/types/js/components/PlaylistWindow/SortContextMenu.d.ts +1 -0
  78. package/built/types/js/components/PlaylistWindow/TrackCell.d.ts +9 -0
  79. package/built/types/js/components/PlaylistWindow/TrackList.d.ts +2 -0
  80. package/built/types/js/components/PlaylistWindow/TrackTitle.d.ts +6 -0
  81. package/built/types/js/components/PlaylistWindow/index.d.ts +5 -0
  82. package/built/types/js/components/ResizeTarget.d.ts +11 -0
  83. package/built/types/js/components/Skin.d.ts +1 -0
  84. package/built/types/js/components/SkinsContextMenu.d.ts +2 -0
  85. package/built/types/js/components/VerticalSlider.d.ts +15 -0
  86. package/built/types/js/components/Vis.d.ts +5 -0
  87. package/built/types/js/components/VisPainter.d.ts +147 -0
  88. package/built/types/js/components/Volume.d.ts +8 -0
  89. package/built/types/js/components/WinampButton.d.ts +23 -0
  90. package/built/types/js/components/WindowManager.d.ts +8 -0
  91. package/built/types/js/constants.d.ts +38 -0
  92. package/built/types/js/emitter.d.ts +9 -0
  93. package/built/types/js/fileUtils.d.ts +15 -0
  94. package/built/types/js/hooks.d.ts +21 -0
  95. package/built/types/js/hotkeys.d.ts +2 -0
  96. package/built/types/js/loadQueue.d.ts +9 -0
  97. package/built/types/js/marqueeUtils.d.ts +6 -0
  98. package/built/types/js/marqueeUtils.test.d.ts +1 -0
  99. package/built/types/js/media/StereoBalanceNode.d.ts +3 -0
  100. package/built/types/js/media/elementSource.d.ts +26 -0
  101. package/built/types/js/media/index.d.ts +43 -0
  102. package/built/types/js/mediaMiddleware.d.ts +4 -0
  103. package/built/types/js/playlistHtml.d.ts +10 -0
  104. package/built/types/js/reducers/display.d.ts +26 -0
  105. package/built/types/js/reducers/equalizer.d.ts +10 -0
  106. package/built/types/js/reducers/index.d.ts +4 -0
  107. package/built/types/js/reducers/media.d.ts +14 -0
  108. package/built/types/js/reducers/milkdrop.d.ts +15 -0
  109. package/built/types/js/reducers/network.d.ts +6 -0
  110. package/built/types/js/reducers/playlist.d.ts +9 -0
  111. package/built/types/js/reducers/settings.d.ts +6 -0
  112. package/built/types/js/reducers/tracks.d.ts +7 -0
  113. package/built/types/js/reducers/tracks.test.d.ts +1 -0
  114. package/built/types/js/reducers/userInput.d.ts +9 -0
  115. package/built/types/js/reducers/windows.d.ts +34 -0
  116. package/built/types/js/regionParser.d.ts +6 -0
  117. package/built/types/js/resizeUtils.d.ts +23 -0
  118. package/built/types/js/resizeUtils.test.d.ts +1 -0
  119. package/built/types/js/selectors.d.ts +184 -0
  120. package/built/types/js/selectors.test.d.ts +1 -0
  121. package/built/types/js/serialization.test.d.ts +1 -0
  122. package/built/types/js/serializedStates/v1Types.d.ts +64 -0
  123. package/built/types/js/skinParser.d.ts +12 -0
  124. package/built/types/js/skinParserUtils.d.ts +19 -0
  125. package/built/types/js/skinSelectors.d.ts +6 -0
  126. package/built/types/js/skinSprites.d.ts +17 -0
  127. package/built/types/js/snapUtils.d.ts +32 -0
  128. package/built/types/js/snapUtils.test.d.ts +1 -0
  129. package/built/types/js/spinParserUtils.test.d.ts +1 -0
  130. package/built/types/js/store.d.ts +4 -0
  131. package/built/types/js/trackUtils.d.ts +3 -0
  132. package/built/types/js/types.d.ts +734 -0
  133. package/built/types/js/utils.d.ts +71 -0
  134. package/built/types/js/utils.test.d.ts +1 -0
  135. package/built/types/js/webamp.d.ts +6 -0
  136. package/built/types/js/webampLazy.d.ts +156 -0
  137. package/built/types/scripts/postcss-optimize-data-uri-pngs.d.ts +2 -0
  138. package/built/types/scripts/rollupPlugins.d.mts +8 -0
  139. package/built/types/vite.config.d.ts +2 -0
  140. package/built/webamp.bundle.js +43627 -36184
  141. package/built/webamp.bundle.js.map +1 -0
  142. package/built/webamp.bundle.min.js +43 -71
  143. package/built/webamp.bundle.min.js.map +1 -1
  144. package/built/webamp.bundle.min.mjs +44 -0
  145. package/built/webamp.bundle.min.mjs.map +1 -0
  146. package/built/webamp.lazy-bundle.js +14215 -18995
  147. package/built/webamp.lazy-bundle.js.map +1 -0
  148. package/built/webamp.lazy-bundle.min.js +41 -50
  149. package/built/webamp.lazy-bundle.min.js.map +1 -1
  150. package/built/webamp.lazy-bundle.min.mjs +42 -0
  151. package/built/webamp.lazy-bundle.min.mjs.map +1 -0
  152. package/package.json +68 -75
  153. package/CHANGELOG.md +0 -198
  154. package/index.d.ts +0 -277
package/package.json CHANGED
@@ -1,28 +1,45 @@
1
1
  {
2
2
  "name": "webamp",
3
- "version": "1.4.3-beta.5",
3
+ "version": "2.0.0",
4
4
  "description": "Winamp 2 implemented in HTML5 and JavaScript",
5
- "main": "built/webamp.bundle.js",
6
5
  "files": [
7
- "built/webamp.bundle.js",
8
- "built/webamp.bundle.min.js",
9
- "built/webamp.bundle.min.js.map",
10
- "built/webamp.lazy-bundle.js",
11
- "built/webamp.lazy-bundle.min.js",
12
- "built/webamp.lazy-bundle.min.js.map",
13
- "index.d.ts"
6
+ "built",
7
+ "!built/types/demo",
8
+ "!built/*.html",
9
+ "!built/tsBuilt"
14
10
  ],
11
+ "types": "built/types/js/webamp.d.ts",
12
+ "browser": "built/webamp.bundle.min.mjs",
13
+ "browserslist": "> 0.5%, last 2 versions, Firefox ESR, not dead",
14
+ "targets": {
15
+ "demo-site": {
16
+ "source": "demo/index.html"
17
+ }
18
+ },
19
+ "exports": {
20
+ ".": {
21
+ "require": "./built/webamp.bundle.min.js",
22
+ "import": "./built/webamp.bundle.min.mjs",
23
+ "types": "./built/types/js/webamp.d.ts",
24
+ "default": "./built/webamp.bundle.min.mjs"
25
+ },
26
+ "./lazy": {
27
+ "require": "./built/webamp.lazy-bundle.js",
28
+ "import": "./built/webamp.lazy-bundle.min.mjs",
29
+ "types": "./built/types/js/webampLazy.d.ts",
30
+ "default": "./built/webamp.lazy-bundle.min.mjs"
31
+ }
32
+ },
15
33
  "scripts": {
16
34
  "lint-fix": "eslint . --ext ts,tsx,js --fix",
17
35
  "lint": "eslint . --ext ts,tsx,js",
18
36
  "type-check": "tsc",
19
- "build": "webpack --config=demo/config/webpack.prod.js",
20
- "build-library": "webpack --config=config/webpack.library.js",
21
- "prepublishOnly": "npm run build-library",
22
- "serve": "http-server ./demo/built",
23
- "start": "webpack-dev-server --open --config=demo/config/webpack.dev.js",
24
- "stats": "webpack --config=demo/config/webpack.prod.js --json > stats.json",
25
- "stats-library": "webpack --config=config/webpack.library.js --json > stats.json",
37
+ "build": "vite build --emptyOutDir",
38
+ "build-library": "node ./scripts/rollup.mjs",
39
+ "prepublishOnly": "npm run build-library && npm run type-check",
40
+ "publish-next": "yarn publish --new-version=\"0.0.0-next-$(git rev-parse --short HEAD)\" --tag next",
41
+ "serve": "http-server ./dist/demo-site",
42
+ "start": "vite",
26
43
  "test": "jest --config=config/jest.unit.js",
27
44
  "tdd": "jest --config=config/jest.unit.js --watch",
28
45
  "format": "prettier --write \"**/*.{js,ts,tsx,d.ts,css}\"",
@@ -50,78 +67,50 @@
50
67
  },
51
68
  "homepage": "https://github.com/captbaritone/webamp/",
52
69
  "devDependencies": {
53
- "@babel/core": "^7.7.2",
54
- "@babel/node": "^7.0.0",
55
- "@babel/plugin-proposal-class-properties": "^7.0.0",
56
- "@babel/plugin-proposal-nullish-coalescing-operator": "^7.4.4",
57
- "@babel/plugin-proposal-object-rest-spread": "^7.0.0",
58
- "@babel/plugin-proposal-optional-chaining": "^7.6.0",
59
- "@babel/plugin-syntax-dynamic-import": "^7.0.0",
60
- "@babel/plugin-transform-modules-commonjs": "^7.0.0",
61
- "@babel/plugin-transform-runtime": "^7.0.0",
62
- "@babel/polyfill": "^7.7.0",
63
- "@babel/preset-env": "^7.7.1",
64
- "@babel/preset-react": "^7.7.0",
65
- "@babel/preset-typescript": "^7.7.2",
66
- "@babel/runtime": "^7.7.2",
67
- "@sentry/browser": "5.9.1",
70
+ "@parcel/reporter-bundle-analyzer": "^2.8.2",
71
+ "@rollup/plugin-babel": "^6.0.4",
72
+ "@rollup/plugin-commonjs": "^25.0.8",
73
+ "@rollup/plugin-json": "^6.1.0",
74
+ "@rollup/plugin-node-resolve": "^15.2.3",
75
+ "@rollup/plugin-replace": "^5.0.5",
76
+ "@rollup/plugin-terser": "^0.4.4",
77
+ "@rollup/plugin-typescript": "^11.1.6",
68
78
  "@types/classnames": "^2.2.6",
69
- "@types/css-font-loading-module": "^0.0.2",
70
79
  "@types/fscreen": "^1.0.1",
71
80
  "@types/invariant": "^2.2.29",
72
- "@types/jest": "^23.3.2",
81
+ "@types/jest": "^27.0.3",
73
82
  "@types/jszip": "^3.1.5",
74
83
  "@types/lodash": "^4.14.116",
75
84
  "@types/lodash-es": "^4.17.1",
76
- "@types/react": "^16.8.13",
77
- "@types/react-dom": "^16.8.4",
85
+ "@types/react": "^18.0.26",
86
+ "@types/react-dom": "^18.0.10",
78
87
  "@types/react-redux": "^7.1.1",
79
88
  "@types/webaudioapi": "^0.0.27",
80
- "@typescript-eslint/eslint-plugin": "^2.6.1",
81
- "@typescript-eslint/parser": "^2.7.0",
82
- "babel-core": "7.0.0-bridge.0",
83
- "babel-eslint": "^9.0.0-beta.3",
84
- "babel-jest": "^23.4.2",
85
- "babel-loader": "^8.0.4",
86
- "caniuse-lite": "^1.0.30001154",
89
+ "@typescript-eslint/eslint-plugin": "^7.1.0",
90
+ "@typescript-eslint/parser": "^7.1.0",
87
91
  "canvas-mock": "0.0.0",
88
- "copy-webpack-plugin": "^4.6.0",
89
- "css-loader": "^1.0.1",
90
- "cssnano": "^4.1.10",
91
92
  "data-uri-to-buffer": "^2.0.0",
92
- "eslint": "^6.5.1",
93
- "eslint-plugin-import": "^2.18.2",
94
- "eslint-plugin-prettier": "^3.1.0",
95
- "eslint-plugin-react": "^7.16.0",
96
- "eslint-plugin-react-hooks": "^2.1.2",
97
- "file-loader": "^2.0.0",
98
- "git-revision-webpack-plugin": "^3.0.3",
99
93
  "glob": "^7.1.4",
100
- "html-webpack-inline-svg-plugin": "^2.3.0",
101
- "html-webpack-plugin": "^4.5.0",
102
94
  "http-server": "^0.11.1",
103
95
  "imagemin": "^6.1.0",
104
96
  "imagemin-optipng": "^6.0.0",
105
- "jest": "^24.9.0",
97
+ "jest": "^29.7.0",
98
+ "jest-environment-jsdom": "^29.7.0",
106
99
  "jest-image-snapshot": "^2.12.0",
107
- "jest-puppeteer": "^4.4.0",
108
- "postcss": "^8.2.10",
109
- "postcss-loader": "^3.0.0",
110
- "prettier": "^2.3.0",
111
- "puppeteer": "^1.15.0",
100
+ "jest-puppeteer": "^10.0.1",
101
+ "parcel": "^2.8.2",
102
+ "postcss": "^8.4.21",
103
+ "postcss-import": "^16.1.0",
104
+ "puppeteer": "^22.2.0",
112
105
  "react-test-renderer": "^17.0.1",
113
- "redux-devtools-extension": "^2.13.2",
114
- "redux-sentry-middleware": "^0.1.3",
115
- "redux-thunk": "^2.3.0",
106
+ "rollup": "^4.18.0",
107
+ "rollup-plugin-polyfill-node": "^0.13.0",
108
+ "rollup-plugin-postcss": "^4.0.2",
109
+ "rollup-plugin-visualizer": "^5.12.0",
116
110
  "style-loader": "^0.23.1",
117
- "terser-webpack-plugin": "^1.4.3",
118
- "typescript": "^3.7.2",
111
+ "typescript": "^5.3.3",
119
112
  "url-loader": "^1.1.2",
120
- "webpack": "^4.41.2",
121
- "webpack-bundle-analyzer": "^4.3.0",
122
- "webpack-cli": "^3.1.2",
123
- "webpack-dev-server": "^3.8.2",
124
- "webpack-merge": "^4.1.2"
113
+ "vite": "^5.2.12"
125
114
  },
126
115
  "jest": {
127
116
  "globalSetup": "jest-environment-puppeteer/setup",
@@ -134,20 +123,24 @@
134
123
  "trailingComma": "es5"
135
124
  },
136
125
  "dependencies": {
126
+ "@sentry/browser": "5.9.1",
137
127
  "ani-cursor": "^0.0.4",
138
128
  "butterchurn": "^3.0.0-beta.3",
139
129
  "butterchurn-presets": "3.0.0-beta.4",
140
130
  "classnames": "^2.2.5",
141
131
  "fscreen": "^1.0.2",
142
132
  "invariant": "^2.2.3",
143
- "jszip": "^3.1.3",
133
+ "jszip": "^3.10.1",
144
134
  "lodash": "^4.17.21",
145
135
  "milkdrop-preset-converter-aws": "^0.1.6",
146
136
  "music-metadata-browser": "^0.6.1",
147
- "react": "^17.0.1",
148
- "react-dom": "^17.0.1",
149
- "react-redux": "^7.2.2",
150
- "redux": "^4.0.5",
137
+ "react": "^19.1.0",
138
+ "react-dom": "^19.1.0",
139
+ "react-redux": "^8.0.5",
140
+ "redux": "^5.0.0-alpha.0",
141
+ "redux-devtools-extension": "^2.13.9",
142
+ "redux-sentry-middleware": "^0.1.3",
143
+ "redux-thunk": "^2.4.0",
151
144
  "reselect": "^3.0.1",
152
145
  "tinyqueue": "^1.2.3",
153
146
  "winamp-eqf": "^1.0.0"
package/CHANGELOG.md DELETED
@@ -1,198 +0,0 @@
1
- ## NEXT
2
-
3
- ### Features
4
-
5
- - Support `.ani` cursors in skins [#1035](https://github.com/captbaritone/webamp/pull/1035), [blog post](https://jordaneldredge.com/blog/rendering-animated-ani-cursors-in-the-browser/).
6
- - Improved support for mobile/touch screen interaction: volume, balance and position sliders, marquee, playlist and window dragging/resizing/focusing. [#1098](https://github.com/captbaritone/webamp/pull/1098)/[#1099](https://github.com/captbaritone/webamp/pull/1099)
7
-
8
- ### Bug Fixes
9
-
10
- - Fix a number of edge cases where the close and minimize buttons in the equalizer window could render the wrong sprite [#1046](https://github.com/captbaritone/webamp/pull/1046)
11
- - Fix a bug where unminified bundle was accidentally minified.
12
- - Treat skin files with forward slashes in their filename as directories [#1052](https://github.com/captbaritone/webamp/pull/1052)
13
- - Fix a bug where the Milkdrop window could not be moved in some cases [#1068](https://github.com/captbaritone/webamp/pull/1068)
14
- - Fix a bug where the visualizer in the Playlist window was not hidden when audio was stopped. [#1072](https://github.com/captbaritone/webamp/pull/1072)
15
- - Fix a bug where the marquee was one pixel too narrow [#1087](https://github.com/captbaritone/webamp/pull/1087)
16
-
17
- ## 1.4.2
18
-
19
- ### Bug Fixes
20
-
21
- - Add `webamp.close()` method to public TypeScript types.
22
-
23
- ## 1.4.1
24
-
25
- ### Features
26
-
27
- - New Webamp instance method: `.setSkinFromUrl(url)`. See [usage.md](./docs/usage.md) for more details.
28
- - New Webamp instance method: `.close()`. See [usage.md](./docs/usage.md) for more details.
29
-
30
- ### Bug Fixes
31
-
32
- - Fix a bug where skins missing some images would fail to load [2e8392](https://github.com/captbaritone/webamp/commit/2e83920ca1597ad9704f01cc950d59a52c25635c)
33
- - Clicking on the lightning icon in the main window now correctly opens our about page in a new tab [#794](https://github.com/captbaritone/webamp/pull/794)
34
- - Skin `.ini` files can use `=` as a comment separator [577b5e3](https://github.com/captbaritone/webamp/commit/577b5e3c177f2f3ee06f9fbc6aac212adfbbc8c8)
35
- - We nolonger cycle Milkdrop presets when media is not playing [#799](https://github.com/captbaritone/webamp/pull/799)
36
- - Guard against some kinds of malformed `region.txt` files [0bd8b0](https://github.com/captbaritone/webamp/commit/0bd8b09ecff9f00873fc13dcd2a5662bf3efff61)
37
-
38
- ## 1.4.0
39
-
40
- ### Features
41
-
42
- - Added optional configuration option `handleTrackDropEvent` which lets you decide how drop events get converted into tracks.
43
- - New Webamp instance methods: `.stop()`, `.getMediaStatus()`, and `.seekToTime(seconds)`. See [usage.md](./docs/usage.md) for more details.
44
- - Windows are now layered in the order in which they were focused ([5ee1a4](https://github.com/captbaritone/webamp/commit/5ee1a4f7b024d9e667c41d24c961404e463009c4))
45
- - When focusing something other than Webamp, it's now possible for no windows to be selected ([6132ac](https://github.com/captbaritone/webamp/commit/6132acdf2cd42b56bf757fa101fc08203e84fd67))
46
-
47
- ### Bug Fixes:
48
-
49
- - Fix a bug where context menus could appear in the wrong location ([95db2d](https://github.com/captbaritone/webamp/commit/95db2d08b6b189f5b9da577d23aca44b04c462a8))
50
- - Fix a bug where pressing next/previous when stopped would play the track ([#740](https://github.com/captbaritone/webamp/issues/730))
51
- - Fix a bug where `webamp.dispose` would error if the `#webamp` node had been reparented to anything other than `document.body`.
52
- - Fix a bug where tracks dropped in the main window were not autoplayed ([f8167d](https://github.com/captbaritone/webamp/commit/f8167dd32209e1a71958190abc037df79642a2cb))
53
-
54
- ### Internal Improvements:
55
-
56
- - Upgraded [React Redux](https://github.com/reduxjs/react-redux) ([c3c3ad](https://github.com/captbaritone/webamp/commit/c3c3ad69abacdc34b58f3385b39b2634e9271590))
57
- - Several improvements to the performance of rendering Redux updates ([c75214](https://github.com/captbaritone/webamp/commit/c75214dcd7475b27f24c159cda26117a143ff740), [73f87b](https://github.com/captbaritone/webamp/commit/73f87be7c34acf5d0d5227a2a1b0e9718da11875), [4322aa](https://github.com/captbaritone/webamp/commit/4322aade4b5a60926c280e1807c4592cf915b497), [e89aa2](https://github.com/captbaritone/webamp/commit/e89aa266121ba7f890b96351d2da46314b7589e7),)
58
-
59
- ## 1.3.1 [CURRENT]
60
-
61
- ### Bug Fixes:
62
-
63
- - Fix issue where `music-metadata-browser` was not imported correctly, and id3 tags could not be read. ([324fc2](https://github.com/captbaritone/webamp/commit/324fc29ca6c94fa54091608323842ba0604e0b4c))
64
-
65
- ## 1.3.0
66
-
67
- This release is far overdue. In the last six months we've made a huge number of improvements to Webamp.
68
-
69
- We've fixed multiple longstanding bugs and continued to inch closer to pixel-perfect parity with Winamp. We've added several methods which make it easier to use Webamp in your project. In addition, we've continued to invest in the code by refactoring code to make it more maintainable, and converting the entire project from vanilla JavaScript to TypeScript which should help reduce the number of "dumb" bugs.
70
-
71
- See a full list below:
72
-
73
- ### Features:
74
-
75
- - Added methods to the webamp instance to control playback. See the [Usage Docs](./docs/usage.md) for more information:
76
- - `webamp.play()`
77
- - `webamp.pause()`
78
- - `webamp.previousTrack()`
79
- - `webamp.nextTrack()`
80
- - `webamp.seekForward(seconds)`
81
- - `webamp.seekBackward(seconds)`
82
- - Our ID3 parsing library [jsmediatags](https://github.com/aadsm/jsmediatags) has been replaced by [music-metadata-browser](https://www.npmjs.com/package/music-metadata-browser). This means we now support a broader range of media types, and also that the bitrate and sample rate displayed are now functional
83
- - The default skin is now included in the Skins section of the options menu by default
84
- - Implemented the "Options" sub context menu. Click the "O" in the "clutter bar" or select "Options" from the main context menu to see it
85
- - The equlizer graph is nolonger antialiased. It is now pixelated like real Winamp
86
- - Added a `.reopen()` method to reopen Webamp after you've closed it ([47ba520](https://github.com/captbaritone/webamp/commit/47ba520c2422d8e4842468a32ca13492845183cd))
87
- - Stip diacritic marks from song description so it displays better in the marquee ([2b2598](https://github.com/captbaritone/webamp/commit/2b2598329d3891ee8a976b8169066586110a767a))
88
-
89
- ### Bug Fixes:
90
-
91
- - Fixed a longstanding bug where mono audio files would only play in the right channel ([4fd802](https://github.com/captbaritone/webamp/commit/4fd802f96efabb98c3c1573819eed37fec630f90))
92
- - Fixed a bug ([#687](https://github.com/captbaritone/webamp/issues/687)) where `webamp.appendTracks()` would cause currently playing media to pause.
93
- - Avoid sticking a file `<input>` into the global DOM ([343686](https://github.com/captbaritone/webamp/commit/343686f7454c4ece95b520fa3ddbf3ecc0198100))
94
- - Fix a bug where tracks dragged into the playlist were added at the wrong location ([b074e0](https://github.com/captbaritone/webamp/commit/b074e0eff35ac8b1b34efa902681aa19ba2b8629))
95
- - Fix a bug where skin cursors were not being shown for the equalizer sliders ([65bb59d](https://github.com/captbaritone/webamp/commit/65bb59353dc2da858440a3d753aec02fb771f0cc))
96
- - The Marquee text is nolonger blury when in "Double Size" mode ([4b5320](https://github.com/captbaritone/webamp/commit/4b53209e0cc0a9e0cd84821d012c1770a940063c))
97
- - Scrolling in the Equalizer window nolonger changes the volume ([48a937](https://github.com/captbaritone/webamp/commit/48a937da8722ccfd3c2e9df378a847c453c36864))
98
- - Clicking anywhere in a equalizer slider now makes the button depress ([20e681](20e6811e6f59e82a5765c38b0b33fbed2eb575ee)
99
- - Parsing of the `viscolor.txt` file in skins is now more permissive, allowing us to support more skins ([0d29ff](0d29ffe3f4b20505005346cbc97d0cdf85664619))
100
- - The hotkeys to seek forward/backwards 10 tracks now works propery ([7d9ef4](https://github.com/captbaritone/webamp/commit/7d9ef4287f7294f6bdc1db89b717592cf4e48f17))
101
- - Fix a bug where the preamp level was not applied until you changed it ([f03c88](https://github.com/captbaritone/webamp/commit/f03c88c6d89fd51cbc0538841bb3227accfa0431))
102
- - Fix a bug where `.eqf` values were encoded incorrectly ([c634cd](https://github.com/captbaritone/webamp/commit/c634cd8b947e5d2d8b94b38023bc20097737a995))
103
- - Preamp and EQ now boost/attenuate the same way original winamp 2 did ([#748](https://github.com/captbaritone/webamp/pull/748))
104
-
105
- ### Internal Improvements:
106
-
107
- - Webamp is now written in [TypeScript](https://www.typescriptlang.org/).
108
- - Upraded to React and began using a few [hooks](https://reactjs.org/docs/hooks-overview.html).
109
- - We nolonger depend upon [cardinal-spline-js](https://www.npmjs.com/package/cardinal-spline-js), we use our own implementation.
110
-
111
- ## 1.2.0
112
-
113
- ### Features
114
-
115
- - Users can register an `onWillClose` callback, which is passed a `cancel` function. The `cancel` function can be called to prevent Webamp from closing. [#655](https://github.com/captbaritone/webamp/pull/655)
116
-
117
- ### Internal changes
118
-
119
- - Webamp is now mostly built with [TypeScript](https://www.typescriptlang.org/).
120
-
121
- ## 1.1.2
122
-
123
- ### Changes
124
-
125
- Webamp is no-longer rendered into the DOM node you pass into `webamp.renderWhenReady()`. Instead, Webamp is rendred as a direct child of the `<body>` tag. The passed DOM node is still used for positioning. Webamp will attempt to center itself within that DOM node when it renders.
126
-
127
- ### Features
128
-
129
- - Allow consumers to specify a z-index when constructing Webamp.
130
-
131
- ### Fixes
132
-
133
- - Fixes positioning of context menus in context menu targets when they are spawned while scrolled.
134
- - Improve performance of CharacterString, which gets rendered on every marquee step.
135
-
136
- ## 1.1.1
137
-
138
- ### Fixes
139
-
140
- - Fixes the marquee text when the host page globally sets `box-sizing`.
141
- - Fixes the initial layout when the container is not at the top of the page.
142
- - Fixes the positioning of context menus created when scrolled down the page.
143
-
144
- ## 1.1.0
145
-
146
- ### Breaking
147
-
148
- - Webamp will attempt to center itself within the node it is rendered into, rather than within the entire page.
149
- - Webamp now includes the default skin directly in the JS bundle, so you don't need host it separately, or pass a URL as part of the initialztiaon.
150
-
151
- ### Features
152
-
153
- - Equalizer sliders now "stick" slightly at zero.
154
- - Context menus on all windows.
155
- - Toggle window visibility via context menus.
156
- - Users can now hard code the duration of initial tracks. This saves Webamp from having to make an HTTP request to check the duration.
157
-
158
- ### Fixed
159
-
160
- - Marquee now displays one additional character: https://github.com/captbaritone/webamp/issues/543
161
- - Track numbers in playlist are now padded to the length of the longest track number.
162
- - Fix close buttons in Playlist and Equalizer in shade mode.
163
- - Skins that omit assets will now fallback to using the default version of that asset.
164
- - Fix seeking forward via hotkeys.
165
-
166
- ## 1.0.0
167
-
168
- **Important:** The NPM module as **moved** from `winamp2-js` to `webamp`. You will need to update your `package.json` to point to the new module.
169
-
170
- ### Breaking
171
-
172
- - Project renamed from "Winamp2-js" to "Webamp".
173
- - UMD module exports as `window.Webamp` instead of `window.winamp2js`. When used via `<script>` tag.
174
- - Deprecated: The misspelled `Webmap` construction option `avaliableSkins` has been deprecated in favor of `availableSkins`. `avaliableSkins` will continue to work, but will log a deprecation warning. [#533](https://github.com/captbaritone/webamp/pull/533) by [@remigallego](https://github.com/remigallego)
175
-
176
- ### Added
177
-
178
- - Instance method to be notified when Webamp is closed `webamp.onClose(callback)`.
179
- - Instance method to be notified when Webamp is minmized `webamp.onMinimize(callback)`.
180
- - Support for skins that use `.png` sprite sheets instead of `.bmp`. This saves 15kb for the default skin on the demo page. ([b88e87](https://github.com/captbaritone/winamp2-js/commit/b88e87b6584fd9db2e2295addab7bba0c1acd226))
181
- - We now attempt to detect mono audio files. Previously mono files would report as stereo and play only in the left channel.
182
-
183
- ### Fixed
184
-
185
- - Shrink visualizer by one pixel to match Winamp. [#536](https://github.com/captbaritone/winamp2-js/issues/536) by [@The1Freeman](https://github.com/The1Freeman)
186
- - Remove Google Analytics tracking module from NPM module. ([aeb9522](https://github.com/captbaritone/winamp2-js/commit/aeb9522a47ac4032f0f73fe7828c3ef01728d6aa))
187
-
188
- ## 0.0.6
189
-
190
- - Added: `winamp.appendTracks()`.
191
- - Added: `winamp.setTracksToPlay()`.
192
- - Changed: We no-longer try to center on window resize.
193
- - Meta: Added real [documentation](./docs/usage.md)!
194
- - Meta: Remove lots of garbage from the NPM build.
195
-
196
- ## Prehistory
197
-
198
- In all older versions, the API was not stable enough to merit a changelog.
package/index.d.ts DELETED
@@ -1,277 +0,0 @@
1
- interface TrackInfo {
2
- /**
3
- * Name to be used until ID3 tags can be resolved.
4
- *
5
- * If the track has a `url`, and this property is not given,
6
- * the filename will be used instead.
7
- *
8
- * Example: `'My Song'`
9
- */
10
- defaultName?: string;
11
-
12
- /**
13
- * Data to be used _instead_ of trying to fetch ID3 tags.
14
- *
15
- * Example: `{ artist: 'Jordan Eldredge', title: "Jordan's Song" }`
16
- */
17
- metaData?: {
18
- artist: string;
19
- title: string;
20
- album?: string;
21
- };
22
-
23
- /**
24
- * Duration (in seconds) to be used instead of fetching enough of the file to measure its length.
25
- *
26
- * Example: 95
27
- */
28
- duration?: number;
29
- }
30
-
31
- interface URLTrack extends TrackInfo {
32
- /**
33
- * Source URL of the track
34
- *
35
- * Note: This URL must be served the with correct CORs headers.
36
- *
37
- * Example: `'https://example.com/song.mp3'`
38
- */
39
- url: string | URL;
40
- }
41
-
42
- interface BlobTrack extends TrackInfo {
43
- /**
44
- * Blob source of the track
45
- */
46
- blob: Blob;
47
- }
48
-
49
- interface LoadedURLTrack {
50
- url: string;
51
- metaData: {
52
- artist: string | null;
53
- title: string | null;
54
- album: string | null;
55
- albumArtUrl: string | null;
56
- };
57
- }
58
-
59
- /**
60
- * Many methods on the webamp instance deal with track.
61
- *
62
- * Either `url` or `blob` must be specified
63
- */
64
- type Track = URLTrack | BlobTrack;
65
-
66
- interface Options {
67
- /**
68
- * An object representing the initial skin to use.
69
- *
70
- * If omitted, the default skin, included in the bundle, will be used.
71
- * Note: This URL must be served the with correct CORs headers.
72
- *
73
- * Example: `{ url: './path/to/skin.wsz' }`
74
- */
75
- initialSkin?: {
76
- url: string;
77
- };
78
-
79
- /**
80
- * An array of `Track`s to prepopulate the playlist with.
81
- */
82
- initialTracks?: Track[];
83
-
84
- /**
85
- * An array of objects representing available skins.
86
- *
87
- * These will appear in the "Options" menu under "Skins".
88
- * Note: These URLs must be served with the correct CORs headers.
89
- *
90
- * Example: `[ { url: "./green.wsz", name: "Green Dimension V2" } ]`
91
- */
92
- availableSkins?: { url: string; name: string }[];
93
-
94
- /**
95
- * Should global hotkeys be enabled?
96
- *
97
- * Default: `false`
98
- */
99
- enableHotkeys?: boolean;
100
-
101
- /**
102
- * An array of additional file pickers.
103
- *
104
- * These will appear in the "Options" menu under "Play".
105
- *
106
- * In the offical version, this option is used to provide a "Dropbox" file picker.
107
- */
108
- filePickers?: [
109
- {
110
- /**
111
- * The name that will appear in the context menu.
112
- *
113
- * Example: `"My File Picker..."`
114
- */
115
- contextMenuName: string;
116
-
117
- /**
118
- * A function which returns a Promise that resolves to an array of `Track`s
119
- *
120
- * Example: `() => Promise.resolve([{ url: './rick_roll.mp3' }])`
121
- */
122
- filePicker: () => Promise<Track[]>;
123
-
124
- /**
125
- * Indicates if this options should be made available when the user is offline.
126
- */
127
- requiresNetwork: boolean;
128
- }
129
- ];
130
- zIndex?: number;
131
-
132
- handleTrackDropEvent?: (
133
- e: React.DragEvent<HTMLDivElement>
134
- ) => Track[] | null | Promise<Track[] | null>;
135
- }
136
-
137
- export default class Webamp {
138
- constructor(options: Options);
139
-
140
- /**
141
- * Returns a true if the current browser supports the features that Webamp depends upon.
142
- *
143
- * It is recommended to check this before you attempt to instantiate an instance of Winamp.
144
- */
145
- public static browserIsSupported(): boolean;
146
-
147
- /**
148
- * Add an array of `Track`s to the end of the playlist.
149
- */
150
- public appendTracks(tracks: Track[]): void;
151
-
152
- /**
153
- * Replace the playlist with an array of `Track`s and begin playing the first track.
154
- */
155
- public setTracksToPlay(tracks: Track[]): void;
156
-
157
- /**
158
- * Play the previous track
159
- */
160
- public previousTrack(): void;
161
-
162
- /**
163
- * Play the next track
164
- */
165
- public nextTrack(): void;
166
-
167
- /**
168
- * Seek forward n seconds in the curent track
169
- */
170
- public seekForward(seconds: number): void;
171
-
172
- /**
173
- * Seek backward n seconds in the curent track
174
- */
175
- public seekBackward(seconds: number): void;
176
-
177
- /**
178
- * Seek to a given time within the current track
179
- */
180
- public seekToTime(seconds: number): void;
181
-
182
- /**
183
- * Pause the current tack
184
- */
185
- public pause(): void;
186
-
187
- /**
188
- * Play the current tack
189
- */
190
- public play(): void;
191
-
192
- /**
193
- * Stop the currently playing audio. Equivilant to pressing the "stop" button
194
- */
195
- public stop(): void;
196
-
197
- /**
198
- * Webamp will wait until it has fetched the skin and fully parsed it and then render itself.
199
- *
200
- * Webamp is rendered into a new DOM node at the end of the <body> tag with the id `#webamp`.
201
- *
202
- * If a domNode is passed, Webamp will place itself in the center of that DOM node.
203
- *
204
- * @returns A promise is returned which will resolve after the render is complete.
205
- */
206
- public renderWhenReady(domNode: HTMLElement): Promise<void>;
207
-
208
- /**
209
- * A callback which will be called when a new track starts loading.
210
- *
211
- * This can happen on startup when the first track starts buffering, or when a subsequent track starts playing.
212
- * The callback will be called with an object `({url: 'https://example.com/track.mp3'})` containing the URL of the track.
213
- * Note: If the user drags in a track, the URL may be an ObjectURL.
214
- *
215
- * @returns An "unsubscribe" function. Useful if at some point in the future you want to stop listening to these events.
216
- */
217
- public onTrackDidChange(
218
- cb: (trackInfo: LoadedURLTrack | null) => void
219
- ): () => void;
220
-
221
- /**
222
- * Get the current "playing" status.
223
- */
224
- public getMediaStatus(): "PLAYING" | "STOPPED" | "PAUSED";
225
-
226
- /**
227
- * A callback which will be called when Webamp is _about to_ close. Returns an
228
- * "unsubscribe" function. The callback will be passed a `cancel` function
229
- * which you can use to conditionally prevent Webamp from being closed.
230
- *
231
- * @returns An "unsubscribe" function. Useful if at some point in the future you want to stop listening to these events.
232
- */
233
- public onWillClose(cb: (cancel: () => void) => void): () => void;
234
-
235
- /**
236
- * A callback which will be called when Webamp is closed.
237
- *
238
- * @returns An "unsubscribe" function. Useful if at some point in the future you want to stop listening to these events.
239
- */
240
- public onClose(cb: () => void): () => void;
241
-
242
- /**
243
- * Equivalent to selection "Close" from Webamp's options menu. Once closed,
244
- * you can open it again with `.reopen()`.
245
- */
246
- public close(): void;
247
-
248
- /**
249
- * After `.close()`ing this instance, you can reopen it by calling this method.
250
- */
251
- public reopen(): void;
252
-
253
- /**
254
- * A callback which will be called when Webamp is minimized.
255
- *
256
- * @returns An "unsubscribe" function. Useful if at some point in the future you want to stop listening to these events.
257
- */
258
- public onMinimize(callback: () => any): () => void;
259
-
260
- public setSkinFromUrl(url: string): void;
261
-
262
- /**
263
- * Returns a promise that resolves when the skin is done loading.
264
- */
265
- public skinIsLoaded(): Promise<void>;
266
-
267
- /**
268
- * **Note:** _This method is not fully functional. It is currently impossible to
269
- * clean up a Winamp instance. This method makes an effort, but it still leaks
270
- * the whole instance. In the future the behavior of this method will improve,
271
- * so you might as well call it._
272
- *
273
- * When you are done with a Webamp instance, call this method and Webamp will
274
- * attempt to clean itself up to avoid memory leaks.
275
- */
276
- public dispose(): void;
277
- }