@wokki20/jspt 2.0.3 → 2.0.4
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/README.md +32 -25
- package/dist/jspt.d.ts +49 -49
- package/dist/jspt.js +626 -626
- package/dist/jspt.min.js +1 -1
- package/dist/jspt.module.js +611 -611
- package/package.json +1 -1
- package/src/jspt.d.ts +49 -49
- package/src/jspt.js +626 -626
- package/src/jspt.module.js +611 -611
package/README.md
CHANGED
|
@@ -15,9 +15,9 @@ Get started in seconds with our CDN:
|
|
|
15
15
|
<html>
|
|
16
16
|
<head>
|
|
17
17
|
<!-- JSPT CSS -->
|
|
18
|
-
<link rel="stylesheet" href="https://cdn.wokki20.nl/content/jspt-v2.0.
|
|
18
|
+
<link rel="stylesheet" href="https://cdn.wokki20.nl/content/jspt-v2.0.4/jspt.css">
|
|
19
19
|
<!-- JSPT JavaScript -->
|
|
20
|
-
<script src="https://cdn.wokki20.nl/content/jspt-v2.0.
|
|
20
|
+
<script src="https://cdn.wokki20.nl/content/jspt-v2.0.4/jspt.min.js"></script>
|
|
21
21
|
</head>
|
|
22
22
|
<body>
|
|
23
23
|
<script>
|
|
@@ -74,10 +74,10 @@ See [FOLDER_STRUCTURE.md](FOLDER_STRUCTURE.md) for detailed information.
|
|
|
74
74
|
#### Production (Pinned Version - Stable)
|
|
75
75
|
```html
|
|
76
76
|
<!-- CSS -->
|
|
77
|
-
<link rel="stylesheet" href="https://cdn.wokki20.nl/content/jspt-v2.0.
|
|
77
|
+
<link rel="stylesheet" href="https://cdn.wokki20.nl/content/jspt-v2.0.4/jspt.css">
|
|
78
78
|
|
|
79
79
|
<!-- JavaScript (minified) -->
|
|
80
|
-
<script src="https://cdn.wokki20.nl/content/jspt-v2.0.
|
|
80
|
+
<script src="https://cdn.wokki20.nl/content/jspt-v2.0.4/jspt.min.js"></script>
|
|
81
81
|
|
|
82
82
|
<!-- Usage -->
|
|
83
83
|
<script>
|
|
@@ -96,10 +96,10 @@ jspt.makeToast({
|
|
|
96
96
|
|
|
97
97
|
#### ES Module from CDN
|
|
98
98
|
```html
|
|
99
|
-
<link rel="stylesheet" href="https://cdn.wokki20.nl/content/jspt-v2.0.
|
|
99
|
+
<link rel="stylesheet" href="https://cdn.wokki20.nl/content/jspt-v2.0.4/jspt.css">
|
|
100
100
|
|
|
101
101
|
<script type="module">
|
|
102
|
-
import { makeToast, makePopup } from 'https://cdn.wokki20.nl/content/jspt-v2.0.
|
|
102
|
+
import { makeToast, makePopup } from 'https://cdn.wokki20.nl/content/jspt-v2.0.4/jspt.module.js';
|
|
103
103
|
|
|
104
104
|
makeToast({ message: "ES Module from CDN!" });
|
|
105
105
|
</script>
|
|
@@ -134,6 +134,12 @@ makeToast({
|
|
|
134
134
|
});
|
|
135
135
|
```
|
|
136
136
|
|
|
137
|
+
### Option 3: NPM Package
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
npm install @wokki20/jspt
|
|
141
|
+
```
|
|
142
|
+
|
|
137
143
|
## CDN Usage
|
|
138
144
|
|
|
139
145
|
JSPT is hosted on `https://cdn.wokki20.nl` with two delivery methods:
|
|
@@ -143,20 +149,20 @@ JSPT is hosted on `https://cdn.wokki20.nl` with two delivery methods:
|
|
|
143
149
|
Use specific versions for stability and caching:
|
|
144
150
|
|
|
145
151
|
```html
|
|
146
|
-
<!-- v2.0.
|
|
147
|
-
<script src="https://cdn.wokki20.nl/content/jspt-v2.0.
|
|
152
|
+
<!-- v2.0.4 - Minified (10KB) -->
|
|
153
|
+
<script src="https://cdn.wokki20.nl/content/jspt-v2.0.4/jspt.min.js"></script>
|
|
148
154
|
|
|
149
|
-
<!-- v2.0.
|
|
150
|
-
<script src="https://cdn.wokki20.nl/content/jspt-v2.0.
|
|
155
|
+
<!-- v2.0.4 - Full with JSDoc (24KB) -->
|
|
156
|
+
<script src="https://cdn.wokki20.nl/content/jspt-v2.0.4/jspt.js"></script>
|
|
151
157
|
|
|
152
|
-
<!-- v2.0.
|
|
153
|
-
<script type="module" src="https://cdn.wokki20.nl/content/jspt-v2.0.
|
|
158
|
+
<!-- v2.0.4 - ES Module (21KB) -->
|
|
159
|
+
<script type="module" src="https://cdn.wokki20.nl/content/jspt-v2.0.4/jspt.module.js"></script>
|
|
154
160
|
|
|
155
161
|
<!-- CSS -->
|
|
156
|
-
<link rel="stylesheet" href="https://cdn.wokki20.nl/content/jspt-v2.0.
|
|
162
|
+
<link rel="stylesheet" href="https://cdn.wokki20.nl/content/jspt-v2.0.4/jspt.css">
|
|
157
163
|
|
|
158
164
|
<!-- TypeScript Definitions -->
|
|
159
|
-
/// <reference path="https://cdn.wokki20.nl/content/jspt-v2.0.
|
|
165
|
+
/// <reference path="https://cdn.wokki20.nl/content/jspt-v2.0.4/jspt.d.ts" />
|
|
160
166
|
```
|
|
161
167
|
|
|
162
168
|
✅ **Benefits:**
|
|
@@ -196,11 +202,11 @@ Always get the newest version automatically:
|
|
|
196
202
|
|
|
197
203
|
| Use Case | Recommended URL |
|
|
198
204
|
|----------|----------------|
|
|
199
|
-
| Production website | `content/jspt-v2.0.
|
|
205
|
+
| Production website | `content/jspt-v2.0.4/jspt.min.js` (versioned) |
|
|
200
206
|
| Testing/Development | `dynamic/jspt/jspt.js` (dynamic) |
|
|
201
|
-
| Maximum performance | `content/jspt-v2.0.
|
|
202
|
-
| ES6 Projects | `content/jspt-v2.0.
|
|
203
|
-
| TypeScript Projects | `content/jspt-v2.0.
|
|
207
|
+
| Maximum performance | `content/jspt-v2.0.4/jspt.min.js` (minified + cached) |
|
|
208
|
+
| ES6 Projects | `content/jspt-v2.0.4/jspt.module.js` (versioned module) |
|
|
209
|
+
| TypeScript Projects | `content/jspt-v2.0.4/jspt.d.ts` (type definitions) |
|
|
204
210
|
|
|
205
211
|
## Usage
|
|
206
212
|
|
|
@@ -373,8 +379,8 @@ The TypeScript definitions are automatically picked up when you import the modul
|
|
|
373
379
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded">
|
|
374
380
|
|
|
375
381
|
<!-- JSPT from CDN -->
|
|
376
|
-
<link rel="stylesheet" href="https://cdn.wokki20.nl/content/jspt-v2.0.
|
|
377
|
-
<script src="https://cdn.wokki20.nl/content/jspt-v2.0.
|
|
382
|
+
<link rel="stylesheet" href="https://cdn.wokki20.nl/content/jspt-v2.0.4/jspt.css">
|
|
383
|
+
<script src="https://cdn.wokki20.nl/content/jspt-v2.0.4/jspt.min.js"></script>
|
|
378
384
|
</head>
|
|
379
385
|
<body>
|
|
380
386
|
<h1>JSPT Example</h1>
|
|
@@ -452,14 +458,14 @@ See `examples/example-script.html` for a full working example.
|
|
|
452
458
|
<!DOCTYPE html>
|
|
453
459
|
<html>
|
|
454
460
|
<head>
|
|
455
|
-
<link rel="stylesheet" href="https://cdn.wokki20.nl/content/jspt-v2.0.
|
|
461
|
+
<link rel="stylesheet" href="https://cdn.wokki20.nl/content/jspt-v2.0.4/jspt.css">
|
|
456
462
|
</head>
|
|
457
463
|
<body>
|
|
458
464
|
<button id="myButton">Show Toast</button>
|
|
459
465
|
<button id="errorButton">Show Error</button>
|
|
460
466
|
|
|
461
467
|
<script type="module">
|
|
462
|
-
import { makeToast } from 'https://cdn.wokki20.nl/content/jspt-v2.0.
|
|
468
|
+
import { makeToast } from 'https://cdn.wokki20.nl/content/jspt-v2.0.4/jspt.module.js';
|
|
463
469
|
|
|
464
470
|
document.getElementById('myButton').addEventListener('click', () => {
|
|
465
471
|
makeToast({
|
|
@@ -529,8 +535,8 @@ The library uses CSS custom properties for easy customization. You can override
|
|
|
529
535
|
- ✅ **Pin to specific version** - Avoid unexpected breaking changes
|
|
530
536
|
- ✅ **Preload for faster loading:**
|
|
531
537
|
```html
|
|
532
|
-
<link rel="preload" href="https://cdn.wokki20.nl/content/jspt-v2.0.
|
|
533
|
-
<link rel="preload" href="https://cdn.wokki20.nl/content/jspt-v2.0.
|
|
538
|
+
<link rel="preload" href="https://cdn.wokki20.nl/content/jspt-v2.0.4/jspt.min.js" as="script">
|
|
539
|
+
<link rel="preload" href="https://cdn.wokki20.nl/content/jspt-v2.0.4/jspt.css" as="style">
|
|
534
540
|
```
|
|
535
541
|
|
|
536
542
|
### File Sizes
|
|
@@ -583,4 +589,5 @@ MIT - See [LICENSE](LICENSE) file for details.
|
|
|
583
589
|
- [API Reference](#api-reference)
|
|
584
590
|
- [Examples](#examples)
|
|
585
591
|
- [Contributing Guide](CONTRIBUTING.md)
|
|
586
|
-
- [Changelog](CHANGELOG.md)
|
|
592
|
+
- [Changelog](CHANGELOG.md)
|
|
593
|
+
|
package/dist/jspt.d.ts
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
export interface PopupOptions {
|
|
2
|
-
style?: 'default';
|
|
3
|
-
content_type?: 'text' | 'html';
|
|
4
|
-
header?: string;
|
|
5
|
-
title?: string;
|
|
6
|
-
message?: string;
|
|
7
|
-
content?: string;
|
|
8
|
-
close_on_blur?: boolean;
|
|
9
|
-
custom_id?: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface ToastOptions {
|
|
13
|
-
style?: 'default' | 'default-error' | string;
|
|
14
|
-
message: string;
|
|
15
|
-
custom_id?: string;
|
|
16
|
-
icon_left?: string;
|
|
17
|
-
icon_left_type?: 'google_material_rounded' | 'google_material_outlined' | 'svg' | 'image' | 'text' | 'emoji';
|
|
18
|
-
icon_left_action?: () => void;
|
|
19
|
-
icon_right?: string;
|
|
20
|
-
icon_right_type?: 'google_material_rounded' | 'google_material_outlined' | 'svg' | 'image' | 'text' | 'emoji';
|
|
21
|
-
icon_right_action?: () => void;
|
|
22
|
-
duration?: number;
|
|
23
|
-
close_on_click?: boolean;
|
|
24
|
-
onclick?: () => void;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface ClosePopupOptions {
|
|
28
|
-
custom_id: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function makePopup(options: PopupOptions): void;
|
|
32
|
-
|
|
33
|
-
export function makeToast(options: ToastOptions): void;
|
|
34
|
-
|
|
35
|
-
export function closePopup(options: ClosePopupOptions): void;
|
|
36
|
-
|
|
37
|
-
declare const jspt: {
|
|
38
|
-
makePopup: typeof makePopup;
|
|
39
|
-
makeToast: typeof makeToast;
|
|
40
|
-
closePopup: typeof closePopup;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export default jspt;
|
|
44
|
-
|
|
45
|
-
declare global {
|
|
46
|
-
interface Window {
|
|
47
|
-
jspt: typeof jspt;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
1
|
+
export interface PopupOptions {
|
|
2
|
+
style?: 'default';
|
|
3
|
+
content_type?: 'text' | 'html';
|
|
4
|
+
header?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
message?: string;
|
|
7
|
+
content?: string;
|
|
8
|
+
close_on_blur?: boolean;
|
|
9
|
+
custom_id?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface ToastOptions {
|
|
13
|
+
style?: 'default' | 'default-error' | string;
|
|
14
|
+
message: string;
|
|
15
|
+
custom_id?: string;
|
|
16
|
+
icon_left?: string;
|
|
17
|
+
icon_left_type?: 'google_material_rounded' | 'google_material_outlined' | 'svg' | 'image' | 'text' | 'emoji';
|
|
18
|
+
icon_left_action?: () => void;
|
|
19
|
+
icon_right?: string;
|
|
20
|
+
icon_right_type?: 'google_material_rounded' | 'google_material_outlined' | 'svg' | 'image' | 'text' | 'emoji';
|
|
21
|
+
icon_right_action?: () => void;
|
|
22
|
+
duration?: number;
|
|
23
|
+
close_on_click?: boolean;
|
|
24
|
+
onclick?: () => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface ClosePopupOptions {
|
|
28
|
+
custom_id: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function makePopup(options: PopupOptions): void;
|
|
32
|
+
|
|
33
|
+
export function makeToast(options: ToastOptions): void;
|
|
34
|
+
|
|
35
|
+
export function closePopup(options: ClosePopupOptions): void;
|
|
36
|
+
|
|
37
|
+
declare const jspt: {
|
|
38
|
+
makePopup: typeof makePopup;
|
|
39
|
+
makeToast: typeof makeToast;
|
|
40
|
+
closePopup: typeof closePopup;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export default jspt;
|
|
44
|
+
|
|
45
|
+
declare global {
|
|
46
|
+
interface Window {
|
|
47
|
+
jspt: typeof jspt;
|
|
48
|
+
}
|
|
49
|
+
}
|