@nypl/web-reader 4.1.0 → 4.2.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 +1 -1
- package/dist/cjs/index.js +13 -48
- package/dist/cjs/index.js.map +2 -2
- package/dist/esm/index.js +54 -70
- package/dist/esm/index.js.map +2 -2
- package/dist/types/ui/theme/components/button.d.ts +6 -0
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -34516,8 +34516,8 @@ var FONT_DETAILS = {
|
|
|
34516
34516
|
},
|
|
34517
34517
|
"sans-serif": {
|
|
34518
34518
|
heading: "Sans-serif font",
|
|
34519
|
-
body: "
|
|
34520
|
-
token: "
|
|
34519
|
+
body: "Roboto",
|
|
34520
|
+
token: "body",
|
|
34521
34521
|
fontWeight: "regular"
|
|
34522
34522
|
},
|
|
34523
34523
|
"open-dyslexic": {
|
|
@@ -34866,18 +34866,6 @@ import React42 from "react";
|
|
|
34866
34866
|
var Fonts = () => /* @__PURE__ */ React42.createElement(Global, {
|
|
34867
34867
|
styles: `
|
|
34868
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
34869
|
@font-face {
|
|
34882
34870
|
font-family: 'OpenDyslexic';
|
|
34883
34871
|
font-style: normal;
|
|
@@ -34887,29 +34875,6 @@ var Fonts = () => /* @__PURE__ */ React42.createElement(Global, {
|
|
|
34887
34875
|
url('/fonts/opendyslexic/opendyslexic-regular-webfont.woff')
|
|
34888
34876
|
format('woff');
|
|
34889
34877
|
}
|
|
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
34878
|
`
|
|
34914
34879
|
});
|
|
34915
34880
|
var fonts_default = Fonts;
|
|
@@ -34984,7 +34949,6 @@ var typography3 = {
|
|
|
34984
34949
|
body: "Roboto, -apple-system, BlinkMacSystemFont, system-ui, sans-serif",
|
|
34985
34950
|
heading: "Roboto, -apple-system, BlinkMacSystemFont, system-ui, sans-serif",
|
|
34986
34951
|
serif: `'Georgia', serif`,
|
|
34987
|
-
sansSerif: `'Helvetica', 'Arial', serif`,
|
|
34988
34952
|
opendyslexic: `'OpenDyslexic', sans-serif`
|
|
34989
34953
|
}
|
|
34990
34954
|
};
|
|
@@ -35574,7 +35538,12 @@ var variantSolid6 = (getColor4) => (props) => {
|
|
|
35574
35538
|
const bgColor = getColor4("ui.gray.light-warm", "ui.black", "ui.sepia");
|
|
35575
35539
|
const bgColorActive = getColor4("ui.gray.active", "ui.gray.x-dark", "ui.sepiaChecked");
|
|
35576
35540
|
const color3 = getColor4("gray.800", "ui.white", "gray.800");
|
|
35577
|
-
const _focus = {
|
|
35541
|
+
const _focus = {
|
|
35542
|
+
bgColor: bgColorActive,
|
|
35543
|
+
color: color3,
|
|
35544
|
+
ring: "2px",
|
|
35545
|
+
ringInset: "inset"
|
|
35546
|
+
};
|
|
35578
35547
|
const _hover = {
|
|
35579
35548
|
bgColor: bgColorActive,
|
|
35580
35549
|
color: color3,
|
|
@@ -35586,7 +35555,7 @@ var variantSolid6 = (getColor4) => (props) => {
|
|
|
35586
35555
|
return {
|
|
35587
35556
|
border: "none",
|
|
35588
35557
|
borderColor: "gray.100",
|
|
35589
|
-
height: "
|
|
35558
|
+
height: "45px",
|
|
35590
35559
|
transition: "none",
|
|
35591
35560
|
fontSize: 0,
|
|
35592
35561
|
letterSpacing: 1,
|
|
@@ -35613,6 +35582,9 @@ var variantSettings = (getColor4) => (props) => {
|
|
|
35613
35582
|
width: [8, 16, 36],
|
|
35614
35583
|
fontSize: [0, 0, 2],
|
|
35615
35584
|
whiteSpace: ["normal", "normal", "nowrap"],
|
|
35585
|
+
p: {
|
|
35586
|
+
textAlign: "center"
|
|
35587
|
+
},
|
|
35616
35588
|
_active: {
|
|
35617
35589
|
bgColor
|
|
35618
35590
|
},
|
|
@@ -35621,7 +35593,8 @@ var variantSettings = (getColor4) => (props) => {
|
|
|
35621
35593
|
bgColor: checkedBgColor,
|
|
35622
35594
|
borderBottomColor: checkedBgColor,
|
|
35623
35595
|
p: {
|
|
35624
|
-
textDecoration: "underline"
|
|
35596
|
+
textDecoration: "underline",
|
|
35597
|
+
textUnderlinePosition: "under"
|
|
35625
35598
|
}
|
|
35626
35599
|
},
|
|
35627
35600
|
_hover: {
|
|
@@ -35679,7 +35652,7 @@ function ToggleButton(props) {
|
|
|
35679
35652
|
}
|
|
35680
35653
|
var FontToggleButton = (props) => {
|
|
35681
35654
|
return /* @__PURE__ */ React43.createElement(ToggleButton, __spreadValues({
|
|
35682
|
-
fontSize: [-1, -1, 0],
|
|
35655
|
+
fontSize: [-2, -2, -1, -1, 0],
|
|
35683
35656
|
py: 6
|
|
35684
35657
|
}, props));
|
|
35685
35658
|
};
|
|
@@ -35694,7 +35667,8 @@ var ColorModeToggleButton = (_a) => {
|
|
|
35694
35667
|
_checked: {
|
|
35695
35668
|
bgColor,
|
|
35696
35669
|
p: {
|
|
35697
|
-
textDecoration: "underline"
|
|
35670
|
+
textDecoration: "underline",
|
|
35671
|
+
textUnderlinePosition: "under"
|
|
35698
35672
|
}
|
|
35699
35673
|
}
|
|
35700
35674
|
}
|
|
@@ -35907,28 +35881,31 @@ function HtmlSettings(props) {
|
|
|
35907
35881
|
}), /* @__PURE__ */ React48.createElement(FontToggleButton, {
|
|
35908
35882
|
value: "sans-serif",
|
|
35909
35883
|
label: "Sans-Serif",
|
|
35910
|
-
fontFamily: "
|
|
35884
|
+
fontFamily: "body",
|
|
35911
35885
|
fontWeight: "regular"
|
|
35912
35886
|
}), /* @__PURE__ */ React48.createElement(FontToggleButton, {
|
|
35913
35887
|
value: "open-dyslexic",
|
|
35914
35888
|
label: "Dyslexia",
|
|
35915
35889
|
fontFamily: "opendyslexic",
|
|
35916
35890
|
fontWeight: "regular"
|
|
35917
|
-
})), /* @__PURE__ */ React48.createElement(
|
|
35891
|
+
})), /* @__PURE__ */ React48.createElement(Box, {
|
|
35918
35892
|
bgColor: checkedButtonBgColor,
|
|
35919
|
-
|
|
35920
|
-
|
|
35893
|
+
display: "flex",
|
|
35894
|
+
flexDirection: "column",
|
|
35895
|
+
px: [3, 3, 7],
|
|
35896
|
+
py: [4, 4, 5]
|
|
35921
35897
|
}, /* @__PURE__ */ React48.createElement(Heading, {
|
|
35922
35898
|
as: "h3",
|
|
35923
35899
|
color: buttonTextColor,
|
|
35924
|
-
pb:
|
|
35900
|
+
pb: [1.5, 1.5, 2.5],
|
|
35925
35901
|
fontSize: 2,
|
|
35926
35902
|
fontWeight: "light"
|
|
35927
35903
|
}, FONT_DETAILS[fontFamily].heading), /* @__PURE__ */ React48.createElement(Text, {
|
|
35928
35904
|
color: buttonTextColor,
|
|
35929
35905
|
fontFamily: FONT_DETAILS[fontFamily].token,
|
|
35930
35906
|
fontSize: -1,
|
|
35931
|
-
fontWeight: FONT_DETAILS[fontFamily].fontWeight
|
|
35907
|
+
fontWeight: FONT_DETAILS[fontFamily].fontWeight,
|
|
35908
|
+
margin: 0
|
|
35932
35909
|
}, FONT_DETAILS[fontFamily].body)), /* @__PURE__ */ React48.createElement(ToggleGroup_default, {
|
|
35933
35910
|
value: colorMode,
|
|
35934
35911
|
label: "reading theme options",
|
|
@@ -36038,31 +36015,35 @@ function SettingsCard(props) {
|
|
|
36038
36015
|
const paginationValue = ((_b = (_a = props.state) == null ? void 0 : _a.settings) == null ? void 0 : _b.isScrolling) ? "scrolling" : "paginated";
|
|
36039
36016
|
return /* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement(Popover, {
|
|
36040
36017
|
gutter: 0,
|
|
36018
|
+
closeOnBlur: true,
|
|
36041
36019
|
placement: "bottom-start",
|
|
36042
36020
|
isOpen,
|
|
36043
|
-
onOpen: open,
|
|
36044
36021
|
onClose: close,
|
|
36022
|
+
onOpen: open,
|
|
36045
36023
|
autoFocus: true,
|
|
36046
36024
|
preventOverflow: true,
|
|
36047
36025
|
strategy: "fixed"
|
|
36048
36026
|
}, /* @__PURE__ */ React49.createElement(PopoverTrigger, null, /* @__PURE__ */ React49.createElement(Button_default, {
|
|
36027
|
+
"aria-label": "Settings",
|
|
36049
36028
|
onClick: open,
|
|
36029
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
36050
36030
|
border: "none",
|
|
36051
|
-
|
|
36052
|
-
|
|
36053
|
-
|
|
36054
|
-
|
|
36055
|
-
|
|
36056
|
-
|
|
36057
|
-
|
|
36058
|
-
}, /* @__PURE__ */ React49.createElement(Text, {
|
|
36031
|
+
gap: [0, 0, 2]
|
|
36032
|
+
}, /* @__PURE__ */ React49.createElement(Icon, {
|
|
36033
|
+
as: ReaderSettings_default,
|
|
36034
|
+
fill: iconFill,
|
|
36035
|
+
w: 6,
|
|
36036
|
+
h: 6
|
|
36037
|
+
}), /* @__PURE__ */ React49.createElement(Text, {
|
|
36059
36038
|
variant: "headerNav"
|
|
36060
36039
|
}, "Settings"))), /* @__PURE__ */ React49.createElement(PopoverContent, {
|
|
36061
36040
|
overflow: "hidden",
|
|
36062
36041
|
bgColor: contentBgColor,
|
|
36063
|
-
|
|
36064
|
-
|
|
36065
|
-
|
|
36042
|
+
borderColor: "ui.gray.disabled",
|
|
36043
|
+
borderRadius: "0 0 2px 2px",
|
|
36044
|
+
filter: "drop-shadow(0 1px 2px #00000040)",
|
|
36045
|
+
width: ["90vw", "90vw", "inherit"],
|
|
36046
|
+
marginRight: [4, 4, 4, 0],
|
|
36066
36047
|
maxWidth: "100vw"
|
|
36067
36048
|
}, /* @__PURE__ */ React49.createElement(PopoverBody, {
|
|
36068
36049
|
p: 0
|
|
@@ -36941,7 +36922,7 @@ function Header(props) {
|
|
|
36941
36922
|
bg: mainBgColor
|
|
36942
36923
|
}, headerLeft != null ? headerLeft : /* @__PURE__ */ React53.createElement(DefaultHeaderLeft, null), /* @__PURE__ */ React53.createElement(HStack, {
|
|
36943
36924
|
ml: "auto",
|
|
36944
|
-
spacing:
|
|
36925
|
+
spacing: 0
|
|
36945
36926
|
}, /* @__PURE__ */ React53.createElement(TableOfContent, {
|
|
36946
36927
|
containerRef,
|
|
36947
36928
|
navigator: navigator2,
|
|
@@ -36950,14 +36931,17 @@ function Header(props) {
|
|
|
36950
36931
|
"aria-expanded": isFullscreen,
|
|
36951
36932
|
"aria-label": "Toggle full screen",
|
|
36952
36933
|
border: "none",
|
|
36934
|
+
bgColor: mainBgColor,
|
|
36935
|
+
gap: [0, 0, 2],
|
|
36953
36936
|
onClick: toggleFullScreen2,
|
|
36954
|
-
|
|
36955
|
-
|
|
36956
|
-
|
|
36957
|
-
|
|
36958
|
-
|
|
36959
|
-
|
|
36960
|
-
|
|
36937
|
+
_active: { bgColor: mainBgColor },
|
|
36938
|
+
_focus: { bgColor: mainBgColor, ring: "2px", ringInset: "inset" }
|
|
36939
|
+
}, /* @__PURE__ */ React53.createElement(Icon, {
|
|
36940
|
+
as: isFullscreen ? ToggleFullScreenExit_default : ToggleFullScreen_default,
|
|
36941
|
+
fill: iconFill,
|
|
36942
|
+
w: 6,
|
|
36943
|
+
h: 6
|
|
36944
|
+
}), /* @__PURE__ */ React53.createElement(Text, {
|
|
36961
36945
|
variant: "headerNav"
|
|
36962
36946
|
}, isFullscreen ? "Full screen exit" : "Full screen"))));
|
|
36963
36947
|
}
|
|
@@ -36974,7 +36958,7 @@ var HeaderWrapper = React53.forwardRef((_a, ref) => {
|
|
|
36974
36958
|
zIndex: "sticky",
|
|
36975
36959
|
alignContent: "space-between",
|
|
36976
36960
|
alignItems: "center",
|
|
36977
|
-
px: 8,
|
|
36961
|
+
px: [0, 0, 8],
|
|
36978
36962
|
borderBottom: "1px solid",
|
|
36979
36963
|
borderColor: "gray.100"
|
|
36980
36964
|
}, rest), children);
|