mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
Fix all type errors in design system (#3956)
* 📘 Fix type errors in design system * 🔥 Remove unneeded `?` * 🔧 Add design system to Vetur * 📘 Improve typing of `$el` * ♻️ Address feedback * 📘 Type leftover `MouseEvent` * 📘 Type `event.target` properly
This commit is contained in:
@@ -28,7 +28,7 @@ const markdownLink = require('markdown-it-link-attributes');
|
||||
const markdownEmoji = require('markdown-it-emoji');
|
||||
const markdownTasklists = require('markdown-it-task-lists');
|
||||
|
||||
import xss from 'xss';
|
||||
import xss, { friendlyAttrValue } from 'xss';
|
||||
import { escapeMarkdown } from '../../utils/markdown';
|
||||
|
||||
const DEFAULT_OPTIONS_MARKDOWN = {
|
||||
@@ -131,7 +131,7 @@ export default Vue.extend({
|
||||
if (tag === 'img' && name === 'src') {
|
||||
if (value.match(fileIdRegex)) {
|
||||
const id = value.split('fileId:')[1];
|
||||
return `src=${xss.friendlyAttrValue(imageUrls[id])}` || '';
|
||||
return `src=${friendlyAttrValue(imageUrls[id])}` || '';
|
||||
}
|
||||
// Only allow http requests to supported image files from the `static` directory
|
||||
const isImageFile = value.split('#')[0].match(/\.(jpeg|jpg|gif|png|webp)$/) !== null;
|
||||
@@ -162,13 +162,14 @@ export default Vue.extend({
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
onClick(event) {
|
||||
onClick(event: MouseEvent) {
|
||||
let clickedLink = null;
|
||||
|
||||
if(event.target instanceof HTMLAnchorElement) {
|
||||
clickedLink = event.target;
|
||||
}
|
||||
if(event.target.matches('a *')) {
|
||||
|
||||
if(event.target instanceof HTMLElement && event.target.matches('a *')) {
|
||||
const parentLink = event.target.closest('a');
|
||||
if(parentLink) {
|
||||
clickedLink = parentLink;
|
||||
|
||||
Reference in New Issue
Block a user