@data-fair/lib-vuetify 1.9.0 → 1.9.2

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/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { type Session } from '@data-fair/lib-vue/session.js';
2
2
  import { VuetifyOptions } from 'vuetify';
3
- export declare function vuetifySessionOptions(session: Session): VuetifyOptions;
3
+ export declare function vuetifySessionOptions(session: Session, cspNonce?: string): VuetifyOptions;
4
4
  export declare function defaultOptions(searchParams: Record<string, string>, darkCookie?: boolean, locale?: string): VuetifyOptions;
package/index.js CHANGED
@@ -13,7 +13,7 @@ const baseDarkColors = {
13
13
  primary: '#2196F3', // blue.base
14
14
  success: '#00E676' // green.accent3
15
15
  }
16
- export function vuetifySessionOptions (session) {
16
+ export function vuetifySessionOptions (session, cspNonce) {
17
17
  if (!session.site.value) { throw new Error('vuetifySessionOptions requires fething site info in session util') }
18
18
  const colors = { ...baseColors, ...session.site.value?.colors }
19
19
  return {
@@ -23,6 +23,7 @@ export function vuetifySessionOptions (session) {
23
23
  messages: { fr, en }
24
24
  },
25
25
  theme: {
26
+ cspNonce,
26
27
  defaultTheme: session.theme.value ?? 'default',
27
28
  themes: {
28
29
  [session.theme.value ?? 'default']: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@data-fair/lib-vuetify",
3
- "version": "1.9.0",
3
+ "version": "1.9.2",
4
4
  "description": "Components based on the Vuetify 3 UI lib for the data-fair stack.",
5
5
  "main": "index.js",
6
6
  "files": [
package/personal-menu.vue CHANGED
@@ -202,11 +202,9 @@ en:
202
202
  import { computed, toRefs } from 'vue'
203
203
  import { useI18n } from 'vue-i18n'
204
204
  import { useSession } from '@data-fair/lib-vue/session.js'
205
- import { useTheme } from 'vuetify'
206
205
  import UserAvatar from './user-avatar.vue'
207
206
  import { mdiAlert, mdiShieldAlert, mdiLogout, mdiAccountSwitchOutline } from '@mdi/js'
208
207
 
209
- const theme = useTheme()
210
208
  const session = useSession()
211
209
 
212
210
  const { t } = useI18n({ useScope: 'local' })
@@ -2,11 +2,9 @@
2
2
  import { computed, toRefs } from 'vue';
3
3
  import { useI18n } from 'vue-i18n';
4
4
  import { useSession } from '@data-fair/lib-vue/session.js';
5
- import { useTheme } from 'vuetify';
6
5
  import UserAvatar from './user-avatar.vue';
7
6
  import { mdiAlert, mdiShieldAlert, mdiLogout, mdiAccountSwitchOutline } from '@mdi/js';
8
7
  const { defineProps, defineSlots, defineEmits, defineExpose, defineModel, defineOptions, withDefaults, } = await import('vue');
9
- const theme = useTheme();
10
8
  const session = useSession();
11
9
  const { t } = useI18n({ useScope: 'local' });
12
10
  const { user, account } = toRefs(session.state);