mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
revert
This commit is contained in:
@@ -14,8 +14,7 @@ export const getDefaultUiConfig = (colors?: string[], csp?: { nonce?: string })
|
||||
}, [...(colors || []), 'neutral' as any]),
|
||||
icons,
|
||||
csp: csp || {
|
||||
nonce: '',
|
||||
scriptNonce: ''
|
||||
nonce: ''
|
||||
}
|
||||
})
|
||||
|
||||
@@ -28,8 +27,7 @@ export const defaultOptions = {
|
||||
transitions: true
|
||||
},
|
||||
csp: {
|
||||
nonce: '',
|
||||
scriptNonce: ''
|
||||
nonce: ''
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,12 +39,6 @@ export interface ModuleOptions {
|
||||
* @defaultValue ``
|
||||
*/
|
||||
nonce?: string
|
||||
|
||||
/**
|
||||
* Enable nonce for inline scripts.
|
||||
* @defaultValue ``
|
||||
*/
|
||||
scriptNonce?: string
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,7 +24,7 @@ export default defineNuxtPlugin(() => {
|
||||
const nuxtApp = useNuxtApp()
|
||||
|
||||
const nonce = computed(() => appConfig.ui?.csp?.nonce)
|
||||
const scriptNonce = computed(() => appConfig.ui?.csp?.scriptNonce)
|
||||
|
||||
const root = computed(() => {
|
||||
const { neutral, ...colors } = appConfig.ui.colors
|
||||
|
||||
@@ -65,7 +65,7 @@ export default defineNuxtPlugin(() => {
|
||||
|
||||
headData.script = [{
|
||||
innerHTML: 'document.head.removeChild(document.querySelector(\'[data-nuxt-ui-colors]\'))',
|
||||
...(scriptNonce.value ? { nonce: scriptNonce.value } : {})
|
||||
...(nonce.value ? { nonce: nonce.value } : {})
|
||||
}]
|
||||
}
|
||||
|
||||
|
||||
@@ -167,7 +167,6 @@ type AppConfigUI = {
|
||||
tv?: typeof defaultConfig
|
||||
csp?: {
|
||||
nonce?: string
|
||||
scriptNonce?: string
|
||||
}
|
||||
} & TVConfig<typeof ui>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user