fix: add .js to external imports.

This commit is contained in:
Sidharth Vinod
2022-12-13 00:22:57 +05:30
parent fac3a4d29b
commit 89451ca640
4 changed files with 10 additions and 9 deletions

View File

@@ -85,6 +85,7 @@
"sveidqvist", "sveidqvist",
"techn", "techn",
"teststr", "teststr",
"textlength",
"treemap", "treemap",
"ts-nocheck", "ts-nocheck",
"tuleap", "tuleap",

View File

@@ -4,7 +4,7 @@
*/ */
import { D3Element } from './mermaidAPI'; import { D3Element } from './mermaidAPI';
import isEmpty from 'lodash-es/isEmpty'; import isEmpty from 'lodash-es/isEmpty.js';
/** /**
* Add aria-roledescription to the svg element to the diagramType * Add aria-roledescription to the svg element to the diagramType

View File

@@ -29,7 +29,7 @@ import utils, { directiveSanitizer } from './utils';
import DOMPurify from 'dompurify'; import DOMPurify from 'dompurify';
import { MermaidConfig } from './config.type'; import { MermaidConfig } from './config.type';
import { evaluate } from './diagrams/common/common'; import { evaluate } from './diagrams/common/common';
import isEmpty from 'lodash-es/isEmpty'; import isEmpty from 'lodash-es/isEmpty.js';
import { setA11yDiagramInfo, addSVGa11yTitleDescription } from './accessibility'; import { setA11yDiagramInfo, addSVGa11yTitleDescription } from './accessibility';
// diagram names that support classDef statements // diagram names that support classDef statements
@@ -55,8 +55,8 @@ const IFRAME_SANDBOX_OPTS = 'allow-top-navigation-by-user-activation allow-popup
const IFRAME_NOT_SUPPORTED_MSG = 'The "iframe" tag is not supported by your browser.'; const IFRAME_NOT_SUPPORTED_MSG = 'The "iframe" tag is not supported by your browser.';
// DOMPurify settings for svgCode // DOMPurify settings for svgCode
const DOMPURE_TAGS = ['foreignobject']; const DOMPURIFY_TAGS = ['foreignobject'];
const DOMPURE_ATTR = ['dominant-baseline']; const DOMPURIFY_ATTR = ['dominant-baseline'];
// This is what is returned from getClasses(...) methods. // This is what is returned from getClasses(...) methods.
// It is slightly renamed to ..StyleClassDef instead of just ClassDef because "class" is a greatly ambiguous and overloaded word. // It is slightly renamed to ..StyleClassDef instead of just ClassDef because "class" is a greatly ambiguous and overloaded word.
@@ -539,8 +539,8 @@ const render = function (
} else if (!isLooseSecurityLevel) { } else if (!isLooseSecurityLevel) {
// Sanitize the svgCode using DOMPurify // Sanitize the svgCode using DOMPurify
svgCode = DOMPurify.sanitize(svgCode, { svgCode = DOMPurify.sanitize(svgCode, {
ADD_TAGS: DOMPURE_TAGS, ADD_TAGS: DOMPURIFY_TAGS,
ADD_ATTR: DOMPURE_ATTR, ADD_ATTR: DOMPURIFY_ATTR,
}); });
} }
@@ -741,8 +741,8 @@ const renderAsync = async function (
} else if (!isLooseSecurityLevel) { } else if (!isLooseSecurityLevel) {
// Sanitize the svgCode using DOMPurify // Sanitize the svgCode using DOMPurify
svgCode = DOMPurify.sanitize(svgCode, { svgCode = DOMPurify.sanitize(svgCode, {
ADD_TAGS: DOMPURE_TAGS, ADD_TAGS: DOMPURIFY_TAGS,
ADD_ATTR: DOMPURE_ATTR, ADD_ATTR: DOMPURIFY_ATTR,
}); });
} }

View File

@@ -21,7 +21,7 @@ import { log } from './logger';
import { detectType } from './diagram-api/detectType'; import { detectType } from './diagram-api/detectType';
import assignWithDepth from './assignWithDepth'; import assignWithDepth from './assignWithDepth';
import { MermaidConfig } from './config.type'; import { MermaidConfig } from './config.type';
import memoize from 'lodash-es/memoize'; import memoize from 'lodash-es/memoize.js';
// Effectively an enum of the supported curve types, accessible by name // Effectively an enum of the supported curve types, accessible by name
const d3CurveTypes = { const d3CurveTypes = {