@e-llm-studio/citation 0.0.118 → 0.0.119
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/dist/cjs/features/PdfViewer/PdfToolbar.js +1 -1
- package/dist/cjs/features/PdfViewer/PdfViewer.js +1 -1
- package/dist/cjs/features/PdfViewer/usePdfHighlight.js +1 -1
- package/dist/features/PdfViewer/PdfToolbar.js +1 -1
- package/dist/features/PdfViewer/PdfViewer.js +1 -1
- package/dist/features/PdfViewer/usePdfHighlight.js +1 -1
- package/dist/types/src/PdfViewerTest.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/PdfToolbar.d.ts +2 -1
- package/dist/types/src/features/PdfViewer/PdfToolbar.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/PdfViewer.d.ts.map +1 -1
- package/dist/types/src/features/PdfViewer/usePdfHighlight.d.ts +7 -3
- package/dist/types/src/features/PdfViewer/usePdfHighlight.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var s=require("../../node_modules/tslib/tslib.es6.mjs.js"),e=require("react/jsx-runtime"),t=require("./PdfStyle.js");exports.default=function(i){var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var s=require("../../node_modules/tslib/tslib.es6.mjs.js"),e=require("react/jsx-runtime"),t=require("./PdfStyle.js");exports.default=function(i){i.highlightIndex;var n=i.totalHighlights,l=i.controls,o=i.currentPosition,r=l.ZoomInButton,d=l.ZoomOutButton,a=l.ZoomPopover,u=l.goToPrevious,_=l.goToNext;return e.jsxs("div",s.__assign({style:t.pdfStyles.header},{children:[e.jsx("span",s.__assign({style:t.pdfStyles.title},{children:"PDF with Highlighted Sections"})),e.jsxs("div",s.__assign({style:t.pdfStyles.toolbar},{children:[e.jsx(d,{}),e.jsx(a,{}),e.jsx(r,{}),!!n&&e.jsxs(e.Fragment,{children:[e.jsx("button",s.__assign({style:s.__assign(s.__assign({},t.pdfStyles.button),0===o||1===o?t.pdfStyles.buttonDisabled:{}),onClick:u,disabled:0===o||1===o},{children:"◀"})),e.jsxs("span",s.__assign({style:t.pdfStyles.counter},{children:[o," / ",n]})),e.jsx("button",s.__assign({style:s.__assign(s.__assign({},t.pdfStyles.button),o===n?t.pdfStyles.buttonDisabled:{}),onClick:_,disabled:o===n},{children:"▶"}))]})]}))]}))};
|
|
2
2
|
//# sourceMappingURL=PdfToolbar.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/tslib/tslib.es6.mjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../node_modules/tslib/tslib.es6.mjs.js"),i=require("react/jsx-runtime"),r=require("@react-pdf-viewer/core"),s=require("./PdfContainer.js"),t=require("./PdfToolbar.js"),l=require("./PdfStyle.js"),o=require("./usePdfHighlight.js");require("@react-pdf-viewer/zoom/lib/styles/index.css"),require("@react-pdf-viewer/page-navigation/lib/styles/index.css"),require("@react-pdf-viewer/core/lib/styles/index.css"),require("@react-pdf-viewer/search/lib/styles/index.css");exports.default=function(d){var a=d.pdfUrl,n=d.highlightText,u=d.highlightPages,c=d.jumpToPageValue,g=void 0===c?0:c,h=o.PdfHighlightControls(n,u),f=h.highlightIndex,p=h.cursorIndex,x=h.setCursorIndex,v=h.orderedKeys,j=h.totalHighlights,y=h.getValidPosition,m=h.tryJump,q=h.jumpToPage,P=h.zoomTo,b=h.plugins,_=h.controls,w=y(p);return a?i.jsxs("div",e.__assign({style:l.pdfStyles.pdfViewer},{children:[i.jsx(t.default,{highlightIndex:f,totalHighlights:j,controls:_,currentPosition:w}),i.jsx(s.default,{pdfUrl:a,plugins:b,onLoad:function(){if(P(r.SpecialZoomLevel.ActualSize),g>0){var e=g-1,i=v[e],s=u[i];x(e),s>0&&q(s-1)}requestAnimationFrame(m)}})]})):i.jsx("div",e.__assign({style:l.pdfStyles.emptyState},{children:"PDF is not available for this selection"}))};
|
|
2
2
|
//# sourceMappingURL=PdfViewer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("@react-pdf-viewer/search"),t=require("@react-pdf-viewer/page-navigation"),o=require("@react-pdf-viewer/zoom");exports.PdfHighlightControls=function(n,u){var i=e.useState(0),a=i[0],c=i[1],s=e.useRef(!1),g=e.useState(0),f=g[0],l=g[1],m=Object.keys(u).map(Number).sort(function(e,r){return e-r}),v=Object.values(u).filter(function(e){return e>0}).length,p=r.searchPlugin({keyword:n}),h=t.pageNavigationPlugin(),d=o.zoomPlugin(),P=p.jumpToMatch,x=h.jumpToPage,T=d.zoomTo,j=d.ZoomInButton,y=d.ZoomOutButton,I=d.ZoomPopover,Z=function(){if(!s.current)try{P(0),s.current=!0}catch(e){requestAnimationFrame(Z)}};return{setHighlightIndex:c,highlightIndex:a,cursorIndex:f,setCursorIndex:l,orderedKeys:m,totalHighlights:v,getValidPosition:function(e){for(var r=0,t=0;t<=e;t++){var o=m[t];u[o]>0&&r++}return r},tryJump:Z,jumpToPage:x,zoomTo:T,plugins:[p,h,d],controls:{ZoomInButton:j,ZoomOutButton:y,ZoomPopover:I,goToNext:function(){l(function(e){for(var r=e+1;r<m.length;r++){var t=m[r];if(u[t]>0)return x(u[t]-1),r}return e})},goToPrevious:function(){l(function(e){for(var r=e-1;r>=0;r--){var t=m[r];if(u[t]>0)return x(u[t]-1),r}return e})}}}};
|
|
2
2
|
//# sourceMappingURL=usePdfHighlight.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as t}from"../../node_modules/tslib/tslib.es6.mjs.js";import{jsxs as o,jsx as e,Fragment as i}from"react/jsx-runtime";import{pdfStyles as l}from"./PdfStyle.js";var n=function(n){var r=n.
|
|
1
|
+
import{__assign as t}from"../../node_modules/tslib/tslib.es6.mjs.js";import{jsxs as o,jsx as e,Fragment as i}from"react/jsx-runtime";import{pdfStyles as l}from"./PdfStyle.js";var n=function(n){n.highlightIndex;var r=n.totalHighlights,s=n.controls,d=n.currentPosition,u=s.ZoomInButton,h=s.ZoomOutButton,c=s.ZoomPopover,a=s.goToPrevious,b=s.goToNext;return o("div",t({style:l.header},{children:[e("span",t({style:l.title},{children:"PDF with Highlighted Sections"})),o("div",t({style:l.toolbar},{children:[e(h,{}),e(c,{}),e(u,{}),!!r&&o(i,{children:[e("button",t({style:t(t({},l.button),0===d||1===d?l.buttonDisabled:{}),onClick:a,disabled:0===d||1===d},{children:"◀"})),o("span",t({style:l.counter},{children:[d," / ",r]})),e("button",t({style:t(t({},l.button),d===r?l.buttonDisabled:{}),onClick:b,disabled:d===r},{children:"▶"}))]})]}))]}))};export{n as default};
|
|
2
2
|
//# sourceMappingURL=PdfToolbar.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"../../node_modules/tslib/tslib.es6.mjs.js";import{jsx as
|
|
1
|
+
import{__assign as e}from"../../node_modules/tslib/tslib.es6.mjs.js";import{jsx as i,jsxs as t}from"react/jsx-runtime";import{SpecialZoomLevel as r}from"@react-pdf-viewer/core";import o from"./PdfContainer.js";import s from"./PdfToolbar.js";import{pdfStyles as l}from"./PdfStyle.js";import{PdfHighlightControls as n}from"./usePdfHighlight.js";import"@react-pdf-viewer/zoom/lib/styles/index.css";import"@react-pdf-viewer/page-navigation/lib/styles/index.css";import"@react-pdf-viewer/core/lib/styles/index.css";import"@react-pdf-viewer/search/lib/styles/index.css";var a=function(a){var d=a.pdfUrl,m=a.highlightText,p=a.highlightPages,f=a.jumpToPageValue,c=void 0===f?0:f,g=n(m,p),h=g.highlightIndex,u=g.cursorIndex,v=g.setCursorIndex,x=g.orderedKeys,y=g.totalHighlights,P=g.getValidPosition,j=g.tryJump,b=g.jumpToPage,w=g.zoomTo,T=g.plugins,I=g.controls,z=P(u);return d?t("div",e({style:l.pdfViewer},{children:[i(s,{highlightIndex:h,totalHighlights:y,controls:I,currentPosition:z}),i(o,{pdfUrl:d,plugins:T,onLoad:function(){if(w(r.ActualSize),c>0){var e=c-1,i=x[e],t=p[i];v(e),t>0&&b(t-1)}requestAnimationFrame(j)}})]})):i("div",e({style:l.emptyState},{children:"PDF is not available for this selection"}))};export{a as default};
|
|
2
2
|
//# sourceMappingURL=PdfViewer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useState as o,useRef as
|
|
1
|
+
import{useState as o,useRef as r}from"react";import{searchPlugin as t}from"@react-pdf-viewer/search";import{pageNavigationPlugin as e}from"@react-pdf-viewer/page-navigation";import{zoomPlugin as n}from"@react-pdf-viewer/zoom";var u=function(u,i){var a=o(0),m=a[0],c=a[1],f=r(!1),p=o(0),g=p[0],v=p[1],s=Object.keys(i).map(Number).sort(function(o,r){return o-r}),h=Object.values(i).filter(function(o){return o>0}).length,d=t({keyword:u}),l=e(),T=n(),x=d.jumpToMatch,I=l.jumpToPage,P=T.zoomTo,Z=T.ZoomInButton,j=T.ZoomOutButton,y=T.ZoomPopover,w=function(){if(!f.current)try{x(0),f.current=!0}catch(o){requestAnimationFrame(w)}};return{setHighlightIndex:c,highlightIndex:m,cursorIndex:g,setCursorIndex:v,orderedKeys:s,totalHighlights:h,getValidPosition:function(o){for(var r=0,t=0;t<=o;t++){var e=s[t];i[e]>0&&r++}return r},tryJump:w,jumpToPage:I,zoomTo:P,plugins:[d,l,T],controls:{ZoomInButton:Z,ZoomOutButton:j,ZoomPopover:y,goToNext:function(){v(function(o){for(var r=o+1;r<s.length;r++){var t=s[r];if(i[t]>0)return I(i[t]-1),r}return o})},goToPrevious:function(){v(function(o){for(var r=o-1;r>=0;r--){var t=s[r];if(i[t]>0)return I(i[t]-1),r}return o})}}}};export{u as PdfHighlightControls};
|
|
2
2
|
//# sourceMappingURL=usePdfHighlight.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdfViewerTest.d.ts","sourceRoot":"","sources":["../../../src/PdfViewerTest.tsx"],"names":[],"mappings":"AAcA,QAAA,MAAM,aAAa,+
|
|
1
|
+
{"version":3,"file":"PdfViewerTest.d.ts","sourceRoot":"","sources":["../../../src/PdfViewerTest.tsx"],"names":[],"mappings":"AAcA,QAAA,MAAM,aAAa,+CAsClB,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -2,7 +2,8 @@ type Props = {
|
|
|
2
2
|
highlightIndex: number;
|
|
3
3
|
totalHighlights: number;
|
|
4
4
|
controls: any;
|
|
5
|
+
currentPosition: any;
|
|
5
6
|
};
|
|
6
|
-
declare const PdfToolbar: ({ highlightIndex, totalHighlights, controls, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const PdfToolbar: ({ highlightIndex, totalHighlights, controls, currentPosition }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export default PdfToolbar;
|
|
8
9
|
//# sourceMappingURL=PdfToolbar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdfToolbar.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/PdfToolbar.tsx"],"names":[],"mappings":"AAGA,KAAK,KAAK,GAAG;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"PdfToolbar.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/PdfToolbar.tsx"],"names":[],"mappings":"AAGA,KAAK,KAAK,GAAG;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,GAAG,CAAC;IACd,eAAe,EAAE,GAAG,CAAA;CACrB,CAAC;AAEF,QAAA,MAAM,UAAU,mEAKb,KAAK,4CAsDP,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdfViewer.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/PdfViewer.tsx"],"names":[],"mappings":"AAMA,OAAO,6CAA6C,CAAC;AACrD,OAAO,wDAAwD,CAAC;AAChE,OAAO,6CAA6C,CAAC;AACrD,OAAO,+CAA+C,CAAC;AAGvD,QAAA,MAAM,SAAS,gEAKZ,GAAG,
|
|
1
|
+
{"version":3,"file":"PdfViewer.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/PdfViewer.tsx"],"names":[],"mappings":"AAMA,OAAO,6CAA6C,CAAC;AACrD,OAAO,wDAAwD,CAAC;AAChE,OAAO,6CAA6C,CAAC;AACrD,OAAO,+CAA+C,CAAC;AAGvD,QAAA,MAAM,SAAS,gEAKZ,GAAG,4CA8DL,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const PdfHighlightControls: (highlightText: string[], highlightPages: number
|
|
3
|
-
highlightIndex: number;
|
|
2
|
+
export declare const PdfHighlightControls: (highlightText: string[], highlightPages: Record<number, number>) => {
|
|
4
3
|
setHighlightIndex: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
4
|
+
highlightIndex: number;
|
|
5
|
+
cursorIndex: number;
|
|
6
|
+
setCursorIndex: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
7
|
+
orderedKeys: number[];
|
|
5
8
|
totalHighlights: number;
|
|
9
|
+
getValidPosition: (cursor: number) => number;
|
|
6
10
|
tryJump: () => void;
|
|
7
11
|
jumpToPage: (pageIndex: number) => void;
|
|
8
12
|
zoomTo: (scale: number | import("@react-pdf-viewer/core").SpecialZoomLevel) => void;
|
|
@@ -11,8 +15,8 @@ export declare const PdfHighlightControls: (highlightText: string[], highlightPa
|
|
|
11
15
|
ZoomInButton: () => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
12
16
|
ZoomOutButton: () => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
13
17
|
ZoomPopover: (props?: import("@react-pdf-viewer/zoom").ZoomPopoverProps | undefined) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
14
|
-
goToPrevious: () => void;
|
|
15
18
|
goToNext: () => void;
|
|
19
|
+
goToPrevious: () => void;
|
|
16
20
|
};
|
|
17
21
|
};
|
|
18
22
|
//# sourceMappingURL=usePdfHighlight.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePdfHighlight.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/usePdfHighlight.tsx"],"names":[],"mappings":";AAKA,eAAO,MAAM,oBAAoB,kBAChB,MAAM,EAAE,kBACP,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"usePdfHighlight.d.ts","sourceRoot":"","sources":["../../../../../src/features/PdfViewer/usePdfHighlight.tsx"],"names":[],"mappings":";AAKA,eAAO,MAAM,oBAAoB,kBAChB,MAAM,EAAE,kBACP,OAAO,MAAM,EAAE,MAAM,CAAC;;;;;;;+BAgBJ,MAAM;;;;;;;;;;;;CAmFzC,CAAC"}
|