@linear_non/stellar-kit 3.0.11 → 3.0.12

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.
@@ -213,6 +213,10 @@ export class ApplicationManager {
213
213
  }
214
214
 
215
215
  await this._waitDOM()
216
+
217
+ // Auto-enable debug mode from ?debug URL param
218
+ Debug.init()
219
+
216
220
  Debug.log(
217
221
  "APP",
218
222
  "DOM ready with",
@@ -310,4 +314,4 @@ export class ApplicationManager {
310
314
  if (document.readyState !== "loading") return Promise.resolve()
311
315
  return new Promise(res => document.addEventListener("DOMContentLoaded", res, { once: true }))
312
316
  }
313
- }
317
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linear_non/stellar-kit",
3
- "version": "3.0.11",
3
+ "version": "3.0.12",
4
4
  "description": "Stellar frontend core for Non-Linear Studio projects.",
5
5
  "type": "module",
6
6
  "main": "./core/index.js",
@@ -33,7 +33,7 @@ export default class Observer extends Emitter {
33
33
  end,
34
34
  scrub,
35
35
  once,
36
- markers,
36
+ markers: markers || kitStore.flags.isDebug,
37
37
  scroller: kitStore.scroller || undefined,
38
38
  onEnter: forward("enter"),
39
39
  onLeave: forward("leave"),
package/utils/debug.js CHANGED
@@ -18,9 +18,21 @@ function fmt(scope) {
18
18
  *
19
19
  * - Controlled via kitStore.flags.isDebug
20
20
  * - No-op when debug is off
21
+ * - Call Debug.init() to auto-enable via ?debug URL param
21
22
  */
22
23
 
23
24
  export const Debug = {
25
+ /**
26
+ * Auto-enable debug mode if the URL contains a `?debug` query parameter.
27
+ * e.g. `https://example.com/?debug=1` or `?debug`
28
+ * Call this early (e.g. in Application.initialize).
29
+ */
30
+ init() {
31
+ const params = new URLSearchParams(window.location.search)
32
+ if (params.has("debug")) {
33
+ this.enable()
34
+ }
35
+ },
24
36
  enable() {
25
37
  kitStore.flags.isDebug = true
26
38
  },