@nypl/web-reader 3.2.5 → 4.1.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/README.md +2 -23
- package/dist/cjs/index.js +62 -16
- package/dist/cjs/index.js.map +3 -3
- package/dist/esm/index.js +1074 -563
- package/dist/esm/index.js.map +3 -3
- package/dist/types/HtmlReader/types.d.ts +2 -0
- package/dist/types/constants.d.ts +26 -0
- package/dist/types/index.d.ts +0 -1
- package/dist/types/types.d.ts +1 -0
- package/dist/types/ui/HtmlSettings.d.ts +1 -0
- package/dist/types/ui/ToggleButton.d.ts +5 -2
- package/dist/types/ui/icons/Continuous.d.ts +4 -0
- package/dist/types/ui/icons/Day.d.ts +4 -0
- package/dist/types/ui/icons/EnlargeFont.d.ts +4 -0
- package/dist/types/ui/icons/Night.d.ts +4 -0
- package/dist/types/ui/icons/Paginated.d.ts +4 -0
- package/dist/types/ui/icons/Previous.d.ts +4 -0
- package/dist/types/ui/icons/ReaderSettings.d.ts +4 -0
- package/dist/types/ui/icons/ReduceFont.d.ts +4 -0
- package/dist/types/ui/icons/Reset.d.ts +4 -0
- package/dist/types/ui/icons/Sepia.d.ts +4 -0
- package/dist/types/ui/icons/TableOfContents.d.ts +4 -0
- package/dist/types/ui/icons/ToggleFullScreen.d.ts +4 -0
- package/dist/types/ui/icons/ToggleFullScreenExit.d.ts +4 -0
- package/dist/types/ui/icons/index.d.ts +14 -0
- package/dist/types/ui/menu/use-menu.d.ts +18 -18
- package/dist/types/ui/theme/components/button.d.ts +21 -14
- package/dist/types/ui/theme/foundations/fonts.d.ts +3 -0
- package/dist/types/ui/theme/foundations/typography.d.ts +6 -0
- package/package.json +13 -17
- package/dist/cjs/ServiceWorker/sw.js +0 -2
- package/dist/cjs/ServiceWorker/sw.js.map +0 -7
- package/dist/esm/ServiceWorker/sw.js +0 -1749
- package/dist/esm/ServiceWorker/sw.js.map +0 -7
- package/dist/types/ServiceWorker/client.d.ts +0 -6
- package/dist/types/ServiceWorker/constants.d.ts +0 -4
- package/dist/types/ServiceWorker/index.d.ts +0 -1
- package/dist/types/ServiceWorker/sw.d.ts +0 -19
- package/dist/types/ServiceWorker/types.d.ts +0 -13
package/dist/esm/index.js
CHANGED
|
@@ -1743,6 +1743,7 @@ var require_factoryWithThrowingShims = __commonJS({
|
|
|
1743
1743
|
;
|
|
1744
1744
|
var ReactPropTypes = {
|
|
1745
1745
|
array: shim,
|
|
1746
|
+
bigint: shim,
|
|
1746
1747
|
bool: shim,
|
|
1747
1748
|
func: shim,
|
|
1748
1749
|
number: shim,
|
|
@@ -13616,7 +13617,7 @@ var require_debounce = __commonJS({
|
|
|
13616
13617
|
});
|
|
13617
13618
|
|
|
13618
13619
|
// src/index.tsx
|
|
13619
|
-
import
|
|
13620
|
+
import React81 from "react";
|
|
13620
13621
|
|
|
13621
13622
|
// node_modules/@emotion/react/dist/emotion-react.browser.esm.js
|
|
13622
13623
|
import * as React2 from "react";
|
|
@@ -34471,126 +34472,366 @@ function mergeThemeCustomizer(source, override, key, object) {
|
|
|
34471
34472
|
}
|
|
34472
34473
|
|
|
34473
34474
|
// src/ui/ErrorBoundary.tsx
|
|
34474
|
-
import * as
|
|
34475
|
+
import * as React54 from "react";
|
|
34475
34476
|
|
|
34476
34477
|
// src/ui/Header.tsx
|
|
34477
|
-
import
|
|
34478
|
+
import React53 from "react";
|
|
34478
34479
|
|
|
34479
|
-
//
|
|
34480
|
-
import React29 from "react";
|
|
34481
|
-
|
|
34482
|
-
// node_modules/react-icons/lib/esm/iconContext.js
|
|
34480
|
+
// src/ui/Button.tsx
|
|
34483
34481
|
import React28 from "react";
|
|
34484
|
-
var
|
|
34485
|
-
|
|
34486
|
-
|
|
34487
|
-
|
|
34488
|
-
|
|
34489
|
-
|
|
34490
|
-
|
|
34491
|
-
var IconContext = React28.createContext && React28.createContext(DefaultContext);
|
|
34482
|
+
var Button2 = React28.forwardRef((props, ref) => {
|
|
34483
|
+
return /* @__PURE__ */ React28.createElement(Button, __spreadValues({
|
|
34484
|
+
ref,
|
|
34485
|
+
variant: "solid"
|
|
34486
|
+
}, props));
|
|
34487
|
+
});
|
|
34488
|
+
var Button_default = Button2;
|
|
34492
34489
|
|
|
34493
|
-
//
|
|
34494
|
-
var
|
|
34495
|
-
|
|
34496
|
-
|
|
34497
|
-
|
|
34498
|
-
|
|
34499
|
-
|
|
34500
|
-
|
|
34501
|
-
|
|
34502
|
-
|
|
34503
|
-
|
|
34504
|
-
|
|
34490
|
+
// src/constants.ts
|
|
34491
|
+
var ReadiumWebpubContext = "http://readium.org/webpub/default.jsonld";
|
|
34492
|
+
var IS_DEV = false;
|
|
34493
|
+
var HEADER_HEIGHT = 48;
|
|
34494
|
+
var FOOTER_HEIGHT = 48;
|
|
34495
|
+
var CHROME_HEIGHT = HEADER_HEIGHT + FOOTER_HEIGHT;
|
|
34496
|
+
var DEFAULT_HEIGHT = `calc(100vh - ${CHROME_HEIGHT}px)`;
|
|
34497
|
+
var DEFAULT_SHOULD_GROW_WHEN_SCROLLING = true;
|
|
34498
|
+
var DEFAULT_SETTINGS = {
|
|
34499
|
+
colorMode: "day",
|
|
34500
|
+
isScrolling: false,
|
|
34501
|
+
fontSize: 100,
|
|
34502
|
+
fontFamily: "publisher"
|
|
34505
34503
|
};
|
|
34506
|
-
var
|
|
34507
|
-
|
|
34508
|
-
|
|
34509
|
-
|
|
34510
|
-
|
|
34511
|
-
|
|
34512
|
-
|
|
34513
|
-
|
|
34514
|
-
|
|
34515
|
-
|
|
34516
|
-
|
|
34504
|
+
var FONT_DETAILS = {
|
|
34505
|
+
publisher: {
|
|
34506
|
+
heading: "Publisher's default font",
|
|
34507
|
+
body: "Show the publisher's-specified fonts and layout choices in this ebook",
|
|
34508
|
+
token: "body",
|
|
34509
|
+
fontWeight: "light"
|
|
34510
|
+
},
|
|
34511
|
+
serif: {
|
|
34512
|
+
heading: "Serif font",
|
|
34513
|
+
body: "Georgia",
|
|
34514
|
+
token: "serif",
|
|
34515
|
+
fontWeight: "regular"
|
|
34516
|
+
},
|
|
34517
|
+
"sans-serif": {
|
|
34518
|
+
heading: "Sans-serif font",
|
|
34519
|
+
body: "Helvetica",
|
|
34520
|
+
token: "sansSerif",
|
|
34521
|
+
fontWeight: "regular"
|
|
34522
|
+
},
|
|
34523
|
+
"open-dyslexic": {
|
|
34524
|
+
heading: "Dyslexic friendly font",
|
|
34525
|
+
body: "OpenDyslexic",
|
|
34526
|
+
token: "opendyslexic",
|
|
34527
|
+
fontWeight: "regular"
|
|
34528
|
+
}
|
|
34517
34529
|
};
|
|
34518
|
-
|
|
34519
|
-
|
|
34520
|
-
return React29.createElement(node2.tag, __assign2({
|
|
34521
|
-
key: i
|
|
34522
|
-
}, node2.attr), Tree2Element(node2.child));
|
|
34523
|
-
});
|
|
34524
|
-
}
|
|
34525
|
-
function GenIcon(data) {
|
|
34526
|
-
return function(props) {
|
|
34527
|
-
return React29.createElement(IconBase, __assign2({
|
|
34528
|
-
attr: __assign2({}, data.attr)
|
|
34529
|
-
}, props), Tree2Element(data.child));
|
|
34530
|
-
};
|
|
34531
|
-
}
|
|
34532
|
-
function IconBase(props) {
|
|
34533
|
-
var elem = function(conf) {
|
|
34534
|
-
var attr = props.attr, size3 = props.size, title = props.title, svgProps = __rest2(props, ["attr", "size", "title"]);
|
|
34535
|
-
var computedSize = size3 || conf.size || "1em";
|
|
34536
|
-
var className;
|
|
34537
|
-
if (conf.className)
|
|
34538
|
-
className = conf.className;
|
|
34539
|
-
if (props.className)
|
|
34540
|
-
className = (className ? className + " " : "") + props.className;
|
|
34541
|
-
return React29.createElement("svg", __assign2({
|
|
34542
|
-
stroke: "currentColor",
|
|
34543
|
-
fill: "currentColor",
|
|
34544
|
-
strokeWidth: "0"
|
|
34545
|
-
}, conf.attr, attr, svgProps, {
|
|
34546
|
-
className,
|
|
34547
|
-
style: __assign2(__assign2({
|
|
34548
|
-
color: props.color || conf.color
|
|
34549
|
-
}, conf.style), props.style),
|
|
34550
|
-
height: computedSize,
|
|
34551
|
-
width: computedSize,
|
|
34552
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
34553
|
-
}), title && React29.createElement("title", null, title), props.children);
|
|
34554
|
-
};
|
|
34555
|
-
return IconContext !== void 0 ? React29.createElement(IconContext.Consumer, null, function(conf) {
|
|
34556
|
-
return elem(conf);
|
|
34557
|
-
}) : elem(DefaultContext);
|
|
34558
|
-
}
|
|
34530
|
+
var LOCAL_STORAGE_SETTINGS_KEY = "web-reader-settings";
|
|
34531
|
+
var LOCAL_STORAGE_LOCATIONS_KEY = "web-reader-locations";
|
|
34559
34532
|
|
|
34560
|
-
//
|
|
34561
|
-
|
|
34562
|
-
|
|
34563
|
-
|
|
34564
|
-
|
|
34565
|
-
|
|
34566
|
-
}
|
|
34567
|
-
|
|
34568
|
-
|
|
34569
|
-
|
|
34570
|
-
|
|
34571
|
-
|
|
34572
|
-
|
|
34573
|
-
|
|
34574
|
-
|
|
34575
|
-
|
|
34576
|
-
|
|
34577
|
-
|
|
34578
|
-
}
|
|
34579
|
-
|
|
34580
|
-
|
|
34581
|
-
}
|
|
34582
|
-
|
|
34583
|
-
|
|
34584
|
-
|
|
34585
|
-
|
|
34586
|
-
|
|
34587
|
-
|
|
34588
|
-
|
|
34589
|
-
|
|
34590
|
-
}
|
|
34591
|
-
|
|
34592
|
-
|
|
34593
|
-
}
|
|
34533
|
+
// src/ui/icons/Continuous.tsx
|
|
34534
|
+
import React29 from "react";
|
|
34535
|
+
var Continuous = (props) => /* @__PURE__ */ React29.createElement(Icon, __spreadValues({
|
|
34536
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
34537
|
+
fill: "none",
|
|
34538
|
+
viewBox: "0 0 45 45"
|
|
34539
|
+
}, props), /* @__PURE__ */ React29.createElement("mask", {
|
|
34540
|
+
id: "continuous",
|
|
34541
|
+
width: "45",
|
|
34542
|
+
height: "45",
|
|
34543
|
+
x: "0",
|
|
34544
|
+
y: "0",
|
|
34545
|
+
maskUnits: "userSpaceOnUse"
|
|
34546
|
+
}, /* @__PURE__ */ React29.createElement("path", {
|
|
34547
|
+
fill: "#D9D9D9",
|
|
34548
|
+
d: "M0 0h45v45H0z"
|
|
34549
|
+
})), /* @__PURE__ */ React29.createElement("g", {
|
|
34550
|
+
mask: "url(#continuous)"
|
|
34551
|
+
}, /* @__PURE__ */ React29.createElement("path", {
|
|
34552
|
+
fill: props.fill,
|
|
34553
|
+
d: "M10.172 31.875c-2.594 0-4.781-.922-6.563-2.766C1.83 27.266.938 25.047.938 22.453c0-2.594.89-4.797 2.671-6.61 1.782-1.812 3.97-2.718 6.563-2.718 1 0 1.969.172 2.906.516a7.226 7.226 0 0 1 2.531 1.593l4.5 4.032-1.03.937-4.313-3.937A7.456 7.456 0 0 0 12.562 15a7.01 7.01 0 0 0-2.39-.422c-2.188 0-4.031.766-5.531 2.297-1.5 1.531-2.25 3.39-2.25 5.578s.742 4.063 2.226 5.625c1.485 1.563 3.336 2.344 5.555 2.344.812 0 1.61-.14 2.39-.422a7.456 7.456 0 0 0 2.204-1.266l14.625-13.5a6.739 6.739 0 0 1 2.507-1.593 8.575 8.575 0 0 1 2.93-.516c2.594 0 4.781.906 6.563 2.719 1.78 1.812 2.672 4.015 2.672 6.61 0 2.593-.891 4.812-2.672 6.655-1.782 1.844-3.97 2.766-6.563 2.766-1 0-1.96-.188-2.883-.563a10.255 10.255 0 0 1-2.554-1.5l-4.407-4.03.985-1.032 4.312 3.984a5.669 5.669 0 0 0 2.133 1.29 7.587 7.587 0 0 0 2.414.398c2.188 0 4.031-.781 5.531-2.344 1.5-1.562 2.25-3.437 2.25-5.625 0-2.187-.757-4.047-2.273-5.578-1.516-1.531-3.352-2.297-5.508-2.297-.812 0-1.61.149-2.39.445-.782.297-1.5.711-2.157 1.243L15.61 29.813a6.494 6.494 0 0 1-2.507 1.57 8.941 8.941 0 0 1-2.93.492Z"
|
|
34554
|
+
})));
|
|
34555
|
+
var Continuous_default = Continuous;
|
|
34556
|
+
|
|
34557
|
+
// src/ui/icons/Day.tsx
|
|
34558
|
+
import React30 from "react";
|
|
34559
|
+
var Day = (props) => /* @__PURE__ */ React30.createElement(Icon, __spreadValues({
|
|
34560
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
34561
|
+
fill: "none",
|
|
34562
|
+
viewBox: "0 0 41 41"
|
|
34563
|
+
}, props), /* @__PURE__ */ React30.createElement("path", {
|
|
34564
|
+
fill: "#1C1B1F",
|
|
34565
|
+
d: "M20.5 28c-2.094 0-3.867-.727-5.32-2.18C13.727 24.367 13 22.594 13 20.5c0-2.094.727-3.867 2.18-5.32C16.633 13.727 18.406 13 20.5 13c2.094 0 3.867.727 5.32 2.18C27.273 16.633 28 18.406 28 20.5c0 2.094-.727 3.867-2.18 5.32C24.367 27.273 22.594 28 20.5 28ZM1.516 21.203a.675.675 0 0 1-.493-.21.675.675 0 0 1-.21-.493c0-.219.07-.39.21-.516a.718.718 0 0 1 .493-.187h5.156c.187 0 .351.07.492.21.14.141.211.305.211.493 0 .219-.07.39-.21.516a.718.718 0 0 1-.493.187H1.516Zm32.812 0a.675.675 0 0 1-.492-.21.675.675 0 0 1-.211-.493c0-.219.07-.39.21-.516a.718.718 0 0 1 .493-.187h5.156c.188 0 .352.07.493.21.14.141.21.305.21.493 0 .219-.07.39-.21.516a.718.718 0 0 1-.493.187h-5.156ZM20.5 7.375c-.219 0-.39-.07-.516-.21a.718.718 0 0 1-.187-.493V1.516c0-.188.07-.352.21-.493.141-.14.305-.21.493-.21.219 0 .39.07.516.21.125.141.187.305.187.493v5.156c0 .187-.07.351-.21.492a.675.675 0 0 1-.493.211Zm0 32.813c-.219 0-.39-.07-.516-.211a.718.718 0 0 1-.187-.493v-5.156c0-.187.07-.351.21-.492.141-.14.305-.211.493-.211.219 0 .39.07.516.21.125.142.187.306.187.493v5.156c0 .188-.07.352-.21.493a.675.675 0 0 1-.493.21ZM10.234 11.172l-3-2.906a.542.542 0 0 1-.21-.493.961.961 0 0 1 .21-.539A.717.717 0 0 1 7.75 7c.188 0 .36.078.516.234l2.953 2.954a.717.717 0 0 1 .234.515c0 .188-.078.36-.234.516a.636.636 0 0 1-.469.187.717.717 0 0 1-.516-.234Zm22.5 22.594-2.953-2.953a.717.717 0 0 1-.234-.516c0-.188.094-.36.281-.516a.416.416 0 0 1 .422-.21c.188.015.36.1.516.257l3 2.906a.542.542 0 0 1 .21.493.962.962 0 0 1-.21.539.716.716 0 0 1-.516.234.716.716 0 0 1-.516-.234Zm-2.953-22.547a.517.517 0 0 1-.21-.469.817.817 0 0 1 .257-.516l2.906-3a.542.542 0 0 1 .493-.21.961.961 0 0 1 .539.21.717.717 0 0 1 .234.516c0 .188-.078.36-.234.516l-2.953 2.953a.717.717 0 0 1-.516.234.717.717 0 0 1-.516-.234ZM7.234 33.766A.717.717 0 0 1 7 33.25c0-.188.078-.36.234-.516l2.954-2.953a.717.717 0 0 1 .515-.234c.188 0 .36.078.516.234a.636.636 0 0 1 .187.469c0 .188-.078.36-.234.516l-2.906 3A.717.717 0 0 1 7.75 34a.717.717 0 0 1-.516-.234Z"
|
|
34566
|
+
}));
|
|
34567
|
+
var Day_default = Day;
|
|
34568
|
+
|
|
34569
|
+
// src/ui/icons/EnlargeFont.tsx
|
|
34570
|
+
import React31 from "react";
|
|
34571
|
+
var EnlargeFont = (props) => /* @__PURE__ */ React31.createElement(Icon, __spreadValues({
|
|
34572
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
34573
|
+
fill: "none",
|
|
34574
|
+
viewBox: "0 0 46 46"
|
|
34575
|
+
}, props), /* @__PURE__ */ React31.createElement("mask", {
|
|
34576
|
+
id: "enlargeFont",
|
|
34577
|
+
width: "46",
|
|
34578
|
+
height: "46",
|
|
34579
|
+
x: "0",
|
|
34580
|
+
y: "0",
|
|
34581
|
+
maskUnits: "userSpaceOnUse"
|
|
34582
|
+
}, /* @__PURE__ */ React31.createElement("path", {
|
|
34583
|
+
fill: "#D9D9D9",
|
|
34584
|
+
d: "M0 0h45.639v45.639H0z"
|
|
34585
|
+
})), /* @__PURE__ */ React31.createElement("g", {
|
|
34586
|
+
mask: "url(#enlargeFont)"
|
|
34587
|
+
}, /* @__PURE__ */ React31.createElement("path", {
|
|
34588
|
+
fill: props.fill,
|
|
34589
|
+
d: "M3.09 35.18 13.121 10.46h1.854L25.006 35.18h-2.282l-2.757-6.893H7.987L5.229 35.18H3.09Zm5.562-8.747h10.65L14.12 13.502h-.238l-5.23 12.93Zm26.29 3.042V23.77h-5.704V21.87h5.705v-5.705h1.901v5.705h5.705v1.901h-5.705v5.705h-1.901Z"
|
|
34590
|
+
})));
|
|
34591
|
+
var EnlargeFont_default = EnlargeFont;
|
|
34592
|
+
|
|
34593
|
+
// src/ui/icons/Night.tsx
|
|
34594
|
+
import React32 from "react";
|
|
34595
|
+
var Night = (props) => /* @__PURE__ */ React32.createElement(Icon, __spreadValues({
|
|
34596
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
34597
|
+
viewBox: "0 0 45 45",
|
|
34598
|
+
fill: "none"
|
|
34599
|
+
}, props), /* @__PURE__ */ React32.createElement("mask", {
|
|
34600
|
+
id: "night",
|
|
34601
|
+
width: "45",
|
|
34602
|
+
height: "45",
|
|
34603
|
+
x: "0",
|
|
34604
|
+
y: "0",
|
|
34605
|
+
maskUnits: "userSpaceOnUse"
|
|
34606
|
+
}, /* @__PURE__ */ React32.createElement("path", {
|
|
34607
|
+
fill: "#D9D9D9",
|
|
34608
|
+
d: "M0 0h45v45H0z"
|
|
34609
|
+
})), /* @__PURE__ */ React32.createElement("g", {
|
|
34610
|
+
mask: "url(#night)"
|
|
34611
|
+
}, /* @__PURE__ */ React32.createElement("path", {
|
|
34612
|
+
fill: "#FFF",
|
|
34613
|
+
d: "M22.594 37.5c-4.157 0-7.696-1.46-10.617-4.383-2.922-2.922-4.383-6.46-4.383-10.617 0-3.813 1.242-7.11 3.726-9.89 2.485-2.782 5.555-4.422 9.211-4.922h.282c-.563.906-1 1.906-1.313 3a12.224 12.224 0 0 0-.469 3.374c0 3.344 1.172 6.18 3.516 8.508 2.344 2.328 5.172 3.492 8.484 3.492 1.157 0 2.282-.14 3.375-.421a11.62 11.62 0 0 0 3-1.22c-.031.095-.039.15-.023.165l.023.023c-.5 3.657-2.14 6.72-4.922 9.188-2.78 2.469-6.078 3.703-9.89 3.703Z"
|
|
34614
|
+
})));
|
|
34615
|
+
var Night_default = Night;
|
|
34616
|
+
|
|
34617
|
+
// src/ui/icons/Paginated.tsx
|
|
34618
|
+
import React33 from "react";
|
|
34619
|
+
var Paginated = (props) => /* @__PURE__ */ React33.createElement(Icon, __spreadValues({
|
|
34620
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
34621
|
+
fill: "none",
|
|
34622
|
+
viewBox: "0 0 45 45"
|
|
34623
|
+
}, props), /* @__PURE__ */ React33.createElement("mask", {
|
|
34624
|
+
id: "paginated",
|
|
34625
|
+
width: "45",
|
|
34626
|
+
height: "45",
|
|
34627
|
+
x: "0",
|
|
34628
|
+
y: "0",
|
|
34629
|
+
maskUnits: "userSpaceOnUse"
|
|
34630
|
+
}, /* @__PURE__ */ React33.createElement("path", {
|
|
34631
|
+
fill: "#D9D9D9",
|
|
34632
|
+
d: "M0 0h45v45H0z"
|
|
34633
|
+
})), /* @__PURE__ */ React33.createElement("g", {
|
|
34634
|
+
mask: "url(#paginated)"
|
|
34635
|
+
}, /* @__PURE__ */ React33.createElement("path", {
|
|
34636
|
+
fill: props.fill,
|
|
34637
|
+
d: "m30.563 32.438-1.032-1.032 8.907-8.906-8.907-8.906 1.032-1.031 9.984 9.937-9.984 9.938Zm-16.125 0L4.453 22.5l9.985-9.938 1.03 1.032L6.564 22.5l8.906 8.906-1.031 1.032ZM15 23.812c-.375 0-.688-.125-.938-.375a1.272 1.272 0 0 1-.374-.937c0-.344.124-.656.374-.938.25-.28.563-.421.938-.421.344 0 .656.14.938.422.28.28.421.593.421.937 0 .375-.14.688-.422.938-.28.25-.593.375-.937.375Zm7.5 0c-.375 0-.688-.125-.938-.375a1.272 1.272 0 0 1-.375-.937c0-.344.125-.656.375-.938.25-.28.563-.421.938-.421.344 0 .656.14.938.422.28.28.421.593.421.937 0 .375-.14.688-.422.938-.28.25-.593.375-.937.375Zm7.5 0c-.375 0-.688-.125-.938-.375a1.272 1.272 0 0 1-.375-.937c0-.344.125-.656.375-.938.25-.28.563-.421.938-.421.344 0 .656.14.938.422.28.28.421.593.421.937 0 .375-.14.688-.422.938-.28.25-.593.375-.937.375Z"
|
|
34638
|
+
})));
|
|
34639
|
+
var Paginated_default = Paginated;
|
|
34640
|
+
|
|
34641
|
+
// src/ui/icons/Previous.tsx
|
|
34642
|
+
import React34 from "react";
|
|
34643
|
+
var Previous = (props) => /* @__PURE__ */ React34.createElement(Icon, __spreadValues({
|
|
34644
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
34645
|
+
fill: "none",
|
|
34646
|
+
viewBox: "0 0 48 48"
|
|
34647
|
+
}, props), /* @__PURE__ */ React34.createElement("mask", {
|
|
34648
|
+
id: "previous",
|
|
34649
|
+
width: "48",
|
|
34650
|
+
height: "48",
|
|
34651
|
+
x: "0",
|
|
34652
|
+
y: "0",
|
|
34653
|
+
maskUnits: "userSpaceOnUse"
|
|
34654
|
+
}, /* @__PURE__ */ React34.createElement("path", {
|
|
34655
|
+
fill: "#D9D9D9",
|
|
34656
|
+
d: "M0 0h48v48H0z"
|
|
34657
|
+
})), /* @__PURE__ */ React34.createElement("g", {
|
|
34658
|
+
mask: "url(#previous)"
|
|
34659
|
+
}, /* @__PURE__ */ React34.createElement("path", {
|
|
34660
|
+
fill: props.fill,
|
|
34661
|
+
d: "M20 42.6 1.4 24 20 5.4l1.8 1.8L4.95 24 21.8 40.8 20 42.6Z"
|
|
34662
|
+
})));
|
|
34663
|
+
var Previous_default = Previous;
|
|
34664
|
+
|
|
34665
|
+
// src/ui/icons/ReaderSettings.tsx
|
|
34666
|
+
import React35 from "react";
|
|
34667
|
+
var ReaderSettings = (props) => /* @__PURE__ */ React35.createElement(Icon, __spreadValues({
|
|
34668
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
34669
|
+
fill: "none",
|
|
34670
|
+
viewBox: "0 0 49 49"
|
|
34671
|
+
}, props), /* @__PURE__ */ React35.createElement("mask", {
|
|
34672
|
+
id: "readerSettings",
|
|
34673
|
+
width: "49",
|
|
34674
|
+
height: "49",
|
|
34675
|
+
x: "0",
|
|
34676
|
+
y: "0",
|
|
34677
|
+
maskUnits: "userSpaceOnUse"
|
|
34678
|
+
}, /* @__PURE__ */ React35.createElement("path", {
|
|
34679
|
+
fill: "#D9D9D9",
|
|
34680
|
+
d: "M0 0h49v49H0z"
|
|
34681
|
+
})), /* @__PURE__ */ React35.createElement("g", {
|
|
34682
|
+
mask: "url(#readerSettings)"
|
|
34683
|
+
}, /* @__PURE__ */ React35.createElement("path", {
|
|
34684
|
+
fill: props.fill,
|
|
34685
|
+
d: "M30.37 37.014V9.633H20.16V7h22.97v2.633H32.92v27.38H30.37Zm-18.375 0v-16.85H5.87V17.53h14.802v2.633h-6.125v16.85h-2.552Z"
|
|
34686
|
+
})));
|
|
34687
|
+
var ReaderSettings_default = ReaderSettings;
|
|
34688
|
+
|
|
34689
|
+
// src/ui/icons/ReduceFont.tsx
|
|
34690
|
+
import React36 from "react";
|
|
34691
|
+
var ReduceFont = (props) => /* @__PURE__ */ React36.createElement(Icon, __spreadValues({
|
|
34692
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
34693
|
+
fill: "none",
|
|
34694
|
+
viewBox: "0 0 46 46"
|
|
34695
|
+
}, props), /* @__PURE__ */ React36.createElement("mask", {
|
|
34696
|
+
id: "reduceFont",
|
|
34697
|
+
width: "46",
|
|
34698
|
+
height: "46",
|
|
34699
|
+
x: "0",
|
|
34700
|
+
y: "0",
|
|
34701
|
+
maskUnits: "userSpaceOnUse"
|
|
34702
|
+
}, /* @__PURE__ */ React36.createElement("path", {
|
|
34703
|
+
fill: "#D9D9D9",
|
|
34704
|
+
d: "M0 0h45.639v45.639H0z"
|
|
34705
|
+
})), /* @__PURE__ */ React36.createElement("g", {
|
|
34706
|
+
mask: "url(#reduceFont)"
|
|
34707
|
+
}, /* @__PURE__ */ React36.createElement("path", {
|
|
34708
|
+
fill: props.fill,
|
|
34709
|
+
d: "M3.09 35.18 13.121 10.46h1.854L25.006 35.18h-2.282l-2.757-6.893H7.987L5.229 35.18H3.09Zm5.562-8.747h10.65L14.12 13.502h-.238l-5.23 12.93Zm20.586-2.663V21.87h13.311v1.901H29.238Z"
|
|
34710
|
+
})));
|
|
34711
|
+
var ReduceFont_default = ReduceFont;
|
|
34712
|
+
|
|
34713
|
+
// src/ui/icons/Reset.tsx
|
|
34714
|
+
import React37 from "react";
|
|
34715
|
+
var Reset = (props) => /* @__PURE__ */ React37.createElement(Icon, __spreadValues({
|
|
34716
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
34717
|
+
fill: "none",
|
|
34718
|
+
viewBox: "0 0 45 45"
|
|
34719
|
+
}, props), /* @__PURE__ */ React37.createElement("mask", {
|
|
34720
|
+
id: "a",
|
|
34721
|
+
width: "45",
|
|
34722
|
+
height: "45",
|
|
34723
|
+
x: "0",
|
|
34724
|
+
y: "0",
|
|
34725
|
+
maskUnits: "userSpaceOnUse"
|
|
34726
|
+
}, /* @__PURE__ */ React37.createElement("path", {
|
|
34727
|
+
fill: "#D9D9D9",
|
|
34728
|
+
d: "M0 0h45v45H0z"
|
|
34729
|
+
})), /* @__PURE__ */ React37.createElement("g", {
|
|
34730
|
+
mask: "url(#reset)"
|
|
34731
|
+
}, /* @__PURE__ */ React37.createElement("path", {
|
|
34732
|
+
fill: props.fill,
|
|
34733
|
+
d: "M20.11 37.266c-3.126-.563-5.696-2.047-7.712-4.453-2.015-2.407-3.023-5.22-3.023-8.438 0-1.781.367-3.484 1.102-5.11a13.358 13.358 0 0 1 3.117-4.312c.094-.094.226-.133.398-.117.172.016.32.086.445.21a.537.537 0 0 1 .258.517.787.787 0 0 1-.304.562 10.21 10.21 0 0 0-2.672 3.75 11.674 11.674 0 0 0-.89 4.5c0 2.813.882 5.281 2.648 7.406 1.765 2.125 4.023 3.469 6.773 4.032.188 0 .336.078.445.234a.88.88 0 0 1 .164.516c0 .218-.078.39-.234.515a.807.807 0 0 1-.516.188Zm4.828.047a.628.628 0 0 1-.516-.141.624.624 0 0 1-.235-.516.88.88 0 0 1 .165-.515.655.655 0 0 1 .445-.282c2.719-.656 4.96-2.03 6.726-4.125 1.766-2.093 2.649-4.547 2.649-7.359 0-3.25-1.125-6.008-3.375-8.273-2.25-2.266-5.016-3.399-8.297-3.399h-1.547l2.86 2.86a.6.6 0 0 1 .234.492.741.741 0 0 1-.235.539.741.741 0 0 1-.539.234.74.74 0 0 1-.539-.234l-3.656-3.703a1.33 1.33 0 0 1-.281-.399 1.203 1.203 0 0 1-.094-.492c0-.188.031-.36.094-.516.062-.156.156-.296.281-.421l3.656-3.704a.838.838 0 0 1 .54-.187c.203 0 .382.062.538.187a.906.906 0 0 1 .235.586.6.6 0 0 1-.235.493l-2.859 2.812H22.5c3.656 0 6.758 1.281 9.305 3.844 2.547 2.562 3.82 5.656 3.82 9.281 0 3.188-1.008 5.984-3.023 8.39-2.016 2.407-4.57 3.922-7.664 4.547Z"
|
|
34734
|
+
})));
|
|
34735
|
+
var Reset_default = Reset;
|
|
34736
|
+
|
|
34737
|
+
// src/ui/icons/Sepia.tsx
|
|
34738
|
+
import React38 from "react";
|
|
34739
|
+
var Sepia = (props) => /* @__PURE__ */ React38.createElement(Icon, __spreadValues({
|
|
34740
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
34741
|
+
fill: "none",
|
|
34742
|
+
viewBox: "0 0 45 45"
|
|
34743
|
+
}, props), /* @__PURE__ */ React38.createElement("mask", {
|
|
34744
|
+
id: "sepia",
|
|
34745
|
+
width: "45",
|
|
34746
|
+
height: "45",
|
|
34747
|
+
x: "0",
|
|
34748
|
+
y: "0",
|
|
34749
|
+
maskUnits: "userSpaceOnUse"
|
|
34750
|
+
}, /* @__PURE__ */ React38.createElement("path", {
|
|
34751
|
+
fill: "#D9D9D9",
|
|
34752
|
+
d: "M0 0h45v45H0z"
|
|
34753
|
+
})), /* @__PURE__ */ React38.createElement("g", {
|
|
34754
|
+
mask: "url(#sepia)"
|
|
34755
|
+
}, /* @__PURE__ */ React38.createElement("path", {
|
|
34756
|
+
fill: "#1C1B1F",
|
|
34757
|
+
d: "m22.5 41.063-5.484-5.438H9.375v-7.64L3.844 22.5l5.531-5.484V9.375h7.64L22.5 3.844l5.484 5.531h7.641v7.64l5.531 5.485-5.531 5.484v7.641h-7.64L22.5 41.063Zm-.047-6.891c3.281 0 6.055-1.133 8.32-3.399 2.266-2.265 3.399-5.023 3.399-8.273 0-3.281-1.133-6.055-3.399-8.32-2.265-2.266-5.039-3.399-8.32-3.399-.812 0-1.601.094-2.367.281-.766.188-1.57.454-2.414.797a11.296 11.296 0 0 1 4.992 4.29c1.234 1.921 1.852 4.038 1.852 6.351 0 2.281-.618 4.383-1.852 6.305a11.296 11.296 0 0 1-4.992 4.289c.781.312 1.562.57 2.344.773a9.65 9.65 0 0 0 2.437.305Z"
|
|
34758
|
+
})));
|
|
34759
|
+
var Sepia_default = Sepia;
|
|
34760
|
+
|
|
34761
|
+
// src/ui/icons/TableOfContents.tsx
|
|
34762
|
+
import React39 from "react";
|
|
34763
|
+
var TableOfContents = (props) => /* @__PURE__ */ React39.createElement(Icon, __spreadValues({
|
|
34764
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
34765
|
+
fill: "none",
|
|
34766
|
+
viewBox: "0 0 50 50"
|
|
34767
|
+
}, props), /* @__PURE__ */ React39.createElement("mask", {
|
|
34768
|
+
id: "tableOfContents",
|
|
34769
|
+
width: "50",
|
|
34770
|
+
height: "50",
|
|
34771
|
+
x: "0",
|
|
34772
|
+
y: "0",
|
|
34773
|
+
maskUnits: "userSpaceOnUse"
|
|
34774
|
+
}, /* @__PURE__ */ React39.createElement("path", {
|
|
34775
|
+
fill: "#D9D9D9",
|
|
34776
|
+
d: "M0 0h49.264v49.264H0z"
|
|
34777
|
+
})), /* @__PURE__ */ React39.createElement("g", {
|
|
34778
|
+
mask: "url(#tableOfContents)"
|
|
34779
|
+
}, /* @__PURE__ */ React39.createElement("path", {
|
|
34780
|
+
fill: props.fill,
|
|
34781
|
+
d: "M7.544 33.376v-2.118h27.454v2.118H7.544Zm0-8.47v-2.118h27.454v2.117H7.544Zm0-8.47v-2.118h27.454v2.117H7.544Zm32.842 17.257c-.376 0-.692-.132-.948-.398a1.347 1.347 0 0 1-.386-.978c0-.388.129-.715.386-.98.256-.264.572-.396.948-.396s.693.132.95.396c.256.265.384.592.384.98s-.128.714-.383.978a1.272 1.272 0 0 1-.95.398Zm0-8.47c-.376 0-.692-.133-.948-.398a1.347 1.347 0 0 1-.386-.978c0-.389.129-.715.386-.98.256-.265.572-.397.948-.397s.693.132.95.396c.256.266.384.592.384.98 0 .389-.128.715-.383.979a1.272 1.272 0 0 1-.95.398Zm0-8.47c-.376 0-.692-.133-.948-.398a1.347 1.347 0 0 1-.386-.979c0-.388.129-.715.386-.98.256-.264.572-.396.948-.396s.693.132.95.396c.256.265.384.592.384.98 0 .389-.128.715-.383.979a1.272 1.272 0 0 1-.95.398Z"
|
|
34782
|
+
})));
|
|
34783
|
+
var TableOfContents_default = TableOfContents;
|
|
34784
|
+
|
|
34785
|
+
// src/ui/icons/ToggleFullScreen.tsx
|
|
34786
|
+
import React40 from "react";
|
|
34787
|
+
var ToggleFullScreen = (props) => /* @__PURE__ */ React40.createElement(Icon, __spreadValues({
|
|
34788
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
34789
|
+
fill: "none",
|
|
34790
|
+
viewBox: "0 0 49 49"
|
|
34791
|
+
}, props), /* @__PURE__ */ React40.createElement("mask", {
|
|
34792
|
+
id: "toggleFullScreen",
|
|
34793
|
+
width: "49",
|
|
34794
|
+
height: "49",
|
|
34795
|
+
x: "0",
|
|
34796
|
+
y: "0",
|
|
34797
|
+
maskUnits: "userSpaceOnUse"
|
|
34798
|
+
}, /* @__PURE__ */ React40.createElement("path", {
|
|
34799
|
+
fill: "#D9D9D9",
|
|
34800
|
+
d: "M0 0h49v49H0z"
|
|
34801
|
+
})), /* @__PURE__ */ React40.createElement("g", {
|
|
34802
|
+
mask: "url(#toggleFullScreen)"
|
|
34803
|
+
}, /* @__PURE__ */ React40.createElement("path", {
|
|
34804
|
+
fill: props.fill,
|
|
34805
|
+
d: "M10.208 41.487V30.956h2.042v8.425h8.167v2.106H10.208Zm0-18.956V12h10.209v2.106H12.25v8.425h-2.042Zm18.375 18.956v-2.106h8.167v-8.425h2.042v10.531H28.583Zm8.167-18.956v-8.425h-8.167V12h10.209v10.531H36.75Z"
|
|
34806
|
+
})));
|
|
34807
|
+
var ToggleFullScreen_default = ToggleFullScreen;
|
|
34808
|
+
|
|
34809
|
+
// src/ui/icons/ToggleFullScreenExit.tsx
|
|
34810
|
+
import React41 from "react";
|
|
34811
|
+
var ToggleFullScreenExit = (props) => /* @__PURE__ */ React41.createElement(Icon, __spreadValues({
|
|
34812
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
34813
|
+
fill: "none",
|
|
34814
|
+
viewBox: "0 0 51 51"
|
|
34815
|
+
}, props), /* @__PURE__ */ React41.createElement("mask", {
|
|
34816
|
+
id: "toggleFullScreenExit",
|
|
34817
|
+
width: "51",
|
|
34818
|
+
height: "51",
|
|
34819
|
+
x: "0",
|
|
34820
|
+
y: "0",
|
|
34821
|
+
maskUnits: "userSpaceOnUse"
|
|
34822
|
+
}, /* @__PURE__ */ React41.createElement("path", {
|
|
34823
|
+
fill: "#D9D9D9",
|
|
34824
|
+
d: "M0 0h51v51H0z"
|
|
34825
|
+
})), /* @__PURE__ */ React41.createElement("g", {
|
|
34826
|
+
mask: "url(#toggleFullScreenExit)"
|
|
34827
|
+
}, /* @__PURE__ */ React41.createElement("path", {
|
|
34828
|
+
fill: props.fill,
|
|
34829
|
+
d: "M19.125 38.69v-8.768h-8.5V27.73H21.25v10.96h-2.125Zm10.625 0V27.73h10.625v2.192h-8.5v8.769H29.75ZM10.625 18.96V16.77h8.5V8h2.125v10.96H10.625Zm19.125 0V8h2.125v8.769h8.5v2.192H29.75Z"
|
|
34830
|
+
})));
|
|
34831
|
+
var ToggleFullScreenExit_default = ToggleFullScreenExit;
|
|
34832
|
+
|
|
34833
|
+
// src/ui/SettingsButton.tsx
|
|
34834
|
+
import * as React49 from "react";
|
|
34594
34835
|
|
|
34595
34836
|
// src/utils/getColor.ts
|
|
34596
34837
|
function getColor3(colorMode) {
|
|
@@ -34614,24 +34855,91 @@ var useColorModeValue = (light, dark, sepia) => {
|
|
|
34614
34855
|
};
|
|
34615
34856
|
var useColorModeValue_default = useColorModeValue;
|
|
34616
34857
|
|
|
34617
|
-
// src/ui/SettingsButton.tsx
|
|
34618
|
-
import * as React35 from "react";
|
|
34619
|
-
|
|
34620
|
-
// src/ui/Button.tsx
|
|
34621
|
-
import React30 from "react";
|
|
34622
|
-
var Button2 = React30.forwardRef((props, ref) => {
|
|
34623
|
-
return /* @__PURE__ */ React30.createElement(Button, __spreadValues({
|
|
34624
|
-
ref,
|
|
34625
|
-
variant: "solid"
|
|
34626
|
-
}, props));
|
|
34627
|
-
});
|
|
34628
|
-
var Button_default = Button2;
|
|
34629
|
-
|
|
34630
34858
|
// src/ui/PdfSettings.tsx
|
|
34631
|
-
import * as
|
|
34859
|
+
import * as React47 from "react";
|
|
34632
34860
|
|
|
34633
34861
|
// src/ui/ToggleButton.tsx
|
|
34634
|
-
import
|
|
34862
|
+
import React43 from "react";
|
|
34863
|
+
|
|
34864
|
+
// src/ui/theme/foundations/fonts.tsx
|
|
34865
|
+
import React42 from "react";
|
|
34866
|
+
var Fonts = () => /* @__PURE__ */ React42.createElement(Global, {
|
|
34867
|
+
styles: `
|
|
34868
|
+
/* latin */
|
|
34869
|
+
@font-face {
|
|
34870
|
+
font-family: 'Helvetica';
|
|
34871
|
+
src: url('Helvetica.eot');
|
|
34872
|
+
src: local('Helvetica'),
|
|
34873
|
+
url('Helvetica.eot?#iefix') format('embedded-opentype'),
|
|
34874
|
+
url('Helvetica.woff2') format('woff2'),
|
|
34875
|
+
url('Helvetica.woff') format('woff'),
|
|
34876
|
+
url('Helvetica.ttf') format('truetype');
|
|
34877
|
+
font-weight: normal;
|
|
34878
|
+
font-style: normal;
|
|
34879
|
+
font-display: swap;
|
|
34880
|
+
}
|
|
34881
|
+
@font-face {
|
|
34882
|
+
font-family: 'OpenDyslexic';
|
|
34883
|
+
font-style: normal;
|
|
34884
|
+
font-weight: 700;
|
|
34885
|
+
src: url('/fonts/opendyslexic/opendyslexic-regular-webfont.woff2')
|
|
34886
|
+
format('woff2'),
|
|
34887
|
+
url('/fonts/opendyslexic/opendyslexic-regular-webfont.woff')
|
|
34888
|
+
format('woff');
|
|
34889
|
+
}
|
|
34890
|
+
@font-face {
|
|
34891
|
+
font-family: 'robotoregular';
|
|
34892
|
+
src: url('Roboto-Regular-webfont.eot');
|
|
34893
|
+
src: url('Roboto-Regular-webfont.eot?#iefix') format('embedded-opentype'),
|
|
34894
|
+
url('Roboto-Regular-webfont.woff2') format('woff2'),
|
|
34895
|
+
url('Roboto-Regular-webfont.woff') format('woff'),
|
|
34896
|
+
url('Roboto-Regular-webfont.ttf') format('truetype'),
|
|
34897
|
+
url('Roboto-Regular-webfont.svg#robotoregular') format('svg');
|
|
34898
|
+
font-weight: normal;
|
|
34899
|
+
font-style: normal;
|
|
34900
|
+
}
|
|
34901
|
+
@font-face {
|
|
34902
|
+
font-family: 'robotolight';
|
|
34903
|
+
src: url('Roboto-Light-webfont.eot');
|
|
34904
|
+
src: url('Roboto-Light-webfont.eot?#iefix') format('embedded-opentype'),
|
|
34905
|
+
url('Roboto-Light-webfont.woff2') format('woff2'),
|
|
34906
|
+
url('Roboto-Light-webfont.woff') format('woff'),
|
|
34907
|
+
url('Roboto-Light-webfont.ttf') format('truetype'),
|
|
34908
|
+
url('Roboto-Light-webfont.svg#robotolight') format('svg');
|
|
34909
|
+
font-weight: normal;
|
|
34910
|
+
font-style: normal;
|
|
34911
|
+
|
|
34912
|
+
}
|
|
34913
|
+
`
|
|
34914
|
+
});
|
|
34915
|
+
var fonts_default = Fonts;
|
|
34916
|
+
|
|
34917
|
+
// src/ui/theme/components/alert.ts
|
|
34918
|
+
var baseStyle22 = {
|
|
34919
|
+
container: {
|
|
34920
|
+
px: 4,
|
|
34921
|
+
py: 5
|
|
34922
|
+
},
|
|
34923
|
+
title: {
|
|
34924
|
+
fontWeight: "bold",
|
|
34925
|
+
lineHeight: 4,
|
|
34926
|
+
marginEnd: 2
|
|
34927
|
+
},
|
|
34928
|
+
description: {
|
|
34929
|
+
lineHeight: 3,
|
|
34930
|
+
maxWidth: "100%"
|
|
34931
|
+
},
|
|
34932
|
+
icon: {
|
|
34933
|
+
flexShrink: 0,
|
|
34934
|
+
marginEnd: 4,
|
|
34935
|
+
w: 5,
|
|
34936
|
+
h: 6
|
|
34937
|
+
}
|
|
34938
|
+
};
|
|
34939
|
+
var Alert2 = {
|
|
34940
|
+
baseStyle: baseStyle22
|
|
34941
|
+
};
|
|
34942
|
+
var alert_default = Alert2;
|
|
34635
34943
|
|
|
34636
34944
|
// src/ui/theme/components/text.ts
|
|
34637
34945
|
var TextStyle = {
|
|
@@ -34656,12 +34964,32 @@ var text_default = TextStyle;
|
|
|
34656
34964
|
// src/ui/theme/foundations/colors.ts
|
|
34657
34965
|
var colors2 = {
|
|
34658
34966
|
transparent: "transparent",
|
|
34967
|
+
gray: {
|
|
34968
|
+
active: "#D9D9D9",
|
|
34969
|
+
disabled: "#979797",
|
|
34970
|
+
icon: "#1C1B1F",
|
|
34971
|
+
dark: "#616161",
|
|
34972
|
+
"x-dark": "#424242"
|
|
34973
|
+
},
|
|
34659
34974
|
ui: {
|
|
34660
|
-
sepia: "#
|
|
34975
|
+
sepia: "#F2E4CA",
|
|
34976
|
+
sepiaChecked: "#D9CDB7"
|
|
34661
34977
|
}
|
|
34662
34978
|
};
|
|
34663
34979
|
var colors_default = colors2;
|
|
34664
34980
|
|
|
34981
|
+
// src/ui/theme/foundations/typography.ts
|
|
34982
|
+
var typography3 = {
|
|
34983
|
+
fonts: {
|
|
34984
|
+
body: "Roboto, -apple-system, BlinkMacSystemFont, system-ui, sans-serif",
|
|
34985
|
+
heading: "Roboto, -apple-system, BlinkMacSystemFont, system-ui, sans-serif",
|
|
34986
|
+
serif: `'Georgia', serif`,
|
|
34987
|
+
sansSerif: `'Helvetica', 'Arial', serif`,
|
|
34988
|
+
opendyslexic: `'OpenDyslexic', sans-serif`
|
|
34989
|
+
}
|
|
34990
|
+
};
|
|
34991
|
+
var typography_default = typography3;
|
|
34992
|
+
|
|
34665
34993
|
// src/ui/nypl-base-theme/components/button.ts
|
|
34666
34994
|
var sizes3 = {
|
|
34667
34995
|
lg: {
|
|
@@ -34777,7 +35105,7 @@ var breakpoints_default = createBreakpoints({
|
|
|
34777
35105
|
});
|
|
34778
35106
|
|
|
34779
35107
|
// src/ui/nypl-base-theme/foundations/typography.ts
|
|
34780
|
-
var
|
|
35108
|
+
var typography4 = {
|
|
34781
35109
|
fonts: {
|
|
34782
35110
|
body: "-apple-system, BlinkMacSystemFont, system-ui, sans-serif",
|
|
34783
35111
|
heading: "-apple-system, BlinkMacSystemFont, system-ui, sans-seri",
|
|
@@ -34809,7 +35137,7 @@ var typography3 = {
|
|
|
34809
35137
|
widest: "0.1em"
|
|
34810
35138
|
}
|
|
34811
35139
|
};
|
|
34812
|
-
var
|
|
35140
|
+
var typography_default2 = typography4;
|
|
34813
35141
|
|
|
34814
35142
|
// src/ui/nypl-base-theme/foundations/colors.ts
|
|
34815
35143
|
var colors3 = {
|
|
@@ -34841,9 +35169,12 @@ var colors3 = {
|
|
|
34841
35169
|
},
|
|
34842
35170
|
test: "#FF6347",
|
|
34843
35171
|
gray: {
|
|
34844
|
-
|
|
34845
|
-
|
|
35172
|
+
active: "#D9D9D9",
|
|
35173
|
+
disabled: "#979797",
|
|
35174
|
+
icon: "#1C1B1F",
|
|
34846
35175
|
medium: "#BDBDBD",
|
|
35176
|
+
dark: "#616161",
|
|
35177
|
+
"x-dark": "#424242",
|
|
34847
35178
|
"light-cool": "#E0E0E0",
|
|
34848
35179
|
"light-warm": "#EFEDEB",
|
|
34849
35180
|
"x-light-cool": "#F5F5F5",
|
|
@@ -35139,7 +35470,7 @@ var global3 = {
|
|
|
35139
35470
|
var global_default = global3;
|
|
35140
35471
|
|
|
35141
35472
|
// src/ui/nypl-base-theme/components/form-label.ts
|
|
35142
|
-
var
|
|
35473
|
+
var baseStyle23 = {
|
|
35143
35474
|
fontSize: "sm",
|
|
35144
35475
|
marginEnd: 0,
|
|
35145
35476
|
mb: 2,
|
|
@@ -35151,11 +35482,11 @@ var baseStyle22 = {
|
|
|
35151
35482
|
}
|
|
35152
35483
|
};
|
|
35153
35484
|
var form_label_default = {
|
|
35154
|
-
baseStyle:
|
|
35485
|
+
baseStyle: baseStyle23
|
|
35155
35486
|
};
|
|
35156
35487
|
|
|
35157
35488
|
// src/ui/nypl-base-theme/components/form.ts
|
|
35158
|
-
var
|
|
35489
|
+
var baseStyle24 = {
|
|
35159
35490
|
requiredIndicator: {
|
|
35160
35491
|
marginStart: 1,
|
|
35161
35492
|
color: "red.500"
|
|
@@ -35168,11 +35499,11 @@ var baseStyle23 = {
|
|
|
35168
35499
|
}
|
|
35169
35500
|
};
|
|
35170
35501
|
var form_default = {
|
|
35171
|
-
baseStyle:
|
|
35502
|
+
baseStyle: baseStyle24
|
|
35172
35503
|
};
|
|
35173
35504
|
|
|
35174
35505
|
// src/ui/nypl-base-theme/components/form-error.ts
|
|
35175
|
-
var
|
|
35506
|
+
var baseStyle25 = {
|
|
35176
35507
|
text: {
|
|
35177
35508
|
color: "ui.error",
|
|
35178
35509
|
mt: 2,
|
|
@@ -35184,7 +35515,7 @@ var baseStyle24 = {
|
|
|
35184
35515
|
}
|
|
35185
35516
|
};
|
|
35186
35517
|
var form_error_default = {
|
|
35187
|
-
baseStyle:
|
|
35518
|
+
baseStyle: baseStyle25
|
|
35188
35519
|
};
|
|
35189
35520
|
|
|
35190
35521
|
// src/ui/nypl-base-theme/components/text-area.ts
|
|
@@ -35209,7 +35540,7 @@ var theme2 = extendTheme(__spreadProps(__spreadValues({
|
|
|
35209
35540
|
breakpoints: breakpoints_default,
|
|
35210
35541
|
radii: radii_default,
|
|
35211
35542
|
colors: colors_default2
|
|
35212
|
-
},
|
|
35543
|
+
}, typography_default2), {
|
|
35213
35544
|
space: spacing_default,
|
|
35214
35545
|
components: {
|
|
35215
35546
|
Button: button_default,
|
|
@@ -35231,7 +35562,7 @@ var getButtonStyle = (getColor4) => ({
|
|
|
35231
35562
|
sizes: {},
|
|
35232
35563
|
variants: {
|
|
35233
35564
|
solid: variantSolid6(getColor4),
|
|
35234
|
-
|
|
35565
|
+
settings: variantSettings(getColor4)
|
|
35235
35566
|
},
|
|
35236
35567
|
defaultProps: {
|
|
35237
35568
|
size: "sm",
|
|
@@ -35239,23 +35570,29 @@ var getButtonStyle = (getColor4) => ({
|
|
|
35239
35570
|
}
|
|
35240
35571
|
});
|
|
35241
35572
|
var variantSolid6 = (getColor4) => (props) => {
|
|
35242
|
-
const
|
|
35573
|
+
const { "aria-expanded": expanded2 } = props;
|
|
35574
|
+
const bgColor = getColor4("ui.gray.light-warm", "ui.black", "ui.sepia");
|
|
35575
|
+
const bgColorActive = getColor4("ui.gray.active", "ui.gray.x-dark", "ui.sepiaChecked");
|
|
35243
35576
|
const color3 = getColor4("gray.800", "ui.white", "gray.800");
|
|
35244
|
-
const _focus = { bgColor, color: color3 };
|
|
35245
|
-
const _hover = {
|
|
35246
|
-
|
|
35577
|
+
const _focus = { bgColor: bgColorActive, color: color3 };
|
|
35578
|
+
const _hover = {
|
|
35579
|
+
bgColor: bgColorActive,
|
|
35580
|
+
color: color3,
|
|
35581
|
+
_disabled: { bgColor }
|
|
35582
|
+
};
|
|
35583
|
+
const _active = { bgColor: bgColorActive, color: color3 };
|
|
35247
35584
|
const _checked = { bgColor, color: color3 };
|
|
35248
35585
|
const _disabled = { bgColor };
|
|
35249
35586
|
return {
|
|
35250
|
-
border: "
|
|
35587
|
+
border: "none",
|
|
35251
35588
|
borderColor: "gray.100",
|
|
35589
|
+
height: "48px",
|
|
35252
35590
|
transition: "none",
|
|
35253
35591
|
fontSize: 0,
|
|
35254
35592
|
letterSpacing: 1,
|
|
35255
|
-
textTransform: "uppercase",
|
|
35256
35593
|
maxWidth: "100%",
|
|
35257
35594
|
cursor: "pointer",
|
|
35258
|
-
bgColor,
|
|
35595
|
+
bgColor: expanded2 ? bgColorActive : bgColor,
|
|
35259
35596
|
color: color3,
|
|
35260
35597
|
_focus,
|
|
35261
35598
|
_hover,
|
|
@@ -35264,108 +35601,109 @@ var variantSolid6 = (getColor4) => (props) => {
|
|
|
35264
35601
|
_disabled
|
|
35265
35602
|
};
|
|
35266
35603
|
};
|
|
35267
|
-
var
|
|
35268
|
-
const bgColor =
|
|
35269
|
-
const color3 = getColor4("
|
|
35604
|
+
var variantSettings = (getColor4) => (props) => {
|
|
35605
|
+
const { bgColor } = props;
|
|
35606
|
+
const color3 = getColor4("ui.black", "ui.white", "ui.black");
|
|
35607
|
+
const checkedBgColor = getColor4("ui.gray.light-warm", "ui.gray.x-dark", "ui.sepiaChecked");
|
|
35270
35608
|
return __spreadProps(__spreadValues({}, variantSolid6(getColor4)(props)), {
|
|
35271
|
-
bgColor,
|
|
35609
|
+
bgColor: getColor4("ui.white", "ui.black", "ui.sepia"),
|
|
35610
|
+
border: "1px solid",
|
|
35272
35611
|
color: color3,
|
|
35273
|
-
|
|
35274
|
-
|
|
35275
|
-
fontSize:
|
|
35276
|
-
|
|
35612
|
+
py: 8,
|
|
35613
|
+
width: [8, 16, 36],
|
|
35614
|
+
fontSize: [0, 0, 2],
|
|
35615
|
+
whiteSpace: ["normal", "normal", "nowrap"],
|
|
35616
|
+
_active: {
|
|
35277
35617
|
bgColor
|
|
35278
35618
|
},
|
|
35279
|
-
|
|
35280
|
-
|
|
35619
|
+
_checked: {
|
|
35620
|
+
color: color3,
|
|
35621
|
+
bgColor: checkedBgColor,
|
|
35622
|
+
borderBottomColor: checkedBgColor,
|
|
35623
|
+
p: {
|
|
35624
|
+
textDecoration: "underline"
|
|
35625
|
+
}
|
|
35281
35626
|
},
|
|
35282
|
-
|
|
35627
|
+
_hover: {
|
|
35283
35628
|
bgColor
|
|
35284
35629
|
},
|
|
35285
|
-
|
|
35286
|
-
|
|
35287
|
-
|
|
35630
|
+
_focus: {
|
|
35631
|
+
bgColor,
|
|
35632
|
+
ring: "2px",
|
|
35633
|
+
ringInset: "inset"
|
|
35288
35634
|
}
|
|
35289
35635
|
});
|
|
35290
35636
|
};
|
|
35291
35637
|
var button_default2 = getButtonStyle;
|
|
35292
35638
|
|
|
35293
|
-
// src/ui/theme/components/alert.ts
|
|
35294
|
-
var baseStyle25 = {
|
|
35295
|
-
container: {
|
|
35296
|
-
px: 4,
|
|
35297
|
-
py: 5
|
|
35298
|
-
},
|
|
35299
|
-
title: {
|
|
35300
|
-
fontWeight: "bold",
|
|
35301
|
-
lineHeight: 4,
|
|
35302
|
-
marginEnd: 2
|
|
35303
|
-
},
|
|
35304
|
-
description: {
|
|
35305
|
-
lineHeight: 3,
|
|
35306
|
-
maxWidth: "100%"
|
|
35307
|
-
},
|
|
35308
|
-
icon: {
|
|
35309
|
-
flexShrink: 0,
|
|
35310
|
-
marginEnd: 4,
|
|
35311
|
-
w: 5,
|
|
35312
|
-
h: 6
|
|
35313
|
-
}
|
|
35314
|
-
};
|
|
35315
|
-
var Alert2 = {
|
|
35316
|
-
baseStyle: baseStyle25
|
|
35317
|
-
};
|
|
35318
|
-
var alert_default = Alert2;
|
|
35319
|
-
|
|
35320
35639
|
// src/ui/theme/index.ts
|
|
35321
35640
|
function getTheme3(colorMode = "day") {
|
|
35322
|
-
return extendTheme({
|
|
35323
|
-
colors: colors_default
|
|
35641
|
+
return extendTheme(__spreadProps(__spreadValues({
|
|
35642
|
+
colors: colors_default
|
|
35643
|
+
}, typography_default), {
|
|
35324
35644
|
components: {
|
|
35325
35645
|
Button: button_default2(getColor3(colorMode)),
|
|
35326
35646
|
Text: text_default,
|
|
35327
35647
|
Alert: alert_default
|
|
35328
35648
|
},
|
|
35329
35649
|
currentColorMode: colorMode
|
|
35330
|
-
}, nypl_base_theme_default);
|
|
35650
|
+
}), nypl_base_theme_default);
|
|
35331
35651
|
}
|
|
35332
35652
|
|
|
35333
35653
|
// src/ui/ToggleButton.tsx
|
|
35334
35654
|
function ToggleButton(props) {
|
|
35335
|
-
const _a = props, {
|
|
35655
|
+
const _a = props, { children, colorMode, icon, iconFill, label, value } = _a, rest = __objRest(_a, ["children", "colorMode", "icon", "iconFill", "label", "value"]);
|
|
35336
35656
|
const { getInputProps, getCheckboxProps } = useRadio(props);
|
|
35337
35657
|
const input = getInputProps();
|
|
35338
35658
|
const checkbox = getCheckboxProps();
|
|
35339
35659
|
const theme3 = useTheme3();
|
|
35340
|
-
return /* @__PURE__ */
|
|
35660
|
+
return /* @__PURE__ */ React43.createElement(ThemeProvider3, {
|
|
35341
35661
|
theme: getTheme3(colorMode != null ? colorMode : theme3.currentColorMode)
|
|
35342
|
-
}, /* @__PURE__ */
|
|
35662
|
+
}, /* @__PURE__ */ React43.createElement(fonts_default, null), /* @__PURE__ */ React43.createElement(Box, {
|
|
35343
35663
|
as: "label",
|
|
35344
35664
|
d: "flex",
|
|
35345
35665
|
flexGrow: 1,
|
|
35346
35666
|
"aria-label": label
|
|
35347
|
-
}, /* @__PURE__ */
|
|
35348
|
-
as: "div"
|
|
35349
|
-
|
|
35350
|
-
variant: "toggle"
|
|
35351
|
-
}), rest), {
|
|
35667
|
+
}, /* @__PURE__ */ React43.createElement("input", __spreadValues({}, input)), /* @__PURE__ */ React43.createElement(Button_default, __spreadValues(__spreadValues({
|
|
35668
|
+
as: "div",
|
|
35669
|
+
variant: "settings",
|
|
35352
35670
|
flexGrow: 1
|
|
35353
|
-
}),
|
|
35354
|
-
as:
|
|
35355
|
-
position: "absolute",
|
|
35671
|
+
}, checkbox), rest), icon && /* @__PURE__ */ React43.createElement(Icon, {
|
|
35672
|
+
as: icon,
|
|
35356
35673
|
verticalAlign: "middle",
|
|
35357
|
-
|
|
35358
|
-
|
|
35359
|
-
|
|
35360
|
-
|
|
35361
|
-
|
|
35362
|
-
h: 5
|
|
35363
|
-
}))));
|
|
35674
|
+
mr: 1.5,
|
|
35675
|
+
w: 6,
|
|
35676
|
+
h: 6,
|
|
35677
|
+
fill: iconFill && iconFill
|
|
35678
|
+
}), label && /* @__PURE__ */ React43.createElement(Text, null, label))));
|
|
35364
35679
|
}
|
|
35680
|
+
var FontToggleButton = (props) => {
|
|
35681
|
+
return /* @__PURE__ */ React43.createElement(ToggleButton, __spreadValues({
|
|
35682
|
+
fontSize: [-1, -1, 0],
|
|
35683
|
+
py: 6
|
|
35684
|
+
}, props));
|
|
35685
|
+
};
|
|
35686
|
+
var ColorModeToggleButton = (_a) => {
|
|
35687
|
+
var _b = _a, {
|
|
35688
|
+
bgColor
|
|
35689
|
+
} = _b, rest = __objRest(_b, [
|
|
35690
|
+
"bgColor"
|
|
35691
|
+
]);
|
|
35692
|
+
return /* @__PURE__ */ React43.createElement(ToggleButton, __spreadValues({
|
|
35693
|
+
sx: {
|
|
35694
|
+
_checked: {
|
|
35695
|
+
bgColor,
|
|
35696
|
+
p: {
|
|
35697
|
+
textDecoration: "underline"
|
|
35698
|
+
}
|
|
35699
|
+
}
|
|
35700
|
+
}
|
|
35701
|
+
}, rest));
|
|
35702
|
+
};
|
|
35365
35703
|
var ToggleButton_default = ToggleButton;
|
|
35366
35704
|
|
|
35367
35705
|
// src/ui/ToggleGroup.tsx
|
|
35368
|
-
import
|
|
35706
|
+
import React44 from "react";
|
|
35369
35707
|
var ToggleGroup = ({
|
|
35370
35708
|
value,
|
|
35371
35709
|
label,
|
|
@@ -35379,16 +35717,15 @@ var ToggleGroup = ({
|
|
|
35379
35717
|
value
|
|
35380
35718
|
});
|
|
35381
35719
|
const group = getRootProps();
|
|
35382
|
-
return /* @__PURE__ */
|
|
35720
|
+
return /* @__PURE__ */ React44.createElement(Flex, __spreadProps(__spreadValues({}, group), {
|
|
35383
35721
|
"aria-label": label,
|
|
35384
35722
|
flex: "1 0 auto",
|
|
35385
|
-
flexWrap: "
|
|
35386
|
-
|
|
35387
|
-
}), React32.Children.map(children, (element) => {
|
|
35723
|
+
flexWrap: "nowrap"
|
|
35724
|
+
}), React44.Children.map(children, (element) => {
|
|
35388
35725
|
try {
|
|
35389
35726
|
const value2 = element.props.value;
|
|
35390
35727
|
const radio2 = getRadioProps({ value: value2 });
|
|
35391
|
-
return
|
|
35728
|
+
return React44.cloneElement(element, __spreadValues({}, radio2));
|
|
35392
35729
|
} catch (e) {
|
|
35393
35730
|
throw new Error("ToggleGroup expects ToggleButton children with `value` props.");
|
|
35394
35731
|
}
|
|
@@ -35396,175 +35733,359 @@ var ToggleGroup = ({
|
|
|
35396
35733
|
};
|
|
35397
35734
|
var ToggleGroup_default = ToggleGroup;
|
|
35398
35735
|
|
|
35736
|
+
// node_modules/react-icons/lib/esm/iconBase.js
|
|
35737
|
+
import React46 from "react";
|
|
35738
|
+
|
|
35739
|
+
// node_modules/react-icons/lib/esm/iconContext.js
|
|
35740
|
+
import React45 from "react";
|
|
35741
|
+
var DefaultContext = {
|
|
35742
|
+
color: void 0,
|
|
35743
|
+
size: void 0,
|
|
35744
|
+
className: void 0,
|
|
35745
|
+
style: void 0,
|
|
35746
|
+
attr: void 0
|
|
35747
|
+
};
|
|
35748
|
+
var IconContext = React45.createContext && React45.createContext(DefaultContext);
|
|
35749
|
+
|
|
35750
|
+
// node_modules/react-icons/lib/esm/iconBase.js
|
|
35751
|
+
var __assign2 = function() {
|
|
35752
|
+
__assign2 = Object.assign || function(t2) {
|
|
35753
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
35754
|
+
s = arguments[i];
|
|
35755
|
+
for (var p in s)
|
|
35756
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
35757
|
+
t2[p] = s[p];
|
|
35758
|
+
}
|
|
35759
|
+
return t2;
|
|
35760
|
+
};
|
|
35761
|
+
return __assign2.apply(this, arguments);
|
|
35762
|
+
};
|
|
35763
|
+
var __rest2 = function(s, e) {
|
|
35764
|
+
var t2 = {};
|
|
35765
|
+
for (var p in s)
|
|
35766
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
35767
|
+
t2[p] = s[p];
|
|
35768
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
35769
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
35770
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
35771
|
+
t2[p[i]] = s[p[i]];
|
|
35772
|
+
}
|
|
35773
|
+
return t2;
|
|
35774
|
+
};
|
|
35775
|
+
function Tree2Element(tree) {
|
|
35776
|
+
return tree && tree.map(function(node2, i) {
|
|
35777
|
+
return React46.createElement(node2.tag, __assign2({
|
|
35778
|
+
key: i
|
|
35779
|
+
}, node2.attr), Tree2Element(node2.child));
|
|
35780
|
+
});
|
|
35781
|
+
}
|
|
35782
|
+
function GenIcon(data) {
|
|
35783
|
+
return function(props) {
|
|
35784
|
+
return React46.createElement(IconBase, __assign2({
|
|
35785
|
+
attr: __assign2({}, data.attr)
|
|
35786
|
+
}, props), Tree2Element(data.child));
|
|
35787
|
+
};
|
|
35788
|
+
}
|
|
35789
|
+
function IconBase(props) {
|
|
35790
|
+
var elem = function(conf) {
|
|
35791
|
+
var attr = props.attr, size3 = props.size, title = props.title, svgProps = __rest2(props, ["attr", "size", "title"]);
|
|
35792
|
+
var computedSize = size3 || conf.size || "1em";
|
|
35793
|
+
var className;
|
|
35794
|
+
if (conf.className)
|
|
35795
|
+
className = conf.className;
|
|
35796
|
+
if (props.className)
|
|
35797
|
+
className = (className ? className + " " : "") + props.className;
|
|
35798
|
+
return React46.createElement("svg", __assign2({
|
|
35799
|
+
stroke: "currentColor",
|
|
35800
|
+
fill: "currentColor",
|
|
35801
|
+
strokeWidth: "0"
|
|
35802
|
+
}, conf.attr, attr, svgProps, {
|
|
35803
|
+
className,
|
|
35804
|
+
style: __assign2(__assign2({
|
|
35805
|
+
color: props.color || conf.color
|
|
35806
|
+
}, conf.style), props.style),
|
|
35807
|
+
height: computedSize,
|
|
35808
|
+
width: computedSize,
|
|
35809
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
35810
|
+
}), title && React46.createElement("title", null, title), props.children);
|
|
35811
|
+
};
|
|
35812
|
+
return IconContext !== void 0 ? React46.createElement(IconContext.Consumer, null, function(conf) {
|
|
35813
|
+
return elem(conf);
|
|
35814
|
+
}) : elem(DefaultContext);
|
|
35815
|
+
}
|
|
35816
|
+
|
|
35817
|
+
// node_modules/react-icons/md/index.esm.js
|
|
35818
|
+
function MdKeyboardArrowLeft(props) {
|
|
35819
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" } }, { "tag": "path", "attr": { "d": "M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z" } }] })(props);
|
|
35820
|
+
}
|
|
35821
|
+
function MdKeyboardArrowRight(props) {
|
|
35822
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" } }, { "tag": "path", "attr": { "d": "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z" } }] })(props);
|
|
35823
|
+
}
|
|
35824
|
+
function MdOutlineZoomIn(props) {
|
|
35825
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" } }, { "tag": "path", "attr": { "d": "M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zm.5-7H9v2H7v1h2v2h1v-2h2V9h-2z" } }] })(props);
|
|
35826
|
+
}
|
|
35827
|
+
function MdOutlineZoomOut(props) {
|
|
35828
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" } }, { "tag": "path", "attr": { "d": "M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z" } }] })(props);
|
|
35829
|
+
}
|
|
35830
|
+
|
|
35399
35831
|
// src/ui/PdfSettings.tsx
|
|
35400
35832
|
function PdfSettings(props) {
|
|
35401
35833
|
const { navigator: navigator2, paginationValue } = props;
|
|
35402
35834
|
const { zoomOut, zoomIn, setScroll } = navigator2;
|
|
35403
|
-
|
|
35835
|
+
const iconFill = "ui.gray.icon";
|
|
35836
|
+
return /* @__PURE__ */ React47.createElement(React47.Fragment, null, /* @__PURE__ */ React47.createElement(ButtonGroup, {
|
|
35404
35837
|
d: "flex",
|
|
35405
35838
|
spacing: 0
|
|
35406
|
-
}, /* @__PURE__ */
|
|
35839
|
+
}, /* @__PURE__ */ React47.createElement(Button_default, {
|
|
35407
35840
|
flexGrow: 1,
|
|
35408
35841
|
"aria-label": "Zoom Out",
|
|
35409
35842
|
onClick: zoomOut,
|
|
35410
|
-
variant: "
|
|
35411
|
-
},
|
|
35843
|
+
variant: "settings"
|
|
35844
|
+
}, /* @__PURE__ */ React47.createElement(Icon, {
|
|
35412
35845
|
as: MdOutlineZoomOut,
|
|
35413
35846
|
w: 7,
|
|
35414
35847
|
h: 7,
|
|
35415
35848
|
pl: 1
|
|
35416
|
-
})), /* @__PURE__ */
|
|
35849
|
+
}), "Zoom Out"), /* @__PURE__ */ React47.createElement(Button_default, {
|
|
35417
35850
|
flexGrow: 1,
|
|
35418
35851
|
"aria-label": "Zoom In",
|
|
35419
35852
|
onClick: zoomIn,
|
|
35420
|
-
variant: "
|
|
35421
|
-
},
|
|
35853
|
+
variant: "settings"
|
|
35854
|
+
}, /* @__PURE__ */ React47.createElement(Icon, {
|
|
35422
35855
|
as: MdOutlineZoomIn,
|
|
35423
35856
|
w: 7,
|
|
35424
35857
|
h: 7,
|
|
35425
35858
|
pl: 1
|
|
35426
|
-
}))), /* @__PURE__ */
|
|
35859
|
+
}), "Zoom In")), /* @__PURE__ */ React47.createElement(ToggleGroup_default, {
|
|
35427
35860
|
onChange: setScroll,
|
|
35428
35861
|
value: paginationValue,
|
|
35429
35862
|
label: "pagination options"
|
|
35430
|
-
}, /* @__PURE__ */
|
|
35863
|
+
}, /* @__PURE__ */ React47.createElement(ToggleButton_default, {
|
|
35431
35864
|
value: "paginated",
|
|
35432
|
-
|
|
35433
|
-
|
|
35865
|
+
borderRadius: "0 0 0 4px",
|
|
35866
|
+
label: "Paginated",
|
|
35867
|
+
icon: Paginated_default,
|
|
35868
|
+
iconFill
|
|
35869
|
+
}), /* @__PURE__ */ React47.createElement(ToggleButton_default, {
|
|
35434
35870
|
value: "scrolling",
|
|
35435
|
-
|
|
35436
|
-
|
|
35871
|
+
borderRadius: "0 0 4px 0",
|
|
35872
|
+
label: "Scrolling",
|
|
35873
|
+
icon: Continuous_default,
|
|
35874
|
+
iconFill
|
|
35875
|
+
})));
|
|
35437
35876
|
}
|
|
35438
35877
|
|
|
35439
35878
|
// src/ui/HtmlSettings.tsx
|
|
35440
|
-
import * as
|
|
35879
|
+
import * as React48 from "react";
|
|
35441
35880
|
function HtmlSettings(props) {
|
|
35442
|
-
const { navigator: navigator2, readerState, paginationValue } = props;
|
|
35881
|
+
const { navigator: navigator2, iconFill, readerState, paginationValue } = props;
|
|
35882
|
+
const buttonTextColor = useColorModeValue_default("ui.black", "ui.white", "ui.black");
|
|
35883
|
+
const checkedButtonBgColor = useColorModeValue_default("ui.gray.light-warm", "ui.gray.x-dark", "ui.sepiaChecked");
|
|
35443
35884
|
if (!readerState.settings)
|
|
35444
35885
|
return null;
|
|
35445
|
-
const {
|
|
35886
|
+
const { colorMode, fontFamily } = readerState.settings;
|
|
35446
35887
|
const {
|
|
35447
35888
|
setFontFamily,
|
|
35448
35889
|
decreaseFontSize,
|
|
35449
35890
|
increaseFontSize,
|
|
35891
|
+
resetSettings,
|
|
35450
35892
|
setColorMode,
|
|
35451
35893
|
setScroll
|
|
35452
35894
|
} = navigator2;
|
|
35453
|
-
return /* @__PURE__ */
|
|
35895
|
+
return /* @__PURE__ */ React48.createElement(React48.Fragment, null, /* @__PURE__ */ React48.createElement(ToggleGroup_default, {
|
|
35454
35896
|
value: fontFamily,
|
|
35455
35897
|
label: "text font options",
|
|
35456
35898
|
onChange: setFontFamily
|
|
35457
|
-
}, /* @__PURE__ */
|
|
35899
|
+
}, /* @__PURE__ */ React48.createElement(FontToggleButton, {
|
|
35458
35900
|
value: "publisher",
|
|
35459
|
-
label: "
|
|
35460
|
-
}
|
|
35901
|
+
label: "Default"
|
|
35902
|
+
}), /* @__PURE__ */ React48.createElement(FontToggleButton, {
|
|
35461
35903
|
value: "serif",
|
|
35462
|
-
label: "Serif"
|
|
35463
|
-
|
|
35904
|
+
label: "Serif",
|
|
35905
|
+
fontFamily: "serif",
|
|
35906
|
+
fontWeight: "regular"
|
|
35907
|
+
}), /* @__PURE__ */ React48.createElement(FontToggleButton, {
|
|
35464
35908
|
value: "sans-serif",
|
|
35465
|
-
label: "Sans-Serif"
|
|
35466
|
-
|
|
35909
|
+
label: "Sans-Serif",
|
|
35910
|
+
fontFamily: "sansSerif",
|
|
35911
|
+
fontWeight: "regular"
|
|
35912
|
+
}), /* @__PURE__ */ React48.createElement(FontToggleButton, {
|
|
35467
35913
|
value: "open-dyslexic",
|
|
35468
|
-
label: "Dyslexia
|
|
35469
|
-
|
|
35470
|
-
|
|
35471
|
-
|
|
35472
|
-
|
|
35473
|
-
|
|
35474
|
-
|
|
35475
|
-
|
|
35476
|
-
|
|
35477
|
-
|
|
35478
|
-
|
|
35479
|
-
|
|
35480
|
-
|
|
35481
|
-
|
|
35482
|
-
|
|
35914
|
+
label: "Dyslexia",
|
|
35915
|
+
fontFamily: "opendyslexic",
|
|
35916
|
+
fontWeight: "regular"
|
|
35917
|
+
})), /* @__PURE__ */ React48.createElement(Stack, {
|
|
35918
|
+
bgColor: checkedButtonBgColor,
|
|
35919
|
+
px: 7,
|
|
35920
|
+
py: 5
|
|
35921
|
+
}, /* @__PURE__ */ React48.createElement(Heading, {
|
|
35922
|
+
as: "h3",
|
|
35923
|
+
color: buttonTextColor,
|
|
35924
|
+
pb: "10px",
|
|
35925
|
+
fontSize: 2,
|
|
35926
|
+
fontWeight: "light"
|
|
35927
|
+
}, FONT_DETAILS[fontFamily].heading), /* @__PURE__ */ React48.createElement(Text, {
|
|
35928
|
+
color: buttonTextColor,
|
|
35929
|
+
fontFamily: FONT_DETAILS[fontFamily].token,
|
|
35930
|
+
fontSize: -1,
|
|
35931
|
+
fontWeight: FONT_DETAILS[fontFamily].fontWeight
|
|
35932
|
+
}, FONT_DETAILS[fontFamily].body)), /* @__PURE__ */ React48.createElement(ToggleGroup_default, {
|
|
35483
35933
|
value: colorMode,
|
|
35484
35934
|
label: "reading theme options",
|
|
35485
35935
|
onChange: setColorMode
|
|
35486
|
-
}, /* @__PURE__ */
|
|
35936
|
+
}, /* @__PURE__ */ React48.createElement(ColorModeToggleButton, {
|
|
35487
35937
|
colorMode: "day",
|
|
35938
|
+
icon: Day_default,
|
|
35488
35939
|
value: "day",
|
|
35489
35940
|
label: "Day",
|
|
35490
|
-
|
|
35491
|
-
|
|
35941
|
+
bgColor: "ui.white",
|
|
35942
|
+
textColor: "ui.black"
|
|
35943
|
+
}), /* @__PURE__ */ React48.createElement(ColorModeToggleButton, {
|
|
35492
35944
|
colorMode: "sepia",
|
|
35945
|
+
icon: Sepia_default,
|
|
35493
35946
|
value: "sepia",
|
|
35494
35947
|
label: "Sepia",
|
|
35495
|
-
|
|
35496
|
-
|
|
35497
|
-
|
|
35498
|
-
_checked: { bg: "ui.sepia" }
|
|
35499
|
-
}, "Sepia"), /* @__PURE__ */ React34.createElement(ToggleButton_default, {
|
|
35948
|
+
bgColor: "ui.sepia",
|
|
35949
|
+
textColor: "ui.black"
|
|
35950
|
+
}), /* @__PURE__ */ React48.createElement(ColorModeToggleButton, {
|
|
35500
35951
|
colorMode: "night",
|
|
35952
|
+
icon: Night_default,
|
|
35501
35953
|
value: "night",
|
|
35502
35954
|
label: "Night",
|
|
35503
|
-
|
|
35504
|
-
|
|
35955
|
+
bgColor: "ui.black",
|
|
35956
|
+
textColor: "ui.white"
|
|
35957
|
+
})), /* @__PURE__ */ React48.createElement(ButtonGroup, {
|
|
35958
|
+
d: "flex",
|
|
35959
|
+
spacing: 0
|
|
35960
|
+
}, /* @__PURE__ */ React48.createElement(Button_default, {
|
|
35961
|
+
flexGrow: 1,
|
|
35962
|
+
"aria-label": "Reset settings",
|
|
35963
|
+
onClick: resetSettings,
|
|
35964
|
+
variant: "settings"
|
|
35965
|
+
}, /* @__PURE__ */ React48.createElement(Reset_default, {
|
|
35966
|
+
w: "45px",
|
|
35967
|
+
h: "45px",
|
|
35968
|
+
fill: areSettingsDefault(readerState.settings) ? "ui.gray.disabled" : iconFill
|
|
35969
|
+
})), /* @__PURE__ */ React48.createElement(Button_default, {
|
|
35970
|
+
"aria-label": "Decrease font size",
|
|
35971
|
+
flexGrow: 1,
|
|
35972
|
+
onClick: decreaseFontSize,
|
|
35973
|
+
sx: {
|
|
35974
|
+
_active: {
|
|
35975
|
+
bgColor: checkedButtonBgColor
|
|
35976
|
+
}
|
|
35977
|
+
},
|
|
35978
|
+
value: "decrease font size",
|
|
35979
|
+
variant: "settings"
|
|
35980
|
+
}, /* @__PURE__ */ React48.createElement(ReduceFont_default, {
|
|
35981
|
+
w: "45px",
|
|
35982
|
+
h: "45px",
|
|
35983
|
+
fill: iconFill
|
|
35984
|
+
})), /* @__PURE__ */ React48.createElement(Button_default, {
|
|
35985
|
+
"aria-label": "Increase font size",
|
|
35986
|
+
flexGrow: 1,
|
|
35987
|
+
onClick: increaseFontSize,
|
|
35988
|
+
sx: {
|
|
35989
|
+
_active: {
|
|
35990
|
+
bgColor: checkedButtonBgColor
|
|
35991
|
+
}
|
|
35992
|
+
},
|
|
35993
|
+
value: "increase font size",
|
|
35994
|
+
variant: "settings"
|
|
35995
|
+
}, /* @__PURE__ */ React48.createElement(EnlargeFont_default, {
|
|
35996
|
+
w: "45px",
|
|
35997
|
+
h: "45px",
|
|
35998
|
+
fill: iconFill
|
|
35999
|
+
}))), /* @__PURE__ */ React48.createElement(ToggleGroup_default, {
|
|
35505
36000
|
onChange: setScroll,
|
|
35506
36001
|
value: paginationValue,
|
|
35507
36002
|
label: "pagination options"
|
|
35508
|
-
}, /* @__PURE__ */
|
|
36003
|
+
}, /* @__PURE__ */ React48.createElement(ToggleButton_default, {
|
|
35509
36004
|
value: "paginated",
|
|
35510
|
-
|
|
35511
|
-
|
|
36005
|
+
borderRadius: "0 0 0 4px",
|
|
36006
|
+
label: "Paginated",
|
|
36007
|
+
icon: Paginated_default,
|
|
36008
|
+
iconFill
|
|
36009
|
+
}), /* @__PURE__ */ React48.createElement(ToggleButton_default, {
|
|
35512
36010
|
value: "scrolling",
|
|
35513
|
-
|
|
35514
|
-
|
|
36011
|
+
borderRadius: "0 0 4px 0",
|
|
36012
|
+
label: "Scrolling",
|
|
36013
|
+
icon: Continuous_default,
|
|
36014
|
+
iconFill
|
|
36015
|
+
})));
|
|
35515
36016
|
}
|
|
36017
|
+
var areSettingsDefault = (readerSettings) => {
|
|
36018
|
+
if (!readerSettings) {
|
|
36019
|
+
return false;
|
|
36020
|
+
}
|
|
36021
|
+
let setting;
|
|
36022
|
+
for (setting in DEFAULT_SETTINGS) {
|
|
36023
|
+
if (readerSettings[setting] !== DEFAULT_SETTINGS[setting]) {
|
|
36024
|
+
return false;
|
|
36025
|
+
}
|
|
36026
|
+
}
|
|
36027
|
+
return true;
|
|
36028
|
+
};
|
|
35516
36029
|
|
|
35517
36030
|
// src/ui/SettingsButton.tsx
|
|
35518
36031
|
function SettingsCard(props) {
|
|
35519
36032
|
var _a, _b;
|
|
35520
|
-
const [isOpen, setIsOpen] =
|
|
36033
|
+
const [isOpen, setIsOpen] = React49.useState(false);
|
|
35521
36034
|
const open = () => setIsOpen(true);
|
|
35522
36035
|
const close = () => setIsOpen(false);
|
|
35523
|
-
const paginationValue = ((_b = (_a = props.state) == null ? void 0 : _a.settings) == null ? void 0 : _b.isScrolling) ? "scrolling" : "paginated";
|
|
35524
36036
|
const contentBgColor = useColorModeValue_default("ui.white", "ui.black", "ui.white");
|
|
35525
|
-
|
|
35526
|
-
|
|
36037
|
+
const iconFill = useColorModeValue_default("ui.gray.icon", "ui.white", "ui.gray.icon");
|
|
36038
|
+
const paginationValue = ((_b = (_a = props.state) == null ? void 0 : _a.settings) == null ? void 0 : _b.isScrolling) ? "scrolling" : "paginated";
|
|
36039
|
+
return /* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement(Popover, {
|
|
36040
|
+
gutter: 0,
|
|
36041
|
+
placement: "bottom-start",
|
|
35527
36042
|
isOpen,
|
|
35528
36043
|
onOpen: open,
|
|
35529
36044
|
onClose: close,
|
|
35530
|
-
autoFocus: true
|
|
35531
|
-
|
|
36045
|
+
autoFocus: true,
|
|
36046
|
+
preventOverflow: true,
|
|
36047
|
+
strategy: "fixed"
|
|
36048
|
+
}, /* @__PURE__ */ React49.createElement(PopoverTrigger, null, /* @__PURE__ */ React49.createElement(Button_default, {
|
|
35532
36049
|
onClick: open,
|
|
35533
36050
|
border: "none",
|
|
35534
36051
|
"aria-label": "Settings",
|
|
35535
|
-
leftIcon: /* @__PURE__ */
|
|
35536
|
-
as:
|
|
36052
|
+
leftIcon: /* @__PURE__ */ React49.createElement(Icon, {
|
|
36053
|
+
as: ReaderSettings_default,
|
|
35537
36054
|
w: 6,
|
|
35538
|
-
h: 6
|
|
36055
|
+
h: 6,
|
|
36056
|
+
fill: iconFill
|
|
35539
36057
|
})
|
|
35540
|
-
}, /* @__PURE__ */
|
|
36058
|
+
}, /* @__PURE__ */ React49.createElement(Text, {
|
|
35541
36059
|
variant: "headerNav"
|
|
35542
|
-
}, "Settings"))), /* @__PURE__ */
|
|
35543
|
-
|
|
35544
|
-
|
|
35545
|
-
|
|
35546
|
-
|
|
35547
|
-
|
|
35548
|
-
maxWidth: "
|
|
35549
|
-
},
|
|
36060
|
+
}, "Settings"))), /* @__PURE__ */ React49.createElement(PopoverContent, {
|
|
36061
|
+
overflow: "hidden",
|
|
36062
|
+
bgColor: contentBgColor,
|
|
36063
|
+
borderRadius: "0 0 4px 4px",
|
|
36064
|
+
boxShadow: "0 4px 4px -2px #424242",
|
|
36065
|
+
width: "inherit",
|
|
36066
|
+
maxWidth: "100vw"
|
|
36067
|
+
}, /* @__PURE__ */ React49.createElement(PopoverBody, {
|
|
36068
|
+
p: 0
|
|
36069
|
+
}, props.type === "PDF" && /* @__PURE__ */ React49.createElement(PdfSettings, {
|
|
35550
36070
|
navigator: props.navigator,
|
|
35551
36071
|
readerState: props.state,
|
|
35552
36072
|
paginationValue
|
|
35553
|
-
}), props.type === "HTML" && /* @__PURE__ */
|
|
36073
|
+
}), props.type === "HTML" && /* @__PURE__ */ React49.createElement(HtmlSettings, {
|
|
35554
36074
|
navigator: props.navigator,
|
|
36075
|
+
iconFill,
|
|
35555
36076
|
readerState: props.state,
|
|
35556
36077
|
paginationValue
|
|
35557
36078
|
})))));
|
|
35558
36079
|
}
|
|
35559
36080
|
|
|
35560
36081
|
// src/ui/TableOfContent.tsx
|
|
35561
|
-
import
|
|
36082
|
+
import React52 from "react";
|
|
35562
36083
|
|
|
35563
36084
|
// src/ui/menu/menu.tsx
|
|
35564
|
-
import * as
|
|
36085
|
+
import * as React51 from "react";
|
|
35565
36086
|
|
|
35566
36087
|
// src/ui/menu/use-menu.tsx
|
|
35567
|
-
import * as
|
|
36088
|
+
import * as React50 from "react";
|
|
35568
36089
|
var [
|
|
35569
36090
|
MenuDescendantsProvider,
|
|
35570
36091
|
useMenuDescendantsContext,
|
|
@@ -35605,16 +36126,16 @@ function useMenu(props = {}) {
|
|
|
35605
36126
|
"direction",
|
|
35606
36127
|
"computePositionOnMount"
|
|
35607
36128
|
]);
|
|
35608
|
-
const menuRef =
|
|
35609
|
-
const buttonRef =
|
|
36129
|
+
const menuRef = React50.useRef(null);
|
|
36130
|
+
const buttonRef = React50.useRef(null);
|
|
35610
36131
|
const descendants = useMenuDescendants();
|
|
35611
|
-
const focusMenu =
|
|
36132
|
+
const focusMenu = React50.useCallback(() => {
|
|
35612
36133
|
focus(menuRef.current, {
|
|
35613
36134
|
nextTick: true,
|
|
35614
36135
|
selectTextIfInput: false
|
|
35615
36136
|
});
|
|
35616
36137
|
}, []);
|
|
35617
|
-
const focusFirstItem =
|
|
36138
|
+
const focusFirstItem = React50.useCallback(() => {
|
|
35618
36139
|
const id2 = setTimeout(() => {
|
|
35619
36140
|
const first = descendants.firstEnabled();
|
|
35620
36141
|
if (first)
|
|
@@ -35622,7 +36143,7 @@ function useMenu(props = {}) {
|
|
|
35622
36143
|
});
|
|
35623
36144
|
timeoutIds.current.add(id2);
|
|
35624
36145
|
}, [descendants]);
|
|
35625
|
-
const focusLastItem =
|
|
36146
|
+
const focusLastItem = React50.useCallback(() => {
|
|
35626
36147
|
const id2 = setTimeout(() => {
|
|
35627
36148
|
const last = descendants.lastEnabled();
|
|
35628
36149
|
if (last)
|
|
@@ -35630,7 +36151,7 @@ function useMenu(props = {}) {
|
|
|
35630
36151
|
});
|
|
35631
36152
|
timeoutIds.current.add(id2);
|
|
35632
36153
|
}, [descendants]);
|
|
35633
|
-
const onOpenInternal =
|
|
36154
|
+
const onOpenInternal = React50.useCallback(() => {
|
|
35634
36155
|
onOpenProp == null ? void 0 : onOpenProp();
|
|
35635
36156
|
if (autoSelect) {
|
|
35636
36157
|
focusFirstItem();
|
|
@@ -35654,7 +36175,7 @@ function useMenu(props = {}) {
|
|
|
35654
36175
|
}
|
|
35655
36176
|
}
|
|
35656
36177
|
});
|
|
35657
|
-
const [focusedIndex, setFocusedIndex] =
|
|
36178
|
+
const [focusedIndex, setFocusedIndex] = React50.useState(-1);
|
|
35658
36179
|
useUpdateEffect(() => {
|
|
35659
36180
|
if (!isOpen) {
|
|
35660
36181
|
setFocusedIndex(-1);
|
|
@@ -35666,24 +36187,24 @@ function useMenu(props = {}) {
|
|
|
35666
36187
|
shouldFocus: true
|
|
35667
36188
|
});
|
|
35668
36189
|
const [buttonId, menuId] = useIds(id, `menu-button`, `menu-list`);
|
|
35669
|
-
const openAndFocusMenu =
|
|
36190
|
+
const openAndFocusMenu = React50.useCallback(() => {
|
|
35670
36191
|
onOpen();
|
|
35671
36192
|
focusMenu();
|
|
35672
36193
|
}, [onOpen, focusMenu]);
|
|
35673
|
-
const timeoutIds =
|
|
36194
|
+
const timeoutIds = React50.useRef(/* @__PURE__ */ new Set([]));
|
|
35674
36195
|
useUnmountEffect(() => {
|
|
35675
36196
|
timeoutIds.current.forEach((id2) => clearTimeout(id2));
|
|
35676
36197
|
timeoutIds.current.clear();
|
|
35677
36198
|
});
|
|
35678
|
-
const openAndFocusFirstItem =
|
|
36199
|
+
const openAndFocusFirstItem = React50.useCallback(() => {
|
|
35679
36200
|
onOpen();
|
|
35680
36201
|
focusFirstItem();
|
|
35681
36202
|
}, [focusFirstItem, onOpen]);
|
|
35682
|
-
const openAndFocusLastItem =
|
|
36203
|
+
const openAndFocusLastItem = React50.useCallback(() => {
|
|
35683
36204
|
onOpen();
|
|
35684
36205
|
focusLastItem();
|
|
35685
36206
|
}, [onOpen, focusLastItem]);
|
|
35686
|
-
const refocus =
|
|
36207
|
+
const refocus = React50.useCallback(() => {
|
|
35687
36208
|
var _a2, _b;
|
|
35688
36209
|
const doc3 = getOwnerDocument(menuRef.current);
|
|
35689
36210
|
const hasFocusWithin2 = (_a2 = menuRef.current) == null ? void 0 : _a2.contains(doc3.activeElement);
|
|
@@ -35726,7 +36247,7 @@ function useMenuButton(props = {}, externalRef = null) {
|
|
|
35726
36247
|
openAndFocusFirstItem,
|
|
35727
36248
|
openAndFocusLastItem
|
|
35728
36249
|
} = menu2;
|
|
35729
|
-
const onKeyDown =
|
|
36250
|
+
const onKeyDown = React50.useCallback((event) => {
|
|
35730
36251
|
const eventKey = normalizeEventKey(event);
|
|
35731
36252
|
const keyMap = {
|
|
35732
36253
|
Enter: openAndFocusFirstItem,
|
|
@@ -35774,7 +36295,7 @@ function useMenuList(props = {}, ref = null) {
|
|
|
35774
36295
|
const createTypeaheadHandler = useShortcut({
|
|
35775
36296
|
preventDefault: (event) => event.key !== " " && isTargetMenuItem(event.target)
|
|
35776
36297
|
});
|
|
35777
|
-
const onKeyDown =
|
|
36298
|
+
const onKeyDown = React50.useCallback((event) => {
|
|
35778
36299
|
const eventKey = normalizeEventKey(event);
|
|
35779
36300
|
const keyMap = {
|
|
35780
36301
|
Tab: (event2) => event2.preventDefault(),
|
|
@@ -35816,7 +36337,7 @@ function useMenuList(props = {}, ref = null) {
|
|
|
35816
36337
|
onClose,
|
|
35817
36338
|
setFocusedIndex
|
|
35818
36339
|
]);
|
|
35819
|
-
const hasBeenOpened =
|
|
36340
|
+
const hasBeenOpened = React50.useRef(false);
|
|
35820
36341
|
if (isOpen) {
|
|
35821
36342
|
hasBeenOpened.current = true;
|
|
35822
36343
|
}
|
|
@@ -35867,30 +36388,30 @@ function useMenuItem(props = {}, externalRef = null) {
|
|
|
35867
36388
|
isOpen,
|
|
35868
36389
|
menuId
|
|
35869
36390
|
} = menu2;
|
|
35870
|
-
const ref =
|
|
36391
|
+
const ref = React50.useRef(null);
|
|
35871
36392
|
const id = `${menuId}-menuitem-${useId()}`;
|
|
35872
36393
|
const { index, register } = useMenuDescendant({
|
|
35873
36394
|
disabled: isDisabled2 && !isFocusable2
|
|
35874
36395
|
});
|
|
35875
|
-
const onMouseEnter =
|
|
36396
|
+
const onMouseEnter = React50.useCallback((event) => {
|
|
35876
36397
|
onMouseEnterProp == null ? void 0 : onMouseEnterProp(event);
|
|
35877
36398
|
if (isDisabled2)
|
|
35878
36399
|
return;
|
|
35879
36400
|
setFocusedIndex(index);
|
|
35880
36401
|
}, [setFocusedIndex, index, isDisabled2, onMouseEnterProp]);
|
|
35881
|
-
const onMouseMove =
|
|
36402
|
+
const onMouseMove = React50.useCallback((event) => {
|
|
35882
36403
|
onMouseMoveProp == null ? void 0 : onMouseMoveProp(event);
|
|
35883
36404
|
if (ref.current && !isActiveElement(ref.current)) {
|
|
35884
36405
|
onMouseEnter(event);
|
|
35885
36406
|
}
|
|
35886
36407
|
}, [onMouseEnter, onMouseMoveProp]);
|
|
35887
|
-
const onMouseLeave =
|
|
36408
|
+
const onMouseLeave = React50.useCallback((event) => {
|
|
35888
36409
|
onMouseLeaveProp == null ? void 0 : onMouseLeaveProp(event);
|
|
35889
36410
|
if (isDisabled2)
|
|
35890
36411
|
return;
|
|
35891
36412
|
setFocusedIndex(-1);
|
|
35892
36413
|
}, [setFocusedIndex, isDisabled2, onMouseLeaveProp]);
|
|
35893
|
-
const onClick =
|
|
36414
|
+
const onClick = React50.useCallback((event) => {
|
|
35894
36415
|
onClickProp == null ? void 0 : onClickProp(event);
|
|
35895
36416
|
if (!isTargetMenuItem(event.currentTarget))
|
|
35896
36417
|
return;
|
|
@@ -35957,7 +36478,7 @@ function useMenuOptionGroup(props = {}) {
|
|
|
35957
36478
|
value: valueProp,
|
|
35958
36479
|
onChange: onChangeProp
|
|
35959
36480
|
});
|
|
35960
|
-
const onChange =
|
|
36481
|
+
const onChange = React50.useCallback((selectedValue) => {
|
|
35961
36482
|
if (type === "radio" && isString(value)) {
|
|
35962
36483
|
setValue(selectedValue);
|
|
35963
36484
|
}
|
|
@@ -35976,7 +36497,7 @@ function useMenuOptionGroup(props = {}) {
|
|
|
35976
36497
|
(_b = (_a2 = child.props).onClick) == null ? void 0 : _b.call(_a2, event);
|
|
35977
36498
|
};
|
|
35978
36499
|
const isChecked = type === "radio" ? child.props.value === value : value.includes(child.props.value);
|
|
35979
|
-
return
|
|
36500
|
+
return React50.cloneElement(child, {
|
|
35980
36501
|
type,
|
|
35981
36502
|
onClick,
|
|
35982
36503
|
isChecked
|
|
@@ -35994,13 +36515,13 @@ var Menu = (props) => {
|
|
|
35994
36515
|
const ownProps = omitThemingProps(props);
|
|
35995
36516
|
const { direction: direction2 } = useTheme3();
|
|
35996
36517
|
const _a = useMenu(__spreadProps(__spreadValues({}, ownProps), { direction: direction2 })), { descendants } = _a, ctx = __objRest(_a, ["descendants"]);
|
|
35997
|
-
const context =
|
|
36518
|
+
const context = React51.useMemo(() => ctx, [ctx]);
|
|
35998
36519
|
const { isOpen, onClose } = context;
|
|
35999
|
-
return /* @__PURE__ */
|
|
36520
|
+
return /* @__PURE__ */ React51.createElement(MenuDescendantsProvider, {
|
|
36000
36521
|
value: descendants
|
|
36001
|
-
}, /* @__PURE__ */
|
|
36522
|
+
}, /* @__PURE__ */ React51.createElement(MenuProvider, {
|
|
36002
36523
|
value: context
|
|
36003
|
-
}, /* @__PURE__ */
|
|
36524
|
+
}, /* @__PURE__ */ React51.createElement(StylesProvider, {
|
|
36004
36525
|
value: styles2
|
|
36005
36526
|
}, runIfFn(children, { isOpen, onClose }))));
|
|
36006
36527
|
};
|
|
@@ -36009,7 +36530,7 @@ if (__DEV__) {
|
|
|
36009
36530
|
}
|
|
36010
36531
|
var StyledMenuButton = forwardRef3((props, ref) => {
|
|
36011
36532
|
const styles2 = useStyles();
|
|
36012
|
-
return /* @__PURE__ */
|
|
36533
|
+
return /* @__PURE__ */ React51.createElement(chakra.button, __spreadProps(__spreadValues({
|
|
36013
36534
|
ref
|
|
36014
36535
|
}, props), {
|
|
36015
36536
|
__css: __spreadValues({
|
|
@@ -36024,10 +36545,14 @@ var MenuButton = forwardRef3((props, ref) => {
|
|
|
36024
36545
|
const _a = props, { children, as: As } = _a, rest = __objRest(_a, ["children", "as"]);
|
|
36025
36546
|
const buttonProps = useMenuButton(rest, ref);
|
|
36026
36547
|
const Element2 = As || StyledMenuButton;
|
|
36027
|
-
return /* @__PURE__ */
|
|
36548
|
+
return /* @__PURE__ */ React51.createElement(Element2, __spreadProps(__spreadValues({}, buttonProps), {
|
|
36028
36549
|
className: cx("chakra-menu__menu-button", props.className)
|
|
36029
|
-
}), /* @__PURE__ */
|
|
36030
|
-
__css: {
|
|
36550
|
+
}), /* @__PURE__ */ React51.createElement(chakra.span, {
|
|
36551
|
+
__css: {
|
|
36552
|
+
pointerEvents: "none",
|
|
36553
|
+
flex: "1 1 auto",
|
|
36554
|
+
minW: 0
|
|
36555
|
+
}
|
|
36031
36556
|
}, props.children));
|
|
36032
36557
|
});
|
|
36033
36558
|
if (__DEV__) {
|
|
@@ -36062,9 +36587,9 @@ var MenuList = forwardRef3((props, ref) => {
|
|
|
36062
36587
|
const { isOpen, onTransitionEnd } = useMenuContext();
|
|
36063
36588
|
const menulistProps = useMenuList(rest, ref);
|
|
36064
36589
|
const styles2 = useStyles();
|
|
36065
|
-
return /* @__PURE__ */
|
|
36590
|
+
return /* @__PURE__ */ React51.createElement(chakra.div, {
|
|
36066
36591
|
__css: { zIndex: (_c = props.zIndex) != null ? _c : (_b = styles2.list) == null ? void 0 : _b.zIndex }
|
|
36067
|
-
}, /* @__PURE__ */
|
|
36592
|
+
}, /* @__PURE__ */ React51.createElement(MotionDiv, __spreadProps(__spreadValues({}, menulistProps), {
|
|
36068
36593
|
onUpdate: onTransitionEnd,
|
|
36069
36594
|
className: cx("chakra-menu__menu-list", menulistProps.className),
|
|
36070
36595
|
variants: motionVariants,
|
|
@@ -36093,7 +36618,7 @@ var StyledMenuItem = forwardRef3((props, ref) => {
|
|
|
36093
36618
|
flex: "0 0 auto",
|
|
36094
36619
|
outline: 0
|
|
36095
36620
|
}, styles2.item);
|
|
36096
|
-
return /* @__PURE__ */
|
|
36621
|
+
return /* @__PURE__ */ React51.createElement(chakra.button, __spreadProps(__spreadValues({
|
|
36097
36622
|
ref,
|
|
36098
36623
|
type: btnType
|
|
36099
36624
|
}, rest), {
|
|
@@ -36116,39 +36641,39 @@ var MenuItem = forwardRef3((props, ref) => {
|
|
|
36116
36641
|
]);
|
|
36117
36642
|
const menuitemProps = useMenuItem(rest, ref);
|
|
36118
36643
|
const shouldWrap = icon || command;
|
|
36119
|
-
const _children = shouldWrap ? /* @__PURE__ */
|
|
36644
|
+
const _children = shouldWrap ? /* @__PURE__ */ React51.createElement("span", {
|
|
36120
36645
|
style: { pointerEvents: "none", flex: 1 }
|
|
36121
36646
|
}, children) : children;
|
|
36122
|
-
return /* @__PURE__ */
|
|
36647
|
+
return /* @__PURE__ */ React51.createElement(StyledMenuItem, __spreadProps(__spreadValues({}, menuitemProps), {
|
|
36123
36648
|
className: cx("chakra-menu__menuitem", menuitemProps.className)
|
|
36124
|
-
}), icon && /* @__PURE__ */
|
|
36649
|
+
}), icon && /* @__PURE__ */ React51.createElement(MenuIcon, {
|
|
36125
36650
|
fontSize: "0.8em",
|
|
36126
36651
|
marginEnd: iconSpacing2
|
|
36127
|
-
}, icon), _children, command && /* @__PURE__ */
|
|
36652
|
+
}, icon), _children, command && /* @__PURE__ */ React51.createElement(MenuCommand, {
|
|
36128
36653
|
marginStart: commandSpacing
|
|
36129
36654
|
}, command));
|
|
36130
36655
|
});
|
|
36131
36656
|
if (__DEV__) {
|
|
36132
36657
|
MenuItem.displayName = "MenuItem";
|
|
36133
36658
|
}
|
|
36134
|
-
var CheckIcon3 = (props) => /* @__PURE__ */
|
|
36659
|
+
var CheckIcon3 = (props) => /* @__PURE__ */ React51.createElement("svg", __spreadValues({
|
|
36135
36660
|
viewBox: "0 0 14 14",
|
|
36136
36661
|
width: "1em",
|
|
36137
36662
|
height: "1em"
|
|
36138
|
-
}, props), /* @__PURE__ */
|
|
36663
|
+
}, props), /* @__PURE__ */ React51.createElement("polygon", {
|
|
36139
36664
|
fill: "currentColor",
|
|
36140
36665
|
points: "5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"
|
|
36141
36666
|
}));
|
|
36142
36667
|
var MenuItemOption = forwardRef3((props, ref) => {
|
|
36143
36668
|
const _a = props, { icon, iconSpacing: iconSpacing2 = "0.75rem" } = _a, rest = __objRest(_a, ["icon", "iconSpacing"]);
|
|
36144
36669
|
const optionProps = useMenuOption(rest, ref);
|
|
36145
|
-
return /* @__PURE__ */
|
|
36670
|
+
return /* @__PURE__ */ React51.createElement(StyledMenuItem, __spreadProps(__spreadValues({}, optionProps), {
|
|
36146
36671
|
className: cx("chakra-menu__menuitem-option", rest.className)
|
|
36147
|
-
}), /* @__PURE__ */
|
|
36672
|
+
}), /* @__PURE__ */ React51.createElement(MenuIcon, {
|
|
36148
36673
|
fontSize: "0.8em",
|
|
36149
36674
|
marginEnd: iconSpacing2,
|
|
36150
36675
|
opacity: props.isChecked ? 1 : 0
|
|
36151
|
-
}, icon || /* @__PURE__ */
|
|
36676
|
+
}, icon || /* @__PURE__ */ React51.createElement(CheckIcon3, null)), /* @__PURE__ */ React51.createElement("span", {
|
|
36152
36677
|
style: { flex: 1 }
|
|
36153
36678
|
}, optionProps.children));
|
|
36154
36679
|
});
|
|
@@ -36159,7 +36684,7 @@ if (__DEV__) {
|
|
|
36159
36684
|
var MenuOptionGroup = (props) => {
|
|
36160
36685
|
const _a = props, { className, title } = _a, rest = __objRest(_a, ["className", "title"]);
|
|
36161
36686
|
const ownProps = useMenuOptionGroup(rest);
|
|
36162
|
-
return /* @__PURE__ */
|
|
36687
|
+
return /* @__PURE__ */ React51.createElement(MenuGroup, __spreadValues({
|
|
36163
36688
|
title,
|
|
36164
36689
|
className: cx("chakra-menu__option-group", className)
|
|
36165
36690
|
}, ownProps));
|
|
@@ -36171,11 +36696,11 @@ var MenuGroup = forwardRef3((props, ref) => {
|
|
|
36171
36696
|
const _a = props, { title, children, className } = _a, rest = __objRest(_a, ["title", "children", "className"]);
|
|
36172
36697
|
const _className = cx("chakra-menu__group__title", className);
|
|
36173
36698
|
const styles2 = useStyles();
|
|
36174
|
-
return /* @__PURE__ */
|
|
36699
|
+
return /* @__PURE__ */ React51.createElement("div", {
|
|
36175
36700
|
ref,
|
|
36176
36701
|
className: "chakra-menu__group",
|
|
36177
36702
|
role: "group"
|
|
36178
|
-
}, title && /* @__PURE__ */
|
|
36703
|
+
}, title && /* @__PURE__ */ React51.createElement(chakra.p, __spreadProps(__spreadValues({
|
|
36179
36704
|
className: _className
|
|
36180
36705
|
}, rest), {
|
|
36181
36706
|
__css: styles2.groupTitle
|
|
@@ -36186,7 +36711,7 @@ if (__DEV__) {
|
|
|
36186
36711
|
}
|
|
36187
36712
|
var MenuCommand = forwardRef3((props, ref) => {
|
|
36188
36713
|
const styles2 = useStyles();
|
|
36189
|
-
return /* @__PURE__ */
|
|
36714
|
+
return /* @__PURE__ */ React51.createElement(chakra.span, __spreadProps(__spreadValues({
|
|
36190
36715
|
ref
|
|
36191
36716
|
}, props), {
|
|
36192
36717
|
__css: styles2.command,
|
|
@@ -36198,14 +36723,14 @@ if (__DEV__) {
|
|
|
36198
36723
|
}
|
|
36199
36724
|
var MenuIcon = (props) => {
|
|
36200
36725
|
const _a = props, { className, children } = _a, rest = __objRest(_a, ["className", "children"]);
|
|
36201
|
-
const child =
|
|
36202
|
-
const clone =
|
|
36726
|
+
const child = React51.Children.only(children);
|
|
36727
|
+
const clone = React51.isValidElement(child) ? React51.cloneElement(child, {
|
|
36203
36728
|
focusable: "false",
|
|
36204
36729
|
"aria-hidden": true,
|
|
36205
36730
|
className: cx("chakra-menu__icon", child.props.className)
|
|
36206
36731
|
}) : null;
|
|
36207
36732
|
const _className = cx("chakra-menu__icon-wrapper", className);
|
|
36208
|
-
return /* @__PURE__ */
|
|
36733
|
+
return /* @__PURE__ */ React51.createElement(chakra.span, __spreadProps(__spreadValues({
|
|
36209
36734
|
className: _className
|
|
36210
36735
|
}, rest), {
|
|
36211
36736
|
__css: {
|
|
@@ -36219,7 +36744,7 @@ if (__DEV__) {
|
|
|
36219
36744
|
var MenuDivider = (props) => {
|
|
36220
36745
|
const _a = props, { className } = _a, rest = __objRest(_a, ["className"]);
|
|
36221
36746
|
const styles2 = useStyles();
|
|
36222
|
-
return /* @__PURE__ */
|
|
36747
|
+
return /* @__PURE__ */ React51.createElement(chakra.hr, __spreadProps(__spreadValues({
|
|
36223
36748
|
role: "separator",
|
|
36224
36749
|
"aria-orientation": "horizontal",
|
|
36225
36750
|
className: cx("chakra-menu__divider", className)
|
|
@@ -36241,6 +36766,7 @@ function TableOfContent({
|
|
|
36241
36766
|
navigator2.goToPage(href);
|
|
36242
36767
|
};
|
|
36243
36768
|
const tocBgColor = useColorModeValue_default("ui.white", "ui.black", "ui.sepia");
|
|
36769
|
+
const iconFill = useColorModeValue_default("ui.black", "ui.white", "ui.black");
|
|
36244
36770
|
const getLinkHref = (link2) => {
|
|
36245
36771
|
if (link2.href)
|
|
36246
36772
|
return link2.href;
|
|
@@ -36248,20 +36774,21 @@ function TableOfContent({
|
|
|
36248
36774
|
throw new Error("Manifest is not well formed");
|
|
36249
36775
|
return getLinkHref(link2.children[0]);
|
|
36250
36776
|
};
|
|
36251
|
-
return /* @__PURE__ */
|
|
36777
|
+
return /* @__PURE__ */ React52.createElement(Menu, null, ({ isOpen }) => /* @__PURE__ */ React52.createElement(React52.Fragment, null, /* @__PURE__ */ React52.createElement(MenuButton, {
|
|
36252
36778
|
as: Button_default,
|
|
36253
36779
|
border: "none",
|
|
36254
36780
|
"aria-label": "Table of Contents",
|
|
36255
|
-
leftIcon: /* @__PURE__ */
|
|
36256
|
-
as:
|
|
36781
|
+
leftIcon: /* @__PURE__ */ React52.createElement(Icon, {
|
|
36782
|
+
as: TableOfContents_default,
|
|
36257
36783
|
w: 6,
|
|
36258
|
-
h: 6
|
|
36784
|
+
h: 6,
|
|
36785
|
+
fill: iconFill
|
|
36259
36786
|
})
|
|
36260
|
-
}, /* @__PURE__ */
|
|
36787
|
+
}, /* @__PURE__ */ React52.createElement(Text, {
|
|
36261
36788
|
variant: "headerNav"
|
|
36262
|
-
}, "Table of Contents")), /* @__PURE__ */
|
|
36789
|
+
}, "Table of Contents")), /* @__PURE__ */ React52.createElement(Portal, {
|
|
36263
36790
|
containerRef
|
|
36264
|
-
}, /* @__PURE__ */
|
|
36791
|
+
}, /* @__PURE__ */ React52.createElement(MenuList, {
|
|
36265
36792
|
overflowY: "auto",
|
|
36266
36793
|
m: "0",
|
|
36267
36794
|
position: "absolute",
|
|
@@ -36275,14 +36802,14 @@ function TableOfContent({
|
|
|
36275
36802
|
borderRadius: "0"
|
|
36276
36803
|
}, manifest.toc && manifest.toc.length > 0 ? manifest.toc.map((content, i) => {
|
|
36277
36804
|
var _a;
|
|
36278
|
-
return /* @__PURE__ */
|
|
36805
|
+
return /* @__PURE__ */ React52.createElement(Item, {
|
|
36279
36806
|
key: content.title,
|
|
36280
36807
|
"aria-label": content.title,
|
|
36281
36808
|
onClick: () => tocLinkHandler(getLinkHref(content)),
|
|
36282
36809
|
html: (_a = content.title) != null ? _a : ""
|
|
36283
|
-
}, content.children && /* @__PURE__ */
|
|
36810
|
+
}, content.children && /* @__PURE__ */ React52.createElement(React52.Fragment, null, content.children.map((subLink) => {
|
|
36284
36811
|
var _a2;
|
|
36285
|
-
return /* @__PURE__ */
|
|
36812
|
+
return /* @__PURE__ */ React52.createElement(Item, {
|
|
36286
36813
|
"aria-label": subLink.title,
|
|
36287
36814
|
key: subLink.title,
|
|
36288
36815
|
onClick: () => tocLinkHandler(getLinkHref(subLink)),
|
|
@@ -36290,12 +36817,12 @@ function TableOfContent({
|
|
|
36290
36817
|
html: (_a2 = subLink.title) != null ? _a2 : ""
|
|
36291
36818
|
});
|
|
36292
36819
|
})));
|
|
36293
|
-
}) : /* @__PURE__ */
|
|
36820
|
+
}) : /* @__PURE__ */ React52.createElement(MissingToc, null, "This publication does not have a Table of Contents.")))));
|
|
36294
36821
|
}
|
|
36295
36822
|
var MissingToc = ({
|
|
36296
36823
|
children
|
|
36297
36824
|
}) => {
|
|
36298
|
-
return /* @__PURE__ */
|
|
36825
|
+
return /* @__PURE__ */ React52.createElement(Box, {
|
|
36299
36826
|
d: "flex",
|
|
36300
36827
|
justifyContent: "center",
|
|
36301
36828
|
alignItems: "center",
|
|
@@ -36303,7 +36830,7 @@ var MissingToc = ({
|
|
|
36303
36830
|
maxHeight: "100vmin"
|
|
36304
36831
|
}, children);
|
|
36305
36832
|
};
|
|
36306
|
-
var Item =
|
|
36833
|
+
var Item = React52.forwardRef((_a, ref) => {
|
|
36307
36834
|
var _b = _a, { html, children } = _b, props = __objRest(_b, ["html", "children"]);
|
|
36308
36835
|
const bgColor = useColorModeValue_default("ui.white", "ui.black", "ui.sepia");
|
|
36309
36836
|
const color3 = useColorModeValue_default("ui.black", "ui.white", "ui.black");
|
|
@@ -36316,7 +36843,7 @@ var Item = React38.forwardRef((_a, ref) => {
|
|
|
36316
36843
|
const _focus = __spreadProps(__spreadValues({}, _hover), {
|
|
36317
36844
|
boxShadow: "none"
|
|
36318
36845
|
});
|
|
36319
|
-
return /* @__PURE__ */
|
|
36846
|
+
return /* @__PURE__ */ React52.createElement(React52.Fragment, null, /* @__PURE__ */ React52.createElement(MenuItem, __spreadValues({
|
|
36320
36847
|
d: "flex",
|
|
36321
36848
|
flexDir: "column",
|
|
36322
36849
|
alignItems: "stretch",
|
|
@@ -36328,7 +36855,7 @@ var Item = React38.forwardRef((_a, ref) => {
|
|
|
36328
36855
|
tabIndex: -1,
|
|
36329
36856
|
borderBottom: "1px solid",
|
|
36330
36857
|
borderColor
|
|
36331
|
-
}, props), /* @__PURE__ */
|
|
36858
|
+
}, props), /* @__PURE__ */ React52.createElement("span", {
|
|
36332
36859
|
dangerouslySetInnerHTML: { __html: html }
|
|
36333
36860
|
})), children);
|
|
36334
36861
|
});
|
|
@@ -36373,77 +36900,70 @@ function toggleFullScreen() {
|
|
|
36373
36900
|
}
|
|
36374
36901
|
}
|
|
36375
36902
|
|
|
36376
|
-
// src/constants.ts
|
|
36377
|
-
var ReadiumWebpubContext = "http://readium.org/webpub/default.jsonld";
|
|
36378
|
-
var IS_DEV = false;
|
|
36379
|
-
var HEADER_HEIGHT = 48;
|
|
36380
|
-
var FOOTER_HEIGHT = 48;
|
|
36381
|
-
var CHROME_HEIGHT = HEADER_HEIGHT + FOOTER_HEIGHT;
|
|
36382
|
-
var DEFAULT_HEIGHT = `calc(100vh - ${CHROME_HEIGHT}px)`;
|
|
36383
|
-
var DEFAULT_SHOULD_GROW_WHEN_SCROLLING = true;
|
|
36384
|
-
var DEFAULT_SETTINGS = {
|
|
36385
|
-
colorMode: "day",
|
|
36386
|
-
isScrolling: false,
|
|
36387
|
-
fontSize: 100,
|
|
36388
|
-
fontFamily: "publisher"
|
|
36389
|
-
};
|
|
36390
|
-
var LOCAL_STORAGE_SETTINGS_KEY = "web-reader-settings";
|
|
36391
|
-
var LOCAL_STORAGE_LOCATIONS_KEY = "web-reader-locations";
|
|
36392
|
-
|
|
36393
36903
|
// src/ui/Header.tsx
|
|
36394
36904
|
var DefaultHeaderLeft = () => {
|
|
36395
36905
|
const linkColor = useColorModeValue_default("gray.700", "gray.100", "gray.700");
|
|
36396
|
-
|
|
36906
|
+
const iconFill = useColorModeValue_default("ui.gray.icon", "ui.white", "ui.gray.icon");
|
|
36907
|
+
const bgColorFocus = useColorModeValue_default("ui.gray.active", "ui.gray.x-dark", "ui.gray.active");
|
|
36908
|
+
return /* @__PURE__ */ React53.createElement(Link, {
|
|
36397
36909
|
href: "/",
|
|
36398
36910
|
"aria-label": "Return to Homepage",
|
|
36399
36911
|
tabIndex: 0,
|
|
36400
36912
|
fontSize: 0,
|
|
36913
|
+
px: 3,
|
|
36401
36914
|
py: 1,
|
|
36402
|
-
textTransform: "uppercase",
|
|
36403
36915
|
d: "flex",
|
|
36404
36916
|
color: linkColor,
|
|
36405
36917
|
height: "100%",
|
|
36406
36918
|
alignItems: "center",
|
|
36407
36919
|
_hover: {
|
|
36920
|
+
bgColor: bgColorFocus,
|
|
36408
36921
|
textDecoration: "none"
|
|
36922
|
+
},
|
|
36923
|
+
_focus: {
|
|
36924
|
+
bgColor: bgColorFocus
|
|
36409
36925
|
}
|
|
36410
|
-
}, /* @__PURE__ */
|
|
36411
|
-
as:
|
|
36926
|
+
}, /* @__PURE__ */ React53.createElement(Icon, {
|
|
36927
|
+
as: Previous_default,
|
|
36928
|
+
fill: iconFill,
|
|
36412
36929
|
w: 6,
|
|
36413
36930
|
h: 6
|
|
36414
|
-
}), /* @__PURE__ */
|
|
36415
|
-
paddingLeft: 2,
|
|
36931
|
+
}), /* @__PURE__ */ React53.createElement(Text, {
|
|
36416
36932
|
variant: "headerNav"
|
|
36417
|
-
}, "Back
|
|
36933
|
+
}, "Back"));
|
|
36418
36934
|
};
|
|
36419
36935
|
function Header(props) {
|
|
36420
36936
|
const [isFullscreen, toggleFullScreen2] = useFullscreen();
|
|
36421
36937
|
const { headerLeft, navigator: navigator2, manifest, containerRef } = props;
|
|
36422
|
-
const
|
|
36423
|
-
|
|
36938
|
+
const iconFill = useColorModeValue_default("ui.gray.icon", "ui.white", "ui.gray.icon");
|
|
36939
|
+
const mainBgColor = useColorModeValue_default("ui.gray.light-warm", "ui.black", "ui.sepia");
|
|
36940
|
+
return /* @__PURE__ */ React53.createElement(HeaderWrapper, {
|
|
36424
36941
|
bg: mainBgColor
|
|
36425
|
-
}, headerLeft != null ? headerLeft : /* @__PURE__ */
|
|
36942
|
+
}, headerLeft != null ? headerLeft : /* @__PURE__ */ React53.createElement(DefaultHeaderLeft, null), /* @__PURE__ */ React53.createElement(HStack, {
|
|
36426
36943
|
ml: "auto",
|
|
36427
36944
|
spacing: 1
|
|
36428
|
-
}, /* @__PURE__ */
|
|
36945
|
+
}, /* @__PURE__ */ React53.createElement(TableOfContent, {
|
|
36429
36946
|
containerRef,
|
|
36430
36947
|
navigator: navigator2,
|
|
36431
36948
|
manifest
|
|
36432
|
-
}), /* @__PURE__ */
|
|
36949
|
+
}), /* @__PURE__ */ React53.createElement(SettingsCard, __spreadValues({}, props)), /* @__PURE__ */ React53.createElement(Button_default, {
|
|
36950
|
+
"aria-expanded": isFullscreen,
|
|
36951
|
+
"aria-label": "Toggle full screen",
|
|
36433
36952
|
border: "none",
|
|
36434
36953
|
onClick: toggleFullScreen2,
|
|
36435
|
-
leftIcon: /* @__PURE__ */
|
|
36436
|
-
as: isFullscreen ?
|
|
36954
|
+
leftIcon: /* @__PURE__ */ React53.createElement(Icon, {
|
|
36955
|
+
as: isFullscreen ? ToggleFullScreenExit_default : ToggleFullScreen_default,
|
|
36956
|
+
fill: iconFill,
|
|
36437
36957
|
w: 6,
|
|
36438
36958
|
h: 6
|
|
36439
36959
|
})
|
|
36440
|
-
}, /* @__PURE__ */
|
|
36960
|
+
}, /* @__PURE__ */ React53.createElement(Text, {
|
|
36441
36961
|
variant: "headerNav"
|
|
36442
|
-
}, "
|
|
36962
|
+
}, isFullscreen ? "Full screen exit" : "Full screen"))));
|
|
36443
36963
|
}
|
|
36444
|
-
var HeaderWrapper =
|
|
36964
|
+
var HeaderWrapper = React53.forwardRef((_a, ref) => {
|
|
36445
36965
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
36446
|
-
return /* @__PURE__ */
|
|
36966
|
+
return /* @__PURE__ */ React53.createElement(Flex, __spreadValues({
|
|
36447
36967
|
ref,
|
|
36448
36968
|
as: "header",
|
|
36449
36969
|
position: "sticky",
|
|
@@ -36462,7 +36982,7 @@ var HeaderWrapper = React39.forwardRef((_a, ref) => {
|
|
|
36462
36982
|
|
|
36463
36983
|
// src/ui/ErrorBoundary.tsx
|
|
36464
36984
|
var initialState = { error: void 0, info: void 0 };
|
|
36465
|
-
var ErrorBoundary = class extends
|
|
36985
|
+
var ErrorBoundary = class extends React54.Component {
|
|
36466
36986
|
constructor() {
|
|
36467
36987
|
super(...arguments);
|
|
36468
36988
|
this.state = initialState;
|
|
@@ -36483,13 +37003,13 @@ var ErrorBoundary = class extends React40.Component {
|
|
|
36483
37003
|
var _a;
|
|
36484
37004
|
const { error: error2, info } = this.state;
|
|
36485
37005
|
if (error2 && info) {
|
|
36486
|
-
return /* @__PURE__ */
|
|
37006
|
+
return /* @__PURE__ */ React54.createElement(ThemeProvider3, {
|
|
36487
37007
|
theme: getTheme3("day")
|
|
36488
|
-
}, /* @__PURE__ */
|
|
37008
|
+
}, /* @__PURE__ */ React54.createElement(HeaderWrapper, null, (_a = this.props.headerLeft) != null ? _a : /* @__PURE__ */ React54.createElement(DefaultHeaderLeft, null)), /* @__PURE__ */ React54.createElement(Flex, {
|
|
36489
37009
|
m: 3,
|
|
36490
37010
|
justifyContent: "center",
|
|
36491
37011
|
mt: "20%"
|
|
36492
|
-
}, /* @__PURE__ */
|
|
37012
|
+
}, /* @__PURE__ */ React54.createElement(Alert, {
|
|
36493
37013
|
status: "error",
|
|
36494
37014
|
variant: "top-accent",
|
|
36495
37015
|
flexDirection: "column",
|
|
@@ -36497,9 +37017,9 @@ var ErrorBoundary = class extends React40.Component {
|
|
|
36497
37017
|
justifyContent: "center",
|
|
36498
37018
|
textAlign: "center",
|
|
36499
37019
|
maxW: "600px"
|
|
36500
|
-
}, /* @__PURE__ */
|
|
37020
|
+
}, /* @__PURE__ */ React54.createElement(AlertIcon, null), /* @__PURE__ */ React54.createElement(AlertTitle, {
|
|
36501
37021
|
as: "h1"
|
|
36502
|
-
}, "An error occurred"), /* @__PURE__ */
|
|
37022
|
+
}, "An error occurred"), /* @__PURE__ */ React54.createElement(AlertDescription, {
|
|
36503
37023
|
role: "alert",
|
|
36504
37024
|
"aria-label": error2.message
|
|
36505
37025
|
}, error2.message))));
|
|
@@ -36510,18 +37030,18 @@ var ErrorBoundary = class extends React40.Component {
|
|
|
36510
37030
|
var ErrorBoundary_default = ErrorBoundary;
|
|
36511
37031
|
|
|
36512
37032
|
// src/ui/manager.tsx
|
|
36513
|
-
import * as
|
|
37033
|
+
import * as React57 from "react";
|
|
36514
37034
|
|
|
36515
37035
|
// src/ui/Footer.tsx
|
|
36516
|
-
import * as
|
|
37036
|
+
import * as React56 from "react";
|
|
36517
37037
|
|
|
36518
37038
|
// src/ui/PageButton.tsx
|
|
36519
|
-
import
|
|
37039
|
+
import React55 from "react";
|
|
36520
37040
|
function PageButton(props) {
|
|
36521
37041
|
const _a = props, { children, onClick } = _a, rest = __objRest(_a, ["children", "onClick"]);
|
|
36522
37042
|
const circleColor = useColorModeValue_default("ui.black", "ui.white", "ui.black");
|
|
36523
37043
|
const circleBgColor = useColorModeValue_default("ui.white", "gray.700", "ui.white");
|
|
36524
|
-
return /* @__PURE__ */
|
|
37044
|
+
return /* @__PURE__ */ React55.createElement(Button, __spreadValues({
|
|
36525
37045
|
color: circleColor,
|
|
36526
37046
|
bg: circleBgColor,
|
|
36527
37047
|
height: "auto",
|
|
@@ -36542,10 +37062,10 @@ var Footer = (_a) => {
|
|
|
36542
37062
|
"state",
|
|
36543
37063
|
"navigator"
|
|
36544
37064
|
]);
|
|
36545
|
-
const bgColor = useColorModeValue_default("ui.
|
|
37065
|
+
const bgColor = useColorModeValue_default("ui.gray.light-warm", "ui.black", "ui.sepia");
|
|
36546
37066
|
const isAtStart = state2 == null ? void 0 : state2.atStart;
|
|
36547
37067
|
const isAtEnd = state2 == null ? void 0 : state2.atEnd;
|
|
36548
|
-
return /* @__PURE__ */
|
|
37068
|
+
return /* @__PURE__ */ React56.createElement(Flex, __spreadValues({
|
|
36549
37069
|
as: "footer",
|
|
36550
37070
|
position: "sticky",
|
|
36551
37071
|
height: `${FOOTER_HEIGHT}px`,
|
|
@@ -36556,19 +37076,19 @@ var Footer = (_a) => {
|
|
|
36556
37076
|
bg: bgColor,
|
|
36557
37077
|
borderTop: "1px solid",
|
|
36558
37078
|
borderColor: "gray.100"
|
|
36559
|
-
}, rest), /* @__PURE__ */
|
|
37079
|
+
}, rest), /* @__PURE__ */ React56.createElement(PageButton_default, {
|
|
36560
37080
|
onClick: navigator2 == null ? void 0 : navigator2.goBackward,
|
|
36561
37081
|
"aria-label": "Previous Page",
|
|
36562
37082
|
disabled: isAtStart
|
|
36563
|
-
}, /* @__PURE__ */
|
|
37083
|
+
}, /* @__PURE__ */ React56.createElement(Icon, {
|
|
36564
37084
|
as: MdKeyboardArrowLeft,
|
|
36565
37085
|
w: 6,
|
|
36566
37086
|
h: 6
|
|
36567
|
-
}), "Previous"), /* @__PURE__ */
|
|
37087
|
+
}), "Previous"), /* @__PURE__ */ React56.createElement(PageButton_default, {
|
|
36568
37088
|
onClick: navigator2 == null ? void 0 : navigator2.goForward,
|
|
36569
37089
|
"aria-label": "Next Page",
|
|
36570
37090
|
disabled: isAtEnd
|
|
36571
|
-
}, "Next ", /* @__PURE__ */
|
|
37091
|
+
}, "Next ", /* @__PURE__ */ React56.createElement(Icon, {
|
|
36572
37092
|
as: MdKeyboardArrowRight,
|
|
36573
37093
|
w: 6,
|
|
36574
37094
|
h: 6
|
|
@@ -36579,9 +37099,9 @@ var Footer_default = Footer;
|
|
|
36579
37099
|
// src/ui/manager.tsx
|
|
36580
37100
|
var ManagerUI = (props) => {
|
|
36581
37101
|
var _a, _b;
|
|
36582
|
-
return /* @__PURE__ */
|
|
37102
|
+
return /* @__PURE__ */ React57.createElement(ThemeProvider3, {
|
|
36583
37103
|
theme: getTheme3((_b = (_a = props.state) == null ? void 0 : _a.settings) == null ? void 0 : _b.colorMode)
|
|
36584
|
-
}, /* @__PURE__ */
|
|
37104
|
+
}, /* @__PURE__ */ React57.createElement(WebReaderContent, __spreadValues({}, props)));
|
|
36585
37105
|
};
|
|
36586
37106
|
var WebReaderContent = (_a) => {
|
|
36587
37107
|
var _b = _a, {
|
|
@@ -36592,15 +37112,15 @@ var WebReaderContent = (_a) => {
|
|
|
36592
37112
|
"headerLeft"
|
|
36593
37113
|
]);
|
|
36594
37114
|
const bgColor = useColorModeValue_default("ui.white", "ui.black", "ui.sepia");
|
|
36595
|
-
const containerRef =
|
|
36596
|
-
return /* @__PURE__ */
|
|
37115
|
+
const containerRef = React57.useRef(null);
|
|
37116
|
+
return /* @__PURE__ */ React57.createElement(Flex, {
|
|
36597
37117
|
flexDir: "column",
|
|
36598
37118
|
w: "100%",
|
|
36599
37119
|
position: "relative"
|
|
36600
|
-
}, !props.isLoading && /* @__PURE__ */
|
|
37120
|
+
}, !props.isLoading && /* @__PURE__ */ React57.createElement(Header, __spreadValues({
|
|
36601
37121
|
headerLeft,
|
|
36602
37122
|
containerRef
|
|
36603
|
-
}, props)), /* @__PURE__ */
|
|
37123
|
+
}, props)), /* @__PURE__ */ React57.createElement(Flex, {
|
|
36604
37124
|
as: "main",
|
|
36605
37125
|
ref: containerRef,
|
|
36606
37126
|
position: "relative",
|
|
@@ -36608,7 +37128,7 @@ var WebReaderContent = (_a) => {
|
|
|
36608
37128
|
flexDir: "column",
|
|
36609
37129
|
alignItems: "stretch",
|
|
36610
37130
|
flex: "1 1 auto"
|
|
36611
|
-
}, children), /* @__PURE__ */
|
|
37131
|
+
}, children), /* @__PURE__ */ React57.createElement(Footer_default, {
|
|
36612
37132
|
state: props.state,
|
|
36613
37133
|
navigator: props.navigator
|
|
36614
37134
|
}));
|
|
@@ -36616,7 +37136,7 @@ var WebReaderContent = (_a) => {
|
|
|
36616
37136
|
var manager_default = ManagerUI;
|
|
36617
37137
|
|
|
36618
37138
|
// src/useWebReader.tsx
|
|
36619
|
-
import
|
|
37139
|
+
import React80 from "react";
|
|
36620
37140
|
|
|
36621
37141
|
// src/utils/fetch.ts
|
|
36622
37142
|
function fetchJson(url) {
|
|
@@ -36777,7 +37297,7 @@ function _getPrototypeOf(o) {
|
|
|
36777
37297
|
// node_modules/react-pdf/dist/esm/Document.js
|
|
36778
37298
|
var import_prop_types3 = __toESM(require_prop_types());
|
|
36779
37299
|
var import_make_event_props2 = __toESM(require_entry());
|
|
36780
|
-
import
|
|
37300
|
+
import React59, { PureComponent } from "react";
|
|
36781
37301
|
|
|
36782
37302
|
// node_modules/make-cancellable-promise/dist/esm/index.js
|
|
36783
37303
|
function makeCancellablePromise(promise) {
|
|
@@ -36815,10 +37335,10 @@ var DocumentContext_default = /* @__PURE__ */ createContext13(null);
|
|
|
36815
37335
|
|
|
36816
37336
|
// node_modules/react-pdf/dist/esm/Message.js
|
|
36817
37337
|
var import_prop_types = __toESM(require_prop_types());
|
|
36818
|
-
import
|
|
37338
|
+
import React58 from "react";
|
|
36819
37339
|
function Message(_ref) {
|
|
36820
37340
|
var children = _ref.children, type = _ref.type;
|
|
36821
|
-
return /* @__PURE__ */
|
|
37341
|
+
return /* @__PURE__ */ React58.createElement("div", {
|
|
36822
37342
|
className: "react-pdf__message react-pdf__message--".concat(type)
|
|
36823
37343
|
}, children);
|
|
36824
37344
|
}
|
|
@@ -37642,7 +38162,7 @@ var Document = /* @__PURE__ */ function(_PureComponent) {
|
|
|
37642
38162
|
key: "renderChildren",
|
|
37643
38163
|
value: function renderChildren() {
|
|
37644
38164
|
var children = this.props.children;
|
|
37645
|
-
return /* @__PURE__ */
|
|
38165
|
+
return /* @__PURE__ */ React59.createElement(DocumentContext_default.Provider, {
|
|
37646
38166
|
value: this.childContext
|
|
37647
38167
|
}, children);
|
|
37648
38168
|
}
|
|
@@ -37653,19 +38173,19 @@ var Document = /* @__PURE__ */ function(_PureComponent) {
|
|
|
37653
38173
|
var pdf = this.state.pdf;
|
|
37654
38174
|
if (!file) {
|
|
37655
38175
|
var noData = this.props.noData;
|
|
37656
|
-
return /* @__PURE__ */
|
|
38176
|
+
return /* @__PURE__ */ React59.createElement(Message, {
|
|
37657
38177
|
type: "no-data"
|
|
37658
38178
|
}, typeof noData === "function" ? noData() : noData);
|
|
37659
38179
|
}
|
|
37660
38180
|
if (pdf === null) {
|
|
37661
38181
|
var loading = this.props.loading;
|
|
37662
|
-
return /* @__PURE__ */
|
|
38182
|
+
return /* @__PURE__ */ React59.createElement(Message, {
|
|
37663
38183
|
type: "loading"
|
|
37664
38184
|
}, typeof loading === "function" ? loading() : loading);
|
|
37665
38185
|
}
|
|
37666
38186
|
if (pdf === false) {
|
|
37667
38187
|
var error2 = this.props.error;
|
|
37668
|
-
return /* @__PURE__ */
|
|
38188
|
+
return /* @__PURE__ */ React59.createElement(Message, {
|
|
37669
38189
|
type: "error"
|
|
37670
38190
|
}, typeof error2 === "function" ? error2() : error2);
|
|
37671
38191
|
}
|
|
@@ -37675,7 +38195,7 @@ var Document = /* @__PURE__ */ function(_PureComponent) {
|
|
|
37675
38195
|
key: "render",
|
|
37676
38196
|
value: function render() {
|
|
37677
38197
|
var _this$props2 = this.props, className = _this$props2.className, inputRef = _this$props2.inputRef;
|
|
37678
|
-
return /* @__PURE__ */
|
|
38198
|
+
return /* @__PURE__ */ React59.createElement("div", _extends({
|
|
37679
38199
|
className: mergeClassNames("react-pdf__Document", className),
|
|
37680
38200
|
ref: inputRef
|
|
37681
38201
|
}, this.eventProps), this.renderContent());
|
|
@@ -37750,7 +38270,7 @@ Document.propTypes = _objectSpread(_objectSpread({}, eventProps), {}, {
|
|
|
37750
38270
|
// node_modules/react-pdf/dist/esm/Outline.js
|
|
37751
38271
|
var import_regenerator4 = __toESM(require_regenerator());
|
|
37752
38272
|
var import_prop_types5 = __toESM(require_prop_types());
|
|
37753
|
-
import
|
|
38273
|
+
import React61, { PureComponent as PureComponent3 } from "react";
|
|
37754
38274
|
var import_make_event_props3 = __toESM(require_entry());
|
|
37755
38275
|
|
|
37756
38276
|
// node_modules/react-pdf/dist/esm/OutlineContext.js
|
|
@@ -37760,7 +38280,7 @@ var OutlineContext_default = /* @__PURE__ */ createContext14(null);
|
|
|
37760
38280
|
// node_modules/react-pdf/dist/esm/OutlineItem.js
|
|
37761
38281
|
var import_regenerator3 = __toESM(require_regenerator());
|
|
37762
38282
|
var import_prop_types4 = __toESM(require_prop_types());
|
|
37763
|
-
import
|
|
38283
|
+
import React60, { PureComponent as PureComponent2 } from "react";
|
|
37764
38284
|
|
|
37765
38285
|
// node_modules/react-pdf/dist/esm/Ref.js
|
|
37766
38286
|
var Ref = /* @__PURE__ */ function() {
|
|
@@ -37954,8 +38474,8 @@ var OutlineItemInternal = /* @__PURE__ */ function(_PureComponent) {
|
|
|
37954
38474
|
return null;
|
|
37955
38475
|
}
|
|
37956
38476
|
var subitems = item.items;
|
|
37957
|
-
return /* @__PURE__ */
|
|
37958
|
-
return /* @__PURE__ */
|
|
38477
|
+
return /* @__PURE__ */ React60.createElement("ul", null, subitems.map(function(subitem, subitemIndex) {
|
|
38478
|
+
return /* @__PURE__ */ React60.createElement(OutlineItemInternal2, _extends({
|
|
37959
38479
|
key: typeof subitem.destination === "string" ? subitem.destination : subitemIndex,
|
|
37960
38480
|
item: subitem
|
|
37961
38481
|
}, otherProps));
|
|
@@ -37965,7 +38485,7 @@ var OutlineItemInternal = /* @__PURE__ */ function(_PureComponent) {
|
|
|
37965
38485
|
key: "render",
|
|
37966
38486
|
value: function render() {
|
|
37967
38487
|
var item = this.props.item;
|
|
37968
|
-
return /* @__PURE__ */
|
|
38488
|
+
return /* @__PURE__ */ React60.createElement("li", null, /* @__PURE__ */ React60.createElement("a", {
|
|
37969
38489
|
href: "#",
|
|
37970
38490
|
onClick: this.onClick
|
|
37971
38491
|
}, item.title), this.renderSubitems());
|
|
@@ -37987,9 +38507,9 @@ OutlineItemInternal.propTypes = {
|
|
|
37987
38507
|
pdf: isPdf.isRequired
|
|
37988
38508
|
};
|
|
37989
38509
|
var OutlineItem = function OutlineItem2(props) {
|
|
37990
|
-
return /* @__PURE__ */
|
|
37991
|
-
return /* @__PURE__ */
|
|
37992
|
-
return /* @__PURE__ */
|
|
38510
|
+
return /* @__PURE__ */ React60.createElement(DocumentContext_default.Consumer, null, function(documentContext) {
|
|
38511
|
+
return /* @__PURE__ */ React60.createElement(OutlineContext_default.Consumer, null, function(outlineContext) {
|
|
38512
|
+
return /* @__PURE__ */ React60.createElement(OutlineItemInternal, _extends({}, documentContext, outlineContext, props));
|
|
37993
38513
|
});
|
|
37994
38514
|
});
|
|
37995
38515
|
};
|
|
@@ -38157,8 +38677,8 @@ var OutlineInternal = /* @__PURE__ */ function(_PureComponent) {
|
|
|
38157
38677
|
key: "renderOutline",
|
|
38158
38678
|
value: function renderOutline() {
|
|
38159
38679
|
var outline5 = this.state.outline;
|
|
38160
|
-
return /* @__PURE__ */
|
|
38161
|
-
return /* @__PURE__ */
|
|
38680
|
+
return /* @__PURE__ */ React61.createElement("ul", null, outline5.map(function(item, itemIndex) {
|
|
38681
|
+
return /* @__PURE__ */ React61.createElement(OutlineItem_default, {
|
|
38162
38682
|
key: typeof item.destination === "string" ? item.destination : itemIndex,
|
|
38163
38683
|
item
|
|
38164
38684
|
});
|
|
@@ -38173,10 +38693,10 @@ var OutlineInternal = /* @__PURE__ */ function(_PureComponent) {
|
|
|
38173
38693
|
return null;
|
|
38174
38694
|
}
|
|
38175
38695
|
var _this$props = this.props, className = _this$props.className, inputRef = _this$props.inputRef;
|
|
38176
|
-
return /* @__PURE__ */
|
|
38696
|
+
return /* @__PURE__ */ React61.createElement("div", _extends({
|
|
38177
38697
|
className: mergeClassNames("react-pdf__Outline", className),
|
|
38178
38698
|
ref: inputRef
|
|
38179
|
-
}, this.eventProps), /* @__PURE__ */
|
|
38699
|
+
}, this.eventProps), /* @__PURE__ */ React61.createElement(OutlineContext_default.Provider, {
|
|
38180
38700
|
value: this.childContext
|
|
38181
38701
|
}, this.renderOutline()));
|
|
38182
38702
|
}
|
|
@@ -38210,7 +38730,7 @@ OutlineInternal.propTypes = _objectSpread2({
|
|
|
38210
38730
|
// node_modules/react-pdf/dist/esm/Page.js
|
|
38211
38731
|
var import_regenerator8 = __toESM(require_regenerator());
|
|
38212
38732
|
var import_prop_types11 = __toESM(require_prop_types());
|
|
38213
|
-
import
|
|
38733
|
+
import React67, { PureComponent as PureComponent9 } from "react";
|
|
38214
38734
|
var import_make_event_props4 = __toESM(require_entry());
|
|
38215
38735
|
|
|
38216
38736
|
// node_modules/merge-refs/dist/esm/index.js
|
|
@@ -38239,7 +38759,7 @@ var PageContext_default = /* @__PURE__ */ createContext15(null);
|
|
|
38239
38759
|
|
|
38240
38760
|
// node_modules/react-pdf/dist/esm/Page/PageCanvas.js
|
|
38241
38761
|
var import_prop_types6 = __toESM(require_prop_types());
|
|
38242
|
-
import
|
|
38762
|
+
import React62, { PureComponent as PureComponent4 } from "react";
|
|
38243
38763
|
function _createSuper4(Derived) {
|
|
38244
38764
|
var hasNativeReflectConstruct = _isNativeReflectConstruct4();
|
|
38245
38765
|
return function _createSuperInternal() {
|
|
@@ -38354,7 +38874,7 @@ var PageCanvasInternal = /* @__PURE__ */ function(_PureComponent) {
|
|
|
38354
38874
|
value: function render() {
|
|
38355
38875
|
var _this2 = this;
|
|
38356
38876
|
var canvasRef = this.props.canvasRef;
|
|
38357
|
-
return /* @__PURE__ */
|
|
38877
|
+
return /* @__PURE__ */ React62.createElement("canvas", {
|
|
38358
38878
|
className: "react-pdf__Page__canvas",
|
|
38359
38879
|
dir: "ltr",
|
|
38360
38880
|
ref: mergeRefs2(canvasRef, function(ref) {
|
|
@@ -38398,15 +38918,15 @@ PageCanvasInternal.propTypes = {
|
|
|
38398
38918
|
scale: import_prop_types6.default.number.isRequired
|
|
38399
38919
|
};
|
|
38400
38920
|
function PageCanvas(props) {
|
|
38401
|
-
return /* @__PURE__ */
|
|
38402
|
-
return /* @__PURE__ */
|
|
38921
|
+
return /* @__PURE__ */ React62.createElement(PageContext_default.Consumer, null, function(context) {
|
|
38922
|
+
return /* @__PURE__ */ React62.createElement(PageCanvasInternal, _extends({}, context, props));
|
|
38403
38923
|
});
|
|
38404
38924
|
}
|
|
38405
38925
|
|
|
38406
38926
|
// node_modules/react-pdf/dist/esm/Page/PageSVG.js
|
|
38407
38927
|
var import_prop_types7 = __toESM(require_prop_types());
|
|
38408
38928
|
var pdfjs2 = __toESM(require_pdf());
|
|
38409
|
-
import
|
|
38929
|
+
import React63, { PureComponent as PureComponent5 } from "react";
|
|
38410
38930
|
function _createSuper5(Derived) {
|
|
38411
38931
|
var hasNativeReflectConstruct = _isNativeReflectConstruct5();
|
|
38412
38932
|
return function _createSuperInternal() {
|
|
@@ -38499,7 +39019,7 @@ var PageSVGInternal = /* @__PURE__ */ function(_PureComponent) {
|
|
|
38499
39019
|
value: function render() {
|
|
38500
39020
|
var _this2 = this;
|
|
38501
39021
|
var _this$viewport2 = this.viewport, width = _this$viewport2.width, height = _this$viewport2.height;
|
|
38502
|
-
return /* @__PURE__ */
|
|
39022
|
+
return /* @__PURE__ */ React63.createElement("div", {
|
|
38503
39023
|
className: "react-pdf__Page__svg",
|
|
38504
39024
|
ref: function ref(_ref) {
|
|
38505
39025
|
return _this2.drawPageOnContainer(_ref);
|
|
@@ -38534,20 +39054,20 @@ PageSVGInternal.propTypes = {
|
|
|
38534
39054
|
scale: import_prop_types7.default.number.isRequired
|
|
38535
39055
|
};
|
|
38536
39056
|
function PageSVG(props) {
|
|
38537
|
-
return /* @__PURE__ */
|
|
38538
|
-
return /* @__PURE__ */
|
|
39057
|
+
return /* @__PURE__ */ React63.createElement(PageContext_default.Consumer, null, function(context) {
|
|
39058
|
+
return /* @__PURE__ */ React63.createElement(PageSVGInternal, _extends({}, context, props));
|
|
38539
39059
|
});
|
|
38540
39060
|
}
|
|
38541
39061
|
|
|
38542
39062
|
// node_modules/react-pdf/dist/esm/Page/TextLayer.js
|
|
38543
39063
|
var import_regenerator6 = __toESM(require_regenerator());
|
|
38544
39064
|
var import_prop_types9 = __toESM(require_prop_types());
|
|
38545
|
-
import
|
|
39065
|
+
import React65, { PureComponent as PureComponent7 } from "react";
|
|
38546
39066
|
|
|
38547
39067
|
// node_modules/react-pdf/dist/esm/Page/TextLayerItem.js
|
|
38548
39068
|
var import_regenerator5 = __toESM(require_regenerator());
|
|
38549
39069
|
var import_prop_types8 = __toESM(require_prop_types());
|
|
38550
|
-
import
|
|
39070
|
+
import React64, { PureComponent as PureComponent6 } from "react";
|
|
38551
39071
|
function _createSuper6(Derived) {
|
|
38552
39072
|
var hasNativeReflectConstruct = _isNativeReflectConstruct6();
|
|
38553
39073
|
return function _createSuperInternal() {
|
|
@@ -38683,7 +39203,7 @@ var TextLayerItemInternal = /* @__PURE__ */ function(_PureComponent) {
|
|
|
38683
39203
|
var _this2 = this;
|
|
38684
39204
|
var fontSize = this.fontSize, top2 = this.top, left2 = this.left;
|
|
38685
39205
|
var _this$props2 = this.props, customTextRenderer = _this$props2.customTextRenderer, scale2 = _this$props2.scale, text = _this$props2.str;
|
|
38686
|
-
return /* @__PURE__ */
|
|
39206
|
+
return /* @__PURE__ */ React64.createElement("span", {
|
|
38687
39207
|
ref: function ref(_ref) {
|
|
38688
39208
|
_this2.item = _ref;
|
|
38689
39209
|
},
|
|
@@ -38767,8 +39287,8 @@ TextLayerItemInternal.propTypes = {
|
|
|
38767
39287
|
width: import_prop_types8.default.number.isRequired
|
|
38768
39288
|
};
|
|
38769
39289
|
function TextLayerItem(props) {
|
|
38770
|
-
return /* @__PURE__ */
|
|
38771
|
-
return /* @__PURE__ */
|
|
39290
|
+
return /* @__PURE__ */ React64.createElement(PageContext_default.Consumer, null, function(context) {
|
|
39291
|
+
return /* @__PURE__ */ React64.createElement(TextLayerItemInternal, _extends({}, context, props));
|
|
38772
39292
|
});
|
|
38773
39293
|
}
|
|
38774
39294
|
|
|
@@ -38892,7 +39412,7 @@ var TextLayerInternal = /* @__PURE__ */ function(_PureComponent) {
|
|
|
38892
39412
|
return null;
|
|
38893
39413
|
}
|
|
38894
39414
|
return textItems.map(function(textItem, itemIndex) {
|
|
38895
|
-
return /* @__PURE__ */
|
|
39415
|
+
return /* @__PURE__ */ React65.createElement(TextLayerItem, _extends({
|
|
38896
39416
|
key: itemIndex,
|
|
38897
39417
|
itemIndex
|
|
38898
39418
|
}, textItem));
|
|
@@ -38902,7 +39422,7 @@ var TextLayerInternal = /* @__PURE__ */ function(_PureComponent) {
|
|
|
38902
39422
|
key: "render",
|
|
38903
39423
|
value: function render() {
|
|
38904
39424
|
var viewport2 = this.unrotatedViewport, rotate = this.rotate;
|
|
38905
|
-
return /* @__PURE__ */
|
|
39425
|
+
return /* @__PURE__ */ React65.createElement("div", {
|
|
38906
39426
|
className: "react-pdf__Page__textContent",
|
|
38907
39427
|
style: {
|
|
38908
39428
|
position: "absolute",
|
|
@@ -38942,8 +39462,8 @@ TextLayerInternal.propTypes = {
|
|
|
38942
39462
|
scale: import_prop_types9.default.number
|
|
38943
39463
|
};
|
|
38944
39464
|
function TextLayer(props) {
|
|
38945
|
-
return /* @__PURE__ */
|
|
38946
|
-
return /* @__PURE__ */
|
|
39465
|
+
return /* @__PURE__ */ React65.createElement(PageContext_default.Consumer, null, function(context) {
|
|
39466
|
+
return /* @__PURE__ */ React65.createElement(TextLayerInternal, _extends({}, context, props));
|
|
38947
39467
|
});
|
|
38948
39468
|
}
|
|
38949
39469
|
|
|
@@ -38951,7 +39471,7 @@ function TextLayer(props) {
|
|
|
38951
39471
|
var import_regenerator7 = __toESM(require_regenerator());
|
|
38952
39472
|
var import_prop_types10 = __toESM(require_prop_types());
|
|
38953
39473
|
var pdfjs3 = __toESM(require_pdf());
|
|
38954
|
-
import
|
|
39474
|
+
import React66, { PureComponent as PureComponent8 } from "react";
|
|
38955
39475
|
function _createSuper8(Derived) {
|
|
38956
39476
|
var hasNativeReflectConstruct = _isNativeReflectConstruct8();
|
|
38957
39477
|
return function _createSuperInternal() {
|
|
@@ -39105,7 +39625,7 @@ var AnnotationLayerInternal = /* @__PURE__ */ function(_PureComponent) {
|
|
|
39105
39625
|
key: "render",
|
|
39106
39626
|
value: function render() {
|
|
39107
39627
|
var _this2 = this;
|
|
39108
|
-
return /* @__PURE__ */
|
|
39628
|
+
return /* @__PURE__ */ React66.createElement("div", {
|
|
39109
39629
|
className: "react-pdf__Page__annotations annotationLayer",
|
|
39110
39630
|
ref: function ref(_ref2) {
|
|
39111
39631
|
_this2.annotationLayer = _ref2;
|
|
@@ -39137,9 +39657,9 @@ AnnotationLayerInternal.propTypes = {
|
|
|
39137
39657
|
scale: import_prop_types10.default.number
|
|
39138
39658
|
};
|
|
39139
39659
|
var AnnotationLayer2 = function AnnotationLayer3(props) {
|
|
39140
|
-
return /* @__PURE__ */
|
|
39141
|
-
return /* @__PURE__ */
|
|
39142
|
-
return /* @__PURE__ */
|
|
39660
|
+
return /* @__PURE__ */ React66.createElement(DocumentContext_default.Consumer, null, function(documentContext) {
|
|
39661
|
+
return /* @__PURE__ */ React66.createElement(PageContext_default.Consumer, null, function(pageContext) {
|
|
39662
|
+
return /* @__PURE__ */ React66.createElement(AnnotationLayerInternal, _extends({}, documentContext, pageContext, props));
|
|
39143
39663
|
});
|
|
39144
39664
|
});
|
|
39145
39665
|
};
|
|
@@ -39341,12 +39861,12 @@ var PageInternal = /* @__PURE__ */ function(_PureComponent) {
|
|
|
39341
39861
|
case "none":
|
|
39342
39862
|
return null;
|
|
39343
39863
|
case "svg":
|
|
39344
|
-
return /* @__PURE__ */
|
|
39864
|
+
return /* @__PURE__ */ React67.createElement(PageSVG, {
|
|
39345
39865
|
key: "".concat(this.pageKeyNoScale, "_svg")
|
|
39346
39866
|
});
|
|
39347
39867
|
case "canvas":
|
|
39348
39868
|
default:
|
|
39349
|
-
return /* @__PURE__ */
|
|
39869
|
+
return /* @__PURE__ */ React67.createElement(PageCanvas, {
|
|
39350
39870
|
key: "".concat(this.pageKey, "_canvas"),
|
|
39351
39871
|
canvasRef
|
|
39352
39872
|
});
|
|
@@ -39359,7 +39879,7 @@ var PageInternal = /* @__PURE__ */ function(_PureComponent) {
|
|
|
39359
39879
|
if (!renderTextLayer2) {
|
|
39360
39880
|
return null;
|
|
39361
39881
|
}
|
|
39362
|
-
return /* @__PURE__ */
|
|
39882
|
+
return /* @__PURE__ */ React67.createElement(TextLayer, {
|
|
39363
39883
|
key: "".concat(this.pageKey, "_text")
|
|
39364
39884
|
});
|
|
39365
39885
|
}
|
|
@@ -39370,7 +39890,7 @@ var PageInternal = /* @__PURE__ */ function(_PureComponent) {
|
|
|
39370
39890
|
if (!renderAnnotationLayer2) {
|
|
39371
39891
|
return null;
|
|
39372
39892
|
}
|
|
39373
|
-
return /* @__PURE__ */
|
|
39893
|
+
return /* @__PURE__ */ React67.createElement(AnnotationLayer_default, {
|
|
39374
39894
|
key: "".concat(this.pageKey, "_annotations")
|
|
39375
39895
|
});
|
|
39376
39896
|
}
|
|
@@ -39378,7 +39898,7 @@ var PageInternal = /* @__PURE__ */ function(_PureComponent) {
|
|
|
39378
39898
|
key: "renderChildren",
|
|
39379
39899
|
value: function renderChildren() {
|
|
39380
39900
|
var children = this.props.children;
|
|
39381
|
-
return /* @__PURE__ */
|
|
39901
|
+
return /* @__PURE__ */ React67.createElement(PageContext_default.Provider, {
|
|
39382
39902
|
value: this.childContext
|
|
39383
39903
|
}, this.renderMainLayer(), this.renderTextLayer(), this.renderAnnotationLayer(), children);
|
|
39384
39904
|
}
|
|
@@ -39390,19 +39910,19 @@ var PageInternal = /* @__PURE__ */ function(_PureComponent) {
|
|
|
39390
39910
|
var page = this.state.page;
|
|
39391
39911
|
if (!pageNumber) {
|
|
39392
39912
|
var noData = this.props.noData;
|
|
39393
|
-
return /* @__PURE__ */
|
|
39913
|
+
return /* @__PURE__ */ React67.createElement(Message, {
|
|
39394
39914
|
type: "no-data"
|
|
39395
39915
|
}, typeof noData === "function" ? noData() : noData);
|
|
39396
39916
|
}
|
|
39397
39917
|
if (pdf === null || page === null) {
|
|
39398
39918
|
var loading = this.props.loading;
|
|
39399
|
-
return /* @__PURE__ */
|
|
39919
|
+
return /* @__PURE__ */ React67.createElement(Message, {
|
|
39400
39920
|
type: "loading"
|
|
39401
39921
|
}, typeof loading === "function" ? loading() : loading);
|
|
39402
39922
|
}
|
|
39403
39923
|
if (pdf === false || page === false) {
|
|
39404
39924
|
var error2 = this.props.error;
|
|
39405
|
-
return /* @__PURE__ */
|
|
39925
|
+
return /* @__PURE__ */ React67.createElement(Message, {
|
|
39406
39926
|
type: "error"
|
|
39407
39927
|
}, typeof error2 === "function" ? error2() : error2);
|
|
39408
39928
|
}
|
|
@@ -39413,7 +39933,7 @@ var PageInternal = /* @__PURE__ */ function(_PureComponent) {
|
|
|
39413
39933
|
value: function render() {
|
|
39414
39934
|
var pageNumber = this.pageNumber;
|
|
39415
39935
|
var _this$props3 = this.props, className = _this$props3.className, inputRef = _this$props3.inputRef;
|
|
39416
|
-
return /* @__PURE__ */
|
|
39936
|
+
return /* @__PURE__ */ React67.createElement("div", _extends({
|
|
39417
39937
|
className: mergeClassNames("react-pdf__Page", className),
|
|
39418
39938
|
"data-page-number": pageNumber,
|
|
39419
39939
|
ref: mergeRefs2(inputRef, this.ref),
|
|
@@ -39557,13 +40077,13 @@ PageInternal.propTypes = _objectSpread3(_objectSpread3({}, eventProps), {}, {
|
|
|
39557
40077
|
width: import_prop_types11.default.number
|
|
39558
40078
|
});
|
|
39559
40079
|
function Page(props, ref) {
|
|
39560
|
-
return /* @__PURE__ */
|
|
39561
|
-
return /* @__PURE__ */
|
|
40080
|
+
return /* @__PURE__ */ React67.createElement(DocumentContext_default.Consumer, null, function(context) {
|
|
40081
|
+
return /* @__PURE__ */ React67.createElement(PageInternal, _extends({
|
|
39562
40082
|
ref
|
|
39563
40083
|
}, context, props));
|
|
39564
40084
|
});
|
|
39565
40085
|
}
|
|
39566
|
-
var Page_default = /* @__PURE__ */
|
|
40086
|
+
var Page_default = /* @__PURE__ */ React67.forwardRef(Page);
|
|
39567
40087
|
|
|
39568
40088
|
// node_modules/react-pdf/dist/esm/entry.js
|
|
39569
40089
|
if (isLocalFileSystem) {
|
|
@@ -39572,10 +40092,10 @@ if (isLocalFileSystem) {
|
|
|
39572
40092
|
pdfjs4.GlobalWorkerOptions.workerSrc = "pdf.worker.js";
|
|
39573
40093
|
|
|
39574
40094
|
// src/PdfReader/index.tsx
|
|
39575
|
-
import * as
|
|
40095
|
+
import * as React71 from "react";
|
|
39576
40096
|
|
|
39577
40097
|
// src/PdfReader/useMeasure.tsx
|
|
39578
|
-
import * as
|
|
40098
|
+
import * as React68 from "react";
|
|
39579
40099
|
var DEFAULT_DIMENSION = {
|
|
39580
40100
|
x: 0,
|
|
39581
40101
|
y: 0,
|
|
@@ -39587,9 +40107,9 @@ var DEFAULT_DIMENSION = {
|
|
|
39587
40107
|
right: 0
|
|
39588
40108
|
};
|
|
39589
40109
|
function useMeasure() {
|
|
39590
|
-
const [element, ref] =
|
|
39591
|
-
const [rect, setRect] =
|
|
39592
|
-
const observer =
|
|
40110
|
+
const [element, ref] = React68.useState(null);
|
|
40111
|
+
const [rect, setRect] = React68.useState(DEFAULT_DIMENSION);
|
|
40112
|
+
const observer = React68.useMemo(() => new window.ResizeObserver((entries) => {
|
|
39593
40113
|
if (entries[0]) {
|
|
39594
40114
|
const {
|
|
39595
40115
|
x,
|
|
@@ -39604,7 +40124,7 @@ function useMeasure() {
|
|
|
39604
40124
|
setRect({ x, y, width, height, top: top2, left: left2, bottom: bottom2, right: right2 });
|
|
39605
40125
|
}
|
|
39606
40126
|
}), []);
|
|
39607
|
-
|
|
40127
|
+
React68.useLayoutEffect(() => {
|
|
39608
40128
|
if (!element)
|
|
39609
40129
|
return;
|
|
39610
40130
|
observer.observe(element);
|
|
@@ -39633,7 +40153,7 @@ var ChakraPage = chakra(Page_default, {
|
|
|
39633
40153
|
var ChakraPage_default = ChakraPage;
|
|
39634
40154
|
|
|
39635
40155
|
// src/PdfReader/ScrollPage.tsx
|
|
39636
|
-
import
|
|
40156
|
+
import React69 from "react";
|
|
39637
40157
|
|
|
39638
40158
|
// node_modules/react-intersection-observer/react-intersection-observer.m.js
|
|
39639
40159
|
import { createElement as createElement33, Component as Component3, useRef as useRef19, useState as useState18, useCallback as useCallback15, useEffect as useEffect20 } from "react";
|
|
@@ -39895,7 +40415,7 @@ function useInView(_temp) {
|
|
|
39895
40415
|
|
|
39896
40416
|
// src/PdfReader/ScrollPage.tsx
|
|
39897
40417
|
var Placeholder = ({ width, height, pageNumber }) => {
|
|
39898
|
-
return /* @__PURE__ */
|
|
40418
|
+
return /* @__PURE__ */ React69.createElement("div", {
|
|
39899
40419
|
"data-page-number": pageNumber,
|
|
39900
40420
|
style: { width, height }
|
|
39901
40421
|
});
|
|
@@ -39912,15 +40432,15 @@ var ScrollPage = ({
|
|
|
39912
40432
|
threshold: 0,
|
|
39913
40433
|
triggerOnce: true
|
|
39914
40434
|
});
|
|
39915
|
-
return /* @__PURE__ */
|
|
40435
|
+
return /* @__PURE__ */ React69.createElement("div", {
|
|
39916
40436
|
ref
|
|
39917
|
-
}, inView ? /* @__PURE__ */
|
|
40437
|
+
}, inView ? /* @__PURE__ */ React69.createElement(ChakraPage_default, {
|
|
39918
40438
|
"data-page-number": pageNumber,
|
|
39919
40439
|
pageNumber,
|
|
39920
40440
|
scale: scale2,
|
|
39921
40441
|
width,
|
|
39922
40442
|
onLoadSuccess
|
|
39923
|
-
}) : /* @__PURE__ */
|
|
40443
|
+
}) : /* @__PURE__ */ React69.createElement(Placeholder, {
|
|
39924
40444
|
width: placeholderWidth,
|
|
39925
40445
|
height: placeholderHeight,
|
|
39926
40446
|
pageNumber
|
|
@@ -39929,14 +40449,14 @@ var ScrollPage = ({
|
|
|
39929
40449
|
var ScrollPage_default = ScrollPage;
|
|
39930
40450
|
|
|
39931
40451
|
// src/ui/LoadingSkeleton.tsx
|
|
39932
|
-
import
|
|
40452
|
+
import React70 from "react";
|
|
39933
40453
|
var LoadingSkeletonContent = ({
|
|
39934
40454
|
height
|
|
39935
40455
|
}) => {
|
|
39936
40456
|
const bgColor = useColorModeValue_default("ui.white", "ui.black", "ui.sepia");
|
|
39937
|
-
return /* @__PURE__ */
|
|
40457
|
+
return /* @__PURE__ */ React70.createElement(React70.Fragment, null, /* @__PURE__ */ React70.createElement(HeaderWrapper, {
|
|
39938
40458
|
bg: bgColor
|
|
39939
|
-
}), /* @__PURE__ */
|
|
40459
|
+
}), /* @__PURE__ */ React70.createElement(Box, {
|
|
39940
40460
|
padding: "6",
|
|
39941
40461
|
bg: bgColor,
|
|
39942
40462
|
mt: "0",
|
|
@@ -39944,21 +40464,21 @@ var LoadingSkeletonContent = ({
|
|
|
39944
40464
|
"aria-label": "Loading book...",
|
|
39945
40465
|
"aria-busy": "true",
|
|
39946
40466
|
role: "progressbar"
|
|
39947
|
-
}, /* @__PURE__ */
|
|
40467
|
+
}, /* @__PURE__ */ React70.createElement(Flex, {
|
|
39948
40468
|
justifyContent: "center"
|
|
39949
|
-
}, /* @__PURE__ */
|
|
40469
|
+
}, /* @__PURE__ */ React70.createElement(Skeleton, {
|
|
39950
40470
|
height: "20px",
|
|
39951
40471
|
mb: "7",
|
|
39952
40472
|
w: "30%"
|
|
39953
|
-
})), /* @__PURE__ */
|
|
40473
|
+
})), /* @__PURE__ */ React70.createElement(SkeletonText, {
|
|
39954
40474
|
mb: "7",
|
|
39955
40475
|
noOfLines: 10,
|
|
39956
40476
|
spacing: "4"
|
|
39957
|
-
}), /* @__PURE__ */
|
|
40477
|
+
}), /* @__PURE__ */ React70.createElement(SkeletonText, {
|
|
39958
40478
|
mb: "7",
|
|
39959
40479
|
noOfLines: 5,
|
|
39960
40480
|
spacing: "4"
|
|
39961
|
-
})), /* @__PURE__ */
|
|
40481
|
+
})), /* @__PURE__ */ React70.createElement(Footer_default, {
|
|
39962
40482
|
state: null,
|
|
39963
40483
|
navigator: null,
|
|
39964
40484
|
zIndex: "tooltip"
|
|
@@ -39969,9 +40489,9 @@ function LoadingSkeleton({
|
|
|
39969
40489
|
state: state2
|
|
39970
40490
|
}) {
|
|
39971
40491
|
var _a;
|
|
39972
|
-
return /* @__PURE__ */
|
|
40492
|
+
return /* @__PURE__ */ React70.createElement(ThemeProvider3, {
|
|
39973
40493
|
theme: getTheme3((_a = state2 == null ? void 0 : state2.settings) == null ? void 0 : _a.colorMode)
|
|
39974
|
-
}, /* @__PURE__ */
|
|
40494
|
+
}, /* @__PURE__ */ React70.createElement(LoadingSkeletonContent, {
|
|
39975
40495
|
height
|
|
39976
40496
|
}));
|
|
39977
40497
|
}
|
|
@@ -40087,7 +40607,7 @@ function usePdfReader(args) {
|
|
|
40087
40607
|
height = DEFAULT_HEIGHT,
|
|
40088
40608
|
growWhenScrolling = DEFAULT_SHOULD_GROW_WHEN_SCROLLING
|
|
40089
40609
|
} = args != null ? args : {};
|
|
40090
|
-
const [state2, dispatch] =
|
|
40610
|
+
const [state2, dispatch] = React71.useReducer(pdfReducer, {
|
|
40091
40611
|
state: "INACTIVE",
|
|
40092
40612
|
resourceIndex: 0,
|
|
40093
40613
|
resource: null,
|
|
@@ -40106,7 +40626,7 @@ function usePdfReader(args) {
|
|
|
40106
40626
|
const isParsed = typeof state2.numPages === "number";
|
|
40107
40627
|
const isSinglePDF = manifest && (manifest == null ? void 0 : manifest.readingOrder.length) === 1;
|
|
40108
40628
|
const [containerRef, containerSize] = useMeasure();
|
|
40109
|
-
|
|
40629
|
+
React71.useEffect(() => {
|
|
40110
40630
|
if (!webpubManifestUrl || !manifest) {
|
|
40111
40631
|
return dispatch({ type: "ARGS_CHANGED", args: void 0 });
|
|
40112
40632
|
}
|
|
@@ -40131,7 +40651,7 @@ function usePdfReader(args) {
|
|
|
40131
40651
|
height,
|
|
40132
40652
|
growWhenScrolling
|
|
40133
40653
|
]);
|
|
40134
|
-
|
|
40654
|
+
React71.useEffect(() => {
|
|
40135
40655
|
if (!manifest)
|
|
40136
40656
|
return;
|
|
40137
40657
|
if (!manifest.readingOrder || !manifest.readingOrder.length) {
|
|
@@ -40145,7 +40665,7 @@ function usePdfReader(args) {
|
|
|
40145
40665
|
});
|
|
40146
40666
|
});
|
|
40147
40667
|
}, [state2.resourceIndex, manifest, proxyUrl]);
|
|
40148
|
-
const resizePage =
|
|
40668
|
+
const resizePage = React71.useCallback((pdfWidth, pdfHeight, containerSize2) => {
|
|
40149
40669
|
const wRatio = pdfWidth / containerSize2.width;
|
|
40150
40670
|
const hRatio = pdfHeight / containerSize2.height;
|
|
40151
40671
|
const fitHorizontal = wRatio > hRatio;
|
|
@@ -40153,10 +40673,10 @@ function usePdfReader(args) {
|
|
|
40153
40673
|
const height2 = !fitHorizontal ? Math.round(containerSize2.height) : void 0;
|
|
40154
40674
|
dispatch({ type: "RESIZE_PAGE", width, height: height2 });
|
|
40155
40675
|
}, []);
|
|
40156
|
-
|
|
40676
|
+
React71.useEffect(() => {
|
|
40157
40677
|
resizePage(state2.pdfWidth, state2.pdfHeight, containerSize);
|
|
40158
40678
|
}, [containerSize, state2.pdfWidth, state2.pdfHeight, resizePage]);
|
|
40159
|
-
|
|
40679
|
+
React71.useEffect(() => {
|
|
40160
40680
|
var _a2;
|
|
40161
40681
|
if (!manifest || state2.state !== "ACTIVE")
|
|
40162
40682
|
return;
|
|
@@ -40186,7 +40706,7 @@ function usePdfReader(args) {
|
|
|
40186
40706
|
state2.resourceIndex,
|
|
40187
40707
|
isSinglePDF
|
|
40188
40708
|
]);
|
|
40189
|
-
const goForward =
|
|
40709
|
+
const goForward = React71.useCallback(() => __async(this, null, function* () {
|
|
40190
40710
|
var _a2;
|
|
40191
40711
|
if (!state2.numPages)
|
|
40192
40712
|
return;
|
|
@@ -40220,7 +40740,7 @@ function usePdfReader(args) {
|
|
|
40220
40740
|
state2.pageNumber,
|
|
40221
40741
|
state2.resourceIndex
|
|
40222
40742
|
]);
|
|
40223
|
-
const goBackward =
|
|
40743
|
+
const goBackward = React71.useCallback(() => __async(this, null, function* () {
|
|
40224
40744
|
if (!isParsed)
|
|
40225
40745
|
return;
|
|
40226
40746
|
if (state2.state !== "ACTIVE")
|
|
@@ -40247,23 +40767,23 @@ function usePdfReader(args) {
|
|
|
40247
40767
|
state2.pageNumber,
|
|
40248
40768
|
state2.resourceIndex
|
|
40249
40769
|
]);
|
|
40250
|
-
const setScroll =
|
|
40770
|
+
const setScroll = React71.useCallback((val) => __async(this, null, function* () {
|
|
40251
40771
|
const isScrolling = val === "scrolling";
|
|
40252
40772
|
dispatch({ type: "SET_SCROLL", isScrolling });
|
|
40253
40773
|
}), []);
|
|
40254
|
-
const zoomIn =
|
|
40774
|
+
const zoomIn = React71.useCallback(() => __async(this, null, function* () {
|
|
40255
40775
|
dispatch({
|
|
40256
40776
|
type: "SET_SCALE",
|
|
40257
40777
|
scale: state2.scale + SCALE_STEP
|
|
40258
40778
|
});
|
|
40259
40779
|
}), [state2.scale]);
|
|
40260
|
-
const zoomOut =
|
|
40780
|
+
const zoomOut = React71.useCallback(() => __async(this, null, function* () {
|
|
40261
40781
|
dispatch({
|
|
40262
40782
|
type: "SET_SCALE",
|
|
40263
40783
|
scale: state2.scale - SCALE_STEP
|
|
40264
40784
|
});
|
|
40265
40785
|
}), [state2.scale]);
|
|
40266
|
-
const goToPage =
|
|
40786
|
+
const goToPage = React71.useCallback((href) => __async(this, null, function* () {
|
|
40267
40787
|
const getIndexFromHref = (href2) => {
|
|
40268
40788
|
var _a2;
|
|
40269
40789
|
const index = (_a2 = manifest == null ? void 0 : manifest.readingOrder) == null ? void 0 : _a2.findIndex((link2) => {
|
|
@@ -40294,7 +40814,7 @@ function usePdfReader(args) {
|
|
|
40294
40814
|
return {
|
|
40295
40815
|
type: null,
|
|
40296
40816
|
isLoading: true,
|
|
40297
|
-
content: /* @__PURE__ */
|
|
40817
|
+
content: /* @__PURE__ */ React71.createElement(LoadingSkeleton, {
|
|
40298
40818
|
height,
|
|
40299
40819
|
state: state2
|
|
40300
40820
|
}),
|
|
@@ -40326,7 +40846,7 @@ function usePdfReader(args) {
|
|
|
40326
40846
|
return {
|
|
40327
40847
|
type: "PDF",
|
|
40328
40848
|
isLoading: false,
|
|
40329
|
-
content: /* @__PURE__ */
|
|
40849
|
+
content: /* @__PURE__ */ React71.createElement(Flex, {
|
|
40330
40850
|
as: "main",
|
|
40331
40851
|
zIndex: "base",
|
|
40332
40852
|
flex: "1 0 auto",
|
|
@@ -40336,16 +40856,16 @@ function usePdfReader(args) {
|
|
|
40336
40856
|
id: IFRAME_WRAPPER_ID,
|
|
40337
40857
|
ref: containerRef,
|
|
40338
40858
|
height: finalHeight
|
|
40339
|
-
}, /* @__PURE__ */
|
|
40859
|
+
}, /* @__PURE__ */ React71.createElement("style", null, `
|
|
40340
40860
|
.react-pdf__Document {
|
|
40341
40861
|
height: calc(100vh - ${HEADER_HEIGHT + FOOTER_HEIGHT}px);
|
|
40342
40862
|
overflow-x: hidden;
|
|
40343
40863
|
overflow-y: auto;
|
|
40344
40864
|
}
|
|
40345
|
-
`), /* @__PURE__ */
|
|
40865
|
+
`), /* @__PURE__ */ React71.createElement(Document, {
|
|
40346
40866
|
file: state2.resource,
|
|
40347
40867
|
onLoadSuccess: onDocumentLoadSuccess
|
|
40348
|
-
}, isParsed && state2.numPages && /* @__PURE__ */
|
|
40868
|
+
}, isParsed && state2.numPages && /* @__PURE__ */ React71.createElement(React71.Fragment, null, state2.settings.isScrolling && Array.from(new Array(state2.numPages), (_, index) => /* @__PURE__ */ React71.createElement(ScrollPage_default, {
|
|
40349
40869
|
key: `page_${index + 1}`,
|
|
40350
40870
|
width: containerSize.width,
|
|
40351
40871
|
placeholderHeight: state2.pdfHeight,
|
|
@@ -40353,13 +40873,13 @@ function usePdfReader(args) {
|
|
|
40353
40873
|
scale: state2.scale,
|
|
40354
40874
|
pageNumber: index + 1,
|
|
40355
40875
|
onLoadSuccess: onRenderSuccess
|
|
40356
|
-
})), !state2.settings.isScrolling && /* @__PURE__ */
|
|
40876
|
+
})), !state2.settings.isScrolling && /* @__PURE__ */ React71.createElement(ChakraPage_default, {
|
|
40357
40877
|
pageNumber: state2.pageNumber,
|
|
40358
40878
|
onLoadSuccess: onRenderSuccess,
|
|
40359
40879
|
width: state2.pageWidth,
|
|
40360
40880
|
height: state2.pageHeight,
|
|
40361
40881
|
scale: state2.scale,
|
|
40362
|
-
loading: /* @__PURE__ */
|
|
40882
|
+
loading: /* @__PURE__ */ React71.createElement(React71.Fragment, null)
|
|
40363
40883
|
})))),
|
|
40364
40884
|
state: state2,
|
|
40365
40885
|
manifest,
|
|
@@ -40379,7 +40899,7 @@ function handleInvalidTransition(state2, action) {
|
|
|
40379
40899
|
}
|
|
40380
40900
|
|
|
40381
40901
|
// src/HtmlReader/index.tsx
|
|
40382
|
-
import
|
|
40902
|
+
import React79 from "react";
|
|
40383
40903
|
|
|
40384
40904
|
// src/HtmlReader/lib.ts
|
|
40385
40905
|
var FONT_SIZE_STEP = 4;
|
|
@@ -40558,7 +41078,7 @@ var familyToReadiumFamily = {
|
|
|
40558
41078
|
};
|
|
40559
41079
|
|
|
40560
41080
|
// src/utils/localstorage.ts
|
|
40561
|
-
import
|
|
41081
|
+
import React72 from "react";
|
|
40562
41082
|
function getLocalStorageLocation(identifier2, args) {
|
|
40563
41083
|
if (!(args == null ? void 0 : args.persistLastLocation))
|
|
40564
41084
|
return void 0;
|
|
@@ -40581,7 +41101,7 @@ function getLocalStorageSettings(args) {
|
|
|
40581
41101
|
return void 0;
|
|
40582
41102
|
}
|
|
40583
41103
|
function useUpdateLocalStorage(identifier2, state2, args) {
|
|
40584
|
-
|
|
41104
|
+
React72.useEffect(() => {
|
|
40585
41105
|
if (!identifier2 || !(args == null ? void 0 : args.persistLastLocation))
|
|
40586
41106
|
return;
|
|
40587
41107
|
if (state2.location) {
|
|
@@ -40602,7 +41122,7 @@ function useUpdateLocalStorage(identifier2, state2, args) {
|
|
|
40602
41122
|
}
|
|
40603
41123
|
}
|
|
40604
41124
|
}, [state2.location, identifier2, args == null ? void 0 : args.persistLastLocation]);
|
|
40605
|
-
|
|
41125
|
+
React72.useEffect(() => {
|
|
40606
41126
|
if (!identifier2 || !state2.settings || !(args == null ? void 0 : args.persistSettings))
|
|
40607
41127
|
return;
|
|
40608
41128
|
const settings = {
|
|
@@ -40621,10 +41141,10 @@ function clearWebReaderLocalStorage() {
|
|
|
40621
41141
|
}
|
|
40622
41142
|
|
|
40623
41143
|
// src/HtmlReader/useLocationQuery.ts
|
|
40624
|
-
import
|
|
41144
|
+
import React73 from "react";
|
|
40625
41145
|
var LOCATION_QUERY_TITLE = "location";
|
|
40626
41146
|
function useLocationQuery(state2) {
|
|
40627
|
-
|
|
41147
|
+
React73.useEffect(() => {
|
|
40628
41148
|
if (state2.state === "READY")
|
|
40629
41149
|
updateQuery(state2.location);
|
|
40630
41150
|
}, [state2.location, state2.state]);
|
|
@@ -40959,6 +41479,13 @@ function makeHtmlReducer(args) {
|
|
|
40959
41479
|
})
|
|
40960
41480
|
});
|
|
40961
41481
|
}
|
|
41482
|
+
case "RESET_SETTINGS":
|
|
41483
|
+
if (state2.state === "INACTIVE") {
|
|
41484
|
+
return handleInvalidTransition2(state2, action);
|
|
41485
|
+
}
|
|
41486
|
+
return __spreadProps(__spreadValues({}, state2), {
|
|
41487
|
+
settings: DEFAULT_SETTINGS
|
|
41488
|
+
});
|
|
40962
41489
|
case "SET_FONT_FAMILY":
|
|
40963
41490
|
if (state2.state === "INACTIVE") {
|
|
40964
41491
|
return handleInvalidTransition2(state2, action);
|
|
@@ -41092,11 +41619,11 @@ function extractContentContainerSize(container3) {
|
|
|
41092
41619
|
}
|
|
41093
41620
|
|
|
41094
41621
|
// src/HtmlReader/useResource.tsx
|
|
41095
|
-
import
|
|
41622
|
+
import React74 from "react";
|
|
41096
41623
|
function useResource(manifest, state2, getContent, injectables, dispatch) {
|
|
41097
41624
|
var _a, _b;
|
|
41098
41625
|
const currentResourceUrl = (_b = (_a = state2.location) == null ? void 0 : _a.href) != null ? _b : null;
|
|
41099
|
-
|
|
41626
|
+
React74.useEffect(() => {
|
|
41100
41627
|
if (!currentResourceUrl) {
|
|
41101
41628
|
return;
|
|
41102
41629
|
}
|
|
@@ -41169,9 +41696,9 @@ function injectJS(body) {
|
|
|
41169
41696
|
|
|
41170
41697
|
// src/HtmlReader/useWindowResize.ts
|
|
41171
41698
|
var import_debounce2 = __toESM(require_debounce());
|
|
41172
|
-
import
|
|
41699
|
+
import React75 from "react";
|
|
41173
41700
|
function useWindowResize(manifest, state2, dispatch) {
|
|
41174
|
-
|
|
41701
|
+
React75.useEffect(() => {
|
|
41175
41702
|
if (state2.state !== "NAVIGATING" && state2.state !== "READY")
|
|
41176
41703
|
return;
|
|
41177
41704
|
function handleResize() {
|
|
@@ -41192,11 +41719,11 @@ function useWindowResize(manifest, state2, dispatch) {
|
|
|
41192
41719
|
}
|
|
41193
41720
|
|
|
41194
41721
|
// src/HtmlReader/useUpdateScroll.ts
|
|
41195
|
-
import * as
|
|
41722
|
+
import * as React76 from "react";
|
|
41196
41723
|
var SCROLL_STOP_DEBOUNCE = 100;
|
|
41197
41724
|
function useUpdateScroll(state2, dispatch) {
|
|
41198
|
-
const timeout =
|
|
41199
|
-
|
|
41725
|
+
const timeout = React76.useRef();
|
|
41726
|
+
React76.useLayoutEffect(() => {
|
|
41200
41727
|
if (state2.state !== "READY")
|
|
41201
41728
|
return;
|
|
41202
41729
|
const iframeDocument = state2.iframe.contentDocument;
|
|
@@ -41215,9 +41742,9 @@ function useUpdateScroll(state2, dispatch) {
|
|
|
41215
41742
|
}
|
|
41216
41743
|
|
|
41217
41744
|
// src/HtmlReader/useUpdateCSS.ts
|
|
41218
|
-
import
|
|
41745
|
+
import React77 from "react";
|
|
41219
41746
|
function useUpdateCSS(state2, manifest) {
|
|
41220
|
-
|
|
41747
|
+
React77.useEffect(() => {
|
|
41221
41748
|
if (!manifest)
|
|
41222
41749
|
return;
|
|
41223
41750
|
if (state2.state !== "NAVIGATING" && state2.state !== "READY")
|
|
@@ -41230,9 +41757,9 @@ function useUpdateCSS(state2, manifest) {
|
|
|
41230
41757
|
}
|
|
41231
41758
|
|
|
41232
41759
|
// src/HtmlReader/useIframeLinkClick.ts
|
|
41233
|
-
import
|
|
41760
|
+
import React78 from "react";
|
|
41234
41761
|
function useIframeLinkClick(baseUrl, manifest, dispatch) {
|
|
41235
|
-
|
|
41762
|
+
React78.useEffect(() => {
|
|
41236
41763
|
if (!baseUrl || !manifest)
|
|
41237
41764
|
return;
|
|
41238
41765
|
const messageHandler = ({ data }) => {
|
|
@@ -41274,7 +41801,7 @@ function useHtmlReader(args) {
|
|
|
41274
41801
|
persistLastLocation = true,
|
|
41275
41802
|
persistSettings = true
|
|
41276
41803
|
} = args != null ? args : {};
|
|
41277
|
-
const [state2, dispatch] =
|
|
41804
|
+
const [state2, dispatch] = React79.useReducer(makeHtmlReducer(args), inactiveState);
|
|
41278
41805
|
const currentResourceUrl = (_b = (_a = state2.location) == null ? void 0 : _a.href) != null ? _b : null;
|
|
41279
41806
|
const injectables = ((_d = (_c = manifest == null ? void 0 : manifest.metadata) == null ? void 0 : _c.presentation) == null ? void 0 : _d.layout) === "fixed" ? injectablesFixed : injectablesReflowable;
|
|
41280
41807
|
useResource(manifest, state2, getContent, injectables, dispatch);
|
|
@@ -41285,7 +41812,7 @@ function useHtmlReader(args) {
|
|
|
41285
41812
|
useWindowResize(manifest, state2, dispatch);
|
|
41286
41813
|
useUpdateCSS(state2, manifest);
|
|
41287
41814
|
useIframeLinkClick(webpubManifestUrl, manifest, dispatch);
|
|
41288
|
-
|
|
41815
|
+
React79.useEffect(() => {
|
|
41289
41816
|
if (!webpubManifestUrl || !manifest) {
|
|
41290
41817
|
return dispatch({ type: "ARGS_CHANGED", args: void 0 });
|
|
41291
41818
|
}
|
|
@@ -41314,7 +41841,7 @@ function useHtmlReader(args) {
|
|
|
41314
41841
|
persistLastLocation,
|
|
41315
41842
|
persistSettings
|
|
41316
41843
|
]);
|
|
41317
|
-
|
|
41844
|
+
React79.useEffect(() => {
|
|
41318
41845
|
process.nextTick(() => {
|
|
41319
41846
|
if (state2.state === "NAVIGATING") {
|
|
41320
41847
|
const { fragment, progression, position: position3 } = state2.location.locations;
|
|
@@ -41336,7 +41863,7 @@ function useHtmlReader(args) {
|
|
|
41336
41863
|
(_g = state2.settings) == null ? void 0 : _g.isScrolling,
|
|
41337
41864
|
(_h = state2.location) == null ? void 0 : _h.locations
|
|
41338
41865
|
]);
|
|
41339
|
-
const navigator2 =
|
|
41866
|
+
const navigator2 = React79.useRef({
|
|
41340
41867
|
goToPage(href) {
|
|
41341
41868
|
dispatch({ type: "GO_TO_HREF", href });
|
|
41342
41869
|
},
|
|
@@ -41371,13 +41898,18 @@ function useHtmlReader(args) {
|
|
|
41371
41898
|
dispatch({ type: "DECREASE_FONT_SIZE" });
|
|
41372
41899
|
});
|
|
41373
41900
|
},
|
|
41901
|
+
resetSettings() {
|
|
41902
|
+
return __async(this, null, function* () {
|
|
41903
|
+
dispatch({ type: "RESET_SETTINGS" });
|
|
41904
|
+
});
|
|
41905
|
+
},
|
|
41374
41906
|
setFontFamily(family) {
|
|
41375
41907
|
return __async(this, null, function* () {
|
|
41376
41908
|
dispatch({ type: "SET_FONT_FAMILY", family });
|
|
41377
41909
|
});
|
|
41378
41910
|
}
|
|
41379
41911
|
}).current;
|
|
41380
|
-
const setIframe =
|
|
41912
|
+
const setIframe = React79.useRef((el) => {
|
|
41381
41913
|
dispatch({ type: "SET_IFRAME", iframe: el });
|
|
41382
41914
|
}).current;
|
|
41383
41915
|
if (!webpubManifestUrl || !manifest)
|
|
@@ -41386,7 +41918,7 @@ function useHtmlReader(args) {
|
|
|
41386
41918
|
return {
|
|
41387
41919
|
type: null,
|
|
41388
41920
|
isLoading: true,
|
|
41389
|
-
content: /* @__PURE__ */
|
|
41921
|
+
content: /* @__PURE__ */ React79.createElement(LoadingSkeleton, {
|
|
41390
41922
|
height,
|
|
41391
41923
|
state: state2
|
|
41392
41924
|
}),
|
|
@@ -41410,7 +41942,7 @@ function useHtmlReader(args) {
|
|
|
41410
41942
|
return {
|
|
41411
41943
|
type: "HTML",
|
|
41412
41944
|
isLoading: false,
|
|
41413
|
-
content: /* @__PURE__ */
|
|
41945
|
+
content: /* @__PURE__ */ React79.createElement(React79.Fragment, null, /* @__PURE__ */ React79.createElement("iframe", {
|
|
41414
41946
|
id: IFRAME_ID_SELECTOR,
|
|
41415
41947
|
onLoad: () => dispatch({ type: "IFRAME_LOADED" }),
|
|
41416
41948
|
ref: setIframe,
|
|
@@ -41462,8 +41994,8 @@ function useWebReader(args) {
|
|
|
41462
41994
|
persistLastLocation = true,
|
|
41463
41995
|
persistSettings = true
|
|
41464
41996
|
} = args;
|
|
41465
|
-
const [manifest, setManifest] =
|
|
41466
|
-
const [error2, setError] =
|
|
41997
|
+
const [manifest, setManifest] = React80.useState(null);
|
|
41998
|
+
const [error2, setError] = React80.useState(null);
|
|
41467
41999
|
if (error2) {
|
|
41468
42000
|
throw error2;
|
|
41469
42001
|
}
|
|
@@ -41489,13 +42021,13 @@ function useWebReader(args) {
|
|
|
41489
42021
|
persistLastLocation,
|
|
41490
42022
|
persistSettings
|
|
41491
42023
|
} : void 0);
|
|
41492
|
-
|
|
42024
|
+
React80.useEffect(() => {
|
|
41493
42025
|
fetchJson(webpubManifestUrl).then(setManifest).catch(setError);
|
|
41494
42026
|
}, [webpubManifestUrl]);
|
|
41495
42027
|
if (manifest === null) {
|
|
41496
42028
|
return {
|
|
41497
42029
|
isLoading: true,
|
|
41498
|
-
content: /* @__PURE__ */
|
|
42030
|
+
content: /* @__PURE__ */ React80.createElement(LoadingSkeleton, {
|
|
41499
42031
|
height,
|
|
41500
42032
|
state: htmlReader == null ? void 0 : htmlReader.state
|
|
41501
42033
|
}),
|
|
@@ -41514,27 +42046,6 @@ function useWebReader(args) {
|
|
|
41514
42046
|
throw new Error(`No reader was initialized for the webpub with url: ${webpubManifestUrl} and type: ${readerType}.`);
|
|
41515
42047
|
}
|
|
41516
42048
|
|
|
41517
|
-
// src/ServiceWorker/client.ts
|
|
41518
|
-
import React67 from "react";
|
|
41519
|
-
|
|
41520
|
-
// src/ServiceWorker/constants.ts
|
|
41521
|
-
var PRECACHE_PUBLICATIONS = "PRECACHE_PUBLICATIONS";
|
|
41522
|
-
var CACHE_EXPIRATION_SECONDS = 7 * 24 * 60 * 60;
|
|
41523
|
-
|
|
41524
|
-
// src/ServiceWorker/client.ts
|
|
41525
|
-
function usePublicationSW(publications) {
|
|
41526
|
-
React67.useEffect(() => {
|
|
41527
|
-
var _a;
|
|
41528
|
-
if ("serviceWorker" in navigator) {
|
|
41529
|
-
const message = {
|
|
41530
|
-
type: PRECACHE_PUBLICATIONS,
|
|
41531
|
-
publications
|
|
41532
|
-
};
|
|
41533
|
-
(_a = navigator.serviceWorker.controller) == null ? void 0 : _a.postMessage(message);
|
|
41534
|
-
}
|
|
41535
|
-
}, [publications]);
|
|
41536
|
-
}
|
|
41537
|
-
|
|
41538
42049
|
// src/index.tsx
|
|
41539
42050
|
var WebReaderWithoutBoundary = (_a) => {
|
|
41540
42051
|
var _b = _a, {
|
|
@@ -41554,12 +42065,12 @@ var WebReaderWithoutBoundary = (_a) => {
|
|
|
41554
42065
|
getContent
|
|
41555
42066
|
}, props));
|
|
41556
42067
|
const { content } = webReader;
|
|
41557
|
-
return /* @__PURE__ */
|
|
42068
|
+
return /* @__PURE__ */ React81.createElement(manager_default, __spreadValues({
|
|
41558
42069
|
headerLeft
|
|
41559
42070
|
}, webReader), content);
|
|
41560
42071
|
};
|
|
41561
42072
|
var WebReader = (props) => {
|
|
41562
|
-
return /* @__PURE__ */
|
|
42073
|
+
return /* @__PURE__ */ React81.createElement(ErrorBoundary_default, __spreadValues({}, props), /* @__PURE__ */ React81.createElement(WebReaderWithoutBoundary, __spreadValues({}, props)));
|
|
41563
42074
|
};
|
|
41564
42075
|
var src_default = WebReader;
|
|
41565
42076
|
export {
|
|
@@ -41567,6 +42078,7 @@ export {
|
|
|
41567
42078
|
DEFAULT_HEIGHT,
|
|
41568
42079
|
DEFAULT_SETTINGS,
|
|
41569
42080
|
DEFAULT_SHOULD_GROW_WHEN_SCROLLING,
|
|
42081
|
+
FONT_DETAILS,
|
|
41570
42082
|
FOOTER_HEIGHT,
|
|
41571
42083
|
HEADER_HEIGHT,
|
|
41572
42084
|
IS_DEV,
|
|
@@ -41580,7 +42092,6 @@ export {
|
|
|
41580
42092
|
useColorModeValue_default as useColorModeValue,
|
|
41581
42093
|
useHtmlReader,
|
|
41582
42094
|
usePdfReader,
|
|
41583
|
-
usePublicationSW,
|
|
41584
42095
|
useWebReader
|
|
41585
42096
|
};
|
|
41586
42097
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|