@vivliostyle/react
Advanced tools
Comparing version 2.1.3 to 2.1.4
@@ -6,2 +6,8 @@ # Change Log | ||
## [2.1.4](https://github.com/vivliostyle/vivliostyle.js/compare/v2.1.3...v2.1.4) (2020-10-30) | ||
### Bug Fixes | ||
- negative z-index on `[@page](https://github.com/page) {...}` causes page (margin-box) content to disappear ([000eed6](https://github.com/vivliostyle/vivliostyle.js/commit/000eed65c2527216f0be85433e6ccbfa7f4a07a9)), closes [#665](https://github.com/vivliostyle/vivliostyle.js/issues/665) | ||
## [2.1.3](https://github.com/vivliostyle/vivliostyle.js/compare/v2.1.2...v2.1.3) (2020-09-30) | ||
@@ -8,0 +14,0 @@ |
@@ -1,2 +0,2 @@ | ||
function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var n=e(require("@emotion/styled")),t=require("@vivliostyle/core"),o=require("react"),i=e(o);function r(){return(r=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e}).apply(this,arguments)}function a(){var e,n,t=(e=["\n overflow: scroll;\n background: ",';\n\n @media screen {\n [data-vivliostyle-page-container] {\n background: white;\n }\n\n [data-vivliostyle-viewer-viewport] {\n display: flex;\n overflow: auto;\n position: relative;\n }\n\n [data-vivliostyle-outer-zoom-box] {\n margin: auto;\n overflow: hidden;\n flex: none;\n }\n\n [data-vivliostyle-viewer-viewport] [data-vivliostyle-spread-container] {\n display: flex;\n flex: none;\n justify-content: center;\n transform-origin: left top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-page-progression="ltr"]\n [data-vivliostyle-spread-container] {\n flex-direction: row;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-page-progression="rtl"]\n [data-vivliostyle-spread-container] {\n flex-direction: row-reverse;\n }\n\n [data-vivliostyle-viewer-viewport] [data-vivliostyle-page-container] {\n margin: 0 auto;\n flex: none;\n transform-origin: center top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-spread-view="true"]\n [data-vivliostyle-page-container][data-vivliostyle-page-side="left"] {\n margin-right: 1px;\n transform-origin: right top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-spread-view="true"]\n [data-vivliostyle-page-container][data-vivliostyle-page-side="right"] {\n margin-left: 1px;\n transform-origin: left top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-spread-view="true"]\n [data-vivliostyle-page-container][data-vivliostyle-unpaired-page="true"] {\n margin-left: auto;\n margin-right: auto;\n transform-origin: center top;\n }\n }\n\n /* vivliostyle-viewport */\n [data-vivliostyle-layout-box] {\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n z-index: -1;\n }\n\n [data-vivliostyle-debug] [data-vivliostyle-layout-box] {\n right: auto;\n bottom: auto;\n overflow: visible;\n z-index: auto;\n }\n\n [data-vivliostyle-page-container] {\n position: relative;\n overflow: hidden;\n }\n\n [data-vivliostyle-bleed-box] {\n position: absolute;\n overflow: hidden;\n max-width: 100%;\n max-height: 100%;\n box-sizing: border-box;\n }\n\n [data-vivliostyle-page-box] ~ [data-vivliostyle-page-box] {\n display: none;\n }\n\n [data-vivliostyle-toc-box] {\n position: absolute;\n left: 3px;\n top: 3px;\n overflow: scroll;\n overflow-x: hidden;\n background: rgba(248, 248, 248, 0.9);\n border-radius: 2px;\n box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);\n }\n\n @media print {\n [data-vivliostyle-toc-box] {\n display: none;\n }\n\n [data-vivliostyle-outer-zoom-box],\n [data-vivliostyle-spread-container] {\n width: 100% !important;\n height: 100% !important;\n }\n\n [data-vivliostyle-spread-container],\n [data-vivliostyle-page-container] {\n -moz-transform: none !important;\n -ms-transform: none !important;\n -webkit-transform: none !important;\n transform: none !important;\n }\n\n [data-vivliostyle-page-container] {\n display: block !important;\n max-width: 100%;\n height: 100% !important;\n max-height: 100%;\n }\n\n /* Workaround for Chrome printing problem */\n /* [data-vivliostyle-page-box] {\n padding-bottom: 0 !important;\n overflow: visible !important;\n } */\n [data-vivliostyle-bleed-box] > div > div::before {\n display: block;\n content: "";\n padding-top: 0.015625px;\n margin-bottom: -0.015625px;\n }\n\n /* Gecko-only hack, see https://bugzilla.mozilla.org/show_bug.cgi?id=267029#c17 */\n @-moz-document regexp(\'.*\') {\n [data-vivliostyle-page-container]:nth-last-child(n + 2) {\n top: -1px;\n margin-top: 1px;\n margin-bottom: -1px;\n }\n }\n }\n'],n||(n=e.slice(0)),e.raw=n,e);return a=function(){return t},t}var l=n.div(a(),function(e){return e.background});exports.Renderer=function(e){var n=e.source,a=e.page,d=void 0===a?1:a,v=e.zoom,s=void 0===v?1:v,u=e.fontSize,p=void 0===u?16:u,c=e.background,g=void 0===c?"#ececec":c,f=e.renderAllPages,y=void 0===f||f,m=e.autoResize,b=void 0===m||m,h=e.pageViewMode,w=void 0===h?t.PageViewMode.SINGLE_PAGE:h,x=e.defaultPaperSize,z=e.pageBorderWidth,S=void 0===z?1:z,L=e.fitToScreen,k=void 0!==L&&L,P=e.userStyleSheet,E=e.authorStyleSheet,R=e.style,T=e.onMessage,W=e.onError,A=e.onReadyStateChange,M=e.onLoad,j=e.onNavigation,C=e.onHyperlink,G=e.children,O=o.useRef(null),V=o.useRef(),N=i.useRef();function q(){V.current.setOptions({fontSize:p,pageViewMode:w,zoom:s,renderAllPages:y,autoResize:b,defaultPaperSize:x,pageBorderWidth:S,fitToScreen:k})}function B(){var e,t,o=V.current,i=n.endsWith(".json"),a=r({},P?{userStyleSheet:[(e={},e[P.endsWith(".css")?"url":"text"]=P,e)]}:null,E?{authorStyleSheet:[(t={},t[E.endsWith(".css")?"url":"text"]=E,t)]}:null);i?o.loadPublication(n,a):o.loadDocument({url:n,startPage:d},a,{fontSize:p,pageViewMode:w,zoom:1,renderAllPages:y,autoResize:b,defaultPaperSize:x,pageBorderWidth:S,fitToScreen:!1})}o.useEffect(function(){return V.current=new t.CoreViewer({viewportElement:O.current}),q(),B(),function(){function e(e,n){T&&T(e.content,n)}var n=function(n){return e(n,"debug")},o=function(n){return e(n,"info")},i=function(n){return e(n,"warn")};function r(e){W&&W(e.content)}function a(){A&&A(V.current.readyState)}function l(){M&&M(N.current)}function d(e){var n={docTitle:e.docTitle,epageCount:e.epageCount,epage:e.epage,metadata:e.metadata};N.current=n,j&&j(n)}function v(e){C&&C(e)}var s=V.current;return s.addListener("debug",n),s.addListener("info",o),s.addListener("warn",i),s.addListener("error",r),s.addListener("readystatechange",a),s.addListener("loaded",l),s.addListener("nav",d),s.addListener("hyperlink",v),function(){A&&A(t.ReadyState.LOADING),s.removeListener("debug",n),s.removeListener("info",o),s.removeListener("warn",i),s.removeListener("error",r),s.removeListener("readystatechange",a),s.removeListener("loaded",l),s.removeListener("nav",d),s.removeListener("hyperlink",v),O.current.innerHTML=""}}()},[n,E,P]),o.useEffect(function(){q()},[p,w,s,y,b,x,S,k]),o.useEffect(function(){var e;null===(e=V.current)||void 0===e||e.navigateToPage(t.Navigation.EPAGE,d-1)},[d]);var D=i.createElement(l,{ref:O,style:R,background:g});return"function"==typeof G&&G instanceof Function?G({container:D,reload:B}):D}; | ||
function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var n=e(require("@emotion/styled")),t=require("@vivliostyle/core"),o=require("react"),i=e(o);function r(){return(r=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e}).apply(this,arguments)}function a(){var e,n,t=(e=["\n overflow: scroll;\n background: ",';\n\n @media screen {\n [data-vivliostyle-page-container] {\n background: white;\n z-index: 0;\n }\n\n [data-vivliostyle-viewer-viewport] {\n display: flex;\n overflow: auto;\n position: relative;\n }\n\n [data-vivliostyle-outer-zoom-box] {\n margin: auto;\n overflow: hidden;\n flex: none;\n }\n\n [data-vivliostyle-viewer-viewport] [data-vivliostyle-spread-container] {\n display: flex;\n flex: none;\n justify-content: center;\n transform-origin: left top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-page-progression="ltr"]\n [data-vivliostyle-spread-container] {\n flex-direction: row;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-page-progression="rtl"]\n [data-vivliostyle-spread-container] {\n flex-direction: row-reverse;\n }\n\n [data-vivliostyle-viewer-viewport] [data-vivliostyle-page-container] {\n margin: 0 auto;\n flex: none;\n transform-origin: center top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-spread-view="true"]\n [data-vivliostyle-page-container][data-vivliostyle-page-side="left"] {\n margin-right: 1px;\n transform-origin: right top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-spread-view="true"]\n [data-vivliostyle-page-container][data-vivliostyle-page-side="right"] {\n margin-left: 1px;\n transform-origin: left top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-spread-view="true"]\n [data-vivliostyle-page-container][data-vivliostyle-unpaired-page="true"] {\n margin-left: auto;\n margin-right: auto;\n transform-origin: center top;\n }\n }\n\n /* vivliostyle-viewport */\n [data-vivliostyle-layout-box] {\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n z-index: -1;\n }\n\n [data-vivliostyle-debug] [data-vivliostyle-layout-box] {\n right: auto;\n bottom: auto;\n overflow: visible;\n z-index: auto;\n }\n\n [data-vivliostyle-page-container] {\n position: relative;\n overflow: hidden;\n }\n\n [data-vivliostyle-bleed-box] {\n position: absolute;\n overflow: hidden;\n max-width: 100%;\n max-height: 100%;\n box-sizing: border-box;\n }\n\n [data-vivliostyle-page-box] ~ [data-vivliostyle-page-box] {\n display: none;\n }\n\n [data-vivliostyle-toc-box] {\n position: absolute;\n left: 3px;\n top: 3px;\n overflow: scroll;\n overflow-x: hidden;\n background: rgba(248, 248, 248, 0.9);\n border-radius: 2px;\n box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);\n }\n\n @media print {\n [data-vivliostyle-toc-box] {\n display: none;\n }\n\n [data-vivliostyle-outer-zoom-box],\n [data-vivliostyle-spread-container] {\n width: 100% !important;\n height: 100% !important;\n }\n\n [data-vivliostyle-spread-container],\n [data-vivliostyle-page-container] {\n -moz-transform: none !important;\n -ms-transform: none !important;\n -webkit-transform: none !important;\n transform: none !important;\n }\n\n [data-vivliostyle-page-container] {\n display: block !important;\n max-width: 100%;\n height: 100% !important;\n max-height: 100%;\n }\n\n /* Workaround for Chrome printing problem */\n /* [data-vivliostyle-page-box] {\n padding-bottom: 0 !important;\n overflow: visible !important;\n } */\n [data-vivliostyle-bleed-box] > div > div::before {\n display: block;\n content: "";\n padding-top: 0.015625px;\n margin-bottom: -0.015625px;\n }\n\n /* Gecko-only hack, see https://bugzilla.mozilla.org/show_bug.cgi?id=267029#c17 */\n @-moz-document regexp(\'.*\') {\n [data-vivliostyle-page-container]:nth-last-child(n + 2) {\n top: -1px;\n margin-top: 1px;\n margin-bottom: -1px;\n }\n }\n }\n'],n||(n=e.slice(0)),e.raw=n,e);return a=function(){return t},t}var l=n.div(a(),function(e){return e.background});exports.Renderer=function(e){var n=e.source,a=e.page,d=void 0===a?1:a,v=e.zoom,s=void 0===v?1:v,u=e.fontSize,p=void 0===u?16:u,c=e.background,g=void 0===c?"#ececec":c,f=e.renderAllPages,y=void 0===f||f,m=e.autoResize,b=void 0===m||m,h=e.pageViewMode,w=void 0===h?t.PageViewMode.SINGLE_PAGE:h,x=e.defaultPaperSize,z=e.pageBorderWidth,S=void 0===z?1:z,L=e.fitToScreen,k=void 0!==L&&L,P=e.userStyleSheet,E=e.authorStyleSheet,R=e.style,T=e.onMessage,W=e.onError,A=e.onReadyStateChange,M=e.onLoad,j=e.onNavigation,C=e.onHyperlink,G=e.children,O=o.useRef(null),V=o.useRef(),N=i.useRef();function q(){V.current.setOptions({fontSize:p,pageViewMode:w,zoom:s,renderAllPages:y,autoResize:b,defaultPaperSize:x,pageBorderWidth:S,fitToScreen:k})}function B(){var e,t,o=V.current,i=n.endsWith(".json"),a=r({},P?{userStyleSheet:[(e={},e[P.endsWith(".css")?"url":"text"]=P,e)]}:null,E?{authorStyleSheet:[(t={},t[E.endsWith(".css")?"url":"text"]=E,t)]}:null);i?o.loadPublication(n,a):o.loadDocument({url:n,startPage:d},a,{fontSize:p,pageViewMode:w,zoom:1,renderAllPages:y,autoResize:b,defaultPaperSize:x,pageBorderWidth:S,fitToScreen:!1})}o.useEffect(function(){return V.current=new t.CoreViewer({viewportElement:O.current}),q(),B(),function(){function e(e,n){T&&T(e.content,n)}var n=function(n){return e(n,"debug")},o=function(n){return e(n,"info")},i=function(n){return e(n,"warn")};function r(e){W&&W(e.content)}function a(){A&&A(V.current.readyState)}function l(){M&&M(N.current)}function d(e){var n={docTitle:e.docTitle,epageCount:e.epageCount,epage:e.epage,metadata:e.metadata};N.current=n,j&&j(n)}function v(e){C&&C(e)}var s=V.current;return s.addListener("debug",n),s.addListener("info",o),s.addListener("warn",i),s.addListener("error",r),s.addListener("readystatechange",a),s.addListener("loaded",l),s.addListener("nav",d),s.addListener("hyperlink",v),function(){A&&A(t.ReadyState.LOADING),s.removeListener("debug",n),s.removeListener("info",o),s.removeListener("warn",i),s.removeListener("error",r),s.removeListener("readystatechange",a),s.removeListener("loaded",l),s.removeListener("nav",d),s.removeListener("hyperlink",v),O.current.innerHTML=""}}()},[n,E,P]),o.useEffect(function(){q()},[p,w,s,y,b,x,S,k]),o.useEffect(function(){var e;null===(e=V.current)||void 0===e||e.navigateToPage(t.Navigation.EPAGE,d-1)},[d]);var D=i.createElement(l,{ref:O,style:R,background:g});return"function"==typeof G&&G instanceof Function?G({container:D,reload:B}):D}; | ||
//# sourceMappingURL=react-vivliostyle.js.map |
@@ -1,2 +0,2 @@ | ||
import n from"@emotion/styled";import{ReadyState as e,Navigation as t,PageViewMode as o,CoreViewer as i}from"@vivliostyle/core";import r,{useRef as a,useEffect as l}from"react";function d(){return(d=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}return n}).apply(this,arguments)}function v(){var n,e,t=(n=["\n overflow: scroll;\n background: ",';\n\n @media screen {\n [data-vivliostyle-page-container] {\n background: white;\n }\n\n [data-vivliostyle-viewer-viewport] {\n display: flex;\n overflow: auto;\n position: relative;\n }\n\n [data-vivliostyle-outer-zoom-box] {\n margin: auto;\n overflow: hidden;\n flex: none;\n }\n\n [data-vivliostyle-viewer-viewport] [data-vivliostyle-spread-container] {\n display: flex;\n flex: none;\n justify-content: center;\n transform-origin: left top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-page-progression="ltr"]\n [data-vivliostyle-spread-container] {\n flex-direction: row;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-page-progression="rtl"]\n [data-vivliostyle-spread-container] {\n flex-direction: row-reverse;\n }\n\n [data-vivliostyle-viewer-viewport] [data-vivliostyle-page-container] {\n margin: 0 auto;\n flex: none;\n transform-origin: center top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-spread-view="true"]\n [data-vivliostyle-page-container][data-vivliostyle-page-side="left"] {\n margin-right: 1px;\n transform-origin: right top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-spread-view="true"]\n [data-vivliostyle-page-container][data-vivliostyle-page-side="right"] {\n margin-left: 1px;\n transform-origin: left top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-spread-view="true"]\n [data-vivliostyle-page-container][data-vivliostyle-unpaired-page="true"] {\n margin-left: auto;\n margin-right: auto;\n transform-origin: center top;\n }\n }\n\n /* vivliostyle-viewport */\n [data-vivliostyle-layout-box] {\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n z-index: -1;\n }\n\n [data-vivliostyle-debug] [data-vivliostyle-layout-box] {\n right: auto;\n bottom: auto;\n overflow: visible;\n z-index: auto;\n }\n\n [data-vivliostyle-page-container] {\n position: relative;\n overflow: hidden;\n }\n\n [data-vivliostyle-bleed-box] {\n position: absolute;\n overflow: hidden;\n max-width: 100%;\n max-height: 100%;\n box-sizing: border-box;\n }\n\n [data-vivliostyle-page-box] ~ [data-vivliostyle-page-box] {\n display: none;\n }\n\n [data-vivliostyle-toc-box] {\n position: absolute;\n left: 3px;\n top: 3px;\n overflow: scroll;\n overflow-x: hidden;\n background: rgba(248, 248, 248, 0.9);\n border-radius: 2px;\n box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);\n }\n\n @media print {\n [data-vivliostyle-toc-box] {\n display: none;\n }\n\n [data-vivliostyle-outer-zoom-box],\n [data-vivliostyle-spread-container] {\n width: 100% !important;\n height: 100% !important;\n }\n\n [data-vivliostyle-spread-container],\n [data-vivliostyle-page-container] {\n -moz-transform: none !important;\n -ms-transform: none !important;\n -webkit-transform: none !important;\n transform: none !important;\n }\n\n [data-vivliostyle-page-container] {\n display: block !important;\n max-width: 100%;\n height: 100% !important;\n max-height: 100%;\n }\n\n /* Workaround for Chrome printing problem */\n /* [data-vivliostyle-page-box] {\n padding-bottom: 0 !important;\n overflow: visible !important;\n } */\n [data-vivliostyle-bleed-box] > div > div::before {\n display: block;\n content: "";\n padding-top: 0.015625px;\n margin-bottom: -0.015625px;\n }\n\n /* Gecko-only hack, see https://bugzilla.mozilla.org/show_bug.cgi?id=267029#c17 */\n @-moz-document regexp(\'.*\') {\n [data-vivliostyle-page-container]:nth-last-child(n + 2) {\n top: -1px;\n margin-top: 1px;\n margin-bottom: -1px;\n }\n }\n }\n'],e||(e=n.slice(0)),n.raw=e,n);return v=function(){return t},t}var s=function(n){var v=n.source,s=n.page,u=void 0===s?1:s,c=n.zoom,g=void 0===c?1:c,f=n.fontSize,y=void 0===f?16:f,m=n.background,h=void 0===m?"#ececec":m,b=n.renderAllPages,w=void 0===b||b,x=n.autoResize,z=void 0===x||x,L=n.pageViewMode,S=void 0===L?o.SINGLE_PAGE:L,k=n.defaultPaperSize,P=n.pageBorderWidth,E=void 0===P?1:P,T=n.fitToScreen,W=void 0!==T&&T,A=n.userStyleSheet,G=n.authorStyleSheet,M=n.style,O=n.onMessage,R=n.onError,j=n.onReadyStateChange,C=n.onLoad,B=n.onNavigation,N=n.onHyperlink,V=n.children,D=a(null),H=a(),I=r.useRef();function _(){H.current.setOptions({fontSize:y,pageViewMode:S,zoom:g,renderAllPages:w,autoResize:z,defaultPaperSize:k,pageBorderWidth:E,fitToScreen:W})}function F(){var n,e,t=H.current,o=v.endsWith(".json"),i=d({},A?{userStyleSheet:[(n={},n[A.endsWith(".css")?"url":"text"]=A,n)]}:null,G?{authorStyleSheet:[(e={},e[G.endsWith(".css")?"url":"text"]=G,e)]}:null);o?t.loadPublication(v,i):t.loadDocument({url:v,startPage:u},i,{fontSize:y,pageViewMode:S,zoom:1,renderAllPages:w,autoResize:z,defaultPaperSize:k,pageBorderWidth:E,fitToScreen:!1})}l(function(){return H.current=new i({viewportElement:D.current}),_(),F(),function(){function n(n,e){O&&O(n.content,e)}var t=function(e){return n(e,"debug")},o=function(e){return n(e,"info")},i=function(e){return n(e,"warn")};function r(n){R&&R(n.content)}function a(){j&&j(H.current.readyState)}function l(){C&&C(I.current)}function d(n){var e={docTitle:n.docTitle,epageCount:n.epageCount,epage:n.epage,metadata:n.metadata};I.current=e,B&&B(e)}function v(n){N&&N(n)}var s=H.current;return s.addListener("debug",t),s.addListener("info",o),s.addListener("warn",i),s.addListener("error",r),s.addListener("readystatechange",a),s.addListener("loaded",l),s.addListener("nav",d),s.addListener("hyperlink",v),function(){j&&j(e.LOADING),s.removeListener("debug",t),s.removeListener("info",o),s.removeListener("warn",i),s.removeListener("error",r),s.removeListener("readystatechange",a),s.removeListener("loaded",l),s.removeListener("nav",d),s.removeListener("hyperlink",v),D.current.innerHTML=""}}()},[v,G,A]),l(function(){_()},[y,S,g,w,z,k,E,W]),l(function(){var n;null===(n=H.current)||void 0===n||n.navigateToPage(t.EPAGE,u-1)},[u]);var q=r.createElement(p,{ref:D,style:M,background:h});return"function"==typeof V&&V instanceof Function?V({container:q,reload:F}):q},p=n.div(v(),function(n){return n.background});export{s as Renderer}; | ||
import n from"@emotion/styled";import{ReadyState as e,Navigation as t,PageViewMode as o,CoreViewer as i}from"@vivliostyle/core";import r,{useRef as a,useEffect as l}from"react";function d(){return(d=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}return n}).apply(this,arguments)}function v(){var n,e,t=(n=["\n overflow: scroll;\n background: ",';\n\n @media screen {\n [data-vivliostyle-page-container] {\n background: white;\n z-index: 0;\n }\n\n [data-vivliostyle-viewer-viewport] {\n display: flex;\n overflow: auto;\n position: relative;\n }\n\n [data-vivliostyle-outer-zoom-box] {\n margin: auto;\n overflow: hidden;\n flex: none;\n }\n\n [data-vivliostyle-viewer-viewport] [data-vivliostyle-spread-container] {\n display: flex;\n flex: none;\n justify-content: center;\n transform-origin: left top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-page-progression="ltr"]\n [data-vivliostyle-spread-container] {\n flex-direction: row;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-page-progression="rtl"]\n [data-vivliostyle-spread-container] {\n flex-direction: row-reverse;\n }\n\n [data-vivliostyle-viewer-viewport] [data-vivliostyle-page-container] {\n margin: 0 auto;\n flex: none;\n transform-origin: center top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-spread-view="true"]\n [data-vivliostyle-page-container][data-vivliostyle-page-side="left"] {\n margin-right: 1px;\n transform-origin: right top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-spread-view="true"]\n [data-vivliostyle-page-container][data-vivliostyle-page-side="right"] {\n margin-left: 1px;\n transform-origin: left top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-spread-view="true"]\n [data-vivliostyle-page-container][data-vivliostyle-unpaired-page="true"] {\n margin-left: auto;\n margin-right: auto;\n transform-origin: center top;\n }\n }\n\n /* vivliostyle-viewport */\n [data-vivliostyle-layout-box] {\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n z-index: -1;\n }\n\n [data-vivliostyle-debug] [data-vivliostyle-layout-box] {\n right: auto;\n bottom: auto;\n overflow: visible;\n z-index: auto;\n }\n\n [data-vivliostyle-page-container] {\n position: relative;\n overflow: hidden;\n }\n\n [data-vivliostyle-bleed-box] {\n position: absolute;\n overflow: hidden;\n max-width: 100%;\n max-height: 100%;\n box-sizing: border-box;\n }\n\n [data-vivliostyle-page-box] ~ [data-vivliostyle-page-box] {\n display: none;\n }\n\n [data-vivliostyle-toc-box] {\n position: absolute;\n left: 3px;\n top: 3px;\n overflow: scroll;\n overflow-x: hidden;\n background: rgba(248, 248, 248, 0.9);\n border-radius: 2px;\n box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);\n }\n\n @media print {\n [data-vivliostyle-toc-box] {\n display: none;\n }\n\n [data-vivliostyle-outer-zoom-box],\n [data-vivliostyle-spread-container] {\n width: 100% !important;\n height: 100% !important;\n }\n\n [data-vivliostyle-spread-container],\n [data-vivliostyle-page-container] {\n -moz-transform: none !important;\n -ms-transform: none !important;\n -webkit-transform: none !important;\n transform: none !important;\n }\n\n [data-vivliostyle-page-container] {\n display: block !important;\n max-width: 100%;\n height: 100% !important;\n max-height: 100%;\n }\n\n /* Workaround for Chrome printing problem */\n /* [data-vivliostyle-page-box] {\n padding-bottom: 0 !important;\n overflow: visible !important;\n } */\n [data-vivliostyle-bleed-box] > div > div::before {\n display: block;\n content: "";\n padding-top: 0.015625px;\n margin-bottom: -0.015625px;\n }\n\n /* Gecko-only hack, see https://bugzilla.mozilla.org/show_bug.cgi?id=267029#c17 */\n @-moz-document regexp(\'.*\') {\n [data-vivliostyle-page-container]:nth-last-child(n + 2) {\n top: -1px;\n margin-top: 1px;\n margin-bottom: -1px;\n }\n }\n }\n'],e||(e=n.slice(0)),n.raw=e,n);return v=function(){return t},t}var s=function(n){var v=n.source,s=n.page,u=void 0===s?1:s,c=n.zoom,g=void 0===c?1:c,f=n.fontSize,y=void 0===f?16:f,m=n.background,h=void 0===m?"#ececec":m,b=n.renderAllPages,w=void 0===b||b,x=n.autoResize,z=void 0===x||x,L=n.pageViewMode,S=void 0===L?o.SINGLE_PAGE:L,k=n.defaultPaperSize,P=n.pageBorderWidth,E=void 0===P?1:P,T=n.fitToScreen,W=void 0!==T&&T,A=n.userStyleSheet,G=n.authorStyleSheet,M=n.style,O=n.onMessage,R=n.onError,j=n.onReadyStateChange,C=n.onLoad,B=n.onNavigation,N=n.onHyperlink,V=n.children,D=a(null),H=a(),I=r.useRef();function _(){H.current.setOptions({fontSize:y,pageViewMode:S,zoom:g,renderAllPages:w,autoResize:z,defaultPaperSize:k,pageBorderWidth:E,fitToScreen:W})}function F(){var n,e,t=H.current,o=v.endsWith(".json"),i=d({},A?{userStyleSheet:[(n={},n[A.endsWith(".css")?"url":"text"]=A,n)]}:null,G?{authorStyleSheet:[(e={},e[G.endsWith(".css")?"url":"text"]=G,e)]}:null);o?t.loadPublication(v,i):t.loadDocument({url:v,startPage:u},i,{fontSize:y,pageViewMode:S,zoom:1,renderAllPages:w,autoResize:z,defaultPaperSize:k,pageBorderWidth:E,fitToScreen:!1})}l(function(){return H.current=new i({viewportElement:D.current}),_(),F(),function(){function n(n,e){O&&O(n.content,e)}var t=function(e){return n(e,"debug")},o=function(e){return n(e,"info")},i=function(e){return n(e,"warn")};function r(n){R&&R(n.content)}function a(){j&&j(H.current.readyState)}function l(){C&&C(I.current)}function d(n){var e={docTitle:n.docTitle,epageCount:n.epageCount,epage:n.epage,metadata:n.metadata};I.current=e,B&&B(e)}function v(n){N&&N(n)}var s=H.current;return s.addListener("debug",t),s.addListener("info",o),s.addListener("warn",i),s.addListener("error",r),s.addListener("readystatechange",a),s.addListener("loaded",l),s.addListener("nav",d),s.addListener("hyperlink",v),function(){j&&j(e.LOADING),s.removeListener("debug",t),s.removeListener("info",o),s.removeListener("warn",i),s.removeListener("error",r),s.removeListener("readystatechange",a),s.removeListener("loaded",l),s.removeListener("nav",d),s.removeListener("hyperlink",v),D.current.innerHTML=""}}()},[v,G,A]),l(function(){_()},[y,S,g,w,z,k,E,W]),l(function(){var n;null===(n=H.current)||void 0===n||n.navigateToPage(t.EPAGE,u-1)},[u]);var q=r.createElement(p,{ref:D,style:M,background:h});return"function"==typeof V&&V instanceof Function?V({container:q,reload:F}):q},p=n.div(v(),function(n){return n.background});export{s as Renderer}; | ||
//# sourceMappingURL=react-vivliostyle.modern.js.map |
{ | ||
"name": "@vivliostyle/react", | ||
"description": "React component for Vivliostyle", | ||
"version": "2.1.3", | ||
"version": "2.1.4", | ||
"author": "Yasuaki Uechi <y@uechi.io>", | ||
@@ -21,3 +21,3 @@ "scripts": { | ||
"@emotion/styled": "^10.0.27", | ||
"@vivliostyle/core": "^2.1.3" | ||
"@vivliostyle/core": "^2.1.4" | ||
}, | ||
@@ -73,3 +73,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "0ccfdf60d8dc9a67bb7c2a49b7dfc3fe00dd72d2" | ||
"gitHead": "2d070448ff663fb42e6a76b97b8e89c9270a710a" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
86843
Updated@vivliostyle/core@^2.1.4