@printwithsynergy/lens-pdf 0.3.0-beta.81

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.
Files changed (213) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +344 -0
  3. package/dist/browser/codexOverlay.d.ts +109 -0
  4. package/dist/browser/codexOverlay.d.ts.map +1 -0
  5. package/dist/browser/codexOverlay.js +256 -0
  6. package/dist/browser/codexOverlay.js.map +1 -0
  7. package/dist/browser/constants.d.ts +13 -0
  8. package/dist/browser/constants.d.ts.map +1 -0
  9. package/dist/browser/constants.js +13 -0
  10. package/dist/browser/constants.js.map +1 -0
  11. package/dist/browser/index.d.ts +211 -0
  12. package/dist/browser/index.d.ts.map +1 -0
  13. package/dist/browser/index.js +1190 -0
  14. package/dist/browser/index.js.map +1 -0
  15. package/dist/browser/pantone-gold.d.ts +59 -0
  16. package/dist/browser/pantone-gold.d.ts.map +1 -0
  17. package/dist/browser/pantone-gold.js +237 -0
  18. package/dist/browser/pantone-gold.js.map +1 -0
  19. package/dist/components/AnnotationCanvas.d.ts +27 -0
  20. package/dist/components/AnnotationCanvas.d.ts.map +1 -0
  21. package/dist/components/AnnotationCanvas.js +401 -0
  22. package/dist/components/AnnotationCanvas.js.map +1 -0
  23. package/dist/components/AnnotationNotesPanel.d.ts +15 -0
  24. package/dist/components/AnnotationNotesPanel.d.ts.map +1 -0
  25. package/dist/components/AnnotationNotesPanel.js +235 -0
  26. package/dist/components/AnnotationNotesPanel.js.map +1 -0
  27. package/dist/components/AnnotationThread.d.ts +18 -0
  28. package/dist/components/AnnotationThread.d.ts.map +1 -0
  29. package/dist/components/AnnotationThread.js +163 -0
  30. package/dist/components/AnnotationThread.js.map +1 -0
  31. package/dist/components/AnnotationToolbar.d.ts +39 -0
  32. package/dist/components/AnnotationToolbar.d.ts.map +1 -0
  33. package/dist/components/AnnotationToolbar.js +258 -0
  34. package/dist/components/AnnotationToolbar.js.map +1 -0
  35. package/dist/components/BoxOverlay.d.ts +20 -0
  36. package/dist/components/BoxOverlay.d.ts.map +1 -0
  37. package/dist/components/BoxOverlay.js +107 -0
  38. package/dist/components/BoxOverlay.js.map +1 -0
  39. package/dist/components/ColorPickerTool.d.ts +11 -0
  40. package/dist/components/ColorPickerTool.d.ts.map +1 -0
  41. package/dist/components/ColorPickerTool.js +220 -0
  42. package/dist/components/ColorPickerTool.js.map +1 -0
  43. package/dist/components/DensitometerTool.d.ts +25 -0
  44. package/dist/components/DensitometerTool.d.ts.map +1 -0
  45. package/dist/components/DensitometerTool.js +246 -0
  46. package/dist/components/DensitometerTool.js.map +1 -0
  47. package/dist/components/DielineInfoPanel.d.ts +27 -0
  48. package/dist/components/DielineInfoPanel.d.ts.map +1 -0
  49. package/dist/components/DielineInfoPanel.js +23 -0
  50. package/dist/components/DielineInfoPanel.js.map +1 -0
  51. package/dist/components/DielineOverlay.d.ts +10 -0
  52. package/dist/components/DielineOverlay.d.ts.map +1 -0
  53. package/dist/components/DielineOverlay.js +57 -0
  54. package/dist/components/DielineOverlay.js.map +1 -0
  55. package/dist/components/FindingsSidebar.d.ts +50 -0
  56. package/dist/components/FindingsSidebar.d.ts.map +1 -0
  57. package/dist/components/FindingsSidebar.js +78 -0
  58. package/dist/components/FindingsSidebar.js.map +1 -0
  59. package/dist/components/LayerCanvas.d.ts +30 -0
  60. package/dist/components/LayerCanvas.d.ts.map +1 -0
  61. package/dist/components/LayerCanvas.js +84 -0
  62. package/dist/components/LayerCanvas.js.map +1 -0
  63. package/dist/components/LayerPanel.d.ts +9 -0
  64. package/dist/components/LayerPanel.d.ts.map +1 -0
  65. package/dist/components/LayerPanel.js +144 -0
  66. package/dist/components/LayerPanel.js.map +1 -0
  67. package/dist/components/LensPDF.d.ts +61 -0
  68. package/dist/components/LensPDF.d.ts.map +1 -0
  69. package/dist/components/LensPDF.js +49 -0
  70. package/dist/components/LensPDF.js.map +1 -0
  71. package/dist/components/LensPDFDemo.d.ts +160 -0
  72. package/dist/components/LensPDFDemo.d.ts.map +1 -0
  73. package/dist/components/LensPDFDemo.js +1060 -0
  74. package/dist/components/LensPDFDemo.js.map +1 -0
  75. package/dist/components/LensPDFDemo.styles.d.ts +38 -0
  76. package/dist/components/LensPDFDemo.styles.d.ts.map +1 -0
  77. package/dist/components/LensPDFDemo.styles.js +282 -0
  78. package/dist/components/LensPDFDemo.styles.js.map +1 -0
  79. package/dist/components/LensPDFViewer.d.ts +79 -0
  80. package/dist/components/LensPDFViewer.d.ts.map +1 -0
  81. package/dist/components/LensPDFViewer.js +254 -0
  82. package/dist/components/LensPDFViewer.js.map +1 -0
  83. package/dist/components/MeasureTool.d.ts +16 -0
  84. package/dist/components/MeasureTool.d.ts.map +1 -0
  85. package/dist/components/MeasureTool.js +137 -0
  86. package/dist/components/MeasureTool.js.map +1 -0
  87. package/dist/components/MobileBottomSheet.d.ts +12 -0
  88. package/dist/components/MobileBottomSheet.d.ts.map +1 -0
  89. package/dist/components/MobileBottomSheet.js +113 -0
  90. package/dist/components/MobileBottomSheet.js.map +1 -0
  91. package/dist/components/MobileDrawer.d.ts +31 -0
  92. package/dist/components/MobileDrawer.d.ts.map +1 -0
  93. package/dist/components/MobileDrawer.js +67 -0
  94. package/dist/components/MobileDrawer.js.map +1 -0
  95. package/dist/components/PageCanvas.d.ts +33 -0
  96. package/dist/components/PageCanvas.d.ts.map +1 -0
  97. package/dist/components/PageCanvas.js +385 -0
  98. package/dist/components/PageCanvas.js.map +1 -0
  99. package/dist/components/PageNavigator.d.ts +18 -0
  100. package/dist/components/PageNavigator.d.ts.map +1 -0
  101. package/dist/components/PageNavigator.js +44 -0
  102. package/dist/components/PageNavigator.js.map +1 -0
  103. package/dist/components/SeparationCanvas.d.ts +12 -0
  104. package/dist/components/SeparationCanvas.d.ts.map +1 -0
  105. package/dist/components/SeparationCanvas.js +174 -0
  106. package/dist/components/SeparationCanvas.js.map +1 -0
  107. package/dist/components/TACHeatmapOverlay.d.ts +17 -0
  108. package/dist/components/TACHeatmapOverlay.d.ts.map +1 -0
  109. package/dist/components/TACHeatmapOverlay.js +119 -0
  110. package/dist/components/TACHeatmapOverlay.js.map +1 -0
  111. package/dist/components/ZoomControls.d.ts +11 -0
  112. package/dist/components/ZoomControls.d.ts.map +1 -0
  113. package/dist/components/ZoomControls.js +26 -0
  114. package/dist/components/ZoomControls.js.map +1 -0
  115. package/dist/components/defaultShellPlugins.d.ts +3 -0
  116. package/dist/components/defaultShellPlugins.d.ts.map +1 -0
  117. package/dist/components/defaultShellPlugins.js +273 -0
  118. package/dist/components/defaultShellPlugins.js.map +1 -0
  119. package/dist/components/index.d.ts +32 -0
  120. package/dist/components/index.d.ts.map +1 -0
  121. package/dist/components/index.js +32 -0
  122. package/dist/components/index.js.map +1 -0
  123. package/dist/components/presets.d.ts +8 -0
  124. package/dist/components/presets.d.ts.map +1 -0
  125. package/dist/components/presets.js +14 -0
  126. package/dist/components/presets.js.map +1 -0
  127. package/dist/components/shellPlugins.d.ts +105 -0
  128. package/dist/components/shellPlugins.d.ts.map +1 -0
  129. package/dist/components/shellPlugins.js +52 -0
  130. package/dist/components/shellPlugins.js.map +1 -0
  131. package/dist/components/useIsMobile.d.ts +16 -0
  132. package/dist/components/useIsMobile.d.ts.map +1 -0
  133. package/dist/components/useIsMobile.js +30 -0
  134. package/dist/components/useIsMobile.js.map +1 -0
  135. package/dist/fallback-pdfjs/index.d.ts +60 -0
  136. package/dist/fallback-pdfjs/index.d.ts.map +1 -0
  137. package/dist/fallback-pdfjs/index.js +163 -0
  138. package/dist/fallback-pdfjs/index.js.map +1 -0
  139. package/dist/host/LensPDFProvider.d.ts +36 -0
  140. package/dist/host/LensPDFProvider.d.ts.map +1 -0
  141. package/dist/host/LensPDFProvider.js +12 -0
  142. package/dist/host/LensPDFProvider.js.map +1 -0
  143. package/dist/host/index.d.ts +167 -0
  144. package/dist/host/index.d.ts.map +1 -0
  145. package/dist/host/index.js +173 -0
  146. package/dist/host/index.js.map +1 -0
  147. package/dist/host/pdfFallback.d.ts +50 -0
  148. package/dist/host/pdfFallback.d.ts.map +1 -0
  149. package/dist/host/pdfFallback.js +171 -0
  150. package/dist/host/pdfFallback.js.map +1 -0
  151. package/dist/host/pdfValidation.d.ts +45 -0
  152. package/dist/host/pdfValidation.d.ts.map +1 -0
  153. package/dist/host/pdfValidation.js +78 -0
  154. package/dist/host/pdfValidation.js.map +1 -0
  155. package/dist/host/shareLink.d.ts +80 -0
  156. package/dist/host/shareLink.d.ts.map +1 -0
  157. package/dist/host/shareLink.js +114 -0
  158. package/dist/host/shareLink.js.map +1 -0
  159. package/dist/host/useLensPDF.d.ts +73 -0
  160. package/dist/host/useLensPDF.d.ts.map +1 -0
  161. package/dist/host/useLensPDF.js +213 -0
  162. package/dist/host/useLensPDF.js.map +1 -0
  163. package/dist/index.d.ts +68 -0
  164. package/dist/index.d.ts.map +1 -0
  165. package/dist/index.js +62 -0
  166. package/dist/index.js.map +1 -0
  167. package/dist/plugin/context.d.ts +70 -0
  168. package/dist/plugin/context.d.ts.map +1 -0
  169. package/dist/plugin/context.js +16 -0
  170. package/dist/plugin/context.js.map +1 -0
  171. package/dist/plugin/findings-location.d.ts +53 -0
  172. package/dist/plugin/findings-location.d.ts.map +1 -0
  173. package/dist/plugin/findings-location.js +72 -0
  174. package/dist/plugin/findings-location.js.map +1 -0
  175. package/dist/plugin/index.d.ts +19 -0
  176. package/dist/plugin/index.d.ts.map +1 -0
  177. package/dist/plugin/index.js +16 -0
  178. package/dist/plugin/index.js.map +1 -0
  179. package/dist/plugin/registry.d.ts +61 -0
  180. package/dist/plugin/registry.d.ts.map +1 -0
  181. package/dist/plugin/registry.js +102 -0
  182. package/dist/plugin/registry.js.map +1 -0
  183. package/dist/plugin/services.d.ts +380 -0
  184. package/dist/plugin/services.d.ts.map +1 -0
  185. package/dist/plugin/services.js +104 -0
  186. package/dist/plugin/services.js.map +1 -0
  187. package/dist/plugin/types.d.ts +198 -0
  188. package/dist/plugin/types.d.ts.map +1 -0
  189. package/dist/plugin/types.js +24 -0
  190. package/dist/plugin/types.js.map +1 -0
  191. package/dist/types/index.d.ts +191 -0
  192. package/dist/types/index.d.ts.map +1 -0
  193. package/dist/types/index.js +95 -0
  194. package/dist/types/index.js.map +1 -0
  195. package/dist/units/index.d.ts +64 -0
  196. package/dist/units/index.d.ts.map +1 -0
  197. package/dist/units/index.js +98 -0
  198. package/dist/units/index.js.map +1 -0
  199. package/docs/architecture.md +90 -0
  200. package/docs/components.md +569 -0
  201. package/docs/contributing.md +78 -0
  202. package/docs/fallback.md +174 -0
  203. package/docs/lens-pdf-viewer.md +128 -0
  204. package/docs/licensing.md +78 -0
  205. package/docs/measurement-units.md +87 -0
  206. package/docs/plugins.md +256 -0
  207. package/docs/security.md +69 -0
  208. package/docs/server.md +212 -0
  209. package/docs/services.md +210 -0
  210. package/docs/share-links.md +111 -0
  211. package/docs/theming.md +164 -0
  212. package/docs/validation.md +83 -0
  213. package/package.json +139 -0
@@ -0,0 +1,198 @@
1
+ /**
2
+ * Viewer plugin protocol — slot types + plugin shape.
3
+ *
4
+ * Plugins extend the viewer without modifying core. Each plugin
5
+ * declares the slot it mounts into; the registry resolves slot
6
+ * lookups in order.
7
+ *
8
+ * Slots map to where a plugin's `mount()` return value renders:
9
+ * - `overlay.canvas` — absolutely-positioned over the page canvas;
10
+ * draws annotation/finding overlays.
11
+ * - `panel.right`, `panel.left`, `panel.bottom` — side/bottom panels.
12
+ * - `toolbar.top`, `toolbar.left`, `toolbar.bottom` — toolbar pills.
13
+ * - `annotation.source` — non-visual; supplies annotation data via
14
+ * `AnnotationSourceProvider`.
15
+ * - `dialog.modal` — modal dialog launched from another plugin.
16
+ *
17
+ * Anything host- or domain-shaped (host-specific findings,
18
+ * brand-spec violations, audit verdicts) belongs in a plugin pack,
19
+ * not core.
20
+ *
21
+ * @public
22
+ */
23
+ import type { ReactNode } from "react";
24
+ import type { ViewerContext } from "./context";
25
+ /**
26
+ * Slot identifiers a plugin can mount into.
27
+ *
28
+ * @public
29
+ */
30
+ export type ViewerSlot = "overlay.canvas" | "panel.right" | "panel.left" | "panel.bottom" | "toolbar.top" | "toolbar.left" | "toolbar.bottom" | "annotation.source" | "dialog.modal";
31
+ /**
32
+ * Common manifest shared by every plugin shape.
33
+ *
34
+ * @public
35
+ */
36
+ export interface ViewerPluginManifest {
37
+ /** Stable plugin id. Convention: `<vendor>.<area>.<feature>`. */
38
+ id: string;
39
+ /** SemVer string — bump on protocol-affecting changes. */
40
+ version: string;
41
+ /** Slot the plugin mounts into. */
42
+ slot: ViewerSlot;
43
+ /**
44
+ * Optional opt-in override: when set, this plugin **replaces** the
45
+ * plugin with the given id in slot lookups. The replaced plugin
46
+ * stays registered (callers can still inspect it via `listAll()`),
47
+ * but `getPluginsForSlot()` returns this one instead.
48
+ *
49
+ * Use case: a third-party plugin pack ships its own findings panel
50
+ * by registering a `PanelPlugin` with
51
+ * `replaces: "vendor.findings.default"`. The viewer mounts the
52
+ * third-party panel; the original stays out of the slot.
53
+ *
54
+ * Constraints:
55
+ * - The replacement must declare the same `slot` as the target.
56
+ * Cross-slot overrides are not supported (panels can't replace
57
+ * overlays, etc.).
58
+ * - At most one plugin can claim a given `replaces` target. A
59
+ * second registration that targets the same id throws.
60
+ * - The target id does not need to be registered yet — the
61
+ * override registers cleanly even before the target loads, and
62
+ * starts shadowing as soon as the target appears.
63
+ */
64
+ replaces?: string;
65
+ }
66
+ /**
67
+ * A plugin that draws on the page-overlay canvas. The mount function
68
+ * returns React nodes positioned within the page overlay layer.
69
+ *
70
+ * @public
71
+ */
72
+ export interface OverlayPlugin extends ViewerPluginManifest {
73
+ slot: "overlay.canvas";
74
+ mount(ctx: ViewerContext): ReactNode;
75
+ }
76
+ /**
77
+ * A plugin that renders into a side or bottom panel.
78
+ *
79
+ * @public
80
+ */
81
+ export interface PanelPlugin extends ViewerPluginManifest {
82
+ slot: "panel.right" | "panel.left" | "panel.bottom";
83
+ /** Display title for the panel header / tab. */
84
+ title: string;
85
+ /** Sort order within the panel slot — lower renders first. */
86
+ order?: number;
87
+ mount(ctx: ViewerContext): ReactNode;
88
+ }
89
+ /**
90
+ * A plugin that contributes a toolbar control (icon button, dropdown,
91
+ * or arbitrary widget).
92
+ *
93
+ * @public
94
+ */
95
+ export interface ToolbarPlugin extends ViewerPluginManifest {
96
+ slot: "toolbar.top" | "toolbar.left" | "toolbar.bottom";
97
+ /** Sort order within the toolbar — lower renders first. */
98
+ order?: number;
99
+ mount(ctx: ViewerContext): ReactNode;
100
+ }
101
+ /**
102
+ * A non-visual plugin that supplies annotation data to the viewer.
103
+ *
104
+ * The viewer subscribes to `subscribe(callback)`; the provider invokes
105
+ * the callback with the current annotation list and on every change.
106
+ *
107
+ * @public
108
+ */
109
+ export interface AnnotationSourceProvider extends ViewerPluginManifest {
110
+ slot: "annotation.source";
111
+ /** Called on mount; returns an unsubscribe function. */
112
+ subscribe(ctx: ViewerContext, onChange: (annotations: ReadonlyArray<unknown>) => void): () => void;
113
+ }
114
+ /**
115
+ * A plugin that can launch a modal dialog.
116
+ *
117
+ * @public
118
+ */
119
+ export interface DialogPlugin extends ViewerPluginManifest {
120
+ slot: "dialog.modal";
121
+ mount(ctx: ViewerContext): ReactNode;
122
+ }
123
+ /**
124
+ * Discriminated union of every plugin shape. Use this when the slot
125
+ * is unknown at compile time.
126
+ *
127
+ * @public
128
+ */
129
+ export type ViewerPlugin = OverlayPlugin | PanelPlugin | ToolbarPlugin | AnnotationSourceProvider | DialogPlugin;
130
+ /**
131
+ * Measurement-unit plugin — pluggable unit definition for the
132
+ * `MeasureTool` core component. The viewer ships millimetre, inch,
133
+ * point, pica, and agate by default (see `units/`); hosts can
134
+ * extend with their own.
135
+ *
136
+ * @public
137
+ */
138
+ export interface MeasurementUnit {
139
+ /** Stable id (e.g., `"mm"`, `"in"`). */
140
+ id: string;
141
+ /** Display label. */
142
+ label: string;
143
+ /** Conversion from PDF points (1 pt = 1/72 inch) to this unit. */
144
+ fromPoints(points: number): number;
145
+ /** Inverse conversion. */
146
+ toPoints(value: number): number;
147
+ }
148
+ /**
149
+ * Generic overlay item rendered on top of a page canvas.
150
+ *
151
+ * Plugins and host adapters translate their domain types (findings,
152
+ * annotations, brand-spec violations, etc.) into `OverlayItem`s
153
+ * before handing them to a core component. The shape is
154
+ * deliberately minimal — anything richer that callers need to
155
+ * round-trip (per-finding metadata, click handlers, hover tooltips)
156
+ * goes through ``data: Record<string, unknown>``.
157
+ *
158
+ * @public
159
+ */
160
+ export interface OverlayItem {
161
+ /** Stable identifier for selection / hover / dedupe. */
162
+ readonly id: string;
163
+ /** 1-indexed page number this item belongs to. */
164
+ readonly page: number;
165
+ /**
166
+ * Optional bounding box in PDF points: ``[x0, y0, x1, y1]``. When
167
+ * absent, the item applies to the whole page (the renderer may
168
+ * draw a page-level indicator instead of a bbox).
169
+ */
170
+ readonly bbox?: readonly [number, number, number, number];
171
+ /**
172
+ * Severity-like tier the renderer maps to a colour. Hosts can
173
+ * supply their own palette via ``ViewerServices.tokens``; the
174
+ * default mapping treats ``"error"`` as red, ``"warning"`` as
175
+ * amber, ``"advisory"`` as blue.
176
+ */
177
+ readonly tier?: "error" | "warning" | "advisory" | "info" | "neutral";
178
+ /** Optional CSS hex colour override (e.g., ``"#ff5722"``). */
179
+ readonly color?: string;
180
+ /** Optional short label rendered alongside the bbox. */
181
+ readonly label?: string;
182
+ /**
183
+ * Optional longer description used by tooltip-style renderers.
184
+ * The host adapter is responsible for any domain-specific
185
+ * cleanup before populating this field (e.g., stripping long
186
+ * PDF object references that would blow out the tooltip).
187
+ */
188
+ readonly description?: string;
189
+ /**
190
+ * Optional short identifier code rendered alongside the tier
191
+ * (e.g., a vendor-specific check id like ``"PRINT_001"``).
192
+ * Renderers typically display this in a code badge in tooltips.
193
+ */
194
+ readonly code?: string;
195
+ /** Free-form payload for round-tripping host-specific data. */
196
+ readonly data?: Record<string, unknown>;
197
+ }
198
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceR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D;IACxD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Viewer plugin protocol — slot types + plugin shape.
3
+ *
4
+ * Plugins extend the viewer without modifying core. Each plugin
5
+ * declares the slot it mounts into; the registry resolves slot
6
+ * lookups in order.
7
+ *
8
+ * Slots map to where a plugin's `mount()` return value renders:
9
+ * - `overlay.canvas` — absolutely-positioned over the page canvas;
10
+ * draws annotation/finding overlays.
11
+ * - `panel.right`, `panel.left`, `panel.bottom` — side/bottom panels.
12
+ * - `toolbar.top`, `toolbar.left`, `toolbar.bottom` — toolbar pills.
13
+ * - `annotation.source` — non-visual; supplies annotation data via
14
+ * `AnnotationSourceProvider`.
15
+ * - `dialog.modal` — modal dialog launched from another plugin.
16
+ *
17
+ * Anything host- or domain-shaped (host-specific findings,
18
+ * brand-spec violations, audit verdicts) belongs in a plugin pack,
19
+ * not core.
20
+ *
21
+ * @public
22
+ */
23
+ export {};
24
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../plugin/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG"}
@@ -0,0 +1,191 @@
1
+ /**
2
+ * Core viewer types — generic PDF/canvas shapes consumed by the
3
+ * components in `components/`.
4
+ *
5
+ * The shapes here are deliberately host-neutral: page geometry,
6
+ * sampling-result records, layer entries, and a `ViewerConfig`
7
+ * surface for feature flags + branding. Anything domain-shaped
8
+ * (findings, audit verdicts, brand-spec violations, art-size
9
+ * metadata) lives in plugin packs, not here.
10
+ *
11
+ * @public
12
+ */
13
+ /** PDF box in PDF points: lower-left + upper-right corners. */
14
+ export interface PageBox {
15
+ x0: number;
16
+ y0: number;
17
+ x1: number;
18
+ y1: number;
19
+ }
20
+ /** Per-page metadata returned by the engine. */
21
+ export interface PageInfo {
22
+ page_num: number;
23
+ width_pts: number;
24
+ height_pts: number;
25
+ media_box: PageBox;
26
+ crop_box: PageBox | null;
27
+ trim_box: PageBox | null;
28
+ bleed_box: PageBox | null;
29
+ rotation: number;
30
+ }
31
+ /**
32
+ * Build a {@link PageInfo} from just the page number and PDF-point
33
+ * dimensions returned by a fallback adapter's ``getPageDimensions``.
34
+ * Sets ``media_box`` to the full page rectangle and leaves optional
35
+ * boxes null — matching what pdf.js exposes.
36
+ *
37
+ * @public
38
+ */
39
+ export declare function pageInfoFromDimensions(pageNum: number, widthPts: number, heightPts: number): PageInfo;
40
+ /**
41
+ * Dieline detection verdict. `source`:
42
+ * - `"name"` — name-match heuristic (CutContour, Dieline, etc.)
43
+ * - `"vision"` — vision-model spatial-reasoning fallback
44
+ * - `"missing"` — no dieline found
45
+ */
46
+ export interface DielineResult {
47
+ source: "name" | "vision" | "missing";
48
+ polylines: number[][][];
49
+ spot_name: string | null;
50
+ confidence: number;
51
+ /** Per-artwork bboxes extracted from dieline strokes. */
52
+ regions?: Array<{
53
+ x0: number;
54
+ y0: number;
55
+ x1: number;
56
+ y1: number;
57
+ width_mm: number;
58
+ height_mm: number;
59
+ }>;
60
+ /** True when the dieline layer paints in more than one colour. */
61
+ multi_color?: boolean;
62
+ }
63
+ /** Optional Content Group entry surfaced by the layer panel. */
64
+ export interface LayerInfo {
65
+ name: string;
66
+ ocg_index: number;
67
+ default_on: boolean;
68
+ /**
69
+ * True when this row is synthesized by the UI rather than sourced from
70
+ * PDF `/OCProperties` OCG data (e.g. flat PDFs with no optional content
71
+ * groups still get a single "Artwork" row so Layers mode doesn't look
72
+ * broken to non-technical users).
73
+ */
74
+ synthetic?: boolean;
75
+ /**
76
+ * Layer-row provenance:
77
+ * - `ocg` — real optional-content group from the PDF
78
+ * - `flattened-artwork` — synthetic fallback row for flat PDFs
79
+ */
80
+ kind?: "ocg" | "flattened-artwork";
81
+ }
82
+ export interface ColorSample {
83
+ x: number;
84
+ y: number;
85
+ rgb: [number, number, number];
86
+ hex: string;
87
+ tac: number | null;
88
+ /** Optional per-ink breakdown — process CMYK + any spot inks the
89
+ * service was able to detect at this point. Hosts that don't surface
90
+ * spot data leave this undefined. */
91
+ inks?: ColorSampleInk[];
92
+ }
93
+ export interface ColorSampleInk {
94
+ name: string;
95
+ percent: number;
96
+ type: "process" | "spot";
97
+ }
98
+ export interface DensitometerChannel {
99
+ name: string;
100
+ percent: number;
101
+ }
102
+ export interface DensitometerSample {
103
+ x: number;
104
+ y: number;
105
+ dpi: number;
106
+ channels: DensitometerChannel[];
107
+ tac: number;
108
+ tac_limit: number;
109
+ limit_exceeded: boolean;
110
+ }
111
+ /**
112
+ * Capabilities the viewer can request data for. Hosts unaware of a
113
+ * key can leave it unset; the viewer treats absence as "not
114
+ * available".
115
+ */
116
+ export type ViewerCapabilityKey = "findings" | "separations" | "tac" | "tac_runs" | "tiles_warmed" | "layers" | "fonts" | "images" | "thumbnails" | "metadata";
117
+ /** How the host produced the findings list backing this viewer
118
+ * session. The viewer never reads this — it's plumbed through so
119
+ * hosts that mount their own panels can show provenance ("findings
120
+ * generated by our engine", "imported from an external pipeline",
121
+ * etc.). Hosts free to ignore or extend the union. */
122
+ export type FindingsSourceMode = "engine" | "external" | "minimal";
123
+ export interface ViewerConfig {
124
+ enable_separations: boolean;
125
+ enable_tac_heatmap: boolean;
126
+ enable_annotations: boolean;
127
+ /** Public share-link only: whether anonymous visitors may create annotations. */
128
+ allow_annotations?: boolean;
129
+ enable_measurement: boolean;
130
+ enable_comparison: boolean;
131
+ enable_layers: boolean;
132
+ enable_findings_panel: boolean;
133
+ enable_page_thumbnails: boolean;
134
+ enable_zoom: boolean;
135
+ enable_download: boolean;
136
+ enable_html_report_link: boolean;
137
+ verdict_mode: "auto" | "manual" | "disabled";
138
+ default_zoom: number;
139
+ default_dpi: number;
140
+ default_tac_limit: number;
141
+ viewer_logo_url: string | null;
142
+ viewer_accent_color: string | null;
143
+ toolbar_position: "top" | "bottom";
144
+ dark_mode: boolean;
145
+ /** Resolved branding — null fields when `anonymous` is true. */
146
+ brand_name: string | null;
147
+ brand_logo_url: string | null;
148
+ brand_primary_color: string | null;
149
+ brand_accent_color: string | null;
150
+ /** True when the viewer must hide all tenant + host chrome. */
151
+ anonymous: boolean;
152
+ tenant_name: string | null;
153
+ support_email: string | null;
154
+ /** How findings were produced for this job. See {@link FindingsSourceMode}. */
155
+ findings_source: FindingsSourceMode;
156
+ /** Per-capability availability map (true = backed by data). */
157
+ capabilities: Partial<Record<ViewerCapabilityKey, boolean>>;
158
+ /** Plan-gate: false means the tenant may not invoke on-demand
159
+ * capability fill-in. */
160
+ capability_fillin_enabled: boolean;
161
+ /** Plan-gate: false means the viewer must hide annotation toolbar. */
162
+ annotations_enabled: boolean;
163
+ /** Plan-gate: empty means report downloads are not available. */
164
+ allowed_report_formats: string[];
165
+ tile_cdn_base: string | null;
166
+ }
167
+ export declare const DEFAULT_VIEWER_CONFIG: ViewerConfig;
168
+ /**
169
+ * Severity-keyed fill/stroke palette. The keys mirror
170
+ * `OverlayItem["tier"]`'s `error` / `warning` / `advisory` values
171
+ * so canvas renderers can index in directly.
172
+ */
173
+ export declare const SEVERITY_COLORS: {
174
+ readonly error: {
175
+ readonly fill: "rgba(239, 68, 68, 0.15)";
176
+ readonly stroke: "#ef4444";
177
+ };
178
+ readonly warning: {
179
+ readonly fill: "rgba(245, 158, 11, 0.15)";
180
+ readonly stroke: "#f59e0b";
181
+ };
182
+ readonly advisory: {
183
+ readonly fill: "rgba(59, 130, 246, 0.15)";
184
+ readonly stroke: "#3b82f6";
185
+ };
186
+ };
187
+ /** Default render DPI for canvas-backed page tiles. */
188
+ export declare const DEFAULT_DPI = 150;
189
+ /** Default DPI for thumbnail/page-navigator tiles. */
190
+ export declare const THUMBNAIL_DPI = 72;
191
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,+DAA+D;AAC/D,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,gDAAgD;AAChD,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAChB,QAAQ,CAWV;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;IACtC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,OAAO,CAAC,EAAE,KAAK,CAAC;QACd,EAAE,EAAE,MAAM,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,EAAE,MAAM,CAAC;QACjB,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BAAkB,CAAC;IACpC,+DAA+D;IAC/D,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC,CAAC;IAC5D;8BAC0B;IAC1B,yBAAyB,EAAE,OAAO,CAAC;IACnC,sEAAsE;IACtE,mBAAmB,EAAE,OAAO,CAAC;IAC7B,iEAAiE;IACjE,sBAAsB,EAAE,MAAM,EAAE,CAAC;IACjC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,eAAO,MAAM,qBAAqB,EAAE,YA4CnC,CAAC;AAMF;;;;GAIG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;CAIlB,CAAC;AAEX,uDAAuD;AACvD,eAAO,MAAM,WAAW,MAAM,CAAC;AAE/B,sDAAsD;AACtD,eAAO,MAAM,aAAa,KAAK,CAAC"}
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Core viewer types — generic PDF/canvas shapes consumed by the
3
+ * components in `components/`.
4
+ *
5
+ * The shapes here are deliberately host-neutral: page geometry,
6
+ * sampling-result records, layer entries, and a `ViewerConfig`
7
+ * surface for feature flags + branding. Anything domain-shaped
8
+ * (findings, audit verdicts, brand-spec violations, art-size
9
+ * metadata) lives in plugin packs, not here.
10
+ *
11
+ * @public
12
+ */
13
+ /**
14
+ * Build a {@link PageInfo} from just the page number and PDF-point
15
+ * dimensions returned by a fallback adapter's ``getPageDimensions``.
16
+ * Sets ``media_box`` to the full page rectangle and leaves optional
17
+ * boxes null — matching what pdf.js exposes.
18
+ *
19
+ * @public
20
+ */
21
+ export function pageInfoFromDimensions(pageNum, widthPts, heightPts) {
22
+ return {
23
+ page_num: pageNum,
24
+ width_pts: widthPts,
25
+ height_pts: heightPts,
26
+ media_box: { x0: 0, y0: 0, x1: widthPts, y1: heightPts },
27
+ crop_box: null,
28
+ trim_box: null,
29
+ bleed_box: null,
30
+ rotation: 0,
31
+ };
32
+ }
33
+ export const DEFAULT_VIEWER_CONFIG = {
34
+ enable_separations: true,
35
+ enable_tac_heatmap: true,
36
+ enable_annotations: true,
37
+ enable_measurement: true,
38
+ enable_comparison: true,
39
+ enable_layers: true,
40
+ enable_findings_panel: true,
41
+ enable_page_thumbnails: true,
42
+ enable_zoom: true,
43
+ enable_download: true,
44
+ enable_html_report_link: true,
45
+ verdict_mode: "auto",
46
+ default_zoom: 100,
47
+ default_dpi: 150,
48
+ default_tac_limit: 300,
49
+ viewer_logo_url: null,
50
+ viewer_accent_color: null,
51
+ toolbar_position: "top",
52
+ dark_mode: false,
53
+ brand_name: null,
54
+ brand_logo_url: null,
55
+ brand_primary_color: "#1a3a7a",
56
+ brand_accent_color: "#2563eb",
57
+ anonymous: false,
58
+ tenant_name: null,
59
+ support_email: null,
60
+ findings_source: "engine",
61
+ capabilities: {
62
+ findings: true,
63
+ separations: true,
64
+ tac: true,
65
+ tac_runs: true,
66
+ tiles_warmed: false,
67
+ layers: true,
68
+ fonts: true,
69
+ images: true,
70
+ thumbnails: true,
71
+ metadata: true,
72
+ },
73
+ capability_fillin_enabled: true,
74
+ annotations_enabled: true,
75
+ allowed_report_formats: ["json", "html", "pdf", "xml"],
76
+ tile_cdn_base: null,
77
+ };
78
+ // ---------------------------------------------------------------------------
79
+ // Render constants
80
+ // ---------------------------------------------------------------------------
81
+ /**
82
+ * Severity-keyed fill/stroke palette. The keys mirror
83
+ * `OverlayItem["tier"]`'s `error` / `warning` / `advisory` values
84
+ * so canvas renderers can index in directly.
85
+ */
86
+ export const SEVERITY_COLORS = {
87
+ error: { fill: "rgba(239, 68, 68, 0.15)", stroke: "#ef4444" },
88
+ warning: { fill: "rgba(245, 158, 11, 0.15)", stroke: "#f59e0b" },
89
+ advisory: { fill: "rgba(59, 130, 246, 0.15)", stroke: "#3b82f6" },
90
+ };
91
+ /** Default render DPI for canvas-backed page tiles. */
92
+ export const DEFAULT_DPI = 150;
93
+ /** Default DPI for thumbnail/page-navigator tiles. */
94
+ export const THUMBNAIL_DPI = 72;
95
+ //# sourceMappingURL=index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AAe,EAAE,QAAQ;IACzB,YAAY,EAAE;QACZ,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,IAAI;QACjB,GAAG,EAAE,IAAI;QACT,QAAQ,EAAE,IAAI;QACd,YAAY,EAAE,KAAK;QACnB,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,IAAI;QACZ,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE,IAAI;KACf;IACD,yBAAyB,EAAE,IAAI;IAC/B,mBAAmB,EAAE,IAAI;IACzB,sBAAsB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC;IACtD,aAAa,EAAE,IAAI;CACpB,CAAC;AAEF,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,KAAK,EAAE,EAAE,IAAI,EAAE,yBAAyB,EAAE,MAAM,EAAE,SAAS,EAAE;IAC7D,OAAO,EAAE,EAAE,IAAI,EAAE,0BAA0B,EAAE,MAAM,EAAE,SAAS,EAAE;IAChE,QAAQ,EAAE,EAAE,IAAI,EAAE,0BAA0B,EAAE,MAAM,EAAE,SAAS,EAAE;CACzD,CAAC;AAEX,uDAAuD;AACvD,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAC;AAE/B,sDAAsD;AACtD,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAC"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Built-in measurement units shipped with the viewer.
3
+ *
4
+ * Five units are wired by default: millimetre, inch, point, pica,
5
+ * agate. Hosts can pass any subset (or extend with their own custom
6
+ * units) via the `units` prop on `MeasureTool`.
7
+ *
8
+ * Conversions are anchored to PDF points (1 pt = 1/72 inch). The
9
+ * inch is exact (25.4 mm), so all derived units are deterministic.
10
+ *
11
+ * @public
12
+ */
13
+ import type { MeasurementUnit } from "../plugin/types";
14
+ /**
15
+ * Millimetre. The metric default for print workflows.
16
+ *
17
+ * @public
18
+ */
19
+ export declare const mmUnit: MeasurementUnit;
20
+ /**
21
+ * Inch. The U.S. print standard.
22
+ *
23
+ * @public
24
+ */
25
+ export declare const inchUnit: MeasurementUnit;
26
+ /**
27
+ * Point. The PDF coordinate-space native unit (1 pt = 1/72 inch).
28
+ *
29
+ * @public
30
+ */
31
+ export declare const pointUnit: MeasurementUnit;
32
+ /**
33
+ * Pica. Twelve points. Used in classical typography for body
34
+ * widths and column gutters.
35
+ *
36
+ * @public
37
+ */
38
+ export declare const picaUnit: MeasurementUnit;
39
+ /**
40
+ * Agate. 5.5 points. Historical newspaper measurement for column
41
+ * inches in classified ads.
42
+ *
43
+ * @public
44
+ */
45
+ export declare const agateUnit: MeasurementUnit;
46
+ /**
47
+ * The five built-in units in display order: mm, in, pt, pica,
48
+ * agate. `MeasureTool` defaults to a subset (`defaultMeasurementUnits`)
49
+ * for readability; consumers that want all five pass this array.
50
+ *
51
+ * @public
52
+ */
53
+ export declare const allMeasurementUnits: ReadonlyArray<MeasurementUnit>;
54
+ /**
55
+ * Default units shown by `MeasureTool` when no `units` prop is
56
+ * supplied: mm, in, pt. The two old-school print units (pica,
57
+ * agate) are available as opt-ins via `allMeasurementUnits` or
58
+ * by passing them explicitly — the readout would otherwise get
59
+ * cluttered for the common case.
60
+ *
61
+ * @public
62
+ */
63
+ export declare const defaultMeasurementUnits: ReadonlyArray<MeasurementUnit>;
64
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../units/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD;;;;GAIG;AACH,eAAO,MAAM,MAAM,EAAE,eAKpB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,eAKtB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,eAKvB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,EAAE,eAKtB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,SAAS,EAAE,eAKvB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,EAAE,aAAa,CAAC,eAAe,CAM9D,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,EAAE,aAAa,CAAC,eAAe,CAIlE,CAAC"}