@embedpdf/plugin-scroll 1.0.0
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/LICENSE +21 -0
- package/dist/index.cjs +737 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +188 -0
- package/dist/index.d.ts +188 -0
- package/dist/index.js +714 -0
- package/dist/index.js.map +1 -0
- package/dist/preact/index.cjs +156 -0
- package/dist/preact/index.cjs.map +1 -0
- package/dist/preact/index.d.cts +30 -0
- package/dist/preact/index.d.ts +30 -0
- package/dist/preact/index.js +127 -0
- package/dist/preact/index.js.map +1 -0
- package/dist/react/index.cjs +156 -0
- package/dist/react/index.cjs.map +1 -0
- package/dist/react/index.d.cts +29 -0
- package/dist/react/index.d.ts +29 -0
- package/dist/react/index.js +127 -0
- package/dist/react/index.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/preact/hooks/use-scroll.ts","../../src/preact/components/scroller.tsx"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/preact';\nimport { ScrollPlugin } from '@embedpdf/plugin-scroll';\n\nexport const useScroll = () => usePlugin<ScrollPlugin>(ScrollPlugin.id);\nexport const useScrollCapability = () => useCapability<ScrollPlugin>(ScrollPlugin.id);\n","/** @jsxImportSource preact */\nimport { JSX } from 'preact';\nimport { useEffect, useState } from 'preact/hooks';\nimport { ScrollStrategy, ScrollerLayout, PageLayout } from '@embedpdf/plugin-scroll';\nimport { useRegistry } from '@embedpdf/core/preact';\nimport { PdfDocumentObject, Rotation } from '@embedpdf/models';\n\nimport { useScrollCapability } from '../hooks';\n\ninterface RenderPageProps extends PageLayout {\n rotation: Rotation;\n scale: number;\n document: PdfDocumentObject | null;\n}\n\ntype ScrollerProps = JSX.HTMLAttributes<HTMLDivElement> & {\n renderPage: (props: RenderPageProps) => JSX.Element;\n overlayElements?: JSX.Element[];\n};\n\nexport function Scroller({ renderPage, overlayElements, ...props }: ScrollerProps) {\n const { provides: scrollProvides } = useScrollCapability();\n const { registry } = useRegistry();\n const [scrollerLayout, setScrollerLayout] = useState<ScrollerLayout | null>(\n () => scrollProvides?.getScrollerLayout() ?? null,\n );\n\n useEffect(() => {\n if (!scrollProvides) return;\n\n return scrollProvides.onScrollerData(setScrollerLayout);\n }, [scrollProvides]);\n\n if (!scrollerLayout) return null;\n if (!registry) return null;\n\n const coreState = registry.getStore().getState();\n\n return (\n <div\n {...props}\n style={{\n width: `${scrollerLayout.totalWidth}px`,\n height: `${scrollerLayout.totalHeight}px`,\n position: 'relative',\n boxSizing: 'border-box',\n margin: '0 auto',\n ...(scrollerLayout.strategy === ScrollStrategy.Horizontal && {\n display: 'flex',\n flexDirection: 'row',\n }),\n }}\n >\n <div\n style={{\n ...(scrollerLayout.strategy === ScrollStrategy.Horizontal\n ? {\n width: scrollerLayout.startSpacing,\n height: '100%',\n flexShrink: 0,\n }\n : {\n height: scrollerLayout.startSpacing,\n width: '100%',\n }),\n }}\n />\n <div\n style={{\n gap: scrollerLayout.pageGap,\n display: 'flex',\n alignItems: 'center',\n position: 'relative',\n boxSizing: 'border-box',\n ...(scrollerLayout.strategy === ScrollStrategy.Horizontal\n ? {\n flexDirection: 'row',\n minHeight: '100%',\n }\n : {\n flexDirection: 'column',\n minWidth: 'fit-content',\n }),\n }}\n >\n {scrollerLayout.items.map((item) => (\n <div\n key={item.pageNumbers[0]}\n style={{\n display: 'flex',\n justifyContent: 'center',\n gap: scrollerLayout.pageGap,\n }}\n >\n {item.pageLayouts.map((layout) => (\n <div\n key={layout.pageNumber}\n style={{\n width: `${layout.rotatedWidth}px`,\n height: `${layout.rotatedHeight}px`,\n }}\n >\n {renderPage({\n ...layout,\n rotation: coreState.core.rotation,\n scale: coreState.core.scale,\n document: coreState.core.document,\n })}\n </div>\n ))}\n </div>\n ))}\n </div>\n <div\n style={{\n ...(scrollerLayout.strategy === ScrollStrategy.Horizontal\n ? {\n width: scrollerLayout.end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YACN;AAAA;AAAA,QACF;AAAA,QACC;AAAA;AAAA;AAAA,EACH;AAEJ;","names":[]}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/react/index.ts
|
|
21
|
+
var react_exports = {};
|
|
22
|
+
__export(react_exports, {
|
|
23
|
+
Scroller: () => Scroller,
|
|
24
|
+
useScroll: () => useScroll,
|
|
25
|
+
useScrollCapability: () => useScrollCapability
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(react_exports);
|
|
28
|
+
|
|
29
|
+
// src/react/hooks/use-scroll.ts
|
|
30
|
+
var import_react = require("@embedpdf/core/react");
|
|
31
|
+
var import_plugin_scroll = require("@embedpdf/plugin-scroll");
|
|
32
|
+
var useScroll = () => (0, import_react.usePlugin)(import_plugin_scroll.ScrollPlugin.id);
|
|
33
|
+
var useScrollCapability = () => (0, import_react.useCapability)(import_plugin_scroll.ScrollPlugin.id);
|
|
34
|
+
|
|
35
|
+
// src/react/components/scroller.tsx
|
|
36
|
+
var import_react2 = require("react");
|
|
37
|
+
var import_plugin_scroll2 = require("@embedpdf/plugin-scroll");
|
|
38
|
+
var import_react3 = require("@embedpdf/core/react");
|
|
39
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
40
|
+
function Scroller({ renderPage, overlayElements, ...props }) {
|
|
41
|
+
const { provides: scrollProvides } = useScrollCapability();
|
|
42
|
+
const { registry } = (0, import_react3.useRegistry)();
|
|
43
|
+
const [scrollerLayout, setScrollerLayout] = (0, import_react2.useState)(
|
|
44
|
+
() => scrollProvides?.getScrollerLayout() ?? null
|
|
45
|
+
);
|
|
46
|
+
(0, import_react2.useEffect)(() => {
|
|
47
|
+
if (!scrollProvides) return;
|
|
48
|
+
return scrollProvides.onScrollerData(setScrollerLayout);
|
|
49
|
+
}, [scrollProvides]);
|
|
50
|
+
if (!scrollerLayout) return null;
|
|
51
|
+
if (!registry) return null;
|
|
52
|
+
const coreState = registry.getStore().getState();
|
|
53
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
...props,
|
|
57
|
+
style: {
|
|
58
|
+
width: `${scrollerLayout.totalWidth}px`,
|
|
59
|
+
height: `${scrollerLayout.totalHeight}px`,
|
|
60
|
+
position: "relative",
|
|
61
|
+
boxSizing: "border-box",
|
|
62
|
+
margin: "0 auto",
|
|
63
|
+
...scrollerLayout.strategy === import_plugin_scroll2.ScrollStrategy.Horizontal && {
|
|
64
|
+
display: "flex",
|
|
65
|
+
flexDirection: "row"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
children: [
|
|
69
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
style: {
|
|
73
|
+
...scrollerLayout.strategy === import_plugin_scroll2.ScrollStrategy.Horizontal ? {
|
|
74
|
+
width: scrollerLayout.startSpacing,
|
|
75
|
+
height: "100%",
|
|
76
|
+
flexShrink: 0
|
|
77
|
+
} : {
|
|
78
|
+
height: scrollerLayout.startSpacing,
|
|
79
|
+
width: "100%"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
85
|
+
"div",
|
|
86
|
+
{
|
|
87
|
+
style: {
|
|
88
|
+
gap: scrollerLayout.pageGap,
|
|
89
|
+
display: "flex",
|
|
90
|
+
alignItems: "center",
|
|
91
|
+
position: "relative",
|
|
92
|
+
boxSizing: "border-box",
|
|
93
|
+
...scrollerLayout.strategy === import_plugin_scroll2.ScrollStrategy.Horizontal ? {
|
|
94
|
+
flexDirection: "row",
|
|
95
|
+
minHeight: "100%"
|
|
96
|
+
} : {
|
|
97
|
+
flexDirection: "column",
|
|
98
|
+
minWidth: "fit-content"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
children: scrollerLayout.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
102
|
+
"div",
|
|
103
|
+
{
|
|
104
|
+
style: {
|
|
105
|
+
display: "flex",
|
|
106
|
+
justifyContent: "center",
|
|
107
|
+
gap: scrollerLayout.pageGap
|
|
108
|
+
},
|
|
109
|
+
children: item.pageLayouts.map((layout) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
110
|
+
"div",
|
|
111
|
+
{
|
|
112
|
+
style: {
|
|
113
|
+
width: `${layout.rotatedWidth}px`,
|
|
114
|
+
height: `${layout.rotatedHeight}px`
|
|
115
|
+
},
|
|
116
|
+
children: renderPage({
|
|
117
|
+
...layout,
|
|
118
|
+
rotation: coreState.core.rotation,
|
|
119
|
+
scale: coreState.core.scale,
|
|
120
|
+
document: coreState.core.document
|
|
121
|
+
})
|
|
122
|
+
},
|
|
123
|
+
layout.pageNumber
|
|
124
|
+
))
|
|
125
|
+
},
|
|
126
|
+
item.pageNumbers[0]
|
|
127
|
+
))
|
|
128
|
+
}
|
|
129
|
+
),
|
|
130
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
131
|
+
"div",
|
|
132
|
+
{
|
|
133
|
+
style: {
|
|
134
|
+
...scrollerLayout.strategy === import_plugin_scroll2.ScrollStrategy.Horizontal ? {
|
|
135
|
+
width: scrollerLayout.endSpacing,
|
|
136
|
+
height: "100%",
|
|
137
|
+
flexShrink: 0
|
|
138
|
+
} : {
|
|
139
|
+
height: scrollerLayout.endSpacing,
|
|
140
|
+
width: "100%"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
),
|
|
145
|
+
overlayElements
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
151
|
+
0 && (module.exports = {
|
|
152
|
+
Scroller,
|
|
153
|
+
useScroll,
|
|
154
|
+
useScrollCapability
|
|
155
|
+
});
|
|
156
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/react/index.ts","../../src/react/hooks/use-scroll.ts","../../src/react/components/scroller.tsx"],"sourcesContent":["export * from './hooks';\nexport * from './components';\n","import { useCapability, usePlugin } from '@embedpdf/core/react';\nimport { ScrollPlugin } from '@embedpdf/plugin-scroll';\n\nexport const useScroll = () => usePlugin<ScrollPlugin>(ScrollPlugin.id);\nexport const useScrollCapability = () => useCapability<ScrollPlugin>(ScrollPlugin.id);\n","import React, { ReactNode, useEffect, useState } from 'react';\nimport { ScrollStrategy, ScrollerLayout, PageLayout } from '@embedpdf/plugin-scroll';\nimport { useRegistry } from '@embedpdf/core/react';\nimport { PdfDocumentObject, Rotation } from '@embedpdf/models';\n\nimport { useScrollCapability } from '../hooks';\n\ninterface RenderPageProps extends PageLayout {\n rotation: Rotation;\n scale: number;\n document: PdfDocumentObject | null;\n}\n\ntype ScrollerProps = React.HTMLAttributes<HTMLDivElement> & {\n renderPage: (props: RenderPageProps) => ReactNode;\n overlayElements?: ReactNode[];\n};\n\nexport function Scroller({ renderPage, overlayElements, ...props }: ScrollerProps) {\n const { provides: scrollProvides } = useScrollCapability();\n const { registry } = useRegistry();\n const [scrollerLayout, setScrollerLayout] = useState<ScrollerLayout | null>(\n () => scrollProvides?.getScrollerLayout() ?? null,\n );\n\n useEffect(() => {\n if (!scrollProvides) return;\n\n return scrollProvides.onScrollerData(setScrollerLayout);\n }, [scrollProvides]);\n\n if (!scrollerLayout) return null;\n if (!registry) return null;\n\n const coreState = registry.getStore().getState();\n\n return (\n <div\n {...props}\n style={{\n width: `${scrollerLayout.totalWidth}px`,\n height: `${scrollerLayout.totalHeight}px`,\n position: 'relative',\n boxSizing: 'border-box',\n margin: '0 auto',\n ...(scrollerLayout.strategy === ScrollStrategy.Horizontal && {\n display: 'flex',\n flexDirection: 'row',\n }),\n }}\n >\n <div\n style={{\n ...(scrollerLayout.strategy === ScrollStrategy.Horizontal\n ? {\n width: scrollerLayout.startSpacing,\n height: '100%',\n flexShrink: 0,\n }\n : {\n height: scrollerLayout.startSpacing,\n width: '100%',\n }),\n }}\n />\n <div\n style={{\n gap: scrollerLayout.pageGap,\n display: 'flex',\n alignItems: 'center',\n position: 'relative',\n boxSizing: 'border-box',\n ...(scrollerLayout.strategy === ScrollStrategy.Horizontal\n ? {\n flexDirection: 'row',\n minHeight: '100%',\n }\n : {\n flexDirection: 'column',\n minWidth: 'fit-content',\n }),\n }}\n >\n {scrollerLayout.items.map((item) => (\n <div\n key={item.pageNumbers[0]}\n style={{\n display: 'flex',\n justifyContent: 'center',\n gap: scrollerLayout.pageGap,\n }}\n >\n {item.pageLayouts.map((layout) => (\n <div\n key={layout.pageNumber}\n style={{\n width: `${layout.rotatedWidth}px`,\n height: `${layout.rotatedHeight}px`,\n }}\n >\n {renderPage({\n ...layout,\n rotation: coreState.core.rotation,\n scale: coreState.core.scale,\n document: coreState.core.document,\n })}\n </div>\n ))}\n </div>\n ))}\n </div>\n <div\n style={{\n ...(scrollerLayout.strategy === ScrollStrategy.Horizontal\n ? {\n width: scrollerLayout.endSpacing,\n height: '100%',\n flexShrink: 0,\n }\n : {\n height: scrollerLayout.endSpacing,\n width: '100%',\n }),\n }}\n />\n {overlayElements}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAyC;AACzC,2BAA6B;AAEtB,IAAM,YAAY,UAAM,wBAAwB,kCAAa,EAAE;AAC/D,IAAM,sBAAsB,UAAM,4BAA4B,kCAAa,EAAE;;;ACJpF,IAAAA,gBAAsD;AACtD,IAAAC,wBAA2D;AAC3D,IAAAD,gBAA4B;AAmCxB;AAnBG,SAAS,SAAS,EAAE,YAAY,iBAAiB,GAAG,MAAM,GAAkB;AACjF,QAAM,EAAE,UAAU,eAAe,IAAI,oBAAoB;AACzD,QAAM,EAAE,SAAS,QAAI,2BAAY;AACjC,QAAM,CAAC,gBAAgB,iBAAiB,QAAI;AAAA,IAC1C,MAAM,gBAAgB,kBAAkB,KAAK;AAAA,EAC/C;AAEA,+BAAU,MAAM;AACd,QAAI,CAAC,eAAgB;AAErB,WAAO,eAAe,eAAe,iBAAiB;AAAA,EACxD,GAAG,CAAC,cAAc,CAAC;AAEnB,MAAI,CAAC,eAAgB,QAAO;AAC5B,MAAI,CAAC,SAAU,QAAO;AAEtB,QAAM,YAAY,SAAS,SAAS,EAAE,SAAS;AAE/C,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,OAAO;AAAA,QACL,OAAO,GAAG,eAAe,UAAU;AAAA,QACnC,QAAQ,GAAG,eAAe,WAAW;AAAA,QACrC,UAAU;AAAA,QACV,WAAW;AAAA,QACX,QAAQ;AAAA,QACR,GAAI,eAAe,aAAa,qCAAe,cAAc;AAAA,UAC3D,SAAS;AAAA,UACT,eAAe;AAAA,QACjB;AAAA,MACF;AAAA,MA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,gBACE,OAAO,eAAe;AAAA,gBACtB,QAAQ;AAAA,gBACR,YAAY;AAAA,cACd,IACA;AAAA,gBACE,QAAQ,eAAe;AAAA,gBACvB,OAAO;AAAA,cACT;AAAA,YACN;AAAA;AAAA,QACF;AAAA,QACC;AAAA;AAAA;AAAA,EACH;AAEJ;","names":["import_react","import_plugin_scroll"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as _embedpdf_plugin_scroll from '@embedpdf/plugin-scroll';
|
|
2
|
+
import { ScrollPlugin, PageLayout } from '@embedpdf/plugin-scroll';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import React, { ReactNode } from 'react';
|
|
5
|
+
import { Rotation, PdfDocumentObject } from '@embedpdf/models';
|
|
6
|
+
|
|
7
|
+
declare const useScroll: () => {
|
|
8
|
+
plugin: ScrollPlugin | null;
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
ready: Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
declare const useScrollCapability: () => {
|
|
13
|
+
provides: Readonly<_embedpdf_plugin_scroll.ScrollCapability> | null;
|
|
14
|
+
isLoading: boolean;
|
|
15
|
+
ready: Promise<void>;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
interface RenderPageProps extends PageLayout {
|
|
19
|
+
rotation: Rotation;
|
|
20
|
+
scale: number;
|
|
21
|
+
document: PdfDocumentObject | null;
|
|
22
|
+
}
|
|
23
|
+
type ScrollerProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
24
|
+
renderPage: (props: RenderPageProps) => ReactNode;
|
|
25
|
+
overlayElements?: ReactNode[];
|
|
26
|
+
};
|
|
27
|
+
declare function Scroller({ renderPage, overlayElements, ...props }: ScrollerProps): react_jsx_runtime.JSX.Element | null;
|
|
28
|
+
|
|
29
|
+
export { Scroller, useScroll, useScrollCapability };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as _embedpdf_plugin_scroll from '@embedpdf/plugin-scroll';
|
|
2
|
+
import { ScrollPlugin, PageLayout } from '@embedpdf/plugin-scroll';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import React, { ReactNode } from 'react';
|
|
5
|
+
import { Rotation, PdfDocumentObject } from '@embedpdf/models';
|
|
6
|
+
|
|
7
|
+
declare const useScroll: () => {
|
|
8
|
+
plugin: ScrollPlugin | null;
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
ready: Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
declare const useScrollCapability: () => {
|
|
13
|
+
provides: Readonly<_embedpdf_plugin_scroll.ScrollCapability> | null;
|
|
14
|
+
isLoading: boolean;
|
|
15
|
+
ready: Promise<void>;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
interface RenderPageProps extends PageLayout {
|
|
19
|
+
rotation: Rotation;
|
|
20
|
+
scale: number;
|
|
21
|
+
document: PdfDocumentObject | null;
|
|
22
|
+
}
|
|
23
|
+
type ScrollerProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
24
|
+
renderPage: (props: RenderPageProps) => ReactNode;
|
|
25
|
+
overlayElements?: ReactNode[];
|
|
26
|
+
};
|
|
27
|
+
declare function Scroller({ renderPage, overlayElements, ...props }: ScrollerProps): react_jsx_runtime.JSX.Element | null;
|
|
28
|
+
|
|
29
|
+
export { Scroller, useScroll, useScrollCapability };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
// src/react/hooks/use-scroll.ts
|
|
2
|
+
import { useCapability, usePlugin } from "@embedpdf/core/react";
|
|
3
|
+
import { ScrollPlugin } from "@embedpdf/plugin-scroll";
|
|
4
|
+
var useScroll = () => usePlugin(ScrollPlugin.id);
|
|
5
|
+
var useScrollCapability = () => useCapability(ScrollPlugin.id);
|
|
6
|
+
|
|
7
|
+
// src/react/components/scroller.tsx
|
|
8
|
+
import { useEffect, useState } from "react";
|
|
9
|
+
import { ScrollStrategy } from "@embedpdf/plugin-scroll";
|
|
10
|
+
import { useRegistry } from "@embedpdf/core/react";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
function Scroller({ renderPage, overlayElements, ...props }) {
|
|
13
|
+
const { provides: scrollProvides } = useScrollCapability();
|
|
14
|
+
const { registry } = useRegistry();
|
|
15
|
+
const [scrollerLayout, setScrollerLayout] = useState(
|
|
16
|
+
() => scrollProvides?.getScrollerLayout() ?? null
|
|
17
|
+
);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (!scrollProvides) return;
|
|
20
|
+
return scrollProvides.onScrollerData(setScrollerLayout);
|
|
21
|
+
}, [scrollProvides]);
|
|
22
|
+
if (!scrollerLayout) return null;
|
|
23
|
+
if (!registry) return null;
|
|
24
|
+
const coreState = registry.getStore().getState();
|
|
25
|
+
return /* @__PURE__ */ jsxs(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
...props,
|
|
29
|
+
style: {
|
|
30
|
+
width: `${scrollerLayout.totalWidth}px`,
|
|
31
|
+
height: `${scrollerLayout.totalHeight}px`,
|
|
32
|
+
position: "relative",
|
|
33
|
+
boxSizing: "border-box",
|
|
34
|
+
margin: "0 auto",
|
|
35
|
+
...scrollerLayout.strategy === ScrollStrategy.Horizontal && {
|
|
36
|
+
display: "flex",
|
|
37
|
+
flexDirection: "row"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ jsx(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
style: {
|
|
45
|
+
...scrollerLayout.strategy === ScrollStrategy.Horizontal ? {
|
|
46
|
+
width: scrollerLayout.startSpacing,
|
|
47
|
+
height: "100%",
|
|
48
|
+
flexShrink: 0
|
|
49
|
+
} : {
|
|
50
|
+
height: scrollerLayout.startSpacing,
|
|
51
|
+
width: "100%"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
/* @__PURE__ */ jsx(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
style: {
|
|
60
|
+
gap: scrollerLayout.pageGap,
|
|
61
|
+
display: "flex",
|
|
62
|
+
alignItems: "center",
|
|
63
|
+
position: "relative",
|
|
64
|
+
boxSizing: "border-box",
|
|
65
|
+
...scrollerLayout.strategy === ScrollStrategy.Horizontal ? {
|
|
66
|
+
flexDirection: "row",
|
|
67
|
+
minHeight: "100%"
|
|
68
|
+
} : {
|
|
69
|
+
flexDirection: "column",
|
|
70
|
+
minWidth: "fit-content"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
children: scrollerLayout.items.map((item) => /* @__PURE__ */ jsx(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
style: {
|
|
77
|
+
display: "flex",
|
|
78
|
+
justifyContent: "center",
|
|
79
|
+
gap: scrollerLayout.pageGap
|
|
80
|
+
},
|
|
81
|
+
children: item.pageLayouts.map((layout) => /* @__PURE__ */ jsx(
|
|
82
|
+
"div",
|
|
83
|
+
{
|
|
84
|
+
style: {
|
|
85
|
+
width: `${layout.rotatedWidth}px`,
|
|
86
|
+
height: `${layout.rotatedHeight}px`
|
|
87
|
+
},
|
|
88
|
+
children: renderPage({
|
|
89
|
+
...layout,
|
|
90
|
+
rotation: coreState.core.rotation,
|
|
91
|
+
scale: coreState.core.scale,
|
|
92
|
+
document: coreState.core.document
|
|
93
|
+
})
|
|
94
|
+
},
|
|
95
|
+
layout.pageNumber
|
|
96
|
+
))
|
|
97
|
+
},
|
|
98
|
+
item.pageNumbers[0]
|
|
99
|
+
))
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
/* @__PURE__ */ jsx(
|
|
103
|
+
"div",
|
|
104
|
+
{
|
|
105
|
+
style: {
|
|
106
|
+
...scrollerLayout.strategy === ScrollStrategy.Horizontal ? {
|
|
107
|
+
width: scrollerLayout.endSpacing,
|
|
108
|
+
height: "100%",
|
|
109
|
+
flexShrink: 0
|
|
110
|
+
} : {
|
|
111
|
+
height: scrollerLayout.endSpacing,
|
|
112
|
+
width: "100%"
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
),
|
|
117
|
+
overlayElements
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
export {
|
|
123
|
+
Scroller,
|
|
124
|
+
useScroll,
|
|
125
|
+
useScrollCapability
|
|
126
|
+
};
|
|
127
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/react/hooks/use-scroll.ts","../../src/react/components/scroller.tsx"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/react';\nimport { ScrollPlugin } from '@embedpdf/plugin-scroll';\n\nexport const useScroll = () => usePlugin<ScrollPlugin>(ScrollPlugin.id);\nexport const useScrollCapability = () => useCapability<ScrollPlugin>(ScrollPlugin.id);\n","import React, { ReactNode, useEffect, useState } from 'react';\nimport { ScrollStrategy, ScrollerLayout, PageLayout } from '@embedpdf/plugin-scroll';\nimport { useRegistry } from '@embedpdf/core/react';\nimport { PdfDocumentObject, Rotation } from '@embedpdf/models';\n\nimport { useScrollCapability } from '../hooks';\n\ninterface RenderPageProps extends PageLayout {\n rotation: Rotation;\n scale: number;\n document: PdfDocumentObject | null;\n}\n\ntype ScrollerProps = React.HTMLAttributes<HTMLDivElement> & {\n renderPage: (props: RenderPageProps) => ReactNode;\n overlayElements?: ReactNode[];\n};\n\nexport function Scroller({ renderPage, overlayElements, ...props }: ScrollerProps) {\n const { provides: scrollProvides } = useScrollCapability();\n const { registry } = useRegistry();\n const [scrollerLayout, setScrollerLayout] = useState<ScrollerLayout | null>(\n () => scrollProvides?.getScrollerLayout() ?? null,\n );\n\n useEffect(() => {\n if (!scrollProvides) return;\n\n return scrollProvides.onScrollerData(setScrollerLayout);\n }, [scrollProvides]);\n\n if (!scrollerLayout) return null;\n if (!registry) return null;\n\n const coreState = registry.getStore().getState();\n\n return (\n <div\n {...props}\n style={{\n width: `${scrollerLayout.totalWidth}px`,\n height: `${scrollerLayout.totalHeight}px`,\n position: 'relative',\n boxSizing: 'border-box',\n margin: '0 auto',\n ...(scrollerLayout.strategy === ScrollStrategy.Horizontal && {\n display: 'flex',\n flexDirection: 'row',\n }),\n }}\n >\n <div\n style={{\n ...(scrollerLayout.strategy === ScrollStrategy.Horizontal\n ? {\n width: scrollerLayout.startSpacing,\n height: '100%',\n flexShrink: 0,\n }\n : {\n height: scrollerLayout.startSpacing,\n width: '100%',\n }),\n }}\n />\n <div\n style={{\n gap: scrollerLayout.pageGap,\n display: 'flex',\n alignItems: 'center',\n position: 'relative',\n boxSizing: 'border-box',\n ...(scrollerLayout.strategy === ScrollStrategy.Horizontal\n ? {\n flexDirection: 'row',\n minHeight: '100%',\n }\n : {\n flexDirection: 'column',\n minWidth: 'fit-content',\n }),\n }}\n >\n {scrollerLayout.items.map((item) => (\n <div\n key={item.pageNumbers[0]}\n style={{\n display: 'flex',\n justifyContent: 'center',\n gap: scrollerLayout.pageGap,\n }}\n >\n {item.pageLayouts.map((layout) => (\n <div\n key={layout.pageNumber}\n style={{\n width: `${layout.rotatedWidth}px`,\n height: `${layout.rotatedHeight}px`,\n }}\n >\n {renderPage({\n ...layout,\n rotation: coreState.core.rotation,\n scale: coreState.core.scale,\n document: coreState.core.document,\n })}\n </div>\n ))}\n </div>\n ))}\n </div>\n <div\n style={{\n ...(scrollerLayout.strategy === ScrollStrategy.Horizontal\n ? {\n width: scrollerLayout.endSpacing,\n height: '100%',\n flexShrink: 0,\n }\n : {\n height: scrollerLayout.endSpacing,\n width: '100%',\n }),\n }}\n />\n {overlayElements}\n </div>\n );\n}\n"],"mappings":";AAAA,SAAS,eAAe,iBAAiB;AACzC,SAAS,oBAAoB;AAEtB,IAAM,YAAY,MAAM,UAAwB,aAAa,EAAE;AAC/D,IAAM,sBAAsB,MAAM,cAA4B,aAAa,EAAE;;;ACJpF,SAA2B,WAAW,gBAAgB;AACtD,S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3C;AAAA,gBACE,eAAe;AAAA,gBACf,WAAW;AAAA,cACb,IACA;AAAA,gBACE,eAAe;AAAA,gBACf,UAAU;AAAA,cACZ;AAAA,YACN;AAAA,YAEC,yBAAe,MAAM,IAAI,CAAC,SACzB;AAAA,cAAC;AAAA;AAAA,gBAEC,OAAO;AAAA,kBACL,SAAS;AAAA,kBACT,gBAAgB;AAAA,kBAChB,KAAK,eAAe;AAAA,gBACtB;AAAA,gBAEC,eAAK,YAAY,IAAI,CAAC,WACrB;AAAA,kBAAC;AAAA;AAAA,oBAEC,OAAO;AAAA,sBACL,OAAO,GAAG,OAAO,YAAY;AAAA,sBAC7B,QAAQ,GAAG,OAAO,aAAa;AAAA,oBACjC;AAAA,oBAEC,qBAAW;AAAA,sBACV,GAAG;AAAA,sBACH,UAAU,UAAU,KAAK;AAAA,sBACzB,OAAO,UAAU,KAAK;AAAA,sBACtB,UAAU,UAAU,KAAK;AAAA,oBAC3B,CAAC;AAAA;AAAA,kBAXI,OAAO;AAAA,gBAYd,CACD;AAAA;AAAA,cAtBI,KAAK,YAAY,CAAC;AAAA,YAuBzB,CACD;AAAA;AAAA,QACH;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,cACL,GAAI,eAAe,aAAa,eAAe,aAC3C;AAAA,gBACE,OAAO,eAAe;AAAA,gBACtB,QAAQ;AAAA,gBACR,YAAY;AAAA,cACd,IACA;AAAA,gBACE,QAAQ,eAAe;AAAA,gBACvB,OAAO;AAAA,cACT;AAAA,YACN;AAAA;AAAA,QACF;AAAA,QACC;AAAA;AAAA;AAAA,EACH;AAEJ;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@embedpdf/plugin-scroll",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.cjs",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"require": "./dist/index.cjs"
|
|
13
|
+
},
|
|
14
|
+
"./preact": {
|
|
15
|
+
"types": "./dist/preact/index.d.ts",
|
|
16
|
+
"import": "./dist/preact/index.js",
|
|
17
|
+
"require": "./dist/preact/index.cjs"
|
|
18
|
+
},
|
|
19
|
+
"./react": {
|
|
20
|
+
"types": "./dist/react/index.d.ts",
|
|
21
|
+
"import": "./dist/react/index.js",
|
|
22
|
+
"require": "./dist/react/index.cjs"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/react": "^18.2.0",
|
|
28
|
+
"tsup": "^8.0.0",
|
|
29
|
+
"typescript": "^5.0.0",
|
|
30
|
+
"@embedpdf/models": "1.0.0",
|
|
31
|
+
"@embedpdf/plugin-viewport": "1.0.0"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"react": ">=16.8.0",
|
|
35
|
+
"react-dom": ">=16.8.0",
|
|
36
|
+
"preact": "^10.26.4",
|
|
37
|
+
"@embedpdf/core": "1.0.0",
|
|
38
|
+
"@embedpdf/plugin-viewport": "1.0.0"
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"dist",
|
|
42
|
+
"README.md"
|
|
43
|
+
],
|
|
44
|
+
"repository": {
|
|
45
|
+
"type": "git",
|
|
46
|
+
"url": "https://github.com/embedpdf/embed-pdf-viewer",
|
|
47
|
+
"directory": "packages/plugin-scroll"
|
|
48
|
+
},
|
|
49
|
+
"homepage": "https://www.embedpdf.com/docs",
|
|
50
|
+
"bugs": {
|
|
51
|
+
"url": "https://github.com/embedpdf/embed-pdf-viewer/issues"
|
|
52
|
+
},
|
|
53
|
+
"publishConfig": {
|
|
54
|
+
"access": "public"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "PROJECT_CWD=$(pwd) pnpm -w p:build",
|
|
58
|
+
"build:watch": "PROJECT_CWD=$(pwd) pnpm -w p:build:watch",
|
|
59
|
+
"clean": "PROJECT_CWD=$(pwd) pnpm -w p:clean",
|
|
60
|
+
"lint": "PROJECT_CWD=$(pwd) pnpm -w p:lint",
|
|
61
|
+
"lint:fix": "PROJECT_CWD=$(pwd) pnpm -w p:lint:fix",
|
|
62
|
+
"typecheck": "PROJECT_CWD=$(pwd) pnpm -w p:typecheck"
|
|
63
|
+
}
|
|
64
|
+
}
|