@sbc-connect/nuxt-base 0.1.25 → 0.1.27

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @sbc-connect/nuxt-base
2
2
 
3
+ ## 0.1.27
4
+
5
+ ### Patch Changes
6
+
7
+ - [#88](https://github.com/bcgov/connect-nuxt/pull/88) [`11ccded`](https://github.com/bcgov/connect-nuxt/commit/11ccdedb47c73d36a335ddd96e529fe74ca17480) Thanks [@kialj876](https://github.com/kialj876)! - Base layer - Update tombstone component stateKey prop to optional
8
+
9
+ ## 0.1.26
10
+
11
+ ### Patch Changes
12
+
13
+ - [#86](https://github.com/bcgov/connect-nuxt/pull/86) [`c1fb4f2`](https://github.com/bcgov/connect-nuxt/commit/c1fb4f2a217b3d57e7ea7aed8b9773e215a21978) Thanks [@deetz99](https://github.com/deetz99)! - feat: v-sanitize directive.
14
+
3
15
  ## 0.1.25
4
16
 
5
17
  ### Patch Changes
@@ -1,7 +1,4 @@
1
1
  <script setup lang="ts">
2
- /* eslint-disable vue/no-v-html */
3
- /* eslint-disable vue/no-v-text-v-html-on-component */
4
-
5
2
  const {
6
3
  translationPath,
7
4
  as = 'span'
@@ -39,5 +36,5 @@ const textToDisplay = computed(() => {
39
36
  </script>
40
37
 
41
38
  <template>
42
- <component :is="as" v-html="$sanitize(textToDisplay)" />
39
+ <component :is="as" v-sanitize="textToDisplay" />
43
40
  </template>
@@ -1,9 +1,9 @@
1
1
  <script setup lang="ts">
2
2
  import type { ButtonProps } from '@nuxt/ui'
3
3
 
4
- const props = defineProps<{ stateKey: string }>()
4
+ const props = defineProps<{ stateKey?: string }>()
5
5
 
6
- const { tombstone } = useConnectTombstone(props.stateKey)
6
+ const { tombstone } = useConnectTombstone(props.stateKey || '')
7
7
 
8
8
  async function handleButtonAction(button: ButtonProps, event: MouseEvent) {
9
9
  button.loading = true
@@ -3,7 +3,16 @@ import DOMPurify from 'dompurify'
3
3
  export default defineNuxtPlugin({
4
4
  name: 'connect-sanitize-plugin',
5
5
  parallel: true,
6
- setup() {
6
+ setup(nuxtApp) {
7
+ nuxtApp.vueApp.directive('sanitize', {
8
+ beforeMount(el, binding) {
9
+ el.innerHTML = DOMPurify.sanitize(binding.value)
10
+ },
11
+ updated(el, binding) {
12
+ el.innerHTML = DOMPurify.sanitize(binding.value)
13
+ }
14
+ })
15
+
7
16
  return {
8
17
  provide: {
9
18
  sanitize: DOMPurify.sanitize
@@ -0,0 +1,7 @@
1
+ declare module 'vue' {
2
+ interface GlobalDirectives {
3
+ vSanitize: Directive<HTMLElement, string>
4
+ }
5
+ }
6
+
7
+ export {}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sbc-connect/nuxt-base",
3
3
  "type": "module",
4
- "version": "0.1.25",
4
+ "version": "0.1.27",
5
5
  "repository": "github:bcgov/connect-nuxt",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "./nuxt.config.ts",
@@ -25,8 +25,8 @@
25
25
  "typescript": "5.9.3",
26
26
  "vue-tsc": "3.1.2",
27
27
  "@sbc-connect/eslint-config": "0.0.8",
28
- "@sbc-connect/vitest-config": "0.0.6",
29
- "@sbc-connect/playwright-config": "0.0.8"
28
+ "@sbc-connect/playwright-config": "0.0.8",
29
+ "@sbc-connect/vitest-config": "0.0.6"
30
30
  },
31
31
  "scripts": {
32
32
  "preinstall": "npx only-allow pnpm",