@hostlink/nuxt-light 1.64.0 → 1.64.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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "light",
3
3
  "configKey": "light",
4
- "version": "1.64.0",
4
+ "version": "1.64.2",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -12,7 +12,7 @@ export type LSystemSettingSecurityProps = {
12
12
  password_expiration: string;
13
13
  password_expiration_duration: string;
14
14
  concurrent_login_disabled: string;
15
- web_authn_enabled?: string;
15
+ webauthn_enabled?: string;
16
16
  };
17
17
  declare const __VLS_export: import("vue").DefineComponent<LSystemSettingSecurityProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
18
  submit: (...args: any[]) => void;
@@ -32,6 +32,7 @@ declare const __VLS_export: import("vue").DefineComponent<LSystemSettingSecurity
32
32
  password_expiration: string;
33
33
  password_expiration_duration: string;
34
34
  concurrent_login_disabled: string;
35
+ webauthn_enabled: string;
35
36
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
36
37
  declare const _default: typeof __VLS_export;
37
38
  export default _default;
@@ -14,7 +14,7 @@ defineProps({
14
14
  password_expiration: { type: String, required: true, default: "0" },
15
15
  password_expiration_duration: { type: String, required: true, default: "90" },
16
16
  concurrent_login_disabled: { type: String, required: true, default: "0" },
17
- web_authn_enabled: { type: String, required: false }
17
+ webauthn_enabled: { type: String, required: false, default: "1" }
18
18
  });
19
19
  </script>
20
20
 
@@ -12,7 +12,7 @@ export type LSystemSettingSecurityProps = {
12
12
  password_expiration: string;
13
13
  password_expiration_duration: string;
14
14
  concurrent_login_disabled: string;
15
- web_authn_enabled?: string;
15
+ webauthn_enabled?: string;
16
16
  };
17
17
  declare const __VLS_export: import("vue").DefineComponent<LSystemSettingSecurityProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
18
  submit: (...args: any[]) => void;
@@ -32,6 +32,7 @@ declare const __VLS_export: import("vue").DefineComponent<LSystemSettingSecurity
32
32
  password_expiration: string;
33
33
  password_expiration_duration: string;
34
34
  concurrent_login_disabled: string;
35
+ webauthn_enabled: string;
35
36
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
36
37
  declare const _default: typeof __VLS_export;
37
38
  export default _default;
@@ -1,6 +1,7 @@
1
1
  <script setup>
2
2
  import { computed, ref, useAttrs } from "vue";
3
3
  import { useQuasar } from "quasar";
4
+ import { sanitizeHtml } from "../composables/sanitizeHtml";
4
5
  const $q = useQuasar();
5
6
  const editorRef = ref(null);
6
7
  const textColorRef = ref(null);
@@ -10,6 +11,9 @@ const highlight = ref("#ffff00aa");
10
11
  const foreColor = ref("#000000");
11
12
  const tableRows = ref(3);
12
13
  const tableCols = ref(3);
14
+ const onEditorBlur = () => {
15
+ emit("update:modelValue", sanitizeHtml(props.modelValue));
16
+ };
13
17
  const TextColorCMD = ((cmd, name) => {
14
18
  const edit = editorRef.value;
15
19
  textColorRef.value.hide();
@@ -182,7 +186,7 @@ const newFonts = {
182
186
  </script>
183
187
 
184
188
  <template>
185
- <q-editor v-model="localValue" ref="editorRef" v-bind="attrs">
189
+ <q-editor v-model="localValue" ref="editorRef" v-bind="attrs" @blur="onEditorBlur">
186
190
  <template v-slot:textColor>
187
191
  <q-btn-dropdown dense no-caps ref="textColorRef" no-wrap unelevated color="white" text-color="default"
188
192
  label="Text Color" icon="sym_o_format_color_text" size="sm">
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Sanitize HTML to prevent XSS attacks
3
+ * Use this before rendering user-generated content with v-html
4
+ *
5
+ * @example
6
+ * <div v-html="sanitizeHtml(userContent)" />
7
+ */
8
+ export declare const sanitizeHtml: (html: string) => string;
9
+ export default sanitizeHtml;
@@ -0,0 +1,80 @@
1
+ import DOMPurify from "dompurify";
2
+ const purifyConfig = {
3
+ ALLOWED_TAGS: [
4
+ "p",
5
+ "br",
6
+ "span",
7
+ "div",
8
+ "a",
9
+ "b",
10
+ "i",
11
+ "u",
12
+ "s",
13
+ "strong",
14
+ "em",
15
+ "strike",
16
+ "h1",
17
+ "h2",
18
+ "h3",
19
+ "h4",
20
+ "h5",
21
+ "h6",
22
+ "ul",
23
+ "ol",
24
+ "li",
25
+ "blockquote",
26
+ "pre",
27
+ "code",
28
+ "table",
29
+ "thead",
30
+ "tbody",
31
+ "tr",
32
+ "th",
33
+ "td",
34
+ "img",
35
+ "hr",
36
+ "sub",
37
+ "sup",
38
+ "font"
39
+ ],
40
+ ALLOWED_ATTR: [
41
+ "href",
42
+ "target",
43
+ "rel",
44
+ "src",
45
+ "alt",
46
+ "title",
47
+ "width",
48
+ "height",
49
+ "style",
50
+ "class",
51
+ "id",
52
+ "border",
53
+ "cellpadding",
54
+ "cellspacing",
55
+ "colspan",
56
+ "rowspan",
57
+ "align",
58
+ "valign",
59
+ "color",
60
+ "size",
61
+ "face"
62
+ ],
63
+ ALLOW_DATA_ATTR: false,
64
+ FORBID_TAGS: ["script", "style", "iframe", "object", "embed", "form", "input", "button"],
65
+ FORBID_ATTR: ["onerror", "onload", "onclick", "onmouseover", "onfocus", "onblur", "onchange", "onsubmit"]
66
+ };
67
+ let hookAdded = false;
68
+ if (!hookAdded && typeof window !== "undefined") {
69
+ DOMPurify.addHook("uponSanitizeAttribute", (node, data) => {
70
+ if (data.attrName.startsWith("on")) {
71
+ data.keepAttr = false;
72
+ }
73
+ });
74
+ hookAdded = true;
75
+ }
76
+ export const sanitizeHtml = (html) => {
77
+ if (!html) return "";
78
+ return DOMPurify.sanitize(html, purifyConfig);
79
+ };
80
+ export default sanitizeHtml;
@@ -33,7 +33,7 @@ onUnmounted(() => {
33
33
 
34
34
  <template>
35
35
  <l-page title="System Database Process">
36
- <q-table :rows="data?.database?.processList || []" hide-bottom v-bind="$light.styles.table" :loading="loading">
36
+ <q-table :rows="data?.database?.processList || []" v-bind="$light.styles.table" :loading="loading">
37
37
  <template #top-left>
38
38
  <q-btn label="Reload" outline color="primary" icon="sym_o_refresh" @click="refresh"></q-btn>
39
39
  </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.64.0",
3
+ "version": "1.64.2",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": {
6
6
  "type": "git",
@@ -40,6 +40,7 @@
40
40
  "axios": "^1.12.2",
41
41
  "defu": "^6.1.4",
42
42
  "diff2html": "^3.4.47",
43
+ "dompurify": "^3.3.1",
43
44
  "formkit-quasar": "^0.0.15",
44
45
  "json-to-graphql-query": "^2.3.0",
45
46
  "nuxt-quasar-ui": "^3.0.0",