@bonniepdf/previewer 0.0.0-stage → 2026.11.13

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.
@@ -0,0 +1,59 @@
1
+ import type { PreviewerPlugin } from './types.cjs';
2
+ export interface ComplianceViewOptions {
3
+ /** Label for the structure tab. Defaults to `'Accessibility'`. */
4
+ label?: string;
5
+ /**
6
+ * Label for the findings tab. Defaults to `'Issues'`.
7
+ *
8
+ * The findings live on their own tab because they are unbounded: a
9
+ * colour-rich document can carry hundreds, and listing them beside the tree
10
+ * pushes the tree off the bottom of the panel. The tree tab keeps only the
11
+ * fixed-height summary.
12
+ */
13
+ issuesLabel?: string;
14
+ /** Show the panel as soon as a snapshot loads. Defaults to `false`. */
15
+ openByDefault?: boolean;
16
+ /**
17
+ * Paint a persistent tinted marker over every flagged element on the page
18
+ * (an "issues heatmap") whenever the panel is open. Defaults to `true`.
19
+ */
20
+ markIssuesOnPage?: boolean;
21
+ /**
22
+ * Include the WCAG 2.2 findings (text contrast) supplied in the report.
23
+ * Defaults to `true`.
24
+ *
25
+ * This is the viewer-side twin of core's `evaluateCompliance(snapshot, {
26
+ * includeWcag })`: a host that already evaluated with the family switched off
27
+ * simply has no such findings to hide. Turning it off here removes those
28
+ * findings from the tree, the detail pane, the counts, the tab badge, and the
29
+ * on-page markers — PDF/UA-1 findings are untouched.
30
+ *
31
+ * The user can flip it in the panel; this option only sets the initial state.
32
+ */
33
+ showWcagChecks?: boolean;
34
+ /**
35
+ * Show only elements that have findings (or contain one). Defaults to `false`.
36
+ * The user can flip it in the panel.
37
+ */
38
+ onlyIssues?: boolean;
39
+ /**
40
+ * How many levels of the tree are expanded on load. Defaults to every level:
41
+ * the tree is the map of the document, and a map you have to unfold before it
42
+ * says anything is a worse default than a long one you can collapse. Pass a
43
+ * number to open only that many levels (`2` = the document and its pages);
44
+ * branches containing an error are always expanded, however deep they sit.
45
+ */
46
+ defaultExpandDepth?: number;
47
+ /**
48
+ * `localStorage` key under which the panel's own settings (the two filter
49
+ * toggles) persist, mirroring the host element's `preference-key`. Omitted =
50
+ * nothing is stored.
51
+ */
52
+ preferenceKey?: string;
53
+ }
54
+ /**
55
+ * Creates the compliance-view plugin. Pass it to `createPreviewer(container, {
56
+ * plugins: [complianceView()] })` and supply the data via
57
+ * `handle.load(pages, { snapshot, report })`.
58
+ */
59
+ export declare function complianceView(options?: ComplianceViewOptions): PreviewerPlugin;
@@ -0,0 +1,59 @@
1
+ import type { PreviewerPlugin } from './types.js';
2
+ export interface ComplianceViewOptions {
3
+ /** Label for the structure tab. Defaults to `'Accessibility'`. */
4
+ label?: string;
5
+ /**
6
+ * Label for the findings tab. Defaults to `'Issues'`.
7
+ *
8
+ * The findings live on their own tab because they are unbounded: a
9
+ * colour-rich document can carry hundreds, and listing them beside the tree
10
+ * pushes the tree off the bottom of the panel. The tree tab keeps only the
11
+ * fixed-height summary.
12
+ */
13
+ issuesLabel?: string;
14
+ /** Show the panel as soon as a snapshot loads. Defaults to `false`. */
15
+ openByDefault?: boolean;
16
+ /**
17
+ * Paint a persistent tinted marker over every flagged element on the page
18
+ * (an "issues heatmap") whenever the panel is open. Defaults to `true`.
19
+ */
20
+ markIssuesOnPage?: boolean;
21
+ /**
22
+ * Include the WCAG 2.2 findings (text contrast) supplied in the report.
23
+ * Defaults to `true`.
24
+ *
25
+ * This is the viewer-side twin of core's `evaluateCompliance(snapshot, {
26
+ * includeWcag })`: a host that already evaluated with the family switched off
27
+ * simply has no such findings to hide. Turning it off here removes those
28
+ * findings from the tree, the detail pane, the counts, the tab badge, and the
29
+ * on-page markers — PDF/UA-1 findings are untouched.
30
+ *
31
+ * The user can flip it in the panel; this option only sets the initial state.
32
+ */
33
+ showWcagChecks?: boolean;
34
+ /**
35
+ * Show only elements that have findings (or contain one). Defaults to `false`.
36
+ * The user can flip it in the panel.
37
+ */
38
+ onlyIssues?: boolean;
39
+ /**
40
+ * How many levels of the tree are expanded on load. Defaults to every level:
41
+ * the tree is the map of the document, and a map you have to unfold before it
42
+ * says anything is a worse default than a long one you can collapse. Pass a
43
+ * number to open only that many levels (`2` = the document and its pages);
44
+ * branches containing an error are always expanded, however deep they sit.
45
+ */
46
+ defaultExpandDepth?: number;
47
+ /**
48
+ * `localStorage` key under which the panel's own settings (the two filter
49
+ * toggles) persist, mirroring the host element's `preference-key`. Omitted =
50
+ * nothing is stored.
51
+ */
52
+ preferenceKey?: string;
53
+ }
54
+ /**
55
+ * Creates the compliance-view plugin. Pass it to `createPreviewer(container, {
56
+ * plugins: [complianceView()] })` and supply the data via
57
+ * `handle.load(pages, { snapshot, report })`.
58
+ */
59
+ export declare function complianceView(options?: ComplianceViewOptions): PreviewerPlugin;
@@ -0,0 +1,8 @@
1
+ import type { PreviewerHandle, PreviewerOptions } from './types.cjs';
2
+ /**
3
+ * Builds a PDF previewer into `container` (a shadow root for the web component,
4
+ * or any element for light-DOM use) and returns a handle to drive it. The
5
+ * container's chrome renders immediately in a loading state; call `load()` with
6
+ * the document's pages to populate it.
7
+ */
8
+ export declare function createPreviewer(container: ShadowRoot | HTMLElement, options?: PreviewerOptions): PreviewerHandle;
@@ -0,0 +1,8 @@
1
+ import type { PreviewerHandle, PreviewerOptions } from './types.js';
2
+ /**
3
+ * Builds a PDF previewer into `container` (a shadow root for the web component,
4
+ * or any element for light-DOM use) and returns a handle to drive it. The
5
+ * container's chrome renders immediately in a loading state; call `load()` with
6
+ * the document's pages to populate it.
7
+ */
8
+ export declare function createPreviewer(container: ShadowRoot | HTMLElement, options?: PreviewerOptions): PreviewerHandle;
@@ -0,0 +1,74 @@
1
+ import type { LoadOptions, PreviewLoadOptions, PreviewSource, PreviewPage } from './types.cjs';
2
+ /**
3
+ * `<bonnie-pdf-previewer>` — a framework-agnostic PDF preview element.
4
+ *
5
+ * A document is an object, not markup, so it's supplied through the imperative
6
+ * {@link load} method:
7
+ *
8
+ * ```js
9
+ * import '@bonniepdf/previewer/element';
10
+ *
11
+ * const el = document.querySelector('bonnie-pdf-previewer');
12
+ * el.load(doc); // a @bonniepdf/core Document
13
+ * el.load(svgExport); // or an export generated elsewhere, e.g. by a .NET server
14
+ * ```
15
+ *
16
+ * Configuration is read from attributes: `show-thumbnails` (`"false"` to hide),
17
+ * `show-inspector`, `preference-key`, `fit-mode` (`fit-page` | `fit-width`),
18
+ * `download-filename`, `selection-color`, and `label`.
19
+ *
20
+ * A footer bar renders under the page area when the `footer` attribute is
21
+ * present (remove it or set `"false"` for none). Its left text defaults to
22
+ * "Generated by @bonniepdf/previewer" and can be overridden with
23
+ * `footer-label`; the right side shows conformance pills (e.g. `PDF/A-2a`,
24
+ * `PDF/UA-1`) derived from each loaded document's snapshot metadata.
25
+ *
26
+ * The accessibility inspector is opted into with `compliance-view`; add
27
+ * `wcag-checks="false"` to start it with the WCAG 2.2 contrast findings hidden
28
+ * (the user can turn them back on in the panel).
29
+ *
30
+ * Individual built-in toolbar groups can be dropped (each defaults to shown) via
31
+ * `show-page-nav`, `show-zoom`, `show-fullscreen`, `show-download`, and
32
+ * `show-thumbnails-toggle`, each set to `"false"` to hide that group.
33
+ *
34
+ * The viewer renders inside a shadow root, so host-page CSS cannot reach the SVG
35
+ * pages — the embedded fonts always win and there are no id collisions between
36
+ * instances.
37
+ */
38
+ export declare class BonniePdfPreviewerElement extends HTMLElement {
39
+ private handle;
40
+ /** A load requested before the element was connected, replayed on connect.
41
+ * `settle` resolves the promise a superseded pending load handed out. */
42
+ private pending;
43
+ connectedCallback(): void;
44
+ disconnectedCallback(): void;
45
+ /**
46
+ * Shows a document: a `@bonniepdf/core` `Document`, an SVG document export,
47
+ * or a promise of either. See {@link PreviewerHandle.load}. Safe to call
48
+ * before the element is connected; the load runs as soon as it mounts.
49
+ */
50
+ load(source: PreviewSource, options?: PreviewLoadOptions): Promise<void>;
51
+ /**
52
+ * Replaces the previewed document with the given pages.
53
+ * @deprecated Pass the document or its export: `load(doc)` or `load(svgExport)`.
54
+ */
55
+ load(pages: PreviewPage[], options?: LoadOptions): void;
56
+ /** Selects and reveals a layout-snapshot node by its current document id. */
57
+ selectSnapshotNode(nodeId: string): boolean;
58
+ /** Clears rendered pages and resets to the loading state without removing injected fonts. */
59
+ clear(): void;
60
+ private readOptions;
61
+ /** Reads the per-group toolbar flags. A group attribute defaults to shown and
62
+ * is hidden only by an explicit `"false"`. Returns undefined when no toolbar
63
+ * attribute is present, leaving the full toolbar in place. */
64
+ private readToolbarConfig;
65
+ private readPreferences;
66
+ private readZoomPreference;
67
+ private writePreferences;
68
+ }
69
+ /**
70
+ * Registers {@link BonniePdfPreviewerElement} under `tagName` (default
71
+ * `bonnie-pdf-previewer`). A no-op if the tag is already defined, so it's safe to
72
+ * call more than once.
73
+ */
74
+ export declare function defineBonniePdfPreviewer(tagName?: string): void;
@@ -0,0 +1,74 @@
1
+ import type { LoadOptions, PreviewLoadOptions, PreviewSource, PreviewPage } from './types.js';
2
+ /**
3
+ * `<bonnie-pdf-previewer>` — a framework-agnostic PDF preview element.
4
+ *
5
+ * A document is an object, not markup, so it's supplied through the imperative
6
+ * {@link load} method:
7
+ *
8
+ * ```js
9
+ * import '@bonniepdf/previewer/element';
10
+ *
11
+ * const el = document.querySelector('bonnie-pdf-previewer');
12
+ * el.load(doc); // a @bonniepdf/core Document
13
+ * el.load(svgExport); // or an export generated elsewhere, e.g. by a .NET server
14
+ * ```
15
+ *
16
+ * Configuration is read from attributes: `show-thumbnails` (`"false"` to hide),
17
+ * `show-inspector`, `preference-key`, `fit-mode` (`fit-page` | `fit-width`),
18
+ * `download-filename`, `selection-color`, and `label`.
19
+ *
20
+ * A footer bar renders under the page area when the `footer` attribute is
21
+ * present (remove it or set `"false"` for none). Its left text defaults to
22
+ * "Generated by @bonniepdf/previewer" and can be overridden with
23
+ * `footer-label`; the right side shows conformance pills (e.g. `PDF/A-2a`,
24
+ * `PDF/UA-1`) derived from each loaded document's snapshot metadata.
25
+ *
26
+ * The accessibility inspector is opted into with `compliance-view`; add
27
+ * `wcag-checks="false"` to start it with the WCAG 2.2 contrast findings hidden
28
+ * (the user can turn them back on in the panel).
29
+ *
30
+ * Individual built-in toolbar groups can be dropped (each defaults to shown) via
31
+ * `show-page-nav`, `show-zoom`, `show-fullscreen`, `show-download`, and
32
+ * `show-thumbnails-toggle`, each set to `"false"` to hide that group.
33
+ *
34
+ * The viewer renders inside a shadow root, so host-page CSS cannot reach the SVG
35
+ * pages — the embedded fonts always win and there are no id collisions between
36
+ * instances.
37
+ */
38
+ export declare class BonniePdfPreviewerElement extends HTMLElement {
39
+ private handle;
40
+ /** A load requested before the element was connected, replayed on connect.
41
+ * `settle` resolves the promise a superseded pending load handed out. */
42
+ private pending;
43
+ connectedCallback(): void;
44
+ disconnectedCallback(): void;
45
+ /**
46
+ * Shows a document: a `@bonniepdf/core` `Document`, an SVG document export,
47
+ * or a promise of either. See {@link PreviewerHandle.load}. Safe to call
48
+ * before the element is connected; the load runs as soon as it mounts.
49
+ */
50
+ load(source: PreviewSource, options?: PreviewLoadOptions): Promise<void>;
51
+ /**
52
+ * Replaces the previewed document with the given pages.
53
+ * @deprecated Pass the document or its export: `load(doc)` or `load(svgExport)`.
54
+ */
55
+ load(pages: PreviewPage[], options?: LoadOptions): void;
56
+ /** Selects and reveals a layout-snapshot node by its current document id. */
57
+ selectSnapshotNode(nodeId: string): boolean;
58
+ /** Clears rendered pages and resets to the loading state without removing injected fonts. */
59
+ clear(): void;
60
+ private readOptions;
61
+ /** Reads the per-group toolbar flags. A group attribute defaults to shown and
62
+ * is hidden only by an explicit `"false"`. Returns undefined when no toolbar
63
+ * attribute is present, leaving the full toolbar in place. */
64
+ private readToolbarConfig;
65
+ private readPreferences;
66
+ private readZoomPreference;
67
+ private writePreferences;
68
+ }
69
+ /**
70
+ * Registers {@link BonniePdfPreviewerElement} under `tagName` (default
71
+ * `bonnie-pdf-previewer`). A no-op if the tag is already defined, so it's safe to
72
+ * call more than once.
73
+ */
74
+ export declare function defineBonniePdfPreviewer(tagName?: string): void;
package/dist/dom.d.cts ADDED
@@ -0,0 +1,19 @@
1
+ import type { PreviewerOptions, ToolbarConfig } from './types.cjs';
2
+ /**
3
+ * Rewrites every `id` (and matching `url(#…)` / `href="#…"` reference) in an SVG
4
+ * string with a unique prefix. The same page SVG is mounted twice within one
5
+ * previewer (thumbnail + full page), and each carries `clipPath` ids like
6
+ * `clip0`; browsers resolve `url(#clip0)` to the first match in tree order, so
7
+ * without scoping the full page would borrow the thumbnail's clip. (Distinct
8
+ * previewer *instances* are already isolated by their separate shadow roots.)
9
+ */
10
+ export declare function namespaceSvgIds(svg: string, prefix: string): string;
11
+ /** Builds the previewer chrome (stylesheet + toolbar + empty body + footer +
12
+ * loading overlay) into the given root. Page/thumbnail content is mounted later
13
+ * by the controller. */
14
+ export declare function buildShell(root: ShadowRoot | HTMLElement, opts: Required<Pick<PreviewerOptions, 'showThumbnails' | 'hideBorder' | 'styleScrollbars' | 'title' | 'fitMode'>> & {
15
+ toolbar: Required<ToolbarConfig>;
16
+ footer?: {
17
+ text: string;
18
+ };
19
+ }): void;
package/dist/dom.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ import type { PreviewerOptions, ToolbarConfig } from './types.js';
2
+ /**
3
+ * Rewrites every `id` (and matching `url(#…)` / `href="#…"` reference) in an SVG
4
+ * string with a unique prefix. The same page SVG is mounted twice within one
5
+ * previewer (thumbnail + full page), and each carries `clipPath` ids like
6
+ * `clip0`; browsers resolve `url(#clip0)` to the first match in tree order, so
7
+ * without scoping the full page would borrow the thumbnail's clip. (Distinct
8
+ * previewer *instances* are already isolated by their separate shadow roots.)
9
+ */
10
+ export declare function namespaceSvgIds(svg: string, prefix: string): string;
11
+ /** Builds the previewer chrome (stylesheet + toolbar + empty body + footer +
12
+ * loading overlay) into the given root. Page/thumbnail content is mounted later
13
+ * by the controller. */
14
+ export declare function buildShell(root: ShadowRoot | HTMLElement, opts: Required<Pick<PreviewerOptions, 'showThumbnails' | 'hideBorder' | 'styleScrollbars' | 'title' | 'fitMode'>> & {
15
+ toolbar: Required<ToolbarConfig>;
16
+ footer?: {
17
+ text: string;
18
+ };
19
+ }): void;
@@ -0,0 +1 @@
1
+ 'use strict';var chunkGCCYT6QM_cjs=require('./chunk-GCCYT6QM.cjs');chunkGCCYT6QM_cjs.e();Object.defineProperty(exports,"BonniePdfPreviewerElement",{enumerable:true,get:function(){return chunkGCCYT6QM_cjs.d}});Object.defineProperty(exports,"defineBonniePdfPreviewer",{enumerable:true,get:function(){return chunkGCCYT6QM_cjs.e}});
@@ -0,0 +1 @@
1
+ export { BonniePdfPreviewerElement, defineBonniePdfPreviewer } from './define.cjs';
@@ -0,0 +1 @@
1
+ export { BonniePdfPreviewerElement, defineBonniePdfPreviewer } from './define.js';
@@ -0,0 +1 @@
1
+ import {e}from'./chunk-7GN6MXS6.js';export{d as BonniePdfPreviewerElement,e as defineBonniePdfPreviewer}from'./chunk-7GN6MXS6.js';e();
@@ -0,0 +1,19 @@
1
+ declare const BODY: {
2
+ readonly 'panel-left-close': '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18m7-6l-3-3l3-3"/></g>';
3
+ readonly 'panel-left': '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18"/></g>';
4
+ readonly 'chevron-left': '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m15 18l-6-6l6-6"/>';
5
+ readonly 'chevron-right': '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m9 18l6-6l-6-6"/>';
6
+ readonly 'zoom-out': '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21l-4.35-4.35M8 11h6"/></g>';
7
+ readonly 'zoom-in': '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21l-4.35-4.35M11 8v6m-3-3h6"/></g>';
8
+ readonly maximize: '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3M3 16v3a2 2 0 0 0 2 2h3m8 0h3a2 2 0 0 0 2-2v-3"/>';
9
+ readonly minimize: '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3M3 16h3a2 2 0 0 1 2 2v3m8 0v-3a2 2 0 0 1 2-2h3"/>';
10
+ readonly download: '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="m7 10l5 5l5-5"/></g>';
11
+ readonly 'panel-right': '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M15 3v18"/></g>';
12
+ readonly 'circle-x': '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="m15 9-6 6m0-6 6 6"/></g>';
13
+ readonly 'triangle-alert': '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21.73 18 13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3ZM12 9v4m0 4h.01"/>';
14
+ readonly info: '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="M12 11v5m0-8h.01"/></g>';
15
+ };
16
+ export type IconName = keyof typeof BODY;
17
+ /** Returns sized SVG markup for an icon. */
18
+ export declare function icon(name: IconName, className?: string): string;
19
+ export {};
@@ -0,0 +1,19 @@
1
+ declare const BODY: {
2
+ readonly 'panel-left-close': '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18m7-6l-3-3l3-3"/></g>';
3
+ readonly 'panel-left': '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18"/></g>';
4
+ readonly 'chevron-left': '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m15 18l-6-6l6-6"/>';
5
+ readonly 'chevron-right': '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m9 18l6-6l-6-6"/>';
6
+ readonly 'zoom-out': '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21l-4.35-4.35M8 11h6"/></g>';
7
+ readonly 'zoom-in': '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21l-4.35-4.35M11 8v6m-3-3h6"/></g>';
8
+ readonly maximize: '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3M3 16v3a2 2 0 0 0 2 2h3m8 0h3a2 2 0 0 0 2-2v-3"/>';
9
+ readonly minimize: '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3M3 16h3a2 2 0 0 1 2 2v3m8 0v-3a2 2 0 0 1 2-2h3"/>';
10
+ readonly download: '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="m7 10l5 5l5-5"/></g>';
11
+ readonly 'panel-right': '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M15 3v18"/></g>';
12
+ readonly 'circle-x': '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="m15 9-6 6m0-6 6 6"/></g>';
13
+ readonly 'triangle-alert': '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21.73 18 13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3ZM12 9v4m0 4h.01"/>';
14
+ readonly info: '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="M12 11v5m0-8h.01"/></g>';
15
+ };
16
+ export type IconName = keyof typeof BODY;
17
+ /** Returns sized SVG markup for an icon. */
18
+ export declare function icon(name: IconName, className?: string): string;
19
+ export {};
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ 'use strict';var chunkGCCYT6QM_cjs=require('./chunk-GCCYT6QM.cjs');function p(r={}){return {...chunkGCCYT6QM_cjs.c({label:r.label,openByDefault:r.openByDefault}),name:"structure-view"}}Object.defineProperty(exports,"BonniePdfPreviewerElement",{enumerable:true,get:function(){return chunkGCCYT6QM_cjs.d}});Object.defineProperty(exports,"complianceView",{enumerable:true,get:function(){return chunkGCCYT6QM_cjs.c}});Object.defineProperty(exports,"createPreviewer",{enumerable:true,get:function(){return chunkGCCYT6QM_cjs.b}});Object.defineProperty(exports,"defineBonniePdfPreviewer",{enumerable:true,get:function(){return chunkGCCYT6QM_cjs.e}});Object.defineProperty(exports,"svgStringsToPages",{enumerable:true,get:function(){return chunkGCCYT6QM_cjs.a}});exports.structureView=p;
@@ -0,0 +1,8 @@
1
+ export { createPreviewer } from './controller.cjs';
2
+ export { BonniePdfPreviewerElement, defineBonniePdfPreviewer } from './define.cjs';
3
+ export { svgStringsToPages } from './types.cjs';
4
+ export { structureView } from './structure-view.cjs';
5
+ export type { StructureViewOptions } from './structure-view.cjs';
6
+ export { complianceView } from './compliance-view.cjs';
7
+ export type { ComplianceViewOptions } from './compliance-view.cjs';
8
+ export type { PreviewPage, FitMode, PreviewerZoomState, PreviewerOptions, ToolbarConfig, FooterConfig, LoadOptions, PdfSource, PreviewableDocument, PreviewExport, PreviewLoadOptions, PreviewSource, PreviewerHandle, PreviewerPlugin, PreviewerPluginContext, PreviewerLoadContext, PreviewerSyncContext, PreviewerViewState, LayoutSnapshot, SnapshotNode, SnapshotRect, NodeAccessibility, SnapshotMeta, ComplianceReport, ComplianceFinding, ComplianceSeverity, } from './types.cjs';
@@ -0,0 +1,8 @@
1
+ export { createPreviewer } from './controller.js';
2
+ export { BonniePdfPreviewerElement, defineBonniePdfPreviewer } from './define.js';
3
+ export { svgStringsToPages } from './types.js';
4
+ export { structureView } from './structure-view.js';
5
+ export type { StructureViewOptions } from './structure-view.js';
6
+ export { complianceView } from './compliance-view.js';
7
+ export type { ComplianceViewOptions } from './compliance-view.js';
8
+ export type { PreviewPage, FitMode, PreviewerZoomState, PreviewerOptions, ToolbarConfig, FooterConfig, LoadOptions, PdfSource, PreviewableDocument, PreviewExport, PreviewLoadOptions, PreviewSource, PreviewerHandle, PreviewerPlugin, PreviewerPluginContext, PreviewerLoadContext, PreviewerSyncContext, PreviewerViewState, LayoutSnapshot, SnapshotNode, SnapshotRect, NodeAccessibility, SnapshotMeta, ComplianceReport, ComplianceFinding, ComplianceSeverity, } from './types.js';
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ import {c}from'./chunk-7GN6MXS6.js';export{d as BonniePdfPreviewerElement,c as complianceView,b as createPreviewer,e as defineBonniePdfPreviewer,a as svgStringsToPages}from'./chunk-7GN6MXS6.js';function p(r={}){return {...c({label:r.label,openByDefault:r.openByDefault}),name:"structure-view"}}export{p as structureView};
@@ -0,0 +1,29 @@
1
+ export interface SelectionHighlightRect {
2
+ left: number;
3
+ top: number;
4
+ width: number;
5
+ height: number;
6
+ }
7
+ interface SelectionHighlightOptions {
8
+ root: ShadowRoot | HTMLElement;
9
+ ownerDocument: Document;
10
+ pageElements: readonly HTMLElement[];
11
+ signal: AbortSignal;
12
+ }
13
+ interface SelectionHighlightController {
14
+ refresh(): void;
15
+ clear(): void;
16
+ }
17
+ /**
18
+ * Coalesces the small, glyph-level rectangles returned for SVG text into line
19
+ * fragments. The gap cap deliberately scales with line height: it bridges word
20
+ * spacing (including justification) without flooding a column or table gutter.
21
+ */
22
+ export declare function mergeSelectionHighlightRects(rects: readonly SelectionHighlightRect[]): SelectionHighlightRect[];
23
+ /**
24
+ * Paints a continuous selection backdrop for SVG text. Browsers often paint
25
+ * native SVG selection per glyph and leave visible holes at spaces, even though
26
+ * the whitespace remains part of the selected string and clipboard content.
27
+ */
28
+ export declare function installSelectionHighlights(options: SelectionHighlightOptions): SelectionHighlightController;
29
+ export {};
@@ -0,0 +1,29 @@
1
+ export interface SelectionHighlightRect {
2
+ left: number;
3
+ top: number;
4
+ width: number;
5
+ height: number;
6
+ }
7
+ interface SelectionHighlightOptions {
8
+ root: ShadowRoot | HTMLElement;
9
+ ownerDocument: Document;
10
+ pageElements: readonly HTMLElement[];
11
+ signal: AbortSignal;
12
+ }
13
+ interface SelectionHighlightController {
14
+ refresh(): void;
15
+ clear(): void;
16
+ }
17
+ /**
18
+ * Coalesces the small, glyph-level rectangles returned for SVG text into line
19
+ * fragments. The gap cap deliberately scales with line height: it bridges word
20
+ * spacing (including justification) without flooding a column or table gutter.
21
+ */
22
+ export declare function mergeSelectionHighlightRects(rects: readonly SelectionHighlightRect[]): SelectionHighlightRect[];
23
+ /**
24
+ * Paints a continuous selection backdrop for SVG text. Browsers often paint
25
+ * native SVG selection per glyph and leave visible holes at spaces, even though
26
+ * the whitespace remains part of the selected string and clipboard content.
27
+ */
28
+ export declare function installSelectionHighlights(options: SelectionHighlightOptions): SelectionHighlightController;
29
+ export {};
@@ -0,0 +1,14 @@
1
+ import type { PreviewerPlugin } from './types.cjs';
2
+ /** @deprecated Use `ComplianceViewOptions` with `complianceView()` instead. */
3
+ export interface StructureViewOptions {
4
+ /** Panel header label. Defaults to `'Accessibility'`. */
5
+ label?: string;
6
+ /** Show the panel as soon as a snapshot loads. Defaults to `true`. */
7
+ openByDefault?: boolean;
8
+ }
9
+ /**
10
+ * @deprecated Use `complianceView()` instead. The accessibility inspector now
11
+ * includes the complete layout tree, geometry, two-way selection, and document
12
+ * source-navigation semantics formerly provided by this plugin.
13
+ */
14
+ export declare function structureView(options?: StructureViewOptions): PreviewerPlugin;
@@ -0,0 +1,14 @@
1
+ import type { PreviewerPlugin } from './types.js';
2
+ /** @deprecated Use `ComplianceViewOptions` with `complianceView()` instead. */
3
+ export interface StructureViewOptions {
4
+ /** Panel header label. Defaults to `'Accessibility'`. */
5
+ label?: string;
6
+ /** Show the panel as soon as a snapshot loads. Defaults to `true`. */
7
+ openByDefault?: boolean;
8
+ }
9
+ /**
10
+ * @deprecated Use `complianceView()` instead. The accessibility inspector now
11
+ * includes the complete layout tree, geometry, two-way selection, and document
12
+ * source-navigation semantics formerly provided by this plugin.
13
+ */
14
+ export declare function structureView(options?: StructureViewOptions): PreviewerPlugin;
@@ -0,0 +1 @@
1
+ export declare const STYLES = "\n:host {\n --_divider: var(--bpdf-divider, var(--cui-divider, #e2e8f0));\n --_bg: var(--bpdf-bg, var(--cui-bg, #ffffff));\n --_bg-alt: var(--bpdf-bg-alt, var(--cui-bg-alt, #f1f5f9));\n --_bg-soft: var(--bpdf-bg-soft, var(--cui-bg-soft, #f8fafc));\n --_brand: var(--bpdf-brand-2, var(--cui-brand-1, #007acc));\n --_brand-soft: var(--bpdf-brand-soft, var(--cui-brand-soft, rgba(0, 122, 204, 0.08)));\n --_text-1: var(--bpdf-text-1, var(--cui-text-1, #0f172a));\n --_text-2: var(--bpdf-text-2, var(--cui-text-2, #475569));\n --_text-3: var(--bpdf-text-3, var(--cui-text-3, #94a3b8));\n --_radius-md: var(--bpdf-radius, var(--cui-radius, 8px));\n --_radius-sm: 6px;\n\n /* Compliance severity palette (overridable via --bpdf-* tokens). */\n --_sev-error: var(--bpdf-error, var(--cui-danger-1, #dc2626));\n --_sev-warning: var(--bpdf-warning, var(--cui-status-warning-text, #d97706));\n --_sev-info: var(--bpdf-info, var(--cui-palette-blue, #2563eb));\n --_sev-ok: var(--bpdf-status-success-text, var(--bpdf-success, var(--cui-status-success-text, #047857)));\n\n display: block;\n height: 100%;\n min-height: 0;\n /* A clean default font for the chrome; the SVG pages carry their own fonts. */\n font-family: var(--bpdf-font-family, var(--cui-font-family, system-ui, -apple-system, Segoe UI, Roboto, sans-serif));\n}\n\n/* Maximized web components enter the browser's top layer via the Popover API,\n so host-page stacking contexts (sticky headers, transformed ancestors, etc.)\n cannot cover the previewer. The class selector provides the same sizing for\n createPreviewer() instances mounted directly into a light-DOM element. */\n:host(:popover-open),\n.bpp-popover-host:popover-open {\n position: fixed;\n inset: 0;\n width: 100vw;\n height: 100dvh;\n max-width: none;\n max-height: none;\n margin: 0;\n padding: 0;\n border: 0;\n overflow: hidden;\n background: var(--_bg-alt);\n z-index: 2147483647;\n}\n\n* { box-sizing: border-box; }\n\n.bpp {\n position: relative;\n display: flex;\n flex-direction: column;\n height: 100%;\n min-height: 0;\n min-width: 0;\n border: 1px solid var(--_divider);\n border-radius: var(--_radius-md);\n overflow: hidden;\n background: var(--_bg-alt);\n container-type: inline-size;\n}\n\n.bpp-no-border {\n border-color: transparent;\n border-radius: 0;\n border: none;\n}\n\n.bpp-fullscreen {\n position: fixed;\n inset: 0;\n width: 100vw;\n height: 100dvh;\n border-radius: 0;\n z-index: 2147483647;\n}\n\n/* \u2500\u2500 Toolbar \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.bpp-toolbar {\n display: flex;\n align-items: center;\n height: 48px;\n padding: 0 12px;\n gap: 4px;\n flex-shrink: 0;\n background: var(--_bg-soft);\n border-bottom: 1px solid var(--_divider);\n z-index: 5;\n}\n.bpp-group { display: flex; align-items: center; gap: 2px; }\n.bpp-group-end { margin-left: auto; }\n.bpp-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n min-width: 32px;\n height: 32px;\n padding: 0 6px;\n background: transparent;\n border: 1px solid transparent;\n border-radius: var(--_radius-sm);\n cursor: pointer;\n color: var(--_text-2);\n font: inherit;\n font-size: 0.8125rem;\n}\n.bpp-btn:hover:not(:disabled) {\n background: var(--_bg-alt);\n border-color: var(--_divider);\n color: var(--_text-1);\n}\n.bpp-btn:disabled { opacity: 0.35; cursor: not-allowed; }\n.bpp-btn-active, .bpp-btn-active:hover {\n background: var(--_brand-soft);\n border-color: var(--_brand);\n color: var(--_brand);\n}\n.bpp-btn-download { padding: 0 10px; }\n.bpp-btn-label { white-space: nowrap; }\n.bpp-icon { width: 16px; height: 16px; flex-shrink: 0; }\n.bpp-btn-active .bpp-icon-thumbs-closed,\n.bpp-btn:not(.bpp-btn-active) .bpp-icon-thumbs-open { display: none; }\n.bpp-fullscreen .bpp-icon-fullscreen-open,\n.bpp:not(.bpp-fullscreen) .bpp-icon-fullscreen-close { display: none; }\n.bpp-fullscreen-label { display: none; white-space: nowrap; }\n.bpp-fullscreen .bpp-fullscreen-label { display: inline; }\n.bpp-sep { width: 1px; height: 20px; margin: 0 6px; background: var(--_divider); flex-shrink: 0; }\n.bpp-pages-label {\n display: flex; align-items: center; gap: 4px; min-width: 56px; justify-content: center;\n font-size: 0.8125rem; color: var(--_text-2); font-variant-numeric: tabular-nums; user-select: none;\n}\n.bpp-page-current { font-weight: 600; color: var(--_text-1); }\n.bpp-page-sep, .bpp-page-total { color: var(--_text-3); }\n.bpp-zoom {\n appearance: none; -webkit-appearance: none;\n height: 32px; min-width: 96px; padding: 0 28px 0 8px;\n border: 1px solid var(--_divider); border-radius: var(--_radius-sm);\n background-color: var(--_bg);\n background-image:\n linear-gradient(45deg, transparent 50%, currentColor 50%),\n linear-gradient(135deg, currentColor 50%, transparent 50%);\n background-position: calc(100% - 17px) 50%, calc(100% - 13px) 50%;\n background-size: 4px 4px; background-repeat: no-repeat;\n color: var(--_text-1); font: inherit; font-size: 0.8125rem; cursor: pointer;\n}\n.bpp-zoom:hover { border-color: var(--_text-3); }\n\n@container (max-width: 640px) {\n .bpp-btn-label { display: none; }\n .bpp-btn-download { padding: 0 6px; }\n}\n\n/* Narrow containers (phones): the controls no longer fit on one row, so the\n toolbar wraps instead of clipping them. Separators are dropped because they\n would otherwise start or end a wrapped row. */\n@container (max-width: 560px) {\n .bpp-toolbar {\n flex-wrap: wrap;\n justify-content: center;\n height: auto;\n min-height: 48px;\n padding: 6px 8px;\n row-gap: 4px;\n }\n .bpp-sep { display: none; }\n .bpp-group-end { margin-left: 0; }\n .bpp-group-end:empty { display: none; }\n .bpp-zoom { min-width: 0; }\n}\n\n/* \u2500\u2500 Body / thumbnails / pages \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.bpp-body { display: flex; flex-direction: row; flex: 1; min-height: 0; overflow: hidden; }\n.bpp-thumbs {\n width: 168px; flex-shrink: 0; overflow-y: auto; overscroll-behavior: contain;\n background: var(--_bg-soft); border-right: 1px solid var(--_divider);\n}\n.bpp-thumbs[hidden] { display: none; }\n.bpp-thumbs-list { list-style: none; margin: 0; padding: 12px; display: flex; flex-direction: column; gap: 12px; }\n.bpp-thumb {\n display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%;\n padding: 0; background: none; border: none; cursor: pointer; color: var(--_text-3); font: inherit;\n}\n.bpp-thumb-canvas {\n display: block; width: 100%; background: #fff; border: 2px solid transparent; border-radius: 2px;\n box-shadow: 0 1px 3px rgba(0,0,0,0.16); overflow: hidden;\n transition: border-color 0.15s ease, box-shadow 0.15s ease;\n}\n.bpp-thumb-canvas svg { display: block; width: 100%; height: auto; }\n/* Link overlays stay inert in thumbnails - a thumbnail click always navigates\n to the page, never follows the document's links. */\n.bpp-thumb-canvas svg a, .bpp-thumb-canvas svg [data-bp-link-page] { pointer-events: none; }\n.bpp-thumb:hover .bpp-thumb-canvas { border-color: var(--_brand); }\n.bpp-thumb-active .bpp-thumb-canvas { border-color: var(--_brand); box-shadow: 0 0 0 1px var(--_brand); }\n.bpp-thumb-label { font-size: 0.75rem; font-variant-numeric: tabular-nums; }\n.bpp-thumb-active .bpp-thumb-label { color: var(--_text-1); font-weight: 600; }\n/* scrollbar-gutter: stable reserves the vertical scrollbar's space at all\n times so the scroll container's clientWidth doesn't jump when the scrollbar\n appears/disappears. Without it, fit-width sizing forms a feedback loop with\n the ResizeObserver (width -> page scale -> content height -> scrollbar ->\n width...), which oscillates forever for documents whose fitted height lands\n right at the viewport boundary (e.g. the pdf-compliance example). */\n.bpp-scroll { flex: 1; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }\n.bpp-pages { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 24px; min-width: min-content; }\n.bpp-page {\n position: relative;\n flex-shrink: 0; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.18);\n /* Let the browser skip layout/paint of off-screen pages as a second layer of\n virtualisation on top of the JS mount/unmount. */\n content-visibility: auto;\n}\n.bpp-page-canvas { position: absolute; inset: 0; z-index: 0; }\n.bpp-page svg { display: block; width: 100%; height: 100%; }\n\n/* Chromium paints native SVG selection around glyph cells and leaves the\n advances occupied by spaces uncoloured. A measured overlay fills those gaps;\n the native background is made transparent while its selected foreground is\n retained. The overlay is inert and remains below inspector highlights. */\n.bpp-page-canvas svg text::selection {\n background-color: transparent;\n color: inherit;\n fill: inherit;\n}\n.bpp-selection-layer {\n position: absolute; inset: 0; overflow: hidden;\n pointer-events: none; z-index: 1;\n}\n.bpp-selection-rect {\n position: absolute; display: block;\n background: var(--bpdf-selection, Highlight); opacity: 0.45;\n}\n@media (forced-colors: active) {\n .bpp-page-canvas svg text::selection { color: HighlightText; fill: HighlightText; }\n .bpp-selection-rect { opacity: 1; }\n}\n\n/* \u2500\u2500 Plugin overlays (inspector highlights) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.bpp-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 2; }\n\n/* \u2500\u2500 Shared inspector side panel (tabbed: structure / compliance / \u2026) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.bpp-side {\n width: 280px; flex-shrink: 0;\n display: flex; flex-direction: column; min-height: 0;\n border-left: 1px solid var(--_divider); background: var(--_bg-alt);\n font-size: 0.8125rem; color: var(--_text-2);\n}\n.bpp-side[hidden] { display: none; }\n\n/* Splitter between the document area and the inspector panel. A 7px hit area\n that straddles the panel's left seam via negative margins, so it adds no\n layout width. The visible accent line only appears on hover/focus/drag; at\n rest the panel's own border-left is the divider. */\n.bpp-side-resizer {\n flex: 0 0 auto;\n align-self: stretch;\n width: 7px;\n margin-left: -4px;\n margin-right: -3px;\n position: relative;\n z-index: 3;\n cursor: col-resize;\n background: transparent;\n touch-action: none;\n}\n.bpp-side-resizer[hidden] { display: none; }\n.bpp-side-resizer::before {\n content: \"\";\n position: absolute;\n top: 0; bottom: 0; left: 50%;\n width: 2px;\n transform: translateX(-50%);\n background: var(--_brand);\n opacity: 0;\n transition: opacity 0.15s ease;\n}\n.bpp-side-resizer:hover::before,\n.bpp-side-resizer:focus-visible::before,\n.bpp-side-resizer-active::before { opacity: 1; }\n.bpp-side-resizer:focus-visible { outline: none; }\n\n/* Tab strip: one tab per registered panel; hidden when there's only one. */\n.bpp-side-tabs {\n display: flex; flex-shrink: 0; gap: 2px; padding: 6px 6px 0;\n border-bottom: 1px solid var(--_divider);\n}\n.bpp-side-tabs[hidden] { display: none; }\n.bpp-side-tab {\n display: inline-flex; align-items: center; gap: 6px;\n padding: 6px 10px; border: 0; border-bottom: 2px solid transparent;\n background: none; color: var(--_text-2); font: inherit; font-size: 0.8125rem;\n font-weight: 600; cursor: pointer; white-space: nowrap;\n}\n.bpp-side-tab:hover { color: var(--_text-1); }\n.bpp-side-tab-active {\n color: var(--_brand); border-bottom-color: var(--_brand);\n}\n.bpp-side-tab-badge {\n min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box;\n display: inline-flex; align-items: center; justify-content: center;\n border-radius: 999px; font-size: 0.625rem; font-weight: 700; line-height: 1; color: #fff;\n}\n.bpp-side-tab-badge[hidden] { display: none; }\n.bpp-side-tab-badge-error { background: var(--_sev-error); }\n.bpp-side-tab-badge-warning { background: var(--_sev-warning); }\n.bpp-side-tab-badge-info { background: var(--_sev-info); }\n.bpp-side-tab-badge-ok { background: var(--_sev-ok); }\n/* Body: holds every panel's element; only the active one is shown. */\n.bpp-side-body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; }\n.bpp-side-body > [hidden] { display: none; }\n.bpp-side-body > * { flex: 1 1 auto; min-height: 0; }\n/* Toolbar toggle: a dot signals unseen issues while the panel is collapsed. */\n.bpp-side-toggle { position: relative; }\n.bpp-side-toggle-dot {\n position: absolute; top: 3px; right: 3px;\n width: 8px; height: 8px; border-radius: 50%;\n box-shadow: 0 0 0 1.5px var(--_bg);\n}\n.bpp-side-toggle-dot[hidden] { display: none; }\n.bpp-side-toggle-dot-error { background: var(--_sev-error); }\n.bpp-side-toggle-dot-warning { background: var(--_sev-warning); }\n.bpp-side-toggle-dot-info { background: var(--_sev-info); }\n.bpp-tree { list-style: none; margin: 0; padding: 6px 0; }\n.bpp-tree ul { list-style: none; margin: 0; padding-left: 14px; }\n.bpp-tree-row {\n display: flex; align-items: baseline; gap: 6px; width: 100%;\n padding: 3px 10px; border: 0; background: none; text-align: left;\n color: inherit; font: inherit; cursor: pointer;\n}\n.bpp-tree-row:hover { background: color-mix(in srgb, var(--_brand) 10%, transparent); }\n.bpp-tree-row[aria-selected=\"true\"] {\n background: color-mix(in srgb, var(--_brand) 16%, transparent);\n color: var(--_text-1); font-weight: 600;\n}\n.bpp-tree-row:focus-visible {\n outline: 2px solid var(--_brand); outline-offset: -2px;\n}\n.bpp-tree-type { color: var(--_text-1); }\n.bpp-tree-name {\n color: var(--_text-3); font-style: italic;\n overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n}\n/* Expand/collapse affordance: a CSS triangle that rotates, so no icon asset and\n no extra DOM. Leaves keep the box for alignment but draw nothing. */\n.bpp-tree-twisty {\n flex: 0 0 auto; width: 10px; height: 10px; position: relative;\n}\n.bpp-tree-twisty::before {\n content: ''; position: absolute; left: 2px; top: 1px;\n border: 4px solid transparent; border-left-color: var(--_text-3);\n transition: transform 0.12s ease;\n}\n.bpp-tree-row[aria-expanded=\"true\"] > .bpp-tree-twisty::before {\n transform: rotate(90deg); transform-origin: 2px 4px;\n}\n.bpp-tree-twisty-leaf::before { content: none; }\n@media (prefers-reduced-motion: reduce) {\n .bpp-tree-twisty::before { transition: none; }\n}\n\n/* \u2500\u2500 Footer \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n/* Slim bar under the page area: host text left, document conformance pills\n right. Rendered only when the host opts in via the footer option. */\n.bpp-footer {\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-wrap: wrap;\n gap: 0.25rem 0.75rem;\n min-height: 34px;\n padding: 0.25rem 12px;\n flex-shrink: 0;\n background: var(--_bg-soft);\n border-top: 1px solid var(--_divider);\n font-size: 0.75rem;\n color: var(--_text-3);\n}\n.bpp-footer-text {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.bpp-footer-tags {\n display: flex;\n align-items: center;\n gap: 0.35rem;\n flex-shrink: 0;\n}\n.bpp-footer-tag {\n display: inline-flex;\n align-items: center;\n padding: 0.1rem 0.5rem;\n border-radius: 999px;\n font-size: 0.6875rem;\n font-weight: 600;\n letter-spacing: 0.02em;\n color: var(--_brand);\n background: var(--_brand-soft);\n white-space: nowrap;\n}\n\n/* \u2500\u2500 Loading overlay \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.bpp-loading {\n position: absolute; inset: 0; z-index: 6;\n display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;\n background: var(--_bg-alt); color: var(--_text-3); font-size: 0.875rem;\n}\n.bpp-loading[hidden] { display: none; }\n.bpp-spinner {\n width: 34px; height: 34px; border-radius: 50%;\n border: 3px solid var(--_divider); border-top-color: var(--_brand);\n animation: bpp-spin 0.8s linear infinite;\n}\n@keyframes bpp-spin { to { transform: rotate(360deg); } }\n\n/* \u2500\u2500 Busy and error states \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.bpp-busy .bpp-pages { opacity: 0.55; transition: opacity 120ms ease; }\n.bpp-error {\n position: absolute; inset: 0; z-index: 7;\n display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;\n padding: 24px; text-align: center;\n background: var(--_bg-alt); color: var(--_text-2); font-size: 0.875rem;\n}\n.bpp-error[hidden] { display: none; }\n.bpp-error-title { font-weight: 600; color: var(--_text-1); }\n.bpp-error-detail { color: var(--_text-3); overflow-wrap: anywhere; }\n.bpp-error-detail:empty { display: none; }\n.bpp-error.bpp-error-banner {\n inset: auto 0 0 0; flex-direction: row; justify-content: flex-start; gap: 8px;\n padding: 8px 12px; border-top: 1px solid var(--_divider); text-align: left;\n}\n@media (prefers-reduced-motion: reduce) { .bpp-spinner { animation-duration: 2s; } }\n\n/* \u2500\u2500 Compliance view plugin \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.bpp-cv-host { display: flex; flex-direction: column; height: 100%; min-height: 0; }\n\n/* Summary block: fixed height on both tabs, so it never squeezes the tree. */\n.bpp-cv-summary {\n flex: 0 0 auto;\n padding: 10px 12px; border-bottom: 1px solid var(--_divider);\n display: flex; flex-direction: column; gap: 8px;\n}\n.bpp-cv-header { display: flex; flex-direction: column; gap: 8px; }\n.bpp-cv-pills { display: flex; flex-wrap: wrap; gap: 6px; }\n.bpp-cv-pill {\n padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 600;\n color: #fff;\n}\n.bpp-cv-pill-error { background: var(--_sev-error); }\n.bpp-cv-pill-warning { background: var(--_sev-warning); }\n.bpp-cv-pill-info { background: var(--_sev-info); }\n.bpp-cv-pill-zero { background: var(--_bg-alt); color: var(--_text-2); border: 1px solid var(--_divider); }\n.bpp-cv-verdict { font-size: 0.8125rem; font-weight: 600; }\n.bpp-cv-verdict-pass { color: var(--_sev-ok); }\n.bpp-cv-verdict-fail { color: var(--_sev-error); }\n.bpp-cv-filter { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--_text-2); cursor: pointer; }\n\n/* Settings row: the finding filters, then the tree's expand/collapse actions. */\n.bpp-cv-settings { display: flex; flex-direction: column; gap: 6px; }\n.bpp-cv-filters { display: flex; flex-direction: column; gap: 4px; }\n.bpp-cv-tree-actions { display: flex; gap: 6px; }\n.bpp-cv-action {\n padding: 2px 8px; border: 1px solid var(--_divider); border-radius: 5px;\n background: none; color: var(--_text-2); font: inherit; font-size: 0.6875rem;\n cursor: pointer;\n}\n.bpp-cv-action:hover { background: var(--_brand-soft); color: var(--_text-1); }\n.bpp-cv-action:focus-visible { outline: 2px solid var(--_brand); outline-offset: 1px; }\n\n/* Section titles. */\n.bpp-cv-section-title {\n font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.05em;\n color: var(--_text-3); font-weight: 700; padding: 8px 12px 4px;\n}\n\n/* Findings tab. The list scrolls on its own so it can be any length without\n competing with the tree, which lives on the other tab. */\n.bpp-cv-issues { overflow: hidden; }\n.bpp-cv-issues-head {\n flex: 0 0 auto; padding: 10px 12px; border-bottom: 1px solid var(--_divider);\n display: flex; flex-direction: column; gap: 8px;\n}\n.bpp-cv-issues-list {\n flex: 1 1 auto; overflow: auto; min-height: 0;\n display: flex; flex-direction: column; gap: 4px; padding-bottom: 12px;\n}\n.bpp-cv-issues-group { display: flex; flex-direction: column; gap: 6px; }\n.bpp-cv-scope {\n align-self: flex-start; padding: 1px 6px; border-radius: 999px;\n border: 1px solid var(--_divider); color: var(--_text-3); font-size: 0.625rem;\n text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700;\n}\n.bpp-cv-finding-where { margin: 0; font-size: 0.75rem; }\n.bpp-cv-finding-el { color: var(--_text-1); font-weight: 600; }\n.bpp-cv-finding-page { color: var(--_text-3); font-variant-numeric: tabular-nums; }\n\n/* Tree area (scrolls). */\n.bpp-cv-tree-host { flex: 1 1 auto; overflow: auto; min-height: 60px; }\n.bpp-cv-tree { padding: 4px 0; }\n.bpp-cv-row { align-items: center; }\n\n/* Finding icons. */\n.bpp-cv-issue-icon { display: inline-flex; flex: 0 0 auto; }\n.bpp-cv-issue-icon .bpp-icon { width: 14px; height: 14px; }\n.bpp-cv-issue-icon-error { color: var(--_sev-error); }\n.bpp-cv-issue-icon-warning { color: var(--_sev-warning); }\n.bpp-cv-issue-icon-info { color: var(--_sev-info); }\n\n/* Role chips. */\n.bpp-cv-role {\n flex: 0 0 auto; padding: 0 5px; border-radius: 4px; font-size: 0.6875rem;\n font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.5;\n background: var(--_bg-soft); color: var(--_text-2); border: 1px solid var(--_divider);\n}\n.bpp-cv-role-heading { background: color-mix(in srgb, var(--_brand) 14%, transparent); color: var(--_brand); border-color: transparent; }\n.bpp-cv-role-figure { background: color-mix(in srgb, var(--_sev-info) 14%, transparent); color: var(--_sev-info); border-color: transparent; }\n.bpp-cv-role-table { background: color-mix(in srgb, var(--_sev-ok) 16%, transparent); color: var(--_sev-ok); border-color: transparent; }\n.bpp-cv-role-artifact { background: transparent; color: var(--_text-3); border-style: dashed; }\n.bpp-cv-row .bpp-cv-role { background: transparent; color: var(--_text-2); border-color: var(--_text-3); }\n.bpp-cv-row .bpp-cv-role-tagged {\n background: color-mix(in srgb, var(--_sev-ok) 14%, transparent);\n color: var(--_text-1); border-color: transparent;\n}\n@media (forced-colors: active) {\n .bpp-cv-row .bpp-cv-role-tagged {\n forced-color-adjust: none;\n background: CanvasText; color: Canvas;\n }\n}\n\n/* Detail pane. */\n.bpp-cv-detail { border-top: 1px solid var(--_divider); max-height: 42%; overflow: auto; flex: 0 0 auto; }\n.bpp-cv-detail-body { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 8px; }\n.bpp-cv-detail-head { display: flex; align-items: center; gap: 6px; padding: 0 12px 6px; }\n.bpp-cv-detail-type { font-weight: 700; color: var(--_text-1); font-size: 0.8125rem; }\n.bpp-cv-detail-name { color: var(--_text-3); font-size: 0.8125rem; font-style: italic; }\n.bpp-cv-geom { margin: 0 12px 4px; font-size: 0.75rem; color: var(--_text-3); font-variant-numeric: tabular-nums; }\n.bpp-cv-attr { margin: 0 12px; font-size: 0.75rem; color: var(--_text-2); font-style: italic; }\n.bpp-cv-empty { padding: 4px 12px; font-size: 0.75rem; color: var(--_text-3); }\n\n/* Finding cards. */\n.bpp-cv-finding {\n border: 1px solid var(--_divider); border-left-width: 3px; border-radius: var(--_radius-sm);\n padding: 8px 10px; background: var(--_bg); display: flex; flex-direction: column; gap: 5px;\n}\n.bpp-cv-issues-group .bpp-cv-finding { margin: 0 12px; }\n.bpp-cv-finding-error { border-left-color: var(--_sev-error); }\n.bpp-cv-finding-warning { border-left-color: var(--_sev-warning); }\n.bpp-cv-finding-info { border-left-color: var(--_sev-info); }\n.bpp-cv-finding-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }\n.bpp-cv-badge {\n padding: 1px 6px; border-radius: 4px; font-size: 0.625rem; font-weight: 700;\n text-transform: uppercase; letter-spacing: 0.03em; color: #fff;\n}\n.bpp-cv-badge-error { background: var(--_sev-error); }\n.bpp-cv-badge-warning { background: var(--_sev-warning); }\n.bpp-cv-badge-info { background: var(--_sev-info); }\n.bpp-cv-clause { font-size: 0.6875rem; color: var(--_text-3); font-variant-numeric: tabular-nums; }\n.bpp-cv-msg { margin: 0; font-size: 0.75rem; color: var(--_text-1); line-height: 1.45; }\n.bpp-cv-fix { margin: 0; font-size: 0.75rem; color: var(--_text-2); line-height: 1.45; }\n.bpp-cv-fix-label { font-weight: 700; color: var(--_sev-ok); }\n.bpp-cv-jump {\n align-self: flex-start; margin-top: 2px; padding: 3px 8px; border: 1px solid var(--_divider);\n border-radius: var(--_radius-sm); background: var(--_bg-soft); color: var(--_brand);\n font: inherit; font-size: 0.6875rem; font-weight: 600; cursor: pointer;\n}\n.bpp-cv-jump:hover { background: var(--_brand-soft); }\n\n/* On-page markers (issues heatmap) + selection. */\n.bpp-cv-mark { position: absolute; box-sizing: border-box; border-radius: 1px; border: 1px solid transparent; }\n.bpp-cv-mark-error { background: color-mix(in srgb, var(--_sev-error) 12%, transparent); border-color: color-mix(in srgb, var(--_sev-error) 55%, transparent); }\n.bpp-cv-mark-warning { background: color-mix(in srgb, var(--_sev-warning) 12%, transparent); border-color: color-mix(in srgb, var(--_sev-warning) 55%, transparent); }\n.bpp-cv-mark-info { background: color-mix(in srgb, var(--_sev-info) 10%, transparent); border-color: color-mix(in srgb, var(--_sev-info) 45%, transparent); }\n.bpp-cv-sel { position: absolute; box-sizing: border-box; border-radius: 1px; background: color-mix(in srgb, var(--_brand) 16%, transparent); border: 2px solid var(--_brand); }\n.bpp-cv-sel-error { background: color-mix(in srgb, var(--_sev-error) 20%, transparent); border-color: var(--_sev-error); }\n.bpp-cv-sel-warning { background: color-mix(in srgb, var(--_sev-warning) 20%, transparent); border-color: var(--_sev-warning); }\n.bpp-cv-sel-info { background: color-mix(in srgb, var(--_sev-info) 18%, transparent); border-color: var(--_sev-info); }\n\n/* \u2500\u2500 Custom Scrollbars \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n/* scrollbar-color is inherited. Set it on the previewer root so nested plugin\n scrollers (such as the accessibility inspector) cannot inherit the host\n document's scrollbar theme through the shadow host. */\n.bpp-styled-scrollbars {\n scrollbar-color: var(--_divider) transparent;\n}\n";