@kne/react-pdf-sign 1.1.2 → 1.1.5

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/dist/index.css CHANGED
@@ -25,6 +25,7 @@
25
25
  width: 100%;
26
26
  height: 100%;
27
27
  z-index: 10;
28
+ overflow: hidden;
28
29
  }
29
30
 
30
31
  ._IbVpf,
@@ -1 +1 @@
1
- {"version":3,"sources":["style.module.scss"],"names":[],"mappings":"AAAA;EACE,cAAc;EACd,kBAAkB;EAClB,iBAAiB;EACjB,WAAW;AACb;AACA;;EAEE,cAAc;AAChB;;AAEA;EACE,WAAW;EACX,kBAAkB;AACpB;;AAEA;EACE,wEAAwE;AAC1E;;AAEA;EACE,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,WAAW;EACX,YAAY;EACZ,WAAW;AACb;;AAEA;;EAEE,kBAAkB;EAClB,eAAe;EACf,qBAAqB;EACrB,WAAW;EACX,YAAY;EACZ,eAAe;EACf,YAAY;AACd;;AAEA;EACE,kBAAkB;EAClB,YAAY;EACZ,SAAS;EACT,2BAA2B;EAC3B,cAAc;EACd,0CAA0C;EAC1C,yCAAyC;EACzC,kBAAkB;AACpB;;AAEA;EACE,QAAQ;AACV;;AAEA;EACE,yBAAyB;EACzB,kBAAkB;EAClB,kBAAkB;AACpB;;AAEA;EACE,WAAW;EACX,YAAY;AACd;;AAEA;EACE,gBAAgB;EAChB,WAAW;AACb;;AAEA;EACE,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,WAAW;EACX,YAAY;EACZ,oBAAoB;AACtB","file":"index.css","sourcesContent":[".pdf-view-container {\n margin: 0 auto;\n position: relative;\n max-width: 1200px;\n width: 100%;\n}\n.pdf-view-container :global(.react-pdf__Page__canvas),\n.pdf-view-container :global(.textLayer) {\n margin: 0 auto;\n}\n\n.pdf-view-container {\n width: 100%;\n position: relative;\n}\n\n.pdf-view {\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);\n}\n\n.pdf-view-children {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 10;\n}\n\n.pdf-view-page-control-left,\n.pdf-view-page-control-right {\n position: absolute;\n font-size: 30px;\n top: calc(50% - 19px);\n z-index: 10;\n padding: 8px;\n cursor: pointer;\n opacity: 0.3;\n}\n\n.pdf-view-page-control-current {\n position: absolute;\n bottom: 10px;\n left: 50%;\n transform: translateX(-50%);\n color: #666666;\n background-color: rgba(255, 255, 255, 0.5);\n text-shadow: 0 0 8px white, 0 0 8px white;\n border-radius: 4px;\n}\n\n.pdf-view-page-control-right {\n right: 0;\n}\n\n.signature-container {\n border: 1px solid #cccccc;\n border-radius: 4px;\n position: relative;\n}\n\n.signature-canvas {\n width: 100%;\n height: 100%;\n}\n\n.signature-modal :global .ant-modal-confirm-paragraph {\n max-width: unset;\n width: 100%;\n}\n\n.signature-mask {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}"]}
1
+ {"version":3,"sources":["style.module.scss"],"names":[],"mappings":"AAAA;EACE,cAAc;EACd,kBAAkB;EAClB,iBAAiB;EACjB,WAAW;AACb;AACA;;EAEE,cAAc;AAChB;;AAEA;EACE,WAAW;EACX,kBAAkB;AACpB;;AAEA;EACE,wEAAwE;AAC1E;;AAEA;EACE,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,WAAW;EACX,YAAY;EACZ,WAAW;EACX,gBAAgB;AAClB;;AAEA;;EAEE,kBAAkB;EAClB,eAAe;EACf,qBAAqB;EACrB,WAAW;EACX,YAAY;EACZ,eAAe;EACf,YAAY;AACd;;AAEA;EACE,kBAAkB;EAClB,YAAY;EACZ,SAAS;EACT,2BAA2B;EAC3B,cAAc;EACd,0CAA0C;EAC1C,yCAAyC;EACzC,kBAAkB;AACpB;;AAEA;EACE,QAAQ;AACV;;AAEA;EACE,yBAAyB;EACzB,kBAAkB;EAClB,kBAAkB;AACpB;;AAEA;EACE,WAAW;EACX,YAAY;AACd;;AAEA;EACE,gBAAgB;EAChB,WAAW;AACb;;AAEA;EACE,kBAAkB;EAClB,MAAM;EACN,OAAO;EACP,WAAW;EACX,YAAY;EACZ,oBAAoB;AACtB","file":"index.css","sourcesContent":[".pdf-view-container {\n margin: 0 auto;\n position: relative;\n max-width: 1200px;\n width: 100%;\n}\n.pdf-view-container :global(.react-pdf__Page__canvas),\n.pdf-view-container :global(.textLayer) {\n margin: 0 auto;\n}\n\n.pdf-view-container {\n width: 100%;\n position: relative;\n}\n\n.pdf-view {\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);\n}\n\n.pdf-view-children {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 10;\n overflow: hidden;\n}\n\n.pdf-view-page-control-left,\n.pdf-view-page-control-right {\n position: absolute;\n font-size: 30px;\n top: calc(50% - 19px);\n z-index: 10;\n padding: 8px;\n cursor: pointer;\n opacity: 0.3;\n}\n\n.pdf-view-page-control-current {\n position: absolute;\n bottom: 10px;\n left: 50%;\n transform: translateX(-50%);\n color: #666666;\n background-color: rgba(255, 255, 255, 0.5);\n text-shadow: 0 0 8px white, 0 0 8px white;\n border-radius: 4px;\n}\n\n.pdf-view-page-control-right {\n right: 0;\n}\n\n.signature-container {\n border: 1px solid #cccccc;\n border-radius: 4px;\n position: relative;\n}\n\n.signature-canvas {\n width: 100%;\n height: 100%;\n}\n\n.signature-modal :global .ant-modal-confirm-paragraph {\n max-width: unset;\n width: 100%;\n}\n\n.signature-mask {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}"]}
package/dist/index.js CHANGED
@@ -682,13 +682,15 @@ const computedPDFSignLocation = ({
682
682
  }) => {
683
683
  const scaleX = size.width / size.originalWidth;
684
684
  const scaleY = size.height / size.originalHeight;
685
- const pdfX = Math.round(location.size.x / scaleX);
686
- const pdfY = Math.round(size.originalHeight - location.size.y / scaleY);
687
- const signWidth = Math.round(location.size.width / scaleX);
688
- const signHeight = Math.round(location.size.height / scaleY);
685
+ const pdfX = Math.round(location.size.x);
686
+ const pdfY = Math.round(size.originalHeight - location.size.y);
687
+ const signWidth = Math.round(location.size.width);
688
+ const signHeight = Math.round(location.size.height);
689
689
  return {
690
690
  scaleX,
691
691
  scaleY,
692
+ pageWidth: size.originalWidth,
693
+ pageHeight: size.originalHeight,
692
694
  pdfX,
693
695
  pdfY,
694
696
  width: signWidth,
@@ -4134,9 +4136,10 @@ const PDFSignMultiInner = /*#__PURE__*/react.forwardRef((_ref, ref) => {
4134
4136
  });
4135
4137
  }
4136
4138
  }));
4139
+ const scale = size.width / size.originalWidth;
4137
4140
  return /*#__PURE__*/jsxRuntime.jsx("div", {
4138
4141
  style: {
4139
- transform: "scale(" + size.width / size.originalWidth + ")",
4142
+ transform: "scale(" + scale + ")",
4140
4143
  transformOrigin: '0 0'
4141
4144
  },
4142
4145
  children: /*#__PURE__*/jsxRuntime.jsx(LocationGroup, {
@@ -4313,6 +4316,7 @@ const Signature = withLocale(_ref => {
4313
4316
  message.error(formatMessage({
4314
4317
  id: 'signatureEmptyError'
4315
4318
  }));
4319
+ setLoading(false);
4316
4320
  return;
4317
4321
  }
4318
4322
  let result = signatureCanvasRef.current.toDataURL('image/png');
@@ -4408,6 +4412,7 @@ exports.PDFSign = PDFSign;
4408
4412
  exports.PDFSignMulti = PDFSignMulti;
4409
4413
  exports.PDFViewer = PDFViewer;
4410
4414
  exports["default"] = PDFSign;
4415
+ exports.signMultiPdfFile = signMultiPdfFile;
4411
4416
  exports.signPdfFile = signPdfFile;
4412
4417
  exports.useSignature = useSignature;
4413
4418
  //# sourceMappingURL=index.js.map