@edrlab/thorium-web 1.3.0 → 1.4.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/dist/{ThPreferencesAdapter-D0rzsGRl.d.mts → ThPreferencesAdapter-L1H6gzmu.d.mts} +23 -6
- package/dist/{ThSettingsWrapper-BXuRgdqp.d.mts → ThSettingsWrapper-DWEA4hYF.d.mts} +1 -1
- package/dist/{actions-BLAr0oaM.d.mts → actions-BjeRjaJU.d.mts} +1 -1
- package/dist/{actionsReducer-BhG1wicI.d.mts → actionsReducer-B32cq2mB.d.mts} +11 -4
- package/dist/{chunk-L4XGZAZ5.mjs → chunk-2YRT7RNW.mjs} +20 -3
- package/dist/chunk-2YRT7RNW.mjs.map +1 -0
- package/dist/{chunk-UCTMVCW7.mjs → chunk-6MONB2DN.mjs} +91 -63
- package/dist/chunk-6MONB2DN.mjs.map +1 -0
- package/dist/chunk-A575ZW4A.mjs +10 -0
- package/dist/chunk-A575ZW4A.mjs.map +1 -0
- package/dist/chunk-AE6P4KJB.mjs +13 -0
- package/dist/chunk-AE6P4KJB.mjs.map +1 -0
- package/dist/{chunk-OWHP7ONM.mjs → chunk-IVXRCKWR.mjs} +4 -4
- package/dist/{chunk-OWHP7ONM.mjs.map → chunk-IVXRCKWR.mjs.map} +1 -1
- package/dist/{chunk-RRVLWDT3.mjs → chunk-KVUG6BNI.mjs} +92 -27
- package/dist/chunk-KVUG6BNI.mjs.map +1 -0
- package/dist/{chunk-IYAFKTPL.mjs → chunk-NUXGQWED.mjs} +7 -5
- package/dist/chunk-NUXGQWED.mjs.map +1 -0
- package/dist/{chunk-4ODYHZKD.mjs → chunk-P6ILEQ5P.mjs} +49 -51
- package/dist/chunk-P6ILEQ5P.mjs.map +1 -0
- package/dist/{chunk-D7MFLHXV.mjs → chunk-PXXWEMNL.mjs} +951 -592
- package/dist/chunk-PXXWEMNL.mjs.map +1 -0
- package/dist/{chunk-T2E6MRVP.mjs → chunk-QUSGPT5M.mjs} +11 -12
- package/dist/chunk-QUSGPT5M.mjs.map +1 -0
- package/dist/{chunk-XBZWGRDM.mjs → chunk-SZAVAQ6S.mjs} +30 -6
- package/dist/chunk-SZAVAQ6S.mjs.map +1 -0
- package/dist/{chunk-3LDWKC5N.mjs → chunk-T5ENYSDJ.mjs} +5 -5
- package/dist/chunk-T5ENYSDJ.mjs.map +1 -0
- package/dist/{chunk-4TVEDX7L.mjs → chunk-TSLTLQ6O.mjs} +127 -41
- package/dist/chunk-TSLTLQ6O.mjs.map +1 -0
- package/dist/{chunk-ITDBOMY5.mjs → chunk-VENFFPK2.mjs} +3 -3
- package/dist/{chunk-ITDBOMY5.mjs.map → chunk-VENFFPK2.mjs.map} +1 -1
- package/dist/{chunk-YZ3KCMKY.mjs → chunk-WLVE3WNW.mjs} +238 -58
- package/dist/chunk-WLVE3WNW.mjs.map +1 -0
- package/dist/chunk-XRFLDNAY.mjs +3913 -0
- package/dist/chunk-XRFLDNAY.mjs.map +1 -0
- package/dist/components/Audio/index.d.mts +12 -12
- package/dist/components/Audio/index.mjs +14 -14
- package/dist/components/Epub/index.css +3 -3
- package/dist/components/Epub/index.css.map +1 -1
- package/dist/components/Epub/index.d.mts +12 -12
- package/dist/components/Epub/index.mjs +15 -15
- package/dist/components/Misc/index.css +2 -2
- package/dist/components/Misc/index.css.map +1 -1
- package/dist/components/Misc/index.mjs +4 -4
- package/dist/components/Reader/index.css +5 -5
- package/dist/components/Reader/index.css.map +1 -1
- package/dist/components/Reader/index.d.mts +11 -11
- package/dist/components/Reader/index.mjs +26 -24
- package/dist/components/Reader/index.mjs.map +1 -1
- package/dist/components/WebPub/index.css +3 -3
- package/dist/components/WebPub/index.css.map +1 -1
- package/dist/components/WebPub/index.d.mts +12 -12
- package/dist/components/WebPub/index.mjs +15 -15
- package/dist/core/Components/index.d.mts +11 -21
- package/dist/core/Components/index.mjs +1 -1
- package/dist/core/Helpers/index.d.mts +1 -1
- package/dist/core/Helpers/index.mjs +2 -3
- package/dist/core/Hooks/index.d.mts +12 -8
- package/dist/core/Hooks/index.mjs +1 -1
- package/dist/i18n/index.mjs +3 -6
- package/dist/lib/index.d.mts +49 -20
- package/dist/lib/index.mjs +3 -2
- package/dist/locales/da/thorium-shared.json +3 -0
- package/dist/locales/en/thorium-shared.json +24 -2
- package/dist/locales/en/thorium-web.json +2 -2
- package/dist/locales/es/thorium-shared.json +364 -0
- package/dist/locales/es/thorium-web.json +130 -0
- package/dist/locales/et/thorium-shared.json +121 -9
- package/dist/locales/et/thorium-web.json +32 -1
- package/dist/locales/fi/thorium-shared.json +42 -4
- package/dist/locales/fi/thorium-web.json +36 -2
- package/dist/locales/fr/thorium-shared.json +108 -1
- package/dist/locales/fr/thorium-web.json +121 -86
- package/dist/locales/it/thorium-shared.json +108 -1
- package/dist/locales/it/thorium-web.json +15 -2
- package/dist/locales/lt/thorium-web.json +10 -1
- package/dist/locales/pl/thorium-web.json +1 -1
- package/dist/locales/pt-BR/thorium-shared.json +6 -0
- package/dist/locales/pt-BR/thorium-web.json +88 -88
- package/dist/locales/pt-PT/thorium-shared.json +91 -0
- package/dist/locales/pt-PT/thorium-web.json +15 -3
- package/dist/locales/sv/thorium-shared.json +108 -2
- package/dist/locales/sv/thorium-web.json +15 -3
- package/dist/locales/tr/thorium-shared.json +42 -0
- package/dist/preferences/index.d.mts +59 -13
- package/dist/preferences/index.mjs +6 -6
- package/dist/{settingsReducer-Bu1zeveu.d.mts → settingsReducer-DLaT2wUB.d.mts} +14 -2
- package/dist/{ui-nBv8gfr0.d.mts → ui-DnZZhozX.d.mts} +1 -1
- package/dist/{useAudioNavigator-C5aW4-eT.d.mts → useAudioNavigator-CWXyNWq1.d.mts} +3 -1
- package/dist/{useContrast-2t429O9O.d.mts → useContrast-Bo7cDw_X.d.mts} +5 -1
- package/dist/{usePreferences-VaBf46eP.d.mts → usePreferences-D8NU1yhP.d.mts} +6 -8
- package/dist/{useReaderTransitions-JDzlBFsu.d.mts → useReaderTransitions-BQGzKeY2.d.mts} +61 -10
- package/package.json +12 -11
- package/dist/chunk-3LDWKC5N.mjs.map +0 -1
- package/dist/chunk-4ODYHZKD.mjs.map +0 -1
- package/dist/chunk-4TVEDX7L.mjs.map +0 -1
- package/dist/chunk-7CGMWOZN.mjs +0 -20
- package/dist/chunk-7CGMWOZN.mjs.map +0 -1
- package/dist/chunk-C236BQQB.mjs +0 -1725
- package/dist/chunk-C236BQQB.mjs.map +0 -1
- package/dist/chunk-D7MFLHXV.mjs.map +0 -1
- package/dist/chunk-IYAFKTPL.mjs.map +0 -1
- package/dist/chunk-L4XGZAZ5.mjs.map +0 -1
- package/dist/chunk-RRVLWDT3.mjs.map +0 -1
- package/dist/chunk-T2E6MRVP.mjs.map +0 -1
- package/dist/chunk-UCTMVCW7.mjs.map +0 -1
- package/dist/chunk-WECWPYZB.mjs +0 -1950
- package/dist/chunk-WECWPYZB.mjs.map +0 -1
- package/dist/chunk-XBZWGRDM.mjs.map +0 -1
- package/dist/chunk-YZ3KCMKY.mjs.map +0 -1
package/dist/chunk-C236BQQB.mjs
DELETED
|
@@ -1,1725 +0,0 @@
|
|
|
1
|
-
import { isSupportedLocale, supportedLocales } from './chunk-B3WDMWCT.mjs';
|
|
2
|
-
import fontStacks from '@readium/css/css/vars/fontStacks.json';
|
|
3
|
-
import ReadiumCSSColors from '@readium/css/css/vars/colors.json';
|
|
4
|
-
import { createContext, useContext } from 'react';
|
|
5
|
-
|
|
6
|
-
// src/preferences/models/actions.ts
|
|
7
|
-
var ThActionsKeys = /* @__PURE__ */ ((ThActionsKeys3) => {
|
|
8
|
-
ThActionsKeys3["fullscreen"] = "fullscreen";
|
|
9
|
-
ThActionsKeys3["jumpToPosition"] = "jumpToPosition";
|
|
10
|
-
ThActionsKeys3["settings"] = "settings";
|
|
11
|
-
ThActionsKeys3["toc"] = "toc";
|
|
12
|
-
return ThActionsKeys3;
|
|
13
|
-
})(ThActionsKeys || {});
|
|
14
|
-
var ThDockingKeys = /* @__PURE__ */ ((ThDockingKeys3) => {
|
|
15
|
-
ThDockingKeys3["start"] = "dockingStart";
|
|
16
|
-
ThDockingKeys3["end"] = "dockingEnd";
|
|
17
|
-
ThDockingKeys3["transient"] = "dockingTransient";
|
|
18
|
-
return ThDockingKeys3;
|
|
19
|
-
})(ThDockingKeys || {});
|
|
20
|
-
var ThDockingTypes = /* @__PURE__ */ ((ThDockingTypes2) => {
|
|
21
|
-
ThDockingTypes2["none"] = "none";
|
|
22
|
-
ThDockingTypes2["both"] = "both";
|
|
23
|
-
ThDockingTypes2["start"] = "start";
|
|
24
|
-
ThDockingTypes2["end"] = "end";
|
|
25
|
-
return ThDockingTypes2;
|
|
26
|
-
})(ThDockingTypes || {});
|
|
27
|
-
var ThSheetTypes = /* @__PURE__ */ ((ThSheetTypes3) => {
|
|
28
|
-
ThSheetTypes3["popover"] = "popover";
|
|
29
|
-
ThSheetTypes3["compactPopover"] = "compactPopover";
|
|
30
|
-
ThSheetTypes3["modal"] = "modal";
|
|
31
|
-
ThSheetTypes3["fullscreen"] = "fullscreen";
|
|
32
|
-
ThSheetTypes3["dockedStart"] = "docked start";
|
|
33
|
-
ThSheetTypes3["dockedEnd"] = "docked end";
|
|
34
|
-
ThSheetTypes3["bottomSheet"] = "bottomSheet";
|
|
35
|
-
return ThSheetTypes3;
|
|
36
|
-
})(ThSheetTypes || {});
|
|
37
|
-
var ThSheetHeaderVariant = /* @__PURE__ */ ((ThSheetHeaderVariant2) => {
|
|
38
|
-
ThSheetHeaderVariant2["close"] = "close";
|
|
39
|
-
ThSheetHeaderVariant2["previous"] = "previous";
|
|
40
|
-
return ThSheetHeaderVariant2;
|
|
41
|
-
})(ThSheetHeaderVariant || {});
|
|
42
|
-
var defaultActionKeysObject = {
|
|
43
|
-
visibility: "partially" /* partially */,
|
|
44
|
-
shortcut: null
|
|
45
|
-
};
|
|
46
|
-
var defaultSettingsAction = {
|
|
47
|
-
visibility: "partially" /* partially */,
|
|
48
|
-
shortcut: null,
|
|
49
|
-
// `${ UnstableShortcutMetaKeywords.shift }+${ ShortcutMetaKeywords.alt }+P`,
|
|
50
|
-
sheet: {
|
|
51
|
-
defaultSheet: "popover" /* popover */,
|
|
52
|
-
breakpoints: {
|
|
53
|
-
["compact" /* compact */]: "bottomSheet" /* bottomSheet */
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
docked: {
|
|
57
|
-
dockable: "none" /* none */,
|
|
58
|
-
width: 340
|
|
59
|
-
},
|
|
60
|
-
snapped: {
|
|
61
|
-
scrim: true,
|
|
62
|
-
peekHeight: 50,
|
|
63
|
-
minHeight: 30,
|
|
64
|
-
maxHeight: 100
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
var defaultFullscreenAction = {
|
|
68
|
-
visibility: "partially" /* partially */,
|
|
69
|
-
shortcut: null
|
|
70
|
-
};
|
|
71
|
-
var defaultTocAction = {
|
|
72
|
-
visibility: "partially" /* partially */,
|
|
73
|
-
shortcut: null,
|
|
74
|
-
// `${ UnstableShortcutMetaKeywords.shift }+${ ShortcutMetaKeywords.alt }+T`,
|
|
75
|
-
sheet: {
|
|
76
|
-
defaultSheet: "popover" /* popover */,
|
|
77
|
-
breakpoints: {
|
|
78
|
-
["compact" /* compact */]: "fullscreen" /* fullscreen */,
|
|
79
|
-
["medium" /* medium */]: "fullscreen" /* fullscreen */
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
docked: {
|
|
83
|
-
dockable: "both" /* both */,
|
|
84
|
-
dragIndicator: false,
|
|
85
|
-
width: 360,
|
|
86
|
-
minWidth: 320,
|
|
87
|
-
maxWidth: 450
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
var defaultJumpToPositionAction = {
|
|
91
|
-
visibility: "overflow" /* overflow */,
|
|
92
|
-
shortcut: null,
|
|
93
|
-
// `${ UnstableShortcutMetaKeywords.shift }+${ ShortcutMetaKeywords.alt }+J`,
|
|
94
|
-
sheet: {
|
|
95
|
-
defaultSheet: "popover" /* popover */,
|
|
96
|
-
breakpoints: {
|
|
97
|
-
["compact" /* compact */]: "bottomSheet" /* bottomSheet */
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
docked: {
|
|
101
|
-
dockable: "none" /* none */
|
|
102
|
-
},
|
|
103
|
-
snapped: {
|
|
104
|
-
scrim: true,
|
|
105
|
-
minHeight: "content-height"
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
// src/preferences/models/settings.ts
|
|
110
|
-
var ThSettingsKeys = /* @__PURE__ */ ((ThSettingsKeys2) => {
|
|
111
|
-
ThSettingsKeys2["columns"] = "columns";
|
|
112
|
-
ThSettingsKeys2["fontFamily"] = "fontFamily";
|
|
113
|
-
ThSettingsKeys2["fontWeight"] = "fontWeight";
|
|
114
|
-
ThSettingsKeys2["hyphens"] = "hyphens";
|
|
115
|
-
ThSettingsKeys2["layout"] = "layout";
|
|
116
|
-
ThSettingsKeys2["letterSpacing"] = "letterSpacing";
|
|
117
|
-
ThSettingsKeys2["lineHeight"] = "lineHeight";
|
|
118
|
-
ThSettingsKeys2["paragraphIndent"] = "paragraphIndent";
|
|
119
|
-
ThSettingsKeys2["paragraphSpacing"] = "paragraphSpacing";
|
|
120
|
-
ThSettingsKeys2["publisherStyles"] = "publisherStyles";
|
|
121
|
-
ThSettingsKeys2["spacingGroup"] = "spacingGroup";
|
|
122
|
-
ThSettingsKeys2["spacingPresets"] = "spacingPresets";
|
|
123
|
-
ThSettingsKeys2["textAlign"] = "textAlign";
|
|
124
|
-
ThSettingsKeys2["textGroup"] = "textGroup";
|
|
125
|
-
ThSettingsKeys2["textNormalize"] = "textNormalize";
|
|
126
|
-
ThSettingsKeys2["theme"] = "theme";
|
|
127
|
-
ThSettingsKeys2["wordSpacing"] = "wordSpacing";
|
|
128
|
-
ThSettingsKeys2["zoom"] = "zoom";
|
|
129
|
-
return ThSettingsKeys2;
|
|
130
|
-
})(ThSettingsKeys || {});
|
|
131
|
-
var ThTextSettingsKeys = /* @__PURE__ */ ((ThTextSettingsKeys3) => {
|
|
132
|
-
ThTextSettingsKeys3["fontFamily"] = "fontFamily";
|
|
133
|
-
ThTextSettingsKeys3["fontWeight"] = "fontWeight";
|
|
134
|
-
ThTextSettingsKeys3["hyphens"] = "hyphens";
|
|
135
|
-
ThTextSettingsKeys3["textAlign"] = "textAlign";
|
|
136
|
-
ThTextSettingsKeys3["textNormalize"] = "textNormalize";
|
|
137
|
-
return ThTextSettingsKeys3;
|
|
138
|
-
})(ThTextSettingsKeys || {});
|
|
139
|
-
var ThSpacingSettingsKeys = /* @__PURE__ */ ((ThSpacingSettingsKeys3) => {
|
|
140
|
-
ThSpacingSettingsKeys3["letterSpacing"] = "letterSpacing";
|
|
141
|
-
ThSpacingSettingsKeys3["lineHeight"] = "lineHeight";
|
|
142
|
-
ThSpacingSettingsKeys3["paragraphIndent"] = "paragraphIndent";
|
|
143
|
-
ThSpacingSettingsKeys3["paragraphSpacing"] = "paragraphSpacing";
|
|
144
|
-
ThSpacingSettingsKeys3["publisherStyles"] = "publisherStyles";
|
|
145
|
-
ThSpacingSettingsKeys3["spacingPresets"] = "spacingPresets";
|
|
146
|
-
ThSpacingSettingsKeys3["wordSpacing"] = "wordSpacing";
|
|
147
|
-
return ThSpacingSettingsKeys3;
|
|
148
|
-
})(ThSpacingSettingsKeys || {});
|
|
149
|
-
var ThSettingsContainerKeys = /* @__PURE__ */ ((ThSettingsContainerKeys2) => {
|
|
150
|
-
ThSettingsContainerKeys2["initial"] = "initial";
|
|
151
|
-
ThSettingsContainerKeys2["text"] = "text";
|
|
152
|
-
ThSettingsContainerKeys2["spacing"] = "spacing";
|
|
153
|
-
return ThSettingsContainerKeys2;
|
|
154
|
-
})(ThSettingsContainerKeys || {});
|
|
155
|
-
var ThSettingsRangeVariant = /* @__PURE__ */ ((ThSettingsRangeVariant2) => {
|
|
156
|
-
ThSettingsRangeVariant2["slider"] = "slider";
|
|
157
|
-
ThSettingsRangeVariant2["incrementedSlider"] = "incrementedSlider";
|
|
158
|
-
ThSettingsRangeVariant2["numberField"] = "numberField";
|
|
159
|
-
ThSettingsRangeVariant2["sliderWithPresets"] = "sliderWithPresets";
|
|
160
|
-
ThSettingsRangeVariant2["presetsGroup"] = "presetsGroup";
|
|
161
|
-
return ThSettingsRangeVariant2;
|
|
162
|
-
})(ThSettingsRangeVariant || {});
|
|
163
|
-
var ThSettingsRangePlaceholder = /* @__PURE__ */ ((ThSettingsRangePlaceholder2) => {
|
|
164
|
-
ThSettingsRangePlaceholder2["range"] = "range";
|
|
165
|
-
ThSettingsRangePlaceholder2["none"] = "none";
|
|
166
|
-
return ThSettingsRangePlaceholder2;
|
|
167
|
-
})(ThSettingsRangePlaceholder || {});
|
|
168
|
-
var ThSpacingPresetKeys = /* @__PURE__ */ ((ThSpacingPresetKeys3) => {
|
|
169
|
-
ThSpacingPresetKeys3["publisher"] = "publisher";
|
|
170
|
-
ThSpacingPresetKeys3["tight"] = "tight";
|
|
171
|
-
ThSpacingPresetKeys3["balanced"] = "balanced";
|
|
172
|
-
ThSpacingPresetKeys3["loose"] = "loose";
|
|
173
|
-
ThSpacingPresetKeys3["accessible"] = "accessible";
|
|
174
|
-
ThSpacingPresetKeys3["custom"] = "custom";
|
|
175
|
-
return ThSpacingPresetKeys3;
|
|
176
|
-
})(ThSpacingPresetKeys || {});
|
|
177
|
-
var ThLayoutOptions = /* @__PURE__ */ ((ThLayoutOptions2) => {
|
|
178
|
-
ThLayoutOptions2["scroll"] = "scroll_option";
|
|
179
|
-
ThLayoutOptions2["paginated"] = "page_option";
|
|
180
|
-
return ThLayoutOptions2;
|
|
181
|
-
})(ThLayoutOptions || {});
|
|
182
|
-
var ThTextAlignOptions = /* @__PURE__ */ ((ThTextAlignOptions2) => {
|
|
183
|
-
ThTextAlignOptions2["publisher"] = "publisher";
|
|
184
|
-
ThTextAlignOptions2["start"] = "start";
|
|
185
|
-
ThTextAlignOptions2["justify"] = "justify";
|
|
186
|
-
return ThTextAlignOptions2;
|
|
187
|
-
})(ThTextAlignOptions || {});
|
|
188
|
-
var ThLineHeightOptions = /* @__PURE__ */ ((ThLineHeightOptions3) => {
|
|
189
|
-
ThLineHeightOptions3["publisher"] = "publisher";
|
|
190
|
-
ThLineHeightOptions3["small"] = "small";
|
|
191
|
-
ThLineHeightOptions3["medium"] = "medium";
|
|
192
|
-
ThLineHeightOptions3["large"] = "large";
|
|
193
|
-
return ThLineHeightOptions3;
|
|
194
|
-
})(ThLineHeightOptions || {});
|
|
195
|
-
var defaultTextSettingsMain = ["fontFamily" /* fontFamily */];
|
|
196
|
-
var defaultTextSettingsSubpanel = [
|
|
197
|
-
"fontFamily" /* fontFamily */,
|
|
198
|
-
"textAlign" /* textAlign */,
|
|
199
|
-
"hyphens" /* hyphens */,
|
|
200
|
-
"fontWeight" /* fontWeight */,
|
|
201
|
-
"textNormalize" /* textNormalize */
|
|
202
|
-
];
|
|
203
|
-
var defaultSpacingSettingsMain = [
|
|
204
|
-
"spacingPresets" /* spacingPresets */
|
|
205
|
-
];
|
|
206
|
-
var defaultSpacingSettingsSubpanel = [
|
|
207
|
-
"spacingPresets" /* spacingPresets */,
|
|
208
|
-
"lineHeight" /* lineHeight */,
|
|
209
|
-
"paragraphSpacing" /* paragraphSpacing */,
|
|
210
|
-
"paragraphIndent" /* paragraphIndent */,
|
|
211
|
-
"wordSpacing" /* wordSpacing */,
|
|
212
|
-
"letterSpacing" /* letterSpacing */
|
|
213
|
-
];
|
|
214
|
-
var defaultSpacingPresetsOrder = [
|
|
215
|
-
"publisher" /* publisher */,
|
|
216
|
-
"accessible" /* accessible */,
|
|
217
|
-
"custom" /* custom */,
|
|
218
|
-
"tight" /* tight */,
|
|
219
|
-
"balanced" /* balanced */,
|
|
220
|
-
"loose" /* loose */
|
|
221
|
-
];
|
|
222
|
-
var defaultParagraphSpacing = {
|
|
223
|
-
variant: "numberField" /* numberField */,
|
|
224
|
-
placeholder: "range" /* range */,
|
|
225
|
-
range: [0, 3],
|
|
226
|
-
step: 0.25
|
|
227
|
-
};
|
|
228
|
-
var defaultParagraphIndent = {
|
|
229
|
-
variant: "numberField" /* numberField */,
|
|
230
|
-
placeholder: "range" /* range */,
|
|
231
|
-
range: [0, 2],
|
|
232
|
-
step: 0.25
|
|
233
|
-
};
|
|
234
|
-
var defaultWordSpacing = {
|
|
235
|
-
variant: "numberField" /* numberField */,
|
|
236
|
-
placeholder: "range" /* range */,
|
|
237
|
-
range: [0, 1],
|
|
238
|
-
step: 0.1
|
|
239
|
-
};
|
|
240
|
-
var defaultLetterSpacing = {
|
|
241
|
-
variant: "numberField" /* numberField */,
|
|
242
|
-
placeholder: "range" /* range */,
|
|
243
|
-
range: [0, 0.5],
|
|
244
|
-
step: 0.05
|
|
245
|
-
};
|
|
246
|
-
var defaultLineHeights = {
|
|
247
|
-
["small" /* small */]: 1.35,
|
|
248
|
-
["medium" /* medium */]: 1.5,
|
|
249
|
-
["large" /* large */]: 1.75
|
|
250
|
-
};
|
|
251
|
-
var defaultZoom = {
|
|
252
|
-
variant: "numberField" /* numberField */,
|
|
253
|
-
placeholder: "range" /* range */,
|
|
254
|
-
range: [0.7, 4],
|
|
255
|
-
step: 0.05
|
|
256
|
-
};
|
|
257
|
-
var defaultSpacingPresets = {
|
|
258
|
-
["tight" /* tight */]: {
|
|
259
|
-
["lineHeight" /* lineHeight */]: "small" /* small */,
|
|
260
|
-
["paragraphSpacing" /* paragraphSpacing */]: 0.25,
|
|
261
|
-
["paragraphIndent" /* paragraphIndent */]: 1
|
|
262
|
-
},
|
|
263
|
-
["balanced" /* balanced */]: {
|
|
264
|
-
["lineHeight" /* lineHeight */]: "medium" /* medium */,
|
|
265
|
-
["paragraphSpacing" /* paragraphSpacing */]: 1,
|
|
266
|
-
["paragraphIndent" /* paragraphIndent */]: 1
|
|
267
|
-
},
|
|
268
|
-
["loose" /* loose */]: {
|
|
269
|
-
["lineHeight" /* lineHeight */]: "large" /* large */,
|
|
270
|
-
["paragraphSpacing" /* paragraphSpacing */]: 1.5,
|
|
271
|
-
["paragraphIndent" /* paragraphIndent */]: 1
|
|
272
|
-
},
|
|
273
|
-
["accessible" /* accessible */]: {
|
|
274
|
-
["lineHeight" /* lineHeight */]: "large" /* large */,
|
|
275
|
-
["paragraphSpacing" /* paragraphSpacing */]: 2.5,
|
|
276
|
-
["paragraphIndent" /* paragraphIndent */]: 1,
|
|
277
|
-
["letterSpacing" /* letterSpacing */]: 0.1,
|
|
278
|
-
["wordSpacing" /* wordSpacing */]: 0.3
|
|
279
|
-
}
|
|
280
|
-
};
|
|
281
|
-
|
|
282
|
-
// src/preferences/models/audio.ts
|
|
283
|
-
var ThAudioActionKeys = /* @__PURE__ */ ((ThAudioActionKeys2) => {
|
|
284
|
-
ThAudioActionKeys2["toc"] = "audio.toc";
|
|
285
|
-
ThAudioActionKeys2["volume"] = "audio.volume";
|
|
286
|
-
ThAudioActionKeys2["playbackRate"] = "audio.playbackRate";
|
|
287
|
-
ThAudioActionKeys2["sleepTimer"] = "audio.sleepTimer";
|
|
288
|
-
ThAudioActionKeys2["remotePlayback"] = "audio.remotePlayback";
|
|
289
|
-
return ThAudioActionKeys2;
|
|
290
|
-
})(ThAudioActionKeys || {});
|
|
291
|
-
var ThAudioKeys = /* @__PURE__ */ ((ThAudioKeys2) => {
|
|
292
|
-
ThAudioKeys2["theme"] = "theme";
|
|
293
|
-
ThAudioKeys2["volume"] = "volume";
|
|
294
|
-
ThAudioKeys2["playbackRate"] = "playbackRate";
|
|
295
|
-
ThAudioKeys2["skipBackwardInterval"] = "skipBackwardInterval";
|
|
296
|
-
ThAudioKeys2["skipForwardInterval"] = "skipForwardInterval";
|
|
297
|
-
ThAudioKeys2["skipInterval"] = "skipInterval";
|
|
298
|
-
ThAudioKeys2["autoPlay"] = "autoPlay";
|
|
299
|
-
ThAudioKeys2["sleepTimer"] = "sleepTimer";
|
|
300
|
-
return ThAudioKeys2;
|
|
301
|
-
})(ThAudioKeys || {});
|
|
302
|
-
var ThSettingsTimerVariant = /* @__PURE__ */ ((ThSettingsTimerVariant2) => {
|
|
303
|
-
ThSettingsTimerVariant2["presetList"] = "presetList";
|
|
304
|
-
ThSettingsTimerVariant2["durationField"] = "durationField";
|
|
305
|
-
return ThSettingsTimerVariant2;
|
|
306
|
-
})(ThSettingsTimerVariant || {});
|
|
307
|
-
var defaultAudioVolume = {
|
|
308
|
-
variant: "slider" /* slider */,
|
|
309
|
-
range: [0, 1],
|
|
310
|
-
step: 0.1,
|
|
311
|
-
placeholder: "range" /* range */
|
|
312
|
-
};
|
|
313
|
-
var defaultAudioPlaybackRate = {
|
|
314
|
-
variant: "sliderWithPresets" /* sliderWithPresets */,
|
|
315
|
-
range: [0.5, 4],
|
|
316
|
-
step: 0.05,
|
|
317
|
-
placeholder: "range" /* range */,
|
|
318
|
-
presets: [0.75, 1, 1.25, 1.5, 1.75, 2]
|
|
319
|
-
};
|
|
320
|
-
var defaultAudioSkipBackwardInterval = {
|
|
321
|
-
variant: "presetsGroup" /* presetsGroup */,
|
|
322
|
-
range: [5, 60],
|
|
323
|
-
step: 5,
|
|
324
|
-
placeholder: "range" /* range */,
|
|
325
|
-
presets: [5, 10, 30]
|
|
326
|
-
};
|
|
327
|
-
var defaultAudioSkipForwardInterval = {
|
|
328
|
-
variant: "presetsGroup" /* presetsGroup */,
|
|
329
|
-
range: [5, 60],
|
|
330
|
-
step: 5,
|
|
331
|
-
placeholder: "range" /* range */,
|
|
332
|
-
presets: [5, 10, 30]
|
|
333
|
-
};
|
|
334
|
-
var defaultAudioSkipInterval = {
|
|
335
|
-
variant: "presetsGroup" /* presetsGroup */,
|
|
336
|
-
range: [5, 60],
|
|
337
|
-
step: 5,
|
|
338
|
-
placeholder: "range" /* range */,
|
|
339
|
-
presets: [5, 10, 30]
|
|
340
|
-
};
|
|
341
|
-
var defaultAudioSleepTimer = {
|
|
342
|
-
variant: "durationField" /* durationField */,
|
|
343
|
-
maxHours: 23
|
|
344
|
-
};
|
|
345
|
-
var defaultAudioSleepTimerPresetList = {
|
|
346
|
-
variant: "presetList" /* presetList */,
|
|
347
|
-
presets: [15, 30, 45, 60, 90, "endOfFragment", "endOfResource"]
|
|
348
|
-
};
|
|
349
|
-
var defaultAudioVolumeAction = {
|
|
350
|
-
visibility: "always" /* always */,
|
|
351
|
-
shortcut: null,
|
|
352
|
-
sheet: {
|
|
353
|
-
defaultSheet: "compactPopover" /* compactPopover */,
|
|
354
|
-
breakpoints: {}
|
|
355
|
-
},
|
|
356
|
-
docked: { dockable: "none" /* none */ }
|
|
357
|
-
};
|
|
358
|
-
var defaultAudioPlaybackRateAction = {
|
|
359
|
-
visibility: "always" /* always */,
|
|
360
|
-
shortcut: null,
|
|
361
|
-
sheet: {
|
|
362
|
-
defaultSheet: "compactPopover" /* compactPopover */,
|
|
363
|
-
breakpoints: { ["compact" /* compact */]: "bottomSheet" /* bottomSheet */ }
|
|
364
|
-
},
|
|
365
|
-
snapped: {
|
|
366
|
-
minHeight: "content-height"
|
|
367
|
-
},
|
|
368
|
-
docked: { dockable: "none" /* none */ }
|
|
369
|
-
};
|
|
370
|
-
var defaultAudioSleepTimerAction = {
|
|
371
|
-
visibility: "partially" /* partially */,
|
|
372
|
-
shortcut: null,
|
|
373
|
-
sheet: {
|
|
374
|
-
defaultSheet: "modal" /* modal */,
|
|
375
|
-
breakpoints: {
|
|
376
|
-
["compact" /* compact */]: "bottomSheet" /* bottomSheet */,
|
|
377
|
-
["medium" /* medium */]: "bottomSheet" /* bottomSheet */
|
|
378
|
-
}
|
|
379
|
-
},
|
|
380
|
-
snapped: {
|
|
381
|
-
minHeight: "content-height"
|
|
382
|
-
},
|
|
383
|
-
docked: { dockable: "none" /* none */ }
|
|
384
|
-
};
|
|
385
|
-
var defaultAudioRemotePlaybackAction = {
|
|
386
|
-
visibility: "always" /* always */,
|
|
387
|
-
shortcut: null
|
|
388
|
-
};
|
|
389
|
-
var defaultAudioTocAction = {
|
|
390
|
-
visibility: "partially" /* partially */,
|
|
391
|
-
shortcut: null,
|
|
392
|
-
sheet: {
|
|
393
|
-
defaultSheet: "modal" /* modal */,
|
|
394
|
-
breakpoints: {
|
|
395
|
-
["compact" /* compact */]: "fullscreen" /* fullscreen */,
|
|
396
|
-
["medium" /* medium */]: "fullscreen" /* fullscreen */
|
|
397
|
-
}
|
|
398
|
-
},
|
|
399
|
-
docked: {
|
|
400
|
-
dockable: "both" /* both */,
|
|
401
|
-
dragIndicator: false,
|
|
402
|
-
width: 360,
|
|
403
|
-
minWidth: 320,
|
|
404
|
-
maxWidth: 450
|
|
405
|
-
}
|
|
406
|
-
};
|
|
407
|
-
|
|
408
|
-
// src/preferences/helpers/fontPref/googleFonts.ts
|
|
409
|
-
var DEFAULT_FALLBACK = "sans-serif";
|
|
410
|
-
var DEFAULT_WIDTH_STEP = 20;
|
|
411
|
-
var DEFAULT_WEIGHT_STEP = 20;
|
|
412
|
-
var createDefinitionsFromGoogleFonts = (params) => {
|
|
413
|
-
const { cssUrl, options } = params;
|
|
414
|
-
const { widthStep = DEFAULT_WIDTH_STEP, weightStep = DEFAULT_WEIGHT_STEP, display, labels, fallbacks, order } = options || {};
|
|
415
|
-
const processedUrl = cssUrl.includes("@import") ? cssUrl.match(/@import\s+url\(['"]?([^'")]+)['"]?\)/i)?.[1] || cssUrl : cssUrl.includes("href=") ? cssUrl.match(/href=["']([^"']+)["']/)?.[1] || cssUrl : cssUrl;
|
|
416
|
-
const url = new URL(processedUrl);
|
|
417
|
-
if (!url.hostname.includes("fonts.googleapis.com")) {
|
|
418
|
-
throw new Error("Invalid Google Fonts URL");
|
|
419
|
-
}
|
|
420
|
-
const familyParams = url.searchParams.getAll("family");
|
|
421
|
-
if (familyParams.length === 0) {
|
|
422
|
-
throw new Error("No family parameter found in Google Fonts URL");
|
|
423
|
-
}
|
|
424
|
-
const families = familyParams.map((familyParam) => {
|
|
425
|
-
const decodedFamily = decodeURIComponent(familyParam);
|
|
426
|
-
const [familyName, axesStr] = decodedFamily.split(":");
|
|
427
|
-
if (!familyName) {
|
|
428
|
-
throw new Error(`Invalid family format: ${familyParam}`);
|
|
429
|
-
}
|
|
430
|
-
const family = {
|
|
431
|
-
name: familyName.replace(/\+/g, " "),
|
|
432
|
-
styles: ["normal"],
|
|
433
|
-
weights: { type: "static", values: [400] }
|
|
434
|
-
// Default weight
|
|
435
|
-
};
|
|
436
|
-
let hasExplicitWeights = false;
|
|
437
|
-
if (axesStr) {
|
|
438
|
-
const [axisNames, valuesStr] = axesStr.split("@");
|
|
439
|
-
if (axisNames && valuesStr) {
|
|
440
|
-
const axes = axisNames.split(",");
|
|
441
|
-
const variations = valuesStr.split(";");
|
|
442
|
-
variations.forEach((variation) => {
|
|
443
|
-
const values = variation.split(",");
|
|
444
|
-
axes.forEach((axis, index) => {
|
|
445
|
-
const value = values[index];
|
|
446
|
-
if (!value) return;
|
|
447
|
-
switch (axis) {
|
|
448
|
-
case "ital":
|
|
449
|
-
if (value === "1") {
|
|
450
|
-
family.styles = Array.from(/* @__PURE__ */ new Set([...family.styles, "italic"]));
|
|
451
|
-
}
|
|
452
|
-
break;
|
|
453
|
-
case "wght":
|
|
454
|
-
if (value.includes("..")) {
|
|
455
|
-
const [min, max] = value.split("..").map(Number);
|
|
456
|
-
if (!isNaN(min) && !isNaN(max)) {
|
|
457
|
-
family.weights = {
|
|
458
|
-
type: "variable",
|
|
459
|
-
min,
|
|
460
|
-
max,
|
|
461
|
-
step: weightStep
|
|
462
|
-
};
|
|
463
|
-
}
|
|
464
|
-
} else {
|
|
465
|
-
const weight = Number(value);
|
|
466
|
-
if (!isNaN(weight) && family.weights.type === "static") {
|
|
467
|
-
const currentWeights = family.weights.values;
|
|
468
|
-
const newWeights = !hasExplicitWeights ? [weight] : Array.from(/* @__PURE__ */ new Set([...currentWeights, weight])).sort((a, b) => a - b);
|
|
469
|
-
family.weights = {
|
|
470
|
-
type: "static",
|
|
471
|
-
values: newWeights
|
|
472
|
-
};
|
|
473
|
-
hasExplicitWeights = true;
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
break;
|
|
477
|
-
case "wdth":
|
|
478
|
-
if (value.includes("..")) {
|
|
479
|
-
const [min, max] = value.split("..").map(Number);
|
|
480
|
-
if (!isNaN(min) && !isNaN(max)) {
|
|
481
|
-
family.widths = {
|
|
482
|
-
min,
|
|
483
|
-
max,
|
|
484
|
-
step: widthStep
|
|
485
|
-
};
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
break;
|
|
489
|
-
}
|
|
490
|
-
});
|
|
491
|
-
});
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
return family;
|
|
495
|
-
});
|
|
496
|
-
const fontEntries = families.map((family) => {
|
|
497
|
-
const fontId = family.name.toLowerCase().replace(/\s+/g, "-");
|
|
498
|
-
return [
|
|
499
|
-
fontId,
|
|
500
|
-
{
|
|
501
|
-
id: fontId,
|
|
502
|
-
name: family.name,
|
|
503
|
-
...labels?.[fontId] && { label: labels[fontId] },
|
|
504
|
-
source: { type: "custom", provider: "google" },
|
|
505
|
-
spec: {
|
|
506
|
-
family: family.name,
|
|
507
|
-
fallbacks: fallbacks?.[fontId] || [DEFAULT_FALLBACK],
|
|
508
|
-
weights: family.weights,
|
|
509
|
-
styles: family.styles,
|
|
510
|
-
...family.widths && { widths: family.widths },
|
|
511
|
-
...display && { display }
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
];
|
|
515
|
-
});
|
|
516
|
-
if (order && order.length > 0) {
|
|
517
|
-
const orderedEntries = [];
|
|
518
|
-
const fontMap = new Map(fontEntries);
|
|
519
|
-
for (const fontId of order) {
|
|
520
|
-
const fontEntry = fontMap.get(fontId);
|
|
521
|
-
if (fontEntry) {
|
|
522
|
-
orderedEntries.push([fontId, fontEntry]);
|
|
523
|
-
fontMap.delete(fontId);
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
for (const [fontId, fontEntry] of fontMap.entries()) {
|
|
527
|
-
orderedEntries.push([fontId, fontEntry]);
|
|
528
|
-
}
|
|
529
|
-
return Object.fromEntries(orderedEntries);
|
|
530
|
-
}
|
|
531
|
-
return Object.fromEntries(fontEntries);
|
|
532
|
-
};
|
|
533
|
-
|
|
534
|
-
// src/preferences/helpers/fontPref/localFonts.ts
|
|
535
|
-
var createDefinitionFromStaticFonts = (params) => {
|
|
536
|
-
const { id, name, files, family, label, fallbacks = ["sans-serif"] } = params;
|
|
537
|
-
if (!files || files.length === 0) {
|
|
538
|
-
throw new Error("No files provided to infer font specification");
|
|
539
|
-
}
|
|
540
|
-
if (!files.every((file) => file.weight !== void 0)) {
|
|
541
|
-
throw new Error("All files must have explicit weights for static font specification inference");
|
|
542
|
-
}
|
|
543
|
-
const weights = Array.from(new Set(files.map((file) => file.weight))).sort((a, b) => a - b);
|
|
544
|
-
const styles = Array.from(new Set(files.map((file) => file.style)));
|
|
545
|
-
const source = {
|
|
546
|
-
type: "custom",
|
|
547
|
-
provider: "local",
|
|
548
|
-
variant: "static",
|
|
549
|
-
files
|
|
550
|
-
};
|
|
551
|
-
const spec = {
|
|
552
|
-
family: family || name,
|
|
553
|
-
fallbacks,
|
|
554
|
-
weights: {
|
|
555
|
-
type: "static",
|
|
556
|
-
values: weights
|
|
557
|
-
},
|
|
558
|
-
styles
|
|
559
|
-
};
|
|
560
|
-
return {
|
|
561
|
-
id,
|
|
562
|
-
name,
|
|
563
|
-
...label && { label },
|
|
564
|
-
source,
|
|
565
|
-
spec
|
|
566
|
-
};
|
|
567
|
-
};
|
|
568
|
-
|
|
569
|
-
// src/preferences/helpers/validateObjectKeys.ts
|
|
570
|
-
var validateObjectKeys = (orderArrays, keysObj, context, specialCase, fallback) => {
|
|
571
|
-
const allOrders = new Set(
|
|
572
|
-
orderArrays.flatMap((arr) => {
|
|
573
|
-
if (!specialCase) return arr;
|
|
574
|
-
return arr.filter((k) => {
|
|
575
|
-
if (Array.isArray(specialCase)) {
|
|
576
|
-
return !specialCase.includes(k);
|
|
577
|
-
} else {
|
|
578
|
-
return k !== specialCase;
|
|
579
|
-
}
|
|
580
|
-
});
|
|
581
|
-
})
|
|
582
|
-
);
|
|
583
|
-
const availableKeys = Object.keys(keysObj);
|
|
584
|
-
allOrders.forEach((key) => {
|
|
585
|
-
if (!availableKeys.includes(key)) {
|
|
586
|
-
if (fallback) keysObj[key] = fallback;
|
|
587
|
-
console.warn(
|
|
588
|
-
`Key "${key}" in ${context} order arrays not found in ${context}.keys.${fallback ? `
|
|
589
|
-
Using fallback: ${JSON.stringify(fallback)}` : ""}`
|
|
590
|
-
);
|
|
591
|
-
}
|
|
592
|
-
});
|
|
593
|
-
};
|
|
594
|
-
var readiumCSSFontCollection = {
|
|
595
|
-
oldStyle: {
|
|
596
|
-
id: "oldStyle",
|
|
597
|
-
name: "Old Style",
|
|
598
|
-
label: "reader.preferences.fontFamily.oldStyle.descriptive",
|
|
599
|
-
source: { type: "system" },
|
|
600
|
-
spec: {
|
|
601
|
-
family: fontStacks.RS__oldStyleTf,
|
|
602
|
-
weights: { type: "static", values: [400, 700] },
|
|
603
|
-
fallbacks: []
|
|
604
|
-
}
|
|
605
|
-
},
|
|
606
|
-
modern: {
|
|
607
|
-
id: "modern",
|
|
608
|
-
name: "Modern",
|
|
609
|
-
label: "reader.preferences.fontFamily.modern.descriptive",
|
|
610
|
-
source: { type: "system" },
|
|
611
|
-
spec: {
|
|
612
|
-
family: fontStacks.RS__modernTf,
|
|
613
|
-
weights: { type: "static", values: [400, 700] },
|
|
614
|
-
fallbacks: []
|
|
615
|
-
}
|
|
616
|
-
},
|
|
617
|
-
sans: {
|
|
618
|
-
id: "sans",
|
|
619
|
-
name: "Sans",
|
|
620
|
-
label: "reader.preferences.fontFamily.sans",
|
|
621
|
-
source: { type: "system" },
|
|
622
|
-
spec: {
|
|
623
|
-
family: fontStacks.RS__sansTf,
|
|
624
|
-
weights: { type: "static", values: [400, 700] },
|
|
625
|
-
fallbacks: []
|
|
626
|
-
}
|
|
627
|
-
},
|
|
628
|
-
humanist: {
|
|
629
|
-
id: "humanist",
|
|
630
|
-
name: "Humanist",
|
|
631
|
-
label: "reader.preferences.fontFamily.humanist.descriptive",
|
|
632
|
-
source: { type: "system" },
|
|
633
|
-
spec: {
|
|
634
|
-
family: fontStacks.RS__humanistTf,
|
|
635
|
-
weights: { type: "static", values: [400, 700] },
|
|
636
|
-
fallbacks: []
|
|
637
|
-
}
|
|
638
|
-
},
|
|
639
|
-
monospace: {
|
|
640
|
-
id: "monospace",
|
|
641
|
-
name: "Monospace",
|
|
642
|
-
label: "reader.preferences.fontFamily.monospace",
|
|
643
|
-
source: { type: "system" },
|
|
644
|
-
spec: {
|
|
645
|
-
family: fontStacks.RS__monospaceTf,
|
|
646
|
-
weights: { type: "static", values: [400, 700] },
|
|
647
|
-
fallbacks: []
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
};
|
|
651
|
-
var defaultFontCollection = {
|
|
652
|
-
...createDefinitionsFromGoogleFonts({
|
|
653
|
-
cssUrl: "https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible+Next:ital,wght@0,200..800;1,200..800&family=Literata:ital,opsz,wght@0,7..72,200..900;1,7..72,200..900",
|
|
654
|
-
options: {
|
|
655
|
-
order: ["literata", "atkinson-hyperlegible-next"],
|
|
656
|
-
fallbacks: {
|
|
657
|
-
"literata": ["serif"],
|
|
658
|
-
"atkinson-hyperlegible-next": ["sans-serif"]
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
}),
|
|
662
|
-
luciole: createDefinitionFromStaticFonts({
|
|
663
|
-
id: "luciole",
|
|
664
|
-
name: "Luciole",
|
|
665
|
-
files: [
|
|
666
|
-
{ path: "/fonts/Luciole/Luciole-Regular.woff2", weight: 400, style: "normal" },
|
|
667
|
-
{ path: "/fonts/Luciole/Luciole-Italic.woff2", weight: 400, style: "italic" },
|
|
668
|
-
{ path: "/fonts/Luciole/Luciole-Bold.woff2", weight: 700, style: "normal" },
|
|
669
|
-
{ path: "/fonts/Luciole/Luciole-BoldItalic.woff2", weight: 700, style: "italic" }
|
|
670
|
-
]
|
|
671
|
-
}),
|
|
672
|
-
...readiumCSSFontCollection,
|
|
673
|
-
iAWriterDuo: createDefinitionFromStaticFonts({
|
|
674
|
-
id: "iAWriterDuo",
|
|
675
|
-
name: "iA Writer Duo",
|
|
676
|
-
label: "iA Writer Duospace",
|
|
677
|
-
fallbacks: ["monospace"],
|
|
678
|
-
files: [
|
|
679
|
-
{ path: "/fonts/iAWriterDuo/iAWriterDuoS-Regular.woff2", weight: 400, style: "normal" },
|
|
680
|
-
{ path: "/fonts/iAWriterDuo/iAWriterDuoS-Bold.woff2", weight: 700, style: "normal" },
|
|
681
|
-
{ path: "/fonts/iAWriterDuo/iAWriterDuoS-Italic.woff2", weight: 400, style: "italic" },
|
|
682
|
-
{ path: "/fonts/iAWriterDuo/iAWriterDuoS-BoldItalic.woff2", weight: 700, style: "italic" }
|
|
683
|
-
]
|
|
684
|
-
}),
|
|
685
|
-
openDyslexic: createDefinitionFromStaticFonts({
|
|
686
|
-
id: "openDyslexic",
|
|
687
|
-
name: "Open Dyslexic",
|
|
688
|
-
files: [
|
|
689
|
-
{ path: "/fonts/OpenDyslexic/OpenDyslexic-Regular.otf", weight: 400, style: "normal" },
|
|
690
|
-
{ path: "/fonts/OpenDyslexic/OpenDyslexic-Italic.otf", weight: 400, style: "italic" },
|
|
691
|
-
{ path: "/fonts/OpenDyslexic/OpenDyslexic-Bold.otf", weight: 700, style: "normal" },
|
|
692
|
-
{ path: "/fonts/OpenDyslexic/OpenDyslexic-BoldItalic.otf", weight: 700, style: "italic" }
|
|
693
|
-
]
|
|
694
|
-
}),
|
|
695
|
-
accessibleDfA: createDefinitionFromStaticFonts({
|
|
696
|
-
id: "accessibleDfA",
|
|
697
|
-
name: "Accessible DfA",
|
|
698
|
-
files: [
|
|
699
|
-
{ path: "/fonts/AccessibleDfA/AccessibleDfA-Regular.woff2", weight: 400, style: "normal" },
|
|
700
|
-
{ path: "/fonts/AccessibleDfA/AccessibleDfA-Italic.woff2", weight: 400, style: "italic" },
|
|
701
|
-
{ path: "/fonts/AccessibleDfA/AccessibleDfA-Bold.woff2", weight: 700, style: "normal" }
|
|
702
|
-
]
|
|
703
|
-
})
|
|
704
|
-
};
|
|
705
|
-
var tamilCollection = {
|
|
706
|
-
...createDefinitionsFromGoogleFonts({
|
|
707
|
-
cssUrl: "https://fonts.googleapis.com/css2?family=Anek+Tamil:wght@100..800&family=Catamaran:wght@100..900&family=Hind+Madurai:wght@400;700&family=Mukta+Malar:wght@400;700&family=Noto+Sans+Tamil:wght@100..900&family=Noto+Serif+Tamil:ital,wght@0,100..900;1,100..900",
|
|
708
|
-
options: {
|
|
709
|
-
order: ["noto-sans-tamil", "noto-serif-tamil", "anek-tamil", "catamaran", "hind-madurai", "mukta-malar"],
|
|
710
|
-
labels: {
|
|
711
|
-
"noto-sans-tamil": "Noto Sans",
|
|
712
|
-
"noto-serif-tamil": "Noto Serif",
|
|
713
|
-
"anek-tamil": "\u0B85\u0BA9\u0BC7\u0B95\u0BCD \u0BA4\u0BAE\u0BBF\u0BB4\u0BCD",
|
|
714
|
-
"catamaran": "\u0B95\u0B9F\u0BCD\u0B9F\u0BC1\u0BAE\u0BB0\u0BA9\u0BCD",
|
|
715
|
-
"mukta-malar": "\u0BAE\u0BC1\u0B95\u0BCD\u0BA4 \u0BAE\u0BB2\u0BB0\u0BCD"
|
|
716
|
-
},
|
|
717
|
-
fallbacks: {
|
|
718
|
-
"noto-serif-tamil": ["serif"]
|
|
719
|
-
}
|
|
720
|
-
}
|
|
721
|
-
})
|
|
722
|
-
};
|
|
723
|
-
|
|
724
|
-
// src/preferences/models/protection.ts
|
|
725
|
-
var resolveContentProtectionConfig = (contentProtection, t) => {
|
|
726
|
-
if (!contentProtection) return void 0;
|
|
727
|
-
let resolvedWatermark;
|
|
728
|
-
if (contentProtection.protectPrinting?.watermark) {
|
|
729
|
-
if (typeof contentProtection.protectPrinting.watermark === "object" && "key" in contentProtection.protectPrinting.watermark) {
|
|
730
|
-
resolvedWatermark = t(contentProtection.protectPrinting.watermark.key, {
|
|
731
|
-
defaultValue: contentProtection.protectPrinting.watermark.fallback
|
|
732
|
-
});
|
|
733
|
-
} else if (typeof contentProtection.protectPrinting.watermark === "string") {
|
|
734
|
-
resolvedWatermark = t(contentProtection.protectPrinting.watermark);
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
const resolved = {
|
|
738
|
-
protectCopy: contentProtection.protectCopy,
|
|
739
|
-
disableContextMenu: contentProtection.disableContextMenu,
|
|
740
|
-
disableDragAndDrop: contentProtection.disableDragAndDrop,
|
|
741
|
-
protectPrinting: contentProtection.protectPrinting?.disable ? {
|
|
742
|
-
disable: true,
|
|
743
|
-
watermark: resolvedWatermark
|
|
744
|
-
} : void 0,
|
|
745
|
-
disableSelectAll: contentProtection.disableSelectAll,
|
|
746
|
-
disableSave: contentProtection.disableSave,
|
|
747
|
-
monitorDevTools: contentProtection.monitorDevTools
|
|
748
|
-
// TODO: When we implement it in non-audio navigators, uncomment
|
|
749
|
-
// disableRemotePlayback: contentProtection.disableRemotePlayback
|
|
750
|
-
};
|
|
751
|
-
return resolved;
|
|
752
|
-
};
|
|
753
|
-
var resolveAudioContentProtectionConfig = (contentProtection, t) => {
|
|
754
|
-
if (!contentProtection) return void 0;
|
|
755
|
-
let resolvedWatermark;
|
|
756
|
-
if (contentProtection.protectPrinting?.watermark) {
|
|
757
|
-
if (typeof contentProtection.protectPrinting.watermark === "object" && "key" in contentProtection.protectPrinting.watermark) {
|
|
758
|
-
resolvedWatermark = t(contentProtection.protectPrinting.watermark.key, {
|
|
759
|
-
defaultValue: contentProtection.protectPrinting.watermark.fallback
|
|
760
|
-
});
|
|
761
|
-
} else if (typeof contentProtection.protectPrinting.watermark === "string") {
|
|
762
|
-
resolvedWatermark = t(contentProtection.protectPrinting.watermark);
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
return {
|
|
766
|
-
protectCopy: contentProtection.protectCopy,
|
|
767
|
-
disableContextMenu: contentProtection.disableContextMenu,
|
|
768
|
-
disableDragAndDrop: contentProtection.disableDragAndDrop,
|
|
769
|
-
protectPrinting: contentProtection.protectPrinting?.disable ? {
|
|
770
|
-
disable: true,
|
|
771
|
-
watermark: resolvedWatermark
|
|
772
|
-
} : void 0,
|
|
773
|
-
disableSelectAll: contentProtection.disableSelectAll,
|
|
774
|
-
disableSave: contentProtection.disableSave,
|
|
775
|
-
monitorDevTools: contentProtection.monitorDevTools,
|
|
776
|
-
disableRemotePlayback: contentProtection.disableRemotePlayback
|
|
777
|
-
};
|
|
778
|
-
};
|
|
779
|
-
var defaultContentProtectionConfig = {
|
|
780
|
-
protectCopy: false,
|
|
781
|
-
disableContextMenu: false,
|
|
782
|
-
disableDragAndDrop: false,
|
|
783
|
-
protectPrinting: {
|
|
784
|
-
disable: false,
|
|
785
|
-
watermark: "reader.app.printingDisabled"
|
|
786
|
-
},
|
|
787
|
-
disableSelectAll: false,
|
|
788
|
-
disableSave: false,
|
|
789
|
-
monitorDevTools: false
|
|
790
|
-
};
|
|
791
|
-
var defaultAudioContentProtectionConfig = {
|
|
792
|
-
protectCopy: false,
|
|
793
|
-
disableContextMenu: false,
|
|
794
|
-
disableDragAndDrop: false,
|
|
795
|
-
protectPrinting: {
|
|
796
|
-
disable: false,
|
|
797
|
-
watermark: "reader.app.printingDisabled"
|
|
798
|
-
},
|
|
799
|
-
disableSelectAll: false,
|
|
800
|
-
disableSave: false,
|
|
801
|
-
monitorDevTools: false,
|
|
802
|
-
disableRemotePlayback: false
|
|
803
|
-
};
|
|
804
|
-
var devContentProtectionConfig = {
|
|
805
|
-
protectCopy: false,
|
|
806
|
-
disableContextMenu: false,
|
|
807
|
-
disableDragAndDrop: false,
|
|
808
|
-
protectPrinting: {
|
|
809
|
-
disable: false
|
|
810
|
-
},
|
|
811
|
-
disableSelectAll: false,
|
|
812
|
-
disableSave: false,
|
|
813
|
-
monitorDevTools: false,
|
|
814
|
-
disableRemotePlayback: false
|
|
815
|
-
};
|
|
816
|
-
var ThThemeKeys = /* @__PURE__ */ ((ThThemeKeys3) => {
|
|
817
|
-
ThThemeKeys3["light"] = "light";
|
|
818
|
-
ThThemeKeys3["sepia"] = "sepia";
|
|
819
|
-
ThThemeKeys3["dark"] = "dark";
|
|
820
|
-
ThThemeKeys3["paper"] = "paper";
|
|
821
|
-
ThThemeKeys3["contrast1"] = "contrast1";
|
|
822
|
-
ThThemeKeys3["contrast2"] = "contrast2";
|
|
823
|
-
ThThemeKeys3["contrast3"] = "contrast3";
|
|
824
|
-
return ThThemeKeys3;
|
|
825
|
-
})(ThThemeKeys || {});
|
|
826
|
-
var lightTheme = {
|
|
827
|
-
background: ReadiumCSSColors.RS__backgroundColor,
|
|
828
|
-
// Color of background
|
|
829
|
-
text: ReadiumCSSColors.RS__textColor,
|
|
830
|
-
// Color of text
|
|
831
|
-
link: "#0000ee",
|
|
832
|
-
// Color of links
|
|
833
|
-
visited: "#551a8b",
|
|
834
|
-
// Color of visited links
|
|
835
|
-
subdue: "#808080",
|
|
836
|
-
// Color of subdued elements
|
|
837
|
-
disable: "#808080",
|
|
838
|
-
// color for :disabled
|
|
839
|
-
hover: "#d9d9d9",
|
|
840
|
-
// color of background for :hover
|
|
841
|
-
onHover: ReadiumCSSColors.RS__textColor,
|
|
842
|
-
// color of text for :hover
|
|
843
|
-
select: "#b4d8fe",
|
|
844
|
-
// color of selected background
|
|
845
|
-
onSelect: "inherit",
|
|
846
|
-
// color of selected text
|
|
847
|
-
focus: "#0067f4",
|
|
848
|
-
// color of :focus-visible
|
|
849
|
-
elevate: "0px 0px 2px #808080",
|
|
850
|
-
// drop shadow of containers
|
|
851
|
-
immerse: "0.6"
|
|
852
|
-
// opacity of immersive mode
|
|
853
|
-
};
|
|
854
|
-
var darkTheme = {
|
|
855
|
-
background: "#000000",
|
|
856
|
-
text: "#FEFEFE",
|
|
857
|
-
link: "#63caff",
|
|
858
|
-
visited: "#0099E5",
|
|
859
|
-
subdue: "#808080",
|
|
860
|
-
disable: "#808080",
|
|
861
|
-
hover: "#404040",
|
|
862
|
-
onHover: "#FEFEFE",
|
|
863
|
-
select: "#b4d8fe",
|
|
864
|
-
onSelect: "inherit",
|
|
865
|
-
focus: "#0067f4",
|
|
866
|
-
elevate: "0px 0px 2px #808080",
|
|
867
|
-
immerse: "0.4"
|
|
868
|
-
};
|
|
869
|
-
var paperTheme = {
|
|
870
|
-
background: "#faf4e8",
|
|
871
|
-
text: "#121212",
|
|
872
|
-
link: "#0000EE",
|
|
873
|
-
visited: "#551A8B",
|
|
874
|
-
subdue: "#8c8c8c",
|
|
875
|
-
disable: "#8c8c8c",
|
|
876
|
-
hover: "#edd7ab",
|
|
877
|
-
onHover: "#121212",
|
|
878
|
-
select: "#b4d8fe",
|
|
879
|
-
onSelect: "inherit",
|
|
880
|
-
focus: "#0067f4",
|
|
881
|
-
elevate: "0px 0px 2px #8c8c8c",
|
|
882
|
-
immerse: "0.5"
|
|
883
|
-
};
|
|
884
|
-
var sepiaTheme = {
|
|
885
|
-
background: "#e9ddc8",
|
|
886
|
-
text: "#000000",
|
|
887
|
-
link: "#0000EE",
|
|
888
|
-
visited: "#551A8B",
|
|
889
|
-
subdue: "#8c8c8c",
|
|
890
|
-
disable: "#8c8c8c",
|
|
891
|
-
hover: "#ccb07f",
|
|
892
|
-
onHover: "#000000",
|
|
893
|
-
select: "#b4d8fe",
|
|
894
|
-
onSelect: "inherit",
|
|
895
|
-
focus: "#004099",
|
|
896
|
-
elevate: "0px 0px 2px #8c8c8c",
|
|
897
|
-
immerse: "0.45"
|
|
898
|
-
};
|
|
899
|
-
var contrast1Theme = {
|
|
900
|
-
background: "#000000",
|
|
901
|
-
text: "#ffff00",
|
|
902
|
-
link: "#63caff",
|
|
903
|
-
visited: "#0099E5",
|
|
904
|
-
subdue: "#808000",
|
|
905
|
-
disable: "#808000",
|
|
906
|
-
hover: "#404040",
|
|
907
|
-
onHover: "#ffff00",
|
|
908
|
-
select: "#b4d8fe",
|
|
909
|
-
onSelect: "inherit",
|
|
910
|
-
focus: "#0067f4",
|
|
911
|
-
elevate: "0px 0px 2px #808000",
|
|
912
|
-
immerse: "0.4"
|
|
913
|
-
};
|
|
914
|
-
var contrast2Theme = {
|
|
915
|
-
background: "#181842",
|
|
916
|
-
text: "#ffffff",
|
|
917
|
-
link: "#adcfff",
|
|
918
|
-
visited: "#7ab2ff",
|
|
919
|
-
subdue: "#808080",
|
|
920
|
-
disable: "#808080",
|
|
921
|
-
hover: "#4444bb",
|
|
922
|
-
onHover: "#ffffff",
|
|
923
|
-
select: "#b4d8fe",
|
|
924
|
-
onSelect: "inherit",
|
|
925
|
-
focus: "#6BA9FF",
|
|
926
|
-
elevate: "0px 0px 2px #808080",
|
|
927
|
-
immerse: "0.4"
|
|
928
|
-
};
|
|
929
|
-
var contrast3Theme = {
|
|
930
|
-
background: "#c5e7cd",
|
|
931
|
-
text: "#000000",
|
|
932
|
-
link: "#0000EE",
|
|
933
|
-
visited: "#551A8B",
|
|
934
|
-
subdue: "#8c8c8c",
|
|
935
|
-
disable: "#8c8c8c",
|
|
936
|
-
hover: "#6fc383",
|
|
937
|
-
onHover: "#000000",
|
|
938
|
-
select: "#b4d8fe",
|
|
939
|
-
onSelect: "inherit",
|
|
940
|
-
focus: "#004099",
|
|
941
|
-
elevate: "0px 0px 2px #8c8c8c",
|
|
942
|
-
immerse: "0.45"
|
|
943
|
-
};
|
|
944
|
-
|
|
945
|
-
// src/preferences/audioPreferences.ts
|
|
946
|
-
var ThAudioAffordance = /* @__PURE__ */ ((ThAudioAffordance2) => {
|
|
947
|
-
ThAudioAffordance2["timeline"] = "timeline";
|
|
948
|
-
ThAudioAffordance2["readingOrder"] = "readingOrder";
|
|
949
|
-
ThAudioAffordance2["toc"] = "toc";
|
|
950
|
-
return ThAudioAffordance2;
|
|
951
|
-
})(ThAudioAffordance || {});
|
|
952
|
-
var validateRangePresets = (pref, context) => {
|
|
953
|
-
if (pref.variant !== "sliderWithPresets" /* sliderWithPresets */ || !pref.presets?.length) return;
|
|
954
|
-
const [min, max] = [Math.min(...pref.range), Math.max(...pref.range)];
|
|
955
|
-
const step = pref.step;
|
|
956
|
-
const tolerance = step * 1e-9;
|
|
957
|
-
const invalid = pref.presets.filter((p) => {
|
|
958
|
-
if (p < min || p > max) return true;
|
|
959
|
-
const offset = (p - min) / step;
|
|
960
|
-
return Math.abs(offset - Math.round(offset)) > tolerance;
|
|
961
|
-
});
|
|
962
|
-
if (invalid.length > 0) {
|
|
963
|
-
console.warn(
|
|
964
|
-
`${context}: presets [${invalid.join(", ")}] are not reachable with range=[${min}, ${max}] and step=${step}.`
|
|
965
|
-
);
|
|
966
|
-
}
|
|
967
|
-
};
|
|
968
|
-
var createAudioPreferences = (params) => {
|
|
969
|
-
if (params.actions?.secondary) {
|
|
970
|
-
validateObjectKeys(
|
|
971
|
-
[params.actions.secondary.displayOrder],
|
|
972
|
-
params.actions.secondary.keys,
|
|
973
|
-
"actions.secondary"
|
|
974
|
-
);
|
|
975
|
-
}
|
|
976
|
-
if (params.settings?.order) {
|
|
977
|
-
const order = params.settings.order;
|
|
978
|
-
const hasSkipInterval = order.includes("skipInterval" /* skipInterval */);
|
|
979
|
-
const hasSplitIntervals = order.includes("skipBackwardInterval" /* skipBackwardInterval */) || order.includes("skipForwardInterval" /* skipForwardInterval */);
|
|
980
|
-
if (hasSkipInterval && hasSplitIntervals) {
|
|
981
|
-
console.warn(
|
|
982
|
-
`settings.order contains both "${"skipInterval" /* skipInterval */}" and split interval keys. Use one or the other.`
|
|
983
|
-
);
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
if (params.theming?.themes) {
|
|
987
|
-
validateObjectKeys(
|
|
988
|
-
[params.theming.themes.audioOrder],
|
|
989
|
-
params.theming.themes.keys,
|
|
990
|
-
"theming.themes",
|
|
991
|
-
"auto"
|
|
992
|
-
);
|
|
993
|
-
}
|
|
994
|
-
if (params.theming?.layout?.publicationMetadata?.order) {
|
|
995
|
-
const order = params.theming.layout.publicationMetadata.order;
|
|
996
|
-
const titleVariants = [
|
|
997
|
-
"title" /* title */,
|
|
998
|
-
"titleWithSubtitle" /* titleWithSubtitle */,
|
|
999
|
-
"subtitleWithTitle" /* subtitleWithTitle */
|
|
1000
|
-
];
|
|
1001
|
-
const titleVariantsInOrder = order.filter((c) => titleVariants.includes(c));
|
|
1002
|
-
if (titleVariantsInOrder.length > 1) {
|
|
1003
|
-
console.warn(
|
|
1004
|
-
`publicationMetadata.order contains multiple title variants [${titleVariantsInOrder.join(", ")}]. Using first one only.`
|
|
1005
|
-
);
|
|
1006
|
-
const firstTitleIndex = order.findIndex((c) => titleVariants.includes(c));
|
|
1007
|
-
params.theming.layout.publicationMetadata.order = order.filter((component, index) => {
|
|
1008
|
-
if (component === "authors" /* authors */) return true;
|
|
1009
|
-
return index === firstTitleIndex;
|
|
1010
|
-
});
|
|
1011
|
-
}
|
|
1012
|
-
}
|
|
1013
|
-
Object.entries(params.settings?.keys ?? {}).forEach(([key, pref]) => {
|
|
1014
|
-
if (pref && typeof pref === "object" && "variant" in pref) {
|
|
1015
|
-
validateRangePresets(pref, `settings.keys.${key}`);
|
|
1016
|
-
}
|
|
1017
|
-
});
|
|
1018
|
-
return params;
|
|
1019
|
-
};
|
|
1020
|
-
|
|
1021
|
-
// src/preferences/defaultAudioPreferences.ts
|
|
1022
|
-
var defaultAudioPreferences = createAudioPreferences({
|
|
1023
|
-
theming: {
|
|
1024
|
-
header: {
|
|
1025
|
-
backLink: {
|
|
1026
|
-
variant: "arrow" /* arrow */,
|
|
1027
|
-
visibility: "partially",
|
|
1028
|
-
href: "/"
|
|
1029
|
-
}
|
|
1030
|
-
},
|
|
1031
|
-
icon: {
|
|
1032
|
-
size: 24,
|
|
1033
|
-
tooltipOffset: 10
|
|
1034
|
-
},
|
|
1035
|
-
layout: {
|
|
1036
|
-
compact: {
|
|
1037
|
-
order: [
|
|
1038
|
-
"cover" /* cover */,
|
|
1039
|
-
"metadata" /* metadata */,
|
|
1040
|
-
"playbackControls" /* playbackControls */,
|
|
1041
|
-
"progressBar" /* progressBar */,
|
|
1042
|
-
"mediaActions" /* mediaActions */
|
|
1043
|
-
]
|
|
1044
|
-
},
|
|
1045
|
-
expanded: {
|
|
1046
|
-
start: [
|
|
1047
|
-
"cover" /* cover */,
|
|
1048
|
-
"metadata" /* metadata */
|
|
1049
|
-
],
|
|
1050
|
-
end: [
|
|
1051
|
-
"playbackControls" /* playbackControls */,
|
|
1052
|
-
"progressBar" /* progressBar */,
|
|
1053
|
-
"mediaActions" /* mediaActions */
|
|
1054
|
-
]
|
|
1055
|
-
},
|
|
1056
|
-
publicationMetadata: {
|
|
1057
|
-
order: [
|
|
1058
|
-
"titleWithSubtitle" /* titleWithSubtitle */
|
|
1059
|
-
]
|
|
1060
|
-
},
|
|
1061
|
-
radius: 5,
|
|
1062
|
-
spacing: 20,
|
|
1063
|
-
progressBar: {
|
|
1064
|
-
variant: "segmented" /* segmented */
|
|
1065
|
-
},
|
|
1066
|
-
defaults: {
|
|
1067
|
-
dockingWidth: 340,
|
|
1068
|
-
scrim: "rgba(0, 0, 0, 0.2)"
|
|
1069
|
-
},
|
|
1070
|
-
constraints: {
|
|
1071
|
-
["bottomSheet" /* bottomSheet */]: 600,
|
|
1072
|
-
["popover" /* popover */]: 600,
|
|
1073
|
-
["modal" /* modal */]: 600,
|
|
1074
|
-
cover: 300
|
|
1075
|
-
}
|
|
1076
|
-
},
|
|
1077
|
-
breakpoints: {
|
|
1078
|
-
["compact" /* compact */]: 600,
|
|
1079
|
-
["medium" /* medium */]: 840,
|
|
1080
|
-
["expanded" /* expanded */]: 1200,
|
|
1081
|
-
["large" /* large */]: 1600,
|
|
1082
|
-
["xLarge" /* xLarge */]: null
|
|
1083
|
-
},
|
|
1084
|
-
themes: {
|
|
1085
|
-
audioOrder: [
|
|
1086
|
-
"auto",
|
|
1087
|
-
"light" /* light */,
|
|
1088
|
-
"dark" /* dark */
|
|
1089
|
-
],
|
|
1090
|
-
systemThemes: {
|
|
1091
|
-
light: "light" /* light */,
|
|
1092
|
-
dark: "dark" /* dark */
|
|
1093
|
-
},
|
|
1094
|
-
keys: {
|
|
1095
|
-
["light" /* light */]: lightTheme,
|
|
1096
|
-
["dark" /* dark */]: darkTheme
|
|
1097
|
-
}
|
|
1098
|
-
}
|
|
1099
|
-
},
|
|
1100
|
-
actions: {
|
|
1101
|
-
primary: {
|
|
1102
|
-
displayOrder: [
|
|
1103
|
-
"audio.volume" /* volume */,
|
|
1104
|
-
"audio.playbackRate" /* playbackRate */,
|
|
1105
|
-
"audio.toc" /* toc */,
|
|
1106
|
-
"audio.sleepTimer" /* sleepTimer */
|
|
1107
|
-
],
|
|
1108
|
-
keys: {
|
|
1109
|
-
["audio.volume" /* volume */]: defaultAudioVolumeAction,
|
|
1110
|
-
["audio.playbackRate" /* playbackRate */]: defaultAudioPlaybackRateAction,
|
|
1111
|
-
["audio.toc" /* toc */]: defaultAudioTocAction,
|
|
1112
|
-
["audio.sleepTimer" /* sleepTimer */]: defaultAudioSleepTimerAction
|
|
1113
|
-
}
|
|
1114
|
-
},
|
|
1115
|
-
secondary: {
|
|
1116
|
-
displayOrder: [
|
|
1117
|
-
"audio.remotePlayback" /* remotePlayback */,
|
|
1118
|
-
"settings" /* settings */
|
|
1119
|
-
],
|
|
1120
|
-
collapse: {
|
|
1121
|
-
["compact" /* compact */]: 2,
|
|
1122
|
-
["medium" /* medium */]: 3
|
|
1123
|
-
},
|
|
1124
|
-
keys: {
|
|
1125
|
-
["audio.remotePlayback" /* remotePlayback */]: defaultAudioRemotePlaybackAction,
|
|
1126
|
-
["settings" /* settings */]: defaultSettingsAction
|
|
1127
|
-
}
|
|
1128
|
-
}
|
|
1129
|
-
},
|
|
1130
|
-
settings: {
|
|
1131
|
-
order: [
|
|
1132
|
-
"theme" /* theme */,
|
|
1133
|
-
"skipBackwardInterval" /* skipBackwardInterval */,
|
|
1134
|
-
"skipForwardInterval" /* skipForwardInterval */,
|
|
1135
|
-
"autoPlay" /* autoPlay */
|
|
1136
|
-
],
|
|
1137
|
-
keys: {
|
|
1138
|
-
["volume" /* volume */]: defaultAudioVolume,
|
|
1139
|
-
["playbackRate" /* playbackRate */]: defaultAudioPlaybackRate,
|
|
1140
|
-
["skipBackwardInterval" /* skipBackwardInterval */]: defaultAudioSkipBackwardInterval,
|
|
1141
|
-
["skipForwardInterval" /* skipForwardInterval */]: defaultAudioSkipForwardInterval,
|
|
1142
|
-
["sleepTimer" /* sleepTimer */]: defaultAudioSleepTimer
|
|
1143
|
-
}
|
|
1144
|
-
},
|
|
1145
|
-
contentProtection: defaultAudioContentProtectionConfig,
|
|
1146
|
-
affordances: {
|
|
1147
|
-
previous: "toc" /* toc */,
|
|
1148
|
-
next: "toc" /* toc */
|
|
1149
|
-
},
|
|
1150
|
-
shortcuts: {
|
|
1151
|
-
representation: "symbol" /* symbol */,
|
|
1152
|
-
joiner: "+"
|
|
1153
|
-
},
|
|
1154
|
-
docking: {
|
|
1155
|
-
displayOrder: [
|
|
1156
|
-
"dockingTransient" /* transient */,
|
|
1157
|
-
"dockingStart" /* start */,
|
|
1158
|
-
"dockingEnd" /* end */
|
|
1159
|
-
],
|
|
1160
|
-
// Only toc is dockable; others have dockable:none so dock panels are TOC-only
|
|
1161
|
-
dock: {},
|
|
1162
|
-
collapse: true,
|
|
1163
|
-
keys: {
|
|
1164
|
-
["dockingStart" /* start */]: { visibility: "overflow" /* overflow */, shortcut: null },
|
|
1165
|
-
["dockingEnd" /* end */]: { visibility: "overflow" /* overflow */, shortcut: null },
|
|
1166
|
-
["dockingTransient" /* transient */]: { visibility: "overflow" /* overflow */, shortcut: null }
|
|
1167
|
-
}
|
|
1168
|
-
}
|
|
1169
|
-
});
|
|
1170
|
-
var ThAudioPreferencesContext = createContext(null);
|
|
1171
|
-
var defaultAudioPreferencesContextValue = {
|
|
1172
|
-
preferences: defaultAudioPreferences,
|
|
1173
|
-
updatePreferences: () => {
|
|
1174
|
-
throw new Error("updatePreferences must be used within a ThAudioPreferencesProvider");
|
|
1175
|
-
}
|
|
1176
|
-
};
|
|
1177
|
-
|
|
1178
|
-
// src/preferences/preferences.ts
|
|
1179
|
-
var createPreferences = (params) => {
|
|
1180
|
-
if (params.locale) {
|
|
1181
|
-
const languageCode = params.locale.split("-")[0];
|
|
1182
|
-
if (!isSupportedLocale(languageCode)) {
|
|
1183
|
-
console.warn(`Locale "${params.locale}" is not supported. Supported locales: ${supportedLocales.join(", ")}. Falling back to browser/OS language settings.`);
|
|
1184
|
-
params.locale = void 0;
|
|
1185
|
-
}
|
|
1186
|
-
}
|
|
1187
|
-
if (params.actions) {
|
|
1188
|
-
validateObjectKeys(
|
|
1189
|
-
[
|
|
1190
|
-
params.actions.reflowOrder,
|
|
1191
|
-
params.actions.fxlOrder,
|
|
1192
|
-
params.actions.webPubOrder
|
|
1193
|
-
],
|
|
1194
|
-
params.actions.keys,
|
|
1195
|
-
"actions"
|
|
1196
|
-
);
|
|
1197
|
-
}
|
|
1198
|
-
if (params.theming?.themes) {
|
|
1199
|
-
validateObjectKeys(
|
|
1200
|
-
[params.theming.themes.reflowOrder, params.theming.themes.fxlOrder],
|
|
1201
|
-
params.theming.themes.keys,
|
|
1202
|
-
"theming.themes",
|
|
1203
|
-
"auto"
|
|
1204
|
-
// Special case for themes
|
|
1205
|
-
);
|
|
1206
|
-
}
|
|
1207
|
-
if (params.settings.spacing?.presets) {
|
|
1208
|
-
validateObjectKeys(
|
|
1209
|
-
[params.settings.spacing.presets.reflowOrder],
|
|
1210
|
-
params.settings.spacing.presets.keys,
|
|
1211
|
-
"settings.spacing.presets",
|
|
1212
|
-
["publisher", "custom"]
|
|
1213
|
-
);
|
|
1214
|
-
}
|
|
1215
|
-
if (params.settings?.spacing?.presets?.keys && params.settings?.keys) {
|
|
1216
|
-
const spacingSettings = params.settings.spacing.presets.keys;
|
|
1217
|
-
const spacingThemes = params.settings.spacing.presets.keys;
|
|
1218
|
-
const adjustSpacingValue = (key, value, context) => {
|
|
1219
|
-
const settingKey = Object.values(ThSettingsKeys).find((k) => k === key);
|
|
1220
|
-
if (!settingKey) {
|
|
1221
|
-
return value;
|
|
1222
|
-
}
|
|
1223
|
-
const setting = spacingSettings[settingKey];
|
|
1224
|
-
if (!setting) {
|
|
1225
|
-
return value;
|
|
1226
|
-
}
|
|
1227
|
-
let range;
|
|
1228
|
-
let step;
|
|
1229
|
-
if (setting && typeof setting === "object" && "range" in setting) {
|
|
1230
|
-
range = setting.range;
|
|
1231
|
-
step = setting.step;
|
|
1232
|
-
} else if (setting && typeof setting === "object") {
|
|
1233
|
-
return value;
|
|
1234
|
-
}
|
|
1235
|
-
let adjustedValue = value;
|
|
1236
|
-
if (range) {
|
|
1237
|
-
const [min, max] = range;
|
|
1238
|
-
if (adjustedValue < min) {
|
|
1239
|
-
console.warn(`Adjusting value ${value} for ${context.join(".")} to minimum allowed value ${min}`);
|
|
1240
|
-
adjustedValue = min;
|
|
1241
|
-
} else if (adjustedValue > max) {
|
|
1242
|
-
console.warn(`Adjusting value ${value} for ${context.join(".")} to maximum allowed value ${max}`);
|
|
1243
|
-
adjustedValue = max;
|
|
1244
|
-
}
|
|
1245
|
-
}
|
|
1246
|
-
if (step && range) {
|
|
1247
|
-
const [min] = range;
|
|
1248
|
-
const steps = Math.round((adjustedValue - min) / step);
|
|
1249
|
-
const steppedValue = parseFloat((min + steps * step).toFixed(10));
|
|
1250
|
-
const finalValue = Math.min(Math.max(steppedValue, range[0]), range[1]);
|
|
1251
|
-
if (Math.abs(finalValue - adjustedValue) > Number.EPSILON) {
|
|
1252
|
-
console.warn(`Adjusting value ${value} for ${context.join(".")} to nearest step value ${finalValue}`);
|
|
1253
|
-
adjustedValue = finalValue;
|
|
1254
|
-
}
|
|
1255
|
-
}
|
|
1256
|
-
return adjustedValue;
|
|
1257
|
-
};
|
|
1258
|
-
for (const [themeName, spacingTheme] of Object.entries(spacingThemes)) {
|
|
1259
|
-
if (spacingTheme && typeof spacingTheme === "object") {
|
|
1260
|
-
const adjustedTheme = {};
|
|
1261
|
-
let hasAdjustedValues = false;
|
|
1262
|
-
for (const [key, value] of Object.entries(spacingTheme)) {
|
|
1263
|
-
if (typeof value === "number") {
|
|
1264
|
-
const context = ["theming", "spacing", "keys", themeName, key];
|
|
1265
|
-
const adjustedValue = adjustSpacingValue(key, value, context);
|
|
1266
|
-
adjustedTheme[key] = adjustedValue;
|
|
1267
|
-
if (adjustedValue !== value) {
|
|
1268
|
-
hasAdjustedValues = true;
|
|
1269
|
-
}
|
|
1270
|
-
} else {
|
|
1271
|
-
adjustedTheme[key] = value;
|
|
1272
|
-
}
|
|
1273
|
-
}
|
|
1274
|
-
if (hasAdjustedValues) {
|
|
1275
|
-
spacingThemes[themeName] = adjustedTheme;
|
|
1276
|
-
}
|
|
1277
|
-
}
|
|
1278
|
-
}
|
|
1279
|
-
}
|
|
1280
|
-
if (params.settings?.keys?.fontFamily) {
|
|
1281
|
-
const fontFamilyPref = params.settings.keys.fontFamily;
|
|
1282
|
-
const languageMap = /* @__PURE__ */ new Map();
|
|
1283
|
-
Object.entries(fontFamilyPref).forEach(([collectionName, collectionData]) => {
|
|
1284
|
-
if (collectionName === "default") return;
|
|
1285
|
-
const supportedLangs = "supportedLanguages" in collectionData ? collectionData.supportedLanguages : null;
|
|
1286
|
-
if (supportedLangs && Array.isArray(supportedLangs)) {
|
|
1287
|
-
supportedLangs.forEach((lang) => {
|
|
1288
|
-
if (!languageMap.has(lang)) {
|
|
1289
|
-
languageMap.set(lang, []);
|
|
1290
|
-
}
|
|
1291
|
-
languageMap.get(lang).push(collectionName);
|
|
1292
|
-
});
|
|
1293
|
-
}
|
|
1294
|
-
});
|
|
1295
|
-
languageMap.forEach((collections, language) => {
|
|
1296
|
-
if (collections.length > 1) {
|
|
1297
|
-
console.warn(`Language "${language}" is supported by multiple font collections: ${collections.join(", ")}. This may cause ambiguous font selection. Consider consolidating to a single collection per language.`);
|
|
1298
|
-
}
|
|
1299
|
-
});
|
|
1300
|
-
}
|
|
1301
|
-
const validateRangePresets2 = (pref, context) => {
|
|
1302
|
-
if (pref.variant !== "sliderWithPresets" /* sliderWithPresets */ || !pref.presets?.length) return;
|
|
1303
|
-
const [min, max] = [Math.min(...pref.range), Math.max(...pref.range)];
|
|
1304
|
-
const step = pref.step;
|
|
1305
|
-
const tolerance = step * 1e-9;
|
|
1306
|
-
const invalid = pref.presets.filter((p) => {
|
|
1307
|
-
if (p < min || p > max) return true;
|
|
1308
|
-
const offset = (p - min) / step;
|
|
1309
|
-
return Math.abs(offset - Math.round(offset)) > tolerance;
|
|
1310
|
-
});
|
|
1311
|
-
if (invalid.length > 0) {
|
|
1312
|
-
console.warn(`${context}: presets [${invalid.join(", ")}] are not reachable with range=[${min}, ${max}] and step=${step}.`);
|
|
1313
|
-
}
|
|
1314
|
-
};
|
|
1315
|
-
Object.entries(params.settings?.keys ?? {}).forEach(([key, pref]) => {
|
|
1316
|
-
if (pref && typeof pref === "object" && "variant" in pref) {
|
|
1317
|
-
validateRangePresets2(pref, `settings.keys.${key}`);
|
|
1318
|
-
}
|
|
1319
|
-
});
|
|
1320
|
-
return params;
|
|
1321
|
-
};
|
|
1322
|
-
|
|
1323
|
-
// src/preferences/defaultPreferences.ts
|
|
1324
|
-
var defaultPreferences = createPreferences({
|
|
1325
|
-
// direction: ThLayoutDirection.ltr,
|
|
1326
|
-
// locale: "en",
|
|
1327
|
-
experiments: {
|
|
1328
|
-
reflow: ["experimentalHeaderFiltering", "experimentalZoom"],
|
|
1329
|
-
webPub: ["experimentalHeaderFiltering", "experimentalZoom"]
|
|
1330
|
-
},
|
|
1331
|
-
metadata: {
|
|
1332
|
-
documentTitle: {
|
|
1333
|
-
format: "title" /* title */
|
|
1334
|
-
}
|
|
1335
|
-
},
|
|
1336
|
-
typography: {
|
|
1337
|
-
minimalLineLength: 40,
|
|
1338
|
-
// undefined | null | number of characters. If 2 cols will switch to 1 based on this
|
|
1339
|
-
optimalLineLength: 55,
|
|
1340
|
-
// number of characters. If auto layout, picks colCount based on this
|
|
1341
|
-
maximalLineLength: 70,
|
|
1342
|
-
// undefined | null | number of characters.
|
|
1343
|
-
pageGutter: 20
|
|
1344
|
-
},
|
|
1345
|
-
theming: {
|
|
1346
|
-
header: {
|
|
1347
|
-
backLink: {
|
|
1348
|
-
variant: "arrow" /* arrow */,
|
|
1349
|
-
visibility: "partially",
|
|
1350
|
-
href: "/"
|
|
1351
|
-
},
|
|
1352
|
-
runningHead: {
|
|
1353
|
-
format: {
|
|
1354
|
-
reflow: {
|
|
1355
|
-
default: {
|
|
1356
|
-
variants: "chapter" /* chapter */,
|
|
1357
|
-
displayInImmersive: true,
|
|
1358
|
-
displayInFullscreen: false
|
|
1359
|
-
},
|
|
1360
|
-
breakpoints: {
|
|
1361
|
-
["compact" /* compact */]: {
|
|
1362
|
-
variants: "chapter" /* chapter */,
|
|
1363
|
-
displayInImmersive: false,
|
|
1364
|
-
displayInFullscreen: false
|
|
1365
|
-
}
|
|
1366
|
-
}
|
|
1367
|
-
},
|
|
1368
|
-
fxl: {
|
|
1369
|
-
default: {
|
|
1370
|
-
variants: "title" /* title */,
|
|
1371
|
-
displayInImmersive: true,
|
|
1372
|
-
displayInFullscreen: true
|
|
1373
|
-
},
|
|
1374
|
-
breakpoints: {
|
|
1375
|
-
["compact" /* compact */]: {
|
|
1376
|
-
variants: "title" /* title */,
|
|
1377
|
-
displayInImmersive: false,
|
|
1378
|
-
displayInFullscreen: true
|
|
1379
|
-
}
|
|
1380
|
-
}
|
|
1381
|
-
},
|
|
1382
|
-
webPub: {
|
|
1383
|
-
default: {
|
|
1384
|
-
variants: "chapter" /* chapter */,
|
|
1385
|
-
displayInImmersive: true,
|
|
1386
|
-
displayInFullscreen: true
|
|
1387
|
-
}
|
|
1388
|
-
}
|
|
1389
|
-
}
|
|
1390
|
-
}
|
|
1391
|
-
},
|
|
1392
|
-
progression: {
|
|
1393
|
-
format: {
|
|
1394
|
-
reflow: {
|
|
1395
|
-
default: {
|
|
1396
|
-
variants: [
|
|
1397
|
-
"positionsPercentOfTotal" /* positionsPercentOfTotal */,
|
|
1398
|
-
"progressionOfResource" /* progressionOfResource */
|
|
1399
|
-
],
|
|
1400
|
-
displayInImmersive: true,
|
|
1401
|
-
displayInFullscreen: false
|
|
1402
|
-
},
|
|
1403
|
-
breakpoints: {
|
|
1404
|
-
["compact" /* compact */]: {
|
|
1405
|
-
variants: [
|
|
1406
|
-
"positionsOfTotal" /* positionsOfTotal */,
|
|
1407
|
-
"resourceProgression" /* resourceProgression */
|
|
1408
|
-
],
|
|
1409
|
-
displayInImmersive: false,
|
|
1410
|
-
displayInFullscreen: false
|
|
1411
|
-
}
|
|
1412
|
-
}
|
|
1413
|
-
},
|
|
1414
|
-
fxl: {
|
|
1415
|
-
default: {
|
|
1416
|
-
variants: [
|
|
1417
|
-
"positionsOfTotal" /* positionsOfTotal */,
|
|
1418
|
-
"overallProgression" /* overallProgression */,
|
|
1419
|
-
"none" /* none */
|
|
1420
|
-
],
|
|
1421
|
-
displayInImmersive: true,
|
|
1422
|
-
displayInFullscreen: true
|
|
1423
|
-
},
|
|
1424
|
-
breakpoints: {
|
|
1425
|
-
["compact" /* compact */]: {
|
|
1426
|
-
variants: [
|
|
1427
|
-
"positions" /* positions */,
|
|
1428
|
-
"overallProgression" /* overallProgression */,
|
|
1429
|
-
"none" /* none */
|
|
1430
|
-
],
|
|
1431
|
-
displayInImmersive: false,
|
|
1432
|
-
displayInFullscreen: true
|
|
1433
|
-
}
|
|
1434
|
-
}
|
|
1435
|
-
},
|
|
1436
|
-
webPub: {
|
|
1437
|
-
default: {
|
|
1438
|
-
variants: [
|
|
1439
|
-
"readingOrderIndex" /* readingOrderIndex */,
|
|
1440
|
-
"none" /* none */
|
|
1441
|
-
],
|
|
1442
|
-
displayInImmersive: true,
|
|
1443
|
-
displayInFullscreen: true
|
|
1444
|
-
}
|
|
1445
|
-
}
|
|
1446
|
-
}
|
|
1447
|
-
},
|
|
1448
|
-
arrow: {
|
|
1449
|
-
size: 40,
|
|
1450
|
-
// Size of the left and right arrows in px
|
|
1451
|
-
offset: 5
|
|
1452
|
-
// offset of the arrows from the edges in px
|
|
1453
|
-
},
|
|
1454
|
-
icon: {
|
|
1455
|
-
size: 24,
|
|
1456
|
-
// Size of icons in px
|
|
1457
|
-
tooltipOffset: 10
|
|
1458
|
-
// offset of tooltip in px
|
|
1459
|
-
},
|
|
1460
|
-
layout: {
|
|
1461
|
-
ui: {
|
|
1462
|
-
reflow: "layered-ui" /* layered */,
|
|
1463
|
-
fxl: "layered-ui" /* layered */,
|
|
1464
|
-
webPub: "stacked-ui" /* stacked */
|
|
1465
|
-
},
|
|
1466
|
-
radius: 5,
|
|
1467
|
-
// border-radius of containers
|
|
1468
|
-
spacing: 20,
|
|
1469
|
-
// padding of containers/sheets
|
|
1470
|
-
defaults: {
|
|
1471
|
-
dockingWidth: 340,
|
|
1472
|
-
// default width of resizable panels
|
|
1473
|
-
scrim: "rgba(0, 0, 0, 0.2)"
|
|
1474
|
-
// default scrim/underlay bg-color
|
|
1475
|
-
},
|
|
1476
|
-
constraints: {
|
|
1477
|
-
["bottomSheet" /* bottomSheet */]: 600,
|
|
1478
|
-
// Max-width of all bottom sheets
|
|
1479
|
-
["popover" /* popover */]: 600,
|
|
1480
|
-
// Max-width of all popover sheets
|
|
1481
|
-
["modal" /* modal */]: 600,
|
|
1482
|
-
// Max-width of all modal sheets
|
|
1483
|
-
pagination: 1024,
|
|
1484
|
-
// Max-width of pagination component
|
|
1485
|
-
dropdown: 250
|
|
1486
|
-
// Max-height of main UI dropdowns
|
|
1487
|
-
}
|
|
1488
|
-
},
|
|
1489
|
-
breakpoints: {
|
|
1490
|
-
// See https://m3.material.io/foundations/layout/applying-layout/window-size-classes
|
|
1491
|
-
["compact" /* compact */]: 600,
|
|
1492
|
-
// Phone in portrait
|
|
1493
|
-
["medium" /* medium */]: 840,
|
|
1494
|
-
// Tablet in portrait, Foldable in portrait (unfolded)
|
|
1495
|
-
["expanded" /* expanded */]: 1200,
|
|
1496
|
-
// Phone in landscape, Tablet in landscape, Foldable in landscape (unfolded), Desktop
|
|
1497
|
-
["large" /* large */]: 1600,
|
|
1498
|
-
// Desktop
|
|
1499
|
-
["xLarge" /* xLarge */]: null
|
|
1500
|
-
// Desktop Ultra-wide
|
|
1501
|
-
},
|
|
1502
|
-
themes: {
|
|
1503
|
-
reflowOrder: [
|
|
1504
|
-
"auto",
|
|
1505
|
-
"light" /* light */,
|
|
1506
|
-
"paper" /* paper */,
|
|
1507
|
-
"sepia" /* sepia */,
|
|
1508
|
-
"dark" /* dark */,
|
|
1509
|
-
"contrast1" /* contrast1 */,
|
|
1510
|
-
"contrast2" /* contrast2 */,
|
|
1511
|
-
"contrast3" /* contrast3 */
|
|
1512
|
-
],
|
|
1513
|
-
fxlOrder: [
|
|
1514
|
-
"auto",
|
|
1515
|
-
"light" /* light */,
|
|
1516
|
-
"dark" /* dark */
|
|
1517
|
-
],
|
|
1518
|
-
systemThemes: {
|
|
1519
|
-
light: "light" /* light */,
|
|
1520
|
-
dark: "dark" /* dark */
|
|
1521
|
-
},
|
|
1522
|
-
keys: {
|
|
1523
|
-
["light" /* light */]: lightTheme,
|
|
1524
|
-
["dark" /* dark */]: darkTheme,
|
|
1525
|
-
["paper" /* paper */]: paperTheme,
|
|
1526
|
-
["sepia" /* sepia */]: sepiaTheme,
|
|
1527
|
-
["contrast1" /* contrast1 */]: contrast1Theme,
|
|
1528
|
-
["contrast2" /* contrast2 */]: contrast2Theme,
|
|
1529
|
-
["contrast3" /* contrast3 */]: contrast3Theme
|
|
1530
|
-
}
|
|
1531
|
-
}
|
|
1532
|
-
},
|
|
1533
|
-
contentProtection: defaultContentProtectionConfig,
|
|
1534
|
-
affordances: {
|
|
1535
|
-
scroll: {
|
|
1536
|
-
hintInImmersive: true,
|
|
1537
|
-
toggleOnMiddlePointer: ["tap", "click"],
|
|
1538
|
-
hideOnForwardScroll: true,
|
|
1539
|
-
showOnBackwardScroll: true
|
|
1540
|
-
},
|
|
1541
|
-
paginated: {
|
|
1542
|
-
reflow: {
|
|
1543
|
-
default: {
|
|
1544
|
-
variant: "layered" /* layered */,
|
|
1545
|
-
discard: ["navigation"],
|
|
1546
|
-
hint: ["layoutChange"]
|
|
1547
|
-
},
|
|
1548
|
-
breakpoints: {
|
|
1549
|
-
["large" /* large */]: {
|
|
1550
|
-
variant: "stacked" /* stacked */
|
|
1551
|
-
},
|
|
1552
|
-
["xLarge" /* xLarge */]: {
|
|
1553
|
-
variant: "stacked" /* stacked */
|
|
1554
|
-
}
|
|
1555
|
-
}
|
|
1556
|
-
},
|
|
1557
|
-
fxl: {
|
|
1558
|
-
// Note FXL arrows are always layered
|
|
1559
|
-
// FXL navigator is using the window width to calculate the layout
|
|
1560
|
-
// so we need to force the layered variant to prevent layout issues
|
|
1561
|
-
default: {
|
|
1562
|
-
variant: "layered" /* layered */,
|
|
1563
|
-
discard: ["navigation"],
|
|
1564
|
-
hint: "none"
|
|
1565
|
-
}
|
|
1566
|
-
}
|
|
1567
|
-
}
|
|
1568
|
-
},
|
|
1569
|
-
shortcuts: {
|
|
1570
|
-
representation: "symbol" /* symbol */,
|
|
1571
|
-
joiner: "+"
|
|
1572
|
-
},
|
|
1573
|
-
actions: {
|
|
1574
|
-
reflowOrder: [
|
|
1575
|
-
"settings" /* settings */,
|
|
1576
|
-
"toc" /* toc */,
|
|
1577
|
-
"fullscreen" /* fullscreen */,
|
|
1578
|
-
"jumpToPosition" /* jumpToPosition */
|
|
1579
|
-
],
|
|
1580
|
-
fxlOrder: [
|
|
1581
|
-
"settings" /* settings */,
|
|
1582
|
-
"toc" /* toc */,
|
|
1583
|
-
"fullscreen" /* fullscreen */,
|
|
1584
|
-
"jumpToPosition" /* jumpToPosition */
|
|
1585
|
-
],
|
|
1586
|
-
webPubOrder: [
|
|
1587
|
-
"settings" /* settings */,
|
|
1588
|
-
"toc" /* toc */,
|
|
1589
|
-
"fullscreen" /* fullscreen */
|
|
1590
|
-
],
|
|
1591
|
-
collapse: {
|
|
1592
|
-
// Number of partially icons to display
|
|
1593
|
-
// value "all" a keyword for the length of displayOrder above
|
|
1594
|
-
// Icons with visibility always are excluded from collapsing
|
|
1595
|
-
["compact" /* compact */]: 2,
|
|
1596
|
-
["medium" /* medium */]: 3
|
|
1597
|
-
},
|
|
1598
|
-
keys: {
|
|
1599
|
-
["settings" /* settings */]: defaultSettingsAction,
|
|
1600
|
-
["fullscreen" /* fullscreen */]: defaultFullscreenAction,
|
|
1601
|
-
["toc" /* toc */]: defaultTocAction,
|
|
1602
|
-
["jumpToPosition" /* jumpToPosition */]: defaultJumpToPositionAction
|
|
1603
|
-
}
|
|
1604
|
-
},
|
|
1605
|
-
docking: {
|
|
1606
|
-
displayOrder: [
|
|
1607
|
-
"dockingTransient" /* transient */,
|
|
1608
|
-
"dockingStart" /* start */,
|
|
1609
|
-
"dockingEnd" /* end */
|
|
1610
|
-
],
|
|
1611
|
-
dock: {
|
|
1612
|
-
["compact" /* compact */]: "none" /* none */,
|
|
1613
|
-
["medium" /* medium */]: "none" /* none */,
|
|
1614
|
-
["expanded" /* expanded */]: "start" /* start */,
|
|
1615
|
-
["large" /* large */]: "both" /* both */,
|
|
1616
|
-
["xLarge" /* xLarge */]: "both" /* both */
|
|
1617
|
-
},
|
|
1618
|
-
collapse: true,
|
|
1619
|
-
keys: {
|
|
1620
|
-
["dockingStart" /* start */]: {
|
|
1621
|
-
visibility: "overflow" /* overflow */,
|
|
1622
|
-
shortcut: null
|
|
1623
|
-
},
|
|
1624
|
-
["dockingEnd" /* end */]: {
|
|
1625
|
-
visibility: "overflow" /* overflow */,
|
|
1626
|
-
shortcut: null
|
|
1627
|
-
},
|
|
1628
|
-
["dockingTransient" /* transient */]: {
|
|
1629
|
-
visibility: "overflow" /* overflow */,
|
|
1630
|
-
shortcut: null
|
|
1631
|
-
}
|
|
1632
|
-
}
|
|
1633
|
-
},
|
|
1634
|
-
settings: {
|
|
1635
|
-
reflowOrder: [
|
|
1636
|
-
"zoom" /* zoom */,
|
|
1637
|
-
"textGroup" /* textGroup */,
|
|
1638
|
-
"theme" /* theme */,
|
|
1639
|
-
"spacingGroup" /* spacingGroup */,
|
|
1640
|
-
"layout" /* layout */,
|
|
1641
|
-
"columns" /* columns */
|
|
1642
|
-
],
|
|
1643
|
-
fxlOrder: [
|
|
1644
|
-
"theme" /* theme */,
|
|
1645
|
-
"columns" /* columns */
|
|
1646
|
-
],
|
|
1647
|
-
webPubOrder: [
|
|
1648
|
-
"zoom" /* zoom */,
|
|
1649
|
-
"textGroup" /* textGroup */,
|
|
1650
|
-
"spacingGroup" /* spacingGroup */
|
|
1651
|
-
],
|
|
1652
|
-
keys: {
|
|
1653
|
-
["fontFamily" /* fontFamily */]: {
|
|
1654
|
-
default: defaultFontCollection,
|
|
1655
|
-
tamil: {
|
|
1656
|
-
supportedLanguages: ["ta"],
|
|
1657
|
-
fonts: tamilCollection
|
|
1658
|
-
}
|
|
1659
|
-
},
|
|
1660
|
-
["letterSpacing" /* letterSpacing */]: defaultLetterSpacing,
|
|
1661
|
-
["lineHeight" /* lineHeight */]: {
|
|
1662
|
-
allowUnset: false,
|
|
1663
|
-
keys: defaultLineHeights
|
|
1664
|
-
},
|
|
1665
|
-
["paragraphIndent" /* paragraphIndent */]: defaultParagraphIndent,
|
|
1666
|
-
["paragraphSpacing" /* paragraphSpacing */]: defaultParagraphSpacing,
|
|
1667
|
-
["wordSpacing" /* wordSpacing */]: defaultWordSpacing,
|
|
1668
|
-
["zoom" /* zoom */]: defaultZoom
|
|
1669
|
-
},
|
|
1670
|
-
text: {
|
|
1671
|
-
header: "previous" /* previous */,
|
|
1672
|
-
main: defaultTextSettingsMain,
|
|
1673
|
-
subPanel: defaultTextSettingsSubpanel
|
|
1674
|
-
},
|
|
1675
|
-
spacing: {
|
|
1676
|
-
header: "previous" /* previous */,
|
|
1677
|
-
main: defaultSpacingSettingsMain,
|
|
1678
|
-
subPanel: defaultSpacingSettingsSubpanel,
|
|
1679
|
-
presets: {
|
|
1680
|
-
reflowOrder: defaultSpacingPresetsOrder,
|
|
1681
|
-
webPubOrder: defaultSpacingPresetsOrder,
|
|
1682
|
-
keys: defaultSpacingPresets
|
|
1683
|
-
}
|
|
1684
|
-
}
|
|
1685
|
-
}
|
|
1686
|
-
});
|
|
1687
|
-
var ThPreferencesContext = createContext(null);
|
|
1688
|
-
var defaultPreferencesContextValue = {
|
|
1689
|
-
preferences: defaultPreferences,
|
|
1690
|
-
updatePreferences: () => {
|
|
1691
|
-
throw new Error("updatePreferences must be used within a ThPreferencesProvider with an adapter");
|
|
1692
|
-
}
|
|
1693
|
-
};
|
|
1694
|
-
var useSharedPreferences = () => {
|
|
1695
|
-
const audioCtx = useContext(ThAudioPreferencesContext);
|
|
1696
|
-
const readerCtx = useContext(ThPreferencesContext);
|
|
1697
|
-
const ctx = audioCtx ?? readerCtx;
|
|
1698
|
-
if (!ctx) throw new Error("useSharedPreferences must be used within a ThPreferencesProvider or ThAudioPreferencesProvider");
|
|
1699
|
-
const prefs = ctx.preferences;
|
|
1700
|
-
return {
|
|
1701
|
-
direction: prefs.direction,
|
|
1702
|
-
locale: prefs.locale,
|
|
1703
|
-
shortcuts: prefs.shortcuts,
|
|
1704
|
-
docking: prefs.docking,
|
|
1705
|
-
theming: {
|
|
1706
|
-
icon: prefs.theming.icon,
|
|
1707
|
-
header: prefs.theming.header ? { backLink: prefs.theming.header.backLink } : void 0,
|
|
1708
|
-
themes: {
|
|
1709
|
-
systemThemes: prefs.theming.themes.systemThemes,
|
|
1710
|
-
keys: prefs.theming.themes.keys,
|
|
1711
|
-
audioOrder: audioCtx?.preferences.theming.themes.audioOrder,
|
|
1712
|
-
reflowOrder: readerCtx?.preferences.theming.themes.reflowOrder,
|
|
1713
|
-
fxlOrder: readerCtx?.preferences.theming.themes.fxlOrder
|
|
1714
|
-
},
|
|
1715
|
-
layout: {
|
|
1716
|
-
defaults: prefs.theming.layout.defaults
|
|
1717
|
-
},
|
|
1718
|
-
breakpoints: prefs.theming.breakpoints
|
|
1719
|
-
}
|
|
1720
|
-
};
|
|
1721
|
-
};
|
|
1722
|
-
|
|
1723
|
-
export { ThActionsKeys, ThAudioActionKeys, ThAudioAffordance, ThAudioKeys, ThAudioPreferencesContext, ThDockingKeys, ThDockingTypes, ThLayoutOptions, ThLineHeightOptions, ThPreferencesContext, ThSettingsContainerKeys, ThSettingsKeys, ThSettingsRangePlaceholder, ThSettingsRangeVariant, ThSettingsTimerVariant, ThSheetHeaderVariant, ThSheetTypes, ThSpacingPresetKeys, ThSpacingSettingsKeys, ThTextAlignOptions, ThTextSettingsKeys, ThThemeKeys, contrast1Theme, contrast2Theme, contrast3Theme, createAudioPreferences, createDefinitionFromStaticFonts, createDefinitionsFromGoogleFonts, createPreferences, darkTheme, defaultActionKeysObject, defaultAudioContentProtectionConfig, defaultAudioPlaybackRate, defaultAudioPlaybackRateAction, defaultAudioPreferences, defaultAudioPreferencesContextValue, defaultAudioRemotePlaybackAction, defaultAudioSkipBackwardInterval, defaultAudioSkipForwardInterval, defaultAudioSkipInterval, defaultAudioSleepTimer, defaultAudioSleepTimerAction, defaultAudioSleepTimerPresetList, defaultAudioTocAction, defaultAudioVolume, defaultAudioVolumeAction, defaultContentProtectionConfig, defaultFontCollection, defaultFullscreenAction, defaultJumpToPositionAction, defaultLetterSpacing, defaultLineHeights, defaultParagraphIndent, defaultParagraphSpacing, defaultPreferences, defaultPreferencesContextValue, defaultSettingsAction, defaultSpacingPresets, defaultSpacingPresetsOrder, defaultSpacingSettingsMain, defaultSpacingSettingsSubpanel, defaultTextSettingsMain, defaultTextSettingsSubpanel, defaultTocAction, defaultWordSpacing, defaultZoom, devContentProtectionConfig, lightTheme, paperTheme, readiumCSSFontCollection, resolveAudioContentProtectionConfig, resolveContentProtectionConfig, sepiaTheme, tamilCollection, useSharedPreferences, validateObjectKeys };
|
|
1724
|
-
//# sourceMappingURL=chunk-C236BQQB.mjs.map
|
|
1725
|
-
//# sourceMappingURL=chunk-C236BQQB.mjs.map
|