react-adobe-embed
Advanced tools
Comparing version 0.1.69 to 0.2.69
@@ -31,3 +31,2 @@ "use strict"; | ||
constructor(props) { | ||
var _a; | ||
super(props); | ||
@@ -37,3 +36,3 @@ this.onLoaded = () => { | ||
this.previewFile(((_a = this.props.config) === null || _a === void 0 ? void 0 : _a.divId) || "pdf-div", ((_b = this.props.config) === null || _b === void 0 ? void 0 : _b.previewConfig) || AdobeReactView.staticDefaultCOnfig, ((_c = this.props.config) === null || _c === void 0 ? void 0 : _c.url) || | ||
"https://suntzuping.s3.ap-east-1.amazonaws.com/ANDYTIME/23andMe_Ancestry_Book.pdf"); | ||
AdobeReactView.demoUrl); | ||
}; | ||
@@ -48,8 +47,7 @@ this.state = { | ||
this.onLoaded = this.onLoaded.bind(this); | ||
document.addEventListener((((_a = this.props.cconfig) === null || _a === void 0 ? void 0 : _a.divId) || "pdf-div") + ".loaded", this.onLoad); | ||
} | ||
previewFile(divId, viewerConfig, url) { | ||
previewFile(divId, clientId, viewerConfig, url) { | ||
var _a, _b; | ||
this.adobeDCView = new window.AdobeDC.View({ | ||
clientId: ((_a = this.props.config) === null || _a === void 0 ? void 0 : _a.clientId) || "CLIENT_ID", | ||
clientId: clientId || ((_a = this.props.config) === null || _a === void 0 ? void 0 : _a.clientId) || "CLIENT_ID", | ||
divId: divId || AdobeReactView.staticDefaultDivId, | ||
@@ -64,6 +62,3 @@ url: ((_b = this.props.config) === null || _b === void 0 ? void 0 : _b.url) || AdobeReactView.demoUrl | ||
}, | ||
metaData: { | ||
fileName: "Menu.pdf", | ||
id: "6d07d124 - ac85–43b3 - a867–36930f502ac6", | ||
}, | ||
metaData: AdobeReactView.demoMetaData, | ||
}, viewerConfig); | ||
@@ -106,8 +101,12 @@ return previewFilePromise; | ||
}; | ||
AdobeReactView.demoMetaData = { | ||
fileName: "Menu.pdf", | ||
id: "6d07d124 - ac85–43b3 - a867–36930f502ac6", | ||
}; | ||
AdobeReactView.staticDefaultDivId = "pdf-div"; | ||
const ReactViewAdobe = (props) => { | ||
var _a; | ||
const [adobeMainReady, setAdobeMainReady] = (0, react_1.useState)(false); | ||
const [isReady, setIsReady] = (0, react_1.useState)(false); | ||
const divID = ((_a = props.initState.config) === null || _a === void 0 ? void 0 : _a.divId) || AdobeReactView.staticDefaultDivId; | ||
const [adobeMainReady, setAdobeMainReady] = (0, react_1.useState)(props.adobeMainReady || false); | ||
const [isReady, setIsReady] = (0, react_1.useState)(props.isReady || false); | ||
const divID = ((_a = props.config) === null || _a === void 0 ? void 0 : _a.divId) || AdobeReactView.staticDefaultDivId; | ||
(0, react_1.useEffect)(() => { | ||
@@ -125,4 +124,9 @@ if (document.getElementById(divID)) { | ||
setIsReady(true); | ||
}, props: Object.assign({ previewConfig: props.previewConfig }, props.initState) })); | ||
}, props: { | ||
previewConfig: props.previewConfig, | ||
config: props.config, | ||
isReady: isReady, | ||
adobeMainReady: adobeMainReady, | ||
} })); | ||
}; | ||
exports.default = ReactViewAdobe; |
{ | ||
"name": "react-adobe-embed", | ||
"version": "0.1.69", | ||
"version": "0.2.69", | ||
"description": "React Wrapper for Embed Adobe API", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23865
4
420