@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 @@
|
|
|
1
|
+
{"version":3,"file":"useIsMobile.js","sourceRoot":"","sources":["../../components/useIsMobile.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,WAAW,CAAC,UAAU,GAAG,GAAG;IAC1C,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,OAAO,MAAM,KAAK,WAAW;YAAE,OAAO;QAC1C,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,eAAe,UAAU,KAAK,CAAC,CAAC;QAC9D,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC9C,MAAM,EAAE,CAAC;QACT,GAAG,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACvC,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACzD,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IACjB,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@printwithsynergy/lens-pdf/fallback-pdfjs`
|
|
3
|
+
*
|
|
4
|
+
* In-browser PDF fallback adapter built on pdf.js. Provides "minimum
|
|
5
|
+
* data" (page count, dimensions, page rasters, OCG layers, RGB color
|
|
6
|
+
* sampling) for the fallback-capable tools when a host hasn't wired
|
|
7
|
+
* richer services.
|
|
8
|
+
*
|
|
9
|
+
* Distinct from the deprecated `createPdfJsFallback` re-export in
|
|
10
|
+
* `/host`: this subpath imports `pdfjs-dist` statically, so bundlers
|
|
11
|
+
* trace it correctly without the host having to side-effect-import
|
|
12
|
+
* the dep themselves. Hosts that never use the fallback never import
|
|
13
|
+
* this subpath and never pay the bundle cost.
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { createPdfJsFallback } from "@printwithsynergy/lens-pdf/fallback-pdfjs";
|
|
17
|
+
* const fallback = createPdfJsFallback({ pdfUrl: "/proofs/abc.pdf" });
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* Usually you don't import this directly — `<LensPDFViewer>` uses
|
|
21
|
+
* it internally and is the one-liner most hosts want.
|
|
22
|
+
*
|
|
23
|
+
* **Security**: this adapter fetches whatever URL the host hands it.
|
|
24
|
+
* Sign / scope / expire the URL the same way you would any other PDF
|
|
25
|
+
* download — the viewer is a pure renderer and trusts the host to
|
|
26
|
+
* enforce access control upstream.
|
|
27
|
+
*
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
import type { PdfFallbackAdapter } from "../plugin/services";
|
|
31
|
+
/**
|
|
32
|
+
* Default URL for the pdf.js worker, served via unpkg pinned to the
|
|
33
|
+
* exact `pdfjs-dist` version this package was built against. Hosts
|
|
34
|
+
* that don't want a runtime CDN dep can override via the
|
|
35
|
+
* `workerSrc` option, set `pdfjs.GlobalWorkerOptions.workerSrc`
|
|
36
|
+
* directly before constructing the adapter, or self-host the file.
|
|
37
|
+
*
|
|
38
|
+
* @public
|
|
39
|
+
*/
|
|
40
|
+
export declare const defaultPdfWorkerSrc: string;
|
|
41
|
+
interface PdfJsFallbackOptions {
|
|
42
|
+
/** Raw PDF URL. Must be reachable from the user's browser. */
|
|
43
|
+
pdfUrl: string;
|
|
44
|
+
/**
|
|
45
|
+
* Optional override for the pdf.js worker URL. Default:
|
|
46
|
+
* {@link defaultPdfWorkerSrc}, an unpkg URL pinned to the bundled
|
|
47
|
+
* pdfjs-dist version.
|
|
48
|
+
*/
|
|
49
|
+
workerSrc?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Build a {@link PdfFallbackAdapter} backed by pdf.js. The returned
|
|
53
|
+
* adapter caches the parsed document and per-page rasters so
|
|
54
|
+
* repeated calls don't re-parse or re-render.
|
|
55
|
+
*
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
58
|
+
export declare function createPdfJsFallback(opts: PdfJsFallbackOptions): PdfFallbackAdapter;
|
|
59
|
+
export {};
|
|
60
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../fallback-pdfjs/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,QAA2E,CAAC;AAE5G,UAAU,oBAAoB;IAC5B,8DAA8D;IAC9D,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,oBAAoB,GAAG,kBAAkB,CA2HlF"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@printwithsynergy/lens-pdf/fallback-pdfjs`
|
|
3
|
+
*
|
|
4
|
+
* In-browser PDF fallback adapter built on pdf.js. Provides "minimum
|
|
5
|
+
* data" (page count, dimensions, page rasters, OCG layers, RGB color
|
|
6
|
+
* sampling) for the fallback-capable tools when a host hasn't wired
|
|
7
|
+
* richer services.
|
|
8
|
+
*
|
|
9
|
+
* Distinct from the deprecated `createPdfJsFallback` re-export in
|
|
10
|
+
* `/host`: this subpath imports `pdfjs-dist` statically, so bundlers
|
|
11
|
+
* trace it correctly without the host having to side-effect-import
|
|
12
|
+
* the dep themselves. Hosts that never use the fallback never import
|
|
13
|
+
* this subpath and never pay the bundle cost.
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* import { createPdfJsFallback } from "@printwithsynergy/lens-pdf/fallback-pdfjs";
|
|
17
|
+
* const fallback = createPdfJsFallback({ pdfUrl: "/proofs/abc.pdf" });
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* Usually you don't import this directly — `<LensPDFViewer>` uses
|
|
21
|
+
* it internally and is the one-liner most hosts want.
|
|
22
|
+
*
|
|
23
|
+
* **Security**: this adapter fetches whatever URL the host hands it.
|
|
24
|
+
* Sign / scope / expire the URL the same way you would any other PDF
|
|
25
|
+
* download — the viewer is a pure renderer and trusts the host to
|
|
26
|
+
* enforce access control upstream.
|
|
27
|
+
*
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
import * as pdfjs from "pdfjs-dist";
|
|
31
|
+
/**
|
|
32
|
+
* Default URL for the pdf.js worker, served via unpkg pinned to the
|
|
33
|
+
* exact `pdfjs-dist` version this package was built against. Hosts
|
|
34
|
+
* that don't want a runtime CDN dep can override via the
|
|
35
|
+
* `workerSrc` option, set `pdfjs.GlobalWorkerOptions.workerSrc`
|
|
36
|
+
* directly before constructing the adapter, or self-host the file.
|
|
37
|
+
*
|
|
38
|
+
* @public
|
|
39
|
+
*/
|
|
40
|
+
export const defaultPdfWorkerSrc = `https://unpkg.com/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.mjs`;
|
|
41
|
+
const sampleCanvases = new Map();
|
|
42
|
+
/**
|
|
43
|
+
* Build a {@link PdfFallbackAdapter} backed by pdf.js. The returned
|
|
44
|
+
* adapter caches the parsed document and per-page rasters so
|
|
45
|
+
* repeated calls don't re-parse or re-render.
|
|
46
|
+
*
|
|
47
|
+
* @public
|
|
48
|
+
*/
|
|
49
|
+
export function createPdfJsFallback(opts) {
|
|
50
|
+
// Configure the worker once. Idempotent — repeated calls with the
|
|
51
|
+
// same value are no-ops.
|
|
52
|
+
const workerSrc = opts.workerSrc ?? defaultPdfWorkerSrc;
|
|
53
|
+
if (pdfjs.GlobalWorkerOptions.workerSrc !== workerSrc) {
|
|
54
|
+
pdfjs.GlobalWorkerOptions.workerSrc = workerSrc;
|
|
55
|
+
}
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
57
|
+
let docPromise = null;
|
|
58
|
+
const renderCache = new Map();
|
|
59
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
60
|
+
async function getDoc() {
|
|
61
|
+
if (!docPromise) {
|
|
62
|
+
docPromise = pdfjs.getDocument({ url: opts.pdfUrl }).promise;
|
|
63
|
+
}
|
|
64
|
+
return docPromise;
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
async getPageCount() {
|
|
68
|
+
const doc = await getDoc();
|
|
69
|
+
return doc.numPages;
|
|
70
|
+
},
|
|
71
|
+
async getPageDimensions(pageNum) {
|
|
72
|
+
const doc = await getDoc();
|
|
73
|
+
const page = await doc.getPage(pageNum);
|
|
74
|
+
const viewport = page.getViewport({ scale: 1 });
|
|
75
|
+
return { widthPts: viewport.width, heightPts: viewport.height };
|
|
76
|
+
},
|
|
77
|
+
async renderPageToUrl({ pageNum, dpi }) {
|
|
78
|
+
const cacheKey = `${pageNum}@${dpi}`;
|
|
79
|
+
const cached = renderCache.get(cacheKey);
|
|
80
|
+
if (cached)
|
|
81
|
+
return cached;
|
|
82
|
+
const doc = await getDoc();
|
|
83
|
+
const page = await doc.getPage(pageNum);
|
|
84
|
+
const scale = dpi / 72;
|
|
85
|
+
const viewport = page.getViewport({ scale });
|
|
86
|
+
const canvas = document.createElement("canvas");
|
|
87
|
+
canvas.width = Math.ceil(viewport.width);
|
|
88
|
+
canvas.height = Math.ceil(viewport.height);
|
|
89
|
+
const ctx = canvas.getContext("2d");
|
|
90
|
+
if (!ctx)
|
|
91
|
+
throw new Error("[lens-pdf] 2D context unavailable for fallback render.");
|
|
92
|
+
await page.render({ canvasContext: ctx, viewport }).promise;
|
|
93
|
+
const url = canvas.toDataURL("image/png");
|
|
94
|
+
renderCache.set(cacheKey, url);
|
|
95
|
+
return url;
|
|
96
|
+
},
|
|
97
|
+
async listLayers() {
|
|
98
|
+
const doc = await getDoc();
|
|
99
|
+
// pdf.js exposes OCGs through the OptionalContentConfig. Older
|
|
100
|
+
// versions / RGB-only PDFs simply have no groups → empty list.
|
|
101
|
+
let config;
|
|
102
|
+
try {
|
|
103
|
+
config = await doc.getOptionalContentConfig();
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
return [];
|
|
107
|
+
}
|
|
108
|
+
const groups = (config?.getGroups?.() ?? {});
|
|
109
|
+
const ids = Object.keys(groups);
|
|
110
|
+
return ids.map((id, index) => ({
|
|
111
|
+
name: groups[id]?.name ?? `Layer ${index + 1}`,
|
|
112
|
+
ocg_index: index,
|
|
113
|
+
default_on: config.isVisible(id) ?? true,
|
|
114
|
+
}));
|
|
115
|
+
},
|
|
116
|
+
async sampleColorAt({ pageNum, pdfX, pdfY, dpi = 150 }) {
|
|
117
|
+
const doc = await getDoc();
|
|
118
|
+
const page = await doc.getPage(pageNum);
|
|
119
|
+
const ptsToPx = dpi / 72;
|
|
120
|
+
const viewport = page.getViewport({ scale: ptsToPx });
|
|
121
|
+
// Render the whole page once per (page, dpi) and cache the
|
|
122
|
+
// canvas — repeated sampling is then a single getImageData call.
|
|
123
|
+
const canvasKey = `${pageNum}@${dpi}`;
|
|
124
|
+
let canvas = sampleCanvases.get(canvasKey);
|
|
125
|
+
if (!canvas) {
|
|
126
|
+
canvas = document.createElement("canvas");
|
|
127
|
+
canvas.width = Math.ceil(viewport.width);
|
|
128
|
+
canvas.height = Math.ceil(viewport.height);
|
|
129
|
+
const renderCtx = canvas.getContext("2d", { willReadFrequently: true });
|
|
130
|
+
if (!renderCtx)
|
|
131
|
+
return null;
|
|
132
|
+
await page.render({ canvasContext: renderCtx, viewport }).promise;
|
|
133
|
+
sampleCanvases.set(canvasKey, canvas);
|
|
134
|
+
}
|
|
135
|
+
// pdfX/pdfY use PDF-point coords with origin lower-left; canvas
|
|
136
|
+
// pixels use origin upper-left.
|
|
137
|
+
const pageHeightPts = viewport.height / ptsToPx;
|
|
138
|
+
const pxX = Math.max(0, Math.min(canvas.width - 1, Math.round(pdfX * ptsToPx)));
|
|
139
|
+
const pxY = Math.max(0, Math.min(canvas.height - 1, Math.round((pageHeightPts - pdfY) * ptsToPx)));
|
|
140
|
+
const ctx = canvas.getContext("2d");
|
|
141
|
+
if (!ctx)
|
|
142
|
+
return null;
|
|
143
|
+
const data = ctx.getImageData(pxX, pxY, 1, 1).data;
|
|
144
|
+
const r = data[0] ?? 0;
|
|
145
|
+
const g = data[1] ?? 0;
|
|
146
|
+
const b = data[2] ?? 0;
|
|
147
|
+
const hex = "#" +
|
|
148
|
+
[r, g, b]
|
|
149
|
+
.map((v) => v.toString(16).padStart(2, "0"))
|
|
150
|
+
.join("");
|
|
151
|
+
const sample = {
|
|
152
|
+
x: pdfX,
|
|
153
|
+
y: pdfY,
|
|
154
|
+
rgb: [r, g, b],
|
|
155
|
+
hex,
|
|
156
|
+
// pdf.js renders to RGB only — no real ink coverage available.
|
|
157
|
+
tac: null,
|
|
158
|
+
};
|
|
159
|
+
return sample;
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../fallback-pdfjs/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAIpC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,gCAAgC,KAAK,CAAC,OAAO,2BAA2B,CAAC;AAa5G,MAAM,cAAc,GAAG,IAAI,GAAG,EAA6B,CAAC;AAE5D;;;;;;GAMG;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;YACvB,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YACvB,MAAM,GAAG,GACP,GAAG;gBACH,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;qBACN,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;qBAC3C,IAAI,CAAC,EAAE,CAAC,CAAC;YACd,MAAM,MAAM,GAAgB;gBAC1B,CAAC,EAAE,IAAI;gBACP,CAAC,EAAE,IAAI;gBACP,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;gBACd,GAAG;gBACH,+DAA+D;gBAC/D,GAAG,EAAE,IAAI;aACV,CAAC;YACF,OAAO,MAAM,CAAC;QAChB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<LensPDFProvider>` — thin context wrapper that mounts both
|
|
3
|
+
* `ViewerHostContext` and `ViewerServicesContext` from a
|
|
4
|
+
* {@link UseLensPDFReturn} value.
|
|
5
|
+
*
|
|
6
|
+
* Pair with {@link useLensPDF} for the "full custom" tier:
|
|
7
|
+
*
|
|
8
|
+
* ```tsx
|
|
9
|
+
* const viewer = useLensPDF(url, { tokens });
|
|
10
|
+
* return (
|
|
11
|
+
* <LensPDFProvider value={viewer}>
|
|
12
|
+
* <MyCustomShell>
|
|
13
|
+
* <PageCanvas ... />
|
|
14
|
+
* </MyCustomShell>
|
|
15
|
+
* </LensPDFProvider>
|
|
16
|
+
* );
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
import type { ReactNode } from "react";
|
|
22
|
+
import type { UseLensPDFReturn } from "./useLensPDF";
|
|
23
|
+
/** Props for {@link LensPDFProvider}. */
|
|
24
|
+
export interface LensPDFProviderProps {
|
|
25
|
+
/** The return value from {@link useLensPDF}. */
|
|
26
|
+
value: UseLensPDFReturn;
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Mounts both `ViewerHostContext` and `ViewerServicesContext` from a
|
|
31
|
+
* `useLensPDF()` return value.
|
|
32
|
+
*
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
export declare function LensPDFProvider({ value, children }: LensPDFProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
//# sourceMappingURL=LensPDFProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LensPDFProvider.d.ts","sourceRoot":"","sources":["../../host/LensPDFProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,yCAAyC;AACzC,MAAM,WAAW,oBAAoB;IACnC,gDAAgD;IAChD,KAAK,EAAE,gBAAgB,CAAC;IACxB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,oBAAoB,2CAQxE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ViewerHostContext, ViewerServicesContext } from "./index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Mounts both `ViewerHostContext` and `ViewerServicesContext` from a
|
|
5
|
+
* `useLensPDF()` return value.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export function LensPDFProvider({ value, children }) {
|
|
10
|
+
return (_jsx(ViewerHostContext.Provider, { value: value.hostValue, children: _jsx(ViewerServicesContext.Provider, { value: value.servicesValue, children: children }) }));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=LensPDFProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LensPDFProvider.js","sourceRoot":"","sources":["../../host/LensPDFProvider.tsx"],"names":[],"mappings":";AAsBA,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAUnE;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAwB;IACvE,OAAO,CACL,KAAC,iBAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,CAAC,SAAS,YAChD,KAAC,qBAAqB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,CAAC,aAAa,YACvD,QAAQ,GACsB,GACN,CAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Viewer host context — the bridge between an embedding application
|
|
3
|
+
* and the core viewer components. Two contexts live here:
|
|
4
|
+
*
|
|
5
|
+
* - {@link ViewerHostContext}: cross-cutting host config (API base
|
|
6
|
+
* paths, read-only flag, debug toggle, optional pdf.js fallback).
|
|
7
|
+
* - {@link ViewerServicesContext}: the {@link ViewerServices} object
|
|
8
|
+
* carrying all the data-source protocols (page images, layers,
|
|
9
|
+
* separations, annotations, etc.). Components read services via
|
|
10
|
+
* {@link useViewerServices}; components decide between wired,
|
|
11
|
+
* fallback, and hidden render modes via {@link useFallbackMode}.
|
|
12
|
+
*
|
|
13
|
+
* Hosts mount a `<ViewerHostContext.Provider>` at the root of their
|
|
14
|
+
* app and supply concrete values; the no-op defaults exported below
|
|
15
|
+
* keep an unwired viewer renderable but quiet.
|
|
16
|
+
*
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
import type { PdfFallbackAdapter, ViewerServices } from "../plugin/services";
|
|
20
|
+
/**
|
|
21
|
+
* Values the host application supplies to the viewer's core
|
|
22
|
+
* components. Cross-cutting toggles, base API paths, and the
|
|
23
|
+
* optional PDF fallback adapter live here; per-feature data sources
|
|
24
|
+
* are on {@link ViewerServices}.
|
|
25
|
+
*
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
28
|
+
export interface ViewerHostContextValue {
|
|
29
|
+
/**
|
|
30
|
+
* Base path for viewer API calls (no trailing slash). The viewer
|
|
31
|
+
* itself never builds URLs from this — it's plumbed through for
|
|
32
|
+
* host-side service implementations that want a single source of
|
|
33
|
+
* truth (e.g. a host's `getPageImageUrl` returning
|
|
34
|
+
* ``${apiBase}/page/${n}.png``). Leave empty if your services
|
|
35
|
+
* compose URLs differently.
|
|
36
|
+
*/
|
|
37
|
+
apiBase: string;
|
|
38
|
+
/**
|
|
39
|
+
* Base path for job-level API calls (findings, reports, etc.).
|
|
40
|
+
* Same plumbing convention as {@link apiBase}.
|
|
41
|
+
*/
|
|
42
|
+
jobApiBase: string;
|
|
43
|
+
/**
|
|
44
|
+
* When true, hides write-only UI (annotations, verdict, comparison
|
|
45
|
+
* initiation). Public-token / share-link viewers run with this on.
|
|
46
|
+
*/
|
|
47
|
+
readOnly: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* When true, components log a one-shot ``console.info`` whenever
|
|
50
|
+
* they self-hide because their backing service is unwired. Off by
|
|
51
|
+
* default so production embeds stay quiet. Hosts typically derive
|
|
52
|
+
* this from an environment flag (``import.meta.env.DEV``,
|
|
53
|
+
* ``process.env.NODE_ENV !== "production"``, etc.).
|
|
54
|
+
*/
|
|
55
|
+
debug?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Optional URL to the raw PDF file. Consumed by the pdf.js fallback
|
|
58
|
+
* adapter (see ``createPdfJsFallback``) and by base components when
|
|
59
|
+
* no service is wired.
|
|
60
|
+
*
|
|
61
|
+
* **Security**: this is a pure renderer. Whatever URL the host puts
|
|
62
|
+
* here is fetched by the user's browser as-is — sign it, scope it,
|
|
63
|
+
* and expire it like any other PDF download link. Never point this
|
|
64
|
+
* at an unauthenticated path that exposes documents the viewer's
|
|
65
|
+
* user shouldn't see.
|
|
66
|
+
*/
|
|
67
|
+
pdfUrl?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Optional in-browser fallback adapter used when a richer service
|
|
70
|
+
* is unwired. See {@link PdfFallbackAdapter}. Hosts that don't set
|
|
71
|
+
* this get hide-on-unwired behaviour for every fallback-capable
|
|
72
|
+
* tool; hosts that set it (e.g. via ``createPdfJsFallback``) get
|
|
73
|
+
* graceful degradation instead.
|
|
74
|
+
*/
|
|
75
|
+
pdfFallback?: PdfFallbackAdapter;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* React context object. Default value is intentionally empty so a
|
|
79
|
+
* misconfigured viewer renders nothing surprising — components that
|
|
80
|
+
* read `apiBase` should treat the empty string as "no host wired up".
|
|
81
|
+
*
|
|
82
|
+
* @public
|
|
83
|
+
*/
|
|
84
|
+
export declare const ViewerHostContext: import("react").Context<ViewerHostContextValue>;
|
|
85
|
+
/**
|
|
86
|
+
* Hook for reading the current `ViewerHostContextValue`. Returns the
|
|
87
|
+
* default empty values when no provider is mounted.
|
|
88
|
+
*
|
|
89
|
+
* @public
|
|
90
|
+
*/
|
|
91
|
+
export declare function useViewerHost(): ViewerHostContextValue;
|
|
92
|
+
/**
|
|
93
|
+
* No-op default services. URL builders return empty strings; the
|
|
94
|
+
* other protocols are filled with the no-op stubs already defined
|
|
95
|
+
* in `core/plugin/services`. Hosts that supply a partial
|
|
96
|
+
* `ViewerServices` in their provider override only the fields they
|
|
97
|
+
* actually have.
|
|
98
|
+
*
|
|
99
|
+
* Choosing empty-string for URL builders (rather than throwing)
|
|
100
|
+
* keeps the boundary forgiving — a misconfigured viewer renders
|
|
101
|
+
* blank tiles, but doesn't crash.
|
|
102
|
+
*/
|
|
103
|
+
declare const defaultViewerServices: ViewerServices;
|
|
104
|
+
/**
|
|
105
|
+
* React context carrying the active `ViewerServices` instance.
|
|
106
|
+
* `<ViewerServicesContext.Provider value={...}>` mounts a host's
|
|
107
|
+
* concrete implementation; downstream plugin packs typically expose
|
|
108
|
+
* a factory like `createMyHostViewerServices(...)` that returns one.
|
|
109
|
+
*
|
|
110
|
+
* @public
|
|
111
|
+
*/
|
|
112
|
+
export declare const ViewerServicesContext: import("react").Context<ViewerServices>;
|
|
113
|
+
/**
|
|
114
|
+
* Hook for reading the active `ViewerServices`. Returns the no-op
|
|
115
|
+
* defaults when no provider is mounted.
|
|
116
|
+
*
|
|
117
|
+
* @public
|
|
118
|
+
*/
|
|
119
|
+
export declare function useViewerServices(): ViewerServices;
|
|
120
|
+
/**
|
|
121
|
+
* One-shot ``console.info`` for components that self-hide because
|
|
122
|
+
* their backing service is unwired. Silent unless ``host.debug`` is
|
|
123
|
+
* on, and deduped per-component-name so a thousand re-renders don't
|
|
124
|
+
* spam the console.
|
|
125
|
+
*
|
|
126
|
+
* @public
|
|
127
|
+
*/
|
|
128
|
+
export declare function logUnwiredHide(componentName: string, serviceName: string): void;
|
|
129
|
+
/**
|
|
130
|
+
* Helper hook used by fallback-capable components. Returns a stable
|
|
131
|
+
* tuple describing how the component should render its data source:
|
|
132
|
+
*
|
|
133
|
+
* - ``mode: "wired"`` — host provided the dedicated service; use it.
|
|
134
|
+
* - ``mode: "fallback"`` — service unwired but ``pdfFallback`` is
|
|
135
|
+
* present; use the fallback adapter.
|
|
136
|
+
* - ``mode: "hidden"`` — neither is available; render ``null``.
|
|
137
|
+
*
|
|
138
|
+
* Components are responsible for calling {@link logUnwiredHide} from
|
|
139
|
+
* an effect when they choose to hide; this hook deliberately doesn't
|
|
140
|
+
* log on its own so callers control the message.
|
|
141
|
+
*
|
|
142
|
+
* @public
|
|
143
|
+
*/
|
|
144
|
+
export declare function useFallbackMode(service: object | null | undefined): "wired" | "fallback" | "hidden";
|
|
145
|
+
/**
|
|
146
|
+
* Pre-built services where every protocol is a no-op default tagged
|
|
147
|
+
* with the unwired marker. Hosts that only need a partial override
|
|
148
|
+
* can spread this and replace the fields they've wired:
|
|
149
|
+
*
|
|
150
|
+
* ```ts
|
|
151
|
+
* const services = { ...defaultUnwiredServices, pageImages: myPageImages };
|
|
152
|
+
* ```
|
|
153
|
+
*
|
|
154
|
+
* @public
|
|
155
|
+
*/
|
|
156
|
+
export { defaultViewerServices as defaultUnwiredServices };
|
|
157
|
+
export { createPdfJsFallback } from "./pdfFallback";
|
|
158
|
+
export { isUnwired, markUnwired } from "../plugin/services";
|
|
159
|
+
export { validatePdfFile, validatePdfUrl } from "./pdfValidation";
|
|
160
|
+
export type { PdfValidationResult } from "./pdfValidation";
|
|
161
|
+
export { generateShareLink, parseShareParams } from "./shareLink";
|
|
162
|
+
export type { ShareLinkOptions, ParsedShareParams } from "./shareLink";
|
|
163
|
+
export { useLensPDF } from "./useLensPDF";
|
|
164
|
+
export type { UseLensPDFOptions, UseLensPDFReturn } from "./useLensPDF";
|
|
165
|
+
export { LensPDFProvider } from "./LensPDFProvider";
|
|
166
|
+
export type { LensPDFProviderProps } from "./LensPDFProvider";
|
|
167
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../host/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAS7E;;;;;;;GAOG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;;;;OAOG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,kBAAkB,CAAC;CAClC;AAED;;;;;;GAMG;AACH,eAA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viewer host context — the bridge between an embedding application
|
|
3
|
+
* and the core viewer components. Two contexts live here:
|
|
4
|
+
*
|
|
5
|
+
* - {@link ViewerHostContext}: cross-cutting host config (API base
|
|
6
|
+
* paths, read-only flag, debug toggle, optional pdf.js fallback).
|
|
7
|
+
* - {@link ViewerServicesContext}: the {@link ViewerServices} object
|
|
8
|
+
* carrying all the data-source protocols (page images, layers,
|
|
9
|
+
* separations, annotations, etc.). Components read services via
|
|
10
|
+
* {@link useViewerServices}; components decide between wired,
|
|
11
|
+
* fallback, and hidden render modes via {@link useFallbackMode}.
|
|
12
|
+
*
|
|
13
|
+
* Hosts mount a `<ViewerHostContext.Provider>` at the root of their
|
|
14
|
+
* app and supply concrete values; the no-op defaults exported below
|
|
15
|
+
* keep an unwired viewer renderable but quiet.
|
|
16
|
+
*
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
import { createContext, useContext } from "react";
|
|
20
|
+
import { defaultThemeTokens, isUnwired, markUnwired, noopI18n, noopTelemetry, } from "../plugin/services.js";
|
|
21
|
+
/**
|
|
22
|
+
* React context object. Default value is intentionally empty so a
|
|
23
|
+
* misconfigured viewer renders nothing surprising — components that
|
|
24
|
+
* read `apiBase` should treat the empty string as "no host wired up".
|
|
25
|
+
*
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
28
|
+
export const ViewerHostContext = createContext({
|
|
29
|
+
apiBase: "",
|
|
30
|
+
jobApiBase: "",
|
|
31
|
+
readOnly: false,
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* Hook for reading the current `ViewerHostContextValue`. Returns the
|
|
35
|
+
* default empty values when no provider is mounted.
|
|
36
|
+
*
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
39
|
+
export function useViewerHost() {
|
|
40
|
+
return useContext(ViewerHostContext);
|
|
41
|
+
}
|
|
42
|
+
// ---------------------------------------------------------------------------
|
|
43
|
+
// ViewerServices context
|
|
44
|
+
// ---------------------------------------------------------------------------
|
|
45
|
+
/**
|
|
46
|
+
* No-op default services. URL builders return empty strings; the
|
|
47
|
+
* other protocols are filled with the no-op stubs already defined
|
|
48
|
+
* in `core/plugin/services`. Hosts that supply a partial
|
|
49
|
+
* `ViewerServices` in their provider override only the fields they
|
|
50
|
+
* actually have.
|
|
51
|
+
*
|
|
52
|
+
* Choosing empty-string for URL builders (rather than throwing)
|
|
53
|
+
* keeps the boundary forgiving — a misconfigured viewer renders
|
|
54
|
+
* blank tiles, but doesn't crash.
|
|
55
|
+
*/
|
|
56
|
+
const defaultViewerServices = {
|
|
57
|
+
pageImages: markUnwired({
|
|
58
|
+
getPageImageUrl: () => "",
|
|
59
|
+
}),
|
|
60
|
+
layers: markUnwired({
|
|
61
|
+
getLayerImageUrl: () => "",
|
|
62
|
+
listLayers: async () => [],
|
|
63
|
+
}),
|
|
64
|
+
separations: markUnwired({
|
|
65
|
+
getChannelImageUrl: () => "",
|
|
66
|
+
}),
|
|
67
|
+
tacHeatmap: markUnwired({
|
|
68
|
+
getHeatmapImageUrl: () => "",
|
|
69
|
+
listRuns: async () => [],
|
|
70
|
+
}),
|
|
71
|
+
colorSample: markUnwired({
|
|
72
|
+
sampleAt: async () => null,
|
|
73
|
+
}),
|
|
74
|
+
densitometer: markUnwired({
|
|
75
|
+
sampleAt: async () => {
|
|
76
|
+
throw new Error("No separations available for this page.");
|
|
77
|
+
},
|
|
78
|
+
}),
|
|
79
|
+
annotations: markUnwired({
|
|
80
|
+
list: async () => [],
|
|
81
|
+
getForPage: async () => null,
|
|
82
|
+
saveForPage: async () => { },
|
|
83
|
+
remove: async () => { },
|
|
84
|
+
}),
|
|
85
|
+
reports: markUnwired({
|
|
86
|
+
getHtmlReportUrl: () => "",
|
|
87
|
+
getPdfDownloadUrl: () => "",
|
|
88
|
+
}),
|
|
89
|
+
telemetry: noopTelemetry,
|
|
90
|
+
i18n: noopI18n,
|
|
91
|
+
tokens: defaultThemeTokens,
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* React context carrying the active `ViewerServices` instance.
|
|
95
|
+
* `<ViewerServicesContext.Provider value={...}>` mounts a host's
|
|
96
|
+
* concrete implementation; downstream plugin packs typically expose
|
|
97
|
+
* a factory like `createMyHostViewerServices(...)` that returns one.
|
|
98
|
+
*
|
|
99
|
+
* @public
|
|
100
|
+
*/
|
|
101
|
+
export const ViewerServicesContext = createContext(defaultViewerServices);
|
|
102
|
+
/**
|
|
103
|
+
* Hook for reading the active `ViewerServices`. Returns the no-op
|
|
104
|
+
* defaults when no provider is mounted.
|
|
105
|
+
*
|
|
106
|
+
* @public
|
|
107
|
+
*/
|
|
108
|
+
export function useViewerServices() {
|
|
109
|
+
return useContext(ViewerServicesContext);
|
|
110
|
+
}
|
|
111
|
+
// ---------------------------------------------------------------------------
|
|
112
|
+
// Debug logging
|
|
113
|
+
// ---------------------------------------------------------------------------
|
|
114
|
+
const loggedHideOnce = new Set();
|
|
115
|
+
/**
|
|
116
|
+
* One-shot ``console.info`` for components that self-hide because
|
|
117
|
+
* their backing service is unwired. Silent unless ``host.debug`` is
|
|
118
|
+
* on, and deduped per-component-name so a thousand re-renders don't
|
|
119
|
+
* spam the console.
|
|
120
|
+
*
|
|
121
|
+
* @public
|
|
122
|
+
*/
|
|
123
|
+
export function logUnwiredHide(componentName, serviceName) {
|
|
124
|
+
const key = `${componentName}:${serviceName}`;
|
|
125
|
+
if (loggedHideOnce.has(key))
|
|
126
|
+
return;
|
|
127
|
+
loggedHideOnce.add(key);
|
|
128
|
+
// eslint-disable-next-line no-console
|
|
129
|
+
console.info(`[lens-pdf] ${componentName} hidden — host did not wire \`services.${serviceName}\`. ` +
|
|
130
|
+
`Provide an implementation, or set \`pdfFallback\` on the host context to use the in-browser PDF fallback.`);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Helper hook used by fallback-capable components. Returns a stable
|
|
134
|
+
* tuple describing how the component should render its data source:
|
|
135
|
+
*
|
|
136
|
+
* - ``mode: "wired"`` — host provided the dedicated service; use it.
|
|
137
|
+
* - ``mode: "fallback"`` — service unwired but ``pdfFallback`` is
|
|
138
|
+
* present; use the fallback adapter.
|
|
139
|
+
* - ``mode: "hidden"`` — neither is available; render ``null``.
|
|
140
|
+
*
|
|
141
|
+
* Components are responsible for calling {@link logUnwiredHide} from
|
|
142
|
+
* an effect when they choose to hide; this hook deliberately doesn't
|
|
143
|
+
* log on its own so callers control the message.
|
|
144
|
+
*
|
|
145
|
+
* @public
|
|
146
|
+
*/
|
|
147
|
+
export function useFallbackMode(service) {
|
|
148
|
+
const { pdfFallback } = useViewerHost();
|
|
149
|
+
if (!isUnwired(service))
|
|
150
|
+
return "wired";
|
|
151
|
+
if (pdfFallback)
|
|
152
|
+
return "fallback";
|
|
153
|
+
return "hidden";
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Pre-built services where every protocol is a no-op default tagged
|
|
157
|
+
* with the unwired marker. Hosts that only need a partial override
|
|
158
|
+
* can spread this and replace the fields they've wired:
|
|
159
|
+
*
|
|
160
|
+
* ```ts
|
|
161
|
+
* const services = { ...defaultUnwiredServices, pageImages: myPageImages };
|
|
162
|
+
* ```
|
|
163
|
+
*
|
|
164
|
+
* @public
|
|
165
|
+
*/
|
|
166
|
+
export { defaultViewerServices as defaultUnwiredServices };
|
|
167
|
+
export { createPdfJsFallback } from "./pdfFallback.js";
|
|
168
|
+
export { isUnwired, markUnwired } from "../plugin/services.js";
|
|
169
|
+
export { validatePdfFile, validatePdfUrl } from "./pdfValidation.js";
|
|
170
|
+
export { generateShareLink, parseShareParams } from "./shareLink.js";
|
|
171
|
+
export { useLensPDF } from "./useLensPDF.js";
|
|
172
|
+
export { LensPDFProvider } from "./LensPDFProvider.js";
|
|
173
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../host/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,aAAa,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