asma-doc-viewer 1.0.6 → 1.0.7
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/.idea/workspace.xml +51 -5
- package/CHANGELOG.md +293 -0
- package/build/components/DocumentNav.d.ts +2 -0
- package/build/components/DocumentNav.js +64 -0
- package/build/components/FileName.d.ts +2 -0
- package/build/components/FileName.js +61 -0
- package/build/components/HeaderBar.d.ts +2 -0
- package/build/components/HeaderBar.js +58 -0
- package/build/components/ProxyRenderer.d.ts +2 -0
- package/build/components/ProxyRenderer.js +80 -0
- package/build/components/common/Button.d.ts +11 -0
- package/build/components/common/Button.js +38 -0
- package/build/components/common/index.d.ts +1 -0
- package/build/components/common/index.js +17 -0
- package/build/components/icons/index.d.ts +9 -0
- package/build/components/icons/index.js +45 -0
- package/build/index.d.ts +26 -0
- package/build/index.js +89 -0
- package/build/plugins/bmp/index.d.ts +3 -0
- package/build/plugins/bmp/index.js +22 -0
- package/build/plugins/html/index.d.ts +3 -0
- package/build/plugins/html/index.js +60 -0
- package/build/plugins/image/index.d.ts +3 -0
- package/build/plugins/image/index.js +34 -0
- package/build/plugins/index.d.ts +1 -0
- package/build/plugins/index.js +26 -0
- package/build/plugins/jpg/index.d.ts +3 -0
- package/build/plugins/jpg/index.js +22 -0
- package/build/plugins/msdoc/index.d.ts +3 -0
- package/build/plugins/msdoc/index.js +54 -0
- package/build/plugins/pdf/components/PDFControls.d.ts +3 -0
- package/build/plugins/pdf/components/PDFControls.js +73 -0
- package/build/plugins/pdf/components/PDFPagination.d.ts +3 -0
- package/build/plugins/pdf/components/PDFPagination.js +57 -0
- package/build/plugins/pdf/components/icons/index.d.ts +10 -0
- package/build/plugins/pdf/components/icons/index.js +79 -0
- package/build/plugins/pdf/components/pages/PDFAllPages.d.ts +6 -0
- package/build/plugins/pdf/components/pages/PDFAllPages.js +41 -0
- package/build/plugins/pdf/components/pages/PDFPages.d.ts +3 -0
- package/build/plugins/pdf/components/pages/PDFPages.js +56 -0
- package/build/plugins/pdf/components/pages/PDFSinglePage.d.ts +6 -0
- package/build/plugins/pdf/components/pages/PDFSinglePage.js +53 -0
- package/build/plugins/pdf/index.d.ts +3 -0
- package/build/plugins/pdf/index.js +55 -0
- package/build/plugins/pdf/state/actions.d.ts +25 -0
- package/build/plugins/pdf/state/actions.js +31 -0
- package/build/plugins/pdf/state/index.d.ts +13 -0
- package/build/plugins/pdf/state/index.js +47 -0
- package/build/plugins/pdf/state/reducer.d.ts +12 -0
- package/build/plugins/pdf/state/reducer.js +45 -0
- package/build/plugins/png/index.d.ts +3 -0
- package/build/plugins/png/index.js +29 -0
- package/build/plugins/tiff/index.d.ts +3 -0
- package/build/plugins/tiff/index.js +77 -0
- package/build/plugins/tiff/tiffToCanvas.d.ts +1 -0
- package/build/plugins/tiff/tiffToCanvas.js +602 -0
- package/build/plugins/txt/index.d.ts +3 -0
- package/build/plugins/txt/index.js +24 -0
- package/build/plugins/webp/index.d.ts +3 -0
- package/build/plugins/webp/index.js +59 -0
- package/build/state/actions.d.ts +42 -0
- package/build/state/actions.js +45 -0
- package/build/state/index.d.ts +10 -0
- package/build/state/index.js +54 -0
- package/build/state/reducer.d.ts +14 -0
- package/build/state/reducer.js +64 -0
- package/build/theme/index.d.ts +2 -0
- package/build/theme/index.js +12 -0
- package/build/types/index.d.ts +41 -0
- package/build/types/index.js +2 -0
- package/build/utils/fileLoaders.d.ts +12 -0
- package/build/utils/fileLoaders.js +105 -0
- package/build/utils/useDocumentLoader.d.ts +12 -0
- package/build/utils/useDocumentLoader.js +82 -0
- package/build/utils/useRendererSelector.d.ts +7 -0
- package/build/utils/useRendererSelector.js +40 -0
- package/build/utils/useWindowSize.d.ts +4 -0
- package/build/utils/useWindowSize.js +34 -0
- package/package.json +17 -17
package/.idea/workspace.xml
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
</component>
|
|
6
6
|
<component name="ChangeListManager">
|
|
7
7
|
<list default="true" id="2420ee6f-9c38-476f-82bf-3c5a7aca550a" name="Changes" comment="">
|
|
8
|
-
<change afterPath="$PROJECT_DIR$/
|
|
8
|
+
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
|
|
9
9
|
</list>
|
|
10
10
|
<option name="SHOW_DIALOG" value="false" />
|
|
11
11
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
@@ -19,13 +19,38 @@
|
|
|
19
19
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
|
20
20
|
<option name="RESET_MODE" value="HARD" />
|
|
21
21
|
</component>
|
|
22
|
-
<component name="GitLabMergeRequestsSettings"
|
|
23
|
-
<component name="
|
|
24
|
-
|
|
22
|
+
<component name="GitLabMergeRequestsSettings">{}</component>
|
|
23
|
+
<component name="GitToolBoxStore">
|
|
24
|
+
<option name="recentBranches">
|
|
25
|
+
<RecentBranches>
|
|
26
|
+
<option name="branchesForRepo">
|
|
27
|
+
<list>
|
|
28
|
+
<RecentBranchesForRepo>
|
|
29
|
+
<option name="branches">
|
|
30
|
+
<list>
|
|
31
|
+
<RecentBranch>
|
|
32
|
+
<option name="branchName" value="feat/ASMA-2845-new-api-webp" />
|
|
33
|
+
<option name="lastUsedInstant" value="1708986544" />
|
|
34
|
+
</RecentBranch>
|
|
35
|
+
<RecentBranch>
|
|
36
|
+
<option name="branchName" value="master" />
|
|
37
|
+
<option name="lastUsedInstant" value="1708986214" />
|
|
38
|
+
</RecentBranch>
|
|
39
|
+
</list>
|
|
40
|
+
</option>
|
|
41
|
+
<option name="repositoryRootUrl" value="file://$PROJECT_DIR$" />
|
|
42
|
+
</RecentBranchesForRepo>
|
|
43
|
+
</list>
|
|
44
|
+
</option>
|
|
45
|
+
</RecentBranches>
|
|
46
|
+
</option>
|
|
47
|
+
</component>
|
|
48
|
+
<component name="GithubPullRequestsUISettings">{}</component>
|
|
49
|
+
<component name="KubernetesApiProvider">{}</component>
|
|
25
50
|
<component name="MarkdownSettingsMigration">
|
|
26
51
|
<option name="stateVersion" value="1" />
|
|
27
52
|
</component>
|
|
28
|
-
<component name="ProjectColorInfo"
|
|
53
|
+
<component name="ProjectColorInfo">{}</component>
|
|
29
54
|
<component name="ProjectId" id="25ENHDhJCwOrfTBlC0Ap5oFVrBf" />
|
|
30
55
|
<component name="ProjectViewState">
|
|
31
56
|
<option name="hideEmptyMiddlePackages" value="true" />
|
|
@@ -36,6 +61,7 @@
|
|
|
36
61
|
"git-widget-placeholder": "feat/ASMA-2845-new-api-webp",
|
|
37
62
|
"last_opened_file_path": "/Users/utopiaeh/Developer/carasent/srv/doc-viewer/src/plugins",
|
|
38
63
|
"node.js.selected.package.tslint": "(autodetect)",
|
|
64
|
+
"npm.build.executor": "Run",
|
|
39
65
|
"ts.external.directory.path": "/Users/utopiaeh/Developer/carasent/srv/doc-viewer/node_modules/typescript/lib"
|
|
40
66
|
}
|
|
41
67
|
}]]></component>
|
|
@@ -43,6 +69,26 @@
|
|
|
43
69
|
<key name="CopyFile.RECENT_KEYS">
|
|
44
70
|
<recent name="$PROJECT_DIR$/src/plugins" />
|
|
45
71
|
</key>
|
|
72
|
+
<key name="MoveFile.RECENT_KEYS">
|
|
73
|
+
<recent name="$PROJECT_DIR$" />
|
|
74
|
+
</key>
|
|
75
|
+
</component>
|
|
76
|
+
<component name="RunManager">
|
|
77
|
+
<configuration name="build" type="js.build_tools.npm" temporary="true" nameIsGenerated="true">
|
|
78
|
+
<package-json value="$PROJECT_DIR$/package.json" />
|
|
79
|
+
<command value="run" />
|
|
80
|
+
<scripts>
|
|
81
|
+
<script value="build" />
|
|
82
|
+
</scripts>
|
|
83
|
+
<node-interpreter value="project" />
|
|
84
|
+
<envs />
|
|
85
|
+
<method v="2" />
|
|
86
|
+
</configuration>
|
|
87
|
+
<recent_temporary>
|
|
88
|
+
<list>
|
|
89
|
+
<item itemvalue="npm.build" />
|
|
90
|
+
</list>
|
|
91
|
+
</recent_temporary>
|
|
46
92
|
</component>
|
|
47
93
|
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
|
48
94
|
<component name="TaskManager">
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
#### 0.1.5 (2020-10-29)
|
|
2
|
+
|
|
3
|
+
##### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **TIFFRenderer file Corrupt:** Don't crash if parseTIFF fails because of corrupted file. ([30755e57](https://github.com/Alcumus/react-doc-viewer/commit/30755e57ec0bef8a665ce1c6f9e8f93c4ada55dc))
|
|
6
|
+
|
|
7
|
+
#### 0.1.4 (2020-10-29)
|
|
8
|
+
|
|
9
|
+
##### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **TIFFRenderer crash:** If parseTiff is supplied with an undefined tiffArrayBuffer. Return out. ([eedeac1e](https://github.com/Alcumus/react-doc-viewer/commit/eedeac1e0deada4126e77058d5c52b1ed92f200f))
|
|
12
|
+
|
|
13
|
+
#### 0.1.3 (2020-10-29)
|
|
14
|
+
|
|
15
|
+
##### New Features
|
|
16
|
+
|
|
17
|
+
* **TIF:** Added .tif as an option to render within TIFFRenderer. ([a32f9b0f](https://github.com/Alcumus/react-doc-viewer/commit/a32f9b0ffff1a0a37d14a6dd948e1d0f52ffe6c6))
|
|
18
|
+
|
|
19
|
+
##### Other Changes
|
|
20
|
+
|
|
21
|
+
* fix/pptx ([60c27812](https://github.com/Alcumus/react-doc-viewer/commit/60c27812f658d4edf4a7cc1673c26a95b838eca1))
|
|
22
|
+
|
|
23
|
+
#### 0.1.2 (2020-10-26)
|
|
24
|
+
|
|
25
|
+
##### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* Added github url to npm package ([b713957f](https://github.com/Alcumus/react-doc-viewer/commit/b713957fef42e896ab45d99a3127a59e98a11e60))
|
|
28
|
+
|
|
29
|
+
#### 0.1.1 (2020-10-26)
|
|
30
|
+
|
|
31
|
+
##### New Features
|
|
32
|
+
|
|
33
|
+
* **FileName Header:**
|
|
34
|
+
* decodeURI when rendering fileName in header title (79c0da83)
|
|
35
|
+
* When rendering fileName in header, remove url params unless requested to keep (109da8d7)
|
|
36
|
+
|
|
37
|
+
#### 0.0.43 (2020-09-30)
|
|
38
|
+
|
|
39
|
+
##### New Features
|
|
40
|
+
|
|
41
|
+
* **Combine File Loaders:** File Loaders duplicate code combined, also base64 and arrayBuffer combined into fileData (#47) (f3fd9952)
|
|
42
|
+
|
|
43
|
+
#### 0.0.42 (2020-09-30)
|
|
44
|
+
|
|
45
|
+
##### Documentation Changes
|
|
46
|
+
|
|
47
|
+
* README - styled component example is missing a closing bracket after DocViewer Fixes #31 (da0a40ee)
|
|
48
|
+
|
|
49
|
+
##### New Features
|
|
50
|
+
|
|
51
|
+
* BMP Image renderer added (2e8578b1)
|
|
52
|
+
* Internal ImageProxyRenderer created, that can be used by all other Image renderers, and styled by them (dc2afb71)
|
|
53
|
+
|
|
54
|
+
##### Other Changes
|
|
55
|
+
|
|
56
|
+
* Alcumus/react-doc-viewer into develop (2184d46c)
|
|
57
|
+
* mattmogford-alcumus/40_Create-HTMLRenderer (9eff64e2)
|
|
58
|
+
|
|
59
|
+
#### 0.0.41 (2020-09-25)
|
|
60
|
+
|
|
61
|
+
#### 0.0.40 (2020-09-24)
|
|
62
|
+
|
|
63
|
+
##### Documentation Changes
|
|
64
|
+
|
|
65
|
+
* README - styled component example is missing a closing bracket after DocViewer Fixes #31 (7964c0b9)
|
|
66
|
+
|
|
67
|
+
##### New Features
|
|
68
|
+
|
|
69
|
+
* BMP Image renderer added (2cb03e4c)
|
|
70
|
+
* Internal ImageProxyRenderer created, that can be used by all other Image renderers, and styled by them (90e575da)
|
|
71
|
+
|
|
72
|
+
#### 0.0.39 (2020-09-23)
|
|
73
|
+
|
|
74
|
+
##### Documentation Changes
|
|
75
|
+
|
|
76
|
+
* README updated (819acb5b)
|
|
77
|
+
|
|
78
|
+
#### 0.0.38 (2020-09-23)
|
|
79
|
+
|
|
80
|
+
##### New Features
|
|
81
|
+
|
|
82
|
+
* Added renderer for .msg file extension (b4cf7bf4)
|
|
83
|
+
* useDocumentLoader hook now allows use of custom fileLoaders. e.g. bse64, ArrayBuffer (ebc9a454)
|
|
84
|
+
|
|
85
|
+
#### 0.0.37 (2020-09-18)
|
|
86
|
+
|
|
87
|
+
##### Other Changes
|
|
88
|
+
|
|
89
|
+
* mattmogford-alcumus/issue29 (35ea44eb)
|
|
90
|
+
|
|
91
|
+
#### 0.0.36 (2020-09-17)
|
|
92
|
+
|
|
93
|
+
#### 0.0.35 (2020-09-17)
|
|
94
|
+
|
|
95
|
+
#### 0.0.34 (2020-09-16)
|
|
96
|
+
|
|
97
|
+
##### Bug Fixes
|
|
98
|
+
|
|
99
|
+
* Document fetches header even if file type is supplied (b5296d0f)
|
|
100
|
+
|
|
101
|
+
#### 0.0.33 (2020-09-16)
|
|
102
|
+
|
|
103
|
+
##### Other Changes
|
|
104
|
+
|
|
105
|
+
* develop (66cd5676)
|
|
106
|
+
* mattmogford-alcumus/issue19 (f8f16bc1)
|
|
107
|
+
|
|
108
|
+
#### 0.0.32 (2020-09-03)
|
|
109
|
+
|
|
110
|
+
##### Chores
|
|
111
|
+
|
|
112
|
+
* Added default height to loading container (e5570741)
|
|
113
|
+
|
|
114
|
+
##### New Features
|
|
115
|
+
|
|
116
|
+
* pluginRenderers are now passed directly to the main state context, and the correct renderer is retrieved from there depending on it's fileType associations (4c7abfd3)
|
|
117
|
+
|
|
118
|
+
##### Bug Fixes
|
|
119
|
+
|
|
120
|
+
* Changed Button to actual <button> from <a> to prevent annoying text selection bug (25dc93eb)
|
|
121
|
+
* Abort fetch of file when new file is selected mid fetch. Also display loading spinner (db440e66)
|
|
122
|
+
|
|
123
|
+
##### Tests
|
|
124
|
+
|
|
125
|
+
* Updated test snapshot (7660907f)
|
|
126
|
+
|
|
127
|
+
#### 0.0.31 (2020-09-02)
|
|
128
|
+
|
|
129
|
+
##### Chores
|
|
130
|
+
|
|
131
|
+
* Removed unused css file (485f15b3)
|
|
132
|
+
|
|
133
|
+
##### New Features
|
|
134
|
+
|
|
135
|
+
* Removed FontAwesome and included replacement svgs, which are resizable and colourable (7c7c3fca)
|
|
136
|
+
|
|
137
|
+
##### Bug Fixes
|
|
138
|
+
|
|
139
|
+
* IIconProps import type fixed (1e1b00c5)
|
|
140
|
+
|
|
141
|
+
##### Tests
|
|
142
|
+
|
|
143
|
+
* Updated snapshots for tests (f40a5447)
|
|
144
|
+
|
|
145
|
+
#### 0.0.30 (2020-09-02)
|
|
146
|
+
|
|
147
|
+
##### New Features
|
|
148
|
+
|
|
149
|
+
* implemented ability to fully replace the contents of the header, but also retain access to the state and document navigation actions (2c1e3d0d)
|
|
150
|
+
|
|
151
|
+
#### 0.0.29 (2020-09-01)
|
|
152
|
+
|
|
153
|
+
##### Chores
|
|
154
|
+
|
|
155
|
+
* No longer require public folder (2a639dcc)
|
|
156
|
+
|
|
157
|
+
#### 0.0.28 (2020-09-01)
|
|
158
|
+
|
|
159
|
+
##### Bug Fixes
|
|
160
|
+
|
|
161
|
+
* Removed necessity for 2 context calls (1e9886ca)
|
|
162
|
+
|
|
163
|
+
#### 0.0.27 (2020-09-01)
|
|
164
|
+
|
|
165
|
+
##### Documentation Changes
|
|
166
|
+
|
|
167
|
+
* Removed Setup Demo from contents at top of README (8a8db314)
|
|
168
|
+
|
|
169
|
+
#### 0.0.26 (2020-09-01)
|
|
170
|
+
|
|
171
|
+
##### Bug Fixes
|
|
172
|
+
|
|
173
|
+
* Pass mainState context to CurrentRenderer for ease of use/access to loaded data, and other mainState props (98efa91c)
|
|
174
|
+
|
|
175
|
+
#### 0.0.25 (2020-09-01)
|
|
176
|
+
|
|
177
|
+
##### Chores
|
|
178
|
+
|
|
179
|
+
* Renamed MainContext to DocViewerContext for external plugins to import it with a less generic name (c433d438)
|
|
180
|
+
|
|
181
|
+
##### Documentation Changes
|
|
182
|
+
|
|
183
|
+
* Added README info for importing and using the included individual renderers (3a87cf87)
|
|
184
|
+
|
|
185
|
+
##### Refactors
|
|
186
|
+
|
|
187
|
+
* Reverting from Recoil to react state, context and reducers (ff26a49b)
|
|
188
|
+
|
|
189
|
+
#### 0.0.24 (2020-08-28)
|
|
190
|
+
|
|
191
|
+
#### 0.0.23 (2020-08-28)
|
|
192
|
+
|
|
193
|
+
#### 0.0.22 (2020-08-28)
|
|
194
|
+
|
|
195
|
+
##### New Features
|
|
196
|
+
|
|
197
|
+
* **Merge Default Plugins:** Plugins have been pulled back into the component package, Updated README to inform on updated and better way to use included and custom plugins (34bed0c7)
|
|
198
|
+
|
|
199
|
+
##### Bug Fixes
|
|
200
|
+
|
|
201
|
+
* If user passes in a bad file / url and uri ends up not being useful, (ae99034f)
|
|
202
|
+
|
|
203
|
+
#### 0.0.21 (2020-08-27)
|
|
204
|
+
|
|
205
|
+
##### Chores
|
|
206
|
+
|
|
207
|
+
* Removed old pdf plugin dependencies (3baa9355)
|
|
208
|
+
|
|
209
|
+
#### 0.0.20 (2020-08-27)
|
|
210
|
+
|
|
211
|
+
#### 0.0.19 (2020-08-26)
|
|
212
|
+
|
|
213
|
+
##### Documentation Changes
|
|
214
|
+
|
|
215
|
+
* README updated (39fd2b93)
|
|
216
|
+
|
|
217
|
+
##### Bug Fixes
|
|
218
|
+
|
|
219
|
+
* FileType removed, as the component needs to be ambiguous to plugin renderers (fcf9e1c0)
|
|
220
|
+
|
|
221
|
+
#### 0.0.18 (2020-08-26)
|
|
222
|
+
|
|
223
|
+
#### 0.0.17 (2020-08-25)
|
|
224
|
+
|
|
225
|
+
#### 0.0.16 (2020-08-25)
|
|
226
|
+
|
|
227
|
+
#### 0.0.15 (2020-08-25)
|
|
228
|
+
|
|
229
|
+
#### 0.0.14 (2020-08-25)
|
|
230
|
+
|
|
231
|
+
#### 0.0.13 (2020-08-25)
|
|
232
|
+
|
|
233
|
+
#### 0.0.12 (2020-08-25)
|
|
234
|
+
|
|
235
|
+
##### Chores
|
|
236
|
+
|
|
237
|
+
* Tidied state atoms etc. (fbb5ede2)
|
|
238
|
+
|
|
239
|
+
##### Bug Fixes
|
|
240
|
+
|
|
241
|
+
* **PDFRenderer Reset Zoom Broken:** resetZoomLevel function wasn't being called (4b3b9918)
|
|
242
|
+
|
|
243
|
+
#### 0.0.12 (2020-08-25)
|
|
244
|
+
|
|
245
|
+
##### Bug Fixes
|
|
246
|
+
|
|
247
|
+
* **PDFRenderer Reset Zoom Broken:** resetZoomLevel function wasn't being called (4b3b9918)
|
|
248
|
+
|
|
249
|
+
#### 0.0.11 (2020-08-25)
|
|
250
|
+
|
|
251
|
+
##### Bug Fixes
|
|
252
|
+
|
|
253
|
+
* sever was incorrect for build-release options (2ebe713b)
|
|
254
|
+
|
|
255
|
+
##### Tests
|
|
256
|
+
|
|
257
|
+
* Added example png for testing purposes (9c3c6cf6)
|
|
258
|
+
|
|
259
|
+
#### 0.0.10 (2020-08-24)
|
|
260
|
+
|
|
261
|
+
#### 0.0.9 (2020-08-24)
|
|
262
|
+
|
|
263
|
+
#### 0.0.8 (2020-08-24)
|
|
264
|
+
|
|
265
|
+
##### Bug Fixes
|
|
266
|
+
|
|
267
|
+
* ignore index on building package, point main and types to main component file DocViewer.tsx (96f1a12f)
|
|
268
|
+
|
|
269
|
+
#### 0.0.4 (2020-08-24)
|
|
270
|
+
|
|
271
|
+
##### New Features
|
|
272
|
+
|
|
273
|
+
* **Versioning:** Added scripts for auto update CHANGELOG with versioning (31c31d1c)
|
|
274
|
+
|
|
275
|
+
##### Bug Fixes
|
|
276
|
+
|
|
277
|
+
* config is optional and so could be undefined (596d611d)
|
|
278
|
+
|
|
279
|
+
#### 0.0.3 (2020-08-24)
|
|
280
|
+
|
|
281
|
+
##### New Features
|
|
282
|
+
|
|
283
|
+
- **Versioning:** Added scripts for auto update CHANGELOG with versioning (48536a0c)
|
|
284
|
+
|
|
285
|
+
##### Bug Fixes
|
|
286
|
+
|
|
287
|
+
- config is optional and so could be undefined (596d611d)
|
|
288
|
+
|
|
289
|
+
#### 0.0.3 (2020-08-24)
|
|
290
|
+
|
|
291
|
+
##### Bug Fixes
|
|
292
|
+
|
|
293
|
+
- config is optional and so could be undefined (596d611d)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
+
if (mod && mod.__esModule) return mod;
|
|
24
|
+
var result = {};
|
|
25
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
+
__setModuleDefault(result, mod);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
30
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
31
|
+
};
|
|
32
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
exports.DocumentNav = void 0;
|
|
34
|
+
var react_1 = __importStar(require("react"));
|
|
35
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
36
|
+
var state_1 = require("../state");
|
|
37
|
+
var actions_1 = require("../state/actions");
|
|
38
|
+
var Button_1 = require("./common/Button");
|
|
39
|
+
var icons_1 = require("./icons");
|
|
40
|
+
var DocumentNav = function () {
|
|
41
|
+
var _a = (0, react_1.useContext)(state_1.DocViewerContext), _b = _a.state, currentDocument = _b.currentDocument, currentFileNo = _b.currentFileNo, documents = _b.documents, dispatch = _a.dispatch;
|
|
42
|
+
if (documents.length <= 1 || !currentDocument)
|
|
43
|
+
return null;
|
|
44
|
+
var fileName = currentDocument.uri;
|
|
45
|
+
var splitURL = fileName.split("/");
|
|
46
|
+
if (splitURL.length) {
|
|
47
|
+
fileName = splitURL[splitURL.length - 1];
|
|
48
|
+
}
|
|
49
|
+
return (react_1.default.createElement(Container, { id: "doc-nav" },
|
|
50
|
+
react_1.default.createElement("p", { id: "doc-nav-info" },
|
|
51
|
+
"Doc ",
|
|
52
|
+
currentFileNo + 1,
|
|
53
|
+
" of ",
|
|
54
|
+
documents.length),
|
|
55
|
+
react_1.default.createElement(ButtonPrev, { id: "doc-nav-prev", onClick: function () { return dispatch((0, actions_1.previousDocument)()); }, disabled: currentFileNo === 0 },
|
|
56
|
+
react_1.default.createElement(icons_1.PrevDocIcon, { color: "#fff", size: "60%" })),
|
|
57
|
+
react_1.default.createElement(ButtonNext, { id: "doc-nav-next", onClick: function () { return dispatch((0, actions_1.nextDocument)()); }, disabled: currentFileNo >= documents.length - 1 },
|
|
58
|
+
react_1.default.createElement(icons_1.NextDocIcon, { color: "#fff", size: "60%" }))));
|
|
59
|
+
};
|
|
60
|
+
exports.DocumentNav = DocumentNav;
|
|
61
|
+
var Container = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n min-width: 150px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: flex-end;\n margin: 0 10px;\n color: ", ";\n"], ["\n min-width: 150px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: flex-end;\n margin: 0 10px;\n color: ", ";\n"])), function (props) { return props.theme.text_primary; });
|
|
62
|
+
var ButtonPrev = (0, styled_components_1.default)(Button_1.ButtonSecondary)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 30px;\n height: 30px;\n margin: 0 5px 0 10px;\n\n @media (max-width: 768px) {\n width: 25px;\n height: 25px;\n }\n"], ["\n width: 30px;\n height: 30px;\n margin: 0 5px 0 10px;\n\n @media (max-width: 768px) {\n width: 25px;\n height: 25px;\n }\n"])));
|
|
63
|
+
var ButtonNext = (0, styled_components_1.default)(ButtonPrev)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n margin: 0 5px;\n"], ["\n margin: 0 5px;\n"])));
|
|
64
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
+
if (mod && mod.__esModule) return mod;
|
|
24
|
+
var result = {};
|
|
25
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
+
__setModuleDefault(result, mod);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
30
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
31
|
+
};
|
|
32
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
exports.FileName = void 0;
|
|
34
|
+
var react_1 = __importStar(require("react"));
|
|
35
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
36
|
+
var state_1 = require("../state");
|
|
37
|
+
var FileName = function () {
|
|
38
|
+
var _a, _b;
|
|
39
|
+
var _c = (0, react_1.useContext)(state_1.DocViewerContext).state, config = _c.config, currentDocument = _c.currentDocument;
|
|
40
|
+
if (!currentDocument || ((_a = config === null || config === void 0 ? void 0 : config.header) === null || _a === void 0 ? void 0 : _a.disableFileName))
|
|
41
|
+
return null;
|
|
42
|
+
var fileName = '';
|
|
43
|
+
if (currentDocument.fileName) {
|
|
44
|
+
fileName = currentDocument.fileName;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
fileName = currentDocument.uri || '';
|
|
48
|
+
fileName = decodeURI(fileName);
|
|
49
|
+
if (!((_b = config === null || config === void 0 ? void 0 : config.header) === null || _b === void 0 ? void 0 : _b.retainURLParams)) {
|
|
50
|
+
fileName = fileName.split('?')[0];
|
|
51
|
+
}
|
|
52
|
+
var splitURL = fileName.split('/');
|
|
53
|
+
if (splitURL.length) {
|
|
54
|
+
fileName = splitURL[splitURL.length - 1];
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return (react_1.default.createElement(Container, { id: 'file-name', "data-testid": 'file-name' }, fileName));
|
|
58
|
+
};
|
|
59
|
+
exports.FileName = FileName;
|
|
60
|
+
var Container = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex: 1;\n text-align: left;\n color: ", ";\n font-weight: bold;\n margin: 0 10px;\n overflow: hidden;\n"], ["\n flex: 1;\n text-align: left;\n color: ", ";\n font-weight: bold;\n margin: 0 10px;\n overflow: hidden;\n"])), function (props) { return props.theme.text_primary; });
|
|
61
|
+
var templateObject_1;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
+
if (mod && mod.__esModule) return mod;
|
|
24
|
+
var result = {};
|
|
25
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
+
__setModuleDefault(result, mod);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
30
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
31
|
+
};
|
|
32
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
exports.HeaderBar = void 0;
|
|
34
|
+
var react_1 = __importStar(require("react"));
|
|
35
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
36
|
+
var state_1 = require("../state");
|
|
37
|
+
var actions_1 = require("../state/actions");
|
|
38
|
+
var DocumentNav_1 = require("./DocumentNav");
|
|
39
|
+
var FileName_1 = require("./FileName");
|
|
40
|
+
var HeaderBar = function () {
|
|
41
|
+
var _a, _b, _c;
|
|
42
|
+
var _d = (0, react_1.useContext)(state_1.DocViewerContext), state = _d.state, dispatch = _d.dispatch;
|
|
43
|
+
var config = state.config;
|
|
44
|
+
if ((_a = config === null || config === void 0 ? void 0 : config.header) === null || _a === void 0 ? void 0 : _a.disableHeader)
|
|
45
|
+
return null;
|
|
46
|
+
var override = (_c = (_b = config === null || config === void 0 ? void 0 : config.header) === null || _b === void 0 ? void 0 : _b.overrideComponent) === null || _c === void 0 ? void 0 : _c.call(_b, state, function () { return dispatch((0, actions_1.previousDocument)()); }, function () { return dispatch((0, actions_1.nextDocument)()); });
|
|
47
|
+
if (override) {
|
|
48
|
+
return override;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
return (react_1.default.createElement(Container, { id: "header-bar", "data-testid": "header-bar" },
|
|
52
|
+
react_1.default.createElement(FileName_1.FileName, null),
|
|
53
|
+
react_1.default.createElement(DocumentNav_1.DocumentNav, null)));
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
exports.HeaderBar = HeaderBar;
|
|
57
|
+
var Container = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n justify-content: flex-end;\n align-items: center;\n z-index: 1;\n padding: 0 10px;\n background-color: ", ";\n font-size: 16px;\n min-height: 50px;\n\n @media (max-width: 768px) {\n min-height: 30px;\n padding: 5px;\n font-size: 10px;\n }\n"], ["\n display: flex;\n justify-content: flex-end;\n align-items: center;\n z-index: 1;\n padding: 0 10px;\n background-color: ", ";\n font-size: 16px;\n min-height: 50px;\n\n @media (max-width: 768px) {\n min-height: 30px;\n padding: 5px;\n font-size: 10px;\n }\n"])), function (props) { return props.theme.primary; });
|
|
58
|
+
var templateObject_1;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
+
if (mod && mod.__esModule) return mod;
|
|
24
|
+
var result = {};
|
|
25
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
+
__setModuleDefault(result, mod);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.ProxyRenderer = void 0;
|
|
31
|
+
var react_1 = __importStar(require("react"));
|
|
32
|
+
var styled_components_1 = __importStar(require("styled-components"));
|
|
33
|
+
var actions_1 = require("../state/actions");
|
|
34
|
+
var useDocumentLoader_1 = require("../utils/useDocumentLoader");
|
|
35
|
+
var useWindowSize_1 = require("../utils/useWindowSize");
|
|
36
|
+
var common_1 = require("./common");
|
|
37
|
+
var icons_1 = require("./icons");
|
|
38
|
+
var ProxyRenderer = function () {
|
|
39
|
+
var _a = (0, useDocumentLoader_1.useDocumentLoader)(), state = _a.state, dispatch = _a.dispatch, CurrentRenderer = _a.CurrentRenderer;
|
|
40
|
+
var documents = state.documents, documentLoading = state.documentLoading, currentDocument = state.currentDocument;
|
|
41
|
+
var size = (0, useWindowSize_1.useWindowSize)();
|
|
42
|
+
var containerRef = (0, react_1.useCallback)(function (node) {
|
|
43
|
+
node && dispatch((0, actions_1.setRendererRect)(node.getBoundingClientRect()));
|
|
44
|
+
},
|
|
45
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
46
|
+
[size]);
|
|
47
|
+
var Contents = function () {
|
|
48
|
+
if (!documents.length) {
|
|
49
|
+
return react_1.default.createElement("div", { id: "no-documents" });
|
|
50
|
+
}
|
|
51
|
+
else if (documentLoading) {
|
|
52
|
+
return (react_1.default.createElement(LoadingContainer, { id: "loading-renderer", "data-testid": "loading-renderer" },
|
|
53
|
+
react_1.default.createElement(LoadingIconContainer, null,
|
|
54
|
+
react_1.default.createElement(icons_1.LoadingIcon, { color: "#444", size: 40 }))));
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
if (CurrentRenderer) {
|
|
58
|
+
return react_1.default.createElement(CurrentRenderer, { mainState: state });
|
|
59
|
+
}
|
|
60
|
+
else if (CurrentRenderer === undefined) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
return (react_1.default.createElement("div", { id: "no-renderer", "data-testid": "no-renderer" },
|
|
65
|
+
"No Renderer for file type ", currentDocument === null || currentDocument === void 0 ? void 0 :
|
|
66
|
+
currentDocument.fileType,
|
|
67
|
+
react_1.default.createElement(DownloadButton, { id: "no-renderer-download", href: currentDocument === null || currentDocument === void 0 ? void 0 : currentDocument.uri, download: currentDocument === null || currentDocument === void 0 ? void 0 : currentDocument.uri }, "Download File")));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
return (react_1.default.createElement(Container, { id: "proxy-renderer", ref: containerRef },
|
|
72
|
+
react_1.default.createElement(Contents, null)));
|
|
73
|
+
};
|
|
74
|
+
exports.ProxyRenderer = ProxyRenderer;
|
|
75
|
+
var Container = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex: 1;\n overflow-y: auto;\n"], ["\n display: flex;\n flex: 1;\n overflow-y: auto;\n"])));
|
|
76
|
+
var LoadingContainer = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex: 1;\n height: 75px;\n align-items: center;\n justify-content: center;\n"], ["\n display: flex;\n flex: 1;\n height: 75px;\n align-items: center;\n justify-content: center;\n"])));
|
|
77
|
+
var spinAnim = (0, styled_components_1.keyframes)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n"], ["\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n"])));
|
|
78
|
+
var LoadingIconContainer = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n animation-name: ", ";\n animation-duration: 4s;\n animation-timing-function: linear;\n animation-iteration-count: infinite;\n"], ["\n animation-name: ", ";\n animation-duration: 4s;\n animation-timing-function: linear;\n animation-iteration-count: infinite;\n"])), spinAnim);
|
|
79
|
+
var DownloadButton = (0, styled_components_1.default)(common_1.LinkButton)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n width: 130px;\n height: 30px;\n background-color: ", ";\n @media (max-width: 768px) {\n width: 125px;\n height: 25px;\n }\n"], ["\n width: 130px;\n height: 30px;\n background-color: ", ";\n @media (max-width: 768px) {\n width: 125px;\n height: 25px;\n }\n"])), function (props) { return props.theme.primary; });
|
|
80
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IStyledProps } from "../../types";
|
|
2
|
+
interface ButtonProps extends IStyledProps {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const ButtonPrimaryStyle: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<IStyledProps, any>>;
|
|
6
|
+
export declare const ButtonSecondaryStyle: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<IStyledProps, any>>;
|
|
7
|
+
export declare const Button: import("styled-components").StyledComponent<"button", any, ButtonProps, never>;
|
|
8
|
+
export declare const LinkButton: import("styled-components").StyledComponent<"a", any, IStyledProps, never>;
|
|
9
|
+
export declare const ButtonPrimary: import("styled-components").StyledComponent<"button", any, ButtonProps, never>;
|
|
10
|
+
export declare const ButtonSecondary: import("styled-components").StyledComponent<"button", any, ButtonProps, never>;
|
|
11
|
+
export {};
|