@openpageflip/react 0.0.1 → 0.1.1
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/README.md +53 -2
- package/dist/index.d.ts +31 -2
- package/dist/index.js +159 -0
- package/dist/index.js.map +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,10 +2,61 @@
|
|
|
2
2
|
|
|
3
3
|
React 19 bindings for [`@openpageflip/core`](https://www.npmjs.com/package/@openpageflip/core). Successor to [`react-pageflip`](https://www.npmjs.com/package/react-pageflip).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Docs, live demos, the API reference and the changelog: **https://benhonda.github.io/openpageflip/**
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
8
|
bun add @openpageflip/core @openpageflip/react
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Every direct child of `FlipBook` is a page. `Page` marks the hard ones and styles the page element itself. `ref` is the core `Book`.
|
|
12
|
+
|
|
13
|
+
<!-- example: apps/docs/src/examples/react/Quickstart.tsx -->
|
|
14
|
+
```tsx
|
|
15
|
+
import "@openpageflip/core/styles.css";
|
|
16
|
+
import { type Book, FlipBook, Page } from "@openpageflip/react";
|
|
17
|
+
import { useRef } from "react";
|
|
18
|
+
|
|
19
|
+
export default function Quickstart() {
|
|
20
|
+
const book = useRef<Book>(null);
|
|
21
|
+
return (
|
|
22
|
+
<>
|
|
23
|
+
<FlipBook ref={book} className="book" width={400} height={560} size="stretch" cover>
|
|
24
|
+
<Page density="hard" className="page page-cover">
|
|
25
|
+
<h2>OpenPageFlip</h2>
|
|
26
|
+
<p>A page-turn effect for React</p>
|
|
27
|
+
</Page>
|
|
28
|
+
<Page className="page">
|
|
29
|
+
<h3>Every child is a page</h3>
|
|
30
|
+
<p>Wrap one in Page to make it hard or to style the page element itself.</p>
|
|
31
|
+
</Page>
|
|
32
|
+
<Page className="page">
|
|
33
|
+
<h3>No refs on pages</h3>
|
|
34
|
+
<p>The book owns the page elements. Your components render inside them.</p>
|
|
35
|
+
</Page>
|
|
36
|
+
<Page className="page">
|
|
37
|
+
<h3>Props are options</h3>
|
|
38
|
+
<p>Change one and the book rebuilds on the same page. Children can change freely.</p>
|
|
39
|
+
</Page>
|
|
40
|
+
<Page className="page">
|
|
41
|
+
<h3>Renders on the server</h3>
|
|
42
|
+
<p>This page was server-rendered by the docs site, then hydrated.</p>
|
|
43
|
+
</Page>
|
|
44
|
+
<Page density="hard" className="page page-cover">
|
|
45
|
+
<p>The end</p>
|
|
46
|
+
</Page>
|
|
47
|
+
</FlipBook>
|
|
48
|
+
<p className="controls">
|
|
49
|
+
<button type="button" onClick={() => book.current?.flipPrev()}>
|
|
50
|
+
Previous
|
|
51
|
+
</button>
|
|
52
|
+
<button type="button" onClick={() => book.current?.flipNext()}>
|
|
53
|
+
Next
|
|
54
|
+
</button>
|
|
55
|
+
</p>
|
|
56
|
+
</>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
<!-- /example -->
|
|
61
|
+
|
|
62
|
+
The code above is the docs site's own example and runs in its test suite. Pre-1.0: the plan, decisions and status live in the repository's [SPEC.md](https://github.com/benhonda/openpageflip/blob/main/SPEC.md).
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { Book, Book as Book$1, BookEvents, BookEvents as BookEvents$1, BookOptions, BookOptions as BookOptions$1, BookRect, FlipCorner, FlipState, Layout, Orientation, PageDensity, PageDensity as PageDensity$1 } from "@openpageflip/core";
|
|
2
|
+
import { CSSProperties, HTMLAttributes, ReactElement, ReactNode, Ref } from "react";
|
|
3
|
+
//#region src/FlipBook.d.ts
|
|
4
|
+
/** `onFlip`, `onChangeState`, ... one prop per core event, typed from the core's event map. */
|
|
5
|
+
type FlipBookEventProps = { [K in keyof BookEvents$1 as `on${Capitalize<K>}`]?: (event: BookEvents$1[K]) => void; };
|
|
6
|
+
type FlipBookProps = Omit<BookOptions$1, "pages"> & FlipBookEventProps & {
|
|
7
|
+
/** The book's API, available from the moment the component mounts. */
|
|
8
|
+
ref?: Ref<Book$1>;
|
|
9
|
+
/** Each child is a page. Use `Page` to mark hard pages or style the page element. */
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
/** Controlled page: when it changes, the book flips there. Pair with `onFlip`. */
|
|
12
|
+
page?: number;
|
|
13
|
+
className?: string;
|
|
14
|
+
style?: CSSProperties;
|
|
15
|
+
};
|
|
16
|
+
declare function FlipBook({ ref, children, page, className, style, onInit, onUpdate, onFlip, onChangeState, onChangeOrientation, ...options }: FlipBookProps): ReactElement;
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/Page.d.ts
|
|
19
|
+
type PageProps = HTMLAttributes<HTMLDivElement> & {
|
|
20
|
+
/** `hard` pages turn as a rigid sheet. @default "soft" */
|
|
21
|
+
density?: PageDensity$1;
|
|
22
|
+
children?: ReactNode;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* One page of a `FlipBook`. Any child of `FlipBook` becomes a page; `Page` is the way to say
|
|
26
|
+
* which are hard and to put a class or style on the page element itself.
|
|
27
|
+
*/
|
|
28
|
+
declare function Page({ density, children, ...rest }: PageProps): ReactElement;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { type Book, type BookEvents, type BookOptions, type BookRect, FlipBook, type FlipBookEventProps, type FlipBookProps, type FlipCorner, type FlipState, type Layout, type Orientation, Page, type PageDensity, type PageProps };
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1 +1,160 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { FlipCorner, createBook } from "@openpageflip/core";
|
|
3
|
+
import { Children, isValidElement, useEffect, useImperativeHandle, useLayoutEffect, useRef } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/Page.tsx
|
|
6
|
+
/**
|
|
7
|
+
* One page of a `FlipBook`. Any child of `FlipBook` becomes a page; `Page` is the way to say
|
|
8
|
+
* which are hard and to put a class or style on the page element itself.
|
|
9
|
+
*/
|
|
10
|
+
function Page({ density, children, ...rest }) {
|
|
11
|
+
return /* @__PURE__ */ jsx("div", {
|
|
12
|
+
"data-density": density,
|
|
13
|
+
...rest,
|
|
14
|
+
children
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/FlipBook.tsx
|
|
19
|
+
const PAGE_ATTR = "data-opf-page";
|
|
20
|
+
/** Page elements rendered by this component, in order, skipping the core's transient clone. */
|
|
21
|
+
function collectPages(container) {
|
|
22
|
+
return Array.from(container.querySelectorAll(`:scope > [${PAGE_ATTR}]:not([data-opf-clone])`));
|
|
23
|
+
}
|
|
24
|
+
function sameElements(a, b) {
|
|
25
|
+
return a.length === b.length && a.every((el, i) => el === b[i]);
|
|
26
|
+
}
|
|
27
|
+
function renderPage(child) {
|
|
28
|
+
if (child === null || child === void 0 || typeof child === "boolean") return null;
|
|
29
|
+
if (isValidElement(child) && child.type === Page) {
|
|
30
|
+
const { density, children, ...rest } = child.props;
|
|
31
|
+
return /* @__PURE__ */ jsx("div", {
|
|
32
|
+
...rest,
|
|
33
|
+
[PAGE_ATTR]: "",
|
|
34
|
+
"data-density": density,
|
|
35
|
+
children
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return /* @__PURE__ */ jsx("div", {
|
|
39
|
+
[PAGE_ATTR]: "",
|
|
40
|
+
children: child
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function FlipBook({ ref, children, page, className, style, onInit, onUpdate, onFlip, onChangeState, onChangeOrientation, ...options }) {
|
|
44
|
+
const container = useRef(null);
|
|
45
|
+
const bookRef = useRef(null);
|
|
46
|
+
const pagesRef = useRef([]);
|
|
47
|
+
const latest = useRef({
|
|
48
|
+
onInit,
|
|
49
|
+
onUpdate,
|
|
50
|
+
onFlip,
|
|
51
|
+
onChangeState,
|
|
52
|
+
onChangeOrientation,
|
|
53
|
+
easing: options.easing
|
|
54
|
+
});
|
|
55
|
+
useLayoutEffect(() => {
|
|
56
|
+
latest.current = {
|
|
57
|
+
onInit,
|
|
58
|
+
onUpdate,
|
|
59
|
+
onFlip,
|
|
60
|
+
onChangeState,
|
|
61
|
+
onChangeOrientation,
|
|
62
|
+
easing: options.easing
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
const { easing: _easing, startPage, ...settings } = options;
|
|
66
|
+
const settingsKey = JSON.stringify(settings);
|
|
67
|
+
const initialPage = page ?? startPage;
|
|
68
|
+
useLayoutEffect(() => {
|
|
69
|
+
const el = container.current;
|
|
70
|
+
if (el === null) return;
|
|
71
|
+
const pages = collectPages(el);
|
|
72
|
+
pagesRef.current = pages;
|
|
73
|
+
const book = createBook(el, {
|
|
74
|
+
...settings,
|
|
75
|
+
easing: (t) => latest.current.easing?.(t) ?? t,
|
|
76
|
+
pages,
|
|
77
|
+
startPage: Math.min(bookRef.current?.page ?? initialPage ?? 0, pages.length - 1)
|
|
78
|
+
});
|
|
79
|
+
book.on("init", (e) => latest.current.onInit?.(e));
|
|
80
|
+
book.on("update", (e) => latest.current.onUpdate?.(e));
|
|
81
|
+
book.on("flip", (e) => latest.current.onFlip?.(e));
|
|
82
|
+
book.on("changeState", (e) => latest.current.onChangeState?.(e));
|
|
83
|
+
book.on("changeOrientation", (e) => latest.current.onChangeOrientation?.(e));
|
|
84
|
+
bookRef.current = book;
|
|
85
|
+
return () => {
|
|
86
|
+
book.destroy();
|
|
87
|
+
bookRef.current = null;
|
|
88
|
+
};
|
|
89
|
+
}, [settingsKey]);
|
|
90
|
+
useLayoutEffect(() => {
|
|
91
|
+
const book = bookRef.current;
|
|
92
|
+
const el = container.current;
|
|
93
|
+
if (book === null || el === null) return;
|
|
94
|
+
const pages = collectPages(el);
|
|
95
|
+
if (sameElements(pages, pagesRef.current)) {
|
|
96
|
+
book.redraw();
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
pagesRef.current = pages;
|
|
100
|
+
book.setPages(pages);
|
|
101
|
+
});
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
const book = bookRef.current;
|
|
104
|
+
if (book === null || page === void 0 || page === book.page) return;
|
|
105
|
+
book.flipTo(page);
|
|
106
|
+
}, [page]);
|
|
107
|
+
useImperativeHandle(ref, () => handleFor(bookRef), []);
|
|
108
|
+
return /* @__PURE__ */ jsx("div", {
|
|
109
|
+
ref: container,
|
|
110
|
+
className,
|
|
111
|
+
style,
|
|
112
|
+
children: Children.map(children, renderPage)
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
/** A `Book` that always talks to the current instance and says so when there is none. */
|
|
116
|
+
function handleFor(bookRef) {
|
|
117
|
+
const live = () => {
|
|
118
|
+
if (bookRef.current === null) throw new Error("@openpageflip/react: FlipBook is not mounted");
|
|
119
|
+
return bookRef.current;
|
|
120
|
+
};
|
|
121
|
+
return {
|
|
122
|
+
get page() {
|
|
123
|
+
return live().page;
|
|
124
|
+
},
|
|
125
|
+
get pageCount() {
|
|
126
|
+
return live().pageCount;
|
|
127
|
+
},
|
|
128
|
+
get orientation() {
|
|
129
|
+
return live().orientation;
|
|
130
|
+
},
|
|
131
|
+
get state() {
|
|
132
|
+
return live().state;
|
|
133
|
+
},
|
|
134
|
+
get rect() {
|
|
135
|
+
return live().rect;
|
|
136
|
+
},
|
|
137
|
+
on: (name, listener, options) => live().on(name, listener, options),
|
|
138
|
+
off: (name, listener) => live().off(name, listener),
|
|
139
|
+
flipNext: (corner = FlipCorner.top) => live().flipNext(corner),
|
|
140
|
+
flipPrev: (corner = FlipCorner.top) => live().flipPrev(corner),
|
|
141
|
+
flipTo: (page, corner = FlipCorner.top) => live().flipTo(page, corner),
|
|
142
|
+
turnTo: (page) => live().turnTo(page),
|
|
143
|
+
turnNext: () => live().turnNext(),
|
|
144
|
+
turnPrev: () => live().turnPrev(),
|
|
145
|
+
setPages: (pages) => live().setPages(pages),
|
|
146
|
+
update: () => live().update(),
|
|
147
|
+
redraw: () => live().redraw(),
|
|
148
|
+
destroy: () => live().destroy()
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
//#endregion
|
|
152
|
+
//#region src/index.ts
|
|
153
|
+
/**
|
|
154
|
+
* React 19 bindings: `FlipBook`, `Page`, and the core types they use.
|
|
155
|
+
* @module @openpageflip/react
|
|
156
|
+
*/
|
|
157
|
+
//#endregion
|
|
158
|
+
export { FlipBook, Page };
|
|
159
|
+
|
|
160
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/Page.tsx","../src/FlipBook.tsx","../src/index.ts"],"sourcesContent":["import type { PageDensity } from \"@openpageflip/core\";\nimport type { HTMLAttributes, ReactElement, ReactNode } from \"react\";\n\nexport type PageProps = HTMLAttributes<HTMLDivElement> & {\n /** `hard` pages turn as a rigid sheet. @default \"soft\" */\n density?: PageDensity;\n children?: ReactNode;\n};\n\n/**\n * One page of a `FlipBook`. Any child of `FlipBook` becomes a page; `Page` is the way to say\n * which are hard and to put a class or style on the page element itself.\n */\nexport function Page({ density, children, ...rest }: PageProps): ReactElement {\n return (\n <div data-density={density} {...rest}>\n {children}\n </div>\n );\n}\n","\"use client\";\n\nimport {\n type Book,\n type BookEvents,\n type BookOptions,\n createBook,\n FlipCorner,\n} from \"@openpageflip/core\";\nimport {\n Children,\n type CSSProperties,\n isValidElement,\n type ReactElement,\n type ReactNode,\n type Ref,\n useEffect,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n} from \"react\";\nimport { Page, type PageProps } from \"./Page.tsx\";\n\n/** `onFlip`, `onChangeState`, ... one prop per core event, typed from the core's event map. */\nexport type FlipBookEventProps = {\n [K in keyof BookEvents as `on${Capitalize<K>}`]?: (event: BookEvents[K]) => void;\n};\n\nexport type FlipBookProps = Omit<BookOptions, \"pages\"> &\n FlipBookEventProps & {\n /** The book's API, available from the moment the component mounts. */\n ref?: Ref<Book>;\n /** Each child is a page. Use `Page` to mark hard pages or style the page element. */\n children: ReactNode;\n /** Controlled page: when it changes, the book flips there. Pair with `onFlip`. */\n page?: number;\n className?: string;\n style?: CSSProperties;\n };\n\nconst PAGE_ATTR = \"data-opf-page\";\n\n/** Page elements rendered by this component, in order, skipping the core's transient clone. */\nfunction collectPages(container: HTMLElement): HTMLElement[] {\n return Array.from(\n container.querySelectorAll<HTMLElement>(`:scope > [${PAGE_ATTR}]:not([data-opf-clone])`),\n );\n}\n\nfunction sameElements(a: readonly HTMLElement[], b: readonly HTMLElement[]): boolean {\n return a.length === b.length && a.every((el, i) => el === b[i]);\n}\n\nfunction renderPage(child: ReactNode): ReactElement | null {\n if (child === null || child === undefined || typeof child === \"boolean\") return null;\n if (isValidElement<PageProps>(child) && child.type === Page) {\n const { density, children, ...rest } = child.props;\n return (\n <div {...rest} {...{ [PAGE_ATTR]: \"\" }} data-density={density}>\n {children}\n </div>\n );\n }\n return <div {...{ [PAGE_ATTR]: \"\" }}>{child}</div>;\n}\n\nexport function FlipBook({\n ref,\n children,\n page,\n className,\n style,\n onInit,\n onUpdate,\n onFlip,\n onChangeState,\n onChangeOrientation,\n ...options\n}: FlipBookProps): ReactElement {\n const container = useRef<HTMLDivElement>(null);\n const bookRef = useRef<Book | null>(null);\n const pagesRef = useRef<HTMLElement[]>([]);\n\n // Callbacks and the easing function are read live, so new closures each render do not rebuild the book.\n const latest = useRef({\n onInit,\n onUpdate,\n onFlip,\n onChangeState,\n onChangeOrientation,\n easing: options.easing,\n });\n useLayoutEffect(() => {\n latest.current = {\n onInit,\n onUpdate,\n onFlip,\n onChangeState,\n onChangeOrientation,\n easing: options.easing,\n };\n });\n\n // Everything else about the book is fixed at creation, so a change means a new book.\n const { easing: _easing, startPage, ...settings } = options;\n const settingsKey = JSON.stringify(settings);\n const initialPage = page ?? startPage;\n\n // `initialPage` only seeds a new book; the controlled `page` effect below handles changes.\n // biome-ignore lint/correctness/useExhaustiveDependencies: settingsKey is the serialised settings\n useLayoutEffect(() => {\n const el = container.current;\n if (el === null) return;\n const pages = collectPages(el);\n pagesRef.current = pages;\n // `settings` is the value from the render that changed `settingsKey`, so it is current here.\n const book = createBook(el, {\n ...settings,\n easing: (t) => latest.current.easing?.(t) ?? t,\n pages,\n // Keep the page a previous book was on when only settings changed.\n startPage: Math.min(bookRef.current?.page ?? initialPage ?? 0, pages.length - 1),\n });\n book.on(\"init\", (e) => latest.current.onInit?.(e));\n book.on(\"update\", (e) => latest.current.onUpdate?.(e));\n book.on(\"flip\", (e) => latest.current.onFlip?.(e));\n book.on(\"changeState\", (e) => latest.current.onChangeState?.(e));\n book.on(\"changeOrientation\", (e) => latest.current.onChangeOrientation?.(e));\n bookRef.current = book;\n return () => {\n book.destroy();\n bookRef.current = null;\n };\n }, [settingsKey]);\n\n // After every commit: adopt added or removed pages, and re-apply the book's own classes and\n // layout in case React rewrote a page's attributes.\n useLayoutEffect(() => {\n const book = bookRef.current;\n const el = container.current;\n if (book === null || el === null) return;\n const pages = collectPages(el);\n if (sameElements(pages, pagesRef.current)) {\n book.redraw();\n return;\n }\n pagesRef.current = pages;\n book.setPages(pages);\n });\n\n useEffect(() => {\n const book = bookRef.current;\n if (book === null || page === undefined || page === book.page) return;\n void book.flipTo(page);\n }, [page]);\n\n useImperativeHandle(ref, () => handleFor(bookRef), []);\n\n return (\n <div ref={container} className={className} style={style}>\n {Children.map(children, renderPage)}\n </div>\n );\n}\n\n/** A `Book` that always talks to the current instance and says so when there is none. */\nfunction handleFor(bookRef: { current: Book | null }): Book {\n const live = (): Book => {\n if (bookRef.current === null) throw new Error(\"@openpageflip/react: FlipBook is not mounted\");\n return bookRef.current;\n };\n return {\n get page() {\n return live().page;\n },\n get pageCount() {\n return live().pageCount;\n },\n get orientation() {\n return live().orientation;\n },\n get state() {\n return live().state;\n },\n get rect() {\n return live().rect;\n },\n on: (name, listener, options) => live().on(name, listener, options),\n off: (name, listener) => live().off(name, listener),\n flipNext: (corner = FlipCorner.top) => live().flipNext(corner),\n flipPrev: (corner = FlipCorner.top) => live().flipPrev(corner),\n flipTo: (page, corner = FlipCorner.top) => live().flipTo(page, corner),\n turnTo: (page) => live().turnTo(page),\n turnNext: () => live().turnNext(),\n turnPrev: () => live().turnPrev(),\n setPages: (pages) => live().setPages(pages),\n update: () => live().update(),\n redraw: () => live().redraw(),\n destroy: () => live().destroy(),\n };\n}\n","/**\n * React 19 bindings: `FlipBook`, `Page`, and the core types they use.\n * @module @openpageflip/react\n */\n\"use client\";\n\nexport type {\n Book,\n BookEvents,\n BookOptions,\n BookRect,\n FlipCorner,\n FlipState,\n Layout,\n Orientation,\n PageDensity,\n} from \"@openpageflip/core\";\nexport { FlipBook, type FlipBookEventProps, type FlipBookProps } from \"./FlipBook.tsx\";\nexport { Page, type PageProps } from \"./Page.tsx\";\n"],"mappings":";;;;;;;;;AAaA,SAAgB,KAAK,EAAE,SAAS,UAAU,GAAG,QAAiC;CAC5E,OACE,oBAAC,OAAD;EAAK,gBAAc;EAAS,GAAI;EAC7B;CACE,CAAA;AAET;;;ACqBA,MAAM,YAAY;;AAGlB,SAAS,aAAa,WAAuC;CAC3D,OAAO,MAAM,KACX,UAAU,iBAA8B,aAAa,UAAU,wBAAwB,CACzF;AACF;AAEA,SAAS,aAAa,GAA2B,GAAoC;CACnF,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,IAAI,MAAM,OAAO,EAAE,EAAE;AAChE;AAEA,SAAS,WAAW,OAAuC;CACzD,IAAI,UAAU,QAAQ,UAAU,KAAA,KAAa,OAAO,UAAU,WAAW,OAAO;CAChF,IAAI,eAA0B,KAAK,KAAK,MAAM,SAAS,MAAM;EAC3D,MAAM,EAAE,SAAS,UAAU,GAAG,SAAS,MAAM;EAC7C,OACE,oBAAC,OAAD;GAAK,GAAI;IAAa,YAAY;GAAM,gBAAc;GACnD;EACE,CAAA;CAET;CACA,OAAO,oBAAC,OAAD;GAAY,YAAY;EAAO,UAAA;CAAW,CA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,QAAQ,KAAK,CAAC,CAAC,OAAO,MAAM,MAAM;EACrE,SAAS,SAAS,KAAK,CAAC,CAAC,OAAO,IAAI;EACpC,gBAAgB,KAAK,CAAC,CAAC,SAAS;EAChC,gBAAgB,KAAK,CAAC,CAAC,SAAS;EAChC,WAAW,UAAU,KAAK,CAAC,CAAC,SAAS,KAAK;EAC1C,cAAc,KAAK,CAAC,CAAC,OAAO;EAC5B,cAAc,KAAK,CAAC,CAAC,OAAO;EAC5B,eAAe,KAAK,CAAC,CAAC,QAAQ;CAChC;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openpageflip/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "React 19 bindings for @openpageflip/core. Successor to react-pageflip.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@openpageflip/core": "^0.
|
|
30
|
+
"@openpageflip/core": "^0.1.0",
|
|
31
31
|
"react": "^19.2.8"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|