pdfjs-viewer-highlight-echo 5.4.460 → 5.4.463

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pdfjs-viewer-highlight-echo",
3
- "version": "5.4.460",
3
+ "version": "5.4.463",
4
4
  "main": "build/pdf.mjs",
5
5
  "types": "types/src/pdf.d.ts",
6
6
  "description": "Dafu custom PDF.js distribution",
@@ -47,6 +47,8 @@ export class HighlightEditor extends AnnotationEditor {
47
47
  color: any;
48
48
  };
49
49
  /** @inheritdoc */
50
+ get contentText(): string;
51
+ /** @inheritdoc */
50
52
  translateInPage(x: any, y: any): void;
51
53
  /** @inheritdoc */
52
54
  get commentButtonPosition(): null;
@@ -0,0 +1,7 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <!-- Bell icon for notifications -->
3
+ <path d="M8 1.5a2.5 2.5 0 0 0-2.5 2.5v.5c0 .55-.22 1.07-.61 1.46L3.1 7.21A1 1 0 0 0 3.6 8.7h8.8a1 1 0 0 0 .5-1.49l-1.79-1.24A2.25 2.25 0 0 1 10.5 4.5v-.5A2.5 2.5 0 0 0 8 1.5z" fill="black"/>
4
+ <path d="M6.5 11.25a1.75 1.75 0 0 0 3 0" fill="black"/>
5
+ <!-- Notification dot -->
6
+ <circle cx="12.5" cy="3.5" r="1.75" fill="black" />
7
+ </svg>
@@ -3984,7 +3984,7 @@
3984
3984
  --editor-toolbar-bg-color:var(--csstools-light-dark-toggle--76, #f0f0f4);
3985
3985
  --editor-toolbar-highlight-image:url(images/toolbarButton-editorHighlight.svg);
3986
3986
  --editor-toolbar-copy-image:url(images/toolbarButton-copy.svg);
3987
- --editor-toolbar-save-selection-image:url(images/toolbarButton-download.svg);
3987
+ --editor-toolbar-save-selection-image:url(images/toolbarButton-notification.svg);
3988
3988
  --csstools-light-dark-toggle--77:var(--csstools-color-scheme--light) #fbfbfe;
3989
3989
  --editor-toolbar-fg-color:var(--csstools-light-dark-toggle--77, #2e2e56);
3990
3990
  --editor-toolbar-border-color:#8f8f9d;
@@ -21,8 +21,8 @@
21
21
  */
22
22
 
23
23
  /**
24
- * pdfjsVersion = 5.4.460
25
- * pdfjsBuild = 8489d7097
24
+ * pdfjsVersion = 5.4.463
25
+ * pdfjsBuild = 8555ddd2b
26
26
  */
27
27
  /******/ // The require scope
28
28
  /******/ var __webpack_require__ = {};
@@ -7655,7 +7655,7 @@ class PDFViewer {
7655
7655
  #textLayerMode = TextLayerMode.ENABLE;
7656
7656
  #viewerAlert = null;
7657
7657
  constructor(options) {
7658
- const viewerVersion = "5.4.460";
7658
+ const viewerVersion = "5.4.463";
7659
7659
  if (version !== viewerVersion) {
7660
7660
  throw new Error(`The API version "${version}" does not match the Viewer version "${viewerVersion}".`);
7661
7661
  }
package/web/viewer.css CHANGED
@@ -3984,7 +3984,7 @@
3984
3984
  --editor-toolbar-bg-color:var(--csstools-light-dark-toggle--107, #f0f0f4);
3985
3985
  --editor-toolbar-highlight-image:url(images/toolbarButton-editorHighlight.svg);
3986
3986
  --editor-toolbar-copy-image:url(images/toolbarButton-copy.svg);
3987
- --editor-toolbar-save-selection-image:url(images/toolbarButton-download.svg);
3987
+ --editor-toolbar-save-selection-image:url(images/toolbarButton-notification.svg);
3988
3988
  --csstools-light-dark-toggle--108:var(--csstools-color-scheme--light) #fbfbfe;
3989
3989
  --editor-toolbar-fg-color:var(--csstools-light-dark-toggle--108, #2e2e56);
3990
3990
  --editor-toolbar-border-color:#8f8f9d;
@@ -5757,6 +5757,7 @@
5757
5757
  --toolbarButton-print-icon:url(images/toolbarButton-print.svg);
5758
5758
  --toolbarButton-openFile-icon:url(images/toolbarButton-openFile.svg);
5759
5759
  --toolbarButton-download-icon:url(images/toolbarButton-download.svg);
5760
+ --toolbarButton-event-notification-icon:url(images/toolbarButton-notification.svg);
5760
5761
  --toolbarButton-bookmark-icon:url(images/toolbarButton-bookmark.svg);
5761
5762
  --toolbarButton-viewThumbnail-icon:url(images/toolbarButton-viewThumbnail.svg);
5762
5763
  --toolbarButton-viewOutline-icon:url(images/toolbarButton-viewOutline.svg);
package/web/viewer.mjs CHANGED
@@ -21,8 +21,8 @@
21
21
  */
22
22
 
23
23
  /**
24
- * pdfjsVersion = 5.4.460
25
- * pdfjsBuild = 8489d7097
24
+ * pdfjsVersion = 5.4.463
25
+ * pdfjsBuild = 8555ddd2b
26
26
  */
27
27
  /******/ // The require scope
28
28
  /******/ var __webpack_require__ = {};
@@ -7621,11 +7621,11 @@ class FilterHighlightOverlay {
7621
7621
  textId: id,
7622
7622
  highlightDivId: divId
7623
7623
  });
7624
+ console.log(`DEBUG - Found HighlightEditor with div ID and pushed it:`, {
7625
+ textId: id,
7626
+ highlightDivId: divId
7627
+ });
7624
7628
  }
7625
- console.log(`DEBUG - Found HighlightEditor with div ID:`, {
7626
- textId: id,
7627
- highlightDivId: divId
7628
- });
7629
7629
  }
7630
7630
  }
7631
7631
  }
@@ -13522,7 +13522,7 @@ class PDFViewer {
13522
13522
  #textLayerMode = TextLayerMode.ENABLE;
13523
13523
  #viewerAlert = null;
13524
13524
  constructor(options) {
13525
- const viewerVersion = "5.4.460";
13525
+ const viewerVersion = "5.4.463";
13526
13526
  if (version !== viewerVersion) {
13527
13527
  throw new Error(`The API version "${version}" does not match the Viewer version "${viewerVersion}".`);
13528
13528
  }
@@ -17537,17 +17537,17 @@ const PDFViewerApplication = {
17537
17537
  } = params;
17538
17538
  const pageView = this.pdfViewer.getPageView(editorInfo.pageIndex);
17539
17539
  if (!pageView) {
17540
- console.warn("Could not find page view for editor");
17540
+ console.warn("Could not find page view for editor highlight");
17541
17541
  return;
17542
17542
  }
17543
17543
  const pageElement = this.pdfViewer.viewer.querySelector(`.page[data-page-number="${editorInfo.pageNumber}"]`);
17544
17544
  if (!pageElement) {
17545
- console.warn("Could not find page element for editor");
17545
+ console.warn("Could not find page element for editor highlight");
17546
17546
  return;
17547
17547
  }
17548
17548
  const textLayer = pageElement.querySelector(".textLayer");
17549
17549
  if (!textLayer) {
17550
- console.warn("Could not find text layer for editor");
17550
+ console.warn("Could not find text layer for editor highlight");
17551
17551
  return;
17552
17552
  }
17553
17553
  const textLayerRect = textLayer.getBoundingClientRect();
@@ -17565,21 +17565,21 @@ const PDFViewerApplication = {
17565
17565
  timestamp: Date.now(),
17566
17566
  documentUrl: this.url || window.location.href
17567
17567
  };
17568
- console.log("Selection data sent to parent window within Editor:", data);
17568
+ console.log("Selection data sent to parent window within Editor highlight:", data);
17569
17569
  if (this.isViewerEmbedded && window.parent !== window) {
17570
17570
  try {
17571
17571
  window.parent.postMessage({
17572
- type: "pdfjs-selection",
17572
+ type: "pdfjs-selection-highlight-event",
17573
17573
  source: "pdf.js",
17574
17574
  data
17575
17575
  }, "*");
17576
- console.log("Selection data sent to parent window:", data);
17576
+ console.log("Selection data sent to parent window within Editor highlight:", data);
17577
17577
  } catch (postError) {
17578
- console.error("Error posting message to parent:", postError);
17578
+ console.error("Error posting message to parent within Editor highlight:", postError);
17579
17579
  }
17580
17580
  }
17581
17581
  try {
17582
- const customEvent = new CustomEvent("pdfselectioncaptured", {
17582
+ const customEvent = new CustomEvent("pdfjs-selection-highlight-event", {
17583
17583
  bubbles: true,
17584
17584
  cancelable: false,
17585
17585
  detail: data
@@ -17594,9 +17594,9 @@ const PDFViewerApplication = {
17594
17594
  document.dispatchEvent(customEvent);
17595
17595
  }
17596
17596
  } catch (eventError) {
17597
- console.error("Error dispatching custom event:", eventError);
17597
+ console.error("Error dispatching custom event within Editor highlight:", eventError);
17598
17598
  }
17599
- console.log("Selection saved and transferred (from editor):", data);
17599
+ console.log("Selection saved and transferred (from editor highlight):", data);
17600
17600
  return;
17601
17601
  }
17602
17602
  try {