@vue-pdf-viewer/shared 1.4.0 → 1.5.0-rc.0

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 (2) hide show
  1. package/dist/types.d.ts +39 -0
  2. package/package.json +1 -1
package/dist/types.d.ts CHANGED
@@ -308,3 +308,42 @@ export interface DeletedAnnotationData {
308
308
  export interface AnnotationPluginApi {
309
309
  exportToPdf: (annotations: Annotation[], deletedAnnotations?: DeletedAnnotationData[] | string[]) => Promise<Uint8Array | null>;
310
310
  }
311
+ /**
312
+ * Programmatic API for text selection annotation tools (highlight, underline, strikethrough).
313
+ * Exposed on the VPdfViewer instance as `textSelectionControl`.
314
+ * Undefined when the annotation plugin is not loaded.
315
+ */
316
+ export interface AnnotationTextSelectionControl {
317
+ /** Whether the highlight tool is currently active */
318
+ readonly isHighlightActive: boolean;
319
+ /** Whether the underline tool is currently active */
320
+ readonly isUnderlineActive: boolean;
321
+ /** Whether the strikethrough tool is currently active */
322
+ readonly isStrikethroughActive: boolean;
323
+ /** Current highlight color as CSS hex string, or null if not set */
324
+ readonly highlightColor: string | null;
325
+ /** Current underline color as CSS hex string, or null if not set */
326
+ readonly underlineColor: string | null;
327
+ /** Current strikethrough color as CSS hex string, or null if not set */
328
+ readonly strikethroughColor: string | null;
329
+ /** Toggle highlight tool. Activating deactivates other text selection tools. */
330
+ toggleHighlight(): void;
331
+ /** Toggle underline tool. Activating deactivates other text selection tools. */
332
+ toggleUnderline(): void;
333
+ /** Toggle strikethrough tool. Activating deactivates other text selection tools. */
334
+ toggleStrikethrough(): void;
335
+ /** Deactivate all text selection tools. */
336
+ deactivateAll(): void;
337
+ /** Set highlight color. Takes effect on the next annotation created. */
338
+ setHighlightColor(color: string): void;
339
+ /** Set underline color. Takes effect on the next annotation created. */
340
+ setUnderlineColor(color: string): void;
341
+ /** Set strikethrough color. Takes effect on the next annotation created. */
342
+ setStrikethroughColor(color: string): void;
343
+ /** Set the highlight color palette shown in the popover. Accepts LabelValuePair[] or string[] (1–12 colors). */
344
+ setHighlightColorPalette(colors: AnnotationHighlightColors): void;
345
+ /** Set the underline color palette shown in the popover. Accepts LabelValuePair[] or string[] (1–12 colors). */
346
+ setUnderlineColorPalette(colors: AnnotationUnderlineColors): void;
347
+ /** Set the strikethrough color palette shown in the popover. Accepts LabelValuePair[] or string[] (1–12 colors). */
348
+ setStrikethroughColorPalette(colors: AnnotationStrikethroughColors): void;
349
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vue-pdf-viewer/shared",
3
3
  "private": false,
4
- "version": "1.4.0",
4
+ "version": "1.5.0-rc.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",