sprintify-ui 0.12.25 → 0.12.26

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.
@@ -6,7 +6,6 @@ import { useSystemAlertStore } from './stores/systemAlerts';
6
6
  import { useClickOutside } from './composables/clickOutside';
7
7
  import { LAYOUT_HEADER_HEIGHT_CSS_VARIABLE, useLayoutHeaderHeight } from './composables/layoutHeaderHeight';
8
8
  import { useField } from './composables/field';
9
- import { vSafeHtml, SAFE_HTML_CONFIG } from './directives/safeHtml';
10
9
  declare const messages: {
11
10
  en: {
12
11
  cancel: string;
@@ -275,5 +274,3 @@ export { useLayoutHeaderHeight };
275
274
  export { LAYOUT_HEADER_HEIGHT_CSS_VARIABLE };
276
275
  export { useField };
277
276
  export { SettingsStorage };
278
- export { vSafeHtml };
279
- export { SAFE_HTML_CONFIG };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.12.25",
3
+ "version": "0.12.26",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "generate-llm-txt": "node scripts/generate-llm-txt.js",
@@ -44,7 +44,6 @@
44
44
  "@tiptap/extension-subscript": "^3.20.4",
45
45
  "@tiptap/extension-superscript": "^3.20.4",
46
46
  "color2k": "^2.0.3",
47
- "dompurify": "^3.4.14",
48
47
  "tailwind-merge": "^2.4.0"
49
48
  },
50
49
  "devDependencies": {
@@ -69,8 +69,8 @@
69
69
  name="tooltip"
70
70
  >
71
71
  <div
72
- v-safe-html="tooltip"
73
72
  class="text-xs max-w-xs leading-snug rounded-md pt-1.5 pb-2 px-3 bg-slate-900 text-white"
73
+ v-html="tooltip"
74
74
  />
75
75
  </slot>
76
76
  </transition>
@@ -79,7 +79,6 @@
79
79
  </template>
80
80
 
81
81
  <script lang="ts" setup>
82
- import { vSafeHtml } from '@/directives/safeHtml';
83
82
  import { ClassNameValue, twMerge } from 'tailwind-merge';
84
83
  import { RouteLocationRaw } from 'vue-router';
85
84
  import { BaseIcon } from '.';
@@ -43,9 +43,9 @@
43
43
  @change="onVisibleColumnChange($event, element.newKey)"
44
44
  >
45
45
  <div
46
- v-safe-html="element.label"
47
46
  class="text-xs grow leading-tight"
48
47
  :class="[element.toggle ? 'text-slate-700' : 'text-slate-400']"
48
+ v-html="element.label"
49
49
  >
50
50
  </div>
51
51
  </label>
@@ -57,7 +57,6 @@
57
57
  </template>
58
58
 
59
59
  <script lang="ts" setup>
60
- import { vSafeHtml } from '@/directives/safeHtml';
61
60
  import { cloneDeep } from 'lodash';
62
61
  import { PropType } from 'vue';
63
62
  import BaseDataTableTemplate from './BaseDataTableTemplate.vue';
@@ -58,12 +58,12 @@
58
58
  @click="sort(column, undefined, $event as any)"
59
59
  >
60
60
  <div
61
- v-safe-html="column.label"
62
61
  class="whitespace-nowrap text-slate-600"
63
62
  :class="{
64
63
  'text-[12px]': size == 'sm',
65
64
  'text-xs': size == 'md',
66
65
  }"
66
+ v-html="column.label"
67
67
  />
68
68
  <!-- h-4 is used to make sure the tooltip icon is always smaller than label and avoid alignment issues when icon is not present -->
69
69
  <div
@@ -197,7 +197,6 @@
197
197
  </template>
198
198
 
199
199
  <script lang="ts" setup>
200
- import { vSafeHtml } from '@/directives/safeHtml';
201
200
  import { PropType, ref } from 'vue';
202
201
  import { BaseTableColumnData, CollectionItem, Row } from '@/types';
203
202
  import SlotComponent from './SlotComponent';
@@ -47,8 +47,8 @@
47
47
  <div class="mt-2">
48
48
  <div
49
49
  v-if="html"
50
- v-safe-html="message"
51
50
  class="text-slate-500 prose-sm prose-p:leading-snug prose-a:text-blue-600 prose-a:underline"
51
+ v-html="message"
52
52
  />
53
53
  <p
54
54
  v-else
@@ -118,7 +118,6 @@
118
118
  </template>
119
119
 
120
120
  <script lang="ts" setup>
121
- import { vSafeHtml } from '@/directives/safeHtml';
122
121
  import { PropType } from 'vue';
123
122
  import { Icon as BaseIcon } from '@iconify/vue';
124
123
  import { t } from '@/i18n';
@@ -10,9 +10,9 @@
10
10
  />
11
11
  <div class="min-w-0 flex-1">
12
12
  <div
13
- v-safe-html="notification.text"
14
13
  class="text-sm leading-tight"
15
14
  :class="textClasses"
15
+ v-html="notification.text"
16
16
  />
17
17
  <BaseDisplayRelativeTime
18
18
  v-if="notification.created_at"
@@ -32,7 +32,6 @@
32
32
  </template>
33
33
 
34
34
  <script lang="ts" setup>
35
- import { vSafeHtml } from '@/directives/safeHtml';
36
35
  import { Notification } from '@/types/Notification';
37
36
  import BaseDisplayRelativeTime from './BaseDisplayRelativeTime.vue';
38
37
 
@@ -32,8 +32,8 @@
32
32
  name="tooltip"
33
33
  >
34
34
  <div
35
- v-safe-html="tooltip"
36
35
  class="text-xs max-w-xs leading-snug rounded-md pt-1.5 pb-2 px-3 bg-slate-900 text-white"
36
+ v-html="tooltip"
37
37
  />
38
38
  </slot>
39
39
  </transition>
@@ -42,7 +42,6 @@
42
42
  </template>
43
43
 
44
44
  <script lang="ts" setup>
45
- import { vSafeHtml } from '@/directives/safeHtml';
46
45
  import { useTooltip } from '@/composables/tooltip';
47
46
  import { cellClasses } from '@/services/table/classes';
48
47
  import { CellConfig, TableProps } from '@/services/table/types';
@@ -28,11 +28,11 @@
28
28
  >
29
29
  <div class="relative filter drop-shadow-[0_1px_2px_rgba(0,0,0,0.1)]">
30
30
  <div
31
- v-safe-html="text"
32
31
  class="text-xs max-w-xs leading-snug rounded-md pt-1.5 pb-2 px-3"
33
32
  :class="[
34
33
  dark ? 'bg-slate-900 text-white' : 'bg-white text-slate-900',
35
34
  ]"
35
+ v-html="text"
36
36
  />
37
37
  <div
38
38
  ref="arrowRef"
@@ -51,7 +51,6 @@
51
51
  </template>
52
52
 
53
53
  <script lang="ts" setup>
54
- import { vSafeHtml } from '@/directives/safeHtml';
55
54
  import { useTooltip } from '@/composables/tooltip';
56
55
  import { unrefElement } from '@vueuse/core';
57
56
  import { UseFloatingOptions } from '@floating-ui/vue';
package/src/index.ts CHANGED
@@ -13,7 +13,6 @@ import {
13
13
  useLayoutHeaderHeight,
14
14
  } from './composables/layoutHeaderHeight';
15
15
  import { useField } from './composables/field';
16
- import { vSafeHtml, SAFE_HTML_CONFIG } from './directives/safeHtml';
17
16
 
18
17
  const messages = { en, fr };
19
18
 
@@ -77,8 +76,6 @@ function install(app: App, options?: Options) {
77
76
  app.component(key, components[key]);
78
77
  }
79
78
 
80
- app.directive('safe-html', vSafeHtml);
81
-
82
79
  if (options?.http) {
83
80
  config.http = options.http;
84
81
  }
@@ -145,5 +142,3 @@ export { useLayoutHeaderHeight };
145
142
  export { LAYOUT_HEADER_HEIGHT_CSS_VARIABLE };
146
143
  export { useField };
147
144
  export { SettingsStorage };
148
- export { vSafeHtml };
149
- export { SAFE_HTML_CONFIG };
package/src/lang/en.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "address_2_description": "Apartment, suite, unit, building",
13
13
  "and": "and",
14
14
  "apply": "Apply",
15
- "apply_signature": "Apply my signature",
15
+ "apply_signature": "Apply signature",
16
16
  "apply_filters": "Apply filters",
17
17
  "authentication_code": "Authentication code",
18
18
  "autocomplete_placeholder": "Search...",
@@ -105,4 +105,4 @@
105
105
  "today": "Today",
106
106
  "week": "Week",
107
107
  "year": "Year"
108
- }
108
+ }
package/src/lang/fr.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "address_2_description": "Appartement, suite, unité, immeuble",
13
13
  "and": "et",
14
14
  "apply": "Appliquer",
15
- "apply_signature": "Appliquer ma signature",
15
+ "apply_signature": "Appliquer signature",
16
16
  "apply_filters": "Appliquer les filtres",
17
17
  "authentication_code": "Code d'authentification",
18
18
  "autocomplete_placeholder": "Rechercher...",
@@ -105,4 +105,4 @@
105
105
  "today": "Aujourd\\'hui",
106
106
  "week": "Semaine",
107
107
  "year": "Année"
108
- }
108
+ }
@@ -1,4 +0,0 @@
1
- import type { Config } from 'dompurify';
2
- import type { Directive } from 'vue';
3
- export declare const SAFE_HTML_CONFIG: Config;
4
- export declare const vSafeHtml: Directive<HTMLElement, string | null | undefined>;
@@ -1,28 +0,0 @@
1
- import DOMPurify from 'dompurify';
2
- import type { Config } from 'dompurify';
3
- import type { Directive } from 'vue';
4
-
5
- // Must keep BaseTipTap output intact: links (href/target), images,
6
- // highlights (<mark style="background-color">), sub/superscript.
7
- export const SAFE_HTML_CONFIG: Config = {
8
- USE_PROFILES: { html: true },
9
- ADD_ATTR: ['target'],
10
- FORBID_TAGS: ['style', 'form', 'input', 'textarea', 'select', 'button'],
11
- };
12
-
13
- DOMPurify.addHook('afterSanitizeAttributes', (node) => {
14
- if (node.tagName === 'A' && node.getAttribute('target') === '_blank') {
15
- node.setAttribute('rel', 'noopener noreferrer');
16
- }
17
- });
18
-
19
- export const vSafeHtml: Directive<HTMLElement, string | null | undefined> = {
20
- mounted: (el, { value }) => {
21
- el.innerHTML = DOMPurify.sanitize(value ?? '', SAFE_HTML_CONFIG);
22
- },
23
- updated: (el, { value, oldValue }) => {
24
- if (value !== oldValue) {
25
- el.innerHTML = DOMPurify.sanitize(value ?? '', SAFE_HTML_CONFIG);
26
- }
27
- },
28
- };