ga-toasts 1.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.
@@ -0,0 +1,149 @@
1
+ # Redirect Setup Guide for GA Toasts
2
+
3
+ ## Overview
4
+ This guide helps you set up proper redirects to handle www/non-www subdomain issues and prevent duplicate content problems.
5
+
6
+ ## Files Created
7
+
8
+ ### 1. `.htaccess` (Apache Servers)
9
+ - **Purpose**: Server-level redirects for Apache web servers
10
+ - **Location**: Root directory of your website
11
+ - **Features**:
12
+ - www → non-www redirects
13
+ - HTTP → HTTPS redirects
14
+ - Performance optimizations
15
+ - Security headers
16
+
17
+ ### 2. `_redirects` (Netlify)
18
+ - **Purpose**: Redirect configuration for Netlify hosting
19
+ - **Location**: Root directory or `public` folder
20
+ - **Features**:
21
+ - www → non-www redirects
22
+ - HTTP → HTTPS redirects
23
+ - Catch-all redirects
24
+
25
+ ### 3. `vercel.json` (Vercel)
26
+ - **Purpose**: Redirect configuration for Vercel hosting
27
+ - **Location**: Root directory
28
+ - **Features**:
29
+ - Host-based redirects
30
+ - Protocol-based redirects
31
+ - Security headers
32
+
33
+ ### 4. HTML Meta Redirects
34
+ - **Purpose**: Client-side fallback redirects
35
+ - **Location**: `<head>` section of `index.html`
36
+ - **Features**:
37
+ - JavaScript redirects
38
+ - Meta refresh redirects
39
+ - Comprehensive hostname handling
40
+
41
+ ## Setup Instructions
42
+
43
+ ### For Apache Servers
44
+ 1. Upload `.htaccess` to your web server root directory
45
+ 2. Ensure mod_rewrite is enabled
46
+ 3. Test redirects using online tools
47
+
48
+ ### For Netlify
49
+ 1. Upload `_redirects` file to your site root
50
+ 2. Deploy your site
51
+ 3. Test redirects
52
+
53
+ ### For Vercel
54
+ 1. Upload `vercel.json` to your project root
55
+ 2. Deploy your site
56
+ 3. Test redirects
57
+
58
+ ### For Other Hosting Providers
59
+ 1. Check your hosting provider's documentation for redirect configuration
60
+ 2. Use the HTML meta redirects as fallback
61
+ 3. Consider using a CDN with redirect capabilities
62
+
63
+ ## Testing Your Redirects
64
+
65
+ ### Online Tools
66
+ - [Redirect Checker](https://www.redirectchecker.org/)
67
+ - [HTTP Status Code Checker](https://httpstatus.io/)
68
+ - [SEO Redirect Checker](https://www.seoptimer.com/redirect-checker/)
69
+
70
+ ### Manual Testing
71
+ 1. Visit `http://www.ga-toasts.com` - should redirect to `https://ga-toasts.com`
72
+ 2. Visit `https://www.ga-toasts.com` - should redirect to `https://ga-toasts.com`
73
+ 3. Visit `http://ga-toasts.com` - should redirect to `https://ga-toasts.com`
74
+
75
+ ### Expected Results
76
+ - **Status Code**: 301 (Permanent Redirect)
77
+ - **Final URL**: `https://ga-toasts.com/`
78
+ - **No Redirect Loops**: Should not redirect infinitely
79
+
80
+ ## Troubleshooting
81
+
82
+ ### Common Issues
83
+
84
+ #### 1. Redirects Not Working
85
+ - **Check**: Server supports mod_rewrite (Apache)
86
+ - **Check**: File permissions on `.htaccess`
87
+ - **Check**: Hosting provider allows custom redirects
88
+
89
+ #### 2. Infinite Redirect Loops
90
+ - **Fix**: Ensure redirect rules don't conflict
91
+ - **Fix**: Check for conflicting server configurations
92
+ - **Fix**: Verify canonical URL settings
93
+
94
+ #### 3. HTTPS Issues
95
+ - **Check**: SSL certificate is properly installed
96
+ - **Check**: HTTPS redirects are enabled
97
+ - **Check**: Mixed content warnings
98
+
99
+ ### Debug Steps
100
+ 1. Check server error logs
101
+ 2. Use browser developer tools
102
+ 3. Test with curl commands
103
+ 4. Verify DNS settings
104
+
105
+ ## DNS Configuration
106
+
107
+ ### Recommended DNS Setup
108
+ ```
109
+ A Record: ga-toasts.com → Your Server IP
110
+ CNAME: www.ga-toasts.com → ga-toasts.com
111
+ ```
112
+
113
+ ### Alternative DNS Setup
114
+ ```
115
+ A Record: ga-toasts.com → Your Server IP
116
+ A Record: www.ga-toasts.com → Your Server IP
117
+ ```
118
+
119
+ ## SEO Considerations
120
+
121
+ ### Benefits of Proper Redirects
122
+ - ✅ Prevents duplicate content issues
123
+ - ✅ Consolidates link equity
124
+ - ✅ Improves search engine rankings
125
+ - ✅ Provides consistent user experience
126
+
127
+ ### Best Practices
128
+ - Use 301 redirects for permanent redirects
129
+ - Preserve query parameters and fragments
130
+ - Test redirects regularly
131
+ - Monitor for redirect errors
132
+
133
+ ## Support
134
+
135
+ If you're still experiencing redirect issues:
136
+ 1. Check your hosting provider's documentation
137
+ 2. Contact your hosting provider's support
138
+ 3. Verify DNS configuration
139
+ 4. Test with different browsers and devices
140
+
141
+ ## Files to Upload
142
+
143
+ Make sure to upload these files to your web server:
144
+ - ✅ `.htaccess` (for Apache servers)
145
+ - ✅ `_redirects` (for Netlify)
146
+ - ✅ `vercel.json` (for Vercel)
147
+ - ✅ Updated `index.html` (for all hosting)
148
+
149
+ The redirects should work immediately after uploading the appropriate configuration file for your hosting environment.
package/ga-toasts.d.ts ADDED
@@ -0,0 +1,99 @@
1
+ export type GaToastType =
2
+ | 'success'
3
+ | 'error'
4
+ | 'warning'
5
+ | 'info'
6
+ | 'primary'
7
+ | 'secondary';
8
+
9
+ export type GaToastPosition =
10
+ | 'top-start'
11
+ | 'top-center'
12
+ | 'top-end'
13
+ | 'middle-start'
14
+ | 'middle-center'
15
+ | 'middle-end'
16
+ | 'bottom-start'
17
+ | 'bottom-center'
18
+ | 'bottom-end';
19
+
20
+ export type GaToastAnimation = 'fade' | 'slide' | 'bounce' | 'scale';
21
+
22
+ export type GaToastVariant = '' | 'filled' | 'light';
23
+
24
+ export type GaToastProgressPosition = 'top' | 'bottom' | 'none';
25
+
26
+ export type GaToastSize = '' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
27
+
28
+ export interface GaToastAction {
29
+ text: string;
30
+ class?: string;
31
+ click?: (event: Event, toast: HTMLElement | string) => void;
32
+ }
33
+
34
+ export interface GaToastOptions {
35
+ id?: string;
36
+ title?: string;
37
+ message?: string;
38
+ type?: GaToastType;
39
+ duration?: number;
40
+ closable?: boolean;
41
+ position?: GaToastPosition;
42
+ icon?: string;
43
+ actions?: GaToastAction[];
44
+ size?: GaToastSize;
45
+ variant?: GaToastVariant;
46
+ animation?: GaToastAnimation;
47
+ clickToClose?: boolean;
48
+ progress?: boolean;
49
+ progressBackground?: boolean;
50
+ pauseOnHover?: boolean;
51
+ glassmorphism?: boolean;
52
+ /** Denser layout with reduced padding */
53
+ compact?: boolean;
54
+ /** Show a small status chip (defaults to capitalized type) */
55
+ showStatus?: boolean;
56
+ statusText?: string;
57
+ /** Automatically choose an icon based on type (default: true) */
58
+ autoIcon?: boolean;
59
+ /** Pin toast (no auto close, visually indicated) */
60
+ pinned?: boolean;
61
+ /** Where to render progress bar */
62
+ progressPosition?: GaToastProgressPosition;
63
+ /** Segmented progress: total steps in a multi-step flow */
64
+ steps?: number;
65
+ /** Segmented progress: current step (1-based) */
66
+ currentStep?: number;
67
+ }
68
+
69
+ export interface GaToastsApi {
70
+ show(options: GaToastOptions): HTMLElement;
71
+ success(message: string, options?: GaToastOptions): HTMLElement;
72
+ error(message: string, options?: GaToastOptions): HTMLElement;
73
+ warning(message: string, options?: GaToastOptions): HTMLElement;
74
+ info(message: string, options?: GaToastOptions): HTMLElement;
75
+ confirm(message: string, options?: GaToastOptions & {
76
+ onConfirm?: () => void;
77
+ onCancel?: () => void;
78
+ }): HTMLElement;
79
+ loading(message?: string, options?: GaToastOptions): HTMLElement;
80
+
81
+ close(toast: HTMLElement | string): void;
82
+ closeAll(): void;
83
+ clear(type?: GaToastType): void;
84
+ update(toastId: string, options: Partial<GaToastOptions>): boolean;
85
+ getCount(type?: GaToastType): number;
86
+ exists(toastId: string): boolean;
87
+ get(toastId: string): HTMLElement | null;
88
+
89
+ setDefaults(defaults: GaToastOptions): void;
90
+ setLogger(
91
+ logger: ((event: string, payload: unknown) => void) | null
92
+ ): void;
93
+ }
94
+
95
+ declare const GaToasts: GaToastsApi;
96
+
97
+ export default GaToasts;
98
+
99
+
Binary file