@ecopages/dev-toolbar 0.2.0 → 0.3.0
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 +10 -8
- package/package.json +4 -4
- package/src/api/build-error-contract.d.ts +4 -0
- package/src/api/build-error-contract.js +4 -0
- package/src/api/manifest-contract.d.ts +1 -1
- package/src/api/manifest-contract.js +1 -1
- package/src/apps/a11y-panel.js +2 -1
- package/src/apps/deps-panel.js +2 -1
- package/src/apps/islands-panel.js +2 -1
- package/src/apps/navigation-panel.js +2 -1
- package/src/config.d.ts +1 -1
- package/src/config.js +1 -1
- package/src/islands/island-record-builder.js +7 -1
- package/src/islands/read-island-records.test.browser.js +5 -0
- package/src/runtime/navigation-events.d.ts +2 -1
- package/src/runtime/navigation-events.js +1 -0
- package/src/runtime/navigation-telemetry.d.ts +0 -2
- package/src/runtime/navigation-telemetry.js +8 -23
- package/src/shell/build-errors.test.browser.d.ts +1 -0
- package/src/shell/build-errors.test.browser.js +124 -0
- package/src/shell/eco-dev-toolbar.d.ts +3 -0
- package/src/shell/eco-dev-toolbar.js +38 -4
- package/src/shell/ensure-dev-toolbar-styles.js +2 -1
- package/src/shell/styles/content.d.ts +1 -1
- package/src/shell/styles/content.js +6 -0
package/README.md
CHANGED
|
@@ -9,13 +9,10 @@ User-facing docs: [Dev toolbar](https://ecopages.dev/docs/core/dev-toolbar) (ena
|
|
|
9
9
|
Add the package to your app and opt in from config:
|
|
10
10
|
|
|
11
11
|
```ts
|
|
12
|
-
import {
|
|
12
|
+
import { defineConfig } from '@ecopages/core/config';
|
|
13
13
|
import { devToolbar } from '@ecopages/dev-toolbar/config';
|
|
14
14
|
|
|
15
|
-
export default
|
|
16
|
-
.setRootDir(import.meta.dirname)
|
|
17
|
-
.setDevToolbar(devToolbar())
|
|
18
|
-
.build();
|
|
15
|
+
export default defineConfig({ devToolbar: devToolbar() });
|
|
19
16
|
```
|
|
20
17
|
|
|
21
18
|
```bash
|
|
@@ -30,7 +27,8 @@ Disable per project with `devToolbar: { enabled: false }`, or per process with `
|
|
|
30
27
|
|
|
31
28
|
## Built-in apps
|
|
32
29
|
|
|
33
|
-
- **
|
|
30
|
+
- **Build errors** — opens automatically on HMR errors, reveals stealth mode, lists distinct messages as text, and shows an error count badge; any non-error HMR event clears messages and the badge
|
|
31
|
+
- **Navigation** — route timing archive, initial load, client navigation latency, HMR status, and page Integration (the current owner reported by core's navigation coordinator); writes `#__ECO_DEV_NAV_TELEMETRY__` in `document.head` (with `data-eco-persist`) and exposes `window.__ECO_DEV_NAV_TELEMETRY__` for machine/AI debug
|
|
34
32
|
- **Deps** — Page Browser Graph entry/chunk assets, vendor URLs, lazy-load hints
|
|
35
33
|
- **Islands** — inspect island hosts stamped with `data-eco-island`, including SSR-emitted React `<eco-island>` hosts; repeated component instances are shown independently and hydration status reports `hydrated` (via `data-eco-hydrated` or verified component update completion), `registered` (for defined custom elements awaiting update completion), or `ssr-only`
|
|
36
34
|
- **A11y** — axe-core audit (with built-in fallback checks) and in-page highlights
|
|
@@ -43,11 +41,13 @@ Core delivers the configured client at `/_dev_toolbar.js` and injects `#__ECO_DE
|
|
|
43
41
|
To replace this reference toolbar:
|
|
44
42
|
|
|
45
43
|
1. Create a client package that exports a browser bootstrap module (same layout as `@ecopages/dev-toolbar`).
|
|
46
|
-
2. Set `devToolbar.package` in `eco.config.ts` (use `defineDevTool` from `@ecopages/core/
|
|
44
|
+
2. Set `devToolbar.package` in `eco.config.ts` (use `defineDevTool` from `@ecopages/core/client` for BYO packages).
|
|
47
45
|
3. Fork or copy this package if you want Radiant panels, manifest readers, and stealth dock behavior.
|
|
48
46
|
|
|
49
47
|
`@ecopages/dev-toolbar` is the reference implementation.
|
|
50
48
|
|
|
49
|
+
Custom clients can claim the HMR runtime's cancelable `ecopages:build-error` window event (`detail: { message: string }`) with synchronous `preventDefault()` to suppress the in-page fallback. Listen for `ecopages:build-error-clear` to reset errors. After registering listeners, dispatch `ecopages:build-error-request` to replay active messages if mounting late. Core exports the names and payload type from `@ecopages/core/client`; the reference client mirrors the event names locally for browser bundling. Unclaimed errors still use the fallback. Remove listeners when unmounting.
|
|
50
|
+
|
|
51
51
|
## Reference-toolbar internals
|
|
52
52
|
|
|
53
53
|
`window.__ECO_DEV_TOOLBAR_APPS__` is an optional registry used inside this package for experimental extra dock apps. It is **not** a supported Ecopages extension API — app authors should replace `devToolbar.package` instead.
|
|
@@ -55,11 +55,13 @@ To replace this reference toolbar:
|
|
|
55
55
|
## Package layout
|
|
56
56
|
|
|
57
57
|
- `src/bootstrap.ts` — injects toolbar CSS into `document.head`, boots navigation telemetry, and mounts `eco-dev-toolbar`; reload-safe telemetry ownership prevents HMR bundle re-evaluation from adding duplicate document listeners
|
|
58
|
-
- `src/runtime/navigation-events.ts` — shares
|
|
58
|
+
- `src/runtime/navigation-events.ts` — shares core's navigation lifecycle event names and one DOM listener across toolbar apps, removing it when the final subscriber unmounts
|
|
59
|
+
- `src/runtime/navigation-telemetry.ts` — reads the current owner from `getOwnerState()` so browser and React router ownership is reported consistently
|
|
59
60
|
- `src/shell/eco-dev-toolbar.tsx` — Radiant light-DOM host (JSX `render()`, no shadow root); panel positioning is pure CSS
|
|
60
61
|
- `src/shell/motion.ts` — WAAPI motion for stealth dock reveal only; panel show/hide is CSS
|
|
61
62
|
- `src/apps/*-panel.tsx` — Radiant JSX panels (navigation, deps, islands, a11y, settings)
|
|
62
63
|
- `src/api/manifest-contract.ts` — browser-local mirror of the core dev manifest contract
|
|
64
|
+
- `src/api/build-error-contract.ts` — browser-local event names checked against the public core build error contract
|
|
63
65
|
- `src/api/dev-manifest.ts` — internal DOM read/write for `#__ECO_DEV_MANIFEST__`
|
|
64
66
|
- `src/api/types.ts` — toolbar app host contracts
|
|
65
67
|
- `src/shell/` — custom element host, SVG icons, styles, and `ensureDevToolbarStyles()` (optional CSS override for BYO toolbars)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecopages/dev-toolbar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Development toolbar for Ecopages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ecopages",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"directory": "packages/dev-toolbar"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@ecopages/jsx": "^0.
|
|
44
|
-
"@ecopages/radiant": "^0.
|
|
45
|
-
"@ecopages/signals": "^0.
|
|
43
|
+
"@ecopages/jsx": "^0.4.0",
|
|
44
|
+
"@ecopages/radiant": "^0.4.0",
|
|
45
|
+
"@ecopages/signals": "^0.4.0",
|
|
46
46
|
"axe-core": "^4.10.3"
|
|
47
47
|
},
|
|
48
48
|
"types": "./src/bootstrap.d.ts"
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { type BuildErrorDetail } from '@ecopages/core/client';
|
|
2
|
+
export declare const BUILD_ERROR_EVENT = "ecopages:build-error";
|
|
3
|
+
export declare const BUILD_ERROR_CLEAR_EVENT = "ecopages:build-error-clear";
|
|
4
|
+
export declare const BUILD_ERROR_REQUEST_EVENT = "ecopages:build-error-request";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Browser-local mirror of `@ecopages/core/
|
|
2
|
+
* Browser-local mirror of `@ecopages/core/client`.
|
|
3
3
|
*
|
|
4
4
|
* @remarks Dev-toolbar is browser-bundled separately; Rolldown cannot resolve core
|
|
5
5
|
* package export subpaths from the client entry. Keep in sync with core via
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Browser-local mirror of `@ecopages/core/
|
|
2
|
+
* Browser-local mirror of `@ecopages/core/client`.
|
|
3
3
|
*
|
|
4
4
|
* @remarks Dev-toolbar is browser-bundled separately; Rolldown cannot resolve core
|
|
5
5
|
* package export subpaths from the client entry. Keep in sync with core via
|
package/src/apps/a11y-panel.js
CHANGED
|
@@ -9,6 +9,7 @@ import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "@ecopages/jsx
|
|
|
9
9
|
import { RadiantElement } from '@ecopages/radiant';
|
|
10
10
|
import { customElement } from '@ecopages/radiant/decorators/custom-element';
|
|
11
11
|
import { state } from '@ecopages/radiant/decorators/state';
|
|
12
|
+
import { ECO_NAVIGATION_LIFECYCLE_EVENTS } from '@ecopages/core/client';
|
|
12
13
|
import { toA11yBadge } from './a11y/a11y-badge.js';
|
|
13
14
|
import { resolveA11yIssueElement, runA11yChecks, toA11yIssueView } from './a11y/run-a11y-checks.js';
|
|
14
15
|
import { groupA11yIssues } from './a11y/a11y-issue-groups.js';
|
|
@@ -41,7 +42,7 @@ let EcoDevToolbarA11y = class EcoDevToolbarA11y extends RadiantElement {
|
|
|
41
42
|
}
|
|
42
43
|
connectedCallback() {
|
|
43
44
|
super.connectedCallback();
|
|
44
|
-
this.unsubscribeNavigationEvents = subscribeToNavigationEvents(this.ownerDocument, [
|
|
45
|
+
this.unsubscribeNavigationEvents = subscribeToNavigationEvents(this.ownerDocument, [ECO_NAVIGATION_LIFECYCLE_EVENTS.PAGE_LOAD, ECO_NAVIGATION_LIFECYCLE_EVENTS.AFTER_SWAP], this.scheduleAudit);
|
|
45
46
|
void this.runAudit();
|
|
46
47
|
}
|
|
47
48
|
disconnectedCallback() {
|
package/src/apps/deps-panel.js
CHANGED
|
@@ -9,6 +9,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@ecopages/jsx
|
|
|
9
9
|
import { RadiantElement } from '@ecopages/radiant';
|
|
10
10
|
import { customElement } from '@ecopages/radiant/decorators/custom-element';
|
|
11
11
|
import { state } from '@ecopages/radiant/decorators/state';
|
|
12
|
+
import { ECO_NAVIGATION_LIFECYCLE_EVENTS } from '@ecopages/core/client';
|
|
12
13
|
import { DEV_TOOLBAR_DEPS_REFRESH_DEBOUNCE_MS } from '../runtime/constants.js';
|
|
13
14
|
import { isPanelSlotVisible, observePanelSlotVisibility } from '../shell/panel-slot-visibility.js';
|
|
14
15
|
import { loadDepsInsights } from './deps/load-deps-insights.js';
|
|
@@ -28,7 +29,7 @@ let EcoDevToolbarDeps = class EcoDevToolbarDeps extends RadiantElement {
|
|
|
28
29
|
unsubscribeNavigationEvents;
|
|
29
30
|
connectedCallback() {
|
|
30
31
|
super.connectedCallback();
|
|
31
|
-
this.unsubscribeNavigationEvents = subscribeToNavigationEvents(this.ownerDocument, [
|
|
32
|
+
this.unsubscribeNavigationEvents = subscribeToNavigationEvents(this.ownerDocument, [ECO_NAVIGATION_LIFECYCLE_EVENTS.PAGE_LOAD, ECO_NAVIGATION_LIFECYCLE_EVENTS.AFTER_SWAP], this.scheduleRefresh);
|
|
32
33
|
this.wireVisibilityObserver();
|
|
33
34
|
void this.refresh();
|
|
34
35
|
}
|
|
@@ -9,6 +9,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "@ecopages/jsx/jsx-runtime";
|
|
|
9
9
|
import { RadiantElement } from '@ecopages/radiant';
|
|
10
10
|
import { customElement } from '@ecopages/radiant/decorators/custom-element';
|
|
11
11
|
import { state } from '@ecopages/radiant/decorators/state';
|
|
12
|
+
import { ECO_NAVIGATION_LIFECYCLE_EVENTS } from '@ecopages/core/client';
|
|
12
13
|
import { readIslandRecords, resolveIslandElement, toIslandRecordView, } from '../islands/read-island-records.js';
|
|
13
14
|
import { highlightElement } from '../runtime/highlight-element.js';
|
|
14
15
|
import { subscribeToNavigationEvents } from '../runtime/navigation-events.js';
|
|
@@ -28,7 +29,7 @@ let EcoDevToolbarIslands = class EcoDevToolbarIslands extends RadiantElement {
|
|
|
28
29
|
super.connectedCallback();
|
|
29
30
|
this.refresh();
|
|
30
31
|
this.wireMutationObserver();
|
|
31
|
-
this.unsubscribeNavigationEvents = subscribeToNavigationEvents(this.ownerDocument, [
|
|
32
|
+
this.unsubscribeNavigationEvents = subscribeToNavigationEvents(this.ownerDocument, [ECO_NAVIGATION_LIFECYCLE_EVENTS.PAGE_LOAD, ECO_NAVIGATION_LIFECYCLE_EVENTS.AFTER_SWAP], this.scheduleRefresh);
|
|
32
33
|
}
|
|
33
34
|
disconnectedCallback() {
|
|
34
35
|
this.unsubscribeNavigationEvents?.();
|
|
@@ -9,6 +9,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "@ecopages/jsx/jsx-runtime";
|
|
|
9
9
|
import { RadiantElement } from '@ecopages/radiant';
|
|
10
10
|
import { customElement } from '@ecopages/radiant/decorators/custom-element';
|
|
11
11
|
import { state } from '@ecopages/radiant/decorators/state';
|
|
12
|
+
import { ECO_NAVIGATION_LIFECYCLE_EVENTS } from '@ecopages/core/client';
|
|
12
13
|
import { readDevManifestFromDocument } from '../api/dev-manifest.js';
|
|
13
14
|
import { DEV_TOOLBAR_NAV_HISTORY_PAGE_SIZE } from '../runtime/constants.js';
|
|
14
15
|
import { clearNavigationTelemetryHistory, readNavigationTelemetrySnapshot, } from '../runtime/navigation-telemetry.js';
|
|
@@ -29,7 +30,7 @@ let EcoDevToolbarNavigation = class EcoDevToolbarNavigation extends RadiantEleme
|
|
|
29
30
|
unsubscribeNavigationEvents;
|
|
30
31
|
connectedCallback() {
|
|
31
32
|
super.connectedCallback();
|
|
32
|
-
this.unsubscribeNavigationEvents = subscribeToNavigationEvents(this.ownerDocument, [
|
|
33
|
+
this.unsubscribeNavigationEvents = subscribeToNavigationEvents(this.ownerDocument, [ECO_NAVIGATION_LIFECYCLE_EVENTS.PAGE_LOAD, ECO_NAVIGATION_LIFECYCLE_EVENTS.AFTER_SWAP], this.refresh);
|
|
33
34
|
}
|
|
34
35
|
disconnectedCallback() {
|
|
35
36
|
this.unsubscribeNavigationEvents?.();
|
package/src/config.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export type DevToolbarConfig = {
|
|
|
8
8
|
enabled?: boolean;
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
|
-
* Returns the `devToolbar`
|
|
11
|
+
* Returns the `devToolbar` block for `defineConfig({ devToolbar })`.
|
|
12
12
|
*/
|
|
13
13
|
export declare function devToolbar(options?: DevToolbarOptions): DevToolbarConfig;
|
|
14
14
|
export {};
|
package/src/config.js
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @remarks
|
|
3
|
+
* Browser-local mirror of the decode for core's `encodeIslandProps` (base64 of UTF-8 JSON). The toolbar
|
|
4
|
+
* cannot import core, which already lists the toolbar as an optional peer.
|
|
5
|
+
*/
|
|
1
6
|
function parsePropsPreview(encoded) {
|
|
2
7
|
if (!encoded) {
|
|
3
8
|
return '';
|
|
4
9
|
}
|
|
5
10
|
try {
|
|
6
|
-
|
|
11
|
+
const json = new TextDecoder().decode(Uint8Array.from(atob(encoded), (char) => char.charCodeAt(0)));
|
|
12
|
+
return JSON.stringify(JSON.parse(json), null, 0).slice(0, 120);
|
|
7
13
|
}
|
|
8
14
|
catch {
|
|
9
15
|
return '(invalid props)';
|
|
@@ -16,6 +16,11 @@ describe('readIslandRecords', () => {
|
|
|
16
16
|
expect(records[1].componentKey).toBe('standalone-1');
|
|
17
17
|
expect(records[2].componentKey).toBe('standalone-2');
|
|
18
18
|
});
|
|
19
|
+
it('previews props that contain non-Latin-1 text', () => {
|
|
20
|
+
/** Props as core's `encodeIslandProps` writes them. */
|
|
21
|
+
document.body.innerHTML = `<eco-island data-eco-island data-eco-component-key="unicode" data-eco-props="eyJsYWJlbCI6IjEwIOKCrCIsImNpdHkiOiLmnbHkuqwiLCJpY29uIjoi8J+ZgiJ9"></eco-island>`;
|
|
22
|
+
expect(readIslandRecords(document)[0].propsPreview).toBe(JSON.stringify({ label: '10 €', city: '東京', icon: '🙂' }));
|
|
23
|
+
});
|
|
19
24
|
it('respects integration metadata over componentKey for island kind', () => {
|
|
20
25
|
document.body.innerHTML = `
|
|
21
26
|
<my-lit-island data-eco-island data-eco-island-integration="lit" data-eco-component-key="lit-counter"></my-lit-island>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { ECO_NAVIGATION_LIFECYCLE_EVENTS } from '@ecopages/core/client';
|
|
2
|
+
export type NavigationLifecycleEvent = (typeof ECO_NAVIGATION_LIFECYCLE_EVENTS)[keyof typeof ECO_NAVIGATION_LIFECYCLE_EVENTS];
|
|
2
3
|
type NavigationListener = () => void;
|
|
3
4
|
/**
|
|
4
5
|
* Shares one DOM listener per navigation event while allowing toolbar panels to subscribe independently.
|
|
@@ -40,8 +40,6 @@ export type NavigationTelemetryApi = {
|
|
|
40
40
|
getSnapshot: () => NavigationTelemetrySnapshot;
|
|
41
41
|
clearHistory: () => NavigationTelemetrySnapshot;
|
|
42
42
|
};
|
|
43
|
-
/** @internal */
|
|
44
|
-
export declare function resetNavigationTelemetryForTests(): void;
|
|
45
43
|
/**
|
|
46
44
|
* Boots route timing collection, DOM JSON trace export, and `window.__ECO_DEV_NAV_TELEMETRY__`.
|
|
47
45
|
*/
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ECO_NAVIGATION_LIFECYCLE_EVENTS } from '@ecopages/core/client';
|
|
2
|
+
import { ECO_PERSIST_ATTRIBUTE } from '@ecopages/core/client';
|
|
1
3
|
import { DEV_TOOLBAR_NAV_TELEMETRY_PERSIST_KEY } from './constants.js';
|
|
2
4
|
import { subscribeToNavigationEvents } from './navigation-events.js';
|
|
3
5
|
export const NAV_TELEMETRY_ELEMENT_ID = '__ECO_DEV_NAV_TELEMETRY__';
|
|
@@ -10,31 +12,14 @@ let swapStartedAt = null;
|
|
|
10
12
|
let initialized = false;
|
|
11
13
|
let telemetryDocument;
|
|
12
14
|
let disposeTelemetryListeners;
|
|
13
|
-
/** @internal */
|
|
14
|
-
export function resetNavigationTelemetryForTests() {
|
|
15
|
-
disposeTelemetryListeners?.();
|
|
16
|
-
disposeTelemetryListeners = undefined;
|
|
17
|
-
if (typeof window !== 'undefined') {
|
|
18
|
-
const telemetryWindow = window;
|
|
19
|
-
telemetryWindow.__ECO_DEV_NAV_TELEMETRY_RUNTIME__?.dispose();
|
|
20
|
-
delete telemetryWindow.__ECO_DEV_NAV_TELEMETRY_RUNTIME__;
|
|
21
|
-
delete telemetryWindow.__ECO_DEV_NAV_TELEMETRY__;
|
|
22
|
-
}
|
|
23
|
-
initialized = false;
|
|
24
|
-
telemetryDocument = undefined;
|
|
25
|
-
nextEntryId = 0;
|
|
26
|
-
activeEntry = null;
|
|
27
|
-
history = [];
|
|
28
|
-
swapStartedAt = null;
|
|
29
|
-
}
|
|
30
15
|
function createEntryId() {
|
|
31
16
|
nextEntryId += 1;
|
|
32
17
|
return `nav-${nextEntryId}`;
|
|
33
18
|
}
|
|
34
19
|
function getNavigationOwner() {
|
|
35
20
|
const runtime = window.__ECO_PAGES__?.navigation;
|
|
36
|
-
const owner = runtime?.
|
|
37
|
-
if (owner) {
|
|
21
|
+
const owner = runtime?.getOwnerState().owner;
|
|
22
|
+
if (owner && owner !== 'none') {
|
|
38
23
|
return owner;
|
|
39
24
|
}
|
|
40
25
|
if (window.__ecopages_browser_router__) {
|
|
@@ -119,7 +104,7 @@ function syncTelemetryElement(doc = getTelemetryDocument()) {
|
|
|
119
104
|
const script = doc.createElement('script');
|
|
120
105
|
script.id = NAV_TELEMETRY_ELEMENT_ID;
|
|
121
106
|
script.setAttribute('type', 'application/json');
|
|
122
|
-
script.setAttribute(
|
|
107
|
+
script.setAttribute(ECO_PERSIST_ATTRIBUTE, DEV_TOOLBAR_NAV_TELEMETRY_PERSIST_KEY);
|
|
123
108
|
element = script;
|
|
124
109
|
doc.head.append(element);
|
|
125
110
|
}
|
|
@@ -250,9 +235,9 @@ export function initNavigationTelemetry(doc = document) {
|
|
|
250
235
|
recordInitialLoad(doc);
|
|
251
236
|
};
|
|
252
237
|
const handleDomContentLoaded = () => recordInitialLoad(doc);
|
|
253
|
-
const unsubscribeBeforeSwap = subscribeToNavigationEvents(doc, [
|
|
254
|
-
const unsubscribeAfterSwap = subscribeToNavigationEvents(doc, [
|
|
255
|
-
const unsubscribePageLoad = subscribeToNavigationEvents(doc, [
|
|
238
|
+
const unsubscribeBeforeSwap = subscribeToNavigationEvents(doc, [ECO_NAVIGATION_LIFECYCLE_EVENTS.BEFORE_SWAP], handleBeforeSwap);
|
|
239
|
+
const unsubscribeAfterSwap = subscribeToNavigationEvents(doc, [ECO_NAVIGATION_LIFECYCLE_EVENTS.AFTER_SWAP], handleAfterSwap);
|
|
240
|
+
const unsubscribePageLoad = subscribeToNavigationEvents(doc, [ECO_NAVIGATION_LIFECYCLE_EVENTS.PAGE_LOAD], handlePageLoad);
|
|
256
241
|
if (doc.readyState === 'complete' || doc.readyState === 'interactive') {
|
|
257
242
|
recordInitialLoad(doc);
|
|
258
243
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { beforeAll, afterAll, afterEach, expect, it, vi } from 'vitest';
|
|
2
|
+
import { userEvent } from 'vitest/browser';
|
|
3
|
+
import { BUILD_ERROR_EVENT, BUILD_ERROR_CLEAR_EVENT, BUILD_ERROR_REQUEST_EVENT, } from '@ecopages/core/client';
|
|
4
|
+
import { EcoDevToolbar } from './eco-dev-toolbar.js';
|
|
5
|
+
import { ensureDevToolbarStyles } from './ensure-dev-toolbar-styles.js';
|
|
6
|
+
const BUILD_ERROR_OVERLAY_ID = '__ecopages_build_error__';
|
|
7
|
+
class FakeSocket {
|
|
8
|
+
url;
|
|
9
|
+
static instances = [];
|
|
10
|
+
listeners = new Map();
|
|
11
|
+
constructor(url) {
|
|
12
|
+
this.url = url;
|
|
13
|
+
FakeSocket.instances.push(this);
|
|
14
|
+
}
|
|
15
|
+
addEventListener(type, listener) {
|
|
16
|
+
this.listeners.set(type, listener);
|
|
17
|
+
}
|
|
18
|
+
receive(payload) {
|
|
19
|
+
this.listeners.get('message')?.({ data: JSON.stringify(payload) });
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
afterAll(() => {
|
|
23
|
+
vi.unstubAllGlobals();
|
|
24
|
+
vi.restoreAllMocks();
|
|
25
|
+
});
|
|
26
|
+
beforeAll(async () => {
|
|
27
|
+
vi.spyOn(console, 'error').mockImplementation(() => undefined);
|
|
28
|
+
vi.spyOn(console, 'log').mockImplementation(() => undefined);
|
|
29
|
+
vi.stubGlobal('WebSocket', FakeSocket);
|
|
30
|
+
await import('@ecopages/core/hmr/client/hmr-runtime');
|
|
31
|
+
});
|
|
32
|
+
afterEach(() => {
|
|
33
|
+
FakeSocket.instances[0].receive({ type: 'css-update' });
|
|
34
|
+
document.querySelector('eco-dev-toolbar')?.remove();
|
|
35
|
+
});
|
|
36
|
+
it('shows unique errors in the toolbar, reveals stealth mode, and clears after recovery', async () => {
|
|
37
|
+
ensureDevToolbarStyles();
|
|
38
|
+
const toolbar = EcoDevToolbar.mount();
|
|
39
|
+
toolbar.applyPreferences({ stealth: true });
|
|
40
|
+
const socket = FakeSocket.instances[0];
|
|
41
|
+
socket.receive({ type: 'error', message: 'syntax error <script> in widget.ts' });
|
|
42
|
+
socket.receive({ type: 'error', message: 'syntax error <script> in widget.ts' });
|
|
43
|
+
socket.receive({ type: 'error', message: 'second failure' });
|
|
44
|
+
await vi.waitFor(() => expect(toolbar.querySelectorAll('pre').length).toBe(2));
|
|
45
|
+
expect(toolbar.querySelector('pre')?.textContent).toBe('syntax error <script> in widget.ts');
|
|
46
|
+
expect(toolbar.querySelector('pre script')).toBeNull();
|
|
47
|
+
expect(document.getElementById(BUILD_ERROR_OVERLAY_ID)).toBeNull();
|
|
48
|
+
expect(toolbar.querySelector('[aria-label="Build errors"] .eco-dev-toolbar__badge')?.textContent).toBe('2');
|
|
49
|
+
expect(toolbar.querySelector('.eco-dev-toolbar__shell')?.getAttribute('data-stealth')).toBeNull();
|
|
50
|
+
await userEvent.click(toolbar.querySelector('button[aria-label="Build errors"]'));
|
|
51
|
+
await vi.waitFor(() => expect(toolbar.querySelector('button[aria-label="Build errors"]')?.getAttribute('aria-pressed')).toBe('false'));
|
|
52
|
+
await userEvent.click(toolbar.querySelector('button[aria-label="Build errors"]'));
|
|
53
|
+
await vi.waitFor(() => expect(toolbar.querySelector('button[aria-label="Build errors"]')?.getAttribute('aria-pressed')).toBe('true'));
|
|
54
|
+
socket.receive({ type: 'css-update' });
|
|
55
|
+
await vi.waitFor(() => expect(toolbar.querySelectorAll('pre').length).toBe(0));
|
|
56
|
+
expect(toolbar.querySelector('[aria-label="Build errors"] .eco-dev-toolbar__badge')).toBeNull();
|
|
57
|
+
toolbar.applyPreferences({ stealth: false });
|
|
58
|
+
});
|
|
59
|
+
it('moves a pending fallback into a late toolbar and restores fallback after unmount', async () => {
|
|
60
|
+
const socket = FakeSocket.instances[0];
|
|
61
|
+
socket.receive({ type: 'error', message: 'pending error' });
|
|
62
|
+
expect(document.getElementById(BUILD_ERROR_OVERLAY_ID)?.textContent).toContain('pending error');
|
|
63
|
+
await userEvent.click(document.getElementById(BUILD_ERROR_OVERLAY_ID).querySelector('button'));
|
|
64
|
+
expect(document.getElementById(BUILD_ERROR_OVERLAY_ID)).toBeNull();
|
|
65
|
+
const toolbar = EcoDevToolbar.mount();
|
|
66
|
+
await vi.waitFor(() => expect(toolbar.querySelector('pre')?.textContent).toBe('pending error'));
|
|
67
|
+
expect(toolbar.querySelectorAll('pre')).toHaveLength(1);
|
|
68
|
+
expect(document.getElementById(BUILD_ERROR_OVERLAY_ID)).toBeNull();
|
|
69
|
+
toolbar.remove();
|
|
70
|
+
socket.receive({ type: 'error', message: 'unmounted error' });
|
|
71
|
+
expect(document.getElementById(BUILD_ERROR_OVERLAY_ID)?.textContent).toContain('unmounted error');
|
|
72
|
+
socket.receive({ type: 'css-update' });
|
|
73
|
+
document.documentElement.append(toolbar);
|
|
74
|
+
await vi.waitFor(() => expect(toolbar.querySelector('pre')).toBeNull());
|
|
75
|
+
expect(toolbar.querySelector('[aria-label="Build errors"] .eco-dev-toolbar__badge')).toBeNull();
|
|
76
|
+
});
|
|
77
|
+
it('lets a custom client claim errors synchronously and leaves fallback for unclaimed errors', () => {
|
|
78
|
+
const claim = (event) => event.preventDefault();
|
|
79
|
+
window.addEventListener(BUILD_ERROR_EVENT, claim);
|
|
80
|
+
try {
|
|
81
|
+
FakeSocket.instances[0].receive({ type: 'error', message: 'custom presentation' });
|
|
82
|
+
expect(document.getElementById(BUILD_ERROR_OVERLAY_ID)).toBeNull();
|
|
83
|
+
}
|
|
84
|
+
finally {
|
|
85
|
+
window.removeEventListener(BUILD_ERROR_EVENT, claim);
|
|
86
|
+
}
|
|
87
|
+
FakeSocket.instances[0].receive({ type: 'error', message: 'unclaimed error' });
|
|
88
|
+
expect(document.getElementById(BUILD_ERROR_OVERLAY_ID)?.textContent).toContain('unclaimed error');
|
|
89
|
+
});
|
|
90
|
+
it('replays active errors with selective ownership and clears custom clients after recovery', () => {
|
|
91
|
+
const socket = FakeSocket.instances[0];
|
|
92
|
+
socket.receive({ type: 'error', message: 'claimed failure' });
|
|
93
|
+
socket.receive({ type: 'error', message: 'fallback failure' });
|
|
94
|
+
const received = [];
|
|
95
|
+
const claim = (event) => {
|
|
96
|
+
const detail = event.detail;
|
|
97
|
+
received.push(detail);
|
|
98
|
+
if (detail.message === 'claimed failure')
|
|
99
|
+
event.preventDefault();
|
|
100
|
+
};
|
|
101
|
+
const clear = vi.fn();
|
|
102
|
+
window.addEventListener(BUILD_ERROR_EVENT, claim);
|
|
103
|
+
window.addEventListener(BUILD_ERROR_CLEAR_EVENT, clear);
|
|
104
|
+
try {
|
|
105
|
+
window.dispatchEvent(new Event(BUILD_ERROR_REQUEST_EVENT));
|
|
106
|
+
expect(received).toEqual([{ message: 'claimed failure' }, { message: 'fallback failure' }]);
|
|
107
|
+
const fallback = document.getElementById(BUILD_ERROR_OVERLAY_ID);
|
|
108
|
+
expect(fallback.textContent).not.toContain('claimed failure');
|
|
109
|
+
expect(fallback.querySelectorAll('pre')).toHaveLength(1);
|
|
110
|
+
expect(fallback.querySelector('pre')?.textContent).toBe('fallback failure');
|
|
111
|
+
window.dispatchEvent(new Event(BUILD_ERROR_REQUEST_EVENT));
|
|
112
|
+
expect(document.getElementById(BUILD_ERROR_OVERLAY_ID)?.querySelectorAll('pre')).toHaveLength(1);
|
|
113
|
+
socket.receive({ type: 'css-update' });
|
|
114
|
+
expect(clear).toHaveBeenCalledTimes(1);
|
|
115
|
+
expect(document.getElementById(BUILD_ERROR_OVERLAY_ID)).toBeNull();
|
|
116
|
+
received.length = 0;
|
|
117
|
+
window.dispatchEvent(new Event(BUILD_ERROR_REQUEST_EVENT));
|
|
118
|
+
expect(received).toEqual([]);
|
|
119
|
+
}
|
|
120
|
+
finally {
|
|
121
|
+
window.removeEventListener(BUILD_ERROR_EVENT, claim);
|
|
122
|
+
window.removeEventListener(BUILD_ERROR_CLEAR_EVENT, clear);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
@@ -21,6 +21,7 @@ export declare class EcoDevToolbar extends RadiantElement {
|
|
|
21
21
|
badges: Record<string, DevToolbarBadge | undefined>;
|
|
22
22
|
loadingApps: Record<string, boolean>;
|
|
23
23
|
mountedAppIds: string[];
|
|
24
|
+
buildErrors: string[];
|
|
24
25
|
/** Optional dock apps from the reference-toolbar internal registry (`window.__ECO_DEV_TOOLBAR_APPS__`). */
|
|
25
26
|
extensionApps: Array<{
|
|
26
27
|
id: string;
|
|
@@ -51,6 +52,8 @@ export declare class EcoDevToolbar extends RadiantElement {
|
|
|
51
52
|
private mountLegacyPanelWhenNeeded;
|
|
52
53
|
private wireDocumentListeners;
|
|
53
54
|
private unwireDocumentListeners;
|
|
55
|
+
private readonly handleBuildError;
|
|
56
|
+
private readonly handleBuildErrorClear;
|
|
54
57
|
private readonly handleOutsideClick;
|
|
55
58
|
private readonly handleNavigationStart;
|
|
56
59
|
private readonly handleNavigationEnd;
|
|
@@ -7,7 +7,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@ecopages/jsx/jsx-runtime";
|
|
8
8
|
/** @jsxImportSource @ecopages/jsx */
|
|
9
9
|
import '@ecopages/radiant/client/install-hydrator';
|
|
10
|
+
import { ECO_NAVIGATION_LIFECYCLE_EVENTS } from '@ecopages/core/client';
|
|
11
|
+
import { ECO_PERSIST_ATTRIBUTE } from '@ecopages/core/client';
|
|
10
12
|
import { RadiantElement } from '@ecopages/radiant';
|
|
13
|
+
import { BUILD_ERROR_EVENT, BUILD_ERROR_CLEAR_EVENT, BUILD_ERROR_REQUEST_EVENT, } from '../api/build-error-contract.js';
|
|
11
14
|
import { customElement } from '@ecopages/radiant/decorators/custom-element';
|
|
12
15
|
import { onUpdated } from '@ecopages/radiant/decorators/on-updated';
|
|
13
16
|
import { query } from '@ecopages/radiant/decorators/query';
|
|
@@ -27,6 +30,7 @@ import { DevToolbarNavigationLoading } from './navigation-loading.js';
|
|
|
27
30
|
import { DevToolbarStealthController } from './stealth-controller.js';
|
|
28
31
|
import { subscribeToNavigationEvents } from '../runtime/navigation-events.js';
|
|
29
32
|
const BUILT_IN_APPS = [
|
|
33
|
+
{ id: 'build-errors', label: 'Build errors' },
|
|
30
34
|
{ id: 'navigation', label: 'Navigation' },
|
|
31
35
|
{ id: 'deps', label: 'Deps' },
|
|
32
36
|
{ id: 'islands', label: 'Islands' },
|
|
@@ -44,6 +48,7 @@ let EcoDevToolbar = class EcoDevToolbar extends RadiantElement {
|
|
|
44
48
|
badges = {};
|
|
45
49
|
loadingApps = {};
|
|
46
50
|
mountedAppIds = [];
|
|
51
|
+
buildErrors = [];
|
|
47
52
|
/** Optional dock apps from the reference-toolbar internal registry (`window.__ECO_DEV_TOOLBAR_APPS__`). */
|
|
48
53
|
extensionApps = [];
|
|
49
54
|
legacyPanel;
|
|
@@ -84,7 +89,7 @@ let EcoDevToolbar = class EcoDevToolbar extends RadiantElement {
|
|
|
84
89
|
let host = document.querySelector(DEV_TOOLBAR_ELEMENT_NAME);
|
|
85
90
|
if (!host) {
|
|
86
91
|
host = document.createElement(DEV_TOOLBAR_ELEMENT_NAME);
|
|
87
|
-
host.setAttribute(
|
|
92
|
+
host.setAttribute(ECO_PERSIST_ATTRIBUTE, DEV_TOOLBAR_PERSIST_KEY);
|
|
88
93
|
document.documentElement.append(host);
|
|
89
94
|
}
|
|
90
95
|
return host;
|
|
@@ -101,8 +106,14 @@ let EcoDevToolbar = class EcoDevToolbar extends RadiantElement {
|
|
|
101
106
|
if (this.stealthEnabled) {
|
|
102
107
|
this.stealthController.setPhase('hidden');
|
|
103
108
|
}
|
|
109
|
+
this.handleBuildErrorClear();
|
|
110
|
+
window.addEventListener(BUILD_ERROR_EVENT, this.handleBuildError);
|
|
111
|
+
window.addEventListener(BUILD_ERROR_CLEAR_EVENT, this.handleBuildErrorClear);
|
|
112
|
+
window.dispatchEvent(new Event(BUILD_ERROR_REQUEST_EVENT));
|
|
104
113
|
}
|
|
105
114
|
disconnectedCallback() {
|
|
115
|
+
window.removeEventListener(BUILD_ERROR_EVENT, this.handleBuildError);
|
|
116
|
+
window.removeEventListener(BUILD_ERROR_CLEAR_EVENT, this.handleBuildErrorClear);
|
|
106
117
|
this.unwireDocumentListeners();
|
|
107
118
|
this.stealthController.clearTimers();
|
|
108
119
|
this.navigationLoading.clear();
|
|
@@ -193,9 +204,9 @@ let EcoDevToolbar = class EcoDevToolbar extends RadiantElement {
|
|
|
193
204
|
return;
|
|
194
205
|
}
|
|
195
206
|
document.addEventListener('click', this.handleOutsideClick, true);
|
|
196
|
-
this.unsubscribeNavigationEvents = subscribeToNavigationEvents(document, [
|
|
197
|
-
const unsubscribeNavigationEnd = subscribeToNavigationEvents(document, [
|
|
198
|
-
const unsubscribeRouteChange = subscribeToNavigationEvents(document, [
|
|
207
|
+
this.unsubscribeNavigationEvents = subscribeToNavigationEvents(document, [ECO_NAVIGATION_LIFECYCLE_EVENTS.BEFORE_SWAP], this.handleNavigationStart);
|
|
208
|
+
const unsubscribeNavigationEnd = subscribeToNavigationEvents(document, [ECO_NAVIGATION_LIFECYCLE_EVENTS.AFTER_SWAP, ECO_NAVIGATION_LIFECYCLE_EVENTS.PAGE_LOAD], this.handleNavigationEnd);
|
|
209
|
+
const unsubscribeRouteChange = subscribeToNavigationEvents(document, [ECO_NAVIGATION_LIFECYCLE_EVENTS.AFTER_SWAP, ECO_NAVIGATION_LIFECYCLE_EVENTS.PAGE_LOAD], this.handleRouteChange);
|
|
199
210
|
const unsubscribeExisting = this.unsubscribeNavigationEvents;
|
|
200
211
|
this.unsubscribeNavigationEvents = () => {
|
|
201
212
|
unsubscribeExisting();
|
|
@@ -213,6 +224,22 @@ let EcoDevToolbar = class EcoDevToolbar extends RadiantElement {
|
|
|
213
224
|
this.unsubscribeNavigationEvents = undefined;
|
|
214
225
|
this.documentListenersWired = false;
|
|
215
226
|
}
|
|
227
|
+
handleBuildError = (event) => {
|
|
228
|
+
const { message } = event.detail;
|
|
229
|
+
if (typeof message !== 'string')
|
|
230
|
+
return;
|
|
231
|
+
event.preventDefault();
|
|
232
|
+
if (!this.buildErrors.includes(message))
|
|
233
|
+
this.buildErrors = [...this.buildErrors, message];
|
|
234
|
+
this.setAppBadge('build-errors', { count: this.buildErrors.length, severity: 'error' });
|
|
235
|
+
this.openApp('build-errors');
|
|
236
|
+
};
|
|
237
|
+
handleBuildErrorClear = () => {
|
|
238
|
+
this.buildErrors = [];
|
|
239
|
+
this.setAppBadge('build-errors', undefined);
|
|
240
|
+
if (this.activeAppId === 'build-errors')
|
|
241
|
+
this.closePanel();
|
|
242
|
+
};
|
|
216
243
|
handleOutsideClick = (event) => {
|
|
217
244
|
if (!this.panelOpen || event.composedPath().includes(this)) {
|
|
218
245
|
return;
|
|
@@ -258,6 +285,8 @@ let EcoDevToolbar = class EcoDevToolbar extends RadiantElement {
|
|
|
258
285
|
renderAppIcon(appId) {
|
|
259
286
|
const loading = this.loadingApps[appId] === true;
|
|
260
287
|
switch (appId) {
|
|
288
|
+
case 'build-errors':
|
|
289
|
+
return (_jsx("span", { class: "eco-dev-toolbar__icon-text", "aria-hidden": "true", children: "!" }));
|
|
261
290
|
case 'navigation':
|
|
262
291
|
return _jsx(NavigationIcon, { loading: loading });
|
|
263
292
|
case 'deps':
|
|
@@ -281,6 +310,8 @@ let EcoDevToolbar = class EcoDevToolbar extends RadiantElement {
|
|
|
281
310
|
renderRadiantPanelSlot(appId) {
|
|
282
311
|
const visible = this.panelOpen && this.activeAppId === appId;
|
|
283
312
|
switch (appId) {
|
|
313
|
+
case 'build-errors':
|
|
314
|
+
return (_jsx("div", { class: "eco-dev-toolbar__panel-slot", hidden: !visible, children: _jsxs("section", { class: "eco-dev-toolbar__panel", "aria-label": "Build errors", children: [_jsx("h2", { children: "Build errors" }), _jsx("div", { role: "alert", children: this.buildErrors.map((message) => (_jsx("pre", { class: "eco-dev-toolbar__build-error", children: message }, message))) }), this.buildErrors.length === 0 ? (_jsx("p", { class: "eco-dev-toolbar__muted", children: "No build errors." })) : null] }) }, appId));
|
|
284
315
|
case 'navigation':
|
|
285
316
|
return (_jsx("div", { class: "eco-dev-toolbar__panel-slot", hidden: !visible, children: _jsx("eco-dev-toolbar-navigation", {}) }, appId));
|
|
286
317
|
case 'deps':
|
|
@@ -343,6 +374,9 @@ __decorate([
|
|
|
343
374
|
__decorate([
|
|
344
375
|
state
|
|
345
376
|
], EcoDevToolbar.prototype, "mountedAppIds", void 0);
|
|
377
|
+
__decorate([
|
|
378
|
+
state
|
|
379
|
+
], EcoDevToolbar.prototype, "buildErrors", void 0);
|
|
346
380
|
__decorate([
|
|
347
381
|
state
|
|
348
382
|
], EcoDevToolbar.prototype, "extensionApps", void 0);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ECO_PERSIST_ATTRIBUTE } from '@ecopages/core/client';
|
|
1
2
|
import { DEV_TOOLBAR_PERSIST_KEY } from '../runtime/constants.js';
|
|
2
3
|
import { DEV_TOOLBAR_STYLES } from './styles.js';
|
|
3
4
|
export const DEV_TOOLBAR_STYLES_ELEMENT_ID = 'eco-dev-toolbar-styles';
|
|
@@ -12,7 +13,7 @@ export function ensureDevToolbarStyles(styles = DEV_TOOLBAR_STYLES) {
|
|
|
12
13
|
}
|
|
13
14
|
const style = document.createElement('style');
|
|
14
15
|
style.id = DEV_TOOLBAR_STYLES_ELEMENT_ID;
|
|
15
|
-
style.setAttribute(
|
|
16
|
+
style.setAttribute(ECO_PERSIST_ATTRIBUTE, DEV_TOOLBAR_PERSIST_KEY);
|
|
16
17
|
style.textContent = styles;
|
|
17
18
|
document.head.append(style);
|
|
18
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const DEV_TOOLBAR_CONTENT_STYLES = "\n.eco-dev-toolbar__panel {\n\tpadding: 0.95rem 1rem 1.05rem;\n\tdisplay: grid;\n\tgap: 1rem;\n}\n\n.eco-dev-toolbar__panel h2 {\n\tmargin: 0 0 0.5rem;\n\tfont-size: 0.92rem;\n\tfont-weight: 600;\n\tletter-spacing: 0.01em;\n}\n\n.eco-dev-toolbar__muted {\n\tcolor: var(--eco-dev-toolbar-muted);\n\tmargin: 0;\n}\n\n.eco-dev-toolbar__docs-link {\n\tcolor: var(--eco-dev-toolbar-accent);\n\ttext-decoration: none;\n}\n\n.eco-dev-toolbar__docs-link:hover {\n\ttext-decoration: underline;\n}\n\n.eco-dev-toolbar__warning {\n\tcolor: var(--eco-dev-toolbar-warning);\n\tmargin-top: 0.25rem;\n}\n\n.eco-dev-toolbar__kv {\n\tdisplay: grid;\n\tgap: 0.45rem;\n\tmargin: 0;\n}\n\n.eco-dev-toolbar__kv > div {\n\tdisplay: grid;\n\tgrid-template-columns: 6rem 1fr;\n\tgap: 0.5rem;\n}\n\n.eco-dev-toolbar__kv dt {\n\tmargin: 0;\n\tcolor: var(--eco-dev-toolbar-muted);\n}\n\n.eco-dev-toolbar__kv dd {\n\tmargin: 0;\n\tword-break: break-word;\n}\n\n.eco-dev-toolbar__mono {\n\tfont-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n\tfont-size: 0.72rem;\n\tword-break: break-all;\n}\n\n.eco-dev-toolbar__table-wrap {\n\toverflow: auto;\n\tborder: 1px solid rgba(255, 255, 255, 0.08);\n\tborder-radius: 0.55rem;\n}\n\n.eco-dev-toolbar__table {\n\twidth: 100%;\n\tborder-collapse: collapse;\n\tfont-size: 0.72rem;\n}\n\n.eco-dev-toolbar__table th,\n.eco-dev-toolbar__table td {\n\tpadding: 0.45rem 0.55rem;\n\ttext-align: left;\n\tborder-bottom: 1px solid rgba(255, 255, 255, 0.06);\n\tvertical-align: top;\n}\n\n.eco-dev-toolbar__table th {\n\tcolor: var(--eco-dev-toolbar-muted);\n\tfont-weight: 600;\n}\n\n.eco-dev-toolbar__table tbody tr:last-child td {\n\tborder-bottom: 0;\n}\n\n.eco-dev-toolbar__list {\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\tdisplay: grid;\n\tgap: 0.65rem;\n}\n\n.eco-dev-toolbar__link {\n\tborder: 0;\n\tbackground: transparent;\n\tcolor: inherit;\n\tpadding: 0;\n\ttext-align: left;\n\tcursor: pointer;\n}\n\n.eco-dev-toolbar__list-entry {\n\tdisplay: grid;\n\tgap: 0.45rem;\n}\n\n.eco-dev-toolbar__issue-pagination {\n\tpadding: 0 0.15rem 0.1rem;\n}\n\n.eco-dev-toolbar__list-item {\n\tdisplay: grid;\n\tgap: 0.2rem;\n\twidth: 100%;\n\tborder: 1px solid rgba(255, 255, 255, 0.08);\n\tborder-radius: 0.5rem;\n\tbackground: color-mix(in srgb, var(--eco-dev-toolbar-bg) 92%, transparent);\n\tcolor: inherit;\n\tpadding: 0.55rem 0.65rem;\n\ttext-align: left;\n\tcursor: pointer;\n\ttransition: border-color 160ms var(--eco-dev-toolbar-ease);\n}\n\n.eco-dev-toolbar__dom-highlight[data-eco-dev-toolbar-highlight='a11y'] {\n\toutline: 2px solid #ff5c7a !important;\n\toutline-offset: 2px;\n}\n\n.eco-dev-toolbar__dom-highlight[data-eco-dev-toolbar-highlight='island'] {\n\toutline: 2px solid #7c5cff !important;\n\toutline-offset: 2px;\n}\n\n.eco-dev-toolbar__list-item:hover,\n.eco-dev-toolbar__list-item[data-highlighted='true'] {\n\tborder-color: rgba(139, 124, 255, 0.55);\n}\n\n.eco-dev-toolbar__pagination {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tgap: 0.75rem;\n}\n\n.eco-dev-toolbar__pagination-copy {\n\tmargin: 0;\n\tfont-size: 0.72rem;\n\tcolor: var(--eco-dev-toolbar-muted);\n}\n\n.eco-dev-toolbar__pagination-actions {\n\tdisplay: inline-flex;\n\tgap: 0.35rem;\n}\n\n.eco-dev-toolbar__pagination-button {\n\tborder: 1px solid rgba(255, 255, 255, 0.12);\n\tborder-radius: 0.45rem;\n\tbackground: color-mix(in srgb, var(--eco-dev-toolbar-bg) 92%, transparent);\n\tcolor: var(--eco-dev-toolbar-fg);\n\tfont: inherit;\n\tfont-size: 0.72rem;\n\tpadding: 0.28rem 0.55rem;\n\tcursor: pointer;\n}\n\n.eco-dev-toolbar__pagination-button:disabled {\n\topacity: 0.45;\n\tcursor: not-allowed;\n}\n\n.eco-dev-toolbar__status-pill {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tborder-radius: 999px;\n\tpadding: 0.1rem 0.45rem;\n\tfont-size: 0.68rem;\n\ttext-transform: uppercase;\n\tletter-spacing: 0.04em;\n}\n\n.eco-dev-toolbar__status-pill[data-status='aborted'] {\n\tbackground: rgba(245, 158, 11, 0.16);\n\tcolor: var(--eco-dev-toolbar-warning);\n}\n\n.eco-dev-toolbar__list-item strong {\n\tfont-size: 0.82rem;\n}\n\n.eco-dev-toolbar__list-item .eco-dev-toolbar__muted,\n.eco-dev-toolbar__list-item .eco-dev-toolbar__mono {\n\tdisplay: block;\n}\n\n.eco-dev-toolbar__field {\n\tdisplay: grid;\n\tgap: 0.35rem;\n}\n\n";
|
|
1
|
+
export declare const DEV_TOOLBAR_CONTENT_STYLES = "\n.eco-dev-toolbar__build-error {\n\twhite-space: pre-wrap;\n\toverflow-wrap: anywhere;\n\tfont: 0.75rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;\n}\n\n.eco-dev-toolbar__panel {\n\tpadding: 0.95rem 1rem 1.05rem;\n\tdisplay: grid;\n\tgap: 1rem;\n}\n\n.eco-dev-toolbar__panel h2 {\n\tmargin: 0 0 0.5rem;\n\tfont-size: 0.92rem;\n\tfont-weight: 600;\n\tletter-spacing: 0.01em;\n}\n\n.eco-dev-toolbar__muted {\n\tcolor: var(--eco-dev-toolbar-muted);\n\tmargin: 0;\n}\n\n.eco-dev-toolbar__docs-link {\n\tcolor: var(--eco-dev-toolbar-accent);\n\ttext-decoration: none;\n}\n\n.eco-dev-toolbar__docs-link:hover {\n\ttext-decoration: underline;\n}\n\n.eco-dev-toolbar__warning {\n\tcolor: var(--eco-dev-toolbar-warning);\n\tmargin-top: 0.25rem;\n}\n\n.eco-dev-toolbar__kv {\n\tdisplay: grid;\n\tgap: 0.45rem;\n\tmargin: 0;\n}\n\n.eco-dev-toolbar__kv > div {\n\tdisplay: grid;\n\tgrid-template-columns: 6rem 1fr;\n\tgap: 0.5rem;\n}\n\n.eco-dev-toolbar__kv dt {\n\tmargin: 0;\n\tcolor: var(--eco-dev-toolbar-muted);\n}\n\n.eco-dev-toolbar__kv dd {\n\tmargin: 0;\n\tword-break: break-word;\n}\n\n.eco-dev-toolbar__mono {\n\tfont-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n\tfont-size: 0.72rem;\n\tword-break: break-all;\n}\n\n.eco-dev-toolbar__table-wrap {\n\toverflow: auto;\n\tborder: 1px solid rgba(255, 255, 255, 0.08);\n\tborder-radius: 0.55rem;\n}\n\n.eco-dev-toolbar__table {\n\twidth: 100%;\n\tborder-collapse: collapse;\n\tfont-size: 0.72rem;\n}\n\n.eco-dev-toolbar__table th,\n.eco-dev-toolbar__table td {\n\tpadding: 0.45rem 0.55rem;\n\ttext-align: left;\n\tborder-bottom: 1px solid rgba(255, 255, 255, 0.06);\n\tvertical-align: top;\n}\n\n.eco-dev-toolbar__table th {\n\tcolor: var(--eco-dev-toolbar-muted);\n\tfont-weight: 600;\n}\n\n.eco-dev-toolbar__table tbody tr:last-child td {\n\tborder-bottom: 0;\n}\n\n.eco-dev-toolbar__list {\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\tdisplay: grid;\n\tgap: 0.65rem;\n}\n\n.eco-dev-toolbar__link {\n\tborder: 0;\n\tbackground: transparent;\n\tcolor: inherit;\n\tpadding: 0;\n\ttext-align: left;\n\tcursor: pointer;\n}\n\n.eco-dev-toolbar__list-entry {\n\tdisplay: grid;\n\tgap: 0.45rem;\n}\n\n.eco-dev-toolbar__issue-pagination {\n\tpadding: 0 0.15rem 0.1rem;\n}\n\n.eco-dev-toolbar__list-item {\n\tdisplay: grid;\n\tgap: 0.2rem;\n\twidth: 100%;\n\tborder: 1px solid rgba(255, 255, 255, 0.08);\n\tborder-radius: 0.5rem;\n\tbackground: color-mix(in srgb, var(--eco-dev-toolbar-bg) 92%, transparent);\n\tcolor: inherit;\n\tpadding: 0.55rem 0.65rem;\n\ttext-align: left;\n\tcursor: pointer;\n\ttransition: border-color 160ms var(--eco-dev-toolbar-ease);\n}\n\n.eco-dev-toolbar__dom-highlight[data-eco-dev-toolbar-highlight='a11y'] {\n\toutline: 2px solid #ff5c7a !important;\n\toutline-offset: 2px;\n}\n\n.eco-dev-toolbar__dom-highlight[data-eco-dev-toolbar-highlight='island'] {\n\toutline: 2px solid #7c5cff !important;\n\toutline-offset: 2px;\n}\n\n.eco-dev-toolbar__list-item:hover,\n.eco-dev-toolbar__list-item[data-highlighted='true'] {\n\tborder-color: rgba(139, 124, 255, 0.55);\n}\n\n.eco-dev-toolbar__pagination {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tgap: 0.75rem;\n}\n\n.eco-dev-toolbar__pagination-copy {\n\tmargin: 0;\n\tfont-size: 0.72rem;\n\tcolor: var(--eco-dev-toolbar-muted);\n}\n\n.eco-dev-toolbar__pagination-actions {\n\tdisplay: inline-flex;\n\tgap: 0.35rem;\n}\n\n.eco-dev-toolbar__pagination-button {\n\tborder: 1px solid rgba(255, 255, 255, 0.12);\n\tborder-radius: 0.45rem;\n\tbackground: color-mix(in srgb, var(--eco-dev-toolbar-bg) 92%, transparent);\n\tcolor: var(--eco-dev-toolbar-fg);\n\tfont: inherit;\n\tfont-size: 0.72rem;\n\tpadding: 0.28rem 0.55rem;\n\tcursor: pointer;\n}\n\n.eco-dev-toolbar__pagination-button:disabled {\n\topacity: 0.45;\n\tcursor: not-allowed;\n}\n\n.eco-dev-toolbar__status-pill {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tborder-radius: 999px;\n\tpadding: 0.1rem 0.45rem;\n\tfont-size: 0.68rem;\n\ttext-transform: uppercase;\n\tletter-spacing: 0.04em;\n}\n\n.eco-dev-toolbar__status-pill[data-status='aborted'] {\n\tbackground: rgba(245, 158, 11, 0.16);\n\tcolor: var(--eco-dev-toolbar-warning);\n}\n\n.eco-dev-toolbar__list-item strong {\n\tfont-size: 0.82rem;\n}\n\n.eco-dev-toolbar__list-item .eco-dev-toolbar__muted,\n.eco-dev-toolbar__list-item .eco-dev-toolbar__mono {\n\tdisplay: block;\n}\n\n.eco-dev-toolbar__field {\n\tdisplay: grid;\n\tgap: 0.35rem;\n}\n\n";
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export const DEV_TOOLBAR_CONTENT_STYLES = `
|
|
2
|
+
.eco-dev-toolbar__build-error {
|
|
3
|
+
white-space: pre-wrap;
|
|
4
|
+
overflow-wrap: anywhere;
|
|
5
|
+
font: 0.75rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
6
|
+
}
|
|
7
|
+
|
|
2
8
|
.eco-dev-toolbar__panel {
|
|
3
9
|
padding: 0.95rem 1rem 1.05rem;
|
|
4
10
|
display: grid;
|