web-manager 4.0.25 → 4.0.27
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 +5 -6
- package/TODO.md +9 -0
- package/dist/index.js +3 -0
- package/dist/modules/bindings.js +11 -2
- package/firebase-debug.log +28 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -286,9 +286,12 @@ Web Manager includes a powerful data binding system that automatically updates y
|
|
|
286
286
|
<!-- Hide element when condition is true -->
|
|
287
287
|
<div data-wm-bind="@hide auth.user">Please log in</div>
|
|
288
288
|
|
|
289
|
+
<!-- Or, show element when condition is false -->
|
|
290
|
+
<div data-wm-bind="@show !auth.user">Please log in</div>
|
|
291
|
+
|
|
289
292
|
<!-- Comparisons -->
|
|
290
293
|
<div data-wm-bind="@show auth.account.subscription.plan === 'premium'">Premium features</div>
|
|
291
|
-
<div data-wm-bind="@hide settings.
|
|
294
|
+
<div data-wm-bind="@hide settings.custom === 'value">Notifications enabled</div>
|
|
292
295
|
```
|
|
293
296
|
|
|
294
297
|
#### Usage in JavaScript
|
|
@@ -300,13 +303,9 @@ Manager.auth().listen({ account: true }, (result) => {
|
|
|
300
303
|
|
|
301
304
|
// Update bindings with custom data
|
|
302
305
|
Manager.bindings().update({
|
|
303
|
-
settings: {
|
|
304
|
-
subscription: { plan: 'premium', expiresAt: '2024-12-31' }
|
|
306
|
+
settings: { custom: 'value' },
|
|
305
307
|
});
|
|
306
308
|
|
|
307
|
-
// Set individual properties
|
|
308
|
-
Manager.bindings().set('currentPage', 'dashboard');
|
|
309
|
-
|
|
310
309
|
// Get current binding context
|
|
311
310
|
const context = Manager.bindings().getContext();
|
|
312
311
|
|
package/TODO.md
CHANGED
|
@@ -40,3 +40,12 @@ this.Sentry = {
|
|
|
40
40
|
|
|
41
41
|
// Expose limited API globally (only what's needed)
|
|
42
42
|
window.Sentry = this.Sentry;
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
what if in web-manager we put a special thing like
|
|
46
|
+
|
|
47
|
+
// Precedence: passed environment > query string > config.environment
|
|
48
|
+
const searchParams = new URLSearchParams(window.location.search);
|
|
49
|
+
const queryEnv = searchParams.get('_dev_loudLogs');
|
|
50
|
+
|
|
51
|
+
and this will set a property of webManager to true that enables copious logs
|
package/dist/index.js
CHANGED
|
@@ -108,6 +108,9 @@ class Manager {
|
|
|
108
108
|
// Old IE force polyfill
|
|
109
109
|
// await this._loadPolyfillsIfNeeded();
|
|
110
110
|
|
|
111
|
+
// Update bindings with config
|
|
112
|
+
this.bindings().update({ config: this.config });
|
|
113
|
+
|
|
111
114
|
return this;
|
|
112
115
|
} catch (error) {
|
|
113
116
|
console.error('Manager initialization error:', error);
|
package/dist/modules/bindings.js
CHANGED
|
@@ -13,7 +13,7 @@ class Bindings {
|
|
|
13
13
|
...data
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
// Get the top-level keys that were
|
|
16
|
+
// Get the top-level keys that were updating
|
|
17
17
|
const updatedKeys = Object.keys(data);
|
|
18
18
|
|
|
19
19
|
this._updateBindings(this._context, updatedKeys);
|
|
@@ -35,6 +35,12 @@ class Bindings {
|
|
|
35
35
|
// Find all elements with data-wm-bind attribute
|
|
36
36
|
const bindElements = document.querySelectorAll('[data-wm-bind]');
|
|
37
37
|
|
|
38
|
+
/* @dev-only:start */
|
|
39
|
+
{
|
|
40
|
+
console.log('[Bindings] Updating bindings', context, updatedKeys);
|
|
41
|
+
}
|
|
42
|
+
/* @dev-only:end */
|
|
43
|
+
|
|
38
44
|
bindElements.forEach(element => {
|
|
39
45
|
const bindValue = element.getAttribute('data-wm-bind');
|
|
40
46
|
|
|
@@ -202,8 +208,11 @@ class Bindings {
|
|
|
202
208
|
return true;
|
|
203
209
|
}
|
|
204
210
|
|
|
211
|
+
// Strip negation operator if present before extracting root key
|
|
212
|
+
const cleanPath = path.trim().replace(/^!/, '');
|
|
213
|
+
|
|
205
214
|
// Extract the root key from the path
|
|
206
|
-
const rootKey =
|
|
215
|
+
const rootKey = cleanPath.split('.')[0];
|
|
207
216
|
|
|
208
217
|
// Only update if the root key is in updatedKeys
|
|
209
218
|
return updatedKeys.includes(rootKey);
|
package/firebase-debug.log
CHANGED
|
@@ -98,3 +98,31 @@
|
|
|
98
98
|
[debug] [2025-11-19T03:04:21.579Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
99
99
|
[debug] [2025-11-19T03:04:21.579Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
100
100
|
[debug] [2025-11-19T03:04:21.579Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
101
|
+
[debug] [2025-11-19T20:05:55.095Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
102
|
+
[debug] [2025-11-19T20:05:55.095Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
103
|
+
[debug] [2025-11-19T20:05:55.099Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
104
|
+
[debug] [2025-11-19T20:05:55.099Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
105
|
+
[debug] [2025-11-19T20:05:55.099Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
106
|
+
[debug] [2025-11-19T20:05:55.108Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
107
|
+
[debug] [2025-11-19T20:05:55.109Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
108
|
+
[debug] [2025-11-19T20:05:55.099Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
109
|
+
[debug] [2025-11-19T20:05:55.099Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
110
|
+
[debug] [2025-11-19T20:05:55.099Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
111
|
+
[debug] [2025-11-19T20:05:55.109Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
112
|
+
[debug] [2025-11-19T20:05:55.109Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
113
|
+
[debug] [2025-11-19T20:05:55.135Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
114
|
+
[debug] [2025-11-19T20:05:55.136Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
115
|
+
[debug] [2025-11-19T20:05:55.135Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
116
|
+
[debug] [2025-11-19T20:05:55.136Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
117
|
+
[debug] [2025-11-19T20:05:55.136Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
118
|
+
[debug] [2025-11-19T20:05:55.139Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
119
|
+
[debug] [2025-11-19T20:05:55.139Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
120
|
+
[debug] [2025-11-19T20:05:55.139Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
121
|
+
[debug] [2025-11-19T20:05:55.139Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
122
|
+
[debug] [2025-11-19T20:05:55.136Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
123
|
+
[debug] [2025-11-19T20:05:55.137Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
124
|
+
[debug] [2025-11-19T20:05:55.138Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
125
|
+
[debug] [2025-11-19T20:05:55.139Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
126
|
+
[debug] [2025-11-19T20:05:55.139Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
|
127
|
+
[debug] [2025-11-19T20:05:55.140Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
|
|
128
|
+
[debug] [2025-11-19T20:05:55.140Z] > authorizing via signed-in user (ian.wiedenman@gmail.com)
|
package/package.json
CHANGED