grab-url 1.0.4 → 1.0.6
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/dist/grab-api.cjs.js +0 -0
- package/dist/grab-api.cjs.js.map +0 -0
- package/dist/grab-api.d.ts +0 -0
- package/dist/grab-api.es.js +0 -0
- package/dist/grab-api.es.js.map +0 -0
- package/dist/icons.cjs.js +0 -0
- package/dist/icons.cjs.js.map +0 -0
- package/dist/icons.d.ts +251 -0
- package/dist/icons.es.js +0 -0
- package/dist/icons.es.js.map +0 -0
- package/package.json +1 -1
- package/readme.md +0 -0
- package/src/grab-api.ts +0 -0
- package/src/grab-url.js +1 -1
- package/src/icons/cli/spinners.json +0 -0
- package/src/icons/svg/index.ts +0 -0
- package/src/icons/svg/loading-bouncy-ball.svg +0 -0
- package/src/icons/svg/loading-double-ring.svg +0 -0
- package/src/icons/svg/loading-eclipse.svg +0 -0
- package/src/icons/svg/loading-ellipsis.svg +0 -0
- package/src/icons/svg/loading-floating-search.svg +0 -0
- package/src/icons/svg/loading-gears.svg +0 -0
- package/src/icons/svg/loading-infinity.svg +0 -0
- package/src/icons/svg/loading-orbital.svg +0 -0
- package/src/icons/svg/loading-pacman.svg +0 -0
- package/src/icons/svg/loading-pulse-bars.svg +0 -0
- package/src/icons/svg/loading-red-blue-ball.svg +0 -0
- package/src/icons/svg/loading-reload-arrow.svg +0 -0
- package/src/icons/svg/loading-ring.svg +0 -0
- package/src/icons/svg/loading-ripple.svg +0 -0
- package/src/icons/svg/loading-spinner-oval.svg +0 -0
- package/src/icons/svg/loading-spinner.svg +0 -0
- package/src/icons/svg/loading-square-blocks.svg +0 -0
- package/src/log.ts +1 -1
- package/src/icons/index.ts +0 -58
package/dist/grab-api.cjs.js
CHANGED
|
File without changes
|
package/dist/grab-api.cjs.js.map
CHANGED
|
File without changes
|
package/dist/grab-api.d.ts
CHANGED
|
File without changes
|
package/dist/grab-api.es.js
CHANGED
|
File without changes
|
package/dist/grab-api.es.js.map
CHANGED
|
File without changes
|
package/dist/icons.cjs.js
CHANGED
|
File without changes
|
package/dist/icons.cjs.js.map
CHANGED
|
File without changes
|
package/dist/icons.d.ts
CHANGED
|
@@ -1 +1,252 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a customized SVG string for icon loading-bouncy-ball
|
|
3
|
+
*
|
|
4
|
+
* 
|
|
5
|
+
* @param {Object} options - Configuration options
|
|
6
|
+
* @param {string[]} [options.colors] - Array of hex colors to replace existing colors
|
|
7
|
+
* @param {number} [options.width] - Width of the SVG (default: 200)
|
|
8
|
+
* @param {number} [options.height] - Height of the SVG (default: 200)
|
|
9
|
+
* @param {number} [options.size] - Size for both width and height
|
|
10
|
+
* @example loadingBouncyBall({ colors: ['#0099e5', '#ff4c4c'], size: 100 });
|
|
11
|
+
* @returns {string} SVG string with applied customizations
|
|
12
|
+
*/
|
|
13
|
+
export declare const loadingBouncyBall: (options?: LoadingOptions) => string;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Returns a customized SVG string for icon loading-double-ring
|
|
17
|
+
*
|
|
18
|
+
* 
|
|
19
|
+
* @param {Object} options - Configuration options
|
|
20
|
+
* @param {string[]} [options.colors] - Array of hex colors to replace existing colors
|
|
21
|
+
* @param {number} [options.width] - Width of the SVG (default: 200)
|
|
22
|
+
* @param {number} [options.height] - Height of the SVG (default: 200)
|
|
23
|
+
* @param {number} [options.size] - Size for both width and height
|
|
24
|
+
* @example loadingDoubleRing({ colors: ['#0099e5', '#ff4c4c'], size: 100 });
|
|
25
|
+
* @returns {string} SVG string with applied customizations
|
|
26
|
+
*/
|
|
27
|
+
export declare const loadingDoubleRing: (options?: LoadingOptions) => string;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Returns a customized SVG string for icon loading-eclipse
|
|
31
|
+
*
|
|
32
|
+
* 
|
|
33
|
+
* @param {Object} options - Configuration options
|
|
34
|
+
* @param {string[]} [options.colors] - Array of hex colors to replace existing colors
|
|
35
|
+
* @param {number} [options.width] - Width of the SVG (default: 200)
|
|
36
|
+
* @param {number} [options.height] - Height of the SVG (default: 200)
|
|
37
|
+
* @param {number} [options.size] - Size for both width and height
|
|
38
|
+
* @example loadingEclipse({ colors: ['#0099e5', '#ff4c4c'], size: 100 });
|
|
39
|
+
* @returns {string} SVG string with applied customizations
|
|
40
|
+
*/
|
|
41
|
+
export declare const loadingEclipse: (options?: LoadingOptions) => string;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Returns a customized SVG string for icon loading-ellipsis
|
|
45
|
+
*
|
|
46
|
+
* 
|
|
47
|
+
* @param {Object} options - Configuration options
|
|
48
|
+
* @param {string[]} [options.colors] - Array of hex colors to replace existing colors
|
|
49
|
+
* @param {number} [options.width] - Width of the SVG (default: 200)
|
|
50
|
+
* @param {number} [options.height] - Height of the SVG (default: 200)
|
|
51
|
+
* @param {number} [options.size] - Size for both width and height
|
|
52
|
+
* @example loadingEllipsis({ colors: ['#0099e5', '#ff4c4c'], size: 100 });
|
|
53
|
+
* @returns {string} SVG string with applied customizations
|
|
54
|
+
*/
|
|
55
|
+
export declare const loadingEllipsis: (options?: LoadingOptions) => string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Returns a customized SVG string for icon loading-floating-search
|
|
59
|
+
*
|
|
60
|
+
* 
|
|
61
|
+
* @param {Object} options - Configuration options
|
|
62
|
+
* @param {string[]} [options.colors] - Array of hex colors to replace existing colors
|
|
63
|
+
* @param {number} [options.width] - Width of the SVG (default: 339)
|
|
64
|
+
* @param {number} [options.height] - Height of the SVG (default: 339)
|
|
65
|
+
* @param {number} [options.size] - Size for both width and height
|
|
66
|
+
* @example loadingFloatingSearch({ colors: ['#0099e5', '#ff4c4c'], size: 100 });
|
|
67
|
+
* @returns {string} SVG string with applied customizations
|
|
68
|
+
*/
|
|
69
|
+
export declare const loadingFloatingSearch: (options?: LoadingOptions) => string;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Returns a customized SVG string for icon loading-gears
|
|
73
|
+
*
|
|
74
|
+
* 
|
|
75
|
+
* @param {Object} options - Configuration options
|
|
76
|
+
* @param {string[]} [options.colors] - Array of hex colors to replace existing colors
|
|
77
|
+
* @param {number} [options.width] - Width of the SVG (default: 200)
|
|
78
|
+
* @param {number} [options.height] - Height of the SVG (default: 200)
|
|
79
|
+
* @param {number} [options.size] - Size for both width and height
|
|
80
|
+
* @example loadingGears({ colors: ['#0099e5', '#ff4c4c'], size: 100 });
|
|
81
|
+
* @returns {string} SVG string with applied customizations
|
|
82
|
+
*/
|
|
83
|
+
export declare const loadingGears: (options?: LoadingOptions) => string;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Returns a customized SVG string for icon loading-infinity
|
|
87
|
+
*
|
|
88
|
+
* 
|
|
89
|
+
* @param {Object} options - Configuration options
|
|
90
|
+
* @param {string[]} [options.colors] - Array of hex colors to replace existing colors
|
|
91
|
+
* @param {number} [options.width] - Width of the SVG (default: 200)
|
|
92
|
+
* @param {number} [options.height] - Height of the SVG (default: 200)
|
|
93
|
+
* @param {number} [options.size] - Size for both width and height
|
|
94
|
+
* @example loadingInfinity({ colors: ['#0099e5', '#ff4c4c'], size: 100 });
|
|
95
|
+
* @returns {string} SVG string with applied customizations
|
|
96
|
+
*/
|
|
97
|
+
export declare const loadingInfinity: (options?: LoadingOptions) => string;
|
|
98
|
+
|
|
99
|
+
declare interface LoadingOptions {
|
|
100
|
+
/** Array of hex colors to replace existing colors, in order of appearance in SVG*/
|
|
101
|
+
colors?: string[];
|
|
102
|
+
/** Width of the SVG */
|
|
103
|
+
width?: number;
|
|
104
|
+
/** Height of the SVG */
|
|
105
|
+
height?: number;
|
|
106
|
+
/** Size for both width and height (overrides width/height) */
|
|
107
|
+
size?: number;
|
|
108
|
+
/** Whether to return the raw SVG string or an img tag */
|
|
109
|
+
raw?: boolean;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Returns a customized SVG string for icon loading-orbital
|
|
114
|
+
*
|
|
115
|
+
* 
|
|
116
|
+
* @param {Object} options - Configuration options
|
|
117
|
+
* @param {string[]} [options.colors] - Array of hex colors to replace existing colors
|
|
118
|
+
* @param {number} [options.width] - Width of the SVG (default: 200)
|
|
119
|
+
* @param {number} [options.height] - Height of the SVG (default: 200)
|
|
120
|
+
* @param {number} [options.size] - Size for both width and height
|
|
121
|
+
* @example loadingOrbital({ colors: ['#0099e5', '#ff4c4c'], size: 100 });
|
|
122
|
+
* @returns {string} SVG string with applied customizations
|
|
123
|
+
*/
|
|
124
|
+
export declare const loadingOrbital: (options?: LoadingOptions) => string;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Returns a customized SVG string for icon loading-pacman
|
|
128
|
+
*
|
|
129
|
+
* 
|
|
130
|
+
* @param {Object} options - Configuration options
|
|
131
|
+
* @param {string[]} [options.colors] - Array of hex colors to replace existing colors
|
|
132
|
+
* @param {number} [options.width] - Width of the SVG (default: 200)
|
|
133
|
+
* @param {number} [options.height] - Height of the SVG (default: 200)
|
|
134
|
+
* @param {number} [options.size] - Size for both width and height
|
|
135
|
+
* @example loadingPacman({ colors: ['#0099e5', '#ff4c4c'], size: 100 });
|
|
136
|
+
* @returns {string} SVG string with applied customizations
|
|
137
|
+
*/
|
|
138
|
+
export declare const loadingPacman: (options?: LoadingOptions) => string;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Returns a customized SVG string for icon loading-pulse-bars
|
|
142
|
+
*
|
|
143
|
+
* 
|
|
144
|
+
* @param {Object} options - Configuration options
|
|
145
|
+
* @param {string[]} [options.colors] - Array of hex colors to replace existing colors
|
|
146
|
+
* @param {number} [options.width] - Width of the SVG (default: 200)
|
|
147
|
+
* @param {number} [options.height] - Height of the SVG (default: 200)
|
|
148
|
+
* @param {number} [options.size] - Size for both width and height
|
|
149
|
+
* @example loadingPulseBars({ colors: ['#0099e5', '#ff4c4c'], size: 100 });
|
|
150
|
+
* @returns {string} SVG string with applied customizations
|
|
151
|
+
*/
|
|
152
|
+
export declare const loadingPulseBars: (options?: LoadingOptions) => string;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Returns a customized SVG string for icon loading-red-blue-ball
|
|
156
|
+
*
|
|
157
|
+
* 
|
|
158
|
+
* @param {Object} options - Configuration options
|
|
159
|
+
* @param {string[]} [options.colors] - Array of hex colors to replace existing colors
|
|
160
|
+
* @param {number} [options.width] - Width of the SVG (default: 200)
|
|
161
|
+
* @param {number} [options.height] - Height of the SVG (default: 200)
|
|
162
|
+
* @param {number} [options.size] - Size for both width and height
|
|
163
|
+
* @example loadingRedBlueBall({ colors: ['#0099e5', '#ff4c4c'], size: 100 });
|
|
164
|
+
* @returns {string} SVG string with applied customizations
|
|
165
|
+
*/
|
|
166
|
+
export declare const loadingRedBlueBall: (options?: LoadingOptions) => string;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Returns a customized SVG string for icon loading-reload-arrow
|
|
170
|
+
*
|
|
171
|
+
* 
|
|
172
|
+
* @param {Object} options - Configuration options
|
|
173
|
+
* @param {string[]} [options.colors] - Array of hex colors to replace existing colors
|
|
174
|
+
* @param {number} [options.width] - Width of the SVG (default: 200)
|
|
175
|
+
* @param {number} [options.height] - Height of the SVG (default: 200)
|
|
176
|
+
* @param {number} [options.size] - Size for both width and height
|
|
177
|
+
* @example loadingReloadArrow({ colors: ['#0099e5', '#ff4c4c'], size: 100 });
|
|
178
|
+
* @returns {string} SVG string with applied customizations
|
|
179
|
+
*/
|
|
180
|
+
export declare const loadingReloadArrow: (options?: LoadingOptions) => string;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Returns a customized SVG string for icon loading-ring
|
|
184
|
+
*
|
|
185
|
+
* 
|
|
186
|
+
* @param {Object} options - Configuration options
|
|
187
|
+
* @param {string[]} [options.colors] - Array of hex colors to replace existing colors
|
|
188
|
+
* @param {number} [options.width] - Width of the SVG (default: 200)
|
|
189
|
+
* @param {number} [options.height] - Height of the SVG (default: 200)
|
|
190
|
+
* @param {number} [options.size] - Size for both width and height
|
|
191
|
+
* @example loadingRing({ colors: ['#0099e5', '#ff4c4c'], size: 100 });
|
|
192
|
+
* @returns {string} SVG string with applied customizations
|
|
193
|
+
*/
|
|
194
|
+
export declare const loadingRing: (options?: LoadingOptions) => string;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Returns a customized SVG string for icon loading-ripple
|
|
198
|
+
*
|
|
199
|
+
* 
|
|
200
|
+
* @param {Object} options - Configuration options
|
|
201
|
+
* @param {string[]} [options.colors] - Array of hex colors to replace existing colors
|
|
202
|
+
* @param {number} [options.width] - Width of the SVG (default: 200)
|
|
203
|
+
* @param {number} [options.height] - Height of the SVG (default: 200)
|
|
204
|
+
* @param {number} [options.size] - Size for both width and height
|
|
205
|
+
* @example loadingRipple({ colors: ['#0099e5', '#ff4c4c'], size: 100 });
|
|
206
|
+
* @returns {string} SVG string with applied customizations
|
|
207
|
+
*/
|
|
208
|
+
export declare const loadingRipple: (options?: LoadingOptions) => string;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Returns a customized SVG string for icon loading-spinner
|
|
212
|
+
*
|
|
213
|
+
* 
|
|
214
|
+
* @param {Object} options - Configuration options
|
|
215
|
+
* @param {string[]} [options.colors] - Array of hex colors to replace existing colors
|
|
216
|
+
* @param {number} [options.width] - Width of the SVG (default: 200)
|
|
217
|
+
* @param {number} [options.height] - Height of the SVG (default: 200)
|
|
218
|
+
* @param {number} [options.size] - Size for both width and height
|
|
219
|
+
* @example loadingSpinner({ colors: ['#0099e5', '#ff4c4c'], size: 100 });
|
|
220
|
+
* @returns {string} SVG string with applied customizations
|
|
221
|
+
*/
|
|
222
|
+
export declare const loadingSpinner: (options?: LoadingOptions) => string;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Returns a customized SVG string for icon loading-spinner-oval
|
|
226
|
+
*
|
|
227
|
+
* 
|
|
228
|
+
* @param {Object} options - Configuration options
|
|
229
|
+
* @param {string[]} [options.colors] - Array of hex colors to replace existing colors
|
|
230
|
+
* @param {number} [options.width] - Width of the SVG (default: 200)
|
|
231
|
+
* @param {number} [options.height] - Height of the SVG (default: 200)
|
|
232
|
+
* @param {number} [options.size] - Size for both width and height
|
|
233
|
+
* @example loadingSpinnerOval({ colors: ['#0099e5', '#ff4c4c'], size: 100 });
|
|
234
|
+
* @returns {string} SVG string with applied customizations
|
|
235
|
+
*/
|
|
236
|
+
export declare const loadingSpinnerOval: (options?: LoadingOptions) => string;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Returns a customized SVG string for icon loading-square-blocks
|
|
240
|
+
*
|
|
241
|
+
* 
|
|
242
|
+
* @param {Object} options - Configuration options
|
|
243
|
+
* @param {string[]} [options.colors] - Array of hex colors to replace existing colors
|
|
244
|
+
* @param {number} [options.width] - Width of the SVG (default: 200)
|
|
245
|
+
* @param {number} [options.height] - Height of the SVG (default: 200)
|
|
246
|
+
* @param {number} [options.size] - Size for both width and height
|
|
247
|
+
* @example loadingSquareBlocks({ colors: ['#0099e5', '#ff4c4c'], size: 100 });
|
|
248
|
+
* @returns {string} SVG string with applied customizations
|
|
249
|
+
*/
|
|
250
|
+
export declare const loadingSquareBlocks: (options?: LoadingOptions) => string;
|
|
251
|
+
|
|
1
252
|
export { }
|
package/dist/icons.es.js
CHANGED
|
File without changes
|
package/dist/icons.es.js.map
CHANGED
|
File without changes
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
File without changes
|
package/src/grab-api.ts
CHANGED
|
File without changes
|
package/src/grab-url.js
CHANGED
|
@@ -8,7 +8,7 @@ import cliProgress from 'cli-progress';
|
|
|
8
8
|
import chalk from 'chalk';
|
|
9
9
|
import ora from 'ora';
|
|
10
10
|
import Table from 'cli-table3';
|
|
11
|
-
import grab, { log } from '
|
|
11
|
+
import grab, { log } from '../dist/grab-api.es.js';
|
|
12
12
|
import readline from 'readline';
|
|
13
13
|
import { readFileSync } from 'fs';
|
|
14
14
|
import { fileURLToPath, pathToFileURL } from 'url';
|
|
File without changes
|
package/src/icons/svg/index.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/log.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
export function log(message: string|object = "", options: LogOptions = {}) {
|
|
14
14
|
let {
|
|
15
15
|
color = null,
|
|
16
|
-
style = "color:
|
|
16
|
+
style = "color: #66ccff; font-size: 10pt;",
|
|
17
17
|
hideInProduction = undefined,
|
|
18
18
|
startSpinner = false,
|
|
19
19
|
stopSpinner = false,
|
package/src/icons/index.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
// Do a Barrel Roll (auto-generated) index of SVG icons as JS exports, tree shaking to only the icons used.
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Shared utility function for processing SVG icons
|
|
5
|
-
* @param {Object} options - Configuration options
|
|
6
|
-
* @param {boolean} [options.raw] - Whether to return the raw SVG string or an img tag
|
|
7
|
-
* @param {string[]} [options.colors] - Array of hex colors to replace existing colors
|
|
8
|
-
* @param {number|string} [options.width] - Width of the SVG
|
|
9
|
-
* @param {number|string} [options.height] - Height of the SVG
|
|
10
|
-
* @param {number|string} [options.size] - Size for both width and height (overrides width/height)
|
|
11
|
-
* @param {string} svgString - The original SVG content
|
|
12
|
-
* @returns {string} SVG string with applied customizations
|
|
13
|
-
*/
|
|
14
|
-
function customSVG( options: LoadingOptions, svgString: string) {
|
|
15
|
-
const { colors = [], width, height, size, raw = false } = options;
|
|
16
|
-
|
|
17
|
-
const widthMatch = svgString.match(/width="[^"]*"/);
|
|
18
|
-
const heightMatch = svgString.match(/height="[^"]*"/);
|
|
19
|
-
const finalWidth = size || width || widthMatch?.[1] || '100';
|
|
20
|
-
const finalHeight = size || height || heightMatch?.[1] || '100';
|
|
21
|
-
|
|
22
|
-
if (width || height || size) {
|
|
23
|
-
svgString = svgString.replace(/width="[^"]*"/, `width="${finalWidth}px"`);
|
|
24
|
-
svgString = svgString.replace(/height="[^"]*"/, `height="${finalHeight}px"`);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
// If colors array is provided, replace hex colors in order of appearance
|
|
29
|
-
if (colors && colors.length > 0) {
|
|
30
|
-
const hexColorRegex = /#[0-9a-fA-F]{6}|#[0-9a-fA-F]{3}/g;
|
|
31
|
-
let colorIndex = 0;
|
|
32
|
-
|
|
33
|
-
svgString = svgString.replace(hexColorRegex, (match) => {
|
|
34
|
-
if (colorIndex < colors.length) {
|
|
35
|
-
const replacement = colors[colorIndex];
|
|
36
|
-
colorIndex++;
|
|
37
|
-
return replacement?.startsWith('#') ? replacement : `#${replacement}`;
|
|
38
|
-
}
|
|
39
|
-
return match; // Keep original color if no replacement available
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
if (!raw)
|
|
43
|
-
svgString = (width || height || size ? `<img width="${finalWidth}" height="${finalHeight}"` : '<img') + ` alt="icon" src="data:image/svg+xml;utf8,${encodeURIComponent(svgString)}" />`
|
|
44
|
-
|
|
45
|
-
return svgString;
|
|
46
|
-
}
|
|
47
|
-
interface LoadingOptions {
|
|
48
|
-
/** Array of hex colors to replace existing colors, in order of appearance in SVG*/
|
|
49
|
-
colors?: string[];
|
|
50
|
-
/** Width of the SVG */
|
|
51
|
-
width?: number;
|
|
52
|
-
/** Height of the SVG */
|
|
53
|
-
height?: number;
|
|
54
|
-
/** Size for both width and height (overrides width/height) */
|
|
55
|
-
size?: number;
|
|
56
|
-
/** Whether to return the raw SVG string or an img tag */
|
|
57
|
-
raw?: boolean;
|
|
58
|
-
}
|