@signiphi/pdf-signer 0.2.0-beta.27 → 0.2.0-beta.28

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.
@@ -87,6 +87,19 @@
87
87
  display: none !important;
88
88
  }
89
89
 
90
+ /* Stamp (image) editors must remain interactive even when the annotation
91
+ editor layer is in NONE mode (`.disabled`). pdf_viewer.css drops
92
+ pointer-events on the disabled layer, which would otherwise lock newly
93
+ uploaded images: clicking the stamp triggers our mousedown handler that
94
+ switches PDF.js to NONE, and after that the resize handles + drag are
95
+ stripped of pointer events. Force pointer-events back on for stamps
96
+ (and their resize handle children) so an image stays movable/resizable
97
+ throughout the whole session, regardless of the active editor mode. */
98
+ .annotationEditorLayer.disabled .stampEditor,
99
+ .annotationEditorLayer.disabled .stampEditor * {
100
+ pointer-events: auto !important;
101
+ }
102
+
90
103
  /* Review mode (sender viewing receiver's annotations):
91
104
  - Block pointer events on the annotation editor layer itself so clicks
92
105
  on empty areas DO NOT create new editors regardless of PDF.js mode.
@@ -545,37 +558,46 @@
545
558
  // intercept the mousedown event, hiding the editor from e.target.
546
559
  var editorEl = findEditorAncestor(e.target)
547
560
  || findEditorAtPoint(e.clientX, e.clientY);
548
- if (!editorEl) return;
549
561
  var app = window.PDFViewerApplication;
550
562
  var mode = app?.annotationEditor?.getMode?.();
551
- var uiManager = pdfViewer._layerProperties?.annotationEditorUIManager;
552
- var editor = uiManager?.getEditor?.(editorEl.id);
553
563
 
554
- if (mode !== undefined && mode !== 0 /* NONE */) {
555
- // Switch off the tool synchronously so PDF.js doesn't start a
556
- // new editor on the upcoming click.
557
- try {
558
- pdfViewer.annotationEditorMode = { mode: 0 };
559
- } catch {}
560
- // Notify parent so React state (activeToolType) deselects too.
561
- window.parent.postMessage({
562
- type: 'signiphi:annotation:toolDeselected',
563
- payload: {}
564
- }, parentOrigin);
565
- }
564
+ if (editorEl) {
565
+ // Clicked on an existing annotation editor deselect tool, select editor
566
+ var uiManager = pdfViewer._layerProperties?.annotationEditorUIManager;
567
+ var editor = uiManager?.getEditor?.(editorEl.id);
566
568
 
567
- // Always promote the clicked editor to selected. This handles both
568
- // the tool-active case AND the NONE case where PDF.js sometimes
569
- // fails to transfer selection between editors of different kinds.
570
- if (uiManager && editor) {
571
- try {
572
- if (typeof uiManager.setSelected === 'function') {
573
- uiManager.setSelected(editor);
574
- } else if (typeof editor.select === 'function') {
575
- editor.select();
576
- }
577
- } catch {}
569
+ if (mode !== undefined && mode !== 0 /* NONE */) {
570
+ // Switch off the tool synchronously so PDF.js doesn't start a
571
+ // new editor on the upcoming click.
572
+ try {
573
+ pdfViewer.annotationEditorMode = { mode: 0 };
574
+ } catch {}
575
+ // Notify parent so React state (activeToolType) deselects too.
576
+ window.parent.postMessage({
577
+ type: 'signiphi:annotation:toolDeselected',
578
+ payload: {}
579
+ }, parentOrigin);
580
+ }
581
+
582
+ // Always promote the clicked editor to selected. This handles both
583
+ // the tool-active case AND the NONE case where PDF.js sometimes
584
+ // fails to transfer selection between editors of different kinds.
585
+ if (uiManager && editor) {
586
+ try {
587
+ if (typeof uiManager.setSelected === 'function') {
588
+ uiManager.setSelected(editor);
589
+ } else if (typeof editor.select === 'function') {
590
+ editor.select();
591
+ }
592
+ } catch {}
593
+ }
578
594
  }
595
+ // Note: do NOT deselect the tool on empty-space clicks.
596
+ // When a tool is active and the user clicks on empty space,
597
+ // PDF.js should handle creating the new editor (drawing stroke,
598
+ // text box, etc.). Deselection only happens when clicking an
599
+ // existing editor (handled above) or when the user explicitly
600
+ // toggles the tool off from the toolbar.
579
601
  } catch (err) {
580
602
  console.warn('mousedown handler error:', err);
581
603
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SubmissionForm.d.ts","sourceRoot":"","sources":["../../src/components/SubmissionForm.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,oBAAoB,EAAwC,MAAM,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAA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