asma-doc-viewer 1.0.9 → 1.0.11
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/README.md +2 -1
- package/build/plugins/webp/index.js +2 -13
- package/package.json +12 -11
- package/pnpm-lock.yaml +12742 -0
- package/.idea/workspace.xml +0 -125
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
## Current Renderable File Types
|
|
29
29
|
|
|
30
30
|
| Extension | MIME Type | Available |
|
|
31
|
-
|
|
31
|
+
|-----------| ---------------------------------------------------------------------------------- | --------- |
|
|
32
32
|
| bmp | image/bmp | `✓` |
|
|
33
33
|
| doc | application/msword | `✓` |
|
|
34
34
|
| docx | application/vnd.openxmlformats-officedocument.wordprocessingml.document | `✓` |
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
| txt | text/plain | `✓` |
|
|
45
45
|
| xls | application/vnd.ms-excel | `✓` |
|
|
46
46
|
| xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | `✓` |
|
|
47
|
+
| webp | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | `✓` |
|
|
47
48
|
|
|
48
49
|
<br />
|
|
49
50
|
<br />
|
|
@@ -17,22 +17,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
var react_1 = __importDefault(require("react"));
|
|
18
18
|
var image_1 = __importDefault(require("../image"));
|
|
19
19
|
var WEBPRenderer = function (props) {
|
|
20
|
-
var _a, _b;
|
|
21
|
-
// const [imageUrl, setImageUrl] = useState<undefined | string | ArrayBuffer>();
|
|
22
|
-
// const webpBuffer = props.mainState.currentDocument?.fileData;
|
|
23
|
-
// useEffect(() => {
|
|
24
|
-
// if (webpBuffer) {
|
|
25
|
-
// const blob = new Blob([webpBuffer], {type: 'image/webp'});
|
|
26
|
-
// const url = URL.createObjectURL(blob);
|
|
27
|
-
// setImageUrl(url);
|
|
28
|
-
// }
|
|
29
|
-
// }, [webpBuffer]);
|
|
20
|
+
var _a, _b, _c, _d;
|
|
30
21
|
return (react_1.default.createElement(image_1.default, __assign({}, props),
|
|
31
22
|
react_1.default.createElement("picture", null,
|
|
32
23
|
react_1.default.createElement("source", { srcSet: (_a = props.mainState.currentDocument) === null || _a === void 0 ? void 0 : _a.uri }),
|
|
33
|
-
react_1.default.createElement("
|
|
34
|
-
react_1.default.createElement("span", null, "img tag"),
|
|
35
|
-
react_1.default.createElement("img", { src: (_b = props.mainState.currentDocument) === null || _b === void 0 ? void 0 : _b.uri })))));
|
|
24
|
+
react_1.default.createElement("img", { src: (_b = props.mainState.currentDocument) === null || _b === void 0 ? void 0 : _b.uri, alt: (_d = (_c = props.mainState.currentDocument) === null || _c === void 0 ? void 0 : _c.fileName) !== null && _d !== void 0 ? _d : 'No title' }))));
|
|
36
25
|
};
|
|
37
26
|
WEBPRenderer.fileTypes = ["webp", "image/webp"];
|
|
38
27
|
WEBPRenderer.weight = 0;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "asma-doc-viewer",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.11",
|
|
4
|
+
"description": "Document viewer",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "ISC",
|
|
7
7
|
"repository": {
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"main": "build/index.js",
|
|
11
11
|
"types": "build/index.d.ts",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"pdfjs-dist": "
|
|
13
|
+
"pdfjs-dist": "4.4.168",
|
|
14
14
|
"print-js": "^1.6.0",
|
|
15
|
-
"react-pdf": "
|
|
15
|
+
"react-pdf": "9.1.0",
|
|
16
16
|
"styled-components": "^5.3.5"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@types/pdfjs-dist": "^2.10.378",
|
|
25
25
|
"@types/react": "^18.0.14",
|
|
26
26
|
"@types/react-dom": "^17.0.2",
|
|
27
|
-
"@types/react-pdf": "
|
|
27
|
+
"@types/react-pdf": "7.0.0",
|
|
28
28
|
"@types/styled-components": "^5.1.25",
|
|
29
29
|
"generate-changelog": "^1.8.0",
|
|
30
30
|
"react": "^18.0.14",
|
|
@@ -37,15 +37,16 @@
|
|
|
37
37
|
"build": "rm -rf build/* && tsc -p tsconfig-npm.json",
|
|
38
38
|
"test": "react-scripts test",
|
|
39
39
|
"eject": "react-scripts eject",
|
|
40
|
-
"version:patch": "
|
|
41
|
-
"version:minor": "
|
|
42
|
-
"version:major": "
|
|
40
|
+
"version:patch": "pnpm run version:pre && pnpm run version:changelog && pnpm version patch && pnpm run version:post",
|
|
41
|
+
"version:minor": "pnpm run version:pre && pnpm run version:changelog && pnpm version minor && pnpm run version:post",
|
|
42
|
+
"version:major": "pnpm run version:pre && pnpm run version:changelog && pnpm version major && pnpm run version:post",
|
|
43
43
|
"version:pre": "if [ $(git rev-parse --abbrev-ref HEAD) != 'master' ]; then echo \"\\033[1m\\033[31mCurrently on $(git rev-parse --abbrev-ref HEAD) branch. Please checkout master.\\033[0m\"; exit 1; else exit 0; fi",
|
|
44
44
|
"version:changelog": "changelog -p && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md'",
|
|
45
45
|
"version:post": "git push origin master && git push origin master --tags",
|
|
46
|
-
"build-release:patch": "react-scripts test --watchAll=false &&
|
|
47
|
-
"build-release:minor": "react-scripts test --watchAll=false &&
|
|
48
|
-
"build-release:major": "react-scripts test --watchAll=false &&
|
|
46
|
+
"build-release:patch": "react-scripts test --watchAll=false && pnpm run build && pnpm run version:patch",
|
|
47
|
+
"build-release:minor": "react-scripts test --watchAll=false && pnpm run build && pnpm run version:minor",
|
|
48
|
+
"build-release:major": "react-scripts test --watchAll=false && pnpm run build && pnpm run version:major",
|
|
49
|
+
"preinstall": "npx only-allow pnpm"
|
|
49
50
|
},
|
|
50
51
|
"eslintConfig": {
|
|
51
52
|
"extends": "react-app"
|