@edrlab/thorium-web 1.1.4 → 1.1.6

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.
Files changed (63) hide show
  1. package/dist/{StatefulReader-lpxHxgKK.d.mts → StatefulReader-CjgFzHoO.d.mts} +5 -5
  2. package/dist/ThPreferencesAdapter-B8AYujCA.d.mts +649 -0
  3. package/dist/{ThSettingsWrapper-CMLegiqy.d.mts → ThSettingsWrapper-BlmAxcWF.d.mts} +1 -1
  4. package/dist/actions-BRtHsxpm.d.mts +108 -0
  5. package/dist/{actionsReducer-6UNIgifE.d.mts → actionsReducer-bT0pfxLJ.d.mts} +1 -1
  6. package/dist/{chunk-VH22EPOM.mjs → chunk-47AIIJFO.mjs} +3 -3
  7. package/dist/chunk-47AIIJFO.mjs.map +1 -0
  8. package/dist/{chunk-KTZPAJ4S.mjs → chunk-COQXDRKD.mjs} +2 -2
  9. package/dist/chunk-COQXDRKD.mjs.map +1 -0
  10. package/dist/{chunk-BNPR6V7V.mjs → chunk-GFSLVQIG.mjs} +2 -2
  11. package/dist/chunk-GFSLVQIG.mjs.map +1 -0
  12. package/dist/{chunk-KKMH2EPS.mjs → chunk-KJXHAJYK.mjs} +12 -6
  13. package/dist/chunk-KJXHAJYK.mjs.map +1 -0
  14. package/dist/{chunk-GZDYMUV7.mjs → chunk-KTPIH35Y.mjs} +2 -2
  15. package/dist/chunk-KTPIH35Y.mjs.map +1 -0
  16. package/dist/{chunk-MW7LXDWC.mjs → chunk-QNYZCQKO.mjs} +3 -3
  17. package/dist/{chunk-MW7LXDWC.mjs.map → chunk-QNYZCQKO.mjs.map} +1 -1
  18. package/dist/{chunk-GKXS45F4.mjs → chunk-SFHOVH6R.mjs} +22 -22
  19. package/dist/chunk-SFHOVH6R.mjs.map +1 -0
  20. package/dist/{chunk-VN44OJDD.mjs → chunk-SMK7A7VF.mjs} +567 -358
  21. package/dist/chunk-SMK7A7VF.mjs.map +1 -0
  22. package/dist/chunk-XVSFXHYB.mjs +78 -0
  23. package/dist/chunk-XVSFXHYB.mjs.map +1 -0
  24. package/dist/components/Epub/index.d.mts +8 -9
  25. package/dist/components/Epub/index.mjs +28 -20
  26. package/dist/components/Epub/index.mjs.map +1 -1
  27. package/dist/components/Misc/index.mjs +2 -3
  28. package/dist/components/Misc/index.mjs.map +1 -1
  29. package/dist/components/WebPub/index.d.mts +10 -10
  30. package/dist/components/WebPub/index.mjs +25 -19
  31. package/dist/components/WebPub/index.mjs.map +1 -1
  32. package/dist/core/Components/index.d.mts +6 -5
  33. package/dist/core/Components/index.mjs +1 -2
  34. package/dist/core/Helpers/index.d.mts +1 -2
  35. package/dist/core/Helpers/index.mjs +2 -3
  36. package/dist/core/Hooks/index.d.mts +3 -4
  37. package/dist/core/Hooks/index.mjs +2 -3
  38. package/dist/i18n/index.mjs +5 -6
  39. package/dist/lib/index.d.mts +8 -9
  40. package/dist/lib/index.mjs +2 -3
  41. package/dist/locales/en/thorium-web.json +1 -0
  42. package/dist/preferences/index.d.mts +7 -54
  43. package/dist/preferences/index.mjs +4 -5
  44. package/dist/ui-BVlJcPL_.d.mts +105 -0
  45. package/dist/{useEpubNavigator-DQq5VlY0.d.mts → useEpubNavigator-CsraD65e.d.mts} +2 -1
  46. package/dist/{usePreferences-CM_Y2jpZ.d.mts → usePreferences-rfT368__.d.mts} +3 -2
  47. package/dist/{useWebPubNavigator-XFUVekhV.d.mts → useWebPubNavigator-Che8r5Wg.d.mts} +2 -1
  48. package/package.json +21 -21
  49. package/dist/ThPreferencesAdapter-CcJgE3zC.d.mts +0 -405
  50. package/dist/chunk-7CGMWOZN.mjs +0 -20
  51. package/dist/chunk-7CGMWOZN.mjs.map +0 -1
  52. package/dist/chunk-BNPR6V7V.mjs.map +0 -1
  53. package/dist/chunk-CVM2ZAPL.mjs +0 -187
  54. package/dist/chunk-CVM2ZAPL.mjs.map +0 -1
  55. package/dist/chunk-GKXS45F4.mjs.map +0 -1
  56. package/dist/chunk-GZDYMUV7.mjs.map +0 -1
  57. package/dist/chunk-KKMH2EPS.mjs.map +0 -1
  58. package/dist/chunk-KTZPAJ4S.mjs.map +0 -1
  59. package/dist/chunk-VH22EPOM.mjs.map +0 -1
  60. package/dist/chunk-VN44OJDD.mjs.map +0 -1
  61. package/dist/enums-Bhwwdfx5.d.mts +0 -160
  62. package/dist/useBreakpoints-LTrHif3E.d.mts +0 -22
  63. package/dist/useCollapsibility-CM1I24Ol.d.mts +0 -40
@@ -1,12 +1,12 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { TooltipProps, Heading, HeadingProps, PopoverProps } from 'react-aria-components';
3
- import { d as ThActionsTriggerVariant, a as ThCollapsibilityVisibility, b as ThActionEntry } from './useCollapsibility-CM1I24Ol.mjs';
4
- import { T as ThActionButtonProps, f as ThMenuItemProps, a as ThCollapsibleActionsBarProps, t as ThSettingsEntry, W as WithRef, r as ThDropdownProps, h as ThNumberFieldProps, k as ThRadioGroupProps, m as ThSliderProps, o as ThSwitchProps } from './ThSettingsWrapper-CMLegiqy.mjs';
5
- import { m as ThActionsKeys, c as ThDockingKeys, k as ThSheetTypes, p as ThTextSettingsKeys, q as ThSpacingSettingsKeys, u as ThSpacingPresetKeys, T as ThLineHeightOptions, t as ThSheetHeaderVariant, a as ThTextAlignOptions, j as ThLayoutUI } from './enums-Bhwwdfx5.mjs';
3
+ import { s as ThActionsTriggerVariant, r as ThCollapsibilityVisibility, p as ThActionEntry, a as ThActionsKeys, T as ThDockingKeys, h as ThSheetTypes, i as ThSheetHeaderVariant } from './actions-BRtHsxpm.mjs';
4
+ import { T as ThActionButtonProps, f as ThMenuItemProps, a as ThCollapsibleActionsBarProps, t as ThSettingsEntry, W as WithRef, r as ThDropdownProps, h as ThNumberFieldProps, k as ThRadioGroupProps, m as ThSliderProps, o as ThSwitchProps } from './ThSettingsWrapper-BlmAxcWF.mjs';
6
5
  import React__default, { RefObject, ReactNode } from 'react';
7
- import { H as ThSettingsGroupPref, a as ThPreferences, D as DefaultKeys } from './ThPreferencesAdapter-CcJgE3zC.mjs';
6
+ import { h as ThTextSettingsKeys, i as ThSpacingSettingsKeys, aj as ThSettingsGroupPref, j as ThSpacingPresetKeys, T as ThLineHeightOptions, c as ThPreferences, D as DefaultKeys, a as ThTextAlignOptions } from './ThPreferencesAdapter-B8AYujCA.mjs';
8
7
  import { PressEvent } from 'react-aria';
9
- import { A as ActionsStateKeys } from './actionsReducer-6UNIgifE.mjs';
8
+ import { A as ActionsStateKeys } from './actionsReducer-bT0pfxLJ.mjs';
9
+ import { k as ThLayoutUI } from './ui-BVlJcPL_.mjs';
10
10
  import { T as ThColorScheme } from './useContrast-Cgsrl7GS.mjs';
11
11
  import { Locator } from '@readium/shared';
12
12
  import { FontFamilyStateObject, LineLengthStateObject } from './lib/index.mjs';
@@ -0,0 +1,649 @@
1
+ import { e as UnstableShortcutRepresentation } from './keyboardUtilities-BWAyLS_D.mjs';
2
+ import { B as BreakpointsMap, g as ThBreakpoints, n as ThBreakpointsObject, j as ThLayoutDirection, i as ThDocumentTitleFormat, a as ThBackLinkPref, c as ThFormatPref, m as ThRunningHeadFormat, l as ThProgressionFormat, k as ThLayoutUI, e as ThPaginatedAffordancePref } from './ui-BVlJcPL_.mjs';
3
+ import { T as ThColorScheme, a as ThContrast } from './useContrast-Cgsrl7GS.mjs';
4
+ import { i as ThSheetHeaderVariant, h as ThSheetTypes, a as ThActionsKeys, o as ThCollapsibility, c as ThActionsTokens, f as ThDockingPref, T as ThDockingKeys } from './actions-BRtHsxpm.mjs';
5
+ import { IContentProtectionConfig, ExperimentKey } from '@readium/navigator';
6
+
7
+ type CSSValueUnitless = `${number}`;
8
+ type CSSValueWithUnit<Unit extends string> = `${number}${Unit}`;
9
+ type CSSAbsoluteLength = CSSValueWithUnit<"cm" | "in" | "mm" | "pc" | "pt" | "px" | "Q">;
10
+ type CSSAngle = CSSValueWithUnit<"deg" | "grad" | "rad" | "turn">;
11
+ type CSSDefaultViewport = CSSValueWithUnit<"vb" | "vh" | "vi" | "vmax" | "vmin" | "vw">;
12
+ type CSSDynamicViewport = CSSValueWithUnit<"dvb" | "dvh" | "dvi" | "dvmax" | "dvmin" | "dvw">;
13
+ type CSSFrequency = CSSValueWithUnit<"Hz" | "kHz">;
14
+ type CSSFontRelativeLength = CSSValueWithUnit<"cap" | "ch" | "em" | "ex" | "ic" | "lh">;
15
+ type CSSLargeViewport = CSSValueWithUnit<"lvb" | "lvh" | "lvi" | "lvmax" | "lvmin" | "lvw">;
16
+ type CSSPhysicalLength = CSSValueWithUnit<"cm" | "in" | "mm" | "pc" | "pt" | "Q">;
17
+ type CSSRelativeLength = CSSFontRelativeLength | CSSValueWithUnit<"%"> | CSSRootFontRelativeLength;
18
+ type CSSResolution = CSSValueWithUnit<"dpcm" | "dpi" | "dppx" | "x">;
19
+ type CSSRootFontRelativeLength = CSSValueWithUnit<"rcap" | "rch" | "rem" | "rex" | "ric" | "rlh">;
20
+ type CSSSmallViewport = CSSValueWithUnit<"svb" | "svh" | "svi" | "svmax" | "svmin" | "svw">;
21
+ type CSSTime = CSSValueWithUnit<"ms" | "s">;
22
+ type CSSViewport = CSSDefaultViewport | CSSDynamicViewport | CSSLargeViewport | CSSSmallViewport;
23
+ type CSSColor = string | `#${string}` | `rgb(${string})` | `rgba(${string})` | `hsl(${string})` | `hsla(${string})` | `hwb(${string})` | `lab(${string})` | `lch(${string})` | `oklab(${string})` | `oklch(${string})` | `color(${string})` | `color-mix(${string})` | `light-dark(${string})`;
24
+
25
+ type I18nValue<T> = T | string | {
26
+ key: string;
27
+ fallback?: string;
28
+ };
29
+
30
+ interface SystemFontSource {
31
+ type: "system";
32
+ }
33
+ interface BunnyFontSource {
34
+ type: "custom";
35
+ provider: "bunny";
36
+ }
37
+ interface GoogleFontSource {
38
+ type: "custom";
39
+ provider: "google";
40
+ }
41
+ interface LocalStaticFontFile {
42
+ path: string;
43
+ weight: number;
44
+ style: "normal" | "italic";
45
+ }
46
+ interface LocalVariableFontFile {
47
+ path: string;
48
+ style?: "normal" | "italic";
49
+ }
50
+ interface LocalStaticFontSource {
51
+ type: "custom";
52
+ provider: "local";
53
+ variant: "static";
54
+ files: LocalStaticFontFile[];
55
+ }
56
+ interface LocalVariableFontSource {
57
+ type: "custom";
58
+ provider: "local";
59
+ variant: "variable";
60
+ files: LocalVariableFontFile[];
61
+ }
62
+ type LocalFontSource = LocalStaticFontSource | LocalVariableFontSource;
63
+ type FontSource = SystemFontSource | BunnyFontSource | GoogleFontSource | LocalFontSource;
64
+ type VariableFontRangeConfig = {
65
+ min: number;
66
+ max: number;
67
+ step?: number;
68
+ };
69
+ type WeightConfig = {
70
+ type: "static";
71
+ values: number[];
72
+ } | {
73
+ type: "variable";
74
+ } & VariableFontRangeConfig;
75
+ interface FontSpec {
76
+ family: string;
77
+ fallbacks: string[];
78
+ weights: WeightConfig;
79
+ styles?: ("normal" | "italic")[];
80
+ widths?: VariableFontRangeConfig;
81
+ display?: "swap" | "block" | "fallback" | "optional";
82
+ }
83
+ interface FontDefinition {
84
+ id: string;
85
+ name: string;
86
+ label?: I18nValue<string>;
87
+ source: FontSource;
88
+ spec: FontSpec;
89
+ }
90
+ type FontCollection = Record<string, FontDefinition>;
91
+ type ValidatedLanguageCollection = {
92
+ fonts: FontCollection;
93
+ supportedLanguages: string[];
94
+ };
95
+ type ThFontFamilyPref = {
96
+ default: FontCollection;
97
+ } | {
98
+ [K in Exclude<string, "default">]: ValidatedLanguageCollection;
99
+ };
100
+ declare const readiumCSSFontCollection: FontCollection;
101
+ declare const defaultFontCollection: FontCollection;
102
+ declare const tamilCollection: {
103
+ [x: string]: FontDefinition;
104
+ };
105
+
106
+ interface CopyProtectionConfig {
107
+ /** Maximum percentage of content that can be selected (0-1) */
108
+ maxSelectionPercent: number;
109
+ /** Minimum number of characters that can be selected before protection kicks in */
110
+ minThreshold: number;
111
+ /** Absolute maximum number of characters that can be copied in total */
112
+ absoluteMaxChars: number;
113
+ /** Number of recent copy attempts to keep in history for pattern analysis */
114
+ historySize: number;
115
+ }
116
+ interface PrintProtectionConfig {
117
+ /** Disable printing completely */
118
+ disable?: boolean;
119
+ /** Optional watermark text to show when printing is disabled */
120
+ watermark?: I18nValue<string>;
121
+ }
122
+ interface ContentProtectionConfig {
123
+ /**
124
+ * Higher-level API will make use of the following from Content Protection API:
125
+ * - checkAutomation
126
+ * - checkIFrameEmbedding
127
+ * - monitorSelection
128
+ * - monitorDevTools
129
+ * - monitorScrollingExperimental
130
+ */
131
+ /**
132
+ * Configure copy protection
133
+ * - boolean: true to enable with default settings, false to disable
134
+ * - object: Fine-grained control over copy protection
135
+ */
136
+ protectCopy?: boolean | CopyProtectionConfig;
137
+ /** Disable right-click context menu */
138
+ disableContextMenu?: boolean;
139
+ /** Disable drag and drop functionality */
140
+ disableDragAndDrop?: boolean;
141
+ /** Print protection configuration */
142
+ protectPrinting?: PrintProtectionConfig;
143
+ /** Disable Select All functionality (Ctrl+A/Cmd+A) */
144
+ disableSelectAll?: boolean;
145
+ /** Disable Save functionality (Ctrl+S/Cmd+S) */
146
+ disableSave?: boolean;
147
+ /** Monitor developer tools for suspicious activity. We need it for the shortcut protection */
148
+ monitorDevTools?: boolean;
149
+ }
150
+ /**
151
+ * Resolves content protection configuration with localized strings
152
+ * @param contentProtection The content protection config to resolve
153
+ * @param t Translation function that supports defaultValue option
154
+ * @returns Resolved content protection config compatible with navigator
155
+ */
156
+ declare const resolveContentProtectionConfig: (contentProtection: ContentProtectionConfig | undefined, t: (key: string, options?: {
157
+ defaultValue?: string;
158
+ }) => string) => IContentProtectionConfig | undefined;
159
+ /**
160
+ * Default content protection configuration
161
+ */
162
+ declare const defaultContentProtectionConfig: ContentProtectionConfig;
163
+ /**
164
+ * Development content protection configuration - disables all protections
165
+ */
166
+ declare const devContentProtectionConfig: ContentProtectionConfig;
167
+
168
+ interface ThSettingsGroupPref<T> {
169
+ main: T[];
170
+ subPanel: T[] | null;
171
+ header?: ThSheetHeaderVariant;
172
+ }
173
+ interface ThSettingsRangePref {
174
+ variant?: ThSettingsRangeVariant;
175
+ placeholder?: I18nValue<ThSettingsRangePlaceholder>;
176
+ range?: [number, number];
177
+ step?: number;
178
+ }
179
+ interface ThSettingsRadioPref<T extends string> {
180
+ allowUnset?: boolean;
181
+ keys: {
182
+ [key in T]: number;
183
+ };
184
+ }
185
+ declare enum ThSettingsKeys {
186
+ columns = "columns",
187
+ fontFamily = "fontFamily",
188
+ fontWeight = "fontWeight",
189
+ hyphens = "hyphens",
190
+ layout = "layout",
191
+ letterSpacing = "letterSpacing",
192
+ lineHeight = "lineHeight",
193
+ paragraphIndent = "paragraphIndent",
194
+ paragraphSpacing = "paragraphSpacing",
195
+ publisherStyles = "publisherStyles",
196
+ spacingGroup = "spacingGroup",
197
+ spacingPresets = "spacingPresets",
198
+ textAlign = "textAlign",
199
+ textGroup = "textGroup",
200
+ textNormalize = "textNormalize",
201
+ theme = "theme",
202
+ wordSpacing = "wordSpacing",
203
+ zoom = "zoom"
204
+ }
205
+ declare enum ThTextSettingsKeys {
206
+ fontFamily = "fontFamily",
207
+ fontWeight = "fontWeight",
208
+ hyphens = "hyphens",
209
+ textAlign = "textAlign",
210
+ textNormalize = "textNormalize"
211
+ }
212
+ declare enum ThSpacingSettingsKeys {
213
+ letterSpacing = "letterSpacing",
214
+ lineHeight = "lineHeight",
215
+ paragraphIndent = "paragraphIndent",
216
+ paragraphSpacing = "paragraphSpacing",
217
+ publisherStyles = "publisherStyles",
218
+ spacingPresets = "spacingPresets",
219
+ wordSpacing = "wordSpacing"
220
+ }
221
+ declare enum ThSettingsContainerKeys {
222
+ initial = "initial",
223
+ text = "text",
224
+ spacing = "spacing"
225
+ }
226
+ declare enum ThSettingsRangeVariant {
227
+ slider = "slider",
228
+ incrementedSlider = "incrementedSlider",
229
+ numberField = "numberField"
230
+ }
231
+ declare enum ThSettingsRangePlaceholder {
232
+ range = "range",
233
+ none = "none"
234
+ }
235
+ declare enum ThSpacingPresetKeys {
236
+ publisher = "publisher",
237
+ tight = "tight",
238
+ balanced = "balanced",
239
+ loose = "loose",
240
+ accessible = "accessible",
241
+ custom = "custom"
242
+ }
243
+ declare enum ThLayoutOptions {
244
+ scroll = "scroll_option",
245
+ paginated = "page_option"
246
+ }
247
+ declare enum ThTextAlignOptions {
248
+ publisher = "publisher",
249
+ start = "start",
250
+ justify = "justify"
251
+ }
252
+ declare enum ThLineHeightOptions {
253
+ publisher = "publisher",
254
+ small = "small",
255
+ medium = "medium",
256
+ large = "large"
257
+ }
258
+ declare const defaultTextSettingsMain: ThTextSettingsKeys[];
259
+ declare const defaultTextSettingsSubpanel: ThTextSettingsKeys[];
260
+ declare const defaultSpacingSettingsMain: ThSpacingSettingsKeys[];
261
+ declare const defaultSpacingSettingsSubpanel: ThSpacingSettingsKeys[];
262
+ declare const defaultSpacingPresetsOrder: ThSpacingPresetKeys[];
263
+ declare const defaultParagraphSpacing: Required<ThSettingsRangePref>;
264
+ declare const defaultParagraphIndent: Required<ThSettingsRangePref>;
265
+ declare const defaultWordSpacing: Required<ThSettingsRangePref>;
266
+ declare const defaultLetterSpacing: Required<ThSettingsRangePref>;
267
+ declare const defaultLineHeights: {
268
+ small: number;
269
+ medium: number;
270
+ large: number;
271
+ };
272
+ declare const defaultZoom: Required<ThSettingsRangePref>;
273
+ declare const defaultSpacingPresets: {
274
+ tight: {
275
+ lineHeight: ThLineHeightOptions;
276
+ paragraphSpacing: number;
277
+ paragraphIndent: number;
278
+ };
279
+ balanced: {
280
+ lineHeight: ThLineHeightOptions;
281
+ paragraphSpacing: number;
282
+ paragraphIndent: number;
283
+ };
284
+ loose: {
285
+ lineHeight: ThLineHeightOptions;
286
+ paragraphSpacing: number;
287
+ paragraphIndent: number;
288
+ };
289
+ accessible: {
290
+ lineHeight: ThLineHeightOptions;
291
+ paragraphSpacing: number;
292
+ paragraphIndent: number;
293
+ letterSpacing: number;
294
+ wordSpacing: number;
295
+ };
296
+ };
297
+
298
+ declare enum ThThemeKeys {
299
+ light = "light",
300
+ sepia = "sepia",
301
+ dark = "dark",
302
+ paper = "paper",
303
+ contrast1 = "contrast1",
304
+ contrast2 = "contrast2",
305
+ contrast3 = "contrast3"
306
+ }
307
+ declare const lightTheme: {
308
+ background: string;
309
+ text: string;
310
+ link: string;
311
+ visited: string;
312
+ subdue: string;
313
+ disable: string;
314
+ hover: string;
315
+ onHover: string;
316
+ select: string;
317
+ onSelect: string;
318
+ focus: string;
319
+ elevate: string;
320
+ immerse: string;
321
+ };
322
+ declare const darkTheme: {
323
+ background: string;
324
+ text: string;
325
+ link: string;
326
+ visited: string;
327
+ subdue: string;
328
+ disable: string;
329
+ hover: string;
330
+ onHover: string;
331
+ select: string;
332
+ onSelect: string;
333
+ focus: string;
334
+ elevate: string;
335
+ immerse: string;
336
+ };
337
+ declare const paperTheme: {
338
+ background: string;
339
+ text: string;
340
+ link: string;
341
+ visited: string;
342
+ subdue: string;
343
+ disable: string;
344
+ hover: string;
345
+ onHover: string;
346
+ select: string;
347
+ onSelect: string;
348
+ focus: string;
349
+ elevate: string;
350
+ immerse: string;
351
+ };
352
+ declare const sepiaTheme: {
353
+ background: string;
354
+ text: string;
355
+ link: string;
356
+ visited: string;
357
+ subdue: string;
358
+ disable: string;
359
+ hover: string;
360
+ onHover: string;
361
+ select: string;
362
+ onSelect: string;
363
+ focus: string;
364
+ elevate: string;
365
+ immerse: string;
366
+ };
367
+ declare const contrast1Theme: {
368
+ background: string;
369
+ text: string;
370
+ link: string;
371
+ visited: string;
372
+ subdue: string;
373
+ disable: string;
374
+ hover: string;
375
+ onHover: string;
376
+ select: string;
377
+ onSelect: string;
378
+ focus: string;
379
+ elevate: string;
380
+ immerse: string;
381
+ };
382
+ declare const contrast2Theme: {
383
+ background: string;
384
+ text: string;
385
+ link: string;
386
+ visited: string;
387
+ subdue: string;
388
+ disable: string;
389
+ hover: string;
390
+ onHover: string;
391
+ select: string;
392
+ onSelect: string;
393
+ focus: string;
394
+ elevate: string;
395
+ immerse: string;
396
+ };
397
+ declare const contrast3Theme: {
398
+ background: string;
399
+ text: string;
400
+ link: string;
401
+ visited: string;
402
+ subdue: string;
403
+ disable: string;
404
+ hover: string;
405
+ onHover: string;
406
+ select: string;
407
+ onSelect: string;
408
+ focus: string;
409
+ elevate: string;
410
+ immerse: string;
411
+ };
412
+
413
+ interface ThemeTokens {
414
+ background: CSSColor;
415
+ text: CSSColor;
416
+ link: CSSColor;
417
+ visited: CSSColor;
418
+ subdue: CSSColor;
419
+ disable: CSSColor;
420
+ hover: CSSColor;
421
+ onHover: CSSColor;
422
+ select: CSSColor;
423
+ onSelect: CSSColor;
424
+ focus: CSSColor;
425
+ elevate: string;
426
+ immerse: string;
427
+ }
428
+ interface useThemingProps<T extends string> {
429
+ theme?: string;
430
+ themeKeys: {
431
+ [key in T]?: ThemeTokens;
432
+ };
433
+ systemKeys?: {
434
+ light: T;
435
+ dark: T;
436
+ };
437
+ breakpointsMap: BreakpointsMap<number | null>;
438
+ initProps?: Record<string, any>;
439
+ onBreakpointChange?: (breakpoint: ThBreakpoints | null) => void;
440
+ onColorSchemeChange?: (colorScheme: ThColorScheme) => void;
441
+ onContrastChange?: (contrast: ThContrast) => void;
442
+ onForcedColorsChange?: (forcedColors: boolean) => void;
443
+ onMonochromeChange?: (isMonochrome: boolean) => void;
444
+ onReducedMotionChange?: (reducedMotion: boolean) => void;
445
+ onReducedTransparencyChange?: (reducedTransparency: boolean) => void;
446
+ }
447
+ declare const useTheming: <T extends string>({ theme, systemKeys, themeKeys, breakpointsMap, initProps, onBreakpointChange, onColorSchemeChange, onContrastChange, onForcedColorsChange, onMonochromeChange, onReducedMotionChange, onReducedTransparencyChange, }: useThemingProps<T>) => {
448
+ inferThemeAuto: () => T | undefined;
449
+ theme: string | undefined;
450
+ breakpoints: ThBreakpointsObject;
451
+ colorScheme: ThColorScheme;
452
+ contrast: ThContrast;
453
+ forcedColors: boolean;
454
+ monochrome: boolean;
455
+ reducedMotion: boolean;
456
+ reducedTransparency: boolean;
457
+ };
458
+
459
+ type CustomizableKeys = {
460
+ action?: string;
461
+ theme?: string;
462
+ settings?: string;
463
+ text?: string;
464
+ spacing?: string;
465
+ };
466
+ type DefaultKeys = {
467
+ action: ThActionsKeys;
468
+ theme: ThThemeKeys;
469
+ settings: ThSettingsKeys;
470
+ text: ThTextSettingsKeys;
471
+ spacing: ThSpacingSettingsKeys;
472
+ };
473
+ type ActionKey<K extends CustomizableKeys> = K extends {
474
+ action: infer A;
475
+ } ? A extends string ? ThActionsKeys | A : ThActionsKeys : ThActionsKeys;
476
+ type ThemeKey<K extends CustomizableKeys> = K extends {
477
+ theme: infer T;
478
+ } ? T extends string ? ThThemeKeys | T : ThThemeKeys : ThThemeKeys;
479
+ type SettingsKey<K extends CustomizableKeys> = K extends {
480
+ settings: infer S;
481
+ } ? S extends string ? ThSettingsKeys | S : ThSettingsKeys : ThSettingsKeys;
482
+ type TextSettingsKey<K extends CustomizableKeys> = K extends {
483
+ text: infer T;
484
+ } ? T extends string ? ThTextSettingsKeys | T : ThTextSettingsKeys : ThTextSettingsKeys;
485
+ type SpacingSettingsKey<K extends CustomizableKeys> = K extends {
486
+ spacing: infer S;
487
+ } ? S extends string ? ThSpacingSettingsKeys | S : ThSpacingSettingsKeys : ThSpacingSettingsKeys;
488
+ interface ThSettingsSpacingPresets<K extends CustomizableKeys = DefaultKeys> {
489
+ reflowOrder: Array<ThSpacingPresetKeys>;
490
+ webPubOrder: Array<ThSpacingPresetKeys>;
491
+ keys: {
492
+ [key in Exclude<ThSpacingPresetKeys, "publisher" | "custom">]?: ThSpacingPreset<K>;
493
+ };
494
+ }
495
+ type ThSpacingPreset<K extends CustomizableKeys = DefaultKeys> = {
496
+ [ThSpacingSettingsKeys.letterSpacing]?: number;
497
+ [ThSpacingSettingsKeys.lineHeight]?: ThLineHeightOptions;
498
+ [ThSpacingSettingsKeys.paragraphIndent]?: number;
499
+ [ThSpacingSettingsKeys.paragraphSpacing]?: number;
500
+ [ThSpacingSettingsKeys.wordSpacing]?: number;
501
+ } & (K extends {
502
+ spacing: infer S;
503
+ } ? S extends string ? {
504
+ [key in S]?: number | ThLineHeightOptions;
505
+ } : {} : {});
506
+ interface ThActionsPref<K extends CustomizableKeys> {
507
+ reflowOrder: Array<ActionKey<K>>;
508
+ fxlOrder: Array<ActionKey<K>>;
509
+ webPubOrder: Array<ActionKey<K>>;
510
+ collapse: ThCollapsibility;
511
+ keys: Record<ActionKey<K>, ThActionsTokens>;
512
+ }
513
+ type ThSettingsKeyTypes<K extends CustomizableKeys = DefaultKeys> = {
514
+ [ThSettingsKeys.fontFamily]: ThFontFamilyPref;
515
+ [ThSettingsKeys.letterSpacing]: ThSettingsRangePref;
516
+ [ThSettingsKeys.lineHeight]: ThSettingsRadioPref<Exclude<ThLineHeightOptions, ThLineHeightOptions.publisher>>;
517
+ [ThSettingsKeys.paragraphIndent]: ThSettingsRangePref;
518
+ [ThSettingsKeys.paragraphSpacing]: ThSettingsRangePref;
519
+ [ThSettingsKeys.wordSpacing]: ThSettingsRangePref;
520
+ [ThSettingsKeys.zoom]: ThSettingsRangePref;
521
+ } & (K extends {
522
+ settings: infer S;
523
+ } ? S extends string ? {
524
+ [key in S]: any;
525
+ } : {} : {});
526
+ type ThConstraintKeys = Extract<ThSheetTypes, ThSheetTypes.bottomSheet | ThSheetTypes.popover> | "pagination";
527
+ interface ThPreferences<K extends CustomizableKeys = {}> {
528
+ direction?: ThLayoutDirection;
529
+ locale?: string;
530
+ experiments?: {
531
+ reflow?: Array<ExperimentKey>;
532
+ webPub?: Array<ExperimentKey>;
533
+ };
534
+ metadata?: {
535
+ documentTitle?: {
536
+ format: I18nValue<ThDocumentTitleFormat>;
537
+ };
538
+ };
539
+ typography: {
540
+ minimalLineLength?: number | null;
541
+ maximalLineLength?: number | null;
542
+ optimalLineLength: number;
543
+ pageGutter: number;
544
+ };
545
+ theming: {
546
+ header?: {
547
+ backLink?: ThBackLinkPref | null;
548
+ runningHead?: {
549
+ format?: {
550
+ reflow?: ThFormatPref<ThRunningHeadFormat>;
551
+ fxl?: ThFormatPref<ThRunningHeadFormat>;
552
+ webPub?: ThFormatPref<ThRunningHeadFormat>;
553
+ };
554
+ };
555
+ };
556
+ progression?: {
557
+ format?: {
558
+ reflow?: ThFormatPref<ThProgressionFormat | Array<ThProgressionFormat>>;
559
+ fxl?: ThFormatPref<ThProgressionFormat | Array<ThProgressionFormat>>;
560
+ webPub?: ThFormatPref<ThProgressionFormat | Array<ThProgressionFormat>>;
561
+ };
562
+ };
563
+ arrow: {
564
+ size: number;
565
+ offset: number;
566
+ tooltipDelay?: number;
567
+ };
568
+ icon: {
569
+ size: number;
570
+ tooltipOffset: number;
571
+ tooltipDelay?: number;
572
+ };
573
+ layout: {
574
+ ui?: {
575
+ reflow?: ThLayoutUI;
576
+ fxl?: ThLayoutUI;
577
+ webPub?: ThLayoutUI;
578
+ };
579
+ radius: number;
580
+ spacing: number;
581
+ defaults: {
582
+ dockingWidth: number;
583
+ scrim: string;
584
+ };
585
+ constraints?: {
586
+ [key in ThConstraintKeys]?: number | null;
587
+ };
588
+ };
589
+ breakpoints: BreakpointsMap<number | null>;
590
+ themes: {
591
+ reflowOrder: Array<ThemeKey<K> | "auto">;
592
+ fxlOrder: Array<ThemeKey<K> | "auto">;
593
+ systemThemes?: {
594
+ light: ThemeKey<K>;
595
+ dark: ThemeKey<K>;
596
+ };
597
+ keys: Record<Exclude<ThemeKey<K>, "auto"> & string, ThemeTokens>;
598
+ };
599
+ };
600
+ contentProtection?: ContentProtectionConfig;
601
+ affordances: {
602
+ scroll: {
603
+ hintInImmersive: boolean;
604
+ toggleOnMiddlePointer: Array<"tap" | "click">;
605
+ hideOnForwardScroll: boolean;
606
+ showOnBackwardScroll: boolean;
607
+ };
608
+ paginated: {
609
+ reflow: ThPaginatedAffordancePref;
610
+ fxl: ThPaginatedAffordancePref;
611
+ };
612
+ };
613
+ actions: ThActionsPref<K>;
614
+ shortcuts: {
615
+ representation: UnstableShortcutRepresentation;
616
+ joiner?: string;
617
+ };
618
+ docking: ThDockingPref<ThDockingKeys>;
619
+ settings: {
620
+ reflowOrder: Array<SettingsKey<K>>;
621
+ fxlOrder: Array<SettingsKey<K>>;
622
+ webPubOrder: Array<SettingsKey<K>>;
623
+ keys: ThSettingsKeyTypes<K>;
624
+ text: ThSettingsGroupPref<TextSettingsKey<K>>;
625
+ spacing: ThSettingsGroupPref<SpacingSettingsKey<K>> & {
626
+ presets?: ThSettingsSpacingPresets<K>;
627
+ };
628
+ };
629
+ }
630
+ /**
631
+ * Creates a new preferences object with the provided parameters
632
+ * @param params The preferences object to create
633
+ * @returns A new preferences object
634
+ */
635
+ declare const createPreferences: <K extends CustomizableKeys = {}>(params: ThPreferences<K>) => ThPreferences<K>;
636
+ type ActionKeyType<K extends CustomizableKeys = DefaultKeys> = K["action"] extends string ? K["action"] : ThActionsKeys;
637
+ type ThemeKeyType<K extends CustomizableKeys = DefaultKeys> = K["theme"] extends string ? K["theme"] : ThThemeKeys;
638
+ type SettingsKeyType<K extends CustomizableKeys = DefaultKeys> = K["settings"] extends string ? K["settings"] : ThSettingsKeys;
639
+ type TextSettingsKeyType<K extends CustomizableKeys = DefaultKeys> = K["text"] extends string ? K["text"] : ThTextSettingsKeys;
640
+ type SpacingSettingsKeyType<K extends CustomizableKeys = DefaultKeys> = K["spacing"] extends string ? K["spacing"] : ThSpacingSettingsKeys;
641
+
642
+ interface ThPreferencesAdapter<T extends CustomizableKeys = CustomizableKeys> {
643
+ getPreferences(): ThPreferences<T>;
644
+ setPreferences(prefs: ThPreferences<T>): void;
645
+ subscribe(callback: (prefs: ThPreferences<T>) => void): void;
646
+ unsubscribe(callback: (prefs: ThPreferences<T>) => void): void;
647
+ }
648
+
649
+ export { type BunnyFontSource as $, type ActionKey as A, type CSSValueUnitless as B, type CustomizableKeys as C, type DefaultKeys as D, type CSSValueWithUnit as E, type FontCollection as F, type CSSAbsoluteLength as G, type CSSAngle as H, type CSSDefaultViewport as I, type CSSDynamicViewport as J, type CSSFrequency as K, type LocalStaticFontFile as L, type CSSFontRelativeLength as M, type CSSLargeViewport as N, type CSSPhysicalLength as O, type CSSRelativeLength as P, type CSSResolution as Q, type CSSRootFontRelativeLength as R, type SettingsKey as S, ThLineHeightOptions as T, type CSSSmallViewport as U, type VariableFontRangeConfig as V, type WeightConfig as W, type CSSTime as X, type CSSViewport as Y, type CSSColor as Z, type SystemFontSource as _, ThTextAlignOptions as a, type GoogleFontSource as a0, type LocalVariableFontFile as a1, type LocalStaticFontSource as a2, type LocalVariableFontSource as a3, type LocalFontSource as a4, type FontSource as a5, type FontSpec as a6, type ValidatedLanguageCollection as a7, type ThFontFamilyPref as a8, readiumCSSFontCollection as a9, defaultZoom as aA, defaultSpacingPresets as aB, lightTheme as aC, darkTheme as aD, paperTheme as aE, sepiaTheme as aF, contrast1Theme as aG, contrast2Theme as aH, contrast3Theme as aI, defaultFontCollection as aa, tamilCollection as ab, type I18nValue as ac, type CopyProtectionConfig as ad, type PrintProtectionConfig as ae, type ContentProtectionConfig as af, resolveContentProtectionConfig as ag, defaultContentProtectionConfig as ah, devContentProtectionConfig as ai, type ThSettingsGroupPref as aj, type ThSettingsRangePref as ak, type ThSettingsRadioPref as al, ThSettingsContainerKeys as am, ThSettingsRangeVariant as an, ThSettingsRangePlaceholder as ao, ThLayoutOptions as ap, defaultTextSettingsMain as aq, defaultTextSettingsSubpanel as ar, defaultSpacingSettingsMain as as, defaultSpacingSettingsSubpanel as at, defaultSpacingPresetsOrder as au, defaultParagraphSpacing as av, defaultParagraphIndent as aw, defaultWordSpacing as ax, defaultLetterSpacing as ay, defaultLineHeights as az, type ThPreferencesAdapter as b, type ThPreferences as c, type ThemeTokens as d, type FontDefinition as e, ThThemeKeys as f, ThSettingsKeys as g, ThTextSettingsKeys as h, ThSpacingSettingsKeys as i, ThSpacingPresetKeys as j, type ThemeKey as k, type TextSettingsKey as l, type SpacingSettingsKey as m, type ThSettingsSpacingPresets as n, type ThSpacingPreset as o, type ThActionsPref as p, type ThSettingsKeyTypes as q, type ThConstraintKeys as r, createPreferences as s, type ActionKeyType as t, useTheming as u, type ThemeKeyType as v, type SettingsKeyType as w, type TextSettingsKeyType as x, type SpacingSettingsKeyType as y, type useThemingProps as z };
@@ -2,7 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React__default, { ComponentType, SVGProps } from 'react';
3
3
  import { TooltipTriggerProps, KeyboardProps } from 'react-aria';
4
4
  import { ButtonProps, TooltipProps, MenuItemProps, LabelProps, MenuProps, MenuTriggerProps, PopoverProps, NumberFieldProps, GroupProps, InputProps, RadioGroupProps, RadioProps, SliderProps, SliderOutputProps, SliderTrackProps, SliderThumbProps, SwitchProps, HeadingProps, SelectProps, Button, ListBoxProps, ListBox, ListBoxItemProps, Heading } from 'react-aria-components';
5
- import { b as ThActionEntry, c as ThActionsBarProps, C as CollapsiblePref } from './useCollapsibility-CM1I24Ol.mjs';
5
+ import { p as ThActionEntry, q as ThActionsBarProps, C as CollapsiblePref } from './actions-BRtHsxpm.mjs';
6
6
 
7
7
  interface HTMLAttributesWithRef<T> extends React.HTMLAttributes<T> {
8
8
  ref?: React.ForwardedRef<T>;