@ytspar/devbar 1.18.1 → 1.18.2-canary.3049085

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.
@@ -1 +1 @@
1
- import{_ as e}from"./chunks/chunk-D3SD35W6.js";import"./chunks/chunk-72ZECFVW.js";typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>e()):e());export{e as initGlobalDevBar};
1
+ import{_ as e}from"./chunks/chunk-U6ZTW7WI.js";import"./chunks/chunk-72ZECFVW.js";typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>e()):e());export{e as initGlobalDevBar};
@@ -1 +1 @@
1
- import{$,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,_,a,aa,b,ba,c,ca,d,da,e,ea,f,fa,g,ga,h,ha,i,ia,j,ja,k,ka,l,la,m,ma,n,na,o,oa,p,pa,q,qa,r,ra,s,sa,t,ta,u,ua,v,va,w,wa,x,xa,y,z}from"./chunks/chunk-D3SD35W6.js";import"./chunks/chunk-72ZECFVW.js";export{K as ACCENT_COLOR_PRESETS,j as BUTTON_COLORS,k as CATEGORY_COLORS,L as DEFAULT_SETTINGS,O as DEVBAR_LOGO_COLORS,P as DEVBAR_LOGO_PATHS,Q as DEVBAR_LOGO_SHAPES,N as DEVBAR_LOGO_VIEWBOX,m as DEVBAR_THEME,n as DEVBAR_THEME_LIGHT,D as DebugLogger,e as EARLY_CONSOLE_CAPTURE_SCRIPT,o as FONT_MONO,Z as GlobalDevBar,ba as NetworkMonitor,i as PALETTE,ja as PRESET_DEBUG,ga as PRESET_FULL,fa as PRESET_MINIMAL,ha as PRESET_PERFORMANCE,ia as PRESET_RESPONSIVE,l as STORAGE_KEYS,h as TAILWIND_BREAKPOINTS,H as activateAnnotateMode,ca as appVersionPlugin,E as buildSelector,T as canvasToDataUrl,W as copyCanvasToClipboard,R as createDevBarLogo,V as delay,xa as deleteCookie,ua as deleteLocalStorageItem,wa as deleteSessionStorageItem,aa as destroyGlobalDevBar,Y as earlyConsoleCapture,a as extractDocumentOutline,c as extractPageSchema,f as formatArg,g as formatArgs,u as generateThemeCSSVars,ra as getCookies,S as getDevBarLogoSvg,r as getEffectiveTheme,$ as getGlobalDevBar,X as getHtml2Canvas,B as getImpactColor,pa as getLocalStorage,qa as getSessionStorage,M as getSettingsManager,sa as getStorageData,p as getStoredThemeMode,t as getTheme,s as getThemeColors,z as getViolationCounts,da as gitBranchPlugin,A as groupViolationsByImpact,oa as initDebug,la as initFull,_ as initGlobalDevBar,ka as initMinimal,ma as initPerformance,na as initResponsive,v as injectThemeCSS,w as isAxeLoaded,C as normalizeDebugConfig,b as outlineToMarkdown,x as preloadAxe,U as prepareForCapture,I as registerAnnotateControl,ea as releaseInfoPlugin,J as resolveSaveLocation,y as runA11yAudit,d as schemaToMarkdown,ta as setLocalStorageItem,va as setSessionStorageItem,q as setStoredThemeMode,G as submitPin,F as viewportBucket};
1
+ import{$,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,_,a,aa,b,ba,c,ca,d,da,e,ea,f,fa,g,ga,h,ha,i,ia,j,ja,k,ka,l,la,m,ma,n,na,o,oa,p,pa,q,qa,r,ra,s,sa,t,ta,u,ua,v,va,w,wa,x,xa,y,z}from"./chunks/chunk-U6ZTW7WI.js";import"./chunks/chunk-72ZECFVW.js";export{K as ACCENT_COLOR_PRESETS,j as BUTTON_COLORS,k as CATEGORY_COLORS,L as DEFAULT_SETTINGS,O as DEVBAR_LOGO_COLORS,P as DEVBAR_LOGO_PATHS,Q as DEVBAR_LOGO_SHAPES,N as DEVBAR_LOGO_VIEWBOX,m as DEVBAR_THEME,n as DEVBAR_THEME_LIGHT,D as DebugLogger,e as EARLY_CONSOLE_CAPTURE_SCRIPT,o as FONT_MONO,Z as GlobalDevBar,ba as NetworkMonitor,i as PALETTE,ja as PRESET_DEBUG,ga as PRESET_FULL,fa as PRESET_MINIMAL,ha as PRESET_PERFORMANCE,ia as PRESET_RESPONSIVE,l as STORAGE_KEYS,h as TAILWIND_BREAKPOINTS,H as activateAnnotateMode,ca as appVersionPlugin,E as buildSelector,T as canvasToDataUrl,W as copyCanvasToClipboard,R as createDevBarLogo,V as delay,xa as deleteCookie,ua as deleteLocalStorageItem,wa as deleteSessionStorageItem,aa as destroyGlobalDevBar,Y as earlyConsoleCapture,a as extractDocumentOutline,c as extractPageSchema,f as formatArg,g as formatArgs,u as generateThemeCSSVars,ra as getCookies,S as getDevBarLogoSvg,r as getEffectiveTheme,$ as getGlobalDevBar,X as getHtml2Canvas,B as getImpactColor,pa as getLocalStorage,qa as getSessionStorage,M as getSettingsManager,sa as getStorageData,p as getStoredThemeMode,t as getTheme,s as getThemeColors,z as getViolationCounts,da as gitBranchPlugin,A as groupViolationsByImpact,oa as initDebug,la as initFull,_ as initGlobalDevBar,ka as initMinimal,ma as initPerformance,na as initResponsive,v as injectThemeCSS,w as isAxeLoaded,C as normalizeDebugConfig,b as outlineToMarkdown,x as preloadAxe,U as prepareForCapture,I as registerAnnotateControl,ea as releaseInfoPlugin,J as resolveSaveLocation,y as runA11yAudit,d as schemaToMarkdown,ta as setLocalStorageItem,va as setSessionStorageItem,q as setStoredThemeMode,G as submitPin,F as viewportBucket};
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Suppress a framework's own floating dev indicator when the devbar is active —
3
+ * but ONLY while it is benign, never while it is signalling an error.
4
+ *
5
+ * Next.js renders its dev-tools launcher (the "N" button + route/build badge)
6
+ * inside a `nextjs-portal` **shadow root**, fixed to a bottom corner. In its
7
+ * resting state it duplicates what the devbar already surfaces and, being a
8
+ * fixed overlay, sits on top of page content and pollutes screenshots — so we
9
+ * hide it. But that same badge flips to an **error state** (`data-error="true"`)
10
+ * when the page has a build/runtime error, and that IS meaningful: a capture
11
+ * showing the errored badge is telling you the captured page is broken. Hiding
12
+ * it there would mask a real defect and let a broken page pass review, so the
13
+ * rule below is scoped to the resting badge (`data-error="false"`) and leaves
14
+ * the errored badge — and the `[data-nextjs-dialog-overlay]` error overlay —
15
+ * fully visible. `data-error` is a live attribute, so the CSS reacts on its own
16
+ * as errors come and go.
17
+ *
18
+ * Shadow-DOM encapsulation is why no capture pipeline can hide it from the
19
+ * outside: a `<style>` (or html2canvas `ignoreElements`) in the *main* document
20
+ * never reaches nodes inside the portal's shadow root. The only place that can
21
+ * hide it is a style injected INTO that shadow root — which is exactly what this
22
+ * module does, and why it lives on the page (in the devbar) rather than in a
23
+ * capture backend: it then covers every backend (agent-browser, sweetlink
24
+ * CDP/CLI, html2canvas) at once.
25
+ */
26
+ /**
27
+ * Hide the framework's floating dev indicator, now and whenever it (re)mounts.
28
+ * The portal can appear after the devbar initializes and Next recreates it on
29
+ * HMR, so keep watching. Returns a disposer that stops observing.
30
+ */
31
+ export declare function suppressFrameworkDevIndicators(): () => void;
32
+ //# sourceMappingURL=frameworkDevIndicators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frameworkDevIndicators.d.ts","sourceRoot":"","sources":["../../src/modules/frameworkDevIndicators.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AA2BH;;;;GAIG;AACH,wBAAgB,8BAA8B,IAAI,MAAM,IAAI,CAe3D"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Suppress a framework's own floating dev indicator when the devbar is active —
3
+ * but ONLY while it is benign, never while it is signalling an error.
4
+ *
5
+ * Next.js renders its dev-tools launcher (the "N" button + route/build badge)
6
+ * inside a `nextjs-portal` **shadow root**, fixed to a bottom corner. In its
7
+ * resting state it duplicates what the devbar already surfaces and, being a
8
+ * fixed overlay, sits on top of page content and pollutes screenshots — so we
9
+ * hide it. But that same badge flips to an **error state** (`data-error="true"`)
10
+ * when the page has a build/runtime error, and that IS meaningful: a capture
11
+ * showing the errored badge is telling you the captured page is broken. Hiding
12
+ * it there would mask a real defect and let a broken page pass review, so the
13
+ * rule below is scoped to the resting badge (`data-error="false"`) and leaves
14
+ * the errored badge — and the `[data-nextjs-dialog-overlay]` error overlay —
15
+ * fully visible. `data-error` is a live attribute, so the CSS reacts on its own
16
+ * as errors come and go.
17
+ *
18
+ * Shadow-DOM encapsulation is why no capture pipeline can hide it from the
19
+ * outside: a `<style>` (or html2canvas `ignoreElements`) in the *main* document
20
+ * never reaches nodes inside the portal's shadow root. The only place that can
21
+ * hide it is a style injected INTO that shadow root — which is exactly what this
22
+ * module does, and why it lives on the page (in the devbar) rather than in a
23
+ * capture backend: it then covers every backend (agent-browser, sweetlink
24
+ * CDP/CLI, html2canvas) at once.
25
+ */
26
+ const NEXT_PORTAL_TAG = 'nextjs-portal';
27
+ const STYLE_ID = 'devbar-hide-framework-dev-indicator';
28
+ // Only the resting (non-error) badge. `[data-error="true"]` stays visible so an
29
+ // errored capture still shows that the page is broken.
30
+ //
31
+ // This keys off `data-error="false"` — an undocumented Next.js internal (verified
32
+ // against the current dev overlay). If a future Next stops rendering that literal
33
+ // (e.g. a boolean attribute that's absent when clean, or `data-error="0"`), this
34
+ // rule simply stops matching and the resting badge REAPPEARS in captures. That's
35
+ // the harmless direction: cosmetic screenshot noise, never a hidden error — the
36
+ // errored badge is still shown. Deliberately not broadened to
37
+ // `:not([data-error="true"])`, which would hide a badge whose attribute went
38
+ // missing and shift the failure to the dangerous direction.
39
+ const HIDE_CSS = '[data-next-badge][data-error="false"]{display:none !important;}';
40
+ function injectIntoShadow(portal) {
41
+ const root = portal.shadowRoot;
42
+ if (!root)
43
+ return;
44
+ if (root.querySelector(`#${STYLE_ID}`))
45
+ return;
46
+ const style = document.createElement('style');
47
+ style.id = STYLE_ID;
48
+ style.textContent = HIDE_CSS;
49
+ root.appendChild(style);
50
+ }
51
+ /**
52
+ * Hide the framework's floating dev indicator, now and whenever it (re)mounts.
53
+ * The portal can appear after the devbar initializes and Next recreates it on
54
+ * HMR, so keep watching. Returns a disposer that stops observing.
55
+ */
56
+ export function suppressFrameworkDevIndicators() {
57
+ if (typeof document === 'undefined' || typeof MutationObserver === 'undefined') {
58
+ return () => { };
59
+ }
60
+ const existing = document.querySelector(NEXT_PORTAL_TAG);
61
+ if (existing)
62
+ injectIntoShadow(existing);
63
+ const observer = new MutationObserver(() => {
64
+ const portal = document.querySelector(NEXT_PORTAL_TAG);
65
+ if (portal)
66
+ injectIntoShadow(portal);
67
+ });
68
+ observer.observe(document.documentElement, { childList: true, subtree: true });
69
+ return () => observer.disconnect();
70
+ }
71
+ //# sourceMappingURL=frameworkDevIndicators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frameworkDevIndicators.js","sourceRoot":"","sources":["../../src/modules/frameworkDevIndicators.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,MAAM,eAAe,GAAG,eAAe,CAAC;AACxC,MAAM,QAAQ,GAAG,qCAAqC,CAAC;AACvD,gFAAgF;AAChF,uDAAuD;AACvD,EAAE;AACF,kFAAkF;AAClF,kFAAkF;AAClF,iFAAiF;AACjF,iFAAiF;AACjF,gFAAgF;AAChF,8DAA8D;AAC9D,6EAA6E;AAC7E,4DAA4D;AAC5D,MAAM,QAAQ,GAAG,iEAAiE,CAAC;AAEnF,SAAS,gBAAgB,CAAC,MAAe;IACvC,MAAM,IAAI,GAAI,MAAsB,CAAC,UAAU,CAAC;IAChD,IAAI,CAAC,IAAI;QAAE,OAAO;IAClB,IAAI,IAAI,CAAC,aAAa,CAAC,IAAI,QAAQ,EAAE,CAAC;QAAE,OAAO;IAC/C,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9C,KAAK,CAAC,EAAE,GAAG,QAAQ,CAAC;IACpB,KAAK,CAAC,WAAW,GAAG,QAAQ,CAAC;IAC7B,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC1B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,8BAA8B;IAC5C,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,OAAO,gBAAgB,KAAK,WAAW,EAAE,CAAC;QAC/E,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;IACzD,IAAI,QAAQ;QAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAEzC,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,GAAG,EAAE;QACzC,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;QACvD,IAAI,MAAM;YAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,eAAe,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IAE/E,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;AACrC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ytspar/devbar",
3
- "version": "1.18.1",
3
+ "version": "1.18.2-canary.3049085",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "Development toolbar and utilities with Sweetlink integration - pure vanilla JS, no framework dependencies",
@@ -83,7 +83,7 @@
83
83
  "dependencies": {
84
84
  "axe-core": "^4.10.2",
85
85
  "html2canvas-pro": "^2.0.0",
86
- "@ytspar/sweetlink": "^1.26.3"
86
+ "@ytspar/sweetlink": "^1.26.4-canary.3049085"
87
87
  },
88
88
  "devDependencies": {
89
89
  "@types/node": "^25.2.3",