ultimate-jekyll-manager 0.0.116 → 0.0.118
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 +330 -138
- package/README.md +108 -0
- package/TODO.md +1 -1
- package/dist/assets/js/core/auth.js +3 -7
- package/dist/assets/js/libs/prerendered-icons.js +27 -0
- package/dist/assets/js/pages/account/index.js +1 -1
- package/dist/assets/js/pages/account/sections/api-keys.js +2 -6
- package/dist/assets/js/pages/account/sections/connections.js +91 -57
- package/dist/assets/js/pages/account/sections/referrals.js +29 -29
- package/dist/assets/js/pages/account/sections/security.js +95 -70
- package/dist/assets/js/pages/payment/checkout/index.js +6 -6
- package/dist/assets/js/pages/payment/checkout/modules/processors-main.js +2 -2
- package/dist/assets/js/pages/payment/checkout/modules/session.js +4 -4
- package/dist/defaults/dist/_includes/core/body.html +23 -0
- package/dist/defaults/dist/_layouts/themes/classy/frontend/pages/account/index.html +42 -15
- package/dist/defaults/dist/pages/pricing.md +7 -0
- package/dist/service-worker.js +129 -139
- package/firebase-debug.log +350 -0
- package/package.json +10 -10
package/dist/service-worker.js
CHANGED
|
@@ -17,169 +17,159 @@ importScripts(
|
|
|
17
17
|
// 'https://www.gstatic.com/firebasejs/%%% firebaseVersion %%%/firebase-firestore-compat.js',
|
|
18
18
|
);
|
|
19
19
|
|
|
20
|
-
// Class
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Return
|
|
46
|
-
return self;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// Initialize
|
|
50
|
-
Manager.prototype.initialize = function () {
|
|
51
|
-
const self = this;
|
|
20
|
+
// Manager Class
|
|
21
|
+
class Manager {
|
|
22
|
+
constructor() {
|
|
23
|
+
// Properties
|
|
24
|
+
this.serviceWorker = null;
|
|
25
|
+
|
|
26
|
+
// Load config
|
|
27
|
+
this.config = serviceWorker.UJ_BUILD_JSON?.config || {};
|
|
28
|
+
|
|
29
|
+
// Defaults
|
|
30
|
+
this.app = this.config?.brand?.id || 'default';
|
|
31
|
+
this.environment = this.config?.uj?.environment || 'production';
|
|
32
|
+
this.cache = {
|
|
33
|
+
breaker: this.config?.uj?.cache_breaker || new Date().getTime(),
|
|
34
|
+
};
|
|
35
|
+
this.cache.name = `${this.app}-${this.cache.breaker}`;
|
|
36
|
+
|
|
37
|
+
// Libraries
|
|
38
|
+
this.libraries = {
|
|
39
|
+
firebase: false,
|
|
40
|
+
messaging: false,
|
|
41
|
+
promoServer: false,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
52
44
|
|
|
53
|
-
|
|
45
|
+
// Initialize
|
|
46
|
+
async initialize() {
|
|
54
47
|
// Properties
|
|
55
|
-
|
|
48
|
+
this.serviceWorker = serviceWorker;
|
|
56
49
|
|
|
57
50
|
// Setup instance-specific message handlers
|
|
58
|
-
|
|
51
|
+
this.setupInstanceHandlers();
|
|
59
52
|
|
|
60
53
|
// Initialize Firebase
|
|
61
|
-
|
|
54
|
+
this.initializeFirebase();
|
|
62
55
|
|
|
63
56
|
// Update cache
|
|
64
|
-
|
|
57
|
+
this.updateCache();
|
|
65
58
|
|
|
66
59
|
// Log
|
|
67
60
|
console.log('Initialized!', serviceWorker.location.pathname, serviceWorker);
|
|
61
|
+
console.log('Config loaded from UJ_BUILD_JSON:', this.config);
|
|
68
62
|
|
|
69
63
|
// Return
|
|
70
|
-
return
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
// ['log', 'error', 'warn', 'info', 'debug'].forEach(method => {
|
|
75
|
-
// Manager.prototype[method] = function() {
|
|
76
|
-
// // Get arguments
|
|
77
|
-
// const time = new Date().toLocaleTimeString('en-US', {
|
|
78
|
-
// hour12: false,
|
|
79
|
-
// hour: '2-digit',
|
|
80
|
-
// minute: '2-digit',
|
|
81
|
-
// second: '2-digit'
|
|
82
|
-
// });
|
|
83
|
-
|
|
84
|
-
// // Add prefix
|
|
85
|
-
// const args = [`[${time}] service-worker:`, ...Array.from(arguments)];
|
|
86
|
-
|
|
87
|
-
// // Call the original console method
|
|
88
|
-
// console[method].apply(console, args);
|
|
89
|
-
// };
|
|
90
|
-
// });
|
|
91
|
-
|
|
92
|
-
// Setup instance-specific message handlers
|
|
93
|
-
Manager.prototype.setupInstanceHandlers = function () {
|
|
94
|
-
const self = this;
|
|
95
|
-
|
|
96
|
-
// Send messages: https://stackoverflow.com/questions/35725594/how-do-i-pass-data-like-a-user-id-to-a-web-worker-for-fetching-additional-push
|
|
97
|
-
// more messaging: http://craig-russell.co.uk/2016/01/29/service-worker-messaging.html#.XSKpRZNKiL8
|
|
98
|
-
serviceWorker.addEventListener('message', (event) => {
|
|
99
|
-
// Get the data
|
|
100
|
-
const data = event.data || {};
|
|
101
|
-
|
|
102
|
-
// Parse the data
|
|
103
|
-
const command = data.command || '';
|
|
104
|
-
const payload = data.payload || {};
|
|
105
|
-
|
|
106
|
-
// Quit if no command
|
|
107
|
-
if (!command) return;
|
|
108
|
-
|
|
109
|
-
// Log
|
|
110
|
-
console.log('message', command, payload, event);
|
|
111
|
-
|
|
112
|
-
// Handle commands
|
|
113
|
-
if (command === 'update-cache') {
|
|
114
|
-
const pages = payload.pages || [];
|
|
115
|
-
self.updateCache(pages)
|
|
116
|
-
.then(() => {
|
|
117
|
-
event.ports[0]?.postMessage({ status: 'success' });
|
|
118
|
-
})
|
|
119
|
-
.catch(error => {
|
|
120
|
-
event.ports[0]?.postMessage({ status: 'error', error: error.message });
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
// Log
|
|
126
|
-
console.log('Set up message handlers');
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// Setup Firebase init
|
|
130
|
-
Manager.prototype.initializeFirebase = function () {
|
|
131
|
-
const self = this;
|
|
132
|
-
|
|
133
|
-
// Get Firebase config
|
|
134
|
-
const firebaseConfig = self.config?.web_manager?.firebase?.app?.config;
|
|
135
|
-
|
|
136
|
-
// Check if Firebase config is available
|
|
137
|
-
if (!firebaseConfig) {
|
|
138
|
-
console.log('Firebase config not available yet, skipping Firebase initialization');
|
|
139
|
-
return;
|
|
64
|
+
return serviceWorker;
|
|
140
65
|
}
|
|
141
66
|
|
|
142
|
-
//
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
67
|
+
// ['log', 'error', 'warn', 'info', 'debug'].forEach(method => {
|
|
68
|
+
// Manager.prototype[method] = function() {
|
|
69
|
+
// // Get arguments
|
|
70
|
+
// const time = new Date().toLocaleTimeString('en-US', {
|
|
71
|
+
// hour12: false,
|
|
72
|
+
// hour: '2-digit',
|
|
73
|
+
// minute: '2-digit',
|
|
74
|
+
// second: '2-digit'
|
|
75
|
+
// });
|
|
76
|
+
|
|
77
|
+
// // Add prefix
|
|
78
|
+
// const args = [`[${time}] service-worker:`, ...Array.from(arguments)];
|
|
79
|
+
|
|
80
|
+
// // Call the original console method
|
|
81
|
+
// console[method].apply(console, args);
|
|
82
|
+
// };
|
|
83
|
+
// });
|
|
84
|
+
|
|
85
|
+
// Setup instance-specific message handlers
|
|
86
|
+
setupInstanceHandlers() {
|
|
87
|
+
// Send messages: https://stackoverflow.com/questions/35725594/how-do-i-pass-data-like-a-user-id-to-a-web-worker-for-fetching-additional-push
|
|
88
|
+
// more messaging: http://craig-russell.co.uk/2016/01/29/service-worker-messaging.html#.XSKpRZNKiL8
|
|
89
|
+
serviceWorker.addEventListener('message', (event) => {
|
|
90
|
+
// Get the data
|
|
91
|
+
const data = event.data || {};
|
|
92
|
+
|
|
93
|
+
// Parse the data
|
|
94
|
+
const command = data.command || '';
|
|
95
|
+
const payload = data.payload || {};
|
|
96
|
+
|
|
97
|
+
// Quit if no command
|
|
98
|
+
if (!command) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Log
|
|
103
|
+
console.log('message', command, payload, event);
|
|
104
|
+
|
|
105
|
+
// Handle commands
|
|
106
|
+
if (command === 'update-cache') {
|
|
107
|
+
const pages = payload.pages || [];
|
|
108
|
+
this.updateCache(pages)
|
|
109
|
+
.then(() => {
|
|
110
|
+
event.ports[0]?.postMessage({ status: 'success' });
|
|
111
|
+
})
|
|
112
|
+
.catch(error => {
|
|
113
|
+
event.ports[0]?.postMessage({ status: 'error', error: error.message });
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
});
|
|
147
117
|
|
|
148
|
-
|
|
149
|
-
|
|
118
|
+
// Log
|
|
119
|
+
console.log('Set up message handlers');
|
|
120
|
+
}
|
|
150
121
|
|
|
151
|
-
//
|
|
152
|
-
|
|
122
|
+
// Setup Firebase init
|
|
123
|
+
initializeFirebase() {
|
|
124
|
+
// Get Firebase config
|
|
125
|
+
const firebaseConfig = this.config?.web_manager?.firebase?.app?.config;
|
|
153
126
|
|
|
154
|
-
|
|
155
|
-
|
|
127
|
+
// Check if Firebase config is available
|
|
128
|
+
if (!firebaseConfig) {
|
|
129
|
+
console.log('Firebase config not available yet, skipping Firebase initialization');
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
156
132
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
133
|
+
// Check if already initialized
|
|
134
|
+
if (this.libraries.firebase) {
|
|
135
|
+
console.log('Firebase already initialized');
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
160
138
|
|
|
161
|
-
//
|
|
162
|
-
|
|
163
|
-
const self = this;
|
|
139
|
+
// Log
|
|
140
|
+
console.log('Initializing Firebase v%%% firebaseVersion %%%');
|
|
164
141
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
'/',
|
|
168
|
-
'/assets/css/main.bundle.css',
|
|
169
|
-
'/assets/js/main.bundle.js',
|
|
170
|
-
];
|
|
142
|
+
// Initialize app (libraries were already imported at the top)
|
|
143
|
+
firebase.initializeApp(firebaseConfig);
|
|
171
144
|
|
|
172
|
-
|
|
173
|
-
|
|
145
|
+
// Initialize messaging
|
|
146
|
+
this.libraries.messaging = firebase.messaging();
|
|
174
147
|
|
|
175
|
-
|
|
176
|
-
|
|
148
|
+
// Attach firebase to SWManager
|
|
149
|
+
this.libraries.firebase = firebase;
|
|
150
|
+
}
|
|
177
151
|
|
|
178
|
-
//
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
152
|
+
// Setup cache update
|
|
153
|
+
updateCache(pages) {
|
|
154
|
+
// Set default pages to cache
|
|
155
|
+
const defaults = [
|
|
156
|
+
'/',
|
|
157
|
+
'/assets/css/main.bundle.css',
|
|
158
|
+
'/assets/js/main.bundle.js',
|
|
159
|
+
];
|
|
160
|
+
|
|
161
|
+
// Ensure pages is an array
|
|
162
|
+
pages = pages || [];
|
|
163
|
+
|
|
164
|
+
// Merge with additional pages
|
|
165
|
+
const pagesToCache = [...new Set([...defaults, ...pages])];
|
|
166
|
+
|
|
167
|
+
// Open cache and add pages
|
|
168
|
+
return caches.open(this.cache.name)
|
|
169
|
+
.then(cache => cache.addAll(pagesToCache))
|
|
170
|
+
.then(() => console.log('Cached resources:', pagesToCache))
|
|
171
|
+
.catch(error => console.error('Failed to cache resources:', error));
|
|
172
|
+
}
|
|
183
173
|
}
|
|
184
174
|
|
|
185
175
|
// Helper: Setup global listeners
|