react-adobe-embed
Advanced tools
Comparing version 0.9.69 to 0.10.69
@@ -29,3 +29,2 @@ "use strict"; | ||
const react_1 = __importStar(require("react")); | ||
const lodash_1 = require("lodash"); | ||
class AdobeReactView extends react_1.default.Component { | ||
@@ -86,3 +85,3 @@ constructor(props) { | ||
this.adobeDCView = new window.AdobeDC.View({ | ||
clientId: (_a = this.state.config) === null || _a === void 0 ? void 0 : _a.clientId, | ||
clientId: ((_a = this.state.config) === null || _a === void 0 ? void 0 : _a.clientId) || 'c514163c351b4f2082ef01e530840e0b', | ||
divId, | ||
@@ -128,7 +127,8 @@ }); | ||
render() { | ||
var _a; | ||
if ((this.state.isReady && this.state.adobeMainReady)) { | ||
var _a, _b; | ||
if (document.getElementById(((_a = this.state.config) === null || _a === void 0 ? void 0 : _a.divId) || AdobeReactView.staticDefaultDivId) || | ||
(this.state.isReady && this.state.adobeMainReady)) { | ||
this.onLoaded(); | ||
} | ||
return ((0, jsx_runtime_1.jsx)("div", { id: ((_a = this.state.config) === null || _a === void 0 ? void 0 : _a.divId) || AdobeReactView.staticDefaultDivId, className: "AdobeReactView" })); | ||
return ((0, jsx_runtime_1.jsx)("div", { onLoad: () => this.onLoad(), id: ((_b = this.state.config) === null || _b === void 0 ? void 0 : _b.divId) || AdobeReactView.staticDefaultDivId, className: "AdobeReactView" })); | ||
} | ||
@@ -153,4 +153,2 @@ } | ||
const [adobeMainReady, setAdobeMainReady] = (0, react_1.useState)(props.adobeMainReady || false); | ||
const [previewConfig, setPreviewConfig] = (0, react_1.useState)(props.previewConfig ? (0, lodash_1.cloneDeep)(props.previewConfig) : AdobeReactView.staticDefaultCOnfig); | ||
const [config, setConfig] = (0, react_1.useState)(props.config ? (0, lodash_1.cloneDeep)(props.config) : {}); | ||
const [isReady, setIsReady] = (0, react_1.useState)(props.isReady || false); | ||
@@ -160,5 +158,3 @@ const divID = ((_a = props.config) === null || _a === void 0 ? void 0 : _a.divId) || AdobeReactView.staticDefaultDivId; | ||
if (document.getElementById(divID)) { | ||
if (isReady === false) { | ||
setIsReady(true); | ||
} | ||
setIsReady(true); | ||
} | ||
@@ -171,11 +167,11 @@ if (global.adobeDCView) { | ||
}, [isReady, adobeMainReady, divID]); | ||
return ((0, jsx_runtime_1.jsx)(AdobeReactView, Object.assign({ onLoad: () => { | ||
return ((0, jsx_runtime_1.jsx)(AdobeReactView, { onLoad: () => { | ||
setIsReady(true); | ||
} }, { | ||
isReady, | ||
adobeMainReady, | ||
previewConfig, | ||
config, | ||
}))); | ||
}, props: { | ||
previewConfig: props.previewConfig, | ||
config: props.config, | ||
isReady: isReady, | ||
adobeMainReady: adobeMainReady, | ||
} })); | ||
}; | ||
exports.default = ReactViewAdobe; |
{ | ||
"name": "react-adobe-embed", | ||
"version": "0.9.69", | ||
"version": "0.10.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
31173
616