@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,273 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { AnnotationNotesPanel } from "./AnnotationNotesPanel.js";
4
+ import { AnnotationThread } from "./AnnotationThread.js";
5
+ import { AnnotationToolbar } from "./AnnotationToolbar.js";
6
+ import { LayerPanel } from "./LayerPanel.js";
7
+ import { channelSwatchStyle, headingStyle, modeButtonGroupStyle, modeButtonStyle, rowStyle, } from "./LensPDFDemo.styles.js";
8
+ import { resolveSpotSwatch } from "../browser/pantone-gold.js";
9
+ const panelHeaderRowStyle = {
10
+ display: "flex",
11
+ alignItems: "center",
12
+ justifyContent: "space-between",
13
+ gap: 8,
14
+ };
15
+ const panelHeaderActionsStyle = {
16
+ display: "flex",
17
+ gap: 6,
18
+ };
19
+ const panelAllButtonStyle = {
20
+ background: "transparent",
21
+ border: "1px solid rgba(255,255,255,0.12)",
22
+ borderRadius: 4,
23
+ color: "#cbd5e1",
24
+ fontSize: 11,
25
+ padding: "2px 6px",
26
+ cursor: "pointer",
27
+ };
28
+ const PROCESS_SWATCH = {
29
+ Cyan: "#00b7eb",
30
+ Magenta: "#ec008c",
31
+ Yellow: "#fdd835",
32
+ Black: "#111827",
33
+ };
34
+ function ToolRadio({ label, active, onToggle, swatch, }) {
35
+ return (_jsxs("label", { style: rowStyle, children: [_jsx("input", { type: "radio", checked: active, onChange: onToggle }), swatch ? (_jsx("span", { "aria-hidden": true, style: {
36
+ display: "inline-flex",
37
+ alignItems: "center",
38
+ justifyContent: "center",
39
+ width: 14,
40
+ height: 14,
41
+ flex: "0 0 auto",
42
+ }, children: swatch })) : null, _jsx("span", { children: label })] }));
43
+ }
44
+ const COLOR_PICKER_SWATCH = (_jsx("span", { style: {
45
+ display: "block",
46
+ width: 14,
47
+ height: 14,
48
+ borderRadius: "50%",
49
+ background: "conic-gradient(#ef4444, #f59e0b, #eab308, #22c55e, #06b6d4, #3b82f6, #8b5cf6, #ec4899, #ef4444)",
50
+ boxShadow: "inset 0 0 0 1px rgba(255,255,255,0.25)",
51
+ } }));
52
+ const DENSITOMETER_SWATCH = (_jsxs("span", { style: {
53
+ display: "grid",
54
+ gridTemplateColumns: "1fr 1fr",
55
+ gridTemplateRows: "1fr 1fr",
56
+ width: 14,
57
+ height: 14,
58
+ borderRadius: 2,
59
+ overflow: "hidden",
60
+ boxShadow: "inset 0 0 0 1px rgba(255,255,255,0.25)",
61
+ }, children: [_jsx("span", { style: { background: "#00aeef" } }), _jsx("span", { style: { background: "#ec008c" } }), _jsx("span", { style: { background: "#fff200" } }), _jsx("span", { style: { background: "#000000" } })] }));
62
+ function modeToolsPlugin() {
63
+ return {
64
+ id: "lens.mode-and-tools",
65
+ slot: "panel.left",
66
+ order: 10,
67
+ render: (ctx) => {
68
+ const { tokens, viewerMode, setViewerMode, activeTool, setActiveTool, availability, } = ctx;
69
+ const { separations, layers, colorPicker, densitometer, measure, annotate, tacHeatmap } = availability;
70
+ // Page / Separations / Layers are canvas rendering modes —
71
+ // they share row 1 as a connected pill group. Inspection
72
+ // swaps the side-panel contents (not the canvas), so it sits
73
+ // on its own row below as a full-width button. Keeps the
74
+ // canvas-mode toggles visually distinct from the panel-mode
75
+ // toggle.
76
+ const hasFindings = Boolean((ctx.items && ctx.items.length > 0) || ctx.forceInspectionPanel);
77
+ const sepIsLast = separations && !layers;
78
+ const pageIsLast = !separations && !layers;
79
+ const showFirstRow = separations || layers || hasFindings;
80
+ return (_jsxs(_Fragment, { children: [showFirstRow && (_jsxs(_Fragment, { children: [_jsx("h2", { style: headingStyle, children: "View" }), _jsxs("div", { style: modeButtonGroupStyle(), children: [_jsx("button", { type: "button", style: modeButtonStyle(tokens, viewerMode === "page", pageIsLast ? "solo" : "left"), onClick: () => setViewerMode("page"), children: "Page" }), separations && (_jsx("button", { type: "button", style: modeButtonStyle(tokens, viewerMode === "separation", sepIsLast ? "right" : "middle"), onClick: () => setViewerMode("separation"), children: "Separations" })), layers && (_jsx("button", { type: "button", style: modeButtonStyle(tokens, viewerMode === "layer", "right"), onClick: () => setViewerMode("layer"), children: "Layers" }))] }), hasFindings && (_jsx("div", { style: { ...modeButtonGroupStyle(), marginTop: 6 }, children: _jsx("button", { type: "button", style: modeButtonStyle(tokens, viewerMode === "findings", "solo"), onClick: () => setViewerMode("findings"), children: "Inspection" }) }))] })), _jsx("h2", { style: headingStyle, children: "Tools" }), _jsx(ToolRadio, { label: "Move / Pan", active: activeTool === "none", onToggle: () => {
81
+ setActiveTool("none");
82
+ // Move / Pan is non-annotation navigation; force the
83
+ // annotation sub-tool to pointer so we never leave pen
84
+ // armed when the user exits annotate mode.
85
+ ctx.setAnnotationTool("pointer");
86
+ } }), colorPicker && (_jsx(ToolRadio, { label: "Color picker", active: activeTool === "color-picker", onToggle: () => setActiveTool((prev) => (prev === "color-picker" ? "none" : "color-picker")), swatch: COLOR_PICKER_SWATCH })), densitometer && (_jsx(ToolRadio, { label: "Densitometer", active: activeTool === "densitometer", onToggle: () => setActiveTool((prev) => (prev === "densitometer" ? "none" : "densitometer")), swatch: DENSITOMETER_SWATCH })), measure && (_jsx(ToolRadio, { label: "Measure", active: activeTool === "measure", onToggle: () => setActiveTool((prev) => (prev === "measure" ? "none" : "measure")) })), annotate && (_jsx(ToolRadio, { label: "Annotate", active: activeTool === "annotate", onToggle: () => setActiveTool((prev) => (prev === "annotate" ? "none" : "annotate")) })), tacHeatmap && (_jsxs("label", { style: rowStyle, children: [_jsx("input", { type: "checkbox", checked: ctx.showHeatmap, onChange: (e) => ctx.setShowHeatmap(e.target.checked) }), _jsx("span", { children: "TAC heatmap (limit 300%)" })] }))] }));
87
+ },
88
+ };
89
+ }
90
+ function separationsPlugin() {
91
+ return {
92
+ id: "lens.separations-panel",
93
+ slot: "panel.left",
94
+ order: 20,
95
+ isAvailable: (ctx) => ctx.availability.separations && ctx.viewerMode === "separation",
96
+ render: (ctx) => {
97
+ const allInkNames = ctx.detectedInks.map((ink) => ink.name);
98
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { style: panelHeaderRowStyle, children: [_jsxs("h2", { style: headingStyle, children: ["Inks (", ctx.detectedInks.length, ")"] }), _jsxs("div", { style: panelHeaderActionsStyle, children: [_jsx("button", { type: "button", onClick: () => ctx.setEnabledChannels(new Set(allInkNames)), style: panelAllButtonStyle, title: "Show every ink", children: "All on" }), _jsx("button", { type: "button", onClick: () => ctx.setEnabledChannels(new Set()), style: panelAllButtonStyle, title: "Hide every ink", children: "All off" })] })] }), ctx.detectedInks.map((ink) => {
99
+ const enabled = ctx.enabledChannels.has(ink.name);
100
+ return (_jsxs("label", { style: rowStyle, children: [_jsx("input", { type: "checkbox", checked: enabled, onChange: () => ctx.setEnabledChannels((prev) => {
101
+ const next = new Set(prev);
102
+ if (next.has(ink.name))
103
+ next.delete(ink.name);
104
+ else
105
+ next.add(ink.name);
106
+ return next;
107
+ }) }), _jsx("span", { style: {
108
+ ...channelSwatchStyle,
109
+ backgroundColor: ink.type === "process"
110
+ ? PROCESS_SWATCH[ink.name] ?? "#1f2937"
111
+ : resolveSpotSwatch(ink.name, ink.altRgb, ctx.spotPalette),
112
+ } }), _jsx("span", { children: ink.name })] }, ink.name));
113
+ })] }));
114
+ },
115
+ };
116
+ }
117
+ function layersPlugin() {
118
+ return {
119
+ id: "lens.layers-panel",
120
+ slot: "panel.left",
121
+ order: 30,
122
+ isAvailable: (ctx) => ctx.availability.layers && ctx.viewerMode === "layer",
123
+ render: (ctx) => (_jsxs(_Fragment, { children: [_jsx("h2", { style: headingStyle, children: "Layers" }), _jsx("div", { style: {
124
+ border: `1px solid ${ctx.tokens.border}`,
125
+ borderRadius: 8,
126
+ padding: 6,
127
+ maxHeight: 200,
128
+ overflowY: "auto",
129
+ }, children: _jsx(LayerPanel, { jobId: "lens-pdf-demo", enabledLayers: ctx.enabledLayers, onToggleLayer: (ocgIndex) => {
130
+ ctx.setEnabledLayers((prev) => {
131
+ const next = new Set(prev);
132
+ if (next.has(ocgIndex))
133
+ next.delete(ocgIndex);
134
+ else
135
+ next.add(ocgIndex);
136
+ return next;
137
+ });
138
+ }, onSetAllLayers: (enabled) => {
139
+ ctx.setEnabledLayers(enabled ? new Set(ctx.allLayerIndices) : new Set());
140
+ } }) })] })),
141
+ };
142
+ }
143
+ /**
144
+ * Inspection / Findings panel. Activated by ``viewerMode ===
145
+ * "findings"`` — appears as a fourth tab in the VIEW selector
146
+ * (alongside Page / Separations / Layers) instead of as its own
147
+ * always-on side card. The mode-tools plugin renders the
148
+ * ``Inspection`` button automatically when ``items`` is non-empty
149
+ * or ``forceInspectionPanel`` is set.
150
+ *
151
+ * Rendering: when active, the findings list takes over the entire
152
+ * left panel area below the View toggle. When inactive, this plugin
153
+ * returns nothing.
154
+ */
155
+ function findingsPlugin() {
156
+ return {
157
+ id: "lens.findings-panel",
158
+ slot: "panel.left",
159
+ order: 25,
160
+ isAvailable: (ctx) => ctx.viewerMode === "findings" &&
161
+ Boolean((ctx.items && ctx.items.length > 0) || ctx.forceInspectionPanel),
162
+ render: (ctx) => {
163
+ const items = ctx.items ?? [];
164
+ if (items.length === 0) {
165
+ // forceInspectionPanel branch — render an empty state so the
166
+ // panel slot is visible but the user gets a clear "no
167
+ // findings yet" affordance rather than an unexplained blank.
168
+ return (_jsxs(_Fragment, { children: [_jsx("div", { style: panelHeaderRowStyle, children: _jsx("h2", { style: headingStyle, children: "Inspection" }) }), _jsx("div", { style: {
169
+ border: `1px dashed ${ctx.tokens.border}`,
170
+ borderRadius: 8,
171
+ padding: 12,
172
+ fontSize: 12,
173
+ opacity: 0.7,
174
+ color: ctx.tokens.fg,
175
+ }, children: "No findings yet. The host will populate this panel when a preflight pass completes." })] }));
176
+ }
177
+ const counts = {};
178
+ for (const it of items) {
179
+ const t = (it.tier ?? "info");
180
+ counts[t] = (counts[t] ?? 0) + 1;
181
+ }
182
+ const tone = (t) => {
183
+ switch (t) {
184
+ case "error":
185
+ return "rgba(220, 38, 38, 0.85)";
186
+ case "warning":
187
+ return "rgba(245, 158, 11, 0.85)";
188
+ case "advisory":
189
+ return "rgba(14, 165, 233, 0.85)";
190
+ default:
191
+ return "rgba(148, 163, 184, 0.75)";
192
+ }
193
+ };
194
+ return (_jsxs(_Fragment, { children: [_jsx("div", { style: panelHeaderRowStyle, children: _jsxs("h2", { style: headingStyle, children: ["Inspection (", items.length, ")"] }) }), _jsx("div", { style: {
195
+ display: "flex",
196
+ flexWrap: "wrap",
197
+ gap: 6,
198
+ marginBottom: 8,
199
+ }, children: ["error", "warning", "advisory", "info"].map((t) => (counts[t] ?? 0) > 0 ? (_jsxs("span", { style: {
200
+ display: "inline-flex",
201
+ alignItems: "center",
202
+ gap: 4,
203
+ padding: "2px 8px",
204
+ borderRadius: 999,
205
+ fontSize: 11,
206
+ fontWeight: 600,
207
+ background: tone(t),
208
+ color: "#fff",
209
+ }, children: [counts[t], " ", t] }, t)) : null) }), _jsx("div", { style: {
210
+ maxHeight: 320,
211
+ overflowY: "auto",
212
+ border: `1px solid ${ctx.tokens.border}`,
213
+ borderRadius: 8,
214
+ padding: 4,
215
+ }, children: items.slice(0, 100).map((it, i) => {
216
+ const t = (it.tier ?? "info");
217
+ const label = it.label ?? it.id ?? `Finding ${i + 1}`;
218
+ const isSelected = ctx.selectedItem?.id === it.id;
219
+ return (_jsxs("button", { type: "button", onClick: () => ctx.onItemSelect?.(isSelected ? null : it), style: {
220
+ display: "flex",
221
+ width: "100%",
222
+ alignItems: "flex-start",
223
+ gap: 8,
224
+ padding: "6px 8px",
225
+ border: "1px solid transparent",
226
+ borderColor: isSelected ? "rgba(255,255,255,0.18)" : "transparent",
227
+ borderRadius: 6,
228
+ background: isSelected ? "rgba(255,255,255,0.05)" : "transparent",
229
+ color: ctx.tokens.fg,
230
+ cursor: "pointer",
231
+ textAlign: "left",
232
+ fontSize: 12,
233
+ }, children: [_jsx("span", { "aria-hidden": true, style: {
234
+ marginTop: 4,
235
+ width: 8,
236
+ height: 8,
237
+ borderRadius: "50%",
238
+ background: tone(t),
239
+ flexShrink: 0,
240
+ } }), _jsxs("span", { style: { minWidth: 0, flex: 1 }, children: [_jsx("div", { style: { fontWeight: 500, lineHeight: 1.3 }, children: label }), it.description ? (_jsx("div", { style: { opacity: 0.7, fontSize: 11, marginTop: 2 }, children: it.description })) : null] })] }, it.id ?? `f-${i}`));
241
+ }) })] }));
242
+ },
243
+ };
244
+ }
245
+ function annotationsPlugin() {
246
+ return {
247
+ id: "lens.annotations-panel",
248
+ slot: "panel.left",
249
+ order: 40,
250
+ isAvailable: (ctx) => ctx.availability.annotate,
251
+ render: (ctx) => (_jsxs(_Fragment, { children: [_jsx("h2", { style: headingStyle, children: "Annotations" }), _jsx(AnnotationThread, { jobId: "lens-pdf-demo", currentUserEmail: "you@browser.local", onJumpToPage: (p) => ctx.setCurrentPage(p), refreshKey: ctx.servicesVersion, comfortable: ctx.isMobile }), _jsx("div", { style: { height: 8 } }), _jsx("h2", { style: headingStyle, children: "Notes" }), _jsx(AnnotationNotesPanel, { refreshKey: ctx.servicesVersion, storageScopeKey: ctx.pdfUrl || "lens-pdf-demo", onJumpToPage: (p) => ctx.setCurrentPage(p), indexedAnnotations: ctx.indexedAnnotations, selectedAnnotationId: ctx.selectedAnnotationId, onSelectedAnnotationIdChange: (id) => ctx.setSelectedAnnotationId(id) })] })),
252
+ };
253
+ }
254
+ function annotationToolbarPlugin() {
255
+ return {
256
+ id: "lens.annotation-toolbar",
257
+ slot: "overlay.toolbar",
258
+ order: 10,
259
+ isAvailable: (ctx) => ctx.availability.annotate && ctx.activeTool === "annotate",
260
+ render: (ctx) => (_jsx(AnnotationToolbar, { activeTool: ctx.annotationTool, onToolChange: ctx.setAnnotationTool, strokeColor: ctx.strokeColor, onStrokeColorChange: ctx.setStrokeColor, onUndo: ctx.triggerUndo, onRedo: ctx.triggerRedo, canUndo: ctx.canUndo, canRedo: ctx.canRedo, saving: ctx.savingAnnotation, compact: ctx.isMobile })),
261
+ };
262
+ }
263
+ export function createDefaultShellPlugins() {
264
+ return [
265
+ findingsPlugin(),
266
+ modeToolsPlugin(),
267
+ separationsPlugin(),
268
+ layersPlugin(),
269
+ annotationsPlugin(),
270
+ annotationToolbarPlugin(),
271
+ ];
272
+ }
273
+ //# sourceMappingURL=defaultShellPlugins.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultShellPlugins.js","sourceRoot":"","sources":["../../components/defaultShellPlugins.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,QAAQ,GACT,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,MAAM,mBAA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Consumed via `import { PageCanvas, ... } from "@printwithsynergy/lens-pdf/components"`.
6
+ *
7
+ * @public
8
+ */
9
+ export * from "./AnnotationCanvas";
10
+ export * from "./AnnotationNotesPanel";
11
+ export * from "./AnnotationThread";
12
+ export * from "./AnnotationToolbar";
13
+ export * from "./BoxOverlay";
14
+ export * from "./ColorPickerTool";
15
+ export * from "./DensitometerTool";
16
+ export * from "./DielineOverlay";
17
+ export * from "./defaultShellPlugins";
18
+ export * from "./LayerCanvas";
19
+ export * from "./LayerPanel";
20
+ export * from "./LensPDFDemo";
21
+ export * from "./LensPDFViewer";
22
+ export * from "./MeasureTool";
23
+ export * from "./MobileBottomSheet";
24
+ export * from "./MobileDrawer";
25
+ export * from "./PageCanvas";
26
+ export * from "./PageNavigator";
27
+ export * from "./SeparationCanvas";
28
+ export * from "./shellPlugins";
29
+ export * from "./presets";
30
+ export * from "./TACHeatmapOverlay";
31
+ export * from "./ZoomControls";
32
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Public component barrel — every React component shipped by the OSS
3
+ * lens-pdf viewer core.
4
+ *
5
+ * Consumed via `import { PageCanvas, ... } from "@printwithsynergy/lens-pdf/components"`.
6
+ *
7
+ * @public
8
+ */
9
+ export * from "./AnnotationCanvas.js";
10
+ export * from "./AnnotationNotesPanel.js";
11
+ export * from "./AnnotationThread.js";
12
+ export * from "./AnnotationToolbar.js";
13
+ export * from "./BoxOverlay.js";
14
+ export * from "./ColorPickerTool.js";
15
+ export * from "./DensitometerTool.js";
16
+ export * from "./DielineOverlay.js";
17
+ export * from "./defaultShellPlugins.js";
18
+ export * from "./LayerCanvas.js";
19
+ export * from "./LayerPanel.js";
20
+ export * from "./LensPDFDemo.js";
21
+ export * from "./LensPDFViewer.js";
22
+ export * from "./MeasureTool.js";
23
+ export * from "./MobileBottomSheet.js";
24
+ export * from "./MobileDrawer.js";
25
+ export * from "./PageCanvas.js";
26
+ export * from "./PageNavigator.js";
27
+ export * from "./SeparationCanvas.js";
28
+ export * from "./shellPlugins.js";
29
+ export * from "./presets.js";
30
+ export * from "./TACHeatmapOverlay.js";
31
+ export * from "./ZoomControls.js";
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../components/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { LensPDFShellPlugin } from "./shellPlugins";
2
+ export type LensPDFPresetKind = "demo" | "minimal";
3
+ /**
4
+ * First-party presets shipped with LensPDF. Both preserve full feature
5
+ * surface; hosts can still override by supplying custom shell plugins.
6
+ */
7
+ export declare function pluginsForPreset(preset: LensPDFPresetKind): LensPDFShellPlugin[];
8
+ //# sourceMappingURL=presets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../components/presets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGzD,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,SAAS,CAAC;AAEnD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,iBAAiB,GAAG,kBAAkB,EAAE,CAMhF"}
@@ -0,0 +1,14 @@
1
+ "use client";
2
+ import { createDefaultShellPlugins } from "./defaultShellPlugins.js";
3
+ /**
4
+ * First-party presets shipped with LensPDF. Both preserve full feature
5
+ * surface; hosts can still override by supplying custom shell plugins.
6
+ */
7
+ export function pluginsForPreset(preset) {
8
+ const defaults = createDefaultShellPlugins();
9
+ if (preset === "minimal") {
10
+ return defaults;
11
+ }
12
+ return defaults;
13
+ }
14
+ //# sourceMappingURL=presets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presets.js","sourceRoot":"","sources":["../../components/presets.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAGb,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAIlE;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAyB;IACxD,MAAM,QAAQ,GAAG,yBAAyB,EAAE,CAAC;IAC7C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,105 @@
1
+ import type { Dispatch, ReactNode, SetStateAction } from "react";
2
+ import type { ThemeTokens, ViewerServices } from "../plugin/services";
3
+ import type { AnnotationTool } from "./AnnotationToolbar";
4
+ import type { LensPDFDemoTool } from "./LensPDFDemo";
5
+ export type ViewerMode = "page" | "separation" | "layer" | "findings";
6
+ export type PointerTool = "none" | "color-picker" | "densitometer" | "measure" | "annotate";
7
+ export interface LensPDFFeatureAvailability {
8
+ colorPicker: boolean;
9
+ densitometer: boolean;
10
+ measure: boolean;
11
+ annotate: boolean;
12
+ tacHeatmap: boolean;
13
+ separations: boolean;
14
+ layers: boolean;
15
+ }
16
+ export interface LensPDFFeatureInputs {
17
+ tools: ReadonlyArray<LensPDFDemoTool>;
18
+ services: ViewerServices | null;
19
+ detectedInkCount: number;
20
+ layerCount: number;
21
+ isUnwired: (service: object | null | undefined) => boolean;
22
+ }
23
+ export declare function computeFeatureAvailability({ tools, services, detectedInkCount, layerCount, isUnwired, }: LensPDFFeatureInputs): LensPDFFeatureAvailability;
24
+ export interface LensPDFShellPluginContext {
25
+ tokens: ThemeTokens;
26
+ isMobile: boolean;
27
+ pdfUrl: string;
28
+ servicesVersion: number;
29
+ currentPage: number;
30
+ setCurrentPage: Dispatch<SetStateAction<number>>;
31
+ viewerMode: ViewerMode;
32
+ setViewerMode: Dispatch<SetStateAction<ViewerMode>>;
33
+ activeTool: PointerTool;
34
+ setActiveTool: Dispatch<SetStateAction<PointerTool>>;
35
+ showHeatmap: boolean;
36
+ setShowHeatmap: Dispatch<SetStateAction<boolean>>;
37
+ enabledChannels: Set<string>;
38
+ setEnabledChannels: Dispatch<SetStateAction<Set<string>>>;
39
+ detectedInks: Array<{
40
+ name: string;
41
+ type: "process" | "spot";
42
+ /** Synthetic alternate sRGB triplet for the ink. For spots it's
43
+ * parsed from the PDF's tint transform when available, otherwise
44
+ * hash-derived. The separations panel uses this as the third
45
+ * link in the swatch resolution chain after ``spotPalette`` and
46
+ * the Pantone Gold library. */
47
+ altRgb: [number, number, number];
48
+ }>;
49
+ /** Host-provided spot-color palette — keyed by spot name (case
50
+ * insensitive). Takes priority over both the Pantone Gold library
51
+ * and the PDF's ``altRgb``. Hosts that have a richer source of
52
+ * truth (codex's ``summary.spot_colors.colors[].swatch_hex``, a
53
+ * callas/PitStop preflight report, an internal swatch DB) pass
54
+ * values here so the separations panel renders accurate swatches. */
55
+ spotPalette?: Record<string, string>;
56
+ /** Preflight findings to surface inside the viewer's Inspection
57
+ * panel. Same superset hosts pass to ``<LensPDF items={...}>``;
58
+ * the built-in ``findingsPlugin`` filters/groups by tier and lets
59
+ * the user click a row to focus the matching bbox on the canvas. */
60
+ items?: ReadonlyArray<import("../plugin").OverlayItem>;
61
+ /** Currently-selected finding, if any. */
62
+ selectedItem?: import("../plugin").OverlayItem | null;
63
+ /** Fires when the user clicks a finding row in the Inspection panel. */
64
+ onItemSelect?: (item: import("../plugin").OverlayItem | null) => void;
65
+ /** When true, render the Inspection panel even with no ``items``
66
+ * (panel shows a "no findings yet" empty state). Useful for hosts
67
+ * that want a stable layout while a preflight call is in-flight,
68
+ * or for demos that always advertise the panel slot. Default false
69
+ * — hosts without preflight don't see an empty section. */
70
+ forceInspectionPanel?: boolean;
71
+ enabledLayers: Set<number>;
72
+ setEnabledLayers: Dispatch<SetStateAction<Set<number>>>;
73
+ allLayerIndices: number[];
74
+ annotationTool: AnnotationTool;
75
+ setAnnotationTool: Dispatch<SetStateAction<AnnotationTool>>;
76
+ strokeColor: string;
77
+ setStrokeColor: Dispatch<SetStateAction<string>>;
78
+ savingAnnotation: boolean;
79
+ canUndo: boolean;
80
+ canRedo: boolean;
81
+ triggerUndo: () => void;
82
+ triggerRedo: () => void;
83
+ indexedAnnotations: Array<{
84
+ number: number;
85
+ pageNum: number;
86
+ objectType: string;
87
+ centerX: number;
88
+ centerY: number;
89
+ }>;
90
+ selectedAnnotationId: string | null;
91
+ setSelectedAnnotationId: Dispatch<SetStateAction<string | null>>;
92
+ availability: LensPDFFeatureAvailability;
93
+ }
94
+ export type LensPDFShellSlot = "panel.left" | "overlay.toolbar";
95
+ export interface LensPDFShellPlugin {
96
+ id: string;
97
+ slot: LensPDFShellSlot;
98
+ order?: number;
99
+ replaces?: string;
100
+ isAvailable?: (ctx: LensPDFShellPluginContext) => boolean;
101
+ render: (ctx: LensPDFShellPluginContext) => ReactNode;
102
+ }
103
+ export declare function resolveShellPlugins(plugins: ReadonlyArray<LensPDFShellPlugin>): LensPDFShellPlugin[];
104
+ export declare function pluginsForSlot(plugins: ReadonlyArray<LensPDFShellPlugin>, slot: LensPDFShellSlot, ctx: LensPDFShellPluginContext): LensPDFShellPlugin[];
105
+ //# sourceMappingURL=shellPlugins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shellPlugins.d.ts","sourceRoot":"","sources":["../../components/shellPlugins.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,YAAY,GAAG,OAAO,GAAG,UAAU,CAAC;AACtE,MAAM,MAAM,WAAW,GACnB,MAAM,GACN,cAAc,GACd,cAAc,GAC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IAAI,CAAC;IACxB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,kBAAkB,EAAE,KAAK,CAAC;QACxB,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;IACH,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,uBAAuB,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;IACjE,YAAY,EAAE,0BAA0B,CAAC;CAC1C;AAED,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,iBAAiB,CAAC;AAEhE,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,gBAAgB,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,yBAAyB,KAAK,OAAO,CAAC;IAC1D,MAAM,EAAE,CAAC,GAAG,EAAE,yBAAyB,KAAK,SAAS,CAAC;CACvD;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,aAAa,CAAC,kBAAkB,CAAC,GACzC,kBAAkB,EAAE,CAqBtB;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,aAAa,CAAC,kBAAkB,CAAC,EAC1C,IAAI,EAAE,gBAAgB,EACtB,GAAG,EAAE,yBAAyB,GAC7B,kBAAkB,EAAE,CAMtB"}
@@ -0,0 +1,52 @@
1
+ "use client";
2
+ export function computeFeatureAvailability({ tools, services, detectedInkCount, layerCount, isUnwired, }) {
3
+ const toolSet = new Set(tools);
4
+ const hasColorSampler = !!services && !isUnwired(services.colorSample);
5
+ const hasDensitometer = !!services && !isUnwired(services.densitometer);
6
+ const hasMeasurement = true;
7
+ const hasAnnotations = !!services && !isUnwired(services.annotations);
8
+ const hasTacHeatmap = !!services && !isUnwired(services.tacHeatmap);
9
+ const hasSeparationService = !!services && !isUnwired(services.separations);
10
+ const hasLayerService = !!services && !isUnwired(services.layers);
11
+ const hasSeparationData = detectedInkCount > 0;
12
+ const hasLayerData = layerCount > 0;
13
+ return {
14
+ colorPicker: toolSet.has("color-picker") && hasColorSampler,
15
+ densitometer: toolSet.has("densitometer") && hasDensitometer,
16
+ measure: toolSet.has("measure") && hasMeasurement,
17
+ annotate: toolSet.has("annotate") && hasAnnotations,
18
+ tacHeatmap: toolSet.has("tac-heatmap") && hasTacHeatmap,
19
+ separations: toolSet.has("separations") && hasSeparationService && hasSeparationData,
20
+ layers: toolSet.has("layers") && hasLayerService && hasLayerData,
21
+ };
22
+ }
23
+ export function resolveShellPlugins(plugins) {
24
+ const byId = new Map();
25
+ const overrides = new Map();
26
+ for (const plugin of plugins) {
27
+ if (byId.has(plugin.id)) {
28
+ throw new Error(`Duplicate shell plugin id: ${plugin.id}`);
29
+ }
30
+ if (plugin.replaces) {
31
+ const existing = overrides.get(plugin.replaces);
32
+ if (existing) {
33
+ throw new Error(`Shell plugin override conflict: '${plugin.id}' and '${existing}' both replace '${plugin.replaces}'.`);
34
+ }
35
+ overrides.set(plugin.replaces, plugin.id);
36
+ }
37
+ byId.set(plugin.id, plugin);
38
+ }
39
+ const filtered = Array.from(byId.values()).filter((plugin) => !overrides.has(plugin.id));
40
+ filtered.sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
41
+ return filtered;
42
+ }
43
+ export function pluginsForSlot(plugins, slot, ctx) {
44
+ return plugins.filter((plugin) => {
45
+ if (plugin.slot !== slot)
46
+ return false;
47
+ if (!plugin.isAvailable)
48
+ return true;
49
+ return plugin.isAvailable(ctx);
50
+ });
51
+ }
52
+ //# sourceMappingURL=shellPlugins.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shellPlugins.js","sourceRoot":"","sources":["../../components/shellPlugins.tsx"],"names":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,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC;IACzD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,cAAc,CAC5B,OAA0C,EAC1C,IAAsB,EACtB,GAA8B;IAE9B,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE;QAC/B,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI;YAAE,OAAO,KAAK,CAAC;QACvC,IAAI,CAAC,MAAM,CAAC,WAAW;YAAE,OAAO,IAAI,CAAC;QACrC,OAAO,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Single-source mobile breakpoint matcher used by the demo / drop-in
3
+ * viewer to decide whether to render touch-first chrome (slide-in
4
+ * tools drawer, bottom-sheet readouts) instead of the desktop
5
+ * sidebar / floating-tooltip layout.
6
+ *
7
+ * The default breakpoint matches Tailwind's `md` (768 px). Pass a
8
+ * custom value to override per-component.
9
+ *
10
+ * SSR-safe: returns `false` on the server (assumes desktop) so the
11
+ * first paint matches the static HTML, then re-evaluates on mount.
12
+ *
13
+ * @public
14
+ */
15
+ export declare function useIsMobile(maxWidthPx?: number): boolean;
16
+ //# sourceMappingURL=useIsMobile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIsMobile.d.ts","sourceRoot":"","sources":["../../components/useIsMobile.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,UAAU,SAAM,GAAG,OAAO,CAWrD"}
@@ -0,0 +1,30 @@
1
+ "use client";
2
+ import { useEffect, useState } from "react";
3
+ /**
4
+ * Single-source mobile breakpoint matcher used by the demo / drop-in
5
+ * viewer to decide whether to render touch-first chrome (slide-in
6
+ * tools drawer, bottom-sheet readouts) instead of the desktop
7
+ * sidebar / floating-tooltip layout.
8
+ *
9
+ * The default breakpoint matches Tailwind's `md` (768 px). Pass a
10
+ * custom value to override per-component.
11
+ *
12
+ * SSR-safe: returns `false` on the server (assumes desktop) so the
13
+ * first paint matches the static HTML, then re-evaluates on mount.
14
+ *
15
+ * @public
16
+ */
17
+ export function useIsMobile(maxWidthPx = 767) {
18
+ const [isMobile, setIsMobile] = useState(false);
19
+ useEffect(() => {
20
+ if (typeof window === "undefined")
21
+ return;
22
+ const mql = window.matchMedia(`(max-width: ${maxWidthPx}px)`);
23
+ const update = () => setIsMobile(mql.matches);
24
+ update();
25
+ mql.addEventListener("change", update);
26
+ return () => mql.removeEventListener("change", update);
27
+ }, [maxWidthPx]);
28
+ return isMobile;
29
+ }
30
+ //# sourceMappingURL=useIsMobile.js.map