@voplus/morpho-document 1.4.202 → 1.4.203

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.
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const Download: () => JSX.Element;
3
+ export default Download;
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ import { FontAwesomeIcon as Icon } from "@fortawesome/react-fontawesome";
3
+ import { faFileDownload } from "@fortawesome/pro-regular-svg-icons";
4
+ import { observe } from "@voplus/morpho-ui";
5
+ import { saveAs } from "file-saver";
6
+ import { usePDFViewerContext } from "../../state";
7
+ const Download = () => {
8
+ const context = usePDFViewerContext();
9
+ return observe(() => (React.createElement("span", { className: "toolbar-button margin-left-10", onClick: onDownload },
10
+ React.createElement(Icon, { icon: faFileDownload }))));
11
+ function onDownload() {
12
+ saveAs(context.url);
13
+ }
14
+ };
15
+ export default Download;
16
+ //# sourceMappingURL=Download.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Download.js","sourceRoot":"","sources":["../../../../../src/controls/PDFViewer/Toolbar/buttons/Download.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,IAAI,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,QAAQ,GAAG,GAAG,EAAE;IACrB,MAAM,OAAO,GAAG,mBAAmB,EAAG,CAAC;IAEvC,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,8BAAM,SAAS,EAAC,+BAA+B,EAAC,OAAO,EAAE,UAAU;QAClE,oBAAC,IAAI,IAAC,IAAI,EAAE,cAAc,GAAI,CACxB,CACP,CAAC,CAAC;IAEH,SAAS,UAAU;QAClB,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1,3 +1,4 @@
1
1
  export { default as Zoom } from "./Zoom";
2
2
  export { default as ZoomIn } from "./ZoomIn";
3
3
  export { default as ZoomOut } from "./ZoomOut";
4
+ export { default as Download } from "./Download";
@@ -1,4 +1,5 @@
1
1
  export { default as Zoom } from "./Zoom";
2
2
  export { default as ZoomIn } from "./ZoomIn";
3
3
  export { default as ZoomOut } from "./ZoomOut";
4
+ export { default as Download } from "./Download";
4
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/controls/PDFViewer/Toolbar/buttons/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/controls/PDFViewer/Toolbar/buttons/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC"}
@@ -1,5 +1,5 @@
1
- import "./index.less";
2
1
  import { ReactNode } from "react";
2
+ import "./index.less";
3
3
  export declare type ToolbarProps = {
4
4
  children?: ReactNode | ReactNode[];
5
5
  /** The tool bar sticky to top or not */
@@ -1,9 +1,9 @@
1
- import "./index.less";
2
1
  import React, { useRef } from "react";
3
- import { Zoom, ZoomIn, ZoomOut } from "./buttons";
4
- import classnames from "classnames";
2
+ import { Zoom, ZoomIn, ZoomOut, Download } from "./buttons";
5
3
  import { useIsStickyActive } from "@voplus/morpho-ui";
6
4
  import { usePDFViewerContext } from "../state";
5
+ import classnames from "classnames";
6
+ import "./index.less";
7
7
  const Toolbar = (props) => {
8
8
  const context = usePDFViewerContext();
9
9
  const element = useRef(null);
@@ -11,7 +11,8 @@ const Toolbar = (props) => {
11
11
  return (React.createElement("div", { className: classnames("pdf-viewer-toolbar", { sticky: props.sticky }, props.className), ref: element, style: { textAlign: "center" } }, props.children ? (props.children) : (React.createElement(React.Fragment, null,
12
12
  React.createElement(ZoomOut, null),
13
13
  React.createElement(Zoom, null),
14
- React.createElement(ZoomIn, null)))));
14
+ React.createElement(ZoomIn, null),
15
+ React.createElement(Download, null)))));
15
16
  };
16
17
  Toolbar.defaultProps = {
17
18
  sticky: true,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/controls/PDFViewer/Toolbar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,EAAa,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAS/C,MAAM,OAAO,GAAG,CAAC,KAAmB,EAAE,EAAE;IACvC,MAAM,OAAO,GAAG,mBAAmB,EAAE,CAAC;IACtC,MAAM,OAAO,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAE7C,iBAAiB,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,MAAM,EAAE,OA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UAAU,CAAC,oBAAoB,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,EAAE,KAAK,CAAC,SAAS,CAAC,EACtF,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,IAE7B,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CACjB,KAAK,CAAC,QAAQ,CACd,CAAC,CAAC,CAAC,CACH,oBAAC,KAAK,CAAC,QAAQ;QACd,oBAAC,OAAO,OAAG;QACX,oBAAC,IAAI,OAAG;QACR,oBAAC,MAAM,OAAG;QACV,oBAAC,QAAQ,OAAG,CACI,CACjB,CACI,CACN,CAAC;AACH,CAAC,CAAC;AAEF,OAAO,CAAC,YAAY,GAAG;IACtB,MAAM,EAAE,IAAI;CACZ,CAAC;AACF,eAAe,OAAO,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voplus/morpho-document",
3
- "version": "1.4.202",
3
+ "version": "1.4.203",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://voplus.visualstudio.com/morpho-document/_git/morpho-document"