Socket
Socket
Sign inDemoInstall

react-adobe-embed

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-adobe-embed - npm Package Compare versions

Comparing version 3.69.420 to 3.69.666

93

lib/index.js

@@ -35,3 +35,2 @@ "use strict";

isReady: props.isReady || false,
adobeDCView: null,
config: {

@@ -49,6 +48,4 @@ divId: ((_a = props.config) === null || _a === void 0 ? void 0 : _a.divId) || exports.DefaultConfigs.staticDivId,

};
AdobeReactView.checkForViewJsLoaded =
AdobeReactView.checkForViewJsLoaded.bind(this);
AdobeReactView.checkForDeprecatedMainJsLoaded =
AdobeReactView.checkForDeprecatedMainJsLoaded.bind(this);
this.onLoad = this.onLoad.bind(this);
this.onLoaded = this.onLoaded.bind(this);
this.render = this.render.bind(this);

@@ -58,5 +55,5 @@ this.previewFile = this.previewFile.bind(this);

previewFile(divId, viewerConfig, url) {
var _a;
var _a, _b;
const config = {
clientId: this.state.config.clientId,
clientId: (_a = this.state.config) === null || _a === void 0 ? void 0 : _a.clientId,
divId,

@@ -71,3 +68,3 @@ };

},
metaData: ((_a = this.state.config) === null || _a === void 0 ? void 0 : _a.fileMeta) || exports.DefaultConfigs.demoMetaData,
metaData: ((_b = this.state.config) === null || _b === void 0 ? void 0 : _b.fileMeta) || exports.DefaultConfigs.demoMetaData,
}, viewerConfig);

@@ -77,6 +74,8 @@ return previewFilePromise;

onLoaded() {
this.previewFile(this.state.config.divId, this.state.previewConfig, this.state.config.url);
var _a, _b;
this.previewFile(((_a = this.state.config) === null || _a === void 0 ? void 0 : _a.divId) || exports.DefaultConfigs.staticDivId, this.state.previewConfig, ((_b = this.state.config) === null || _b === void 0 ? void 0 : _b.url) || exports.DefaultConfigs.demoUrl);
}
onLoad() {
console.log("load", this.state.config.divId);
var _a, _b, _c;
console.log("load", ((_a = this.state.config) === null || _a === void 0 ? void 0 : _a.divId) || exports.DefaultConfigs.staticDivId);
document.addEventListener("adobe_dc_view_sdk.ready", () => {

@@ -88,3 +87,3 @@ this.setState({

});
if (document.getElementById(this.state.config.divId || exports.DefaultConfigs.staticDivId)) {
if (document.getElementById(((_b = this.state.config) === null || _b === void 0 ? void 0 : _b.divId) || exports.DefaultConfigs.staticDivId)) {
this.setState({

@@ -95,3 +94,3 @@ isReady: true,

if (AdobeReactView.checkForViewJsLoaded() === true &&
document.getElementById(this.state.config.divId || exports.DefaultConfigs.staticDivId)) {
document.getElementById(((_c = this.state.config) === null || _c === void 0 ? void 0 : _c.divId) || exports.DefaultConfigs.staticDivId)) {
this.setState({

@@ -106,3 +105,3 @@ adobeMainReady: true,

render() {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8;
if (this.state.adobeMainReady === true && this.state.isReady === true) {

@@ -113,36 +112,36 @@ this.onLoaded();

this.onLoad();
}, id: this.state.config.divId || exports.DefaultConfigs.staticDivId, className: this.props.className ||
}, id: ((_a = this.state.config) === null || _a === void 0 ? void 0 : _a.divId) || exports.DefaultConfigs.staticDivId, className: this.props.className ||
"adobe-viewer-of-amazon-corporate-retaliations", style: {
width: ((_a = this.props.style) === null || _a === void 0 ? void 0 : _a.width) || undefined,
height: ((_b = this.props.style) === null || _b === void 0 ? void 0 : _b.height) || undefined,
position: ((_c = this.props.style) === null || _c === void 0 ? void 0 : _c.position) || "static",
top: ((_d = this.props.style) === null || _d === void 0 ? void 0 : _d.top) || undefined,
left: ((_e = this.props.style) === null || _e === void 0 ? void 0 : _e.left) || undefined,
right: ((_f = this.props.style) === null || _f === void 0 ? void 0 : _f.right) || undefined,
bottom: ((_g = this.props.style) === null || _g === void 0 ? void 0 : _g.bottom) || undefined,
zIndex: ((_h = this.props.style) === null || _h === void 0 ? void 0 : _h.zIndex) || "initial",
backgroundColor: ((_j = this.props.style) === null || _j === void 0 ? void 0 : _j.backgroundColor) || "inherit",
color: ((_k = this.props.style) === null || _k === void 0 ? void 0 : _k.color) || "inherit",
fontSize: ((_l = this.props.style) === null || _l === void 0 ? void 0 : _l.fontSize) || "inherit",
fontFamily: ((_m = this.props.style) === null || _m === void 0 ? void 0 : _m.fontFamily) || "inherit",
fontWeight: ((_o = this.props.style) === null || _o === void 0 ? void 0 : _o.fontWeight) || "inherit",
fontStyle: ((_p = this.props.style) === null || _p === void 0 ? void 0 : _p.fontStyle) || "inherit",
lineHeight: ((_q = this.props.style) === null || _q === void 0 ? void 0 : _q.lineHeight) || "inherit",
margin: ((_r = this.props.style) === null || _r === void 0 ? void 0 : _r.margin) || "inherit",
padding: ((_s = this.props.style) === null || _s === void 0 ? void 0 : _s.padding) || "inherit",
marginTop: ((_t = this.props.style) === null || _t === void 0 ? void 0 : _t.marginTop) || "inherit",
marginBottom: ((_u = this.props.style) === null || _u === void 0 ? void 0 : _u.marginBottom) || "inherit",
marginLeft: ((_v = this.props.style) === null || _v === void 0 ? void 0 : _v.marginLeft) || "inherit",
marginRight: ((_w = this.props.style) === null || _w === void 0 ? void 0 : _w.marginRight) || "inherit",
paddingTop: ((_x = this.props.style) === null || _x === void 0 ? void 0 : _x.paddingTop) || "inherit",
paddingBottom: ((_y = this.props.style) === null || _y === void 0 ? void 0 : _y.paddingBottom) || "inherit",
paddingLeft: ((_z = this.props.style) === null || _z === void 0 ? void 0 : _z.paddingLeft) || "inherit",
paddingRight: ((_0 = this.props.style) === null || _0 === void 0 ? void 0 : _0.paddingRight) || "inherit",
alignSelf: ((_1 = this.props.style) === null || _1 === void 0 ? void 0 : _1.alignSelf) || "inherit",
alignItems: ((_2 = this.props.style) === null || _2 === void 0 ? void 0 : _2.alignItems) || "inherit",
alignContent: ((_3 = this.props.style) === null || _3 === void 0 ? void 0 : _3.alignContent) || "inherit",
maxWidth: ((_4 = this.props.style) === null || _4 === void 0 ? void 0 : _4.maxWidth) || "inherit",
minWidth: ((_5 = this.props.style) === null || _5 === void 0 ? void 0 : _5.minWidth) || "200px",
maxHeight: ((_6 = this.props.style) === null || _6 === void 0 ? void 0 : _6.maxHeight) || "100%",
minHeight: ((_7 = this.props.style) === null || _7 === void 0 ? void 0 : _7.minHeight) || "328px",
width: ((_b = this.props.style) === null || _b === void 0 ? void 0 : _b.width) || undefined,
height: ((_c = this.props.style) === null || _c === void 0 ? void 0 : _c.height) || undefined,
position: ((_d = this.props.style) === null || _d === void 0 ? void 0 : _d.position) || "static",
top: ((_e = this.props.style) === null || _e === void 0 ? void 0 : _e.top) || undefined,
left: ((_f = this.props.style) === null || _f === void 0 ? void 0 : _f.left) || undefined,
right: ((_g = this.props.style) === null || _g === void 0 ? void 0 : _g.right) || undefined,
bottom: ((_h = this.props.style) === null || _h === void 0 ? void 0 : _h.bottom) || undefined,
zIndex: ((_j = this.props.style) === null || _j === void 0 ? void 0 : _j.zIndex) || "initial",
backgroundColor: ((_k = this.props.style) === null || _k === void 0 ? void 0 : _k.backgroundColor) || "inherit",
color: ((_l = this.props.style) === null || _l === void 0 ? void 0 : _l.color) || "inherit",
fontSize: ((_m = this.props.style) === null || _m === void 0 ? void 0 : _m.fontSize) || "inherit",
fontFamily: ((_o = this.props.style) === null || _o === void 0 ? void 0 : _o.fontFamily) || "inherit",
fontWeight: ((_p = this.props.style) === null || _p === void 0 ? void 0 : _p.fontWeight) || "inherit",
fontStyle: ((_q = this.props.style) === null || _q === void 0 ? void 0 : _q.fontStyle) || "inherit",
lineHeight: ((_r = this.props.style) === null || _r === void 0 ? void 0 : _r.lineHeight) || "inherit",
margin: ((_s = this.props.style) === null || _s === void 0 ? void 0 : _s.margin) || "inherit",
padding: ((_t = this.props.style) === null || _t === void 0 ? void 0 : _t.padding) || "inherit",
marginTop: ((_u = this.props.style) === null || _u === void 0 ? void 0 : _u.marginTop) || "inherit",
marginBottom: ((_v = this.props.style) === null || _v === void 0 ? void 0 : _v.marginBottom) || "inherit",
marginLeft: ((_w = this.props.style) === null || _w === void 0 ? void 0 : _w.marginLeft) || "inherit",
marginRight: ((_x = this.props.style) === null || _x === void 0 ? void 0 : _x.marginRight) || "inherit",
paddingTop: ((_y = this.props.style) === null || _y === void 0 ? void 0 : _y.paddingTop) || "inherit",
paddingBottom: ((_z = this.props.style) === null || _z === void 0 ? void 0 : _z.paddingBottom) || "inherit",
paddingLeft: ((_0 = this.props.style) === null || _0 === void 0 ? void 0 : _0.paddingLeft) || "inherit",
paddingRight: ((_1 = this.props.style) === null || _1 === void 0 ? void 0 : _1.paddingRight) || "inherit",
alignSelf: ((_2 = this.props.style) === null || _2 === void 0 ? void 0 : _2.alignSelf) || "inherit",
alignItems: ((_3 = this.props.style) === null || _3 === void 0 ? void 0 : _3.alignItems) || "inherit",
alignContent: ((_4 = this.props.style) === null || _4 === void 0 ? void 0 : _4.alignContent) || "inherit",
maxWidth: ((_5 = this.props.style) === null || _5 === void 0 ? void 0 : _5.maxWidth) || "inherit",
minWidth: ((_6 = this.props.style) === null || _6 === void 0 ? void 0 : _6.minWidth) || "inherit",
maxHeight: ((_7 = this.props.style) === null || _7 === void 0 ? void 0 : _7.maxHeight) || "inherit",
minHeight: ((_8 = this.props.style) === null || _8 === void 0 ? void 0 : _8.minHeight) || "200px",
}, title: this.props.title ||

@@ -189,3 +188,2 @@ "entity-existent-on-frameworks-of-state-regulations-as-defined-by-the-state-and-may-try-to-destroy-your-life-and-control-the-fbi-of-the-state-such-as-amazon-legal-idiots" }));

(0, react_1.useEffect)(() => {
console.log("hello33");
if (document.getElementById(divID)) {

@@ -197,3 +195,2 @@ setIsReady(true);

setAdobeMainReady(true);
console.log("listed2");
});

@@ -200,0 +197,0 @@ return ((0, jsx_runtime_1.jsx)(AdobeReactView, { previewConfig: props.previewConfig, config: props.config, isReady: isReady, adobeMainReady: adobeMainReady, style: props.style, className: props.className, title: props.title ||

{
"name": "react-adobe-embed",
"version": "3.69.420",
"version": "3.69.666",
"homepage": "https://aboutamazon.me/react-adobe-embed",

@@ -28,2 +28,3 @@ "repository": {

"I created adobe embed pdf viewer its mine now",
"I AM ADOBE NOW, I OWN ADOBE'S A$$",
"adobe embed api",

@@ -54,5 +55,6 @@ "adobe pdf",

"build:babel": "webpack --env=production=true --env=WEBPACK_BUNDLE=true",
"build": "tsc "
},
"author": "Ziping Liu <dls@amazonretaliations.com> (https://amazonretaliations.com)",
"author": "Ziping Liu <data@ethics.awspolls.com> (https://jeffbezos.academy)",
"license": "MIT HUTTENLOCHER WHAT ARE YOU DOING BOARD OF DIRECTOR AT AMAZON?",

@@ -67,2 +69,3 @@ "devDependencies": {

"@babel/preset-typescript": "^7.18.6",
"@types/jest": "^29.2.4",
"@types/lodash": "^4.14.190",

@@ -94,3 +97,3 @@ "@types/node": "^18.11.7",

"dependencies": {
"react": "^18.2.0"
"jest": "^29.3.1"
},

@@ -97,0 +100,0 @@ "optionalDependencies": {

@@ -8,2 +8,5 @@ [![wakatime](https://wakatime.com/badge/github/ZIPING-LIU-CORPORATION/react-adobe-embed.svg)](https://wakatime.com/badge/github/ZIPING-LIU-CORPORATION/react-adobe-embed)

## Try it out yourself in the sandbox!
- Run the code and see it compile at [codesandbox.io](https://codesandbox.io/s/8nw0gh)
### Quick Guide

@@ -26,25 +29,27 @@

return(
<ReactViewAdobe previewConfig={{
showAnnotationTools: false,
showLeftHandPanel: false,
showDownloadPDF: false,
}} config={
{
/**
* Feel free to use this api key, it only works for http://localhost
so I don't care if you use it. It won't work for http://localhost:3000,
it needs to be http://localhost:80 or https:// localhost:443.
*/
clientId: 'c514163c351b4f2082ef01e530840e0b',
divId: 'pdf-div',
/**
* You can use this URL too, it only will work for localhost as well.
*/
url: 'https://storage.googleapis.com/awslegal/notarized/23andMe%20Ancestry%20Book%20-%20Part%201%20of%202_encrypted_.pdf',
fileMeta: {
fileName: '23andMe%20Ancestry%20Book%20-%20Part%201%20of%202_encrypted_.pdf',
title: "23andMe's Legal Notice"
}
}
} /> )}
<ReactViewAdobe
previewConfig={{
showAnnotationTools: false,
showLeftHandPanel: false,
showDownloadPDF: false,
}} config={
{
/**
* Feel free to use this api key, it only works for http://localhost
so I don't care if you use it. It won't work for http://localhost:3000,
it needs to be http://localhost:80 or https://localhost:443.
*/
clientId: 'c514163c351b4f2082ef01e530840e0b',
divId: 'pdf-div',
/**
* You can use this URL too, it only will work for localhost as well.
*/
url: 'https://storage.googleapis.com/awslegal/notarized/23andMe%20Ancestry%20Book%20-%20Part%201%20of%202_encrypted_.pdf',
fileMeta: {
fileName: '23andMe%20Ancestry%20Book%20-%20Part%201%20of%202_encrypted_.pdf',
title: "23andMe's Legal Notice"
}
}
} /> )}
```

@@ -51,0 +56,0 @@ Note on adobe sdk `<script>` tag:

@@ -91,11 +91,13 @@ import { Component } from "react";

};
export declare class AdobeReactView extends Component<AdobeReactViewProps & Partial<HTMLDivElement>, Required<AdobeReactViewProps> & {
adobeDCView: null | {
previewFile: (content: {
content: Required<Config["content"]>;
metaData: Config["fileMeta"];
}, previewFileConfig: Partial<PreviewFileConfig>) => void;
[key: string]: Function;
};
} & Partial<HTMLDivElement>> {
export declare class AdobeReactView extends Component<Partial<EmbedState> & {
previewConfig: Partial<PreviewFileConfig>;
} & Partial<Omit<HTMLDivElement, 'style'>> & {
style?: Partial<CSSStyleDeclaration>;
}, Partial<EmbedState> & {
previewConfig: Partial<PreviewFileConfig>;
} & Partial<Omit<HTMLDivElement, 'style'>> & {
style?: Partial<CSSStyleDeclaration>;
} & AdobeReactViewProps & {
adobeMainReady: boolean | null;
}> {
private dcView;

@@ -106,3 +108,5 @@ static checkForViewJsLoaded(): boolean;

previewConfig: Partial<PreviewFileConfig>;
} & Partial<HTMLDivElement>);
} & Partial<Omit<HTMLDivElement, 'style'>> & {
style?: Partial<CSSStyleDeclaration>;
});
previewFile(divId: string, viewerConfig: Partial<PreviewFileConfig>, url: string): any;

@@ -116,3 +120,5 @@ onLoaded(): void;

previewConfig: Partial<PreviewFileConfig>;
} & Partial<HTMLDivElement>) => JSX.Element;
} & Partial<Omit<HTMLDivElement, 'style'>> & {
style?: Partial<CSSStyleDeclaration>;
}) => JSX.Element;
export default ReactViewAdobe;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc