@venix-sistemas/jade 1.2.0 → 1.3.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 +367 -157
- package/dist/module.json +1 -1
- package/dist/module.mjs +66 -4
- package/dist/runtime/components/VenixThemeSwitcher.d.vue.ts +2 -0
- package/dist/runtime/components/VenixThemeSwitcher.vue +413 -70
- package/dist/runtime/components/VenixThemeSwitcher.vue.d.ts +2 -0
- package/dist/runtime/composables/useThemeColors.d.ts +2 -2
- package/dist/runtime/composables/useThemeCookies.d.ts +8 -0
- package/dist/runtime/composables/useThemeCookies.js +20 -1
- package/dist/runtime/composables/useThemeLocale.d.ts +2 -2
- package/dist/runtime/composables/useThemeSeasonal.d.ts +2 -2
- package/dist/runtime/composables/useVenixTheme.d.ts +20 -0
- package/dist/runtime/composables/useVenixTheme.js +86 -9
- package/dist/runtime/plugins/overlay-scrollbars.client.d.ts +2 -0
- package/dist/runtime/plugins/overlay-scrollbars.client.js +89 -0
- package/dist/runtime/scripts/theme-init.d.ts +12 -3
- package/dist/runtime/scripts/theme-init.js +21 -4
- package/dist/shared/constants.d.ts +54 -0
- package/dist/shared/constants.js +20 -0
- package/dist/shared/css/cursor-svg.d.ts +10 -0
- package/dist/shared/css/cursor-svg.js +28 -0
- package/dist/shared/css/cursor.js +78 -33
- package/dist/shared/css/scrollbar.js +61 -7
- package/dist/shared/css/typography.js +13 -0
- package/dist/shared/theme.json +14 -8
- package/dist/shared/types/cursor.d.ts +34 -4
- package/dist/shared/types/index.d.ts +2 -2
- package/dist/shared/types/runtime-config.d.ts +1 -0
- package/dist/shared/types/scrollbar.d.ts +11 -0
- package/dist/shared/types/theme.d.ts +7 -0
- package/dist/shared/types/typography.d.ts +2 -1
- package/dist/shared/utils/load.d.ts +2 -2
- package/dist/shared/utils/load.js +2 -1
- package/dist/shared/utils/theme-config.d.ts +3 -3
- package/dist/shared/utils/theme-config.js +0 -1
- package/dist/shared/utils/theme-resolve.d.ts +11 -2
- package/dist/shared/utils/theme-resolve.js +18 -0
- package/dist/shared/utils/theme-resolver.d.ts +1 -0
- package/dist/shared/utils/theme-resolver.js +1 -0
- package/package.json +10 -1
|
@@ -44,66 +44,140 @@
|
|
|
44
44
|
<Transition name="venix-theme-switcher-menu">
|
|
45
45
|
<div
|
|
46
46
|
v-show="open"
|
|
47
|
+
ref="menuRef"
|
|
47
48
|
class="venix-theme-switcher__menu"
|
|
49
|
+
:class="{ 'venix-theme-switcher__menu--above': placeAbove }"
|
|
50
|
+
:style="menuStyle"
|
|
48
51
|
role="menu"
|
|
52
|
+
tabindex="-1"
|
|
49
53
|
:aria-label="resolvedLabel"
|
|
50
54
|
@keydown="handleMenuKeydown"
|
|
51
55
|
>
|
|
52
56
|
<div
|
|
53
|
-
|
|
54
|
-
|
|
57
|
+
v-if="view === 'settings'"
|
|
58
|
+
key="settings"
|
|
59
|
+
class="venix-theme-switcher__view venix-theme-switcher__view--settings"
|
|
55
60
|
>
|
|
56
|
-
|
|
57
|
-
|
|
61
|
+
<div class="venix-theme-switcher__header">
|
|
62
|
+
<button
|
|
63
|
+
type="button"
|
|
64
|
+
role="menuitem"
|
|
65
|
+
class="venix-theme-switcher__icon-button"
|
|
66
|
+
:aria-label="backLabel"
|
|
67
|
+
:title="backLabel"
|
|
68
|
+
@click="showView('main')"
|
|
69
|
+
>
|
|
70
|
+
<span
|
|
71
|
+
v-if="icons.back?.format === 'emote'"
|
|
72
|
+
class="venix-icon venix-icon--emoji"
|
|
73
|
+
aria-hidden="true"
|
|
74
|
+
>{{ icons.back.value }}</span>
|
|
75
|
+
<VenixIcon
|
|
76
|
+
v-else-if="icons.back"
|
|
77
|
+
:icon="icons.back.value"
|
|
78
|
+
:mode="icons.back.format"
|
|
79
|
+
aria-hidden="true"
|
|
80
|
+
/>
|
|
81
|
+
</button>
|
|
82
|
+
<div
|
|
83
|
+
class="venix-theme-switcher__heading"
|
|
84
|
+
aria-hidden="true"
|
|
85
|
+
>
|
|
86
|
+
{{ settingsHeading }}
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
58
89
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
90
|
+
<div
|
|
91
|
+
class="venix-theme-switcher__separator"
|
|
92
|
+
role="separator"
|
|
93
|
+
/>
|
|
63
94
|
|
|
64
|
-
<div
|
|
65
|
-
class="venix-theme-switcher__group"
|
|
66
|
-
role="group"
|
|
67
|
-
:aria-label="modeHeading"
|
|
68
|
-
>
|
|
69
95
|
<div
|
|
70
|
-
class="venix-theme-
|
|
71
|
-
|
|
96
|
+
class="venix-theme-switcher__group"
|
|
97
|
+
role="group"
|
|
98
|
+
:aria-label="settingsHeading"
|
|
72
99
|
>
|
|
73
|
-
{{ modeHeading }}
|
|
74
|
-
</div>
|
|
75
|
-
<div class="venix-theme-switcher__modes">
|
|
76
100
|
<button
|
|
77
|
-
v-for="
|
|
78
|
-
:key="
|
|
101
|
+
v-for="option in settingsOptions"
|
|
102
|
+
:key="option.key"
|
|
79
103
|
type="button"
|
|
80
|
-
role="
|
|
81
|
-
class="venix-theme-switcher__item venix-theme-switcher__item--
|
|
82
|
-
:class="{ 'venix-theme-switcher__item--
|
|
83
|
-
:aria-checked="
|
|
84
|
-
@click="
|
|
104
|
+
role="menuitemcheckbox"
|
|
105
|
+
class="venix-theme-switcher__item venix-theme-switcher__item--toggle"
|
|
106
|
+
:class="{ 'venix-theme-switcher__item--on': option.enabled }"
|
|
107
|
+
:aria-checked="option.enabled"
|
|
108
|
+
@click="option.toggle()"
|
|
85
109
|
>
|
|
86
110
|
<span
|
|
87
|
-
v-if="
|
|
111
|
+
v-if="option.icon?.format === 'emote'"
|
|
88
112
|
class="venix-icon venix-icon--emoji venix-theme-switcher__item-icon"
|
|
89
113
|
aria-hidden="true"
|
|
90
|
-
>{{
|
|
114
|
+
>{{ option.icon.value }}</span>
|
|
91
115
|
<VenixIcon
|
|
92
|
-
v-else-if="
|
|
116
|
+
v-else-if="option.icon"
|
|
93
117
|
class="venix-theme-switcher__item-icon"
|
|
94
|
-
:icon="
|
|
95
|
-
:mode="
|
|
118
|
+
:icon="option.icon.value"
|
|
119
|
+
:mode="option.icon.format"
|
|
120
|
+
aria-hidden="true"
|
|
121
|
+
/>
|
|
122
|
+
<span class="venix-theme-switcher__item-text">
|
|
123
|
+
<span class="venix-theme-switcher__item-title">{{ option.title }}</span>
|
|
124
|
+
<span
|
|
125
|
+
v-if="option.description"
|
|
126
|
+
class="venix-theme-switcher__item-description"
|
|
127
|
+
>{{ option.description }}</span>
|
|
128
|
+
</span>
|
|
129
|
+
<span
|
|
130
|
+
class="venix-theme-switcher__switch"
|
|
96
131
|
aria-hidden="true"
|
|
97
132
|
/>
|
|
98
|
-
<span>{{ item.name }}</span>
|
|
99
133
|
</button>
|
|
100
134
|
</div>
|
|
135
|
+
|
|
136
|
+
<a
|
|
137
|
+
class="venix-theme-switcher__credit"
|
|
138
|
+
role="menuitem"
|
|
139
|
+
tabindex="-1"
|
|
140
|
+
:href="SWITCHER_CREDIT.url"
|
|
141
|
+
target="_blank"
|
|
142
|
+
rel="noopener"
|
|
143
|
+
>{{ SWITCHER_CREDIT.name }}</a>
|
|
101
144
|
</div>
|
|
102
145
|
|
|
103
|
-
<
|
|
104
|
-
v-
|
|
105
|
-
|
|
146
|
+
<div
|
|
147
|
+
v-else
|
|
148
|
+
key="main"
|
|
149
|
+
class="venix-theme-switcher__view"
|
|
106
150
|
>
|
|
151
|
+
<div class="venix-theme-switcher__header">
|
|
152
|
+
<div
|
|
153
|
+
class="venix-theme-switcher__heading"
|
|
154
|
+
aria-hidden="true"
|
|
155
|
+
>
|
|
156
|
+
{{ resolvedLabel }}
|
|
157
|
+
</div>
|
|
158
|
+
<button
|
|
159
|
+
v-if="settingsOptions.length > 0"
|
|
160
|
+
type="button"
|
|
161
|
+
role="menuitem"
|
|
162
|
+
class="venix-theme-switcher__icon-button"
|
|
163
|
+
:aria-label="settingsHeading"
|
|
164
|
+
:title="settingsHeading"
|
|
165
|
+
@click="showView('settings')"
|
|
166
|
+
>
|
|
167
|
+
<span
|
|
168
|
+
v-if="icons.settings?.format === 'emote'"
|
|
169
|
+
class="venix-icon venix-icon--emoji"
|
|
170
|
+
aria-hidden="true"
|
|
171
|
+
>{{ icons.settings.value }}</span>
|
|
172
|
+
<VenixIcon
|
|
173
|
+
v-else-if="icons.settings"
|
|
174
|
+
:icon="icons.settings.value"
|
|
175
|
+
:mode="icons.settings.format"
|
|
176
|
+
aria-hidden="true"
|
|
177
|
+
/>
|
|
178
|
+
</button>
|
|
179
|
+
</div>
|
|
180
|
+
|
|
107
181
|
<div
|
|
108
182
|
class="venix-theme-switcher__separator"
|
|
109
183
|
role="separator"
|
|
@@ -112,40 +186,93 @@
|
|
|
112
186
|
<div
|
|
113
187
|
class="venix-theme-switcher__group"
|
|
114
188
|
role="group"
|
|
115
|
-
:aria-label="
|
|
189
|
+
:aria-label="modeHeading"
|
|
116
190
|
>
|
|
117
191
|
<div
|
|
118
192
|
class="venix-theme-switcher__subheading"
|
|
119
193
|
aria-hidden="true"
|
|
120
194
|
>
|
|
121
|
-
{{
|
|
195
|
+
{{ modeHeading }}
|
|
122
196
|
</div>
|
|
123
|
-
<
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
197
|
+
<div class="venix-theme-switcher__modes">
|
|
198
|
+
<button
|
|
199
|
+
v-for="item in modes"
|
|
200
|
+
:key="item.value"
|
|
201
|
+
type="button"
|
|
202
|
+
role="menuitemradio"
|
|
203
|
+
class="venix-theme-switcher__item venix-theme-switcher__item--mode"
|
|
204
|
+
:class="{ 'venix-theme-switcher__item--active': item.value === mode.preference.value }"
|
|
205
|
+
:aria-checked="item.value === mode.preference.value"
|
|
206
|
+
@click="selectMode(item.value)"
|
|
207
|
+
>
|
|
208
|
+
<span
|
|
209
|
+
v-if="item.icon?.format === 'emote'"
|
|
210
|
+
class="venix-icon venix-icon--emoji venix-theme-switcher__item-icon"
|
|
211
|
+
aria-hidden="true"
|
|
212
|
+
>{{ item.icon.value }}</span>
|
|
213
|
+
<VenixIcon
|
|
214
|
+
v-else-if="item.icon"
|
|
215
|
+
class="venix-theme-switcher__item-icon"
|
|
216
|
+
:icon="item.icon.value"
|
|
217
|
+
:mode="item.icon.format"
|
|
218
|
+
aria-hidden="true"
|
|
219
|
+
/>
|
|
220
|
+
<span>{{ item.name }}</span>
|
|
221
|
+
</button>
|
|
222
|
+
</div>
|
|
223
|
+
</div>
|
|
224
|
+
|
|
225
|
+
<template
|
|
226
|
+
v-for="section in themeSections"
|
|
227
|
+
:key="section.key"
|
|
228
|
+
>
|
|
229
|
+
<div
|
|
230
|
+
class="venix-theme-switcher__separator"
|
|
231
|
+
role="separator"
|
|
232
|
+
/>
|
|
233
|
+
|
|
234
|
+
<div
|
|
235
|
+
class="venix-theme-switcher__group"
|
|
236
|
+
role="group"
|
|
237
|
+
:aria-label="section.heading"
|
|
132
238
|
>
|
|
133
|
-
<
|
|
134
|
-
|
|
135
|
-
class="venix-icon venix-icon--emoji venix-theme-switcher__item-icon"
|
|
136
|
-
aria-hidden="true"
|
|
137
|
-
>{{ item.icon.value }}</span>
|
|
138
|
-
<VenixIcon
|
|
139
|
-
v-else-if="item.icon"
|
|
140
|
-
class="venix-theme-switcher__item-icon"
|
|
141
|
-
:icon="item.icon.value"
|
|
142
|
-
:mode="item.icon.format"
|
|
239
|
+
<div
|
|
240
|
+
class="venix-theme-switcher__subheading"
|
|
143
241
|
aria-hidden="true"
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
242
|
+
>
|
|
243
|
+
{{ section.heading }}
|
|
244
|
+
</div>
|
|
245
|
+
<button
|
|
246
|
+
v-for="item in section.items"
|
|
247
|
+
:key="item.value"
|
|
248
|
+
type="button"
|
|
249
|
+
role="menuitemradio"
|
|
250
|
+
class="venix-theme-switcher__item"
|
|
251
|
+
:class="{ 'venix-theme-switcher__item--active': item.value === theme.preference.value }"
|
|
252
|
+
:aria-checked="item.value === theme.preference.value"
|
|
253
|
+
@click="selectTheme(item.value)"
|
|
254
|
+
>
|
|
255
|
+
<span
|
|
256
|
+
v-if="item.icon?.format === 'emote'"
|
|
257
|
+
class="venix-icon venix-icon--emoji venix-theme-switcher__item-icon"
|
|
258
|
+
aria-hidden="true"
|
|
259
|
+
>{{ item.icon.value }}</span>
|
|
260
|
+
<VenixIcon
|
|
261
|
+
v-else-if="item.icon"
|
|
262
|
+
class="venix-theme-switcher__item-icon"
|
|
263
|
+
:icon="item.icon.value"
|
|
264
|
+
:mode="item.icon.format"
|
|
265
|
+
aria-hidden="true"
|
|
266
|
+
/>
|
|
267
|
+
<span>{{ item.name }}</span>
|
|
268
|
+
<span
|
|
269
|
+
v-if="seasonLabels[item.value]"
|
|
270
|
+
class="venix-theme-switcher__item-season"
|
|
271
|
+
>{{ seasonLabels[item.value] }}</span>
|
|
272
|
+
</button>
|
|
273
|
+
</div>
|
|
274
|
+
</template>
|
|
275
|
+
</div>
|
|
149
276
|
</div>
|
|
150
277
|
</Transition>
|
|
151
278
|
</div>
|
|
@@ -153,8 +280,11 @@
|
|
|
153
280
|
|
|
154
281
|
<script setup>
|
|
155
282
|
import { ref, computed, onMounted, onUnmounted, nextTick } from "vue";
|
|
283
|
+
import { useRuntimeConfig } from "#app";
|
|
156
284
|
import { useVenixTheme } from "../composables/useVenixTheme";
|
|
157
|
-
import { getDefaultSelection } from "../../shared/utils/theme-resolve";
|
|
285
|
+
import { getDefaultSelection, getSeasonDates } from "../../shared/utils/theme-resolve";
|
|
286
|
+
import { resolveThemeIcon } from "../../shared/utils/icon";
|
|
287
|
+
import { SWITCHER_CREDIT, SWITCHER_ICONS } from "../../shared/constants";
|
|
158
288
|
import VenixIcon from "./VenixIcon.vue";
|
|
159
289
|
const LABEL_TRANSLATIONS = {
|
|
160
290
|
"pt-BR": "Cores do site",
|
|
@@ -222,11 +352,100 @@ const MODE_CHANGED_ANNOUNCEMENT_TRANSLATIONS = {
|
|
|
222
352
|
"ko-KR": "\uBAA8\uB4DC\uAC00 {mode}(\uC73C)\uB85C \uBCC0\uACBD\uB418\uC5C8\uC2B5\uB2C8\uB2E4",
|
|
223
353
|
"zh-CN": "\u6A21\u5F0F\u5DF2\u66F4\u6539\u4E3A{mode}"
|
|
224
354
|
};
|
|
355
|
+
const SETTINGS_HEADING_TRANSLATIONS = {
|
|
356
|
+
"pt-BR": "Configura\xE7\xF5es",
|
|
357
|
+
"en-US": "Settings",
|
|
358
|
+
"es-ES": "Configuraci\xF3n",
|
|
359
|
+
"fr-FR": "Param\xE8tres",
|
|
360
|
+
"de-DE": "Einstellungen",
|
|
361
|
+
"it-IT": "Impostazioni",
|
|
362
|
+
"ja-JP": "\u8A2D\u5B9A",
|
|
363
|
+
"ko-KR": "\uC124\uC815",
|
|
364
|
+
"zh-CN": "\u8BBE\u7F6E"
|
|
365
|
+
};
|
|
366
|
+
const BACK_TRANSLATIONS = {
|
|
367
|
+
"pt-BR": "Voltar",
|
|
368
|
+
"en-US": "Back",
|
|
369
|
+
"es-ES": "Volver",
|
|
370
|
+
"fr-FR": "Retour",
|
|
371
|
+
"de-DE": "Zur\xFCck",
|
|
372
|
+
"it-IT": "Indietro",
|
|
373
|
+
"ja-JP": "\u623B\u308B",
|
|
374
|
+
"ko-KR": "\uB4A4\uB85C",
|
|
375
|
+
"zh-CN": "\u8FD4\u56DE"
|
|
376
|
+
};
|
|
377
|
+
const SAVE_TITLE_TRANSLATIONS = {
|
|
378
|
+
"pt-BR": "Salvar altera\xE7\xF5es",
|
|
379
|
+
"en-US": "Save changes",
|
|
380
|
+
"es-ES": "Guardar cambios",
|
|
381
|
+
"fr-FR": "Enregistrer",
|
|
382
|
+
"de-DE": "Speichern",
|
|
383
|
+
"it-IT": "Salva modifiche",
|
|
384
|
+
"ja-JP": "\u5909\u66F4\u3092\u4FDD\u5B58",
|
|
385
|
+
"ko-KR": "\uBCC0\uACBD \uC0AC\uD56D \uC800\uC7A5",
|
|
386
|
+
"zh-CN": "\u4FDD\u5B58\u66F4\u6539"
|
|
387
|
+
};
|
|
388
|
+
const SAVE_DESCRIPTION_TRANSLATIONS = {
|
|
389
|
+
"pt-BR": "Lembrar suas escolhas ao voltar ao site (usa cookies)",
|
|
390
|
+
"en-US": "Remember your choices next time you visit (uses cookies)",
|
|
391
|
+
"es-ES": "Recordar tus elecciones la pr\xF3xima vez (usa cookies)",
|
|
392
|
+
"fr-FR": "Retrouver vos choix \xE0 la prochaine visite (cookies)",
|
|
393
|
+
"de-DE": "Deine Auswahl beim n\xE4chsten Besuch behalten (Cookies)",
|
|
394
|
+
"it-IT": "Ricordare le tue scelte alla prossima visita (usa cookie)",
|
|
395
|
+
"ja-JP": "\u6B21\u56DE\u306E\u30A2\u30AF\u30BB\u30B9\u6642\u3082\u9078\u629E\u3092\u4FDD\u6301\u3057\u307E\u3059\uFF08Cookie\u3092\u4F7F\u7528\uFF09",
|
|
396
|
+
"ko-KR": "\uB2E4\uC74C \uBC29\uBB38 \uB54C\uB3C4 \uC120\uD0DD\uC744 \uC720\uC9C0\uD569\uB2C8\uB2E4 (\uCFE0\uD0A4 \uC0AC\uC6A9)",
|
|
397
|
+
"zh-CN": "\u4E0B\u6B21\u8BBF\u95EE\u65F6\u4FDD\u7559\u4F60\u7684\u9009\u62E9\uFF08\u4F7F\u7528 Cookie\uFF09"
|
|
398
|
+
};
|
|
399
|
+
const SCROLLBAR_TITLE_TRANSLATIONS = {
|
|
400
|
+
"pt-BR": "Rolagem personalizada",
|
|
401
|
+
"en-US": "Custom scrollbar",
|
|
402
|
+
"es-ES": "Scroll personalizado",
|
|
403
|
+
"fr-FR": "D\xE9filement stylis\xE9",
|
|
404
|
+
"de-DE": "Eigene Scrollleiste",
|
|
405
|
+
"it-IT": "Scroll personalizzato",
|
|
406
|
+
"ja-JP": "\u30AB\u30B9\u30BF\u30E0\u30B9\u30AF\u30ED\u30FC\u30EB\u30D0\u30FC",
|
|
407
|
+
"ko-KR": "\uC0AC\uC6A9\uC790 \uC9C0\uC815 \uC2A4\uD06C\uB864\uBC14",
|
|
408
|
+
"zh-CN": "\u81EA\u5B9A\u4E49\u6EDA\u52A8\u6761"
|
|
409
|
+
};
|
|
410
|
+
const CURSOR_TITLE_TRANSLATIONS = {
|
|
411
|
+
"pt-BR": "Cursor personalizado",
|
|
412
|
+
"en-US": "Custom cursor",
|
|
413
|
+
"es-ES": "Cursor personalizado",
|
|
414
|
+
"fr-FR": "Curseur stylis\xE9",
|
|
415
|
+
"de-DE": "Eigener Mauszeiger",
|
|
416
|
+
"it-IT": "Cursore personalizzato",
|
|
417
|
+
"ja-JP": "\u30AB\u30B9\u30BF\u30E0\u30AB\u30FC\u30BD\u30EB",
|
|
418
|
+
"ko-KR": "\uC0AC\uC6A9\uC790 \uC9C0\uC815 \uCEE4\uC11C",
|
|
419
|
+
"zh-CN": "\u81EA\u5B9A\u4E49\u5149\u6807"
|
|
420
|
+
};
|
|
421
|
+
const SEASON_RANGE_TRANSLATIONS = {
|
|
422
|
+
"pt-BR": "{start} a {end}",
|
|
423
|
+
"en-US": "{start} \u2013 {end}",
|
|
424
|
+
"es-ES": "{start} a {end}",
|
|
425
|
+
"fr-FR": "{start} \u2013 {end}",
|
|
426
|
+
"de-DE": "{start} \u2013 {end}",
|
|
427
|
+
"it-IT": "{start} \u2013 {end}",
|
|
428
|
+
"ja-JP": "{start}\uFF5E{end}",
|
|
429
|
+
"ko-KR": "{start}~{end}",
|
|
430
|
+
"zh-CN": "{start}\u81F3{end}"
|
|
431
|
+
};
|
|
432
|
+
const FONT_TITLE_TRANSLATIONS = {
|
|
433
|
+
"pt-BR": "Fonte personalizada",
|
|
434
|
+
"en-US": "Custom font",
|
|
435
|
+
"es-ES": "Fuente personalizada",
|
|
436
|
+
"fr-FR": "Police stylis\xE9e",
|
|
437
|
+
"de-DE": "Eigene Schriftart",
|
|
438
|
+
"it-IT": "Font personalizzato",
|
|
439
|
+
"ja-JP": "\u30AB\u30B9\u30BF\u30E0\u30D5\u30A9\u30F3\u30C8",
|
|
440
|
+
"ko-KR": "\uC0AC\uC6A9\uC790 \uC9C0\uC815 \uAE00\uAF34",
|
|
441
|
+
"zh-CN": "\u81EA\u5B9A\u4E49\u5B57\u4F53"
|
|
442
|
+
};
|
|
225
443
|
const props = defineProps({
|
|
226
444
|
label: { type: String, required: false },
|
|
227
|
-
showLabel: { type: Boolean, required: false }
|
|
445
|
+
showLabel: { type: Boolean, required: false },
|
|
446
|
+
hideConsent: { type: Boolean, required: false }
|
|
228
447
|
});
|
|
229
|
-
const { theme, themes, mode, modes, locale } = useVenixTheme();
|
|
448
|
+
const { theme, themes, mode, modes, locale, persistence, scrollbar, cursor, font } = useVenixTheme();
|
|
230
449
|
const resolvedLabel = computed(() => props.label ?? locale.translate(LABEL_TRANSLATIONS, "Website color"));
|
|
231
450
|
const modeHeading = computed(() => locale.translate(MODE_HEADING_TRANSLATIONS, "Mode"));
|
|
232
451
|
const themeHeading = computed(() => locale.translate(THEME_HEADING_TRANSLATIONS, "Theme"));
|
|
@@ -235,12 +454,108 @@ const themeSections = computed(() => [
|
|
|
235
454
|
{ key: "custom", heading: locale.translate(CUSTOM_HEADING_TRANSLATIONS, "Custom theme"), items: themes.value.filter((item) => item.custom) }
|
|
236
455
|
].filter((section) => section.items.length > 0));
|
|
237
456
|
const triggerLabel = computed(() => [theme.data.value?.name, mode.data.value?.name].filter(Boolean).join(" \xB7 "));
|
|
457
|
+
const today = ref(null);
|
|
458
|
+
const seasonLabels = computed(() => {
|
|
459
|
+
if (!today.value) return {};
|
|
460
|
+
const now = today.value;
|
|
461
|
+
let format;
|
|
462
|
+
try {
|
|
463
|
+
format = new Intl.DateTimeFormat(locale.current.value, { day: "2-digit", month: "2-digit" });
|
|
464
|
+
} catch {
|
|
465
|
+
format = new Intl.DateTimeFormat(void 0, { day: "2-digit", month: "2-digit" });
|
|
466
|
+
}
|
|
467
|
+
const template = locale.translate(SEASON_RANGE_TRANSLATIONS, "{start} \u2013 {end}");
|
|
468
|
+
const labels = {};
|
|
469
|
+
for (const item of themes.value) {
|
|
470
|
+
const group = theme.colors.groups[item.value];
|
|
471
|
+
const dates = group && getSeasonDates(group, now);
|
|
472
|
+
if (dates) labels[item.value] = template.replace("{start}", format.format(dates.start)).replace("{end}", format.format(dates.end));
|
|
473
|
+
}
|
|
474
|
+
return labels;
|
|
475
|
+
});
|
|
476
|
+
const settingsHeading = computed(() => locale.translate(SETTINGS_HEADING_TRANSLATIONS, "Settings"));
|
|
477
|
+
const backLabel = computed(() => locale.translate(BACK_TRANSLATIONS, "Back"));
|
|
478
|
+
const iconFormat = useRuntimeConfig().public.venixTheme?.iconFormat ?? "svg";
|
|
479
|
+
const icons = {
|
|
480
|
+
settings: resolveThemeIcon(SWITCHER_ICONS.settings, iconFormat),
|
|
481
|
+
back: resolveThemeIcon(SWITCHER_ICONS.back, iconFormat)
|
|
482
|
+
};
|
|
483
|
+
const settingsOptions = computed(() => {
|
|
484
|
+
const options = [];
|
|
485
|
+
if (persistence.required && !props.hideConsent) {
|
|
486
|
+
options.push({
|
|
487
|
+
key: "save",
|
|
488
|
+
icon: resolveThemeIcon(SWITCHER_ICONS.save, iconFormat),
|
|
489
|
+
title: locale.translate(SAVE_TITLE_TRANSLATIONS, "Save changes"),
|
|
490
|
+
description: locale.translate(SAVE_DESCRIPTION_TRANSLATIONS, "Remember your choices next time you visit (uses cookies)"),
|
|
491
|
+
enabled: persistence.hasConsent.value,
|
|
492
|
+
toggle: () => persistence.hasConsent.value ? persistence.revoke() : persistence.grant()
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
if (scrollbar.available) {
|
|
496
|
+
options.push({
|
|
497
|
+
key: "scrollbar",
|
|
498
|
+
icon: resolveThemeIcon(SWITCHER_ICONS.scrollbar, iconFormat),
|
|
499
|
+
title: locale.translate(SCROLLBAR_TITLE_TRANSLATIONS, "Custom scrollbar"),
|
|
500
|
+
enabled: scrollbar.enabled.value,
|
|
501
|
+
toggle: () => scrollbar.set(!scrollbar.enabled.value)
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
if (cursor.available && hasFinePointer.value) {
|
|
505
|
+
options.push({
|
|
506
|
+
key: "cursor",
|
|
507
|
+
icon: resolveThemeIcon(SWITCHER_ICONS.cursor, iconFormat),
|
|
508
|
+
title: locale.translate(CURSOR_TITLE_TRANSLATIONS, "Custom cursor"),
|
|
509
|
+
enabled: cursor.enabled.value,
|
|
510
|
+
toggle: () => cursor.set(!cursor.enabled.value)
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
if (font.available) {
|
|
514
|
+
options.push({
|
|
515
|
+
key: "font",
|
|
516
|
+
icon: resolveThemeIcon(SWITCHER_ICONS.font, iconFormat),
|
|
517
|
+
title: locale.translate(FONT_TITLE_TRANSLATIONS, "Custom font"),
|
|
518
|
+
enabled: font.enabled.value,
|
|
519
|
+
toggle: () => font.set(!font.enabled.value)
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
return options;
|
|
523
|
+
});
|
|
238
524
|
const baseTheme = getDefaultSelection(theme.colors).fallbackTheme;
|
|
239
525
|
const open = ref(false);
|
|
526
|
+
const view = ref("main");
|
|
240
527
|
const visible = ref(false);
|
|
241
528
|
const announcement = ref("");
|
|
242
529
|
const rootRef = ref(null);
|
|
243
530
|
const triggerRef = ref(null);
|
|
531
|
+
const menuRef = ref(null);
|
|
532
|
+
const placeAbove = ref(false);
|
|
533
|
+
const menuStyle = ref({});
|
|
534
|
+
const SCREEN_MARGIN = 8;
|
|
535
|
+
const MENU_GAP = 8;
|
|
536
|
+
const updatePlacement = () => {
|
|
537
|
+
const trigger = triggerRef.value;
|
|
538
|
+
const menu = menuRef.value;
|
|
539
|
+
if (!trigger || !menu) return;
|
|
540
|
+
const button = trigger.getBoundingClientRect();
|
|
541
|
+
const screenWidth = document.documentElement.clientWidth;
|
|
542
|
+
const below = window.innerHeight - button.bottom - MENU_GAP - SCREEN_MARGIN;
|
|
543
|
+
const above = button.top - MENU_GAP - SCREEN_MARGIN;
|
|
544
|
+
placeAbove.value = below < menu.scrollHeight && above > below;
|
|
545
|
+
const width = Math.min(menu.offsetWidth, screenWidth - 2 * SCREEN_MARGIN);
|
|
546
|
+
const left = button.right - width;
|
|
547
|
+
const shift = Math.min(Math.max(left, SCREEN_MARGIN), screenWidth - SCREEN_MARGIN - width) - left;
|
|
548
|
+
menuStyle.value = {
|
|
549
|
+
maxHeight: `${Math.max(placeAbove.value ? above : below, 0)}px`,
|
|
550
|
+
right: `${-shift}px`,
|
|
551
|
+
// The opening animation grows from the button, wherever it ends up
|
|
552
|
+
transformOrigin: `${Math.round(width - shift - button.width / 2)}px ${placeAbove.value ? "100%" : "0"}`
|
|
553
|
+
};
|
|
554
|
+
};
|
|
555
|
+
const handleResize = () => {
|
|
556
|
+
if (open.value) updatePlacement();
|
|
557
|
+
};
|
|
558
|
+
const hasFinePointer = ref(true);
|
|
244
559
|
const activeIcon = computed(() => {
|
|
245
560
|
const effectiveTheme = theme.preference.value === "system" ? theme.activeSeasonalTheme.value : theme.preference.value;
|
|
246
561
|
if (!effectiveTheme || effectiveTheme === baseTheme) return mode.data.value?.icon ?? null;
|
|
@@ -248,7 +563,7 @@ const activeIcon = computed(() => {
|
|
|
248
563
|
});
|
|
249
564
|
const activeIconKey = computed(() => `${theme.value.value}:${activeIcon.value?.format ?? ""}:${activeIcon.value?.value ?? ""}`);
|
|
250
565
|
const getMenuItems = () => {
|
|
251
|
-
return Array.from(rootRef.value?.querySelectorAll(".venix-theme-switcher__item") ?? []);
|
|
566
|
+
return Array.from(rootRef.value?.querySelectorAll(".venix-theme-switcher__icon-button, .venix-theme-switcher__item") ?? []);
|
|
252
567
|
};
|
|
253
568
|
const focusItemAt = (index) => {
|
|
254
569
|
const items = getMenuItems();
|
|
@@ -258,10 +573,19 @@ const focusItemAt = (index) => {
|
|
|
258
573
|
const toggleOpen = async () => {
|
|
259
574
|
open.value = !open.value;
|
|
260
575
|
if (!open.value) return;
|
|
576
|
+
view.value = "main";
|
|
261
577
|
await nextTick();
|
|
578
|
+
updatePlacement();
|
|
262
579
|
const items = getMenuItems();
|
|
263
580
|
(items.find((el) => el.getAttribute("aria-checked") === "true") ?? items[0])?.focus();
|
|
264
581
|
};
|
|
582
|
+
const showView = async (next) => {
|
|
583
|
+
menuRef.value?.focus();
|
|
584
|
+
view.value = next;
|
|
585
|
+
await nextTick();
|
|
586
|
+
const items = getMenuItems();
|
|
587
|
+
(next === "settings" ? items[1] : items[0])?.focus();
|
|
588
|
+
};
|
|
265
589
|
const close = (options = {}) => {
|
|
266
590
|
if (!open.value) return;
|
|
267
591
|
open.value = false;
|
|
@@ -272,7 +596,6 @@ const selectTheme = (value) => {
|
|
|
272
596
|
theme.set(value);
|
|
273
597
|
const template = locale.translate(CHANGED_ANNOUNCEMENT_TRANSLATIONS, "Website color changed to {theme}");
|
|
274
598
|
announcement.value = template.replace("{theme}", selected?.name ?? value);
|
|
275
|
-
close({ restoreFocus: true });
|
|
276
599
|
};
|
|
277
600
|
const selectMode = (value) => {
|
|
278
601
|
const selected = modes.value.find((item) => item.value === value);
|
|
@@ -308,8 +631,20 @@ const handleFocusOut = (event) => {
|
|
|
308
631
|
const nextTarget = event.relatedTarget;
|
|
309
632
|
if (!nextTarget || !rootRef.value?.contains(nextTarget)) close();
|
|
310
633
|
};
|
|
311
|
-
const
|
|
312
|
-
|
|
634
|
+
const isInside = (rect, event) => event.clientX >= rect.left && event.clientX <= rect.right && event.clientY >= rect.top && event.clientY <= rect.bottom;
|
|
635
|
+
const isTransitionHitOnMenu = (event) => open.value && event.target === document.documentElement && !!menuRef.value && isInside(menuRef.value.getBoundingClientRect(), event);
|
|
636
|
+
const handleMouseDown = (event) => {
|
|
637
|
+
if (isTransitionHitOnMenu(event)) event.preventDefault();
|
|
638
|
+
};
|
|
639
|
+
const handlePointerDown = (event) => {
|
|
640
|
+
if (isTransitionHitOnMenu(event)) return;
|
|
641
|
+
if (!rootRef.value || !event.composedPath().includes(rootRef.value)) close();
|
|
642
|
+
};
|
|
643
|
+
const handleClick = (event) => {
|
|
644
|
+
if (!isTransitionHitOnMenu(event)) return;
|
|
645
|
+
const control = getMenuItems().find((el) => isInside(el.getBoundingClientRect(), event));
|
|
646
|
+
control?.focus();
|
|
647
|
+
control?.click();
|
|
313
648
|
};
|
|
314
649
|
const handleKeydown = (event) => {
|
|
315
650
|
if (event.key === "Escape") close({ restoreFocus: true });
|
|
@@ -320,15 +655,23 @@ onMounted(() => {
|
|
|
320
655
|
visible.value = true;
|
|
321
656
|
});
|
|
322
657
|
});
|
|
323
|
-
|
|
658
|
+
hasFinePointer.value = window.matchMedia("(any-pointer: fine)").matches;
|
|
659
|
+
today.value = /* @__PURE__ */ new Date();
|
|
660
|
+
document.addEventListener("pointerdown", handlePointerDown);
|
|
661
|
+
document.addEventListener("mousedown", handleMouseDown, true);
|
|
662
|
+
document.addEventListener("click", handleClick);
|
|
324
663
|
document.addEventListener("keydown", handleKeydown);
|
|
664
|
+
window.addEventListener("resize", handleResize);
|
|
325
665
|
});
|
|
326
666
|
onUnmounted(() => {
|
|
327
|
-
document.removeEventListener("
|
|
667
|
+
document.removeEventListener("pointerdown", handlePointerDown);
|
|
668
|
+
document.removeEventListener("mousedown", handleMouseDown, true);
|
|
669
|
+
document.removeEventListener("click", handleClick);
|
|
328
670
|
document.removeEventListener("keydown", handleKeydown);
|
|
671
|
+
window.removeEventListener("resize", handleResize);
|
|
329
672
|
});
|
|
330
673
|
</script>
|
|
331
674
|
|
|
332
675
|
<style>
|
|
333
|
-
.venix-theme-switcher{display:inline-block;position:relative}.venix-theme-switcher__sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border:0;white-space:nowrap}.venix-theme-switcher__trigger{align-items:center;background:transparent;border:none;border-radius:999px;color:inherit;cursor:pointer;display:inline-flex;font-size:1.25rem;gap:.5rem;line-height:1;opacity:0;padding:.5rem;transition:opacity .3s ease,background-color .2s ease}.venix-theme-switcher__trigger--visible{opacity:1}.venix-theme-switcher__trigger:focus-visible
|
|
676
|
+
.venix-theme-switcher{display:inline-block;position:relative}.venix-theme-switcher,.venix-theme-switcher *,.venix-theme-switcher :after,.venix-theme-switcher :before{box-sizing:border-box}.venix-theme-switcher__sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border:0;white-space:nowrap}.venix-theme-switcher__trigger{align-items:center;background:transparent;border:none;border-radius:999px;color:inherit;cursor:pointer;display:inline-flex;font-size:1.25rem;gap:.5rem;line-height:1;opacity:0;padding:.5rem;transition:opacity .3s ease,background-color .2s ease}.venix-theme-switcher__trigger--visible{opacity:1}.venix-theme-switcher__trigger:focus-visible{background:var(--color-background3,hsla(0,0%,50%,.15))}@media (hover:hover){.venix-theme-switcher__trigger:hover{background:var(--color-background3,hsla(0,0%,50%,.15))}}.venix-theme-switcher__trigger-label{font-size:.875rem}.venix-theme-switcher__menu{border-radius:.75rem;margin:0;max-width:calc(100vw - 1rem);min-width:min(16rem,calc(100vw - 1rem));overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;padding:.375rem;position:absolute;right:0;scrollbar-color:var(--venix-switcher-border) transparent;scrollbar-width:thin;text-align:left;top:calc(100% + .5rem);z-index:50;--venix-switcher-bg:#1f2128;--venix-switcher-border:#3a3d46;--venix-switcher-text:rgba(245,245,247,.7);--venix-switcher-text-strong:#fff;--venix-switcher-heading:#fff;--venix-switcher-subheading:#f5f5f7;--venix-switcher-hover:hsla(0,0%,100%,.1);--venix-switcher-active:hsla(0,0%,100%,.16);--venix-switcher-description:rgba(245,245,247,.45);--venix-switcher-switch-off:#3a3d46;--venix-switcher-knob-off:#9a9ca5;--venix-switcher-switch-on:#f5f5f7;--venix-switcher-shadow:rgba(0,0,0,.25);--venix-switcher-icon-button:1.75rem;background:var(--venix-switcher-bg);border:1px solid var(--venix-switcher-border);box-shadow:0 8px 24px var(--venix-switcher-shadow);transform-origin:top right}.venix-theme-switcher__menu--above{bottom:calc(100% + .5rem);top:auto}.venix-theme-switcher__icon-button,.venix-theme-switcher__item,.venix-theme-switcher__trigger{-webkit-tap-highlight-color:transparent;touch-action:manipulation}.venix-theme-switcher__menu:focus{outline:none}@supports (color:light-dark(#fff,#000)){.venix-theme-switcher__menu{--venix-switcher-bg:light-dark(#fff,#1f2128);--venix-switcher-border:light-dark(#e2e4ea,#3a3d46);--venix-switcher-text:light-dark(rgba(31,33,40,.7),rgba(245,245,247,.7));--venix-switcher-text-strong:light-dark(#000,#fff);--venix-switcher-heading:light-dark(#000,#fff);--venix-switcher-subheading:light-dark(#1f2128,#f5f5f7);--venix-switcher-hover:light-dark(rgba(0,0,0,.06),hsla(0,0%,100%,.1));--venix-switcher-active:light-dark(rgba(0,0,0,.1),hsla(0,0%,100%,.16));--venix-switcher-description:light-dark(rgba(31,33,40,.5),rgba(245,245,247,.45));--venix-switcher-switch-off:light-dark(#d5d7de,#3a3d46);--venix-switcher-knob-off:light-dark(#fff,#9a9ca5);--venix-switcher-switch-on:light-dark(#1f2128,#f5f5f7);--venix-switcher-shadow:light-dark(rgba(0,0,0,.12),rgba(0,0,0,.25))}}.venix-theme-switcher-menu-enter-active{transition:transform .22s cubic-bezier(0,0,.2,1),opacity .12s ease-out}.venix-theme-switcher-menu-leave-active{transition:opacity .2s ease-in}.venix-theme-switcher-menu-enter-from{opacity:0;transform:scale(.3)}.venix-theme-switcher-menu-leave-to{opacity:0}.venix-theme-switcher__view{animation:venix-theme-switcher-view-in .18s cubic-bezier(0,0,.2,1);--venix-switcher-view-from:-0.5rem}.venix-theme-switcher__view--settings{--venix-switcher-view-from:0.5rem}@keyframes venix-theme-switcher-view-in{0%{opacity:0;transform:translateX(var(--venix-switcher-view-from))}}@media (prefers-reduced-motion:reduce){.venix-theme-switcher-menu-enter-active,.venix-theme-switcher-menu-leave-active{transition:none}.venix-theme-switcher__view{animation:none}}.venix-theme-switcher__header{align-items:center;display:grid;gap:.25rem;grid-template-columns:var(--venix-switcher-icon-button) 1fr var(--venix-switcher-icon-button)}.venix-theme-switcher__header .venix-theme-switcher__heading{grid-column:2;grid-row:1}.venix-theme-switcher__heading+.venix-theme-switcher__icon-button{grid-column:3}.venix-theme-switcher__icon-button{align-items:center;background:transparent;border:none;border-radius:.5rem;color:var(--venix-switcher-text);cursor:pointer;display:flex;font-size:1rem;height:var(--venix-switcher-icon-button);justify-content:center;padding:0;transition:background-color .15s ease,color .15s ease;width:var(--venix-switcher-icon-button)}.venix-theme-switcher__icon-button:focus-visible{background:var(--venix-switcher-hover);color:var(--venix-switcher-text-strong)}@media (hover:hover){.venix-theme-switcher__icon-button:hover{background:var(--venix-switcher-hover);color:var(--venix-switcher-text-strong)}}.venix-theme-switcher__heading{color:var(--venix-switcher-heading);font-size:.75rem;padding:.375rem .625rem}.venix-theme-switcher__heading,.venix-theme-switcher__subheading{font-weight:600;letter-spacing:.04em;text-align:center;text-transform:uppercase}.venix-theme-switcher__subheading{color:var(--venix-switcher-subheading);font-size:.6875rem;padding:.25rem .625rem}.venix-theme-switcher__modes{display:grid;gap:.25rem;grid-template-columns:repeat(3,1fr)}.venix-theme-switcher__separator{background:var(--venix-switcher-border);height:1px;margin:.375rem .25rem}.venix-theme-switcher__item{align-items:center;background:transparent;border:none;border-radius:.5rem;color:var(--venix-switcher-text);cursor:pointer;display:flex;font:inherit;gap:.625rem;padding:.5rem .625rem;text-align:left;transition:background-color .15s ease,color .15s ease;width:100%}.venix-theme-switcher__item--mode{flex-direction:column;font-size:.75rem;gap:.25rem;justify-content:center;padding:.5rem .25rem;text-align:center}.venix-theme-switcher__item--mode .venix-theme-switcher__item-icon{font-size:1.125rem}.venix-theme-switcher__item:focus-visible{background:var(--venix-switcher-hover);color:var(--venix-switcher-text-strong)}@media (hover:hover){.venix-theme-switcher__item:hover{background:var(--venix-switcher-hover);color:var(--venix-switcher-text-strong)}}@media (pointer:coarse){.venix-theme-switcher__menu{--venix-switcher-icon-button:2.5rem}.venix-theme-switcher__item{padding-block:.625rem}}.venix-theme-switcher__item--active{background:var(--venix-switcher-active);color:var(--venix-switcher-text-strong);font-weight:600}.venix-theme-switcher__item-icon{flex-shrink:0}.venix-theme-switcher__item-season{color:var(--venix-switcher-description);font-size:.6875rem;font-variant-numeric:tabular-nums;font-weight:400;margin-left:auto;opacity:.6;padding-left:.5rem;white-space:nowrap}.venix-theme-switcher__item--on{color:var(--venix-switcher-text-strong)}.venix-theme-switcher__item-text{display:flex;flex:1;flex-direction:column;gap:.125rem;min-width:0}.venix-theme-switcher__item-title{white-space:nowrap}.venix-theme-switcher__item-description{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;color:var(--venix-switcher-description);font-size:.6875rem;-webkit-line-clamp:2;line-clamp:2;line-height:1.3}.venix-theme-switcher__switch{background:var(--venix-switcher-switch-off);border-radius:999px;flex-shrink:0;height:1rem;position:relative;transition:background-color .15s ease;width:1.75rem}.venix-theme-switcher__switch:after{background:var(--venix-switcher-knob-off);border-radius:50%;content:"";height:.75rem;left:.125rem;position:absolute;top:.125rem;transition:transform .15s ease,background-color .15s ease;width:.75rem}.venix-theme-switcher__item--on .venix-theme-switcher__switch{background:var(--venix-switcher-switch-on)}.venix-theme-switcher__item--on .venix-theme-switcher__switch:after{background:var(--venix-switcher-bg);transform:translateX(.75rem)}.venix-theme-switcher__credit{color:var(--venix-switcher-description);display:block;font-size:.625rem;line-height:1.2;margin-top:.25rem;opacity:.6;padding:.125rem .25rem;text-align:center;text-decoration:none;transition:opacity .15s ease}.venix-theme-switcher__credit:focus-visible,.venix-theme-switcher__credit:hover{opacity:1;text-decoration:underline}@media (prefers-reduced-motion:reduce){.venix-theme-switcher__switch,.venix-theme-switcher__switch:after{transition:none}}
|
|
334
677
|
</style>
|
|
@@ -3,6 +3,8 @@ type __VLS_Props = {
|
|
|
3
3
|
label?: string;
|
|
4
4
|
/** Shows the active theme's and mode's names next to the icon on the button. */
|
|
5
5
|
showLabel?: boolean;
|
|
6
|
+
/** Hides "Save changes" in the settings, for a site whose own cookie banner already records consent. */
|
|
7
|
+
hideConsent?: boolean;
|
|
6
8
|
};
|
|
7
9
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
10
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ResolvedTheme } from '../../shared/types/index.js';
|
|
2
2
|
import type { ThemeIconFormat } from '../../shared/utils/icon.js';
|
|
3
|
-
export declare const useThemeColors: (theme:
|
|
3
|
+
export declare const useThemeColors: (theme: ResolvedTheme, translate: (translations?: Record<string, string>, fallback?: string) => string, iconFormat?: ThemeIconFormat) => {
|
|
4
4
|
themes: import("vue").ComputedRef<{
|
|
5
5
|
value: string;
|
|
6
6
|
name: string;
|
|
@@ -8,7 +8,15 @@ export declare const useThemeCookies: (options?: UseThemeCookiesOptions) => {
|
|
|
8
8
|
resolvedCookie: import("nuxt/app").CookieRef<string>;
|
|
9
9
|
modeCookie: import("nuxt/app").CookieRef<string>;
|
|
10
10
|
localeCookie: import("nuxt/app").CookieRef<string>;
|
|
11
|
+
scrollbarCookie: import("nuxt/app").CookieRef<string>;
|
|
12
|
+
cursorCookie: import("nuxt/app").CookieRef<string>;
|
|
13
|
+
fontCookie: import("nuxt/app").CookieRef<string>;
|
|
11
14
|
canPersist: () => boolean;
|
|
12
15
|
persistIfConsented: (preference: string, mode: string, resolved: string) => void;
|
|
16
|
+
persistTogglesIfConsented: (toggles: {
|
|
17
|
+
scrollbar: boolean;
|
|
18
|
+
cursor: boolean;
|
|
19
|
+
font: boolean;
|
|
20
|
+
}) => void;
|
|
13
21
|
disablePersistence: () => void;
|
|
14
22
|
};
|