@edrlab/thorium-web 1.0.8 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/{StatefulReader-BuuUEuKC.d.mts → StatefulReader-BjH7bkU1.d.mts} +2 -26
- package/dist/{ThPreferencesAdapter-CbAb0Vth.d.mts → ThPreferencesAdapter-x_D4c7wI.d.mts} +5 -0
- package/dist/chunk-7CGMWOZN.mjs +20 -0
- package/dist/chunk-7CGMWOZN.mjs.map +1 -0
- package/dist/{chunk-TA2ZMJMK.mjs → chunk-D24O64OP.mjs} +375 -278
- package/dist/chunk-D24O64OP.mjs.map +1 -0
- package/dist/{chunk-4M7DDKAT.mjs → chunk-FG6BJGVE.mjs} +5 -25
- package/dist/chunk-FG6BJGVE.mjs.map +1 -0
- package/dist/{chunk-SQHOOSST.mjs → chunk-HE3WFPGE.mjs} +84 -85
- package/dist/chunk-HE3WFPGE.mjs.map +1 -0
- package/dist/chunk-KKJA56IZ.mjs +27 -0
- package/dist/chunk-KKJA56IZ.mjs.map +1 -0
- package/dist/{chunk-7PJ2GDZA.mjs → chunk-SPAC7T57.mjs} +36 -21
- package/dist/chunk-SPAC7T57.mjs.map +1 -0
- package/dist/components/Epub/index.css +1282 -0
- package/dist/components/Epub/index.css.map +1 -0
- package/dist/components/Epub/index.d.mts +3 -3
- package/dist/components/Epub/index.mjs +49 -45
- package/dist/components/Epub/index.mjs.map +1 -1
- package/dist/components/Misc/index.css +102 -0
- package/dist/components/Misc/index.css.map +1 -0
- package/dist/components/Misc/index.d.mts +28 -0
- package/dist/components/Misc/index.mjs +110 -0
- package/dist/components/Misc/index.mjs.map +1 -0
- package/dist/components/WebPub/index.css +1214 -0
- package/dist/components/WebPub/index.css.map +1 -0
- package/dist/components/WebPub/index.d.mts +5 -5
- package/dist/components/WebPub/index.mjs +33 -27
- package/dist/components/WebPub/index.mjs.map +1 -1
- package/dist/core/Components/index.mjs +0 -1
- package/dist/core/Helpers/index.d.mts +12 -2
- package/dist/core/Helpers/index.mjs +1 -2
- package/dist/core/Hooks/index.mjs +0 -1
- package/dist/i18n/index.mjs +5 -5
- package/dist/lib/index.d.mts +2 -1
- package/dist/lib/index.mjs +2 -3
- package/dist/locales/et/thorium-web.json +1 -0
- package/dist/locales/it/thorium-web.json +1 -0
- package/dist/locales/pl/thorium-web.json +26 -13
- package/dist/locales/sv/thorium-web.json +37 -37
- package/dist/next-lib/index.mjs +0 -2
- package/dist/next-lib/index.mjs.map +1 -1
- package/dist/preferences/index.d.mts +4 -3
- package/dist/preferences/index.mjs +3 -4
- package/dist/{usePreferences-iJ5426UA.d.mts → usePreferences-CRjFlZvF.d.mts} +1 -1
- package/package.json +44 -40
- package/dist/backLink.module-QFOMD4RA.module.css +0 -36
- package/dist/chunk-3QS3WKRC.mjs +0 -29
- package/dist/chunk-3QS3WKRC.mjs.map +0 -1
- package/dist/chunk-4M7DDKAT.mjs.map +0 -1
- package/dist/chunk-7PJ2GDZA.mjs.map +0 -1
- package/dist/chunk-SQHOOSST.mjs.map +0 -1
- package/dist/chunk-TA2ZMJMK.mjs.map +0 -1
- package/dist/chunk-TTGURRX3.mjs +0 -19
- package/dist/chunk-TTGURRX3.mjs.map +0 -1
- package/dist/docking.module-TDNYZX4H.module.css +0 -40
- package/dist/jumpToPosition.module-4C47UYPE.module.css +0 -41
- package/dist/overflowMenu.module-QL32ISXF.module.css +0 -68
- package/dist/publicationGrid.module-T6ISNRGM.module.css +0 -70
- package/dist/reader-NGCQJKLX.css +0 -261
- package/dist/readerArrowButton.module-EFLOIADG.module.css +0 -77
- package/dist/readerHeader.module-RNGQFLVS.module.css +0 -35
- package/dist/readerLoader.module-KDBPCQZJ.module.css +0 -40
- package/dist/readerPagination.module-DYBZAQ7H.module.css +0 -76
- package/dist/readerProgression.module-7PU7L74S.module.css +0 -5
- package/dist/readerSharedUI.module-Y2VDWFS5.module.css +0 -98
- package/dist/settings.module-H5MUDFJO.module.css +0 -437
- package/dist/sheets.module-LJOLY4MK.module.css +0 -195
- package/dist/toc.module-F47C5CDS.module.css +0 -153
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"header": {
|
|
14
14
|
"label": "Górny pasek",
|
|
15
|
-
"runningHead": "
|
|
15
|
+
"runningHead": "Bieżący nagłówek",
|
|
16
16
|
"actions": "Akcje",
|
|
17
17
|
"backLink": {
|
|
18
18
|
"trigger": "Wróć do biblioteki",
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"wrapper": "Aktualny postęp",
|
|
27
27
|
"of": "{{ current }} z {{ reference }}",
|
|
28
28
|
"referenceFallback": "bieżący rozdział",
|
|
29
|
-
"pubFallback": "publikacja"
|
|
29
|
+
"pubFallback": "publikacja",
|
|
30
|
+
"positionsLeft": "{{ count }} pozostało w {{ reference }}"
|
|
30
31
|
},
|
|
31
32
|
"docker": {
|
|
32
33
|
"wrapper": "Opcje dokowania",
|
|
@@ -43,7 +44,7 @@
|
|
|
43
44
|
"tooltip": "Wyskakujące okno"
|
|
44
45
|
},
|
|
45
46
|
"fullscreen": {
|
|
46
|
-
"trigger": "
|
|
47
|
+
"trigger": "Wyświetlaj zawartość",
|
|
47
48
|
"tooltip": "Nakładka"
|
|
48
49
|
},
|
|
49
50
|
"close": {
|
|
@@ -159,17 +160,19 @@
|
|
|
159
160
|
"title": "Wybór czcionek",
|
|
160
161
|
"labels": {
|
|
161
162
|
"publisher": "Czcionka wydawcy",
|
|
162
|
-
"oldStyle": "
|
|
163
|
-
"modern": "
|
|
164
|
-
"sans": "
|
|
165
|
-
"humanist": "
|
|
163
|
+
"oldStyle": "Stary styl serif",
|
|
164
|
+
"modern": "",
|
|
165
|
+
"sans": "",
|
|
166
|
+
"humanist": "Humanista sans-serif",
|
|
166
167
|
"monospace": "O stałej szerokości"
|
|
167
168
|
}
|
|
168
169
|
},
|
|
169
170
|
"fontWeight": {
|
|
170
171
|
"title": "Grubość kroju",
|
|
171
172
|
"increase": "Zwiększ grubość kroju",
|
|
172
|
-
"decrease": "Zmniejsz grubość kroju"
|
|
173
|
+
"decrease": "Zmniejsz grubość kroju",
|
|
174
|
+
"default": "Normalny",
|
|
175
|
+
"bolder": "Wyraźny"
|
|
173
176
|
},
|
|
174
177
|
"normalizeText": {
|
|
175
178
|
"title": "Normalizacja tekstu",
|
|
@@ -194,9 +197,9 @@
|
|
|
194
197
|
}
|
|
195
198
|
},
|
|
196
199
|
"lineHeight": {
|
|
197
|
-
"title": "
|
|
200
|
+
"title": "Wysokość linii",
|
|
198
201
|
"publisher": "Domyślna",
|
|
199
|
-
"small": "
|
|
202
|
+
"small": "wąska",
|
|
200
203
|
"medium": "Zbalansowana",
|
|
201
204
|
"large": "Luźna"
|
|
202
205
|
},
|
|
@@ -228,19 +231,29 @@
|
|
|
228
231
|
"advanced": {
|
|
229
232
|
"tooltip": "Więcej opcji",
|
|
230
233
|
"trigger": "Więcej opcji odstępów"
|
|
234
|
+
},
|
|
235
|
+
"presets": {
|
|
236
|
+
"title": "Ustawienia wstępne",
|
|
237
|
+
"publisher": "Domyślne",
|
|
238
|
+
"tight": "Wąska",
|
|
239
|
+
"balanced": "zrównoważony",
|
|
240
|
+
"loose": "Luźne",
|
|
241
|
+
"accessible": "Dostępność",
|
|
242
|
+
"custom": "Własne"
|
|
231
243
|
}
|
|
232
244
|
},
|
|
233
245
|
"layout": {
|
|
234
246
|
"title": "Układ",
|
|
235
247
|
"scrolled": "Ciągły",
|
|
236
|
-
"paginated": "
|
|
248
|
+
"paginated": "Stronicowane"
|
|
237
249
|
},
|
|
238
250
|
"column": {
|
|
239
251
|
"title": "Kolumny",
|
|
240
|
-
"auto": "
|
|
252
|
+
"auto": "",
|
|
241
253
|
"one": "1 kol",
|
|
242
254
|
"two": "2 kol"
|
|
243
|
-
}
|
|
255
|
+
},
|
|
256
|
+
"reset": "Reset"
|
|
244
257
|
}
|
|
245
258
|
}
|
|
246
259
|
}
|
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
"auto": "Auto"
|
|
9
9
|
},
|
|
10
10
|
"tooltip": "Inställningar",
|
|
11
|
-
"trigger": "
|
|
12
|
-
"close": "Stäng
|
|
11
|
+
"trigger": "Inställningsmeny",
|
|
12
|
+
"close": "Stäng inställningsmenyn",
|
|
13
13
|
"heading": "Visningsinställningar",
|
|
14
14
|
"themes": {
|
|
15
15
|
"title": "Teman",
|
|
16
16
|
"auto": "Auto",
|
|
17
|
-
"light": "
|
|
17
|
+
"light": "Ljust",
|
|
18
18
|
"sepia": "Sepia",
|
|
19
19
|
"paper": "Papper",
|
|
20
|
-
"dark": "
|
|
20
|
+
"dark": "Mörkt",
|
|
21
21
|
"contrast1": "Kontrast 1",
|
|
22
22
|
"contrast2": "Kontrast 2",
|
|
23
23
|
"contrast3": "Kontrast 3"
|
|
@@ -44,18 +44,18 @@
|
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
"fontWeight": {
|
|
47
|
-
"title": "
|
|
48
|
-
"increase": "Öka
|
|
49
|
-
"decrease": "Minska
|
|
47
|
+
"title": "Teckenvikt",
|
|
48
|
+
"increase": "Öka teckenvikt",
|
|
49
|
+
"decrease": "Minska teckenvikt",
|
|
50
50
|
"default": "Normal",
|
|
51
51
|
"bolder": "Fetare"
|
|
52
52
|
},
|
|
53
53
|
"normalizeText": {
|
|
54
|
-
"title": "
|
|
54
|
+
"title": "Textformatering",
|
|
55
55
|
"label": "Ta bort all textformatering"
|
|
56
56
|
},
|
|
57
57
|
"align": {
|
|
58
|
-
"title": "
|
|
58
|
+
"title": "Justering",
|
|
59
59
|
"publisher": "Standard",
|
|
60
60
|
"left": "Vänster",
|
|
61
61
|
"justify": "Justera",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
},
|
|
64
64
|
"hyphens": {
|
|
65
65
|
"title": "Avstavning",
|
|
66
|
-
"label": "Aktivera
|
|
66
|
+
"label": "Aktivera avstavning"
|
|
67
67
|
},
|
|
68
68
|
"text": {
|
|
69
69
|
"title": "Text",
|
|
@@ -95,12 +95,12 @@
|
|
|
95
95
|
"decrease": "Minska ordavstånd"
|
|
96
96
|
},
|
|
97
97
|
"letterSpacing": {
|
|
98
|
-
"title": "
|
|
99
|
-
"increase": "Öka
|
|
100
|
-
"decrease": "Minska
|
|
98
|
+
"title": "Teckenavstånd",
|
|
99
|
+
"increase": "Öka teckenavstånd",
|
|
100
|
+
"decrease": "Minska teckenavstånd"
|
|
101
101
|
},
|
|
102
102
|
"publisherStyles": {
|
|
103
|
-
"label": "Använd
|
|
103
|
+
"label": "Använd originalformat"
|
|
104
104
|
},
|
|
105
105
|
"spacing": {
|
|
106
106
|
"title": "Avstånd",
|
|
@@ -120,18 +120,18 @@
|
|
|
120
120
|
},
|
|
121
121
|
"layout": {
|
|
122
122
|
"title": "Layout",
|
|
123
|
-
"scrolled": "
|
|
124
|
-
"paginated": "
|
|
123
|
+
"scrolled": "Rullningsbar",
|
|
124
|
+
"paginated": "Sidindelad"
|
|
125
125
|
},
|
|
126
126
|
"reset": "Återställ"
|
|
127
127
|
},
|
|
128
128
|
"app": {
|
|
129
|
-
"loading": "
|
|
130
|
-
"publicationWrapper": "Du
|
|
129
|
+
"loading": "Laddar",
|
|
130
|
+
"publicationWrapper": "Du är nu i boken.",
|
|
131
131
|
"docking": {
|
|
132
132
|
"dockingLeft": "Dockad panel till vänster",
|
|
133
133
|
"dockingRight": "Dockad panel till höger",
|
|
134
|
-
"dockingEmpty": "
|
|
134
|
+
"dockingEmpty": "Inget innehåll",
|
|
135
135
|
"dockingClosed": "Är stängd, innehåller {{ action }}",
|
|
136
136
|
"dockingCollapsed": "Är minimerad, innehåller {{ action }}"
|
|
137
137
|
},
|
|
@@ -140,18 +140,18 @@
|
|
|
140
140
|
"trigger": "Tillbaka till biblioteket",
|
|
141
141
|
"tooltip": "Bibliotek"
|
|
142
142
|
},
|
|
143
|
-
"label": "
|
|
144
|
-
"runningHead": "
|
|
143
|
+
"label": "Sidhuvud",
|
|
144
|
+
"runningHead": "Sidtitel",
|
|
145
145
|
"actions": "Åtgärder"
|
|
146
146
|
},
|
|
147
147
|
"footer": {
|
|
148
|
-
"label": "
|
|
148
|
+
"label": "Sidfot"
|
|
149
149
|
},
|
|
150
150
|
"progression": {
|
|
151
|
-
"wrapper": "
|
|
151
|
+
"wrapper": "Läsposition",
|
|
152
152
|
"of": "{{ current }} av {{ reference }}",
|
|
153
|
-
"referenceFallback": "
|
|
154
|
-
"pubFallback": "
|
|
153
|
+
"referenceFallback": "nuvarande kapitel",
|
|
154
|
+
"pubFallback": "boken",
|
|
155
155
|
"positionsLeft": "{{ count }} kvar i {{ reference }}"
|
|
156
156
|
},
|
|
157
157
|
"docker": {
|
|
@@ -165,12 +165,12 @@
|
|
|
165
165
|
"tooltip": "Docka höger"
|
|
166
166
|
},
|
|
167
167
|
"popover": {
|
|
168
|
-
"trigger": "Visa
|
|
168
|
+
"trigger": "Visa som fönster",
|
|
169
169
|
"tooltip": "Visa ovanpå"
|
|
170
170
|
},
|
|
171
171
|
"fullscreen": {
|
|
172
172
|
"trigger": "Visa ovanpå innehåll",
|
|
173
|
-
"tooltip": "
|
|
173
|
+
"tooltip": "Helskärm"
|
|
174
174
|
},
|
|
175
175
|
"close": {
|
|
176
176
|
"trigger": "Stäng",
|
|
@@ -185,25 +185,25 @@
|
|
|
185
185
|
"goForward": "Gå framåt",
|
|
186
186
|
"goBackward": "Gå bakåt",
|
|
187
187
|
"scroll": {
|
|
188
|
-
"wrapper": "Navigera i
|
|
188
|
+
"wrapper": "Navigera i boken",
|
|
189
189
|
"prevLabel": "Föregående",
|
|
190
190
|
"nextLabel": "Nästa",
|
|
191
|
-
"prevA11yLabel": "Gå till föregående
|
|
192
|
-
"nextA11yLabel": "Gå till nästa
|
|
191
|
+
"prevA11yLabel": "Gå till föregående avsnitt",
|
|
192
|
+
"nextA11yLabel": "Gå till nästa avsnitt"
|
|
193
193
|
}
|
|
194
194
|
},
|
|
195
195
|
"fullscreen": {
|
|
196
|
-
"tooltip": "
|
|
197
|
-
"trigger": "
|
|
196
|
+
"tooltip": "Helskärmsläge",
|
|
197
|
+
"trigger": "Starta eller avsluta helskärmsläge",
|
|
198
198
|
"close": "Avsluta helskärmsläge"
|
|
199
199
|
},
|
|
200
200
|
"toc": {
|
|
201
201
|
"tooltip": "Innehållsförteckning",
|
|
202
202
|
"trigger": "Innehållsförteckning",
|
|
203
|
-
"close": "Stäng
|
|
203
|
+
"close": "Stäng innehållsförteckningen",
|
|
204
204
|
"heading": "Innehållsförteckning",
|
|
205
|
-
"entries": "Poster i
|
|
206
|
-
"empty": "
|
|
205
|
+
"entries": "Poster i innehållsförteckningen",
|
|
206
|
+
"empty": "Den här boken saknar innehållsförteckning.",
|
|
207
207
|
"search": {
|
|
208
208
|
"label": "Sök",
|
|
209
209
|
"placeholder": "Sök",
|
|
@@ -214,8 +214,8 @@
|
|
|
214
214
|
"tooltip": "Hoppa till…",
|
|
215
215
|
"trigger": "Hoppa till position",
|
|
216
216
|
"heading": "Hoppa till position",
|
|
217
|
-
"go": "
|
|
218
|
-
"close": "
|
|
217
|
+
"go": "Hoppa",
|
|
218
|
+
"close": "Avbryt hoppa till position",
|
|
219
219
|
"label": "Välj en position från {{ positionStart }} till {{ positionEnd }}:"
|
|
220
220
|
},
|
|
221
221
|
"overflowMenu": {
|
package/dist/next-lib/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/next-lib/helpers/verifyManifest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/next-lib/helpers/verifyManifest.ts"],"names":[],"mappings":";AAyCO,IAAM,iBAAA,GAAoB,CAC/B,OAAA,KACyB;AACzB,EAAA,MAAM,EAAE,WAAA,EAAa,cAAA,GAAiB,EAAC,EAAG,kBAAkB,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa,YAAA,EAAa,GAAI,OAAA;AAEtG,EAAA,IAAI,CAAC,WAAA,EAAa;AAChB,IAAA,OAAO;AAAA,MACL,OAAA,EAAS,KAAA;AAAA,MACT,GAAA,EAAK,EAAA;AAAA,MACL,KAAA,EAAO;AAAA,KACT;AAAA,EACF;AAEA,EAAA,IAAI;AACF,IAAA,MAAM,GAAA,GAAM,IAAI,GAAA,CAAI,WAAW,CAAA;AAG/B,IAAA,MAAM,SAAA,GAAY,eAAA,IAChB,cAAA,CAAe,MAAA,KAAW,CAAA,IAC1B,cAAA,CAAe,QAAA,CAAS,GAAG,CAAA,IAC3B,cAAA,CAAe,IAAA,CAAK,CAAA,MAAA,KAAU;AAC5B,MAAA,IAAI;AACF,QAAA,MAAM,SAAA,GAAY,MAAA,CAAO,UAAA,CAAW,MAAM,CAAA,GACtC,IAAI,GAAA,CAAI,MAAM,CAAA,GACd,IAAI,GAAA,CAAI,CAAA,QAAA,EAAY,MAAO,CAAA,CAAE,CAAA;AACjC,QAAA,OAAO,GAAA,CAAI,aAAa,SAAA,CAAU,QAAA;AAAA,MACpC,CAAA,CAAA,MAAQ;AACN,QAAA,OAAO,KAAA;AAAA,MACT;AAAA,IACF,CAAC,CAAA;AAEH,IAAA,IAAI,CAAC,SAAA,EAAW;AACd,MAAA,OAAO;AAAA,QACL,OAAA,EAAS,KAAA;AAAA,QACT,GAAA,EAAK,WAAA;AAAA,QACL,KAAA,EAAO;AAAA,OACT;AAAA,IACF;AAEA,IAAA,OAAO;AAAA,MACL,OAAA,EAAS,IAAA;AAAA,MACT,GAAA,EAAK;AAAA,KACP;AAAA,EAEF,SAAS,KAAA,EAAO;AACd,IAAA,OAAO;AAAA,MACL,OAAA,EAAS,KAAA;AAAA,MACT,GAAA,EAAK,WAAA;AAAA,MACL,KAAA,EAAO;AAAA,KACT;AAAA,EACF;AACF;AAQO,IAAM,wBAAA,GAA2B,CAAC,WAAA,KAA8C;AACrF,EAAA,MAAM,iBAAA,GAAoB,OAAA,CAAQ,GAAA,CAAI,wBAAA,EAA0B,MAAK,IAAK,EAAA;AAC1E,EAAA,MAAM,cAAA,GAAiB,iBAAA,CACpB,KAAA,CAAM,GAAG,CAAA,CACT,GAAA,CAAI,CAAA,CAAA,KAAK,CAAA,CAAE,IAAA,EAAM,CAAA,CACjB,MAAA,CAAO,OAAO,CAAA;AAEjB,EAAA,OAAO,iBAAA,CAAkB;AAAA,IACvB,WAAA;AAAA,IACA,cAAA;AAAA,IACA,iBAAiB,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa,YAAA,IAAgB,eAAe,MAAA,KAAW;AAAA,GACrF,CAAA;AACH","file":"index.mjs","sourcesContent":["interface VerifyManifestOptions {\n /**\n * The URL of the manifest to verify\n */\n manifestUrl: string;\n \n /**\n * List of allowed domains (without protocol)\n * If empty or contains \"*\", all domains are allowed\n */\n allowedDomains?: string[];\n \n /**\n * Whether to allow all domains (overrides allowedDomains if true)\n * @default process.env.NODE_ENV !== \"production\"\n */\n allowAllDomains?: boolean;\n}\n\ninterface VerifyManifestResult {\n /**\n * Whether the manifest URL is allowed\n */\n allowed: boolean;\n \n /**\n * The normalized manifest URL\n */\n url: string;\n \n /**\n * Error message if verification failed\n */\n error?: string;\n}\n\n/**\n * Verifies if a manifest URL is allowed based on domain restrictions\n * @param options Verification options\n * @returns Verification result\n */\nexport const verifyManifestUrl = (\n options: VerifyManifestOptions\n): VerifyManifestResult => {\n const { manifestUrl, allowedDomains = [], allowAllDomains = process.env.NODE_ENV !== \"production\" } = options;\n \n if (!manifestUrl) {\n return {\n allowed: false,\n url: \"\",\n error: \"URL is required\"\n };\n }\n\n try {\n const url = new URL(manifestUrl);\n \n // In development or if no domains are specified, allow all\n const isAllowed = allowAllDomains || \n allowedDomains.length === 0 ||\n allowedDomains.includes(\"*\") ||\n allowedDomains.some(domain => {\n try {\n const domainUrl = domain.startsWith(\"http\") \n ? new URL(domain) \n : new URL(`https://${ domain }`);\n return url.hostname === domainUrl.hostname;\n } catch {\n return false;\n }\n });\n \n if (!isAllowed) {\n return {\n allowed: false,\n url: manifestUrl,\n error: \"Domain not allowed\"\n };\n }\n \n return {\n allowed: true,\n url: manifestUrl\n };\n \n } catch (error) {\n return {\n allowed: false,\n url: manifestUrl,\n error: \"Invalid URL\"\n };\n }\n}\n\n/**\n * Verifies a manifest URL from environment configuration\n * Uses MANIFEST_ALLOWED_DOMAINS environment variable for domain restrictions\n * @param manifestUrl The manifest URL to verify\n * @returns Verification result\n */\nexport const verifyManifestUrlFromEnv = (manifestUrl: string): VerifyManifestResult => {\n const allowedDomainsRaw = process.env.MANIFEST_ALLOWED_DOMAINS?.trim() || \"\";\n const allowedDomains = allowedDomainsRaw\n .split(\",\")\n .map(d => d.trim())\n .filter(Boolean);\n \n return verifyManifestUrl({\n manifestUrl,\n allowedDomains,\n allowAllDomains: process.env.NODE_ENV !== \"production\" || allowedDomains.length === 0\n });\n}\n"]}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { C as CustomizableKeys, D as DefaultKeys, a as ThPreferences, T as ThPreferencesAdapter, b as ThemeTokens } from '../ThPreferencesAdapter-
|
|
2
|
-
export { A as ActionKey, E as ActionKeyType, I as I18nValue, S as SettingsKey, G as SettingsKeyType, n as SpacingSettingsKey, J as SpacingSettingsKeyType, m as TextSettingsKey, H as TextSettingsKeyType, h as ThActionsDockedPref, o as ThActionsPref, g as ThActionsSnappedPref, i as ThActionsTokens, c as ThBackLinkContent, e as ThBackLinkPref, f as ThBottomSheetDetent, v as ThConstraintKeys, p as ThDockingPref, x as ThFormatPref, w as ThFormatPrefValue, z as ThPaginatedAffordancePref, y as ThPaginatedAffordancePrefValue, q as ThSettingsGroupPref, t as ThSettingsKeyTypes, s as ThSettingsRadioPref, r as ThSettingsRangePref, j as ThSettingsSpacingPresets, k as ThSpacingPreset, l as ThemeKey, F as ThemeKeyType, B as createPreferences, L as defaultActionKeysObject, d as defaultFontFamilyOptions, W as defaultLetterSpacing, X as defaultLineHeights, U as defaultParagraphIndent, R as defaultParagraphSpacing, Z as defaultSpacingPresets, Q as defaultSpacingPresetsOrder, O as defaultSpacingSettingsMain, P as defaultSpacingSettingsSubpanel, M as defaultTextSettingsMain, N as defaultTextSettingsSubpanel, V as defaultWordSpacing, Y as defaultZoom, u as useTheming, K as useThemingProps } from '../ThPreferencesAdapter-
|
|
1
|
+
import { C as CustomizableKeys, D as DefaultKeys, a as ThPreferences, T as ThPreferencesAdapter, b as ThemeTokens } from '../ThPreferencesAdapter-x_D4c7wI.mjs';
|
|
2
|
+
export { A as ActionKey, E as ActionKeyType, I as I18nValue, S as SettingsKey, G as SettingsKeyType, n as SpacingSettingsKey, J as SpacingSettingsKeyType, m as TextSettingsKey, H as TextSettingsKeyType, h as ThActionsDockedPref, o as ThActionsPref, g as ThActionsSnappedPref, i as ThActionsTokens, c as ThBackLinkContent, e as ThBackLinkPref, f as ThBottomSheetDetent, v as ThConstraintKeys, p as ThDockingPref, x as ThFormatPref, w as ThFormatPrefValue, z as ThPaginatedAffordancePref, y as ThPaginatedAffordancePrefValue, q as ThSettingsGroupPref, t as ThSettingsKeyTypes, s as ThSettingsRadioPref, r as ThSettingsRangePref, j as ThSettingsSpacingPresets, k as ThSpacingPreset, l as ThemeKey, F as ThemeKeyType, B as createPreferences, L as defaultActionKeysObject, d as defaultFontFamilyOptions, W as defaultLetterSpacing, X as defaultLineHeights, U as defaultParagraphIndent, R as defaultParagraphSpacing, Z as defaultSpacingPresets, Q as defaultSpacingPresetsOrder, O as defaultSpacingSettingsMain, P as defaultSpacingSettingsSubpanel, M as defaultTextSettingsMain, N as defaultTextSettingsSubpanel, V as defaultWordSpacing, Y as defaultZoom, u as useTheming, K as useThemingProps } from '../ThPreferencesAdapter-x_D4c7wI.mjs';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
export { T as ThPreferencesProvider, u as usePreferences } from '../usePreferences-
|
|
4
|
+
export { T as ThPreferencesProvider, u as usePreferences } from '../usePreferences-CRjFlZvF.mjs';
|
|
5
5
|
import { T as ThColorScheme } from '../useContrast-Cgsrl7GS.mjs';
|
|
6
6
|
import { d as ThActionsKeys, e as ThThemeKeys, f as ThSettingsKeys, g as ThTextSettingsKeys, h as ThSpacingSettingsKeys, i as ThSpacingPresetKeys } from '../enums-CBaXSsr9.mjs';
|
|
7
7
|
export { l as ThArrowVariant, k as ThBackLinkVariant, b as ThBreakpoints, c as ThDockingKeys, p as ThDockingTypes, m as ThDocumentTitleFormat, v as ThLayoutDirection, w as ThLayoutOptions, j as ThLayoutUI, T as ThLineHeightOptions, o as ThProgressionFormat, n as ThRunningHeadFormat, q as ThSettingsContainerKeys, s as ThSettingsRangePlaceholder, r as ThSettingsRangeVariant, u as ThSheetHeaderVariant, t as ThSheetTypes, a as ThTextAlignOptions } from '../enums-CBaXSsr9.mjs';
|
|
8
8
|
import '../keyboardUtilities-BWAyLS_D.mjs';
|
|
9
9
|
import '../useBreakpoints-BtHd3571.mjs';
|
|
10
|
+
import '@readium/navigator';
|
|
10
11
|
import '../useCollapsibility-CM1I24Ol.mjs';
|
|
11
12
|
import 'react/jsx-runtime';
|
|
12
13
|
import 'react-aria-components';
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
export { ThMemoryPreferencesAdapter, ThPreferencesContext, ThPreferencesProvider, buildThemeObject, createPreferences, defaultActionKeysObject, defaultFontFamilyOptions, defaultLetterSpacing, defaultLineHeights, defaultParagraphIndent, defaultParagraphSpacing, defaultPreferences, defaultPreferencesContextValue, defaultSpacingPresets, defaultSpacingPresetsOrder, defaultSpacingSettingsMain, defaultSpacingSettingsSubpanel, defaultTextSettingsMain, defaultTextSettingsSubpanel, defaultWordSpacing, defaultZoom, usePreferenceKeys, usePreferences, useTheming } from '../chunk-
|
|
1
|
+
export { ThMemoryPreferencesAdapter, ThPreferencesContext, ThPreferencesProvider, buildThemeObject, createPreferences, defaultActionKeysObject, defaultFontFamilyOptions, defaultLetterSpacing, defaultLineHeights, defaultParagraphIndent, defaultParagraphSpacing, defaultPreferences, defaultPreferencesContextValue, defaultSpacingPresets, defaultSpacingPresetsOrder, defaultSpacingSettingsMain, defaultSpacingSettingsSubpanel, defaultTextSettingsMain, defaultTextSettingsSubpanel, defaultWordSpacing, defaultZoom, usePreferenceKeys, usePreferences, useTheming } from '../chunk-SPAC7T57.mjs';
|
|
2
|
+
import '../chunk-7CGMWOZN.mjs';
|
|
2
3
|
import '../chunk-BNPR6V7V.mjs';
|
|
4
|
+
import '../chunk-5LUMM7FW.mjs';
|
|
3
5
|
import '../chunk-NQ2ZSGCX.mjs';
|
|
4
6
|
import '../chunk-MLEYTQGK.mjs';
|
|
5
|
-
import '../chunk-TTGURRX3.mjs';
|
|
6
|
-
import '../chunk-5LUMM7FW.mjs';
|
|
7
7
|
export { ThActionsKeys, ThArrowVariant, ThBackLinkVariant, ThBreakpoints, ThDockingKeys, ThDockingTypes, ThDocumentTitleFormat, ThLayoutDirection, ThLayoutOptions, ThLayoutUI, ThLineHeightOptions, ThProgressionFormat, ThRunningHeadFormat, ThSettingsContainerKeys, ThSettingsKeys, ThSettingsRangePlaceholder, ThSettingsRangeVariant, ThSheetHeaderVariant, ThSheetTypes, ThSpacingPresetKeys, ThSpacingSettingsKeys, ThTextAlignOptions, ThTextSettingsKeys, ThThemeKeys } from '../chunk-CVM2ZAPL.mjs';
|
|
8
|
-
import '../chunk-3QS3WKRC.mjs';
|
|
9
8
|
//# sourceMappingURL=index.mjs.map
|
|
10
9
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { C as CustomizableKeys, D as DefaultKeys, T as ThPreferencesAdapter, a as ThPreferences } from './ThPreferencesAdapter-
|
|
2
|
+
import { C as CustomizableKeys, D as DefaultKeys, T as ThPreferencesAdapter, a as ThPreferences } from './ThPreferencesAdapter-x_D4c7wI.mjs';
|
|
3
3
|
|
|
4
4
|
type Props<K extends CustomizableKeys = DefaultKeys> = {
|
|
5
5
|
adapter?: ThPreferencesAdapter<K>;
|
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"bugs": {
|
|
21
21
|
"url": "https://github.com/edrlab/thorium-web/issues"
|
|
22
22
|
},
|
|
23
|
-
"version": "1.0
|
|
23
|
+
"version": "1.1.0",
|
|
24
24
|
"private": false,
|
|
25
25
|
"files": [
|
|
26
26
|
"./dist"
|
|
@@ -36,75 +36,79 @@
|
|
|
36
36
|
"./core/lib": "./dist/lib/index.mjs",
|
|
37
37
|
"./core/preferences": "./dist/preferences/index.mjs",
|
|
38
38
|
"./epub": "./dist/components/Epub/index.mjs",
|
|
39
|
+
"./epub/styles": "./dist/components/Epub/index.css",
|
|
40
|
+
"./misc": "./dist/components/Misc/index.mjs",
|
|
41
|
+
"./misc/styles": "./dist/components/Misc/index.css",
|
|
39
42
|
"./next": "./dist/next-lib/index.mjs",
|
|
40
|
-
"./webpub": "./dist/components/WebPub/index.mjs"
|
|
43
|
+
"./webpub": "./dist/components/WebPub/index.mjs",
|
|
44
|
+
"./webpub/styles": "./dist/components/WebPub/index.css"
|
|
41
45
|
},
|
|
42
46
|
"scripts": {
|
|
43
47
|
"dev": "next dev",
|
|
44
48
|
"build": "next build",
|
|
45
49
|
"start": "next start",
|
|
46
|
-
"lint": "
|
|
50
|
+
"lint": "eslint .",
|
|
47
51
|
"deploy": "npx @cloudflare/next-on-pages && npx wrangler pages deploy",
|
|
48
52
|
"preinstall": "npx only-allow pnpm",
|
|
49
53
|
"copy-locales": "cpx \"public/locales/**/*\" dist/locales",
|
|
50
54
|
"bundle": "tsup --config tsup.config.ts && pnpm copy-locales"
|
|
51
55
|
},
|
|
52
56
|
"peerDependencies": {
|
|
53
|
-
"@readium/css": "2.0.0-beta.
|
|
54
|
-
"@readium/navigator": "
|
|
55
|
-
"@readium/navigator-html-injectables": "
|
|
56
|
-
"@readium/shared": "
|
|
57
|
-
"@reduxjs/toolkit": "^2.
|
|
58
|
-
"i18next": "^25.
|
|
57
|
+
"@readium/css": "2.0.0-beta.24",
|
|
58
|
+
"@readium/navigator": "2.2.5",
|
|
59
|
+
"@readium/navigator-html-injectables": "2.2.2",
|
|
60
|
+
"@readium/shared": "2.1.2",
|
|
61
|
+
"@reduxjs/toolkit": "^2.11.2",
|
|
62
|
+
"i18next": "^25.7.4",
|
|
59
63
|
"i18next-browser-languagedetector": "^8.2.0",
|
|
60
64
|
"i18next-http-backend": "^3.0.2",
|
|
61
|
-
"motion": "^12.
|
|
62
|
-
"react": "^19.2.
|
|
63
|
-
"react-aria": "^3.
|
|
64
|
-
"react-aria-components": "^1.
|
|
65
|
-
"react-dom": "^19.2.
|
|
66
|
-
"react-i18next": "^16.
|
|
65
|
+
"motion": "^12.26.2",
|
|
66
|
+
"react": "^19.2.3",
|
|
67
|
+
"react-aria": "^3.45.0",
|
|
68
|
+
"react-aria-components": "^1.14.0",
|
|
69
|
+
"react-dom": "^19.2.3",
|
|
70
|
+
"react-i18next": "^16.5.3",
|
|
67
71
|
"react-modal-sheet": "^5.2.1",
|
|
68
72
|
"react-redux": "^9.2.0",
|
|
69
73
|
"react-resizable-panels": "^3.0.6",
|
|
70
|
-
"react-stately": "^3.
|
|
74
|
+
"react-stately": "^3.43.0"
|
|
71
75
|
},
|
|
72
76
|
"dependencies": {
|
|
73
|
-
"@readium/css": "2.0.0-beta.
|
|
74
|
-
"@readium/navigator": "
|
|
75
|
-
"@readium/navigator-html-injectables": "
|
|
76
|
-
"@readium/shared": "
|
|
77
|
-
"@reduxjs/toolkit": "^2.
|
|
77
|
+
"@readium/css": "2.0.0-beta.24",
|
|
78
|
+
"@readium/navigator": "2.2.5",
|
|
79
|
+
"@readium/navigator-html-injectables": "2.2.2",
|
|
80
|
+
"@readium/shared": "2.1.2",
|
|
81
|
+
"@reduxjs/toolkit": "^2.11.2",
|
|
78
82
|
"classnames": "^2.5.1",
|
|
79
|
-
"debounce": "^
|
|
80
|
-
"i18next": "^25.
|
|
83
|
+
"debounce": "^3.0.0",
|
|
84
|
+
"i18next": "^25.7.4",
|
|
81
85
|
"i18next-browser-languagedetector": "^8.2.0",
|
|
82
86
|
"i18next-http-backend": "^3.0.2",
|
|
83
|
-
"motion": "^12.
|
|
84
|
-
"next": "
|
|
85
|
-
"react": "^19.2.
|
|
86
|
-
"react-aria": "^3.
|
|
87
|
-
"react-aria-components": "^1.
|
|
88
|
-
"react-dom": "^19.2.
|
|
89
|
-
"react-i18next": "^16.
|
|
87
|
+
"motion": "^12.26.2",
|
|
88
|
+
"next": "16.1.2",
|
|
89
|
+
"react": "^19.2.3",
|
|
90
|
+
"react-aria": "^3.45.0",
|
|
91
|
+
"react-aria-components": "^1.14.0",
|
|
92
|
+
"react-dom": "^19.2.3",
|
|
93
|
+
"react-i18next": "^16.5.3",
|
|
90
94
|
"react-modal-sheet": "^5.2.1",
|
|
91
95
|
"react-redux": "^9.2.0",
|
|
92
96
|
"react-resizable-panels": "^3.0.6",
|
|
93
|
-
"react-stately": "^3.
|
|
97
|
+
"react-stately": "^3.43.0"
|
|
94
98
|
},
|
|
95
99
|
"devDependencies": {
|
|
96
100
|
"@svgr/webpack": "^8.1.0",
|
|
97
101
|
"@types/css-modules": "^1.0.5",
|
|
98
|
-
"@types/node": "^22.
|
|
99
|
-
"@types/react": "^19.2.
|
|
100
|
-
"@types/react-dom": "^19.2.
|
|
102
|
+
"@types/node": "^22.19.7",
|
|
103
|
+
"@types/react": "^19.2.8",
|
|
104
|
+
"@types/react-dom": "^19.2.3",
|
|
101
105
|
"cpx2": "^8.0.0",
|
|
102
106
|
"esbuild-plugin-svgr": "^3.1.1",
|
|
103
|
-
"eslint": "^9.
|
|
104
|
-
"eslint-config-next": "
|
|
105
|
-
"glob": "^
|
|
106
|
-
"immer": "
|
|
107
|
-
"tsup": "^8.5.
|
|
107
|
+
"eslint": "^9.39.2",
|
|
108
|
+
"eslint-config-next": "16.1.2",
|
|
109
|
+
"glob": "^13.0.0",
|
|
110
|
+
"immer": "11.1.2",
|
|
111
|
+
"tsup": "^8.5.1",
|
|
108
112
|
"typescript": "^5.9.3"
|
|
109
113
|
}
|
|
110
|
-
}
|
|
114
|
+
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
.backLink {
|
|
2
|
-
display: block;
|
|
3
|
-
box-sizing: content-box;
|
|
4
|
-
padding: calc(var(--icon-size, 24px) * (1/4));
|
|
5
|
-
text-align: start;
|
|
6
|
-
border-radius: var(--layout-radius);
|
|
7
|
-
max-width: 100%;
|
|
8
|
-
height: var(--icon-size, 24px);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.backLink svg {
|
|
12
|
-
fill: var(--theme-text);
|
|
13
|
-
max-width: 100%;
|
|
14
|
-
height: 100%;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.backLink img {
|
|
18
|
-
max-width: 100%;
|
|
19
|
-
height: 100%;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.backLink[data-hovered] {
|
|
23
|
-
background-color: var(--theme-hover);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.backLink[data-focus-visible] {
|
|
27
|
-
outline: 2px solid var(--theme-focus);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.backLink[data-disabled] {
|
|
31
|
-
color: var(--theme-disable)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.backLink[data-disabled] svg {
|
|
35
|
-
fill: var(--theme-disable);
|
|
36
|
-
}
|
package/dist/chunk-3QS3WKRC.mjs
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
-
mod
|
|
25
|
-
));
|
|
26
|
-
|
|
27
|
-
export { __commonJS, __toESM };
|
|
28
|
-
//# sourceMappingURL=chunk-3QS3WKRC.mjs.map
|
|
29
|
-
//# sourceMappingURL=chunk-3QS3WKRC.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-3QS3WKRC.mjs"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/i18n/config.ts","../src/i18n/ThI18nProvider.tsx","../src/i18n/useI18n.ts"],"names":["i18n"],"mappings":";;;;;;;;;;AAMO,IAAM,cAAA,GAA8B;AAAA,EACzC,WAAA,EAAa,IAAA;AAAA,EACb,IAAA,EAAM,KAAA;AAAA,EACN,wBAAA,EAA0B,IAAA;AAAA,EAC1B,SAAA,EAAW;AAAA,IACT,KAAA,EAAO,CAAC,WAAW,CAAA;AAAA,IACnB,QAAQ;AAAC,GACX;AAAA,EACA,aAAA,EAAe;AAAA,IACb,WAAA,EAAa;AAAA,GACf;AAAA,EACA,OAAA,EAAS;AAAA,IACP,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,EAAA,EAAI,CAAC,aAAa,CAAA;AAAA,EAClB,SAAA,EAAW;AACb;AAEO,IAAM,QAAA,GAAW,OAAO,OAAA,GAAgC,EAAC,KAAM;AACpE,EAAA,IAAI,KAAK,aAAA,EAAe;AACtB,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,OAAO,IAAA,CACJ,GAAA,CAAI,OAAO,CAAA,CACX,GAAA,CAAI,gBAAgB,CAAA,CACpB,GAAA,CAAI,gBAAgB,CAAA,CACpB,IAAA,CAAK;AAAA,IACJ,GAAG,cAAA;AAAA,IACH,GAAG;AAAA,GACJ,CAAA;AACL;ACzBO,IAAM,iBAAiB,CAAC;AAAA,EAC7B,QAAA;AAAA,EACA,GAAG;AACL,CAAA,KAA2B;AACzB,EAAA,MAAM,EAAE,WAAA,EAAY,GAAI,cAAA,EAAe;AACvC,EAAA,MAAM,CAAC,aAAA,EAAe,gBAAgB,CAAA,GAAI,SAAS,KAAK,CAAA;AAExD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,CAAC,KAAK,aAAA,EAAe;AACvB,MAAA,QAAA,CAAS;AAAA,QACP,GAAG,OAAA;AAAA,QACH,GAAA,EAAK,WAAA,EAAa,MAAA,IAAU,OAAA,CAAQ;AAAA,OACrC,CAAA,CAAE,IAAA,CAAK,MAAM,gBAAA,CAAiB,IAAI,CAAC,CAAA;AAAA,IACtC;AAAA,EACF,CAAC,CAAA;AAED,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,aAAA,IAAiB,aAAa,MAAA,EAAQ;AACxC,MAAA,IAAA,CAAK,cAAA,CAAe,YAAY,MAAM,CAAA;AAAA,IACxC;AAAA,EACF,CAAA,EAAG,CAAC,WAAA,EAAa,MAAA,EAAQ,aAAa,CAAC,CAAA;AAEvC,EAAA,IAAI,CAAC,aAAA,EAAe;AAClB,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,uBAAO,GAAA,CAAC,eAAA,EAAA,EAAgB,IAAA,EAAgB,QAAA,EAAU,CAAA;AACpD;AChCO,IAAM,OAAA,GAAU,CAAC,EAAA,GAAa,aAAA,KAAkB;AACrD,EAAA,MAAM,EAAE,CAAA,EAAG,IAAA,EAAAA,OAAM,KAAA,EAAM,GAAI,eAAe,EAAE,CAAA;AAG5C,EAAA,MAAM,cAAA,GAAiB,CAAC,GAAA,KAAgB;AACtC,IAAA,OAAOA,KAAAA,CAAK,eAAe,GAAG,CAAA;AAAA,EAChC,CAAA;AAEA,EAAA,OAAO;AAAA;AAAA,IAEL,CAAA;AAAA;AAAA,IAEA,IAAA,EAAAA,KAAAA;AAAA;AAAA,IAEA,KAAA;AAAA;AAAA,IAEA,iBAAiBA,KAAAA,CAAK,QAAA;AAAA;AAAA,IAEtB,WAAWA,KAAAA,CAAK,SAAA;AAAA;AAAA,IAEhB;AAAA,GACF;AACF","file":"chunk-4M7DDKAT.mjs","sourcesContent":["import i18n from \"i18next\";\nimport { initReactI18next } from \"react-i18next\";\nimport LanguageDetector from \"i18next-browser-languagedetector\";\nimport Backend from \"i18next-http-backend\";\nimport { InitOptions } from \"i18next\";\n\nexport const DEFAULT_CONFIG: InitOptions = {\n fallbackLng: \"en\",\n load: \"all\",\n nonExplicitSupportedLngs: true,\n detection: {\n order: [\"navigator\"],\n caches: []\n },\n interpolation: {\n escapeValue: false\n },\n backend: {\n loadPath: \"/locales/{{lng}}/{{ns}}.json\"\n },\n ns: [\"thorium-web\"],\n defaultNS: \"thorium-web\"\n};\n\nexport const initI18n = async (options: Partial<InitOptions> = {}) => {\n if (i18n.isInitialized) {\n return i18n;\n }\n\n return i18n\n .use(Backend)\n .use(LanguageDetector)\n .use(initReactI18next)\n .init({\n ...DEFAULT_CONFIG,\n ...options\n });\n};\n\nexport { i18n };","\"use client\";\n\nimport React, { ReactNode, useEffect, useState } from \"react\";\nimport { I18nextProvider } from \"react-i18next\";\nimport { i18n, initI18n } from \"./config\";\nimport { InitOptions } from \"i18next\";\nimport { usePreferences } from \"@/preferences\";\n\nexport type ThI18nProviderProps = {\n children: ReactNode;\n} & Partial<InitOptions>;\n\nexport const ThI18nProvider = ({\n children,\n ...options\n}: ThI18nProviderProps) => {\n const { preferences } = usePreferences();\n const [isInitialized, setIsInitialized] = useState(false);\n \n useEffect(() => {\n if (!i18n.isInitialized) { \n initI18n({\n ...options,\n lng: preferences?.locale || options.lng,\n }).then(() => setIsInitialized(true));\n }\n });\n\n useEffect(() => {\n if (isInitialized && preferences?.locale) {\n i18n.changeLanguage(preferences.locale);\n }\n }, [preferences?.locale, isInitialized]);\n\n if (!isInitialized) {\n return null;\n }\n\n return <I18nextProvider i18n={ i18n }>{ children }</I18nextProvider>;\n};\n\nexport default ThI18nProvider;\n","import { useTranslation } from \"react-i18next\";\n\n/**\n * Hook to access the i18n instance and translation functions\n * @param ns The namespace to use for translations (defaults to DEFAULT_NAMESPACE)\n * @returns Translation functions and i18n instance\n */\nexport const useI18n = (ns: string = \"thorium-web\") => {\n const { t, i18n, ready } = useTranslation(ns);\n \n // Helper function to change language\n const changeLanguage = (lng: string) => {\n return i18n.changeLanguage(lng);\n };\n\n return {\n // Translation function\n t,\n // i18n instance\n i18n,\n // Whether translations are loaded\n ready,\n // Current language\n currentLanguage: i18n.language,\n // List of available languages\n languages: i18n.languages,\n // Function to change language\n changeLanguage\n };\n};\n"]}
|