@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.
- package/LICENSE +661 -0
- package/README.md +344 -0
- package/dist/browser/codexOverlay.d.ts +109 -0
- package/dist/browser/codexOverlay.d.ts.map +1 -0
- package/dist/browser/codexOverlay.js +256 -0
- package/dist/browser/codexOverlay.js.map +1 -0
- package/dist/browser/constants.d.ts +13 -0
- package/dist/browser/constants.d.ts.map +1 -0
- package/dist/browser/constants.js +13 -0
- package/dist/browser/constants.js.map +1 -0
- package/dist/browser/index.d.ts +211 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +1190 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/pantone-gold.d.ts +59 -0
- package/dist/browser/pantone-gold.d.ts.map +1 -0
- package/dist/browser/pantone-gold.js +237 -0
- package/dist/browser/pantone-gold.js.map +1 -0
- package/dist/components/AnnotationCanvas.d.ts +27 -0
- package/dist/components/AnnotationCanvas.d.ts.map +1 -0
- package/dist/components/AnnotationCanvas.js +401 -0
- package/dist/components/AnnotationCanvas.js.map +1 -0
- package/dist/components/AnnotationNotesPanel.d.ts +15 -0
- package/dist/components/AnnotationNotesPanel.d.ts.map +1 -0
- package/dist/components/AnnotationNotesPanel.js +235 -0
- package/dist/components/AnnotationNotesPanel.js.map +1 -0
- package/dist/components/AnnotationThread.d.ts +18 -0
- package/dist/components/AnnotationThread.d.ts.map +1 -0
- package/dist/components/AnnotationThread.js +163 -0
- package/dist/components/AnnotationThread.js.map +1 -0
- package/dist/components/AnnotationToolbar.d.ts +39 -0
- package/dist/components/AnnotationToolbar.d.ts.map +1 -0
- package/dist/components/AnnotationToolbar.js +258 -0
- package/dist/components/AnnotationToolbar.js.map +1 -0
- package/dist/components/BoxOverlay.d.ts +20 -0
- package/dist/components/BoxOverlay.d.ts.map +1 -0
- package/dist/components/BoxOverlay.js +107 -0
- package/dist/components/BoxOverlay.js.map +1 -0
- package/dist/components/ColorPickerTool.d.ts +11 -0
- package/dist/components/ColorPickerTool.d.ts.map +1 -0
- package/dist/components/ColorPickerTool.js +220 -0
- package/dist/components/ColorPickerTool.js.map +1 -0
- package/dist/components/DensitometerTool.d.ts +25 -0
- package/dist/components/DensitometerTool.d.ts.map +1 -0
- package/dist/components/DensitometerTool.js +246 -0
- package/dist/components/DensitometerTool.js.map +1 -0
- package/dist/components/DielineInfoPanel.d.ts +27 -0
- package/dist/components/DielineInfoPanel.d.ts.map +1 -0
- package/dist/components/DielineInfoPanel.js +23 -0
- package/dist/components/DielineInfoPanel.js.map +1 -0
- package/dist/components/DielineOverlay.d.ts +10 -0
- package/dist/components/DielineOverlay.d.ts.map +1 -0
- package/dist/components/DielineOverlay.js +57 -0
- package/dist/components/DielineOverlay.js.map +1 -0
- package/dist/components/FindingsSidebar.d.ts +50 -0
- package/dist/components/FindingsSidebar.d.ts.map +1 -0
- package/dist/components/FindingsSidebar.js +78 -0
- package/dist/components/FindingsSidebar.js.map +1 -0
- package/dist/components/LayerCanvas.d.ts +30 -0
- package/dist/components/LayerCanvas.d.ts.map +1 -0
- package/dist/components/LayerCanvas.js +84 -0
- package/dist/components/LayerCanvas.js.map +1 -0
- package/dist/components/LayerPanel.d.ts +9 -0
- package/dist/components/LayerPanel.d.ts.map +1 -0
- package/dist/components/LayerPanel.js +144 -0
- package/dist/components/LayerPanel.js.map +1 -0
- package/dist/components/LensPDF.d.ts +61 -0
- package/dist/components/LensPDF.d.ts.map +1 -0
- package/dist/components/LensPDF.js +49 -0
- package/dist/components/LensPDF.js.map +1 -0
- package/dist/components/LensPDFDemo.d.ts +160 -0
- package/dist/components/LensPDFDemo.d.ts.map +1 -0
- package/dist/components/LensPDFDemo.js +1060 -0
- package/dist/components/LensPDFDemo.js.map +1 -0
- package/dist/components/LensPDFDemo.styles.d.ts +38 -0
- package/dist/components/LensPDFDemo.styles.d.ts.map +1 -0
- package/dist/components/LensPDFDemo.styles.js +282 -0
- package/dist/components/LensPDFDemo.styles.js.map +1 -0
- package/dist/components/LensPDFViewer.d.ts +79 -0
- package/dist/components/LensPDFViewer.d.ts.map +1 -0
- package/dist/components/LensPDFViewer.js +254 -0
- package/dist/components/LensPDFViewer.js.map +1 -0
- package/dist/components/MeasureTool.d.ts +16 -0
- package/dist/components/MeasureTool.d.ts.map +1 -0
- package/dist/components/MeasureTool.js +137 -0
- package/dist/components/MeasureTool.js.map +1 -0
- package/dist/components/MobileBottomSheet.d.ts +12 -0
- package/dist/components/MobileBottomSheet.d.ts.map +1 -0
- package/dist/components/MobileBottomSheet.js +113 -0
- package/dist/components/MobileBottomSheet.js.map +1 -0
- package/dist/components/MobileDrawer.d.ts +31 -0
- package/dist/components/MobileDrawer.d.ts.map +1 -0
- package/dist/components/MobileDrawer.js +67 -0
- package/dist/components/MobileDrawer.js.map +1 -0
- package/dist/components/PageCanvas.d.ts +33 -0
- package/dist/components/PageCanvas.d.ts.map +1 -0
- package/dist/components/PageCanvas.js +385 -0
- package/dist/components/PageCanvas.js.map +1 -0
- package/dist/components/PageNavigator.d.ts +18 -0
- package/dist/components/PageNavigator.d.ts.map +1 -0
- package/dist/components/PageNavigator.js +44 -0
- package/dist/components/PageNavigator.js.map +1 -0
- package/dist/components/SeparationCanvas.d.ts +12 -0
- package/dist/components/SeparationCanvas.d.ts.map +1 -0
- package/dist/components/SeparationCanvas.js +174 -0
- package/dist/components/SeparationCanvas.js.map +1 -0
- package/dist/components/TACHeatmapOverlay.d.ts +17 -0
- package/dist/components/TACHeatmapOverlay.d.ts.map +1 -0
- package/dist/components/TACHeatmapOverlay.js +119 -0
- package/dist/components/TACHeatmapOverlay.js.map +1 -0
- package/dist/components/ZoomControls.d.ts +11 -0
- package/dist/components/ZoomControls.d.ts.map +1 -0
- package/dist/components/ZoomControls.js +26 -0
- package/dist/components/ZoomControls.js.map +1 -0
- package/dist/components/defaultShellPlugins.d.ts +3 -0
- package/dist/components/defaultShellPlugins.d.ts.map +1 -0
- package/dist/components/defaultShellPlugins.js +273 -0
- package/dist/components/defaultShellPlugins.js.map +1 -0
- package/dist/components/index.d.ts +32 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +32 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/presets.d.ts +8 -0
- package/dist/components/presets.d.ts.map +1 -0
- package/dist/components/presets.js +14 -0
- package/dist/components/presets.js.map +1 -0
- package/dist/components/shellPlugins.d.ts +105 -0
- package/dist/components/shellPlugins.d.ts.map +1 -0
- package/dist/components/shellPlugins.js +52 -0
- package/dist/components/shellPlugins.js.map +1 -0
- package/dist/components/useIsMobile.d.ts +16 -0
- package/dist/components/useIsMobile.d.ts.map +1 -0
- package/dist/components/useIsMobile.js +30 -0
- package/dist/components/useIsMobile.js.map +1 -0
- package/dist/fallback-pdfjs/index.d.ts +60 -0
- package/dist/fallback-pdfjs/index.d.ts.map +1 -0
- package/dist/fallback-pdfjs/index.js +163 -0
- package/dist/fallback-pdfjs/index.js.map +1 -0
- package/dist/host/LensPDFProvider.d.ts +36 -0
- package/dist/host/LensPDFProvider.d.ts.map +1 -0
- package/dist/host/LensPDFProvider.js +12 -0
- package/dist/host/LensPDFProvider.js.map +1 -0
- package/dist/host/index.d.ts +167 -0
- package/dist/host/index.d.ts.map +1 -0
- package/dist/host/index.js +173 -0
- package/dist/host/index.js.map +1 -0
- package/dist/host/pdfFallback.d.ts +50 -0
- package/dist/host/pdfFallback.d.ts.map +1 -0
- package/dist/host/pdfFallback.js +171 -0
- package/dist/host/pdfFallback.js.map +1 -0
- package/dist/host/pdfValidation.d.ts +45 -0
- package/dist/host/pdfValidation.d.ts.map +1 -0
- package/dist/host/pdfValidation.js +78 -0
- package/dist/host/pdfValidation.js.map +1 -0
- package/dist/host/shareLink.d.ts +80 -0
- package/dist/host/shareLink.d.ts.map +1 -0
- package/dist/host/shareLink.js +114 -0
- package/dist/host/shareLink.js.map +1 -0
- package/dist/host/useLensPDF.d.ts +73 -0
- package/dist/host/useLensPDF.d.ts.map +1 -0
- package/dist/host/useLensPDF.js +213 -0
- package/dist/host/useLensPDF.js.map +1 -0
- package/dist/index.d.ts +68 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +62 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin/context.d.ts +70 -0
- package/dist/plugin/context.d.ts.map +1 -0
- package/dist/plugin/context.js +16 -0
- package/dist/plugin/context.js.map +1 -0
- package/dist/plugin/findings-location.d.ts +53 -0
- package/dist/plugin/findings-location.d.ts.map +1 -0
- package/dist/plugin/findings-location.js +72 -0
- package/dist/plugin/findings-location.js.map +1 -0
- package/dist/plugin/index.d.ts +19 -0
- package/dist/plugin/index.d.ts.map +1 -0
- package/dist/plugin/index.js +16 -0
- package/dist/plugin/index.js.map +1 -0
- package/dist/plugin/registry.d.ts +61 -0
- package/dist/plugin/registry.d.ts.map +1 -0
- package/dist/plugin/registry.js +102 -0
- package/dist/plugin/registry.js.map +1 -0
- package/dist/plugin/services.d.ts +380 -0
- package/dist/plugin/services.d.ts.map +1 -0
- package/dist/plugin/services.js +104 -0
- package/dist/plugin/services.js.map +1 -0
- package/dist/plugin/types.d.ts +198 -0
- package/dist/plugin/types.d.ts.map +1 -0
- package/dist/plugin/types.js +24 -0
- package/dist/plugin/types.js.map +1 -0
- package/dist/types/index.d.ts +191 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +95 -0
- package/dist/types/index.js.map +1 -0
- package/dist/units/index.d.ts +64 -0
- package/dist/units/index.d.ts.map +1 -0
- package/dist/units/index.js +98 -0
- package/dist/units/index.js.map +1 -0
- package/docs/architecture.md +90 -0
- package/docs/components.md +569 -0
- package/docs/contributing.md +78 -0
- package/docs/fallback.md +174 -0
- package/docs/lens-pdf-viewer.md +128 -0
- package/docs/licensing.md +78 -0
- package/docs/measurement-units.md +87 -0
- package/docs/plugins.md +256 -0
- package/docs/security.md +69 -0
- package/docs/server.md +212 -0
- package/docs/services.md +210 -0
- package/docs/share-links.md +111 -0
- package/docs/theming.md +164 -0
- package/docs/validation.md +83 -0
- package/package.json +139 -0
|
@@ -0,0 +1,98 @@
|
|
|
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
|
+
/**
|
|
14
|
+
* Millimetre. The metric default for print workflows.
|
|
15
|
+
*
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
export const mmUnit = {
|
|
19
|
+
id: "mm",
|
|
20
|
+
label: "mm",
|
|
21
|
+
fromPoints: (points) => points * (25.4 / 72),
|
|
22
|
+
toPoints: (mm) => mm * (72 / 25.4),
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Inch. The U.S. print standard.
|
|
26
|
+
*
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
export const inchUnit = {
|
|
30
|
+
id: "in",
|
|
31
|
+
label: "in",
|
|
32
|
+
fromPoints: (points) => points / 72,
|
|
33
|
+
toPoints: (inches) => inches * 72,
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Point. The PDF coordinate-space native unit (1 pt = 1/72 inch).
|
|
37
|
+
*
|
|
38
|
+
* @public
|
|
39
|
+
*/
|
|
40
|
+
export const pointUnit = {
|
|
41
|
+
id: "pt",
|
|
42
|
+
label: "pt",
|
|
43
|
+
fromPoints: (points) => points,
|
|
44
|
+
toPoints: (pt) => pt,
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Pica. Twelve points. Used in classical typography for body
|
|
48
|
+
* widths and column gutters.
|
|
49
|
+
*
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
export const picaUnit = {
|
|
53
|
+
id: "pica",
|
|
54
|
+
label: "pc",
|
|
55
|
+
fromPoints: (points) => points / 12,
|
|
56
|
+
toPoints: (pica) => pica * 12,
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Agate. 5.5 points. Historical newspaper measurement for column
|
|
60
|
+
* inches in classified ads.
|
|
61
|
+
*
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
export const agateUnit = {
|
|
65
|
+
id: "agate",
|
|
66
|
+
label: "ag",
|
|
67
|
+
fromPoints: (points) => points / 5.5,
|
|
68
|
+
toPoints: (agate) => agate * 5.5,
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* The five built-in units in display order: mm, in, pt, pica,
|
|
72
|
+
* agate. `MeasureTool` defaults to a subset (`defaultMeasurementUnits`)
|
|
73
|
+
* for readability; consumers that want all five pass this array.
|
|
74
|
+
*
|
|
75
|
+
* @public
|
|
76
|
+
*/
|
|
77
|
+
export const allMeasurementUnits = [
|
|
78
|
+
mmUnit,
|
|
79
|
+
inchUnit,
|
|
80
|
+
pointUnit,
|
|
81
|
+
picaUnit,
|
|
82
|
+
agateUnit,
|
|
83
|
+
];
|
|
84
|
+
/**
|
|
85
|
+
* Default units shown by `MeasureTool` when no `units` prop is
|
|
86
|
+
* supplied: mm, in, pt. The two old-school print units (pica,
|
|
87
|
+
* agate) are available as opt-ins via `allMeasurementUnits` or
|
|
88
|
+
* by passing them explicitly — the readout would otherwise get
|
|
89
|
+
* cluttered for the common case.
|
|
90
|
+
*
|
|
91
|
+
* @public
|
|
92
|
+
*/
|
|
93
|
+
export const defaultMeasurementUnits = [
|
|
94
|
+
mmUnit,
|
|
95
|
+
inchUnit,
|
|
96
|
+
pointUnit,
|
|
97
|
+
];
|
|
98
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../units/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAoB;IACrC,EAAE,EAAE,IAAI;IACR,KAAK,EAAE,IAAI;IACX,UAAU,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC;IAC5C,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC;CACnC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAoB;IACvC,EAAE,EAAE,IAAI;IACR,KAAK,EAAE,IAAI;IACX,UAAU,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,GAAG,EAAE;IACnC,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,GAAG,EAAE;CAClC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAoB;IACxC,EAAE,EAAE,IAAI;IACR,KAAK,EAAE,IAAI;IACX,UAAU,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM;IAC9B,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE;CACrB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAoB;IACvC,EAAE,EAAE,MAAM;IACV,KAAK,EAAE,IAAI;IACX,UAAU,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,GAAG,EAAE;IACnC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,EAAE;CAC9B,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAoB;IACxC,EAAE,EAAE,OAAO;IACX,KAAK,EAAE,IAAI;IACX,UAAU,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,GAAG,GAAG;IACpC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,GAAG;CACjC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAmC;IACjE,MAAM;IACN,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,SAAS;CACV,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAmC;IACrE,MAAM;IACN,QAAQ;IACR,SAAS;CACV,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Architecture"
|
|
3
|
+
description: "How the two host contexts and the slot-aware plugin registry fit together, plus the coordinate space the viewer uses for pages, items, and sampling tools."
|
|
4
|
+
group: "Getting started"
|
|
5
|
+
order: 2
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Architecture
|
|
9
|
+
|
|
10
|
+
LensPDF deliberately knows nothing about your backend. Everything that
|
|
11
|
+
needs an API call goes through two React contexts your host application
|
|
12
|
+
provides, and a slot-aware plugin registry on top of that.
|
|
13
|
+
|
|
14
|
+
## The two contexts
|
|
15
|
+
|
|
16
|
+
- **`ViewerHostContext`** — `apiBase`, `jobApiBase`, `readOnly`. Read by
|
|
17
|
+
components via `useViewerHost()`.
|
|
18
|
+
- **`ViewerServicesContext`** — a `ViewerServices` object whose fields
|
|
19
|
+
cover page-image URLs, layers, separations, TAC heatmaps, color sampling,
|
|
20
|
+
the densitometer, annotations, report links, telemetry, i18n, and theme
|
|
21
|
+
tokens. Every field has a no-op default tagged as *unwired*; consuming
|
|
22
|
+
components self-hide when their service is unwired (see
|
|
23
|
+
[fallback.md](./fallback.md)) so you only implement what your host
|
|
24
|
+
actually has and tools without backing data simply don't appear.
|
|
25
|
+
|
|
26
|
+
Components inside the viewer call `useViewerServices()` to reach your host
|
|
27
|
+
data. Plugins receive the same `ViewerServices` through a `ViewerContext`
|
|
28
|
+
argument to their `mount()` callback.
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
┌──────────────────────────────────┐
|
|
32
|
+
<App> │ ViewerHostContext.Provider │
|
|
33
|
+
│ │ apiBase, jobApiBase, readOnly │
|
|
34
|
+
▼ └──────────────────────────────────┘
|
|
35
|
+
<ViewerHostContext> ▼
|
|
36
|
+
<ViewerServicesContext> ┌──────────────────────────────────┐
|
|
37
|
+
│ │ ViewerServicesContext.Provider │
|
|
38
|
+
▼ │ pageImages, layers, separations,│
|
|
39
|
+
core components │ tacHeatmap, colorSample, … │
|
|
40
|
+
(PageCanvas, …) └──────────────────────────────────┘
|
|
41
|
+
│
|
|
42
|
+
▼
|
|
43
|
+
plugin registry
|
|
44
|
+
│ register(plugin)
|
|
45
|
+
▼
|
|
46
|
+
getPluginsForSlot("overlay.canvas") → ReactNode[]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Public entry points
|
|
50
|
+
|
|
51
|
+
Imports are organised by entry point so your bundler only pulls what you use.
|
|
52
|
+
|
|
53
|
+
| Entry point | Contents |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| `@printwithsynergy/lens-pdf/components` | Every React component (`PageCanvas`, `ZoomControls`, `PageNavigator`, `LayerCanvas`, `LayerPanel`, `SeparationCanvas`, `TACHeatmapOverlay`, `BoxOverlay`, `DielineOverlay`, `MeasureTool`, `ColorPickerTool`, `DensitometerTool`, `AnnotationCanvas`, `AnnotationNotesPanel`, `AnnotationThread`, `AnnotationToolbar`, `MobileDrawer`, `MobileBottomSheet`, **`LensPDFViewer`**, **`LensPDFDemo`**) plus the shell-plugin helpers (`createDefaultShellPlugins`, `pluginsForPreset`, `pluginsForSlot`, `resolveShellPlugins`, `computeFeatureAvailability`) and types (`LensPDFShellPlugin`, `LensPDFShellSlot`, `LensPDFShellPluginContext`, `LensPDFFeatureAvailability`, `LensPDFPresetKind`). |
|
|
56
|
+
| `@printwithsynergy/lens-pdf/plugin` | Plugin protocol types (`OverlayPlugin`, `PanelPlugin`, `ToolbarPlugin`, `AnnotationSourceProvider`, `DialogPlugin`, `MeasurementUnit`, `OverlayItem`), `ViewerContext`, `ViewerServices`, the registry (`register`, `unregister`, `getPluginsForSlot`, `listAll`), and no-op defaults (`noopI18n`, `noopTelemetry`, `defaultThemeTokens`, **`darkThemeTokens`**). |
|
|
57
|
+
| `@printwithsynergy/lens-pdf/host` | `ViewerHostContext` + `ViewerServicesContext` and their `useViewerHost` / `useViewerServices` hooks. **`defaultUnwiredServices`**, **`useLensPDF()`**, **`LensPDFProvider`**, **`useFallbackMode`**, **`isUnwired`**, **`markUnwired`**, **`createPdfJsFallback`**, **`validatePdfFile`** / **`validatePdfUrl`**, **`generateShareLink`** / **`parseShareParams`**. |
|
|
58
|
+
| `@printwithsynergy/lens-pdf/browser` | Browser-only `ViewerServices` factory (`createBrowserViewerServices`, `BrowserViewerServices`, `BrowserViewerServicesOptions`), `defaultBrowserWorkerSrc`, `detectSpotInksFromPdfBytes`, `rgbToCmyk`, `useBrowserViewerServicesVersion`, `PROCESS_CHANNELS`, plus codex overlay helpers (`createCodexOverlayServices`, `extractInksFromColorWorld`, `extractLayersFromOcgs`). |
|
|
59
|
+
| `@printwithsynergy/lens-pdf/fallback-pdfjs` | The pdf.js-backed `PdfFallbackAdapter` factory: `createPdfJsFallback`, `defaultPdfWorkerSrc`. |
|
|
60
|
+
| `@printwithsynergy/lens-pdf/units` | Built-in `MeasurementUnit`s (`mmUnit`, `inchUnit`, `pointUnit`, `picaUnit`, `agateUnit`) plus the `defaultMeasurementUnits` and `allMeasurementUnits` arrays. |
|
|
61
|
+
| `@printwithsynergy/lens-pdf/types` | Shared type primitives (`PageInfo`, `PageBox`, `LayerInfo`, `ColorSample`, `ColorSampleInk`, `DensitometerSample`, `DensitometerChannel`, `DielineResult`, `ViewerConfig`, `ViewerCapabilityKey`, `FindingsSourceMode`, `DEFAULT_VIEWER_CONFIG`, `SEVERITY_COLORS`, `DEFAULT_DPI`, `THUMBNAIL_DPI`, **`pageInfoFromDimensions()`**). |
|
|
62
|
+
| `@printwithsynergy/lens-pdf` | Convenience barrel re-exporting `/plugin`, every component, every unit, plus the `/host` utilities, the drop-in `LensPDF` and `LensPDFDemo`, and the browser factory (`createBrowserViewerServices`, `defaultBrowserWorkerSrc`, `detectSpotInksFromPdfBytes`, `rgbToCmyk`, `useBrowserViewerServicesVersion`, `PROCESS_CHANNELS`). |
|
|
63
|
+
|
|
64
|
+
## What lives where
|
|
65
|
+
|
|
66
|
+
- Page-tile rendering, sampling tools, layer / separation modes, annotations,
|
|
67
|
+
and mobile chrome are **components** — see
|
|
68
|
+
[components.md](./components.md).
|
|
69
|
+
- The data-source surface those components depend on (URL builders, async
|
|
70
|
+
fetchers, RGB samples, Fabric JSON storage) is **`ViewerServices`** — see
|
|
71
|
+
[services.md](./services.md).
|
|
72
|
+
- Anything custom you bolt on (overlays, panels, toolbars, modal dialogs,
|
|
73
|
+
annotation sources) is a **plugin** — see [plugins.md](./plugins.md).
|
|
74
|
+
|
|
75
|
+
## Coordinate space
|
|
76
|
+
|
|
77
|
+
LensPDF uses PDF points (1 pt = 1/72 inch) as the canonical coordinate
|
|
78
|
+
space:
|
|
79
|
+
|
|
80
|
+
- `PageInfo.width_pts` / `height_pts` describe the page in PDF points.
|
|
81
|
+
- `PageInfo.media_box` / `crop_box` / `trim_box` / `bleed_box` are
|
|
82
|
+
lower-left + upper-right corners in PDF points.
|
|
83
|
+
- `OverlayItem.bbox` is `[x0, y0, x1, y1]` in PDF points.
|
|
84
|
+
- Sampling services (`colorSample.sampleAt`, `densitometer.sampleAt`)
|
|
85
|
+
receive `pdfX` / `pdfY` in PDF points with origin at the lower-left of
|
|
86
|
+
the page — the components handle the canvas-pixel-to-PDF-point flip
|
|
87
|
+
for you.
|
|
88
|
+
- The TAC heatmap is the one exception — its `listRuns` coordinates use a
|
|
89
|
+
top-left origin to match poppler's `pdftotext -bbox` output. The overlay
|
|
90
|
+
knows this and translates internally.
|