bookito-widget 0.41.3 → 0.41.4-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -1
- package/dist/3140.js +1 -1
- package/dist/bookito-widget.umd.js +20 -20
- package/dist/bookito-widget.window.js +20 -20
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
-
## [0.41.
|
|
5
|
+
## [0.41.4-beta.2](https://github.com/Carlito-GmbH/carlito-platform/compare/bookito-widget-0.41.4-beta.1...bookito-widget-0.41.4-beta.2) (2026-02-09)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## [0.41.4-beta.1](https://github.com/Carlito-GmbH/carlito-platform/compare/bookito-widget-0.41.4-beta.0...bookito-widget-0.41.4-beta.1) (2026-02-09)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## [0.41.4-beta.0](https://github.com/Carlito-GmbH/carlito-platform/compare/bookito-widget-0.41.2-beta.3...bookito-widget-0.41.4-beta.0) (2026-01-27)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [0.41.3](https://github.com/Carlito-GmbH/carlito-platform/compare/bookito-widget-0.41.2-beta.2...bookito-widget-0.41.3) (2026-01-21)
|
|
6
18
|
|
|
7
19
|
|
|
8
20
|
### Bug Fixes
|
|
@@ -16,6 +28,23 @@ This file was generated using [@jscutlery/semver](https://github.com/jscutlery/s
|
|
|
16
28
|
|
|
17
29
|
|
|
18
30
|
|
|
31
|
+
## [0.41.2-beta.3](https://github.com/Carlito-GmbH/carlito-platform/compare/bookito-widget-0.41.2-beta.2...bookito-widget-0.41.2-beta.3) (2026-01-27)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## [0.41.3](https://github.com/Carlito-GmbH/carlito-platform/compare/bookito-widget-0.41.2...bookito-widget-0.41.3) (2026-01-21)
|
|
35
|
+
|
|
36
|
+
### Bug Fixes
|
|
37
|
+
|
|
38
|
+
* hotfix timezone issue event list ([bad8a44](https://github.com/Carlito-GmbH/carlito-platform/commit/bad8a44e5a75a478f057885f400ce2c38a1d86e8))
|
|
39
|
+
* missing import B-widget ([a7f699f](https://github.com/Carlito-GmbH/carlito-platform/commit/a7f699fcc780997037156759a271fe5e96d338fe))
|
|
40
|
+
|
|
41
|
+
## [0.41.2](https://github.com/Carlito-GmbH/carlito-platform/compare/bookito-widget-0.41.2-beta.1...bookito-widget-0.41.2) (2026-01-15)
|
|
42
|
+
|
|
43
|
+
## [0.41.2-beta.3](https://github.com/Carlito-GmbH/carlito-platform/compare/bookito-widget-0.41.2-beta.2...bookito-widget-0.41.2-beta.3) (2026-01-27)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## [0.41.2-beta.2](https://github.com/Carlito-GmbH/carlito-platform/compare/bookito-widget-0.41.2-beta.1...bookito-widget-0.41.2-beta.2) (2026-01-15)
|
|
47
|
+
|
|
19
48
|
## [0.41.2-beta.1](https://github.com/Carlito-GmbH/carlito-platform/compare/bookito-widget-0.41.2-beta.0...bookito-widget-0.41.2-beta.1) (2026-01-14)
|
|
20
49
|
|
|
21
50
|
|
package/dist/3140.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkbookito_widget=self.webpackChunkbookito_widget||[]).push([[3140],{63140:(e,t,n)=>{n.r(t),n.d(t,{default:()=>PdfEmbed_PdfViewer});n(64815),n(2964);var s=n(86326),i=n(78661),o=n(
|
|
1
|
+
"use strict";(self.webpackChunkbookito_widget=self.webpackChunkbookito_widget||[]).push([[3140],{63140:(e,t,n)=>{n.r(t),n.d(t,{default:()=>PdfEmbed_PdfViewer});n(64815),n(2964);var s=n(86326),i=n(78661),o=n(21419),a=n(62084),l=n(16951),c=n.n(l),r=n(7620),d=n(51219),u=(n(40216),n(87921),n(31327),n(35934),n(178));function useRenderPdf({canvasContainer:e,isVisible:t=!0,fileUrl:n,pageNumber:i=1,onDocumentLoaded:o}){const[a,l]=(0,s.useState)(),[c,r]=(0,s.useState)(),[d,f]=(0,s.useState)("idle"),[g,h]=(0,s.useState)(),m=(0,s.useMemo)(()=>function log(...e){0},[n]);return(0,s.useEffect)(()=>{n&&g&&(m("URL changed, resetting loaded document"),h(void 0))},[n]),(0,s.useEffect)(()=>{let e=!1;return t&&n&&(void 0===(null==g?void 0:g.pageNumber)||g.pageNumber!==i)&&setTimeout(()=>{e||(async()=>{f("loading");const e=await async function loadPage({fileUrl:e,pageNumber:t=1,pdfDocument:n}){const s=n||await u.getDocument(e).promise;return{page:await s.getPage(t),pdfDocument:s}}({fileUrl:n,pageNumber:i,pdfDocument:null==g?void 0:g.pdfDocument});f("loaded"),h(Object.assign({},e,{pageNumber:i}))})()},100),()=>{e=!0}},[t,n,i,null==g?void 0:g.pdfDocument]),(0,s.useEffect)(()=>{let n=!1;return null!=g&&g.page&&t&&e&&"rendered"!==d&&setTimeout(()=>{n||(async()=>{m(`Rendering page ${i}`);const{canvas:t}=await async function renderPage({canvasContainer:e,page:t}){e.innerHTML="";const n=document.createElement("canvas");n.style.height="100%",n.style.width="100%",e.appendChild(n);const s=n.getContext("2d");if(!s)throw new Error("Could not get canvas context");const i=window.devicePixelRatio||1,o=t.getViewport({scale:i});n.width=o.width,n.height=o.height;const a={canvasContext:s,viewport:o};return s.clearRect(0,0,n.width,n.height),s.beginPath(),await t.render(a),{canvas:n}}({canvasContainer:e,page:g.page}),s=e.clientHeight;n||(r(t),l(s),f("rendered"))})()},100),()=>{n=!0}},[null==g?void 0:g.page,t,e]),(0,s.useEffect)(()=>{let e=!1;return n&&null!=g&&g.pdfDocument&&o&&(async t=>{const s=await g.pdfDocument.getMetadata(),i=u.getFilenameFromUrl(n),a=s.info,l=null!=(t=null==a?void 0:a.Title)?t:i;e||o({title:l,numPages:g.pdfDocument.numPages})})(),()=>{e=!0}},[null==g?void 0:g.pdfDocument,o]),(0,s.useEffect)(()=>{let e,n=!1;return!t&&null!=g&&g.pdfDocument&&"rendered"===d&&(e=window.setTimeout(()=>{n||g.page.destroyed||(m("Destroying document"),g.pdfDocument.destroy(),c&&function releaseCanvas(e){e.width=1,e.height=1;const t=e.getContext("2d");t&&t.clearRect(0,0,1,1)}(c),h(void 0),f("idle"))},2e3)),()=>{n=!0,void 0!==e&&window.clearTimeout(e)}},[null==g?void 0:g.pdfDocument,t,d]),{displayState:d,lastHeight:a}}var f=n(36870);const g=(0,s.forwardRef)((e,t)=>{var n;const i=s.useRef(null),{lastHeight:o}=useRenderPdf(Object.assign({},e,{canvasContainer:null!=(n=i.current)?n:void 0}));return(0,f.jsx)("div",{ref:t,children:(0,f.jsx)("div",{ref:i,style:o?{minHeight:`${o}px`}:void 0,className:"h-full w-full block"})})}),h={title:"",numPages:0},PdfEmbed_PdfViewer=({open:e,onClose:t,pdfUrl:n})=>{const l=(0,s.useRef)(null),[u,m]=(0,s.useState)(1),[p,v]=(0,s.useState)(h);(0,s.useEffect)(()=>{e||v(h)},[e]);const w=(0,s.useRef)(null),x=(0,s.useRef)(null),j=0===p.numPages;return(0,o.wY)(x,e=>{w.current&&w.current.centerView()}),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(i.oI,{isOpen:e&&j}),(0,f.jsxs)(a.Sb,{onWillDismiss:()=>{m(1),t()},isOpen:e,className:"pdf-modal",style:{"--width":"80vw","--height":"80vh"},children:[(0,f.jsx)(a.eU,{children:(0,f.jsx)(a.ai,{children:(0,f.jsx)(a.QW,{slot:"start",children:(0,f.jsxs)(a.Jm,{onClick:()=>{t()},color:"secondary",children:[(0,f.jsx)(a.iq,{slot:"start",icon:r.fcl}),"Back"]})})})}),(0,f.jsx)(a.W9,{children:(0,f.jsx)("div",{ref:l,className:c()("rounded w-full h-full flex justify-center items-center"),children:(0,f.jsx)(d.GT,{ref:w,children:(0,f.jsx)(d.WZ,{wrapperStyle:{overflow:"visible",width:"100vw",height:"100vh"},children:(0,f.jsx)(g,{ref:x,onDocumentLoaded:v,pageNumber:u,fileUrl:n})})})})}),(0,f.jsx)(a.M0,{children:(0,f.jsxs)(a.ai,{children:[(0,f.jsx)(a.QW,{slot:"start",children:(0,f.jsx)(a.Jm,{onClick:function onPreviousPage(){const e=u-1;m(e<=0?p.numPages:e)},color:"secondary",children:(0,f.jsx)(a.iq,{"data-test-id":"btn-back",slot:"icon-only",icon:r.fcl})})}),(0,f.jsxs)(a.BC,{"data-test-id":"pdf-pagination",children:[u,"/",p.numPages]}),(0,f.jsx)(a.QW,{slot:"end",children:(0,f.jsx)(a.Jm,{color:"secondary",onClick:function onNextPage(){const e=u+1;e>p.numPages?m(1):m(e)},children:(0,f.jsx)(a.iq,{"data-test-id":"btn-next",slot:"icon-only",icon:r.fZ})})})]})})]})]})}}}]);
|