diff --git a/packages/mermaid/src/diagrams/architecture/architectureIcons.ts b/packages/mermaid/src/diagrams/architecture/architectureIcons.ts index bf6bfd4f1..fac4a7b12 100644 --- a/packages/mermaid/src/diagrams/architecture/architectureIcons.ts +++ b/packages/mermaid/src/diagrams/architecture/architectureIcons.ts @@ -1,4 +1,4 @@ -import { unknownIcon } from 'mermaid/dist/rendering-util/icons.js'; +import { unknownIcon } from '../../rendering-util/icons.js'; import type { IconifyJSON } from '@iconify/types'; const wrapIcon = (icon: string) => { diff --git a/packages/mermaid/src/diagrams/architecture/architectureRenderer.ts b/packages/mermaid/src/diagrams/architecture/architectureRenderer.ts index f7dcd325c..af9429539 100644 --- a/packages/mermaid/src/diagrams/architecture/architectureRenderer.ts +++ b/packages/mermaid/src/diagrams/architecture/architectureRenderer.ts @@ -1,4 +1,4 @@ -import { registerIconPacks } from 'mermaid/dist/rendering-util/icons.js'; +import { registerIconPacks } from '../../rendering-util/icons.js'; import type { Position } from 'cytoscape'; import cytoscape from 'cytoscape'; import type { FcoseLayoutOptions } from 'cytoscape-fcose'; diff --git a/packages/mermaid/src/diagrams/architecture/svgDraw.ts b/packages/mermaid/src/diagrams/architecture/svgDraw.ts index 0a4a44d9c..b10a451fe 100644 --- a/packages/mermaid/src/diagrams/architecture/svgDraw.ts +++ b/packages/mermaid/src/diagrams/architecture/svgDraw.ts @@ -1,4 +1,4 @@ -import { getIconSVG } from 'mermaid/dist/rendering-util/icons.js'; +import { getIconSVG } from '../../rendering-util/icons.js'; import type cytoscape from 'cytoscape'; import { getConfig } from '../../diagram-api/diagramAPI.js'; import { createText } from '../../rendering-util/createText.js'; diff --git a/packages/mermaid/src/mermaid.ts b/packages/mermaid/src/mermaid.ts index 6a7efb375..e9fc9196a 100644 --- a/packages/mermaid/src/mermaid.ts +++ b/packages/mermaid/src/mermaid.ts @@ -2,7 +2,7 @@ * Web page integration module for the mermaid framework. It uses the mermaidAPI for mermaid * functionality and to render the diagrams to svg code! */ -import { registerIconPacks } from 'mermaid/dist/rendering-util/icons.js'; +import { registerIconPacks } from './rendering-util/icons.js'; import { dedent } from 'ts-dedent'; import type { MermaidConfig } from './config.type.js'; import { detectType, registerLazyLoadedDiagrams } from './diagram-api/detectType.js'; diff --git a/packages/mermaid/src/rendering-util/createText.ts b/packages/mermaid/src/rendering-util/createText.ts index 0a205ea31..845705210 100644 --- a/packages/mermaid/src/rendering-util/createText.ts +++ b/packages/mermaid/src/rendering-util/createText.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ // @ts-nocheck TODO: Fix types -import { getConfig } from 'mermaid/dist/diagram-api/diagramAPI.js'; -import common, { hasKatex, renderKatex } from 'mermaid/dist/diagrams/common/common.js'; +import { getConfig } from '../diagram-api/diagramAPI.js'; +import common, { hasKatex, renderKatex } from '../diagrams/common/common.js'; import { select } from 'd3'; import type { MermaidConfig } from '../config.type.js'; import type { SVGGroup } from '../diagram-api/types.js'; diff --git a/packages/mermaid/src/rendering-util/icons.ts b/packages/mermaid/src/rendering-util/icons.ts index d08d55f43..5eef3f7eb 100644 --- a/packages/mermaid/src/rendering-util/icons.ts +++ b/packages/mermaid/src/rendering-util/icons.ts @@ -1,4 +1,4 @@ -import { log } from 'mermaid/dist/logger.js'; +import { log } from '../logger.js'; import type { ExtendedIconifyIcon, IconifyIcon, IconifyJSON } from '@iconify/types'; import type { IconifyIconCustomisations } from '@iconify/utils'; import { getIconData, iconToHTML, iconToSVG, replaceIDs, stringToIcon } from '@iconify/utils'; diff --git a/packages/mermaid/src/rendering-util/layout-algorithms/dagre/index.js b/packages/mermaid/src/rendering-util/layout-algorithms/dagre/index.js index afd1f4a9c..9367a65a5 100644 --- a/packages/mermaid/src/rendering-util/layout-algorithms/dagre/index.js +++ b/packages/mermaid/src/rendering-util/layout-algorithms/dagre/index.js @@ -23,7 +23,7 @@ import { insertEdge, clear as clearEdges, } from '../../rendering-elements/edges.js'; -import { log } from 'mermaid/dist/logger.js'; +import { log } from '../../../logger.js'; import { getSubGraphTitleMargins } from '../../../utils/subGraphTitleMargins.js'; import { getConfig } from '../../../diagram-api/diagramAPI.js'; diff --git a/packages/mermaid/src/rendering-util/layout-algorithms/dagre/mermaid-graphlib.js b/packages/mermaid/src/rendering-util/layout-algorithms/dagre/mermaid-graphlib.js index 0cde897ae..f0e5cd5ed 100644 --- a/packages/mermaid/src/rendering-util/layout-algorithms/dagre/mermaid-graphlib.js +++ b/packages/mermaid/src/rendering-util/layout-algorithms/dagre/mermaid-graphlib.js @@ -1,5 +1,5 @@ /** Decorates with functions required by mermaids dagre-wrapper. */ -import { log } from 'mermaid/dist/logger.js'; +import { log } from '../../../logger.js'; import * as graphlib from 'dagre-d3-es/src/graphlib/index.js'; import * as graphlibJson from 'dagre-d3-es/src/graphlib/json.js'; diff --git a/packages/mermaid/src/rendering-util/layout-algorithms/dagre/mermaid-graphlib.spec.js b/packages/mermaid/src/rendering-util/layout-algorithms/dagre/mermaid-graphlib.spec.js index 545a35a92..11acd44eb 100644 --- a/packages/mermaid/src/rendering-util/layout-algorithms/dagre/mermaid-graphlib.spec.js +++ b/packages/mermaid/src/rendering-util/layout-algorithms/dagre/mermaid-graphlib.spec.js @@ -6,7 +6,7 @@ import { extractDescendants, sortNodesByHierarchy, } from './mermaid-graphlib.js'; -import { setLogLevel, log } from 'mermaid/dist/logger.js'; +import { setLogLevel, log } from '../../../logger.js'; describe('Graphlib decorations', () => { let g; diff --git a/packages/mermaid/src/rendering-util/render.ts b/packages/mermaid/src/rendering-util/render.ts index 8306bc15a..b975e7bf9 100644 --- a/packages/mermaid/src/rendering-util/render.ts +++ b/packages/mermaid/src/rendering-util/render.ts @@ -1,7 +1,7 @@ -import type { SVG } from 'mermaid/dist/diagram-api/types.js'; -import type { InternalHelpers } from 'mermaid/dist/internals.js'; -import { internalHelpers } from 'mermaid/dist/internals.js'; -import { log } from 'mermaid/dist/logger.js'; +import type { SVG } from '../diagram-api/types.js'; +import type { InternalHelpers } from '../internals.js'; +import { internalHelpers } from '../internals.js'; +import { log } from '../logger.js'; import type { LayoutData } from './types.js'; export interface RenderOptions { diff --git a/packages/mermaid/src/rendering-util/rendering-elements/clusters.js b/packages/mermaid/src/rendering-util/rendering-elements/clusters.js index a963bba9b..c5fd0a91d 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/clusters.js +++ b/packages/mermaid/src/rendering-util/rendering-elements/clusters.js @@ -1,7 +1,7 @@ -import { getConfig } from 'mermaid/dist/diagram-api/diagramAPI.js'; -import { evaluate } from 'mermaid/dist/diagrams/common/common.js'; -import { log } from 'mermaid/dist/logger.js'; -import { getSubGraphTitleMargins } from 'mermaid/dist/utils/subGraphTitleMargins.js'; +import { getConfig } from '../../diagram-api/diagramAPI.js'; +import { evaluate } from '../../diagrams/common/common.js'; +import { log } from '../../logger.js'; +import { getSubGraphTitleMargins } from '../../utils/subGraphTitleMargins.js'; import { select } from 'd3'; import rough from 'roughjs'; import { createText } from '../createText.ts'; @@ -11,7 +11,7 @@ import { createRoundedRectPathD } from './shapes/roundedRectPath.ts'; import { styles2String, userNodeOverrides, -} from 'mermaid/dist/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.js'; +} from './shapes/handDrawnShapeStyles.js'; const rect = async (parent, node) => { log.info('Creating subgraph rect for ', node.id, node); diff --git a/packages/mermaid/src/rendering-util/rendering-elements/createLabel.js b/packages/mermaid/src/rendering-util/rendering-elements/createLabel.js index 2d560e85d..482dbb9f1 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/createLabel.js +++ b/packages/mermaid/src/rendering-util/rendering-elements/createLabel.js @@ -1,8 +1,8 @@ import { select } from 'd3'; -import { log } from 'mermaid/dist/logger.js'; -import { getConfig } from 'mermaid/dist/diagram-api/diagramAPI.js'; -import common, { evaluate, renderKatex, hasKatex } from 'mermaid/dist/diagrams/common/common.js'; -import { decodeEntities } from 'mermaid/dist/utils.js'; +import { log } from '../../logger.js'; +import { getConfig } from '../../diagram-api/diagramAPI.js'; +import common, { evaluate, renderKatex, hasKatex } from '../../diagrams/common/common.js'; +import { decodeEntities } from '../../utils.js'; /** * @param dom diff --git a/packages/mermaid/src/rendering-util/rendering-elements/edgeMarker.spec.ts b/packages/mermaid/src/rendering-util/rendering-elements/edgeMarker.spec.ts index 313dc1d01..7702782c2 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/edgeMarker.spec.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/edgeMarker.spec.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/unbound-method */ -import type { SVG } from 'mermaid/dist/diagram-api/types.js'; +import type { SVG } from '../../diagram-api/types.js'; import type { Mocked } from 'vitest'; import { addEdgeMarkers } from './edgeMarker.js'; diff --git a/packages/mermaid/src/rendering-util/rendering-elements/edgeMarker.ts b/packages/mermaid/src/rendering-util/rendering-elements/edgeMarker.ts index 032b3989c..5371ac32d 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/edgeMarker.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/edgeMarker.ts @@ -1,6 +1,6 @@ -import type { SVG } from 'mermaid/dist/diagram-api/types.js'; -import { log } from 'mermaid/dist/logger.js'; -import type { EdgeData } from 'mermaid/dist/types.js'; +import type { SVG } from '../../diagram-api/types.js'; +import { log } from '../../logger.js'; +import type { EdgeData } from '../../types.js'; /** * Adds SVG markers to a path element based on the arrow types specified in the edge. * diff --git a/packages/mermaid/src/rendering-util/rendering-elements/edges.js b/packages/mermaid/src/rendering-util/rendering-elements/edges.js index 999dc3d1c..41368ee1e 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/edges.js +++ b/packages/mermaid/src/rendering-util/rendering-elements/edges.js @@ -1,10 +1,10 @@ -import { getConfig } from 'mermaid/dist/diagram-api/diagramAPI.js'; -import { evaluate } from 'mermaid/dist/diagrams/common/common.js'; -import { log } from 'mermaid/dist/logger.js'; -import { createText } from 'mermaid/dist/rendering-util/createText.ts'; -import utils from 'mermaid/dist/utils.js'; -import { getLineFunctionsWithOffset } from 'mermaid/dist/utils/lineWithOffset.js'; -import { getSubGraphTitleMargins } from 'mermaid/dist/utils/subGraphTitleMargins.js'; +import { getConfig } from '../../diagram-api/diagramAPI.js'; +import { evaluate } from '../../diagrams/common/common.js'; +import { log } from '../../logger.js'; +import { createText } from '../createText.js'; +import utils from '../../utils.js'; +import { getLineFunctionsWithOffset } from '../../utils/lineWithOffset.js'; +import { getSubGraphTitleMargins } from '../../utils/subGraphTitleMargins.js'; import { curveBasis, line, select } from 'd3'; import rough from 'roughjs'; import createLabel from './createLabel.js'; diff --git a/packages/mermaid/src/rendering-util/rendering-elements/markers.js b/packages/mermaid/src/rendering-util/rendering-elements/markers.js index b9494c4c1..b2592e20e 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/markers.js +++ b/packages/mermaid/src/rendering-util/rendering-elements/markers.js @@ -1,5 +1,5 @@ /** Setup arrow head and define the marker. The result is appended to the svg. */ -import { log } from 'mermaid/dist/logger.js'; +import { log } from '../../logger.js'; // Only add the number of markers that the diagram needs const insertMarkers = (elem, markerArray, type, id) => { diff --git a/packages/mermaid/src/rendering-util/rendering-elements/nodes.js b/packages/mermaid/src/rendering-util/rendering-elements/nodes.js index 830639f0c..2f69a36bc 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/nodes.js +++ b/packages/mermaid/src/rendering-util/rendering-elements/nodes.js @@ -1,4 +1,4 @@ -import { log } from 'mermaid/dist/logger.js'; +import { log } from '../../logger.js'; import { state } from './shapes/state.ts'; import { roundedRect } from './shapes/roundedRect.ts'; import { squareRect } from './shapes/squareRect.ts'; @@ -9,7 +9,7 @@ import { choice } from './shapes/choice.ts'; import { note } from './shapes/note.ts'; import { stadium } from './shapes/stadium.js'; import { rectWithTitle } from './shapes/rectWithTitle.js'; -import { getConfig } from 'mermaid/dist/diagram-api/diagramAPI.js'; +import { getConfig } from '../../diagram-api/diagramAPI.js'; import { subroutine } from './shapes/subroutine.js'; import { cylinder } from './shapes/cylinder.js'; import { circle } from './shapes/circle.js'; diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/choice.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/choice.ts index 9b99b8e7f..000d627cf 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/choice.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/choice.ts @@ -1,10 +1,10 @@ import intersect from '../intersect/index.js'; -import type { Node } from 'mermaid/dist/rendering-util/types.d.ts'; -import type { SVG } from 'mermaid/dist/diagram-api/types.js'; +import type { Node } from '../../types.js'; +import type { SVG } from '../../../diagram-api/types.js'; // @ts-ignore TODO: Fix rough typings import rough from 'roughjs'; import { solidStateFill, styles2String } from './handDrawnShapeStyles.js'; -import { getConfig } from 'mermaid/dist/diagram-api/diagramAPI.js'; +import { getConfig } from '../../../diagram-api/diagramAPI.js'; export const choice = (parent: SVG, node: Node) => { const { labelStyles, nodeStyles } = styles2String(node); diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/circle.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/circle.ts index 3c301a025..601bc7a0f 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/circle.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/circle.ts @@ -1,11 +1,11 @@ -import { log } from 'mermaid/dist/logger.js'; +import { log } from '../../../logger.js'; import { labelHelper, updateNodeBounds, getNodeClasses } from './util.js'; import intersect from '../intersect/index.js'; -import type { Node } from 'mermaid/dist/rendering-util/types.d.ts'; +import type { Node } from '../../types.js'; import { styles2String, userNodeOverrides, -} from 'mermaid/dist/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.js'; +} from './handDrawnShapeStyles.js'; import rough from 'roughjs'; export const circle = async (parent: SVGAElement, node: Node): Promise => { diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/cylinder.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/cylinder.ts index c92b40138..c1181c4e1 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/cylinder.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/cylinder.ts @@ -1,10 +1,10 @@ import { labelHelper, updateNodeBounds, getNodeClasses } from './util.js'; import intersect from '../intersect/index.js'; -import type { Node } from 'mermaid/dist/rendering-util/types.d.ts'; +import type { Node } from '../../types.js'; import { styles2String, userNodeOverrides, -} from 'mermaid/dist/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.js'; +} from './handDrawnShapeStyles.js'; import rough from 'roughjs'; export const createCylinderPathD = ( diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/doubleCircle.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/doubleCircle.ts index 8672ffbff..d83b48514 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/doubleCircle.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/doubleCircle.ts @@ -1,11 +1,11 @@ -import { log } from 'mermaid/dist/logger.js'; +import { log } from '../../../logger.js'; import { labelHelper, updateNodeBounds, getNodeClasses } from './util.js'; import intersect from '../intersect/index.js'; -import type { Node } from 'mermaid/dist/rendering-util/types.d.ts'; +import type { Node } from '../../types.js'; import { styles2String, userNodeOverrides, -} from 'mermaid/dist/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.js'; +} from './handDrawnShapeStyles.js'; import rough from 'roughjs'; export const doublecircle = async (parent: SVGAElement, node: Node): Promise => { diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/drawRect.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/drawRect.ts index e9643ba4f..41ec14c26 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/drawRect.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/drawRect.ts @@ -1,11 +1,11 @@ import { labelHelper, updateNodeBounds, getNodeClasses } from './util.js'; import intersect from '../intersect/index.js'; -import type { Node, RectOptions } from 'mermaid/dist/rendering-util/types.d.ts'; +import type { Node, RectOptions } from '../../types.js'; import { createRoundedRectPathD } from './roundedRectPath.js'; import { userNodeOverrides, styles2String, -} from 'mermaid/dist/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.js'; +} from './handDrawnShapeStyles.js'; import rough from 'roughjs'; export const drawRect = async (parent: SVGAElement, node: Node, options: RectOptions) => { diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/forkJoin.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/forkJoin.ts index 324bb3134..b2dead73e 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/forkJoin.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/forkJoin.ts @@ -1,10 +1,10 @@ import { updateNodeBounds } from './util.js'; import intersect from '../intersect/index.js'; -import type { Node } from 'mermaid/dist/rendering-util/types.d.ts'; -import type { SVG } from 'mermaid/dist/diagram-api/types.js'; +import type { Node } from '../../types.js'; +import type { SVG } from '../../../diagram-api/types.js'; import rough from 'roughjs'; import { solidStateFill } from './handDrawnShapeStyles.js'; -import { getConfig } from 'mermaid/dist/diagram-api/diagramAPI.js'; +import { getConfig } from '../../../diagram-api/diagramAPI.js'; export const forkJoin = (parent: SVG, node: Node, dir: string) => { const { themeVariables } = getConfig(); diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.ts index d764527d8..99edc4874 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.ts @@ -1,5 +1,5 @@ -import { getConfig } from 'mermaid/dist/diagram-api/diagramAPI.js'; -import type { Node } from 'mermaid/dist/rendering-util/types.d.ts'; +import { getConfig } from '../../../diagram-api/diagramAPI.js'; +import type { Node } from '../../types.js'; // Striped fill like start or fork nodes in state diagrams export const solidStateFill = (color: string) => { diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/hexagon.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/hexagon.ts index 5a1197c51..a8242ce50 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/hexagon.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/hexagon.ts @@ -1,10 +1,10 @@ import { labelHelper, updateNodeBounds, getNodeClasses } from './util.js'; import intersect from '../intersect/index.js'; -import type { Node } from 'mermaid/dist/rendering-util/types.d.ts'; +import type { Node } from '../../types.js'; import { styles2String, userNodeOverrides, -} from 'mermaid/dist/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.js'; +} from './handDrawnShapeStyles.js'; import rough from 'roughjs'; import { insertPolygonShape } from './insertPolygonShape.js'; diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/invertedTrapezoid.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/invertedTrapezoid.ts index 5a8bf9765..f4654e4eb 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/invertedTrapezoid.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/invertedTrapezoid.ts @@ -1,10 +1,10 @@ import { labelHelper, updateNodeBounds, getNodeClasses } from './util.js'; import intersect from '../intersect/index.js'; -import type { Node } from 'mermaid/dist/rendering-util/types.d.ts'; +import type { Node } from '../../types.js'; import { styles2String, userNodeOverrides, -} from 'mermaid/dist/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.js'; +} from './handDrawnShapeStyles.js'; import rough from 'roughjs'; import { insertPolygonShape } from './insertPolygonShape.js'; diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/labelRect.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/labelRect.ts index 51605eae4..852f33e8a 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/labelRect.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/labelRect.ts @@ -1,4 +1,4 @@ -import type { Node, RectOptions } from 'mermaid/dist/rendering-util/types.d.ts'; +import type { Node, RectOptions } from '../../types.js'; import { drawRect } from './drawRect.js'; import { labelHelper, updateNodeBounds } from './util.js'; import intersect from '../intersect/index.js'; diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/leanLeft.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/leanLeft.ts index 8e06096f1..54467a483 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/leanLeft.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/leanLeft.ts @@ -1,10 +1,10 @@ import { labelHelper, updateNodeBounds, getNodeClasses } from './util.js'; import intersect from '../intersect/index.js'; -import type { Node } from 'mermaid/dist/rendering-util/types.d.ts'; +import type { Node } from '../../types.js'; import { styles2String, userNodeOverrides, -} from 'mermaid/dist/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.js'; +} from './handDrawnShapeStyles.js'; import rough from 'roughjs'; import { insertPolygonShape } from './insertPolygonShape.js'; diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/leanRight.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/leanRight.ts index b4c1ae705..90257086f 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/leanRight.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/leanRight.ts @@ -1,10 +1,10 @@ import { labelHelper, updateNodeBounds, getNodeClasses } from './util.js'; import intersect from '../intersect/index.js'; -import type { Node } from 'mermaid/dist/rendering-util/types.d.ts'; +import type { Node } from '../../types.js'; import { styles2String, userNodeOverrides, -} from 'mermaid/dist/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.js'; +} from './handDrawnShapeStyles.js'; import rough from 'roughjs'; import { insertPolygonShape } from './insertPolygonShape.js'; diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/note.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/note.ts index a567c3312..d337c85d4 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/note.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/note.ts @@ -1,8 +1,8 @@ -import { log } from 'mermaid/dist/logger.js'; +import { log } from '../../../logger.js'; import { labelHelper, updateNodeBounds } from './util.js'; import intersect from '../intersect/index.js'; -import { getConfig } from 'mermaid/dist/diagram-api/diagramAPI.js'; -import type { Node } from 'mermaid/dist/rendering-util/types.d.ts'; +import { getConfig } from '../../../diagram-api/diagramAPI.js'; +import type { Node } from '../../types.js'; import rough from 'roughjs'; export const note = async (parent: SVGAElement, node: Node) => { diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/question.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/question.ts index b3eed0f66..765e5c129 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/question.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/question.ts @@ -1,11 +1,11 @@ -import { log } from 'mermaid/dist/logger.js'; +import { log } from '../../../logger.js'; import { labelHelper, updateNodeBounds, getNodeClasses } from './util.js'; import intersect from '../intersect/index.js'; -import type { Node } from 'mermaid/dist/rendering-util/types.d.ts'; +import type { Node } from '../../types.js'; import { styles2String, userNodeOverrides, -} from 'mermaid/dist/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.js'; +} from './handDrawnShapeStyles.js'; import rough from 'roughjs'; import { insertPolygonShape } from './insertPolygonShape.js'; diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/rectLeftInvArrow.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/rectLeftInvArrow.ts index 4d7611331..899dc8d6e 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/rectLeftInvArrow.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/rectLeftInvArrow.ts @@ -1,10 +1,10 @@ import { labelHelper, updateNodeBounds, getNodeClasses } from './util.js'; import intersect from '../intersect/index.js'; -import type { Node } from 'mermaid/dist/rendering-util/types.d.ts'; +import type { Node } from '../../types.js'; import { styles2String, userNodeOverrides, -} from 'mermaid/dist/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.js'; +} from './handDrawnShapeStyles.js'; import rough from 'roughjs'; import { insertPolygonShape } from './insertPolygonShape.js'; diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/rectWithTitle.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/rectWithTitle.ts index 27ef201ee..db9804c55 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/rectWithTitle.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/rectWithTitle.ts @@ -1,17 +1,17 @@ -import type { Node } from 'mermaid/dist/rendering-util/types.d.ts'; +import type { Node } from '../../types.js'; import { select } from 'd3'; -import { evaluate } from 'mermaid/dist/diagrams/common/common.js'; +import { evaluate } from '../../../diagrams/common/common.js'; import { updateNodeBounds } from './util.js'; import createLabel from '../createLabel.js'; import intersect from '../intersect/index.js'; import { styles2String, userNodeOverrides, -} from 'mermaid/dist/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.js'; +} from './handDrawnShapeStyles.js'; import rough from 'roughjs'; -import { getConfig } from 'mermaid/dist/diagram-api/diagramAPI.js'; +import { getConfig } from '../../../diagram-api/diagramAPI.js'; import { createRoundedRectPathD } from './roundedRectPath.js'; -import { log } from 'mermaid/dist/logger.js'; +import { log } from '../../../logger.js'; export const rectWithTitle = async (parent: SVGElement, node: Node) => { const { labelStyles, nodeStyles } = styles2String(node); diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/roundedRect.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/roundedRect.ts index 534296587..ab31a510e 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/roundedRect.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/roundedRect.ts @@ -1,4 +1,4 @@ -import type { Node, RectOptions } from 'mermaid/dist/rendering-util/types.d.ts'; +import type { Node, RectOptions } from '../../types.js'; import { drawRect } from './drawRect.js'; export const roundedRect = async (parent: SVGAElement, node: Node) => { diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/squareRect.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/squareRect.ts index 2070e6a14..5ab8e2833 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/squareRect.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/squareRect.ts @@ -1,4 +1,4 @@ -import type { Node, RectOptions } from 'mermaid/dist/rendering-util/types.d.ts'; +import type { Node, RectOptions } from '../../types.js'; import { drawRect } from './drawRect.js'; export const squareRect = async (parent: SVGAElement, node: Node) => { diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/stadium.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/stadium.ts index bc42d5e6f..0363bba7d 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/stadium.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/stadium.ts @@ -1,10 +1,10 @@ import { labelHelper, updateNodeBounds, getNodeClasses } from './util.js'; import intersect from '../intersect/index.js'; -import type { Node } from 'mermaid/dist/rendering-util/types.d.ts'; +import type { Node } from '../../types.js'; import { styles2String, userNodeOverrides, -} from 'mermaid/dist/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.js'; +} from './handDrawnShapeStyles.js'; import rough from 'roughjs'; import { createRoundedRectPathD } from './roundedRectPath.js'; diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/state.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/state.ts index 06cbc636f..734194737 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/state.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/state.ts @@ -1,4 +1,4 @@ -import type { Node, RectOptions } from 'mermaid/dist/rendering-util/types.d.ts'; +import type { Node, RectOptions } from '../../types.js'; import { drawRect } from './drawRect.js'; export const state = async (parent: SVGAElement, node: Node) => { diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/stateEnd.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/stateEnd.ts index 57f391657..fde5b0367 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/stateEnd.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/stateEnd.ts @@ -1,10 +1,10 @@ import { updateNodeBounds } from './util.js'; import intersect from '../intersect/index.js'; -import type { Node } from 'mermaid/dist/rendering-util/types.d.ts'; -import type { SVG } from 'mermaid/dist/diagram-api/types.js'; +import type { Node } from '../../types.js'; +import type { SVG } from '../../../diagram-api/types.js'; import rough from 'roughjs'; import { solidStateFill } from './handDrawnShapeStyles.js'; -import { getConfig } from 'mermaid/dist/diagram-api/diagramAPI.js'; +import { getConfig } from '../../../diagram-api/diagramAPI.js'; export const stateEnd = (parent: SVG, node: Node) => { const { themeVariables } = getConfig(); diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/stateStart.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/stateStart.ts index f8d0e084d..30d606a84 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/stateStart.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/stateStart.ts @@ -1,10 +1,10 @@ import { updateNodeBounds } from './util.js'; import intersect from '../intersect/index.js'; -import type { Node } from 'mermaid/dist/rendering-util/types.d.ts'; -import type { SVG } from 'mermaid/dist/diagram-api/types.js'; +import type { Node } from '../../types.js'; +import type { SVG } from '../../../diagram-api/types.js'; import rough from 'roughjs'; import { solidStateFill } from './handDrawnShapeStyles.js'; -import { getConfig } from 'mermaid/dist/diagram-api/diagramAPI.js'; +import { getConfig } from '../../../diagram-api/diagramAPI.js'; export const stateStart = (parent: SVG, node: Node) => { const { themeVariables } = getConfig(); diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/subroutine.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/subroutine.ts index fbfa3ed5c..b77e533ed 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/subroutine.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/subroutine.ts @@ -1,10 +1,10 @@ import { labelHelper, updateNodeBounds, getNodeClasses } from './util.js'; import intersect from '../intersect/index.js'; -import type { Node } from 'mermaid/dist/rendering-util/types.d.ts'; +import type { Node } from '../../types.js'; import { styles2String, userNodeOverrides, -} from 'mermaid/dist/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.js'; +} from './handDrawnShapeStyles.js'; import rough from 'roughjs'; import { insertPolygonShape } from './insertPolygonShape.js'; diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/trapezoid.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/trapezoid.ts index 701747c1c..0629badde 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/trapezoid.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/trapezoid.ts @@ -1,10 +1,10 @@ import { labelHelper, updateNodeBounds, getNodeClasses } from './util.js'; import intersect from '../intersect/index.js'; -import type { Node } from 'mermaid/dist/rendering-util/types.d.ts'; +import type { Node } from '../../types.js'; import { styles2String, userNodeOverrides, -} from 'mermaid/dist/rendering-util/rendering-elements/shapes/handDrawnShapeStyles.js'; +} from './handDrawnShapeStyles.js'; import rough from 'roughjs'; import { insertPolygonShape } from './insertPolygonShape.js'; diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/util.js b/packages/mermaid/src/rendering-util/rendering-elements/shapes/util.js index 633171d5c..2b6a8c2f6 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/util.js +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/util.js @@ -1,8 +1,8 @@ -import { createText } from 'mermaid/dist/rendering-util/createText.ts'; -import { getConfig } from 'mermaid/dist/diagram-api/diagramAPI.js'; +import { createText } from '../../createText.js'; +import { getConfig } from '../../../diagram-api/diagramAPI.js'; import { select } from 'd3'; -import { evaluate, sanitizeText } from 'mermaid/dist/diagrams/common/common.js'; -import { decodeEntities } from 'mermaid/dist/utils.js'; +import { evaluate, sanitizeText } from '../../../diagrams/common/common.js'; +import { decodeEntities } from '../../../utils.js'; export const labelHelper = async (parent, node, _classes) => { let cssClasses; diff --git a/packages/mermaid/src/rendering-util/setupViewPortForSVG.ts b/packages/mermaid/src/rendering-util/setupViewPortForSVG.ts index 00d808066..d3df5ddb7 100644 --- a/packages/mermaid/src/rendering-util/setupViewPortForSVG.ts +++ b/packages/mermaid/src/rendering-util/setupViewPortForSVG.ts @@ -1,6 +1,6 @@ -import { configureSvgSize } from 'mermaid/dist/setupGraphViewbox.js'; -import type { SVG } from 'mermaid/dist/diagram-api/types.js'; -import { log } from 'mermaid/dist/logger.js'; +import { configureSvgSize } from '../setupGraphViewbox.js'; +import type { SVG } from '../diagram-api/types.js'; +import { log } from '../logger.js'; export const setupViewPortForSVG = ( svg: SVG, diff --git a/vite.config.ts b/vite.config.ts index 2db66b7a4..16d5801d2 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -2,16 +2,10 @@ import jison from './.vite/jisonPlugin.js'; import jsonSchemaPlugin from './.vite/jsonSchemaPlugin.js'; import typescript from '@rollup/plugin-typescript'; import { defaultExclude, defineConfig } from 'vitest/config'; -import path from 'path'; export default defineConfig({ resolve: { - extensions: ['.js'], - alias: { - // Define your alias here - 'mermaid/dist': path.resolve(__dirname, 'packages/mermaid/src'), - }, - }, + extensions: ['.js'] }, plugins: [ jison(), jsonSchemaPlugin(), // handles .schema.yaml JSON Schema files