@weavy/uikit-react 14.0.1 → 14.0.3
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/changelog.md +10 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FileBrowser.tsx +20 -1
- package/src/components/PdfViewer.tsx +1 -1
package/package.json
CHANGED
|
@@ -27,7 +27,26 @@ const FileBrowser = ({ onFileAdded }: Props) => {
|
|
|
27
27
|
}, []);
|
|
28
28
|
|
|
29
29
|
useEffect(() => {
|
|
30
|
-
|
|
30
|
+
var origin = "";
|
|
31
|
+
|
|
32
|
+
// Get top origin
|
|
33
|
+
try {
|
|
34
|
+
if (window.location.ancestorOrigins && 0 < window.location.ancestorOrigins.length) {
|
|
35
|
+
// Not available in FF, but Google APIs use this
|
|
36
|
+
origin = window.location.ancestorOrigins[window.location.ancestorOrigins.length - 1];
|
|
37
|
+
} else if (window.top) {
|
|
38
|
+
// This may fail due to cors
|
|
39
|
+
origin = window.top.document.location.origin;
|
|
40
|
+
}
|
|
41
|
+
} catch(e) { /* No worries */}
|
|
42
|
+
|
|
43
|
+
if (!origin) {
|
|
44
|
+
try {
|
|
45
|
+
origin = window.self.document.location.origin;
|
|
46
|
+
} catch(e) {
|
|
47
|
+
console.error("Filebrowser: Could not read current origin.");
|
|
48
|
+
}
|
|
49
|
+
}
|
|
31
50
|
|
|
32
51
|
const filebrowserSrc = fileBrowserUrl + "?origin=" + origin + "&v=X&t=" + Date.now().toString() + "&weavyId=wy-filebrowser";
|
|
33
52
|
|
|
@@ -249,7 +249,7 @@ const PdfViewer = ({ src, pdfCMapsUrl, pdfWorkerUrl }: Props) => {
|
|
|
249
249
|
return (
|
|
250
250
|
<div className="wy-content-pdf" data-controller="pdf" data-pdf-url-value="">
|
|
251
251
|
<div className="wy-toolbars-bottom">
|
|
252
|
-
<nav className="wy-toolbar">
|
|
252
|
+
<nav className="wy-toolbar wy-toolbar-center">
|
|
253
253
|
<div className="wy-toolbar-buttons">
|
|
254
254
|
<input type="text" className="wy-input" ref={pageNumberRef} onChange={updatePage} onClick={select} data-pdf-target="pageNumber"/>
|
|
255
255
|
<span>/</span>
|