tiny-essentials 1.28.9 → 1.28.10
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.
- package/changelog/1/28/10.md +5 -0
- package/dist/v1/TinyDragger.min.js +1 -1
- package/dist/v1/TinyEssentials.min.js +1 -1
- package/dist/v1/TinyHtml.min.js +1 -1
- package/dist/v1/TinyMediaPlayer.min.js +1 -1
- package/dist/v1/TinySmartScroller.min.js +1 -1
- package/dist/v1/TinyUploadClicker.min.js +1 -1
- package/dist/v1/libs/TinyHtml.cjs +0 -10
- package/dist/v1/libs/TinyHtml.d.mts +0 -7
- package/dist/v1/libs/TinyHtml.mjs +0 -9
- package/dist/v1/libs/TinyMediaPlayer/index.cjs +13 -0
- package/dist/v1/libs/TinyMediaPlayer/index.d.mts +7 -0
- package/dist/v1/libs/TinyMediaPlayer/index.mjs +12 -0
- package/docs/v1/libs/TinyMediaPlayer.md +3 -2
- package/package.json +1 -1
|
@@ -1042,16 +1042,6 @@ class TinyHtml {
|
|
|
1042
1042
|
return true;
|
|
1043
1043
|
}
|
|
1044
1044
|
|
|
1045
|
-
/**
|
|
1046
|
-
* @deprecated Use the getter {@link elements} instead.
|
|
1047
|
-
* Returns the current targets held by this instance.
|
|
1048
|
-
*
|
|
1049
|
-
* @returns {ConstructorElValues[]} - The instance's targets element.
|
|
1050
|
-
*/
|
|
1051
|
-
getAll() {
|
|
1052
|
-
return [...this.#el];
|
|
1053
|
-
}
|
|
1054
|
-
|
|
1055
1045
|
////////////////////////////////////////////////
|
|
1056
1046
|
|
|
1057
1047
|
// TITLE: Element Getter (Private) (Pt1)
|
|
@@ -463,13 +463,6 @@ declare class TinyHtml<TinyHtmlT extends TinyHtmlConstructor> {
|
|
|
463
463
|
* @returns {boolean} - True if the element exists; otherwise, false.
|
|
464
464
|
*/
|
|
465
465
|
exists(index: number): boolean;
|
|
466
|
-
/**
|
|
467
|
-
* @deprecated Use the getter {@link elements} instead.
|
|
468
|
-
* Returns the current targets held by this instance.
|
|
469
|
-
*
|
|
470
|
-
* @returns {ConstructorElValues[]} - The instance's targets element.
|
|
471
|
-
*/
|
|
472
|
-
getAll(): ConstructorElValues[];
|
|
473
466
|
/**
|
|
474
467
|
* Returns the current Element held by this instance.
|
|
475
468
|
*
|
|
@@ -909,15 +909,6 @@ class TinyHtml {
|
|
|
909
909
|
return false;
|
|
910
910
|
return true;
|
|
911
911
|
}
|
|
912
|
-
/**
|
|
913
|
-
* @deprecated Use the getter {@link elements} instead.
|
|
914
|
-
* Returns the current targets held by this instance.
|
|
915
|
-
*
|
|
916
|
-
* @returns {ConstructorElValues[]} - The instance's targets element.
|
|
917
|
-
*/
|
|
918
|
-
getAll() {
|
|
919
|
-
return [...this.#el];
|
|
920
|
-
}
|
|
921
912
|
////////////////////////////////////////////////
|
|
922
913
|
// TITLE: Element Getter (Private) (Pt1)
|
|
923
914
|
/**
|
|
@@ -52,6 +52,19 @@ class BaseMediaAdapter extends events.EventEmitter {
|
|
|
52
52
|
return this.#destroyed;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
/**
|
|
56
|
+
* Returns the thumbnail URL for the currently loaded track.
|
|
57
|
+
* @param {string} trackId - The SoundCloud track ID.
|
|
58
|
+
* @returns {string} The thumbnail URL.
|
|
59
|
+
* @throws {TypeError} If the trackId is not a valid string.
|
|
60
|
+
*/
|
|
61
|
+
static getThumbnailUrl(trackId) {
|
|
62
|
+
if (typeof trackId !== 'string' || trackId.trim() === '') {
|
|
63
|
+
throw new TypeError('The "trackId" must be a non-empty string.');
|
|
64
|
+
}
|
|
65
|
+
return ``;
|
|
66
|
+
}
|
|
67
|
+
|
|
55
68
|
/**
|
|
56
69
|
* Determines if this adapter can play the provided content.
|
|
57
70
|
* @param {MediaContent} content - The media content to evaluate.
|
|
@@ -66,6 +66,13 @@ declare class BaseMediaAdapter extends EventEmitter {
|
|
|
66
66
|
#private;
|
|
67
67
|
constructor();
|
|
68
68
|
get destroyed(): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Returns the thumbnail URL for the currently loaded track.
|
|
71
|
+
* @param {string} trackId - The SoundCloud track ID.
|
|
72
|
+
* @returns {string} The thumbnail URL.
|
|
73
|
+
* @throws {TypeError} If the trackId is not a valid string.
|
|
74
|
+
*/
|
|
75
|
+
static getThumbnailUrl(trackId: string): string;
|
|
69
76
|
/**
|
|
70
77
|
* Determines if this adapter can play the provided content.
|
|
71
78
|
* @param {MediaContent} content - The media content to evaluate.
|
|
@@ -42,6 +42,18 @@ class BaseMediaAdapter extends EventEmitter {
|
|
|
42
42
|
get destroyed() {
|
|
43
43
|
return this.#destroyed;
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Returns the thumbnail URL for the currently loaded track.
|
|
47
|
+
* @param {string} trackId - The SoundCloud track ID.
|
|
48
|
+
* @returns {string} The thumbnail URL.
|
|
49
|
+
* @throws {TypeError} If the trackId is not a valid string.
|
|
50
|
+
*/
|
|
51
|
+
static getThumbnailUrl(trackId) {
|
|
52
|
+
if (typeof trackId !== 'string' || trackId.trim() === '') {
|
|
53
|
+
throw new TypeError('The "trackId" must be a non-empty string.');
|
|
54
|
+
}
|
|
55
|
+
return ``;
|
|
56
|
+
}
|
|
45
57
|
/**
|
|
46
58
|
* Determines if this adapter can play the provided content.
|
|
47
59
|
* @param {MediaContent} content - The media content to evaluate.
|
|
@@ -14,6 +14,7 @@ To support different media platforms, `TinyMediaPlayer` relies on **Adapters**.
|
|
|
14
14
|
#### Methods
|
|
15
15
|
| Method | Description | Parameters | Returns |
|
|
16
16
|
| :--- | :--- | :--- | :--- |
|
|
17
|
+
| `static getThumbnailUrl` | Returns the thumbnail URL for the provided track ID. Throws `TypeError` if `trackId` is invalid. | `trackId: string` | `string` |
|
|
17
18
|
| `static canHandle` | Determines if the adapter can play the provided content. | `content: MediaContent` | `boolean` |
|
|
18
19
|
| `canHandle` | Determines if the adapter can play the provided content. | `content: MediaContent` | `boolean` |
|
|
19
20
|
| `isReady` | Synchronously checks if the adapter is ready. | None | `boolean` |
|
|
@@ -231,7 +232,7 @@ When initializing `new TinyMediaPlayer(options)`, you can pass the following `Ti
|
|
|
231
232
|
* **`registerAdapter(adapter)`**: Registers a new provider.
|
|
232
233
|
* `adapter`: An instance of a class extending `BaseMediaAdapter`.
|
|
233
234
|
* **`removeAdapter(adapter)`**: Removes a specific registered adapter.
|
|
234
|
-
* **`destroyAdapter(adapter)`**: Destroys and removes a specific registered adapter.
|
|
235
|
+
* **`destroyAdapter(adapter)`**: Destroys and removes a specific registered media adapter.
|
|
235
236
|
* **`hasAdapter(adapter)`**: Checks if a specific adapter is registered.
|
|
236
237
|
* **`clearAdapters()`**: Clears the list of adapters (does not call `destroy` on them).
|
|
237
238
|
* **`destroyAllAdapters()`**: Destroys and removes all registered media adapters.
|
|
@@ -254,7 +255,7 @@ When initializing `new TinyMediaPlayer(options)`, you can pass the following `Ti
|
|
|
254
255
|
* **`removeTrack(index)`**: **(Async)** Removes a track and adjusts the current index/playback accordingly.
|
|
255
256
|
* **`searchTrack(query)`**: Searches the playlist (string or function).
|
|
256
257
|
* `query`: A `string` (searches title, artist, or album) or a `function` (custom logic).
|
|
257
|
-
*
|
|
258
|
+
* `Returns`: `SearchResult[]` (array of objects containing the track and their corresponding indices).
|
|
258
259
|
* **`clearPlaylist()`**: **(Async)** Stops playback and empties the entire playlist.
|
|
259
260
|
|
|
260
261
|
#### ⏯️ Playback Controls
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tiny-essentials",
|
|
3
|
-
"version": "1.28.
|
|
3
|
+
"version": "1.28.10",
|
|
4
4
|
"description": "Collection of small, essential scripts designed to be used across various projects. These simple utilities are crafted for speed, ease of use, and versatility.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"tiny-essentials-fork": "./TinyFork.mjs"
|