ultimate-jekyll-manager 0.0.119 → 0.0.120
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/CLAUDE.md +102 -2
- package/README.md +171 -2
- package/TODO.md +10 -2
- package/_backup/form-manager.backup.js +1020 -0
- package/dist/assets/js/libs/auth/pages.js +64 -136
- package/dist/assets/js/libs/form-manager.js +643 -775
- package/dist/assets/js/pages/account/sections/api-keys.js +37 -52
- package/dist/assets/js/pages/account/sections/connections.js +37 -46
- package/dist/assets/js/pages/account/sections/delete.js +46 -66
- package/dist/assets/js/pages/account/sections/profile.js +37 -56
- package/dist/assets/js/pages/account/sections/security.js +100 -126
- package/dist/assets/js/pages/admin/notifications/new/index.js +72 -157
- package/dist/assets/js/pages/blog/index.js +29 -51
- package/dist/assets/js/pages/contact/index.js +110 -144
- package/dist/assets/js/pages/download/index.js +38 -86
- package/dist/assets/js/pages/oauth2/index.js +17 -17
- package/dist/assets/js/pages/payment/checkout/index.js +23 -36
- package/dist/assets/js/pages/test/libraries/form-manager/index.js +194 -0
- package/dist/defaults/dist/_layouts/themes/classy/frontend/pages/auth/signin.html +2 -2
- package/dist/defaults/dist/_layouts/themes/classy/frontend/pages/auth/signup.html +2 -2
- package/dist/defaults/dist/_layouts/themes/classy/frontend/pages/contact.html +10 -37
- package/dist/defaults/dist/pages/test/libraries/form-manager.html +181 -0
- package/dist/gulp/tasks/serve.js +18 -0
- package/dist/lib/logger.js +1 -1
- package/firebase-debug.log +392 -0
- package/package.json +6 -6
- package/.playwright-mcp/page-2025-10-22T19-11-27-666Z.png +0 -0
- package/.playwright-mcp/page-2025-10-22T19-11-57-357Z.png +0 -0
|
@@ -9,12 +9,6 @@ export default function (Manager) {
|
|
|
9
9
|
// Form manager instance
|
|
10
10
|
let formManager = null;
|
|
11
11
|
|
|
12
|
-
// Shared FormManager configuration
|
|
13
|
-
const formManagerConfig = {
|
|
14
|
-
allowMultipleSubmissions: false,
|
|
15
|
-
validateOnSubmit: true,
|
|
16
|
-
};
|
|
17
|
-
|
|
18
12
|
// Check query string for popup parameter
|
|
19
13
|
const url = new URL(window.location.href);
|
|
20
14
|
const useAuthPopup = url.searchParams.get('authPopup') === 'true' || window !== window.top;
|
|
@@ -61,125 +55,66 @@ export default function (Manager) {
|
|
|
61
55
|
}
|
|
62
56
|
}
|
|
63
57
|
|
|
64
|
-
//
|
|
65
|
-
function
|
|
66
|
-
|
|
67
|
-
...formManagerConfig,
|
|
68
|
-
submitButtonLoadingText: 'Signing in...'
|
|
69
|
-
});
|
|
58
|
+
// Shared validation for signin/signup forms - only validate when email provider is selected
|
|
59
|
+
function validateEmailProvider({ data, setError, $submitButton }) {
|
|
60
|
+
const provider = $submitButton?.getAttribute('data-provider');
|
|
70
61
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
62
|
+
if (provider === 'email') {
|
|
63
|
+
if (!data.email?.trim()) {
|
|
64
|
+
setError('email', 'Email is required');
|
|
65
|
+
}
|
|
66
|
+
if (!data.password) {
|
|
67
|
+
setError('password', 'Password is required');
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
75
71
|
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
// Shared submit handler factory for signin/signup forms
|
|
73
|
+
function createAuthSubmitHandler(action, emailHandler) {
|
|
74
|
+
return async ({ data, $submitButton }) => {
|
|
75
|
+
const provider = $submitButton?.getAttribute('data-provider');
|
|
78
76
|
|
|
79
|
-
// Only validate for email provider
|
|
80
77
|
if (provider === 'email') {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
formManager.setFormState('ready');
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
78
|
+
await emailHandler(data);
|
|
79
|
+
} else if (provider) {
|
|
80
|
+
await signInWithProvider(provider, action);
|
|
87
81
|
}
|
|
82
|
+
};
|
|
83
|
+
}
|
|
88
84
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
} catch (error) {
|
|
97
|
-
// Set form back to ready state
|
|
98
|
-
formManager.setFormState('ready');
|
|
99
|
-
|
|
100
|
-
// Show the error to the user
|
|
101
|
-
formManager.showError(error.message || 'An error occurred during sign in');
|
|
102
|
-
|
|
103
|
-
// Log for debugging
|
|
104
|
-
console.error('Signin error:', error);
|
|
105
|
-
}
|
|
85
|
+
// Initialize signin form
|
|
86
|
+
function initializeSigninForm() {
|
|
87
|
+
formManager = new FormManager('#signin-form', {
|
|
88
|
+
allowResubmit: false,
|
|
89
|
+
submittingText: 'Signing in...',
|
|
90
|
+
submittedText: 'Signed In!',
|
|
106
91
|
});
|
|
92
|
+
|
|
93
|
+
formManager.on('validation', validateEmailProvider);
|
|
94
|
+
formManager.on('submit', createAuthSubmitHandler('signin', handleEmailSignin));
|
|
107
95
|
}
|
|
108
96
|
|
|
109
97
|
// Initialize signup form
|
|
110
98
|
function initializeSignupForm() {
|
|
111
99
|
formManager = new FormManager('#signup-form', {
|
|
112
|
-
|
|
113
|
-
|
|
100
|
+
allowResubmit: false,
|
|
101
|
+
submittingText: 'Creating account...',
|
|
102
|
+
submittedText: 'Account Created!',
|
|
114
103
|
});
|
|
115
104
|
|
|
116
|
-
|
|
117
|
-
formManager.
|
|
118
|
-
// Prevent FormManager's default submit handler
|
|
119
|
-
e.preventDefault();
|
|
120
|
-
|
|
121
|
-
const { submitButton, data } = e.detail;
|
|
122
|
-
const provider = submitButton?.getAttribute('data-provider');
|
|
123
|
-
|
|
124
|
-
// Only validate for email provider
|
|
125
|
-
if (provider === 'email') {
|
|
126
|
-
const validation = formManager.validate(data);
|
|
127
|
-
if (!validation.isValid) {
|
|
128
|
-
formManager.showErrors(validation.errors);
|
|
129
|
-
formManager.setFormState('ready');
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
try {
|
|
135
|
-
if (provider === 'email') {
|
|
136
|
-
// Pass the already collected data to avoid re-collecting from disabled fields
|
|
137
|
-
await handleEmailSignup(data);
|
|
138
|
-
} else if (provider) {
|
|
139
|
-
await signInWithProvider(provider, 'signup');
|
|
140
|
-
}
|
|
141
|
-
} catch (error) {
|
|
142
|
-
// Set form back to ready state
|
|
143
|
-
formManager.setFormState('ready');
|
|
144
|
-
|
|
145
|
-
// Show the error to the user
|
|
146
|
-
formManager.showError(error.message || 'An error occurred during sign up');
|
|
147
|
-
|
|
148
|
-
// Log for debugging
|
|
149
|
-
console.error('Signup error:', error);
|
|
150
|
-
}
|
|
151
|
-
});
|
|
105
|
+
formManager.on('validation', validateEmailProvider);
|
|
106
|
+
formManager.on('submit', createAuthSubmitHandler('signup', handleEmailSignup));
|
|
152
107
|
}
|
|
153
108
|
|
|
154
109
|
// Initialize reset form
|
|
155
110
|
function initializeResetForm() {
|
|
156
111
|
formManager = new FormManager('#reset-form', {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
112
|
+
allowResubmit: false,
|
|
113
|
+
submittingText: 'Sending...',
|
|
114
|
+
submittedText: 'Email Sent!',
|
|
160
115
|
});
|
|
161
116
|
|
|
162
|
-
|
|
163
|
-
formManager.addEventListener('submit', async (e) => {
|
|
164
|
-
// Prevent FormManager's default submit handler
|
|
165
|
-
e.preventDefault();
|
|
166
|
-
|
|
167
|
-
const { data } = e.detail;
|
|
168
|
-
|
|
169
|
-
try {
|
|
170
|
-
// Pass the already collected data to avoid re-collecting from disabled fields
|
|
171
|
-
await handlePasswordReset(data);
|
|
172
|
-
} catch (error) {
|
|
173
|
-
// Set form back to ready state
|
|
174
|
-
formManager.setFormState('ready');
|
|
175
|
-
|
|
176
|
-
// Show the error to the user
|
|
177
|
-
formManager.showError(error.message || 'An error occurred during password reset');
|
|
178
|
-
|
|
179
|
-
// Log for debugging
|
|
180
|
-
console.error('Reset error:', error);
|
|
181
|
-
}
|
|
182
|
-
});
|
|
117
|
+
formManager.on('submit', ({ data }) => handlePasswordReset(data));
|
|
183
118
|
}
|
|
184
119
|
|
|
185
120
|
async function handleRedirectResult() {
|
|
@@ -211,14 +146,10 @@ export default function (Manager) {
|
|
|
211
146
|
|
|
212
147
|
if (isNewUser || isSignupPage) {
|
|
213
148
|
trackSignup(providerId, result.user);
|
|
214
|
-
// Show success message
|
|
215
149
|
formManager.showSuccess('Account created successfully!');
|
|
216
|
-
formManager.setFormState('submitted');
|
|
217
150
|
} else {
|
|
218
151
|
trackLogin(providerId, result.user);
|
|
219
|
-
// Show success message
|
|
220
152
|
formManager.showSuccess('Successfully signed in!');
|
|
221
|
-
formManager.setFormState('submitted');
|
|
222
153
|
}
|
|
223
154
|
} catch (error) {
|
|
224
155
|
// Only capture unexpected errors to Sentry
|
|
@@ -353,9 +284,6 @@ export default function (Manager) {
|
|
|
353
284
|
|
|
354
285
|
// Show success message
|
|
355
286
|
formManager.showSuccess('Account created successfully!');
|
|
356
|
-
|
|
357
|
-
// FormManager will handle the success state
|
|
358
|
-
formManager.setFormState('submitted');
|
|
359
287
|
} catch (error) {
|
|
360
288
|
// Handle Firebase-specific errors
|
|
361
289
|
if (error.code === 'auth/email-already-in-use') {
|
|
@@ -370,9 +298,6 @@ export default function (Manager) {
|
|
|
370
298
|
|
|
371
299
|
// Show success message
|
|
372
300
|
formManager.showSuccess('Successfully signed in!');
|
|
373
|
-
|
|
374
|
-
// Set success state
|
|
375
|
-
formManager.setFormState('submitted');
|
|
376
301
|
return;
|
|
377
302
|
} catch (signInError) {
|
|
378
303
|
// Throw error for outer catch to handle
|
|
@@ -403,9 +328,6 @@ export default function (Manager) {
|
|
|
403
328
|
|
|
404
329
|
// Show success message
|
|
405
330
|
formManager.showSuccess('Successfully signed in!');
|
|
406
|
-
|
|
407
|
-
// FormManager will handle the success state
|
|
408
|
-
formManager.setFormState('submitted');
|
|
409
331
|
}
|
|
410
332
|
|
|
411
333
|
async function handlePasswordReset(formData) {
|
|
@@ -429,9 +351,6 @@ export default function (Manager) {
|
|
|
429
351
|
|
|
430
352
|
// Show success message
|
|
431
353
|
formManager.showSuccess(`Password reset email sent to ${email}. Please check your inbox.`);
|
|
432
|
-
|
|
433
|
-
// Set form to submitted state
|
|
434
|
-
formManager.setFormState('submitted');
|
|
435
354
|
} catch (error) {
|
|
436
355
|
// Handle Firebase-specific errors
|
|
437
356
|
if (error.code === 'auth/user-not-found') {
|
|
@@ -439,7 +358,6 @@ export default function (Manager) {
|
|
|
439
358
|
// Still show success to prevent email enumeration
|
|
440
359
|
trackPasswordReset(email); // Track as success for security
|
|
441
360
|
formManager.showSuccess(`If an account exists for ${email}, a password reset email has been sent.`);
|
|
442
|
-
formManager.setFormState('submitted');
|
|
443
361
|
return;
|
|
444
362
|
}
|
|
445
363
|
|
|
@@ -484,19 +402,32 @@ export default function (Manager) {
|
|
|
484
402
|
throw new Error(`Unsupported provider: ${providerName}`);
|
|
485
403
|
}
|
|
486
404
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
)
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
405
|
+
/* @dev-only:start */
|
|
406
|
+
{
|
|
407
|
+
// // Add device_id and device_name for private IP addresses (required by Firebase)
|
|
408
|
+
// const deviceId = webManager.storage().get('devDeviceId') || crypto.randomUUID();
|
|
409
|
+
// webManager.storage().set('devDeviceId', deviceId);
|
|
410
|
+
|
|
411
|
+
// provider.setCustomParameters({
|
|
412
|
+
// device_id: deviceId,
|
|
413
|
+
// device_name: navigator.userAgent.substring(0, 100),
|
|
414
|
+
// });
|
|
415
|
+
|
|
416
|
+
// Show warning in dev mode when using redirect
|
|
417
|
+
if (!useAuthPopup) {
|
|
418
|
+
webManager.utilities().showNotification(
|
|
419
|
+
'OAuth redirect may fail in development. Use localhost:4000 or add ?authPopup=true to the URL',
|
|
420
|
+
{
|
|
421
|
+
type: 'warning',
|
|
422
|
+
timeout: 10000 // Show for 10 seconds
|
|
423
|
+
}
|
|
424
|
+
);
|
|
425
|
+
|
|
426
|
+
// Wait
|
|
427
|
+
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
428
|
+
}
|
|
499
429
|
}
|
|
430
|
+
/* @dev-only:end */
|
|
500
431
|
|
|
501
432
|
// Use popup if query parameter is set, otherwise use redirect
|
|
502
433
|
if (useAuthPopup) {
|
|
@@ -516,9 +447,6 @@ export default function (Manager) {
|
|
|
516
447
|
// Show success message
|
|
517
448
|
formManager.showSuccess('Successfully signed in!');
|
|
518
449
|
}
|
|
519
|
-
|
|
520
|
-
// Set form to submitted state
|
|
521
|
-
formManager.setFormState('submitted');
|
|
522
450
|
} catch (popupError) {
|
|
523
451
|
// Check if popup was blocked or failed
|
|
524
452
|
if (popupError.code === 'auth/popup-blocked' ||
|