@react-pdf-viewer/properties
Advanced tools
Comparing version 3.7.0 to 3.8.0
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
var core = require('@react-pdf-viewer/core'); | ||
var React = require('react'); | ||
function _interopNamespace(e) { | ||
if (e && e.__esModule) return e; | ||
function _interopNamespaceDefault(e) { | ||
var n = Object.create(null); | ||
@@ -22,7 +19,7 @@ if (e) { | ||
} | ||
n["default"] = e; | ||
n.default = e; | ||
return Object.freeze(n); | ||
} | ||
var React__namespace = /*#__PURE__*/_interopNamespace(React); | ||
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React); | ||
@@ -29,0 +26,0 @@ var InfoIcon = function () { return (React__namespace.createElement(core.Icon, { size: 16 }, |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@react-pdf-viewer/core");function t(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var r=t(require("react")),n=function(){return r.createElement(e.Icon,{size:16},r.createElement("path",{d:"M12,1.001c6.075,0,11,4.925,11,11s-4.925,11-11,11s-11-4.925-11-11S5.925,1.001,12,1.001z\n M14.5,17.005H13\n c-0.552,0-1-0.448-1-1v-6.5c0-0.276-0.224-0.5-0.5-0.5H10\n M11.745,6.504L11.745,6.504\n M11.745,6.5c-0.138,0-0.25,0.112-0.25,0.25\n S11.607,7,11.745,7s0.25-0.112,0.25-0.25S11.883,6.5,11.745,6.5"}))},o=function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o.apply(this,arguments)},a=function(t){var n=t.doc,o=t.render,a=r.useState(),i=a[0],l=a[1];return r.useEffect((function(){n.getMetadata().then((function(e){return Promise.resolve(e)})).then((function(e){return n.getDownloadInfo().then((function(t){return Promise.resolve({fileName:e.contentDispositionFilename||"",info:e.info,length:t.length})}))})).then((function(e){l(e)}))}),[]),i?o(i):r.createElement("div",{className:"rpv-properties__loader"},r.createElement(e.Spinner,null))},i=function(t){var n=t.label,o=t.value,a=r.useContext(e.ThemeContext).direction===e.TextDirection.RightToLeft;return r.createElement("dl",{className:e.classNames({"rpv-properties__item":!0,"rpv-properties__item--rtl":a})},r.createElement("dt",{className:"rpv-properties__item-label"},n,":"),r.createElement("dd",{className:"rpv-properties__item-value"},o||"-"))},l=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"),c=function(e,t,r,n){var o=parseInt(e,10);return o>=t&&o<=r?o:n},s=function(t){var n=t.doc,o=t.fileName,s=t.onToggle,p=r.useContext(e.LocalizationContext).l10n,u=function(e){var t=function(e){var t=l.exec(e);if(!t)return null;var r=parseInt(t[1],10),n=c(t[2],1,12,1)-1,o=c(t[3],1,31,1),a=c(t[4],0,23,0),i=c(t[5],0,59,0),s=c(t[6],0,59,0),p=t[7]||"Z",u=c(t[8],0,23,0),f=c(t[9],0,59,0);switch(p){case"-":a+=u,i+=f;break;case"+":a-=u,i-=f}return new Date(Date.UTC(r,n,o,a,i,s))}(e);return t?"".concat(t.toLocaleDateString(),", ").concat(t.toLocaleTimeString()):""};return r.createElement("div",{className:"rpv-properties__modal"},r.createElement(a,{doc:n,render:function(t){return r.createElement(r.Fragment,null,r.createElement("div",{className:"rpv-properties__modal-section"},r.createElement(i,{label:p&&p.properties?p.properties.fileName:"File name",value:t.fileName||(c=o,s=c.split("/").pop(),s?s.split("#")[0].split("?")[0]:c)}),r.createElement(i,{label:p&&p.properties?p.properties.fileSize:"File size",value:(a=t.length,l=Math.floor(Math.log(a)/Math.log(1024)),"".concat((a/Math.pow(1024,l)).toFixed(2)," ").concat(["B","kB","MB","GB","TB"][l]))})),r.createElement(e.Separator,null),r.createElement("div",{className:"rpv-properties__modal-section"},r.createElement(i,{label:p&&p.properties?p.properties.title:"Title",value:t.info.Title}),r.createElement(i,{label:p&&p.properties?p.properties.author:"Author",value:t.info.Author}),r.createElement(i,{label:p&&p.properties?p.properties.subject:"Subject",value:t.info.Subject}),r.createElement(i,{label:p&&p.properties?p.properties.keywords:"Keywords",value:t.info.Keywords}),r.createElement(i,{label:p&&p.properties?p.properties.creator:"Creator",value:t.info.Creator}),r.createElement(i,{label:p&&p.properties?p.properties.creationDate:"Creation date",value:u(t.info.CreationDate)}),r.createElement(i,{label:p&&p.properties?p.properties.modificationDate:"Modification date",value:u(t.info.ModDate)})),r.createElement(e.Separator,null),r.createElement("div",{className:"rpv-properties__modal-section"},r.createElement(i,{label:p&&p.properties?p.properties.pdfProducer:"PDF producer",value:t.info.Producer}),r.createElement(i,{label:p&&p.properties?p.properties.pdfVersion:"PDF version",value:t.info.PDFFormatVersion}),r.createElement(i,{label:p&&p.properties?p.properties.pageCount:"Page count",value:"".concat(n.numPages)})));var a,l,c,s}}),r.createElement("div",{className:"rpv-properties__modal-footer"},r.createElement(e.Button,{onClick:s},p&&p.properties?p.properties.close:"Close")))},p={left:0,top:8},u=function(t){var o=t.onClick,a=r.useContext(e.LocalizationContext).l10n,i=a&&a.properties?a.properties.showProperties:"Show properties";return r.createElement(e.Tooltip,{ariaControlsSuffix:"properties",position:e.Position.BottomCenter,target:r.createElement(e.MinimalButton,{ariaLabel:i,testId:"properties__button",onClick:o},r.createElement(n,null)),content:function(){return i},offset:p})},f=function(t){var n=t.children,a=t.store,i=function(e){var t=r.useState(e.get("doc")),n=t[0],o=t[1],a=function(e){o(e)};return r.useEffect((function(){return e.subscribe("doc",a),function(){e.unsubscribe("doc",a)}}),[]),{currentDoc:n}}(a).currentDoc,l=a.get("fileName")||"",c=n||function(e){return r.createElement(u,o({},e))};return i?r.createElement(e.Modal,{ariaControlsSuffix:"properties",target:function(e){return c({onClick:e})},content:function(e){return r.createElement(s,{doc:i,fileName:l,onToggle:e})},closeOnClickOutside:!0,closeOnEscape:!0}):r.createElement(r.Fragment,null)},m=function(t){var o=t.onClick,a=r.useContext(e.LocalizationContext).l10n,i=a&&a.properties?a.properties.showProperties:"Show properties";return r.createElement(e.MenuItem,{icon:r.createElement(n,null),testId:"properties__menu",onClick:o},i)};exports.InfoIcon=n,exports.propertiesPlugin=function(){var t=r.useMemo((function(){return e.createStore({fileName:""})}),[]),n=function(e){return r.createElement(f,o({},e,{store:t}))};return{onDocumentLoad:function(e){t.update("doc",e.doc)},onViewerStateChange:function(e){return t.update("fileName",e.file.name),e},ShowProperties:n,ShowPropertiesButton:function(){return r.createElement(f,{store:t})},ShowPropertiesMenuItem:function(e){return r.createElement(n,null,(function(e){return r.createElement(m,o({},e))}))}}}; | ||
"use strict";var e=require("@react-pdf-viewer/core");function t(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var r=t(require("react")),n=function(){return r.createElement(e.Icon,{size:16},r.createElement("path",{d:"M12,1.001c6.075,0,11,4.925,11,11s-4.925,11-11,11s-11-4.925-11-11S5.925,1.001,12,1.001z\n M14.5,17.005H13\n c-0.552,0-1-0.448-1-1v-6.5c0-0.276-0.224-0.5-0.5-0.5H10\n M11.745,6.504L11.745,6.504\n M11.745,6.5c-0.138,0-0.25,0.112-0.25,0.25\n S11.607,7,11.745,7s0.25-0.112,0.25-0.25S11.883,6.5,11.745,6.5"}))},o=function(){return o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o.apply(this,arguments)},a=function(t){var n=t.doc,o=t.render,a=r.useState(),i=a[0],l=a[1];return r.useEffect((function(){n.getMetadata().then((function(e){return Promise.resolve(e)})).then((function(e){return n.getDownloadInfo().then((function(t){return Promise.resolve({fileName:e.contentDispositionFilename||"",info:e.info,length:t.length})}))})).then((function(e){l(e)}))}),[]),i?o(i):r.createElement("div",{className:"rpv-properties__loader"},r.createElement(e.Spinner,null))},i=function(t){var n=t.label,o=t.value,a=r.useContext(e.ThemeContext).direction===e.TextDirection.RightToLeft;return r.createElement("dl",{className:e.classNames({"rpv-properties__item":!0,"rpv-properties__item--rtl":a})},r.createElement("dt",{className:"rpv-properties__item-label"},n,":"),r.createElement("dd",{className:"rpv-properties__item-value"},o||"-"))},l=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"),c=function(e,t,r,n){var o=parseInt(e,10);return o>=t&&o<=r?o:n},p=function(t){var n=t.doc,o=t.fileName,p=t.onToggle,s=r.useContext(e.LocalizationContext).l10n,u=function(e){var t=function(e){var t=l.exec(e);if(!t)return null;var r=parseInt(t[1],10),n=c(t[2],1,12,1)-1,o=c(t[3],1,31,1),a=c(t[4],0,23,0),i=c(t[5],0,59,0),p=c(t[6],0,59,0),s=t[7]||"Z",u=c(t[8],0,23,0),m=c(t[9],0,59,0);switch(s){case"-":a+=u,i+=m;break;case"+":a-=u,i-=m}return new Date(Date.UTC(r,n,o,a,i,p))}(e);return t?"".concat(t.toLocaleDateString(),", ").concat(t.toLocaleTimeString()):""};return r.createElement("div",{className:"rpv-properties__modal"},r.createElement(a,{doc:n,render:function(t){return r.createElement(r.Fragment,null,r.createElement("div",{className:"rpv-properties__modal-section"},r.createElement(i,{label:s&&s.properties?s.properties.fileName:"File name",value:t.fileName||(c=o,p=c.split("/").pop(),p?p.split("#")[0].split("?")[0]:c)}),r.createElement(i,{label:s&&s.properties?s.properties.fileSize:"File size",value:(a=t.length,l=Math.floor(Math.log(a)/Math.log(1024)),"".concat((a/Math.pow(1024,l)).toFixed(2)," ").concat(["B","kB","MB","GB","TB"][l]))})),r.createElement(e.Separator,null),r.createElement("div",{className:"rpv-properties__modal-section"},r.createElement(i,{label:s&&s.properties?s.properties.title:"Title",value:t.info.Title}),r.createElement(i,{label:s&&s.properties?s.properties.author:"Author",value:t.info.Author}),r.createElement(i,{label:s&&s.properties?s.properties.subject:"Subject",value:t.info.Subject}),r.createElement(i,{label:s&&s.properties?s.properties.keywords:"Keywords",value:t.info.Keywords}),r.createElement(i,{label:s&&s.properties?s.properties.creator:"Creator",value:t.info.Creator}),r.createElement(i,{label:s&&s.properties?s.properties.creationDate:"Creation date",value:u(t.info.CreationDate)}),r.createElement(i,{label:s&&s.properties?s.properties.modificationDate:"Modification date",value:u(t.info.ModDate)})),r.createElement(e.Separator,null),r.createElement("div",{className:"rpv-properties__modal-section"},r.createElement(i,{label:s&&s.properties?s.properties.pdfProducer:"PDF producer",value:t.info.Producer}),r.createElement(i,{label:s&&s.properties?s.properties.pdfVersion:"PDF version",value:t.info.PDFFormatVersion}),r.createElement(i,{label:s&&s.properties?s.properties.pageCount:"Page count",value:"".concat(n.numPages)})));var a,l,c,p}}),r.createElement("div",{className:"rpv-properties__modal-footer"},r.createElement(e.Button,{onClick:p},s&&s.properties?s.properties.close:"Close")))},s={left:0,top:8},u=function(t){var o=t.onClick,a=r.useContext(e.LocalizationContext).l10n,i=a&&a.properties?a.properties.showProperties:"Show properties";return r.createElement(e.Tooltip,{ariaControlsSuffix:"properties",position:e.Position.BottomCenter,target:r.createElement(e.MinimalButton,{ariaLabel:i,testId:"properties__button",onClick:o},r.createElement(n,null)),content:function(){return i},offset:s})},m=function(t){var n=t.children,a=t.store,i=function(e){var t=r.useState(e.get("doc")),n=t[0],o=t[1],a=function(e){o(e)};return r.useEffect((function(){return e.subscribe("doc",a),function(){e.unsubscribe("doc",a)}}),[]),{currentDoc:n}}(a).currentDoc,l=a.get("fileName")||"",c=n||function(e){return r.createElement(u,o({},e))};return i?r.createElement(e.Modal,{ariaControlsSuffix:"properties",target:function(e){return c({onClick:e})},content:function(e){return r.createElement(p,{doc:i,fileName:l,onToggle:e})},closeOnClickOutside:!0,closeOnEscape:!0}):r.createElement(r.Fragment,null)},f=function(t){var o=t.onClick,a=r.useContext(e.LocalizationContext).l10n,i=a&&a.properties?a.properties.showProperties:"Show properties";return r.createElement(e.MenuItem,{icon:r.createElement(n,null),testId:"properties__menu",onClick:o},i)};exports.InfoIcon=n,exports.propertiesPlugin=function(){var t=r.useMemo((function(){return e.createStore({fileName:""})}),[]),n=function(e){return r.createElement(m,o({},e,{store:t}))};return{onDocumentLoad:function(e){t.update("doc",e.doc)},onViewerStateChange:function(e){return t.update("fileName",e.file.name),e},ShowProperties:n,ShowPropertiesButton:function(){return r.createElement(m,{store:t})},ShowPropertiesMenuItem:function(e){return r.createElement(n,null,(function(e){return r.createElement(f,o({},e))}))}}}; |
{ | ||
"name": "@react-pdf-viewer/properties", | ||
"version": "3.7.0", | ||
"version": "3.8.0", | ||
"description": "A React component to view a PDF document", | ||
@@ -36,3 +36,3 @@ "license": "https://react-pdf-viewer.dev/license", | ||
"dependencies": { | ||
"@react-pdf-viewer/core": "3.7.0" | ||
"@react-pdf-viewer/core": "3.8.0" | ||
}, | ||
@@ -49,6 +49,6 @@ "peerDependencies": { | ||
"build": "npm run clean && npm run js && npm run css", | ||
"js": "cp src/index.d.ts lib && cp dist/index.js lib && rollup -c ../../rollup.config.js", | ||
"css": "sass --no-source-map src/styles/index.scss lib/styles/index.temp.css && postcss lib/styles/index.temp.css > lib/styles/index.css && rm -rf lib/styles/index.temp.css" | ||
"js": "cp src/index.d.ts lib && cp dist/index.js lib && rollup -c ../../rollup.config.cjs", | ||
"css": "sass --no-source-map --style compressed src/styles/index.scss lib/styles/index.css" | ||
}, | ||
"gitHead": "ccba5d4f68fa44ca7c242837280fcebf92b4f6a6" | ||
"gitHead": "62b141a0ceb569147ca765ab6bbff76c5e480bf8" | ||
} |
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
22404
307
+ Added@mapbox/node-pre-gyp@1.0.11(transitive)
+ Added@react-pdf-viewer/core@3.8.0(transitive)
+ Addedabbrev@1.1.1(transitive)
+ Addedagent-base@6.0.2(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedaproba@2.0.0(transitive)
+ Addedare-we-there-yet@2.0.0(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedcanvas@2.11.2(transitive)
+ Addedchownr@2.0.0(transitive)
+ Addedcolor-support@1.1.3(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedconsole-control-strings@1.1.0(transitive)
+ Addeddebug@4.3.7(transitive)
+ Addeddecompress-response@4.2.1(transitive)
+ Addeddelegates@1.0.0(transitive)
+ Addeddetect-libc@2.0.3(transitive)
+ Addedemoji-regex@8.0.0(transitive)
+ Addedfs-minipass@2.1.0(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedgauge@3.0.2(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedhas-unicode@2.0.1(transitive)
+ Addedhttps-proxy-agent@5.0.1(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedmake-dir@3.1.0(transitive)
+ Addedmimic-response@2.1.0(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedminipass@3.3.65.0.0(transitive)
+ Addedminizlib@2.1.2(transitive)
+ Addedmkdirp@1.0.4(transitive)
+ Addedms@2.1.3(transitive)
+ Addednan@2.22.0(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addednopt@5.0.0(transitive)
+ Addednpmlog@5.0.1(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedpath2d@0.1.1(transitive)
+ Addedpath2d-polyfill@2.1.1(transitive)
+ Addedpdfjs-dist@3.11.174(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedrimraf@3.0.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsemver@6.3.17.6.3(transitive)
+ Addedset-blocking@2.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedsimple-concat@1.0.1(transitive)
+ Addedsimple-get@3.1.1(transitive)
+ Addedstring-width@4.2.3(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedtar@6.2.1(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
+ Addedwide-align@1.1.5(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedyallist@4.0.0(transitive)
- Removed@react-pdf-viewer/core@3.7.0(transitive)
- Removeddommatrix@1.0.3(transitive)
- Removedpdfjs-dist@2.16.105(transitive)
- Removedweb-streams-polyfill@3.3.3(transitive)
Updated@react-pdf-viewer/core@3.8.0