@voplus/morpho-document 1.0.0-dev279 → 1.0.0-dev281

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 (79) hide show
  1. package/changelog.md +2 -0
  2. package/es/Modules.js +4 -0
  3. package/es/Modules.js.map +1 -1
  4. package/es/components/ExtraDataCardList/index.js +1 -1
  5. package/es/components/ExtraDataCardList/index.js.map +1 -1
  6. package/es/components/FileViewer/FileViewer.d.ts +1 -0
  7. package/es/components/FileViewer/FileViewer.js +3 -3
  8. package/es/components/FileViewer/FileViewer.js.map +1 -1
  9. package/es/components/FileViewer/PDF/index.d.ts +10 -0
  10. package/es/components/FileViewer/{PDFViewer.js → PDF/index.js} +12 -11
  11. package/es/components/FileViewer/PDF/index.js.map +1 -0
  12. package/es/controls/PDFViewer/Toolbar/ToolbarState.d.ts +23 -0
  13. package/es/controls/PDFViewer/Toolbar/ToolbarState.js +33 -0
  14. package/es/controls/PDFViewer/Toolbar/ToolbarState.js.map +1 -0
  15. package/es/controls/PDFViewer/Toolbar/buttons/Zoom/index.d.ts +4 -0
  16. package/es/controls/PDFViewer/Toolbar/buttons/Zoom/index.js +32 -0
  17. package/es/controls/PDFViewer/Toolbar/buttons/Zoom/index.js.map +1 -0
  18. package/es/controls/PDFViewer/Toolbar/buttons/Zoom/index.less +14 -0
  19. package/es/controls/PDFViewer/Toolbar/buttons/ZoomIn.d.ts +3 -0
  20. package/es/controls/PDFViewer/Toolbar/buttons/ZoomIn.js +14 -0
  21. package/es/controls/PDFViewer/Toolbar/buttons/ZoomIn.js.map +1 -0
  22. package/es/controls/PDFViewer/Toolbar/buttons/ZoomOut.d.ts +3 -0
  23. package/es/controls/PDFViewer/Toolbar/buttons/ZoomOut.js +14 -0
  24. package/es/controls/PDFViewer/Toolbar/buttons/ZoomOut.js.map +1 -0
  25. package/es/controls/PDFViewer/Toolbar/buttons/index.d.ts +3 -0
  26. package/es/controls/PDFViewer/Toolbar/buttons/index.js +4 -0
  27. package/es/controls/PDFViewer/Toolbar/buttons/index.js.map +1 -0
  28. package/es/controls/PDFViewer/Toolbar/index.d.ts +14 -0
  29. package/es/controls/PDFViewer/Toolbar/index.js +20 -0
  30. package/es/controls/PDFViewer/Toolbar/index.js.map +1 -0
  31. package/es/controls/PDFViewer/Toolbar/index.less +35 -0
  32. package/es/controls/PDFViewer/index.d.ts +5 -0
  33. package/es/controls/PDFViewer/index.js +42 -0
  34. package/es/controls/PDFViewer/index.js.map +1 -0
  35. package/es/controls/PDFViewer/index.less +8 -0
  36. package/es/controls/PDFViewer/props.d.ts +7 -0
  37. package/es/controls/PDFViewer/props.js +1 -0
  38. package/es/controls/PDFViewer/props.js.map +1 -0
  39. package/es/controls/PDFViewer/state.d.ts +17 -0
  40. package/es/controls/PDFViewer/state.js +56 -0
  41. package/es/controls/PDFViewer/state.js.map +1 -0
  42. package/es/modules/unit/UnitUIService.d.ts +5 -0
  43. package/es/modules/unit/UnitUIService.js +9 -0
  44. package/es/modules/unit/UnitUIService.js.map +1 -0
  45. package/es/modules/unit/components/UnitTabs/index.js +11 -8
  46. package/es/modules/unit/components/UnitTabs/index.js.map +1 -1
  47. package/es/modules/unit/components/UnitsSelectDialog/index.d.ts +2 -2
  48. package/es/modules/unit/components/UnitsSelectDialog/index.js +1 -1
  49. package/es/modules/unit/components/UnitsSelectDialog/index.js.map +1 -1
  50. package/es/modules/unit/components/UnitsSelectDialog/state.d.ts +2 -14
  51. package/es/modules/unit/components/UnitsSelectDialog/state.js.map +1 -1
  52. package/es/modules/unit/data/interfaces/IUnit.d.ts +2 -0
  53. package/es/pages/Signature/Letter/LetterContentView/index.js +2 -2
  54. package/es/pages/Signature/Letter/LetterContentView/index.js.map +1 -1
  55. package/es/pages/Signature/Letter/LetterViewer/index.js +2 -2
  56. package/es/pages/Signature/Letter/LetterViewer/index.js.map +1 -1
  57. package/es/pages/VSubmit/VSubmitDefaultView/index.js +2 -2
  58. package/es/pages/VSubmit/VSubmitSubmitterView/index.js +3 -3
  59. package/es/pages/VSubmit/VSubmitSubmitterView/index.js.map +1 -1
  60. package/es/pages/VSubmit/components/{DocumentIconCard → DocumentIcon}/index.d.ts +2 -2
  61. package/es/pages/VSubmit/components/DocumentIcon/index.js +21 -0
  62. package/es/pages/VSubmit/components/DocumentIcon/index.js.map +1 -0
  63. package/es/pages/VSubmit/components/DocumentIcon/index.less +41 -0
  64. package/es/pages/VSubmit/components/{DocumentIconView → DocumentIconList}/index.d.ts +4 -2
  65. package/es/pages/VSubmit/components/{DocumentIconView → DocumentIconList}/index.js +11 -10
  66. package/es/pages/VSubmit/components/DocumentIconList/index.js.map +1 -0
  67. package/es/pages/VSubmit/components/{DocumentIconView → DocumentIconList}/index.less +5 -2
  68. package/es/pages/VSubmit/components/{DocumentIconView → DocumentIconList}/state.js.map +1 -1
  69. package/es/pages/VSubmit/components/SubmitSections/SectionItem/index.less +1 -0
  70. package/es/pages/VSubmit/components/SubmitSections/index.less +6 -0
  71. package/package.json +10 -8
  72. package/es/components/FileViewer/PDFViewer.d.ts +0 -7
  73. package/es/components/FileViewer/PDFViewer.js.map +0 -1
  74. package/es/pages/VSubmit/components/DocumentIconCard/index.js +0 -32
  75. package/es/pages/VSubmit/components/DocumentIconCard/index.js.map +0 -1
  76. package/es/pages/VSubmit/components/DocumentIconCard/index.less +0 -37
  77. package/es/pages/VSubmit/components/DocumentIconView/index.js.map +0 -1
  78. /package/es/pages/VSubmit/components/{DocumentIconView → DocumentIconList}/state.d.ts +0 -0
  79. /package/es/pages/VSubmit/components/{DocumentIconView → DocumentIconList}/state.js +0 -0
package/changelog.md CHANGED
@@ -1,3 +1,5 @@
1
+ [Feature] user info
2
+ [Feature] vSubmit
1
3
  [Fix] ToolBar id 没 update
2
4
  [Improvement] New ActivityLog2 combined with comment
3
5
 
package/es/Modules.js CHANGED
@@ -2,6 +2,7 @@ import { ContainerMeta, FileTypeMeta, GraphMeta, LibraryMeta, PageMeta, Shortcut
2
2
  import { DocumentMetaStore } from "./data/DocumentMetaStore";
3
3
  import { DocumentUIService } from "./DocumentUIService";
4
4
  import Routes from "./routes";
5
+ import { UnitUIService } from "./modules/unit/UnitUIService";
5
6
  const Modules = {
6
7
  /** Register necessary module resources. */
7
8
  register: (context) => {
@@ -11,6 +12,9 @@ const Modules = {
11
12
  if (!context.getService(DocumentUIService.TypeName)) {
12
13
  context.registerService(new DocumentUIService());
13
14
  }
15
+ if (!context.getService(UnitUIService.TypeName)) {
16
+ context.registerService(new UnitUIService());
17
+ }
14
18
  // register metas.
15
19
  const store = context.getStore(DocumentMetaStore.StoreName);
16
20
  store.addMeta(new FileTypeMeta());
package/es/Modules.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Modules.js","sourceRoot":"","sources":["../src/Modules.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,aAAa,EACb,YAAY,EACZ,SAAS,EACT,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,MAAM,OAAO,GAAG;IACf,2CAA2C;IAC3C,QAAQ,EAAE,CAAC,OAAmB,EAAE,EAAE;QACjC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,SAAS,CAAC,EAAE;YACrD,OAAO,CAAC,eAAe,CAAC,IAAI,iBAAiB,EAAE,CAAC,CAAC;SACjD;QAED,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAE;YACpD,OAAO,CAAC,eAAe,CAAC,IAAI,iBAAiB,EAAE,CAAC,CAAC;SACjD;QAED,kBAAkB;QAClB,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC,SAAS,CAAsB,CAAC;QACjF,KAAK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BAAiB,CAAC,QAAQ,CAAC,EAAE;YACpD,OAAO,CAAC,eAAe,CAAC,IAAI,iBAAiB,EAAE,CAAC,CAAC;SACjD;QAED,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE;YAChD,OAAO,CAAC,eAAe,CAAC,IAAI,aAAa,EAAE,CAAC,CAAC;SAC7C;QAED,kBAAkB;QAClB,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC,SAAS,CAAsB,CAAC;QACjF,KAAK,CAAC,OAAO,CAAC,IAAI,YAAY,EAAE,CAAC,CAAC;QAClC,KAAK,CAAC,OAAO,CAAC,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;QACvC,KAAK,CAAC,OAAO,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;QACnC,KAAK,CAAC,OAAO,CAAC,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;QACtC,KAAK,CAAC,OAAO,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;QACnC,KAAK,CAAC,OAAO,CAAC,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;QACpC,KAAK,CAAC,OAAO,CAAC,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;QAExC,mBAAmB;QACnB,MAAM,CAAC,SAAS,EAAE,CAAC;IACpB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { useAutoUpdateListData, useDocumentListEffect } from "@voplus/morpho-document-core";
2
2
  import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
3
3
  import DocumentCard from "../DocumentCard";
4
- import ListView from "@voplus/morpho-ui/es/components/layout/ExtraDataCardList";
4
+ import ListView from "@voplus/morpho-ui/es/components/ExtraDataCardList";
5
5
  import React from "react";
6
6
  import { useObserver } from "mobx-react-lite";
7
7
  import { useRenderOnChange } from "@voplus/morpho-ui";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ExtraDataCardList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEN,qBAAqB,EACrB,qBAAqB,EACrB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEpF,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,QAAQ,MAAM,0DAA0D,CAAC;AAChF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,iBAAiB,GAAG,CAAC,KAAqB,EAAE,EAAE;IACnD,+EAA+E;IAC/E,MAAM,IAAI,GAAG,sBAAsB,CAClC;QACC,cAAc,EAAE;YACf,QAAQ,EAAE,WAAW;YACrB,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;SAChE;KACD,EACD,CAAC,KAAK,CAAC,EAAE,CAAC,CACV,CAAC;IAEF,uEAAuE;IACvE,iBAAiB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAE9C,sEAAsE;IACtE,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAEhF,mEAAmE;IACnE,qBAAqB,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,KAAK,CAAC,EAAE,CAAC,CAAC;IAE1D,OAAO,WAAW,CAAC,GAAG,EA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,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -8,6 +8,7 @@ declare const FileViewer: {
8
8
  (props: IFileViewerProps): JSX.Element;
9
9
  PDF: (props: {
10
10
  id: string;
11
+ viewerProps?: Partial<import("../../controls/PDFViewer/props").PDFViewerProps> | undefined;
11
12
  download?: (() => Promise<Blob>) | undefined;
12
13
  }) => JSX.Element;
13
14
  Image: (props: {
@@ -1,6 +1,6 @@
1
1
  import FilePreview from "./Preview";
2
2
  import ImageViewer from "./ImageViewer";
3
- import PDFViewer from "./PDFViewer";
3
+ import PDFFileViewer from "./PDF";
4
4
  import React from "react";
5
5
  import VideoViewer from "./VideoViewer";
6
6
  import WOPIViewer from "./WOPIViewer";
@@ -15,7 +15,7 @@ const FileViewer = (props) => {
15
15
  return React.createElement(VideoViewer, { id: file.id, mime: file.mimetype });
16
16
  }
17
17
  else if (file.mimetype === "application/pdf") {
18
- return React.createElement(PDFViewer, { id: file.id });
18
+ return React.createElement(PDFFileViewer, { id: file.id });
19
19
  }
20
20
  else if (/^image\/(gif|jpe?g|png)$/gim.test(file.mimetype)) {
21
21
  styles["overflowY"] = "auto";
@@ -33,7 +33,7 @@ const FileViewer = (props) => {
33
33
  };
34
34
  return useObserver(() => (React.createElement(React.Fragment, null, file.loaded && (React.createElement("div", { className: props.className, style: styles }, renderViewer())))));
35
35
  };
36
- FileViewer.PDF = PDFViewer;
36
+ FileViewer.PDF = PDFFileViewer;
37
37
  FileViewer.Image = ImageViewer;
38
38
  FileViewer.Preview = FilePreview;
39
39
  export default FileViewer;
@@ -1 +1 @@
1
- {"version":3,"file":"FileViewer.js","sourceRoot":"","sources":["../../../src/components/FileViewer/FileViewer.tsx"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,WAAW,CAAC;AACpC,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B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
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { PDFViewerProps } from "../../../controls/PDFViewer/props";
3
+ declare const PDFFileViewer: (props: {
4
+ id: string;
5
+ /** props for internal pdf viewer */
6
+ viewerProps?: Partial<PDFViewerProps>;
7
+ /** 指定 download api function */
8
+ download?: () => Promise<Blob>;
9
+ }) => JSX.Element;
10
+ export default PDFFileViewer;
@@ -1,20 +1,23 @@
1
1
  import { useLocalStore, useObserver } from "mobx-react-lite";
2
2
  import React from "react";
3
3
  import { Spin } from "@voplus/antd";
4
- import styles from "./index.less";
4
+ import Viewer from "../../../controls/PDFViewer";
5
+ import styles from "../index.less";
5
6
  import { useEffect } from "react";
6
- import { useFileStore } from "../../data/FileStore/FileStore";
7
- const PDFViewer = (props) => {
7
+ import { useFileStore } from "../../../data/FileStore/FileStore";
8
+ const PDFFileViewer = (props) => {
8
9
  const store = useFileStore();
9
10
  const state = useLocalStore(() => ({
10
- loading: false,
11
+ url: "",
11
12
  error: "",
12
- url: ""
13
+ loading: true
13
14
  }));
14
15
  useEffect(() => {
15
16
  getUrl();
16
17
  }, [props.id]);
17
- const getUrl = () => {
18
+ return useObserver(() => (React.createElement(React.Fragment, null, state.loading ? (React.createElement("div", { className: styles["viewer-spin"] },
19
+ React.createElement(Spin, null))) : state.error ? (state.error) : state.url ? (React.createElement(Viewer, { url: state.url })) : ("No Url"))));
20
+ function getUrl() {
18
21
  state.loading = true;
19
22
  (props.download ? props.download() : store.download(props.id))
20
23
  .then((blob) => {
@@ -24,9 +27,7 @@ const PDFViewer = (props) => {
24
27
  })
25
28
  .catch((err) => (state.error = err))
26
29
  .finally(() => (state.loading = false));
27
- };
28
- return useObserver(() => (React.createElement(React.Fragment, null, state.loading ? (React.createElement("div", { className: styles["viewer-spin"] },
29
- React.createElement(Spin, null))) : state.error ? (state.error) : state.url ? (React.createElement("iframe", { src: state.url, width: "100%", height: "100%", style: { border: 0 } })) : ("No Url"))));
30
+ }
30
31
  };
31
- export default PDFViewer;
32
- //# sourceMappingURL=PDFViewer.js.map
32
+ export default PDFFileViewer;
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/FileViewer/PDF/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,MAAM,MAAM,6BAA6B,CAAC;AACjD,OAAO,MAAM,MAAM,eAAe,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEjE,MAAM,aAAa,GAAG,CAAC,KAMtB,EAAE,EAAE;IACJ,MAAM,KAAK,GAAG,YAAY,EAAE,CAAC;IAC7B,MAAM,KAAK,GAAG,aAAa,CAAC,GAAG,EAAE,CAAC,CAAC;QAClC,GAAG,EAAE,EAAE;QACP,KAAK,EAAE,EAAE;QACT,OAAO,EAAE,IAAI;KACb,CAAC,CAAC,CAAC;IACJ,SAAS,CAAC,GAAG,EAAE;QACd,MAAM,EAAE,CAAC;IACV,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;IAEf,OAAO,WAAW,CAAC,GAAG,EAAE,CAAC,CACxB,oBAAC,KAAK,CAAC,QAAQ,QACb,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAChB,6BAAK,SAAS,EAAE,MAAM,CAAC,aAAa,CAAC;QACpC,oBAAC,IAAI,OAAG,CACH,CACN,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CACjB,KAAK,CAAC,KAAK,CACX,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CACf,oBAAC,MAAM,IAAC,GAAG,EAAE,KAAK,CAAC,GAAG,GAAI,CAC1B,CAAC,CAAC,CAAC,CACH,QAAQ,CACR,CACe,CACjB,CAAC,CAAC;IAEH,SAAS,MAAM;QACd,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;QACrB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;aAC5D,IAAI,CAAC,CAAC,IAAU,EAAE,EAAE;YACpB,IAAI,IAAI,EAAE;gBACT,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;aACtC;QACF,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC;aAC3C,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC;IAC1C,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { PDFViewerState } from "../state";
2
+ /** Interface to be implemented by all tool states e.g Bold . */
3
+ export interface IToolState {
4
+ enable: boolean;
5
+ }
6
+ export declare class DefaultToolState implements IToolState {
7
+ protected context: PDFViewerState;
8
+ enable: boolean;
9
+ constructor(context: PDFViewerState);
10
+ }
11
+ /** Toolbar state, also a ProseMirror plugin */
12
+ export declare class ToolbarState {
13
+ private context;
14
+ visible: boolean;
15
+ constructor(context: PDFViewerState);
16
+ /** Current tools states. */
17
+ private states;
18
+ /** Try to get an existing tool state or create a new one if it's not already exists.
19
+ * @param key - Key of the tool state.
20
+ * @param factory - factor to create a new option state.
21
+ */
22
+ getState<T extends IToolState>(key: string, factory: () => T): T;
23
+ }
@@ -0,0 +1,33 @@
1
+ import { __decorate } from "tslib";
2
+ import { observable } from "mobx";
3
+ export class DefaultToolState {
4
+ constructor(context) {
5
+ this.context = context;
6
+ this.enable = true;
7
+ }
8
+ }
9
+ __decorate([
10
+ observable
11
+ ], DefaultToolState.prototype, "enable", void 0);
12
+ /** Toolbar state, also a ProseMirror plugin */
13
+ export class ToolbarState {
14
+ constructor(context) {
15
+ this.context = context;
16
+ this.visible = true;
17
+ /** Current tools states. */
18
+ this.states = new Map();
19
+ }
20
+ /** Try to get an existing tool state or create a new one if it's not already exists.
21
+ * @param key - Key of the tool state.
22
+ * @param factory - factor to create a new option state.
23
+ */
24
+ getState(key, factory) {
25
+ if (!this.states.has(key))
26
+ this.states.set(key, factory());
27
+ return this.states.get(key);
28
+ }
29
+ }
30
+ __decorate([
31
+ observable
32
+ ], ToolbarState.prototype, "visible", void 0);
33
+ //# sourceMappingURL=ToolbarState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToolbarState.js","sourceRoot":"","sources":["../../../../src/controls/PDFViewer/Toolbar/ToolbarState.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAOlC,MAAM,OAAO,gBAAgB;IAG5B,YAAsB,OAAuB;QAAvB,YAAO,GAAP,OAAO,CAAgB;QAFjC,WAAM,GAAG,IAAI,CAAC;IAEsB,CAAC;CACjD;AAHY;IAAX,UAAU;gDAAe;AAK3B,gDAAgD;AAChD,MAAM,OAAO,YAAY;IAKxB,YAAoB,OAAuB;QAAvB,YAAO,GAAP,OAAO,CAAgB;QAFpC,YAAO,GAAG,IAAI,CAAC;QAGtB,4BAA4B;QACpB,WAAM,GAA4B,IAAI,GAAG,EAAE,CAAC;IAFN,CAAC;IAI/C;;;OAGG;IACI,QAAQ,CAAuB,GAAW,EAAE,OAAgB;QAClE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;QAC3D,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAM,CAAC;IAClC,CAAC;CACD;AAdA;IAFC,UAAU;6CAEW"}
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import "./index.less";
3
+ declare const Zoom: () => JSX.Element;
4
+ export default Zoom;
@@ -0,0 +1,32 @@
1
+ import "./index.less";
2
+ import { CaretDownOutlined, CaretUpOutlined } from "@ant-design/icons";
3
+ import { DefaultToolState } from "../../ToolbarState";
4
+ import React from "react";
5
+ import { Select } from "@voplus/antd";
6
+ import { useObserver } from "mobx-react-lite";
7
+ import { usePDFViewerContext } from "../../../state";
8
+ const Zoom = () => {
9
+ const { Option } = Select;
10
+ const context = usePDFViewerContext();
11
+ const state = context === null || context === void 0 ? void 0 : context.toolbar.getState("Zoom", () => new DefaultToolState(context));
12
+ return useObserver(() => (React.createElement("span", { className: "toolbar-button", title: "Zoom" },
13
+ React.createElement(Select, { className: "zoom-select", value: `${Math.round((context === null || context === void 0 ? void 0 : context.Scale) * 100)} %`, style: { width: 110 }, bordered: false,
14
+ // disabled={!state?.enableNode}
15
+ suffixIcon: React.createElement("span", null,
16
+ React.createElement(CaretUpOutlined, null),
17
+ React.createElement(CaretDownOutlined, { className: "icon-down" })), onChange: value => context === null || context === void 0 ? void 0 : context.Zoom(Number(value)) },
18
+ React.createElement(Option, { value: "0" }, "Fit Width"),
19
+ React.createElement(Option, { value: "0.1" }, "10%"),
20
+ React.createElement(Option, { value: "0.25" }, "25%"),
21
+ React.createElement(Option, { value: "0.5" }, "50%"),
22
+ React.createElement(Option, { value: "0.75" }, "75%"),
23
+ React.createElement(Option, { value: "1" }, "100%"),
24
+ React.createElement(Option, { value: "1.25" }, "125%"),
25
+ React.createElement(Option, { value: "1.50" }, "150%"),
26
+ React.createElement(Option, { value: "2" }, "200%"),
27
+ React.createElement(Option, { value: "4" }, "400%"),
28
+ React.createElement(Option, { value: "8" }, "800%"),
29
+ React.createElement(Option, { value: "16" }, "1600%")))));
30
+ };
31
+ export default Zoom;
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/controls/PDFViewer/Toolbar/buttons/Zoom/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,IAAI,GAAG,GAAG,EAAE;IACjB,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAC1B,MAAM,OAAO,GAAG,mBAAmB,EAAG,CAAC;IACvC,MAAM,KAAK,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;IAErF,OAAO,WAAW,CAAC,GAAG,EAAE,CAAC,CACxB,8BAAM,SAAS,EAAC,gBAAgB,EAAC,KAAK,EAAC,MAAM;QAC5C,oBAAC,MAAM,IACN,SAAS,EAAC,aAAa,EACvB,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,IAAG,GAAG,CAAC,IAAI,EAC9C,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,EACrB,QAAQ,EAAE,KAAK;YACf,gCAAgC;YAChC,UAAU,EACT;gBACC,oBAAC,eAAe,OAAG;gBACnB,oBAAC,iBAAiB,IAAC,SAAS,EAAC,WAAW,GAAG,CACrC,EAER,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAE/C,oBAAC,MAAM,IAAC,KAAK,EAAC,GAAG,gBAAmB;YACpC,oBAAC,MAAM,IAAC,KAAK,EAAC,KAAK,UAAa;YAChC,oBAAC,MAAM,IAAC,KAAK,EAAC,MAAM,UAAa;YACjC,oBAAC,MAAM,IAAC,KAAK,EAAC,KAAK,UAAa;YAChC,oBAAC,MAAM,IAAC,KAAK,EAAC,MAAM,UAAa;YACjC,oBAAC,MAAM,IAAC,KAAK,EAAC,GAAG,WAAc;YAC/B,oBAAC,MAAM,IAAC,KAAK,EAAC,MAAM,WAAc;YAClC,oBAAC,MAAM,IAAC,KAAK,EAAC,MAAM,WAAc;YAClC,oBAAC,MAAM,IAAC,KAAK,EAAC,GAAG,WAAc;YAC/B,oBAAC,MAAM,IAAC,KAAK,EAAC,GAAG,WAAc;YAC/B,oBAAC,MAAM,IAAC,KAAK,EAAC,GAAG,WAAc;YAC/B,oBAAC,MAAM,IAAC,KAAK,EAAC,IAAI,YAAe,CACzB,CACH,CACP,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,14 @@
1
+ :global {
2
+ .zoom-select {
3
+ color: #000000a6;
4
+ .ant-select-arrow {
5
+ top: 56%;
6
+ transform: translateY(-50%);
7
+ font-size: 12px;
8
+ color: #000000a6;
9
+ .icon-down {
10
+ margin-top: -4px;
11
+ }
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const Zoom: () => JSX.Element;
3
+ export default Zoom;
@@ -0,0 +1,14 @@
1
+ import { DefaultToolState } from "../ToolbarState";
2
+ import { FontAwesomeIcon as Icon } from "@fortawesome/react-fontawesome";
3
+ import React from "react";
4
+ import { faPlusCircle } from "@fortawesome/pro-regular-svg-icons";
5
+ import { useObserver } from "mobx-react-lite";
6
+ import { usePDFViewerContext } from "../../state";
7
+ const Zoom = () => {
8
+ const context = usePDFViewerContext();
9
+ const state = context === null || context === void 0 ? void 0 : context.toolbar.getState("ZoomIn", () => new DefaultToolState(context));
10
+ return useObserver(() => (React.createElement("span", { className: "toolbar-button", title: "Zoom In", onClick: () => context === null || context === void 0 ? void 0 : context.Zoom(context.Scale * 1.1) },
11
+ React.createElement(Icon, { icon: faPlusCircle }))));
12
+ };
13
+ export default Zoom;
14
+ //# sourceMappingURL=ZoomIn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZoomIn.js","sourceRoot":"","sources":["../../../../../src/controls/PDFViewer/Toolbar/buttons/ZoomIn.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,eAAe,IAAI,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,IAAI,GAAG,GAAG,EAAE;IACjB,MAAM,OAAO,GAAG,mBAAmB,EAAG,CAAC;IACvC,MAAM,KAAK,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;IAEvF,OAAO,WAAW,CAAC,GAAG,EAAE,CAAC,CACxB,8BACC,SAAS,EAAC,gBAAgB,EAC1B,KAAK,EAAC,SAAS,EACf,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,GAAG,CAAC;QAEjD,oBAAC,IAAI,IAAC,IAAI,EAAE,YAAY,GAAI,CACtB,CACP,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const Zoom: () => JSX.Element;
3
+ export default Zoom;
@@ -0,0 +1,14 @@
1
+ import { DefaultToolState } from "../ToolbarState";
2
+ import { FontAwesomeIcon as Icon } from "@fortawesome/react-fontawesome";
3
+ import React from "react";
4
+ import { faMinusCircle } from "@fortawesome/pro-regular-svg-icons";
5
+ import { useObserver } from "mobx-react-lite";
6
+ import { usePDFViewerContext } from "../../state";
7
+ const Zoom = () => {
8
+ const context = usePDFViewerContext();
9
+ const state = context === null || context === void 0 ? void 0 : context.toolbar.getState("ZoomIn", () => new DefaultToolState(context));
10
+ return useObserver(() => (React.createElement("span", { className: "toolbar-button", title: "Zoom In", onClick: () => context === null || context === void 0 ? void 0 : context.Zoom(context.Scale * 0.9) },
11
+ React.createElement(Icon, { icon: faMinusCircle }))));
12
+ };
13
+ export default Zoom;
14
+ //# sourceMappingURL=ZoomOut.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZoomOut.js","sourceRoot":"","sources":["../../../../../src/controls/PDFViewer/Toolbar/buttons/ZoomOut.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,eAAe,IAAI,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,IAAI,GAAG,GAAG,EAAE;IACjB,MAAM,OAAO,GAAG,mBAAmB,EAAG,CAAC;IACvC,MAAM,KAAK,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;IAEvF,OAAO,WAAW,CAAC,GAAG,EAAE,CAAC,CACxB,8BACC,SAAS,EAAC,gBAAgB,EAC1B,KAAK,EAAC,SAAS,EACf,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,GAAG,CAAC;QAEjD,oBAAC,IAAI,IAAC,IAAI,EAAE,aAAa,GAAI,CACvB,CACP,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default as Zoom } from "./Zoom";
2
+ export { default as ZoomIn } from "./ZoomIn";
3
+ export { default as ZoomOut } from "./ZoomOut";
@@ -0,0 +1,4 @@
1
+ export { default as Zoom } from "./Zoom";
2
+ export { default as ZoomIn } from "./ZoomIn";
3
+ export { default as ZoomOut } from "./ZoomOut";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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"}
@@ -0,0 +1,14 @@
1
+ import "./index.less";
2
+ import { ReactNode } from "react";
3
+ export declare type ToolbarProps = {
4
+ children?: ReactNode | ReactNode[];
5
+ /** The tool bar sticky to top or not */
6
+ sticky?: boolean;
7
+ };
8
+ declare const Toolbar: {
9
+ (props: ToolbarProps): JSX.Element;
10
+ defaultProps: {
11
+ sticky: boolean;
12
+ };
13
+ };
14
+ export default Toolbar;
@@ -0,0 +1,20 @@
1
+ import "./index.less";
2
+ import React, { useRef } from "react";
3
+ import { Zoom, ZoomIn, ZoomOut } from "./buttons";
4
+ import classnames from "classnames";
5
+ import { useIsStickyActive } from "@voplus/morpho-ui";
6
+ import { usePDFViewerContext } from "../state";
7
+ const Toolbar = (props) => {
8
+ const context = usePDFViewerContext();
9
+ const element = useRef(null);
10
+ useIsStickyActive({ stickyOn: props.sticky, element });
11
+ return (React.createElement("div", { className: classnames("pdf-viewer-toolbar", { sticky: props.sticky }), ref: element, style: { textAlign: "center" } }, props.children ? (props.children) : (React.createElement(React.Fragment, null,
12
+ React.createElement(ZoomOut, null),
13
+ React.createElement(Zoom, null),
14
+ React.createElement(ZoomIn, null)))));
15
+ };
16
+ Toolbar.defaultProps = {
17
+ sticky: true
18
+ };
19
+ export default Toolbar;
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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;AAO/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,OAAO,EAAE,CAAC,CAAC;IAEvD,OAAO,CACN,6BACC,SAAS,EAAE,UAAU,CAAC,oBAAoB,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,EACrE,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,CACM,CACjB,CACI,CACN,CAAC;AACH,CAAC,CAAC;AAEF,OAAO,CAAC,YAAY,GAAG;IACtB,MAAM,EAAE,IAAI;CACZ,CAAC;AACF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,35 @@
1
+ @import "~@voplus/antd/es/style/index.less";
2
+ :global {
3
+ .pdf-viewer-toolbar {
4
+ border: 1px @border-style-base @border-color-split;
5
+ //border-bottom: none;
6
+ padding: 0.65rem;
7
+ background-color: white;
8
+ z-index: 1;
9
+ color: lightgray;
10
+ &.sticky {
11
+ position: sticky;
12
+ top: -1px;
13
+ left: 0;
14
+ &.sticky-active {
15
+ box-shadow: 0 8px 6px -6px lightgray;
16
+ }
17
+ }
18
+
19
+ .toolbar-button {
20
+ cursor: pointer;
21
+ padding: 3px 5px;
22
+
23
+ svg:hover,
24
+ svg.active {
25
+ color: @primary-5;
26
+ }
27
+ svg.disable {
28
+ color: #cecece;
29
+ }
30
+ span.active {
31
+ color: @primary-5;
32
+ }
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import "./index.less";
3
+ import { PDFViewerProps } from "./props";
4
+ declare const PDFViewer: (props: PDFViewerProps) => JSX.Element;
5
+ export default PDFViewer;
@@ -0,0 +1,42 @@
1
+ import "./index.less";
2
+ import { Document, Page, pdfjs } from "react-pdf";
3
+ import { PDFViewerContext, PDFViewerState } from "./state";
4
+ import React, { useLayoutEffect, useRef, useState } from "react";
5
+ import Scrollbars from "react-custom-scrollbars";
6
+ import Toolbar from "./Toolbar";
7
+ import { useDeepMemo } from "@voplus/morpho-data";
8
+ import { useObserver } from "mobx-react-lite";
9
+ pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.4.456/pdf.worker.js`;
10
+ const PDFViewer = (props) => {
11
+ const viewerRef = useRef(null);
12
+ const state = useDeepMemo(() => new PDFViewerState(props.url), [props.url]);
13
+ const [numPages, setNumPages] = useState(0);
14
+ useLayoutEffect(() => {
15
+ const observer = new ResizeObserver(() => {
16
+ state.containerWidth = viewerRef.current.getBoundingClientRect().width;
17
+ });
18
+ observer.observe(viewerRef.current);
19
+ return () => observer.disconnect();
20
+ }, []);
21
+ return useObserver(() => {
22
+ var _a;
23
+ return (React.createElement(PDFViewerContext.Provider, { value: state },
24
+ React.createElement(Scrollbars, { autoHide: true, className: "pdf-viewer" }, (_a = props.toolbar) !== null && _a !== void 0 ? _a : React.createElement(Toolbar, null),
25
+ React.createElement(Document, { inputRef: viewerRef, file: state.url, onLoadSuccess: onDocumentLoadSuccess, options: {
26
+ cMapUrl: `//cdn.jsdelivr.net/npm/pdfjs-dist@2.4.456/cmaps/`,
27
+ cMapPacked: true
28
+ } }, Array.from(new Array(numPages), (el, index) => {
29
+ var _a;
30
+ return (React.createElement(Page, { onLoadSuccess: onPageLoadSuccess, width: (_a = state.width) !== null && _a !== void 0 ? _a : undefined, key: `page_${index + 1}`, pageNumber: index + 1 }));
31
+ })))));
32
+ });
33
+ function onDocumentLoadSuccess(pdf) {
34
+ setNumPages(pdf.numPages);
35
+ }
36
+ function onPageLoadSuccess(page) {
37
+ state.updateOriginalWidth(page.originalWidth);
38
+ return;
39
+ }
40
+ };
41
+ export default PDFViewer;
42
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/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,GAAG,EAAE;;QAAC,OAAA,CACxB,oBAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK;YACtC,oBAAC,UAAU,IAAC,QAAQ,QAAC,SAAS,EAAC,YAAY,UACzC,KAAK,CAAC,OAAO,mCAAI,oBAAC,OAAO,OAAG;gBAC7B,oBAAC,QAAQ,IACR,QAAQ,EAAE,SAAS,EACnB,IAAI,EAAE,KAAK,CAAC,GAAG,EACf,aAAa,EAAE,qBAAqB,EACpC,OAAO,EAAE;wBACR,OAAO,EAAE,kDAAkD;wBAC3D,UAAU,EAAE,IAAI;qBAChB,IAEA,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE;;oBAAC,OAAA,CAC/C,oBAAC,IAAI,IACJ,aAAa,EAAE,iBAAiB,EAChC,KAAK,QAAE,KAAK,CAAC,KAAK,mCAAI,SAAS,EAC/B,GAAG,EAAE,QAAQ,KAAK,GAAG,CAAC,EAAE,EACxB,UAAU,EAAE,KAAK,GAAG,CAAC,GACpB,CACF,CAAA;iBAAA,CAAC,CACQ,CACC,CACc,CAC5B,CAAA;KAAA,CAAC,CAAC;IAEH,SAAS,qBAAqB,CAAC,GAAqB;QACnD,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;IAED,SAAS,iBAAiB,CAAC,IAAS;QACnC,KAAK,CAAC,mBAAmB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC9C,OAAO;IACR,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,8 @@
1
+ :global {
2
+ .pdf-viewer {
3
+ }
4
+ .react-pdf__Page__canvas {
5
+ margin-left: auto;
6
+ margin-right: auto;
7
+ }
8
+ }
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from "react";
2
+ export declare type PDFViewerProps = {
3
+ /** the url of the pdf to be displayed */
4
+ url: string;
5
+ /**Toolbar if provide will override the default one. */
6
+ toolbar?: ReactNode;
7
+ };
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=props.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.js","sourceRoot":"","sources":["../../../src/controls/PDFViewer/props.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ import { ToolbarState } from "./Toolbar/ToolbarState";
3
+ export declare class PDFViewerState {
4
+ private scale;
5
+ private originalWidth;
6
+ /** Gets the toolbar state. */
7
+ readonly toolbar: ToolbarState;
8
+ url: string;
9
+ containerWidth?: number;
10
+ constructor(url: string);
11
+ updateOriginalWidth(width: number): void;
12
+ get Scale(): number;
13
+ get width(): number | undefined;
14
+ Zoom(scale: number): void;
15
+ }
16
+ export declare const PDFViewerContext: React.Context<PDFViewerState | null>;
17
+ export declare const usePDFViewerContext: () => PDFViewerState | null;
@@ -0,0 +1,56 @@
1
+ import { __decorate } from "tslib";
2
+ import React, { useContext } from "react";
3
+ import { action, computed, observable } from "mobx";
4
+ import { ToolbarState } from "./Toolbar/ToolbarState";
5
+ export class PDFViewerState {
6
+ constructor(url) {
7
+ this.scale = 0;
8
+ this.originalWidth = 0;
9
+ this.url = "";
10
+ this.url = url;
11
+ this.toolbar = new ToolbarState(this);
12
+ }
13
+ updateOriginalWidth(width) {
14
+ if (this.originalWidth < width)
15
+ this.originalWidth = width;
16
+ }
17
+ get Scale() {
18
+ return this.width ? this.width / this.originalWidth : 0;
19
+ }
20
+ get width() {
21
+ if (this.scale === 0)
22
+ // fit
23
+ return this.containerWidth;
24
+ return this.originalWidth * this.scale;
25
+ }
26
+ Zoom(scale) {
27
+ this.scale = scale;
28
+ }
29
+ }
30
+ __decorate([
31
+ observable
32
+ ], PDFViewerState.prototype, "scale", void 0);
33
+ __decorate([
34
+ observable
35
+ ], PDFViewerState.prototype, "originalWidth", void 0);
36
+ __decorate([
37
+ observable
38
+ ], PDFViewerState.prototype, "url", void 0);
39
+ __decorate([
40
+ observable
41
+ ], PDFViewerState.prototype, "containerWidth", void 0);
42
+ __decorate([
43
+ action
44
+ ], PDFViewerState.prototype, "updateOriginalWidth", null);
45
+ __decorate([
46
+ computed
47
+ ], PDFViewerState.prototype, "Scale", null);
48
+ __decorate([
49
+ computed
50
+ ], PDFViewerState.prototype, "width", null);
51
+ __decorate([
52
+ action
53
+ ], PDFViewerState.prototype, "Zoom", null);
54
+ export const PDFViewerContext = React.createContext(null);
55
+ export const usePDFViewerContext = () => useContext(PDFViewerContext);
56
+ //# sourceMappingURL=state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.js","sourceRoot":"","sources":["../../../src/controls/PDFViewer/state.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,MAAM,OAAO,cAAc;IAkB1B,YAAmB,GAAW;QAhBtB,UAAK,GAAG,CAAC,CAAC;QAGV,kBAAa,GAAG,CAAC,CAAC;QAOnB,QAAG,GAAG,EAAE,CAAC;QAOf,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAGM,mBAAmB,CAAC,KAAa;QACvC,IAAI,IAAI,CAAC,aAAa,GAAG,KAAK;YAAE,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;IAC5D,CAAC;IAID,IAAW,KAAK;QACf,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IACzD,CAAC;IAID,IAAW,KAAK;QACf,IAAI,IAAI,CAAC,KAAK,KAAK,CAAC;YACnB,MAAM;YACN,OAAO,IAAI,CAAC,cAAc,CAAC;QAC5B,OAAO,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC;IACxC,CAAC;IAIM,IAAI,CAAC,KAAa;QACxB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,CAAC;CACD;AA9CA;IADC,UAAU;6CACO;AAGlB;IADC,UAAU;qDACe;AAO1B;IAFC,UAAU;2CAEK;AAIhB;IAFC,UAAU;sDAEoB;AAQ/B;IADC,MAAM;yDAGN;AAID;IAFC,QAAQ;2CAIR;AAID;IAFC,QAAQ;2CAOR;AAID;IAFC,MAAM;0CAIN;AAGF,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC,aAAa,CAAwB,IAAI,CAAC,CAAC;AACjF,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { UnitUIService as Base, UnitSelectDialogProps } from "@voplus/morpho-document-core";
2
+ import React from "react";
3
+ export declare class UnitUIService extends Base {
4
+ renderUnitSelectDialog(props: UnitSelectDialogProps): React.ReactNode;
5
+ }
@@ -0,0 +1,9 @@
1
+ import { UnitUIService as Base } from "@voplus/morpho-document-core";
2
+ import React from "react";
3
+ import UnitSelectDialog from "./components/UnitsSelectDialog";
4
+ export class UnitUIService extends Base {
5
+ renderUnitSelectDialog(props) {
6
+ return React.createElement(UnitSelectDialog, Object.assign({}, props));
7
+ }
8
+ }
9
+ //# sourceMappingURL=UnitUIService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnitUIService.js","sourceRoot":"","sources":["../../../src/modules/unit/UnitUIService.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,IAAI,EAAyB,MAAM,8BAA8B,CAAC;AAE5F,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAE9D,MAAM,OAAO,aAAc,SAAQ,IAAI;IAC/B,sBAAsB,CAAC,KAA4B;QACzD,OAAO,oBAAC,gBAAgB,oBAAK,KAAK,EAAI,CAAC;IACxC,CAAC;CACD"}