diff --git a/lib/Diagram.js b/lib/Diagram.js index c1bd69ed8..8785f4e65 100644 --- a/lib/Diagram.js +++ b/lib/Diagram.js @@ -1,6 +1,6 @@ import { Injector } from 'didi'; -import CoreModule from './core'; +import CoreModule from './core/index.js'; /** * @typedef {import('didi').InjectionContext} InjectionContext diff --git a/lib/Diagram.spec.ts b/lib/Diagram.spec.ts index 099014d4f..4f2d93cd0 100644 --- a/lib/Diagram.spec.ts +++ b/lib/Diagram.spec.ts @@ -1,12 +1,12 @@ -import Diagram from './Diagram'; +import Diagram from './Diagram.js'; -import CommandModule from './command'; +import CommandModule from './command/index.js'; -import CoreModule from './core'; -import EventBus from './core/EventBus'; +import CoreModule from './core/index.js'; +import EventBus from './core/EventBus.js'; -import ModelingModule from './features/modeling'; -import Modeling from './features/modeling/Modeling'; +import ModelingModule from './features/modeling/index.js'; +import Modeling from './features/modeling/Modeling.js'; let diagram = new Diagram(); diff --git a/lib/command/CommandHandler.spec.ts b/lib/command/CommandHandler.spec.ts index 3e230d0a1..6d33f977c 100644 --- a/lib/command/CommandHandler.spec.ts +++ b/lib/command/CommandHandler.spec.ts @@ -1,7 +1,7 @@ -import CommandHandler from './CommandHandler'; -import { CommandContext } from './CommandStack'; +import CommandHandler from './CommandHandler.js'; +import { CommandContext } from './CommandStack.js'; -import Canvas from '../core/Canvas'; +import Canvas from '../core/Canvas.js'; export class AddShapeHandler implements CommandHandler { private _canvas: Canvas; diff --git a/lib/command/CommandHandler.ts b/lib/command/CommandHandler.ts index 6571ac320..c568958df 100644 --- a/lib/command/CommandHandler.ts +++ b/lib/command/CommandHandler.ts @@ -1,5 +1,5 @@ -import { ElementLike } from "../core/Types"; -import { CommandContext } from "./CommandStack"; +import { ElementLike } from '../core/Types.js'; +import { CommandContext } from './CommandStack.js'; /** * A command handler that may be registered via diff --git a/lib/command/CommandInterceptor.js b/lib/command/CommandInterceptor.js index 747723cf1..5e039d9d3 100644 --- a/lib/command/CommandInterceptor.js +++ b/lib/command/CommandInterceptor.js @@ -7,9 +7,9 @@ import { } from 'min-dash'; /** - * @typedef {import('../core/Types').ElementLike} ElementLike - * @typedef {import('../core/EventBus').default} EventBus - * @typedef {import('./CommandStack').CommandContext} CommandContext + * @typedef {import('../core/Types.js').ElementLike} ElementLike + * @typedef {import('../core/EventBus.js').default} EventBus + * @typedef {import('./CommandStack.js').CommandContext} CommandContext * * @typedef {string|string[]} Events * @typedef { (context: CommandContext) => ElementLike[] | void } HandlerFunction @@ -28,7 +28,7 @@ var DEFAULT_PRIORITY = 1000; * @example * * ```javascript - * import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor'; + * import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor.js'; * * class CommandLogger extends CommandInterceptor { * constructor(eventBus) { diff --git a/lib/command/CommandInterceptor.spec.ts b/lib/command/CommandInterceptor.spec.ts index 0ace9b36b..670465e0a 100644 --- a/lib/command/CommandInterceptor.spec.ts +++ b/lib/command/CommandInterceptor.spec.ts @@ -1,8 +1,8 @@ -import CommandInterceptor from './CommandInterceptor'; +import CommandInterceptor from './CommandInterceptor.js'; -import EventBus from '../core/EventBus'; +import EventBus from '../core/EventBus.js'; -import Modeling from '../features/modeling/Modeling'; +import Modeling from '../features/modeling/Modeling.js'; export class AddShapeBehavior extends CommandInterceptor { static $inject = [ 'eventBus', 'modeling' ]; diff --git a/lib/command/CommandStack.js b/lib/command/CommandStack.js index 6deff9760..50aa13bd0 100644 --- a/lib/command/CommandStack.js +++ b/lib/command/CommandStack.js @@ -6,10 +6,10 @@ import { /** * @typedef {import('didi').Injector} Injector * - * @typedef {import('../core/Types').ElementLike} ElementLike + * @typedef {import('../core/Types.js').ElementLike} ElementLike * - * @typedef {import('../core/EventBus').default} EventBus - * @typedef {import('./CommandHandler').default} CommandHandler + * @typedef {import('../core/EventBus.js').default} EventBus + * @typedef {import('./CommandHandler.js').default} CommandHandler * * @typedef { any } CommandContext * @typedef { { diff --git a/lib/command/CommandStack.spec.ts b/lib/command/CommandStack.spec.ts index 9d1325fa0..ec76c78b7 100644 --- a/lib/command/CommandStack.spec.ts +++ b/lib/command/CommandStack.spec.ts @@ -1,9 +1,9 @@ -import Diagram from '../Diagram'; +import Diagram from '../Diagram.js'; -import CommandModule from '.'; -import CommandStack from './CommandStack'; +import CommandModule from './index.js'; +import CommandStack from './CommandStack.js'; -import { AddShapeHandler } from './CommandHandler.spec'; +import { AddShapeHandler } from './CommandHandler.spec.js'; const diagram = new Diagram({ modules: [ diff --git a/lib/command/index.js b/lib/command/index.js index e4d09b4d5..f9767d172 100644 --- a/lib/command/index.js +++ b/lib/command/index.js @@ -1,4 +1,4 @@ -import CommandStack from './CommandStack'; +import CommandStack from './CommandStack.js'; /** * @type { import('didi').ModuleDeclaration } diff --git a/lib/core/Canvas.js b/lib/core/Canvas.js index e1767b084..115faefb8 100644 --- a/lib/core/Canvas.js +++ b/lib/core/Canvas.js @@ -16,14 +16,14 @@ import { import { add as collectionAdd, remove as collectionRemove -} from '../util/Collections'; +} from '../util/Collections.js'; import { getType, getBBox as getBoundingBox -} from '../util/Elements'; +} from '../util/Elements.js'; -import { asTRBL } from '../layout/LayoutUtil'; +import { asTRBL } from '../layout/LayoutUtil.js'; import { append as svgAppend, @@ -38,10 +38,10 @@ import { createMatrix as createMatrix } from 'tiny-svg'; /** - * @typedef {import('./Types').ConnectionLike} ConnectionLike - * @typedef {import('./Types').RootLike} RootLike - * @typedef {import('./Types').ParentLike } ParentLike - * @typedef {import('./Types').ShapeLike} ShapeLike + * @typedef {import('./Types.js').ConnectionLike} ConnectionLike + * @typedef {import('./Types.js').RootLike} RootLike + * @typedef {import('./Types.js').ParentLike } ParentLike + * @typedef {import('./Types.js').ShapeLike} ShapeLike * * @typedef { { * container?: HTMLElement; @@ -67,14 +67,14 @@ import { createMatrix as createMatrix } from 'tiny-svg'; * outer: Dimensions; * } & Rect } CanvasViewbox * - * @typedef {import('./ElementRegistry').default} ElementRegistry - * @typedef {import('./EventBus').default} EventBus - * @typedef {import('./GraphicsFactory').default} GraphicsFactory + * @typedef {import('./ElementRegistry.js').default} ElementRegistry + * @typedef {import('./EventBus.js').default} EventBus + * @typedef {import('./GraphicsFactory.js').default} GraphicsFactory * - * @typedef {import('../util/Types').Dimensions} Dimensions - * @typedef {import('../util/Types').Point} Point - * @typedef {import('../util/Types').Rect} Rect - * @typedef {import('../util/Types').RectTRBL} RectTRBL + * @typedef {import('../util/Types.js').Dimensions} Dimensions + * @typedef {import('../util/Types.js').Point} Point + * @typedef {import('../util/Types.js').Rect} Rect + * @typedef {import('../util/Types.js').RectTRBL} RectTRBL */ function round(number, resolution) { diff --git a/lib/core/Canvas.spec.ts b/lib/core/Canvas.spec.ts index 3af59af05..392d868fe 100644 --- a/lib/core/Canvas.spec.ts +++ b/lib/core/Canvas.spec.ts @@ -1,7 +1,7 @@ -import Diagram from '../Diagram'; +import Diagram from '../Diagram.js'; -import Canvas from './Canvas'; -import ElementFactory from './ElementFactory'; +import Canvas from './Canvas.js'; +import ElementFactory from './ElementFactory.js'; const diagram = new Diagram(); diff --git a/lib/core/ElementFactory.js b/lib/core/ElementFactory.js index 51f79ad33..b4ffdfcd8 100644 --- a/lib/core/ElementFactory.js +++ b/lib/core/ElementFactory.js @@ -1,15 +1,15 @@ import { create -} from '../model'; +} from '../model/index.js'; import { assign } from 'min-dash'; /** - * @typedef {import('../model/Types').Element} Element - * @typedef {import('../model/Types').Connection} Connection - * @typedef {import('../model/Types').Label} Label - * @typedef {import('../model/Types').Root} Root - * @typedef {import('../model/Types').Shape} Shape + * @typedef {import('../model/Types.js').Element} Element + * @typedef {import('../model/Types.js').Connection} Connection + * @typedef {import('../model/Types.js').Label} Label + * @typedef {import('../model/Types.js').Root} Root + * @typedef {import('../model/Types.js').Shape} Shape */ /** diff --git a/lib/core/ElementFactory.spec.ts b/lib/core/ElementFactory.spec.ts index aed6ee1d6..df08c10d7 100644 --- a/lib/core/ElementFactory.spec.ts +++ b/lib/core/ElementFactory.spec.ts @@ -1,13 +1,13 @@ -import Diagram from '../Diagram'; +import Diagram from '../Diagram.js'; -import ElementFactory from './ElementFactory'; +import ElementFactory from './ElementFactory.js'; import { Connection, Label, Root, Shape -} from '../model/Types'; +} from '../model/Types.js'; const diagram = new Diagram(); diff --git a/lib/core/ElementRegistry.js b/lib/core/ElementRegistry.js index 54ba7ba0a..04f54612c 100644 --- a/lib/core/ElementRegistry.js +++ b/lib/core/ElementRegistry.js @@ -3,9 +3,9 @@ var ELEMENT_ID = 'data-element-id'; import { attr as svgAttr } from 'tiny-svg'; /** - * @typedef {import('./Types').ElementLike} ElementLike + * @typedef {import('./Types.js').ElementLike} ElementLike * - * @typedef {import('./EventBus').default} EventBus + * @typedef {import('./EventBus.js').default} EventBus * * @typedef { (element: ElementLike, gfx: SVGElement) => boolean|any } ElementRegistryFilterCallback * @typedef { (element: ElementLike, gfx: SVGElement) => any } ElementRegistryForEachCallback diff --git a/lib/core/ElementRegistry.spec.ts b/lib/core/ElementRegistry.spec.ts index 987071916..e2073135f 100644 --- a/lib/core/ElementRegistry.spec.ts +++ b/lib/core/ElementRegistry.spec.ts @@ -1,8 +1,8 @@ -import Diagram from '../Diagram'; +import Diagram from '../Diagram.js'; -import ElementFactory from './ElementFactory'; -import ElementRegistry from './ElementRegistry'; -import GraphicsFactory from './GraphicsFactory'; +import ElementFactory from './ElementFactory.js'; +import ElementRegistry from './ElementRegistry.js'; +import GraphicsFactory from './GraphicsFactory.js'; const diagram = new Diagram(); diff --git a/lib/core/EventBus.spec.ts b/lib/core/EventBus.spec.ts index 14b13d99d..a3b26724d 100644 --- a/lib/core/EventBus.spec.ts +++ b/lib/core/EventBus.spec.ts @@ -1,6 +1,6 @@ -import Diagram from '../Diagram'; +import Diagram from '../Diagram.js'; -import EventBus from './EventBus'; +import EventBus from './EventBus.js'; const diagram = new Diagram(); diff --git a/lib/core/GraphicsFactory.js b/lib/core/GraphicsFactory.js index 19e189078..9e18e3219 100644 --- a/lib/core/GraphicsFactory.js +++ b/lib/core/GraphicsFactory.js @@ -6,9 +6,9 @@ import { import { getChildren, getVisual -} from '../util/GraphicsUtil'; +} from '../util/GraphicsUtil.js'; -import { translate } from '../util/SvgTransformUtil'; +import { translate } from '../util/SvgTransformUtil.js'; import { clear as domClear } from 'min-dom'; @@ -22,15 +22,15 @@ import { import { isFrameElement -} from '../util/Elements'; +} from '../util/Elements.js'; /** - * @typedef {import('./Types').ConnectionLike} ConnectionLike - * @typedef {import('./Types').ElementLike} ElementLike - * @typedef {import('./Types').ShapeLike} ShapeLike + * @typedef {import('./Types.js').ConnectionLike} ConnectionLike + * @typedef {import('./Types.js').ElementLike} ElementLike + * @typedef {import('./Types.js').ShapeLike} ShapeLike * - * @typedef {import('./ElementRegistry').default} ElementRegistry - * @typedef {import('./EventBus').default} EventBus + * @typedef {import('./ElementRegistry.js').default} ElementRegistry + * @typedef {import('./EventBus.js').default} EventBus */ /** diff --git a/lib/core/GraphicsFactory.spec.ts b/lib/core/GraphicsFactory.spec.ts index cafcb1195..584a76eb0 100644 --- a/lib/core/GraphicsFactory.spec.ts +++ b/lib/core/GraphicsFactory.spec.ts @@ -1,7 +1,7 @@ -import Diagram from '../Diagram'; +import Diagram from '../Diagram.js'; -import ElementFactory from './ElementFactory'; -import GraphicsFactory from './GraphicsFactory'; +import ElementFactory from './ElementFactory.js'; +import GraphicsFactory from './GraphicsFactory.js'; const diagram = new Diagram(); diff --git a/lib/core/Types.ts b/lib/core/Types.ts index 7e1dac4f7..40a7799ea 100644 --- a/lib/core/Types.ts +++ b/lib/core/Types.ts @@ -5,4 +5,4 @@ export type { RootLike, ConnectionLike, LabelLike -} from '../model/Types'; \ No newline at end of file +} from '../model/Types.js'; \ No newline at end of file diff --git a/lib/core/index.js b/lib/core/index.js index 2392090e7..f904ae4dd 100644 --- a/lib/core/index.js +++ b/lib/core/index.js @@ -1,10 +1,10 @@ -import DrawModule from '../draw'; +import DrawModule from '../draw/index.js'; -import Canvas from './Canvas'; -import ElementRegistry from './ElementRegistry'; -import ElementFactory from './ElementFactory'; -import EventBus from './EventBus'; -import GraphicsFactory from './GraphicsFactory'; +import Canvas from './Canvas.js'; +import ElementRegistry from './ElementRegistry.js'; +import ElementFactory from './ElementFactory.js'; +import EventBus from './EventBus.js'; +import GraphicsFactory from './GraphicsFactory.js'; /** * @type { import('didi').ModuleDeclaration } diff --git a/lib/draw/BaseRenderer.js b/lib/draw/BaseRenderer.js index d71582c2a..6557177a0 100644 --- a/lib/draw/BaseRenderer.js +++ b/lib/draw/BaseRenderer.js @@ -1,11 +1,11 @@ var DEFAULT_RENDER_PRIORITY = 1000; /** - * @typedef {import('../core/Types').ElementLike} Element - * @typedef {import('../core/Types').ConnectionLike} Connection - * @typedef {import('../core/Types').ShapeLike} Shape + * @typedef {import('../core/Types.js').ElementLike} Element + * @typedef {import('../core/Types.js').ConnectionLike} Connection + * @typedef {import('../core/Types.js').ShapeLike} Shape * - * @typedef {import('../core/EventBus').default} EventBus + * @typedef {import('../core/EventBus.js').default} EventBus */ /** diff --git a/lib/draw/BaseRenderer.spec.ts b/lib/draw/BaseRenderer.spec.ts index aeaf18e7b..92911c680 100644 --- a/lib/draw/BaseRenderer.spec.ts +++ b/lib/draw/BaseRenderer.spec.ts @@ -1,11 +1,11 @@ -import { Element, Connection, Shape } from '../model'; +import { Element, Connection, Shape } from '../model/index.js'; -import Diagram from '../Diagram'; +import Diagram from '../Diagram.js'; -import ElementFactory from '../core/ElementFactory'; -import GraphicsFactory from '../core/GraphicsFactory'; +import ElementFactory from '../core/ElementFactory.js'; +import GraphicsFactory from '../core/GraphicsFactory.js'; -import BaseRenderer from './BaseRenderer'; +import BaseRenderer from './BaseRenderer.js'; class CustomRenderer extends BaseRenderer { canRender(element: Element): boolean { diff --git a/lib/draw/DefaultRenderer.js b/lib/draw/DefaultRenderer.js index eb3b23142..989df4562 100644 --- a/lib/draw/DefaultRenderer.js +++ b/lib/draw/DefaultRenderer.js @@ -1,11 +1,11 @@ import inherits from 'inherits-browser'; -import BaseRenderer from './BaseRenderer'; +import BaseRenderer from './BaseRenderer.js'; import { componentsToPath, createLine -} from '../util/RenderUtil'; +} from '../util/RenderUtil.js'; import { append as svgAppend, @@ -17,11 +17,11 @@ import { assign } from 'min-dash'; import { isFrameElement -} from '../util/Elements'; +} from '../util/Elements.js'; /** - * @typedef {import('../core/EventBus').default} EventBus - * @typedef {import('./Styles').default} Styles + * @typedef {import('../core/EventBus.js').default} EventBus + * @typedef {import('./Styles.js').default} Styles */ // apply default renderer with lowest possible priority diff --git a/lib/draw/DefaultRenderer.spec.ts b/lib/draw/DefaultRenderer.spec.ts index b344c158f..88429bcd0 100644 --- a/lib/draw/DefaultRenderer.spec.ts +++ b/lib/draw/DefaultRenderer.spec.ts @@ -1,9 +1,9 @@ -import Diagram from "../Diagram"; +import Diagram from '../Diagram.js'; -import DefaultRenderer from "./DefaultRenderer"; +import DefaultRenderer from './DefaultRenderer.js'; -import ElementFactory from "../core/ElementFactory"; -import GraphicsFactory from "../core/GraphicsFactory"; +import ElementFactory from '../core/ElementFactory.js'; +import GraphicsFactory from '../core/GraphicsFactory.js'; const diagram = new Diagram(); diff --git a/lib/draw/index.js b/lib/draw/index.js index dff1d12a6..e2da6cd3a 100644 --- a/lib/draw/index.js +++ b/lib/draw/index.js @@ -1,5 +1,5 @@ -import DefaultRenderer from './DefaultRenderer'; -import Styles from './Styles'; +import DefaultRenderer from './DefaultRenderer.js'; +import Styles from './Styles.js'; /** * @type { import('didi').ModuleDeclaration } diff --git a/lib/features/align-elements/AlignElements.js b/lib/features/align-elements/AlignElements.js index 313da0277..4ea41e0dc 100644 --- a/lib/features/align-elements/AlignElements.js +++ b/lib/features/align-elements/AlignElements.js @@ -6,13 +6,13 @@ import { } from 'min-dash'; /** - * @typedef {import('../../model/Types').Element} Element + * @typedef {import('../../model/Types.js').Element} Element * - * @typedef {import('../modeling/Modeling').default} Modeling - * @typedef {import('../rules/Rules').default} Rules + * @typedef {import('../modeling/Modeling.js').default} Modeling + * @typedef {import('../rules/Rules.js').default} Rules * - * @typedef {import('../../util/Types').Axis} Axis - * @typedef {import('../../util/Types').Dimension} Dimension + * @typedef {import('../../util/Types.js').Axis} Axis + * @typedef {import('../../util/Types.js').Dimension} Dimension * * @typedef { 'top' | 'right' | 'bottom' | 'left' | 'center' | 'middle' } Alignment */ diff --git a/lib/features/align-elements/index.js b/lib/features/align-elements/index.js index d3b432b72..7287f3187 100644 --- a/lib/features/align-elements/index.js +++ b/lib/features/align-elements/index.js @@ -1,4 +1,4 @@ -import AlignElements from './AlignElements'; +import AlignElements from './AlignElements.js'; /** * @type { import('didi').ModuleDeclaration } diff --git a/lib/features/attach-support/AttachSupport.js b/lib/features/attach-support/AttachSupport.js index c099d6d76..825a9e373 100644 --- a/lib/features/attach-support/AttachSupport.js +++ b/lib/features/attach-support/AttachSupport.js @@ -7,23 +7,23 @@ import { unionBy } from 'min-dash'; -import { saveClear } from '../../util/Removal'; +import inherits from 'inherits-browser'; -import { getNewAttachShapeDelta } from '../../util/AttachUtil'; +import { saveClear } from '../../util/Removal.js'; -import inherits from 'inherits-browser'; +import { getNewAttachShapeDelta } from '../../util/AttachUtil.js'; -import CommandInterceptor from '../../command/CommandInterceptor'; +import CommandInterceptor from '../../command/CommandInterceptor.js'; /** * @typedef {import('didi').Injector} Injector * - * @typedef {import('../../model/Types').Element} Element + * @typedef {import('../../model/Types.js').Element} Element * - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../rules/Rules').default} Rules - * @typedef {import('../modeling/Modeling').default} Modeling + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../rules/Rules.js').default} Rules + * @typedef {import('../modeling/Modeling.js').default} Modeling */ var LOW_PRIORITY = 251, diff --git a/lib/features/attach-support/index.js b/lib/features/attach-support/index.js index a254a46a1..28944f92a 100644 --- a/lib/features/attach-support/index.js +++ b/lib/features/attach-support/index.js @@ -1,6 +1,6 @@ -import RulesModule from '../rules'; +import RulesModule from '../rules/index.js'; -import AttachSupport from './AttachSupport'; +import AttachSupport from './AttachSupport.js'; /** * @type { import('didi').ModuleDeclaration } diff --git a/lib/features/auto-place/AutoPlace.js b/lib/features/auto-place/AutoPlace.js index 604c6a8c3..b9a5f8129 100644 --- a/lib/features/auto-place/AutoPlace.js +++ b/lib/features/auto-place/AutoPlace.js @@ -1,18 +1,18 @@ import { asTRBL, getMid -} from '../../layout/LayoutUtil'; +} from '../../layout/LayoutUtil.js'; -import { DEFAULT_DISTANCE } from './AutoPlaceUtil'; +import { DEFAULT_DISTANCE } from './AutoPlaceUtil.js'; /** - * @typedef {import('../../core/Types').ShapeLike} Shape + * @typedef {import('../../core/Types.js').ShapeLike} Shape * - * @typedef {import('../../util/Types').Point} Point + * @typedef {import('../../util/Types.js').Point} Point * - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../modeling/Modeling').default} Modeling + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../modeling/Modeling.js').default} Modeling */ var LOW_PRIORITY = 100; diff --git a/lib/features/auto-place/AutoPlaceSelectionBehavior.js b/lib/features/auto-place/AutoPlaceSelectionBehavior.js index 930dc6ff2..fba040d32 100644 --- a/lib/features/auto-place/AutoPlaceSelectionBehavior.js +++ b/lib/features/auto-place/AutoPlaceSelectionBehavior.js @@ -1,6 +1,6 @@ /** - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../selection/Selection').default} Selection + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../selection/Selection.js').default} Selection */ /** diff --git a/lib/features/auto-place/AutoPlaceUtil.js b/lib/features/auto-place/AutoPlaceUtil.js index 2b378646c..d61f05044 100644 --- a/lib/features/auto-place/AutoPlaceUtil.js +++ b/lib/features/auto-place/AutoPlaceUtil.js @@ -2,7 +2,7 @@ import { asTRBL, getOrientation, getMid -} from '../../layout/LayoutUtil'; +} from '../../layout/LayoutUtil.js'; import { find, @@ -10,11 +10,11 @@ import { } from 'min-dash'; /** - * @typedef {import('../../model/Types').Connection} Connection - * @typedef {import('../../model/Types').Element} Element - * @typedef {import('../../model/Types').Shape} Shape + * @typedef {import('../../model/Types.js').Connection} Connection + * @typedef {import('../../model/Types.js').Element} Element + * @typedef {import('../../model/Types.js').Shape} Shape * - * @typedef {import('../../util/Types').Point} Point + * @typedef {import('../../util/Types.js').Point} Point */ // padding to detect element placement diff --git a/lib/features/auto-place/AutoPlaceUtil.spec.ts b/lib/features/auto-place/AutoPlaceUtil.spec.ts index 7a720c4bf..32a484f0b 100644 --- a/lib/features/auto-place/AutoPlaceUtil.spec.ts +++ b/lib/features/auto-place/AutoPlaceUtil.spec.ts @@ -1,12 +1,12 @@ -import Diagram from '../../Diagram'; +import Diagram from '../../Diagram.js'; -import ElementFactory from '../../core/ElementFactory'; +import ElementFactory from '../../core/ElementFactory.js'; import { findFreePosition, generateGetNextPosition, getConnectedDistance -} from './AutoPlaceUtil'; +} from './AutoPlaceUtil.js'; const diagram = new Diagram(); diff --git a/lib/features/auto-place/index.js b/lib/features/auto-place/index.js index 6129cdda8..5a82a34c9 100644 --- a/lib/features/auto-place/index.js +++ b/lib/features/auto-place/index.js @@ -1,5 +1,5 @@ -import AutoPlace from './AutoPlace'; -import AutoPlaceSelectionBehavior from './AutoPlaceSelectionBehavior'; +import AutoPlace from './AutoPlace.js'; +import AutoPlaceSelectionBehavior from './AutoPlaceSelectionBehavior.js'; /** diff --git a/lib/features/auto-resize/AutoResize.js b/lib/features/auto-resize/AutoResize.js index 69132d7ce..ebae9feaf 100644 --- a/lib/features/auto-resize/AutoResize.js +++ b/lib/features/auto-resize/AutoResize.js @@ -1,12 +1,5 @@ import inherits from 'inherits-browser'; -import { getBBox as getBoundingBox } from '../../util/Elements'; - -import { - asTRBL, - asBounds -} from '../../layout/LayoutUtil'; - import { assign, flatten, @@ -19,20 +12,27 @@ import { values } from 'min-dash'; -import CommandInterceptor from '../../command/CommandInterceptor'; +import { getBBox as getBoundingBox } from '../../util/Elements.js'; + +import { + asTRBL, + asBounds +} from '../../layout/LayoutUtil.js'; + +import CommandInterceptor from '../../command/CommandInterceptor.js'; /** - * @typedef {import('../../model/Types').Element} Element - * @typedef {import('../../model/Types').Shape} Shape + * @typedef {import('../../model/Types.js').Element} Element + * @typedef {import('../../model/Types.js').Shape} Shape * - * @typedef {import('../../util/Types').Direction} Direction - * @typedef {import('../../util/Types').Rect} Rect - * @typedef {import('../../util/Types').RectTRBL} RectTRBL + * @typedef {import('../../util/Types.js').Direction} Direction + * @typedef {import('../../util/Types.js').Rect} Rect + * @typedef {import('../../util/Types.js').RectTRBL} RectTRBL * - * @typedef {import('../../core/ElementRegistry').default} ElementRegistry - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../modeling/Modeling').default} Modeling - * @typedef {import('../rules/Rules').default} Rules + * @typedef {import('../../core/ElementRegistry.js').default} ElementRegistry + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../modeling/Modeling.js').default} Modeling + * @typedef {import('../rules/Rules.js').default} Rules */ /** diff --git a/lib/features/auto-resize/AutoResizeProvider.js b/lib/features/auto-resize/AutoResizeProvider.js index edc676a1d..ae802d282 100644 --- a/lib/features/auto-resize/AutoResizeProvider.js +++ b/lib/features/auto-resize/AutoResizeProvider.js @@ -1,11 +1,11 @@ -import RuleProvider from '../rules/RuleProvider'; - import inherits from 'inherits-browser'; +import RuleProvider from '../rules/RuleProvider.js'; + /** - * @typedef {import('../../model/Types').Shape} Shape + * @typedef {import('../../model/Types.js').Shape} Shape * - * @typedef {import('../../core/EventBus').default} EventBus + * @typedef {import('../../core/EventBus.js').default} EventBus */ /** diff --git a/lib/features/auto-resize/index.js b/lib/features/auto-resize/index.js index a849be36e..e3720d87b 100644 --- a/lib/features/auto-resize/index.js +++ b/lib/features/auto-resize/index.js @@ -1,4 +1,4 @@ -import AutoResize from './AutoResize'; +import AutoResize from './AutoResize.js'; /** diff --git a/lib/features/auto-scroll/AutoScroll.js b/lib/features/auto-scroll/AutoScroll.js index 43872afae..13c81f738 100644 --- a/lib/features/auto-scroll/AutoScroll.js +++ b/lib/features/auto-scroll/AutoScroll.js @@ -2,13 +2,13 @@ import { assign } from 'min-dash'; import { toPoint -} from '../../util/Event'; +} from '../../util/Event.js'; /** - * @typedef {import('../../util/Types').Point} Point + * @typedef {import('../../util/Types.js').Point} Point * - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../../core/Canvas').default} Canvas + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../../core/Canvas.js').default} Canvas */ /** diff --git a/lib/features/auto-scroll/index.js b/lib/features/auto-scroll/index.js index 9cf09fdd2..2f4a556ea 100644 --- a/lib/features/auto-scroll/index.js +++ b/lib/features/auto-scroll/index.js @@ -1,6 +1,6 @@ -import DraggingModule from '../dragging'; +import DraggingModule from '../dragging/index.js'; -import AutoScroll from './AutoScroll'; +import AutoScroll from './AutoScroll.js'; /** diff --git a/lib/features/bendpoints/BendpointMove.js b/lib/features/bendpoints/BendpointMove.js index 0fa630253..c07923300 100644 --- a/lib/features/bendpoints/BendpointMove.js +++ b/lib/features/bendpoints/BendpointMove.js @@ -1,13 +1,13 @@ -import { filterRedundantWaypoints } from '../../layout/LayoutUtil'; +import { filterRedundantWaypoints } from '../../layout/LayoutUtil.js'; /** * @typedef {import('didi').Injector} Injector * - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../dragging/Dragging').default} Dragging - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../modeling/Modeling').default} Modeling - * @typedef {import('../rules/Rules').default} Rules + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../dragging/Dragging.js').default} Dragging + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../modeling/Modeling.js').default} Modeling + * @typedef {import('../rules/Rules.js').default} Rules */ var round = Math.round; diff --git a/lib/features/bendpoints/BendpointMovePreview.js b/lib/features/bendpoints/BendpointMovePreview.js index 636493985..cdaf67db3 100644 --- a/lib/features/bendpoints/BendpointMovePreview.js +++ b/lib/features/bendpoints/BendpointMovePreview.js @@ -3,18 +3,18 @@ import { remove as svgRemove } from 'tiny-svg'; -import { addBendpoint } from './BendpointUtil'; +import { addBendpoint } from './BendpointUtil.js'; -import { translate } from '../../util/SvgTransformUtil'; +import { translate } from '../../util/SvgTransformUtil.js'; -import { isReverse } from './BendpointMove'; +import { isReverse } from './BendpointMove.js'; /** * @typedef {import('didi').Injector} Injector * - * @typedef {import('../bendpoints/BendpointMove').default} BendpointMove - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../../core/EventBus').default} EventBus + * @typedef {import('../bendpoints/BendpointMove.js').default} BendpointMove + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../../core/EventBus.js').default} EventBus */ var RECONNECT_START = 'reconnectStart', diff --git a/lib/features/bendpoints/BendpointSnapping.js b/lib/features/bendpoints/BendpointSnapping.js index 9ff71d004..1e3fa177b 100644 --- a/lib/features/bendpoints/BendpointSnapping.js +++ b/lib/features/bendpoints/BendpointSnapping.js @@ -4,14 +4,14 @@ import { isArray } from 'min-dash'; -import { setSnapped } from '../snapping/SnapUtil'; +import { setSnapped } from '../snapping/SnapUtil.js'; -import { getClosestPointOnConnection } from './BendpointUtil'; +import { getClosestPointOnConnection } from './BendpointUtil.js'; -import { isConnection } from '../../util/ModelUtil'; +import { isConnection } from '../../util/ModelUtil.js'; /** - * @typedef {import('../../core/EventBus').default} EventBus + * @typedef {import('../../core/EventBus.js').default} EventBus */ var abs = Math.abs, round = Math.round; diff --git a/lib/features/bendpoints/BendpointUtil.js b/lib/features/bendpoints/BendpointUtil.js index 0571e0fb6..272587c02 100644 --- a/lib/features/bendpoints/BendpointUtil.js +++ b/lib/features/bendpoints/BendpointUtil.js @@ -1,12 +1,3 @@ -import { - toPoint -} from '../../util/Event'; - -import { - getMidPoint, - pointsAligned -} from '../../util/Geometry'; - import { append as svgAppend, attr as svgAttr, @@ -14,21 +5,30 @@ import { create as svgCreate } from 'tiny-svg'; +import { + toPoint +} from '../../util/Event.js'; + +import { + getMidPoint, + pointsAligned +} from '../../util/Geometry.js'; + import { rotate, translate -} from '../../util/SvgTransformUtil'; +} from '../../util/SvgTransformUtil.js'; import { getApproxIntersection -} from '../../util/LineIntersection'; +} from '../../util/LineIntersection.js'; -import { getDistancePointLine, perpendicularFoot } from './GeometricUtil'; +import { getDistancePointLine, perpendicularFoot } from './GeometricUtil.js'; /** - * @typedef {import('../../core/Types').ConnectionLike} Connection + * @typedef {import('../../core/Types.js').ConnectionLike} Connection * - * @typedef {import('../../util/Types').Point} Point + * @typedef {import('../../util/Types.js').Point} Point */ export var BENDPOINT_CLS = 'djs-bendpoint'; diff --git a/lib/features/bendpoints/Bendpoints.js b/lib/features/bendpoints/Bendpoints.js index 0e9b94cc8..21690032e 100644 --- a/lib/features/bendpoints/Bendpoints.js +++ b/lib/features/bendpoints/Bendpoints.js @@ -6,6 +6,14 @@ import { queryAll as domQueryAll } from 'min-dom'; +import { + append as svgAppend, + attr as svgAttr, + classes as svgClasses, + create as svgCreate, + remove as svgRemove +} from 'tiny-svg'; + import { BENDPOINT_CLS, SEGMENT_DRAGGER_CLS, @@ -13,39 +21,31 @@ import { addSegmentDragger, calculateSegmentMoveRegion, getConnectionIntersection -} from './BendpointUtil'; +} from './BendpointUtil.js'; import { escapeCSS -} from '../../util/EscapeUtil'; +} from '../../util/EscapeUtil.js'; import { pointsAligned, getMidPoint -} from '../../util/Geometry'; +} from '../../util/Geometry.js'; import { isPrimaryButton -} from '../../util/Mouse'; - -import { - append as svgAppend, - attr as svgAttr, - classes as svgClasses, - create as svgCreate, - remove as svgRemove -} from 'tiny-svg'; +} from '../../util/Mouse.js'; import { translate -} from '../../util/SvgTransformUtil'; +} from '../../util/SvgTransformUtil.js'; /** - * @typedef {import('../bendpoints/BendpointMove').default} BendpointMove - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../bendpoints/ConnectionSegmentMove').default} ConnectionSegmentMove - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../interaction-events/InteractionEvents').default} InteractionEvents + * @typedef {import('../bendpoints/BendpointMove.js').default} BendpointMove + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../bendpoints/ConnectionSegmentMove.js').default} ConnectionSegmentMove + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../interaction-events/InteractionEvents.js').default} InteractionEvents */ /** diff --git a/lib/features/bendpoints/ConnectionSegmentMove.js b/lib/features/bendpoints/ConnectionSegmentMove.js index 5fed2a6ba..188606101 100644 --- a/lib/features/bendpoints/ConnectionSegmentMove.js +++ b/lib/features/bendpoints/ConnectionSegmentMove.js @@ -1,45 +1,46 @@ +import { + classes as svgClasses, + remove as svgRemove +} from 'tiny-svg'; + import { pointsAligned, pointsOnLine -} from '../../util/Geometry'; +} from '../../util/Geometry.js'; import { addSegmentDragger, getConnectionIntersection -} from './BendpointUtil'; +} from './BendpointUtil.js'; import { getMid, getOrientation -} from '../../layout/LayoutUtil'; - -var MARKER_CONNECT_HOVER = 'connect-hover', - MARKER_CONNECT_UPDATING = 'djs-updating'; - -import { - classes as svgClasses, - remove as svgRemove -} from 'tiny-svg'; +} from '../../layout/LayoutUtil.js'; import { translate -} from '../../util/SvgTransformUtil'; +} from '../../util/SvgTransformUtil.js'; /** - * @typedef {import('../../model/Types').Shape} Shape + * @typedef {import('didi').Injector} Injector * - * @typedef {import('../../util/Types').Axis} Axis - * @typedef {import('../../util/Types').Point} Point + * @typedef {import('../../model/Types.js').Shape} Shape * - * @typedef {import('didi').Injector} Injector + * @typedef {import('../../util/Types.js').Axis} Axis + * @typedef {import('../../util/Types.js').Point} Point * - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../dragging/Dragging').default} Dragging - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../../core/GraphicsFactory').default} GraphicsFactory - * @typedef {import('../modeling/Modeling').default} Modeling + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../dragging/Dragging.js').default} Dragging + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../../core/GraphicsFactory.js').default} GraphicsFactory + * @typedef {import('../modeling/Modeling.js').default} Modeling */ + +var MARKER_CONNECT_HOVER = 'connect-hover', + MARKER_CONNECT_UPDATING = 'djs-updating'; + function axisAdd(point, axis, delta) { return axisSet(point, axis, point[axis] + delta); } diff --git a/lib/features/bendpoints/GeometricUtil.js b/lib/features/bendpoints/GeometricUtil.js index d97244e85..15a7deffa 100644 --- a/lib/features/bendpoints/GeometricUtil.js +++ b/lib/features/bendpoints/GeometricUtil.js @@ -1,6 +1,6 @@ /** - * @typedef {import('../../util/Types').Point} Point - * @typedef {import('../../util/Types').Vector} Vector + * @typedef {import('../../util/Types.js').Point} Point + * @typedef {import('../../util/Types.js').Vector} Vector */ /** diff --git a/lib/features/bendpoints/index.js b/lib/features/bendpoints/index.js index c43a52492..f5282239d 100644 --- a/lib/features/bendpoints/index.js +++ b/lib/features/bendpoints/index.js @@ -1,11 +1,11 @@ -import DraggingModule from '../dragging'; -import RulesModule from '../rules'; +import DraggingModule from '../dragging/index.js'; +import RulesModule from '../rules/index.js'; -import Bendpoints from './Bendpoints'; -import BendpointMove from './BendpointMove'; -import BendpointMovePreview from './BendpointMovePreview'; -import ConnectionSegmentMove from './ConnectionSegmentMove'; -import BendpointSnapping from './BendpointSnapping'; +import Bendpoints from './Bendpoints.js'; +import BendpointMove from './BendpointMove.js'; +import BendpointMovePreview from './BendpointMovePreview.js'; +import ConnectionSegmentMove from './ConnectionSegmentMove.js'; +import BendpointSnapping from './BendpointSnapping.js'; /** diff --git a/lib/features/change-support/ChangeSupport.js b/lib/features/change-support/ChangeSupport.js index 206c44347..c72ec1e5f 100644 --- a/lib/features/change-support/ChangeSupport.js +++ b/lib/features/change-support/ChangeSupport.js @@ -1,12 +1,12 @@ import { getType as getElementType -} from '../../util/Elements'; +} from '../../util/Elements.js'; /** - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../../core/ElementRegistry').default} ElementRegistry - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../../core/GraphicsFactory').default} GraphicsFactory + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../../core/ElementRegistry.js').default} ElementRegistry + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../../core/GraphicsFactory.js').default} GraphicsFactory */ /** diff --git a/lib/features/change-support/index.js b/lib/features/change-support/index.js index 17d462cef..8ac28a30a 100644 --- a/lib/features/change-support/index.js +++ b/lib/features/change-support/index.js @@ -1,4 +1,4 @@ -import ChangeSupport from './ChangeSupport'; +import ChangeSupport from './ChangeSupport.js'; /** diff --git a/lib/features/clipboard/index.js b/lib/features/clipboard/index.js index d4efeacde..347907baa 100644 --- a/lib/features/clipboard/index.js +++ b/lib/features/clipboard/index.js @@ -1,4 +1,4 @@ -import Clipboard from './Clipboard'; +import Clipboard from './Clipboard.js'; /** diff --git a/lib/features/complex-preview/ComplexPreview.js b/lib/features/complex-preview/ComplexPreview.js index b93e74c27..1d7daaba6 100644 --- a/lib/features/complex-preview/ComplexPreview.js +++ b/lib/features/complex-preview/ComplexPreview.js @@ -3,17 +3,17 @@ import { create as svgCreate } from 'tiny-svg'; -import { getVisual } from '../../util/GraphicsUtil'; +import { getVisual } from '../../util/GraphicsUtil.js'; -import { isConnection } from '../../util/ModelUtil'; +import { isConnection } from '../../util/ModelUtil.js'; -import { translate } from '../../util/SvgTransformUtil'; +import { translate } from '../../util/SvgTransformUtil.js'; /** - * @typedef {import('../../model/Types').Element} Element - * @typedef {import('../../model/Types').Shape} Shape - * @typedef {import('../../util/Types').Point} Point - * @typedef {import('../../util/Types').Rect} Rect + * @typedef {import('../../model/Types.js').Element} Element + * @typedef {import('../../model/Types.js').Shape} Shape + * @typedef {import('../../util/Types.js').Point} Point + * @typedef {import('../../util/Types.js').Rect} Rect * * @typedef { { element: Element, delta: Point } } MovedOption * @typedef { { shape: Shape, bounds: Rect } } ResizedOption diff --git a/lib/features/complex-preview/index.js b/lib/features/complex-preview/index.js index 8d6dbe5b0..935752149 100644 --- a/lib/features/complex-preview/index.js +++ b/lib/features/complex-preview/index.js @@ -1,6 +1,6 @@ -import PreviewSupportModule from '../preview-support'; +import PreviewSupportModule from '../preview-support/index.js'; -import ComplexPreview from './ComplexPreview'; +import ComplexPreview from './ComplexPreview.js'; /** * @type { import('didi').ModuleDeclaration } diff --git a/lib/features/connect/Connect.js b/lib/features/connect/Connect.js index 779993d8e..a9ba5a65d 100644 --- a/lib/features/connect/Connect.js +++ b/lib/features/connect/Connect.js @@ -1,21 +1,21 @@ -import { - getMid -} from '../../layout/LayoutUtil'; - import { isNil, isObject } from 'min-dash'; +import { + getMid +} from '../../layout/LayoutUtil.js'; + /** - * @typedef {import('../../model/Types').Element} Element + * @typedef {import('../../model/Types.js').Element} Element * - * @typedef {import('../../util/Types').Point} Point + * @typedef {import('../../util/Types.js').Point} Point * - * @typedef {import('../dragging/Dragging').default} Dragging - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../modeling/Modeling').default} Modeling - * @typedef {import('../rules/Rules').default} Rules + * @typedef {import('../dragging/Dragging.js').default} Dragging + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../modeling/Modeling.js').default} Modeling + * @typedef {import('../rules/Rules.js').default} Rules */ /** diff --git a/lib/features/connect/ConnectPreview.js b/lib/features/connect/ConnectPreview.js index 90cb4f906..bad847221 100644 --- a/lib/features/connect/ConnectPreview.js +++ b/lib/features/connect/ConnectPreview.js @@ -1,10 +1,10 @@ -import { isReverse } from './Connect'; +import { isReverse } from './Connect.js'; /** * @typedef {import('didi').Injector} Injector * - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../../core/EventBus').default} EventBus + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../../core/EventBus.js').default} EventBus */ var HIGH_PRIORITY = 1100, diff --git a/lib/features/connect/index.js b/lib/features/connect/index.js index b8174d2fb..c164b5beb 100644 --- a/lib/features/connect/index.js +++ b/lib/features/connect/index.js @@ -1,9 +1,9 @@ -import SelectionModule from '../selection'; -import RulesModule from '../rules'; -import DraggingModule from '../dragging'; +import SelectionModule from '../selection/index.js'; +import RulesModule from '../rules/index.js'; +import DraggingModule from '../dragging/index.js'; -import Connect from './Connect'; -import ConnectPreview from './ConnectPreview'; +import Connect from './Connect.js'; +import ConnectPreview from './ConnectPreview.js'; /** diff --git a/lib/features/connection-preview/ConnectionPreview.js b/lib/features/connection-preview/ConnectionPreview.js index 544baef7a..a19afc749 100644 --- a/lib/features/connection-preview/ConnectionPreview.js +++ b/lib/features/connection-preview/ConnectionPreview.js @@ -14,24 +14,24 @@ import { import { getElementLineIntersection, getMid -} from '../../layout/LayoutUtil'; +} from '../../layout/LayoutUtil.js'; import { createLine -} from '../../util/RenderUtil'; +} from '../../util/RenderUtil.js'; /** - * @typedef {import('../../model/Types').Element} Element - * @typedef {import('../../model/Types').Connection} Connection - * @typedef {import('../../model/Types').Shape} Shape + * @typedef {import('didi').Injector} Injector * - * @typedef {import('../../util/Types').Point} Point + * @typedef {import('../../model/Types.js').Element} Element + * @typedef {import('../../model/Types.js').Connection} Connection + * @typedef {import('../../model/Types.js').Shape} Shape * - * @typedef {import('didi').Injector} Injector + * @typedef {import('../../util/Types.js').Point} Point * - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../../core/ElementFactory').default} ElementFactory - * @typedef {import('../../core/GraphicsFactory').default} GraphicsFactory + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../../core/ElementFactory.js').default} ElementFactory + * @typedef {import('../../core/GraphicsFactory.js').default} GraphicsFactory */ var MARKER_CONNECTION_PREVIEW = 'djs-dragger'; diff --git a/lib/features/connection-preview/index.js b/lib/features/connection-preview/index.js index d95acfce2..96c12e378 100644 --- a/lib/features/connection-preview/index.js +++ b/lib/features/connection-preview/index.js @@ -1,4 +1,4 @@ -import ConnectionPreview from './ConnectionPreview'; +import ConnectionPreview from './ConnectionPreview.js'; /** diff --git a/lib/features/context-pad/ContextPad.js b/lib/features/context-pad/ContextPad.js index c811e2c91..7b61805b6 100644 --- a/lib/features/context-pad/ContextPad.js +++ b/lib/features/context-pad/ContextPad.js @@ -17,28 +17,28 @@ import { domify as domify } from 'min-dom'; -import { getBBox } from '../../util/Elements'; +import { getBBox } from '../../util/Elements.js'; import { escapeCSS -} from '../../util/EscapeUtil'; +} from '../../util/EscapeUtil.js'; -import { isConnection } from '../../util/ModelUtil'; +import { isConnection } from '../../util/ModelUtil.js'; /** - * @typedef {import('../../model/Types').Element} Element + * @typedef {import('../../model/Types.js').Element} Element * - * @typedef {import('../../util/Types').Rect} Rect + * @typedef {import('../../util/Types.js').Rect} Rect * - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../overlays/Overlays').default} Overlays + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../overlays/Overlays.js').default} Overlays * - * @typedef {import('../overlays/Overlays').Overlay} Overlay + * @typedef {import('../overlays/Overlays.js').Overlay} Overlay * - * @typedef {import('./ContextPadProvider').default} ContextPadProvider - * @typedef {import('./ContextPadProvider').ContextPadEntries} ContextPadEntries + * @typedef {import('./ContextPadProvider.js').default} ContextPadProvider + * @typedef {import('./ContextPadProvider.js').ContextPadEntries} ContextPadEntries * * @typedef { { * scale?: { diff --git a/lib/features/context-pad/ContextPad.spec.ts b/lib/features/context-pad/ContextPad.spec.ts index 12d5012f4..4b384dfa4 100644 --- a/lib/features/context-pad/ContextPad.spec.ts +++ b/lib/features/context-pad/ContextPad.spec.ts @@ -1,11 +1,11 @@ -import Diagram from '../../Diagram'; +import Diagram from '../../Diagram.js'; -import ElementFactory from '../../core/ElementFactory'; +import ElementFactory from '../../core/ElementFactory.js'; -import ContextPadModule from '.'; -import ContextPad from './ContextPad'; +import ContextPadModule from './index.js'; +import ContextPad from './ContextPad.js'; -import { FooContextPadProvider } from './ContextPadProvider.spec'; +import { FooContextPadProvider } from './ContextPadProvider.spec.js'; const diagram = new Diagram({ modules: [ diff --git a/lib/features/context-pad/ContextPadProvider.spec.ts b/lib/features/context-pad/ContextPadProvider.spec.ts index 047ec1792..0262077bf 100644 --- a/lib/features/context-pad/ContextPadProvider.spec.ts +++ b/lib/features/context-pad/ContextPadProvider.spec.ts @@ -1,6 +1,6 @@ -import ContextPadProvider, { ContextPadEntries } from './ContextPadProvider'; +import ContextPadProvider, { ContextPadEntries } from './ContextPadProvider.js'; -import { Element } from '../../model'; +import { Element } from '../../model/index.js'; export class FooContextPadProvider implements ContextPadProvider { getContextPadEntries(element: Element): ContextPadEntries { diff --git a/lib/features/context-pad/ContextPadProvider.ts b/lib/features/context-pad/ContextPadProvider.ts index fc18d6b12..866c20019 100644 --- a/lib/features/context-pad/ContextPadProvider.ts +++ b/lib/features/context-pad/ContextPadProvider.ts @@ -1,6 +1,6 @@ -import { Element } from '../../model/Types'; +import { Element } from '../../model/Types.js'; -import { ContextPadTarget } from './ContextPad'; +import { ContextPadTarget } from './ContextPad.js'; export type ContextPadEntry = { action: (event: Event, target: ContextPadTarget, autoActivate: boolean) => void; diff --git a/lib/features/context-pad/index.js b/lib/features/context-pad/index.js index eb0386812..cf1b8069b 100644 --- a/lib/features/context-pad/index.js +++ b/lib/features/context-pad/index.js @@ -1,7 +1,7 @@ -import InteractionEventsModule from '../interaction-events'; -import OverlaysModule from '../overlays'; +import InteractionEventsModule from '../interaction-events/index.js'; +import OverlaysModule from '../overlays/index.js'; -import ContextPad from './ContextPad'; +import ContextPad from './ContextPad.js'; /** diff --git a/lib/features/copy-paste/CopyPaste.js b/lib/features/copy-paste/CopyPaste.js index caaab18d2..d2721df56 100644 --- a/lib/features/copy-paste/CopyPaste.js +++ b/lib/features/copy-paste/CopyPaste.js @@ -12,30 +12,29 @@ import { import { getBBox, - getParents -} from '../../util/Elements'; - -import { eachElement } from '../../util/Elements'; + getParents, + eachElement +} from '../../util/Elements.js'; import { isConnection, isLabel -} from '../../util/ModelUtil'; +} from '../../util/ModelUtil.js'; /** - * @typedef {import('../../core/Types').ElementLike} Element - * @typedef {import('../../core/Types').ShapeLike} Shape + * @typedef {import('../../core/Types.js').ElementLike} Element + * @typedef {import('../../core/Types.js').ShapeLike} Shape * - * @typedef {import('../../util/Types').Point} Point + * @typedef {import('../../util/Types.js').Point} Point * - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../clipboard/Clipboard').default} Clipboard - * @typedef {import('../create/Create').default} Create - * @typedef {import('../../core/ElementFactory').default} ElementFactory - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../modeling/Modeling').default} Modeling - * @typedef {import('../mouse/Mouse').default} Mouse - * @typedef {import('../rules/Rules').default} Rules + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../clipboard/Clipboard.js').default} Clipboard + * @typedef {import('../create/Create.js').default} Create + * @typedef {import('../../core/ElementFactory.js').default} ElementFactory + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../modeling/Modeling.js').default} Modeling + * @typedef {import('../mouse/Mouse.js').default} Mouse + * @typedef {import('../rules/Rules.js').default} Rules */ /** diff --git a/lib/features/copy-paste/index.js b/lib/features/copy-paste/index.js index 5db04cb2a..ec32ba08b 100644 --- a/lib/features/copy-paste/index.js +++ b/lib/features/copy-paste/index.js @@ -1,9 +1,9 @@ -import ClipboardModule from '../clipboard'; -import CreateModule from '../create'; -import MouseModule from '../mouse'; -import RulesModule from '../rules'; +import ClipboardModule from '../clipboard/index.js'; +import CreateModule from '../create/index.js'; +import MouseModule from '../mouse/index.js'; +import RulesModule from '../rules/index.js'; -import CopyPaste from './CopyPaste'; +import CopyPaste from './CopyPaste.js'; /** diff --git a/lib/features/create/Create.js b/lib/features/create/Create.js index b8c7422e9..790270dfa 100644 --- a/lib/features/create/Create.js +++ b/lib/features/create/Create.js @@ -13,24 +13,24 @@ import { map } from 'min-dash'; -import { getBBox } from '../../util/Elements'; +import { getBBox } from '../../util/Elements.js'; import { isConnection, isLabel -} from '../../util/ModelUtil'; +} from '../../util/ModelUtil.js'; /** - * @typedef {import('../../core/Types').ElementLike} Element - * @typedef {import('../../core/Types').ShapeLike} Shape + * @typedef {import('../../core/Types.js').ElementLike} Element + * @typedef {import('../../core/Types.js').ShapeLike} Shape * - * @typedef {import('../../util/Types').Point} Point + * @typedef {import('../../util/Types.js').Point} Point * - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../dragging/Dragging').default} Dragging - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../modeling/Modeling').default} Modeling - * @typedef {import('../rules/Rules').default} Rules + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../dragging/Dragging.js').default} Dragging + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../modeling/Modeling.js').default} Modeling + * @typedef {import('../rules/Rules.js').default} Rules */ var PREFIX = 'create'; diff --git a/lib/features/create/CreateConnectPreview.js b/lib/features/create/CreateConnectPreview.js index 348959966..7864aba73 100644 --- a/lib/features/create/CreateConnectPreview.js +++ b/lib/features/create/CreateConnectPreview.js @@ -3,7 +3,7 @@ var LOW_PRIORITY = 740; /** * @typedef {import('didi').Injector} Injector * - * @typedef {import('../../core/EventBus').default} EventBus + * @typedef {import('../../core/EventBus.js').default} EventBus */ /** diff --git a/lib/features/create/CreatePreview.js b/lib/features/create/CreatePreview.js index 7d5b5972d..8d2cfde65 100644 --- a/lib/features/create/CreatePreview.js +++ b/lib/features/create/CreatePreview.js @@ -1,9 +1,3 @@ -import { - translate -} from '../../util/SvgTransformUtil'; - -import { getVisual } from '../../util/GraphicsUtil'; - import { append as svgAppend, attr as svgAttr, @@ -11,12 +5,18 @@ import { remove as svgRemove } from 'tiny-svg'; +import { + translate +} from '../../util/SvgTransformUtil.js'; + +import { getVisual } from '../../util/GraphicsUtil.js'; + /** - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../../core/GraphicsFactory').default} GraphicsFactory - * @typedef {import('../preview-support/PreviewSupport').default} PreviewSupport - * @typedef {import('../../draw/Styles').default} Styles + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../../core/GraphicsFactory.js').default} GraphicsFactory + * @typedef {import('../preview-support/PreviewSupport.js').default} PreviewSupport + * @typedef {import('../../draw/Styles.js').default} Styles */ var LOW_PRIORITY = 750; diff --git a/lib/features/create/index.js b/lib/features/create/index.js index 3906b2bcf..7602d3e49 100644 --- a/lib/features/create/index.js +++ b/lib/features/create/index.js @@ -1,10 +1,10 @@ -import DraggingModule from '../dragging'; -import PreviewSupportModule from '../preview-support'; -import RulesModule from '../rules'; -import SelectionModule from '../selection'; +import DraggingModule from '../dragging/index.js'; +import PreviewSupportModule from '../preview-support/index.js'; +import RulesModule from '../rules/index.js'; +import SelectionModule from '../selection/index.js'; -import Create from './Create'; -import CreatePreview from './CreatePreview'; +import Create from './Create.js'; +import CreatePreview from './CreatePreview.js'; /** diff --git a/lib/features/distribute-elements/DistributeElements.js b/lib/features/distribute-elements/DistributeElements.js index ca50695e8..ae3b47739 100644 --- a/lib/features/distribute-elements/DistributeElements.js +++ b/lib/features/distribute-elements/DistributeElements.js @@ -5,14 +5,14 @@ import { } from 'min-dash'; /** - * @typedef {import('../../model/Types').Element} Element + * @typedef {import('../../model/Types.js').Element} Element * - * @typedef {import('../../util/Types').Axis} Axis - * @typedef {import('../../util/Types').Dimension} Dimension - * @typedef {import('../../util/Types').Rect} Rect + * @typedef {import('../../util/Types.js').Axis} Axis + * @typedef {import('../../util/Types.js').Dimension} Dimension + * @typedef {import('../../util/Types.js').Rect} Rect * - * @typedef {import('../modeling/Modeling').default} Modeling - * @typedef {import('../rules/Rules').default} Rules + * @typedef {import('../modeling/Modeling.js').default} Modeling + * @typedef {import('../rules/Rules.js').default} Rules * * @typedef { { * min: number; diff --git a/lib/features/distribute-elements/index.js b/lib/features/distribute-elements/index.js index 31f54cbfb..760fba710 100644 --- a/lib/features/distribute-elements/index.js +++ b/lib/features/distribute-elements/index.js @@ -1,4 +1,4 @@ -import DistributeElements from './DistributeElements'; +import DistributeElements from './DistributeElements.js'; /** diff --git a/lib/features/dragging/Dragging.js b/lib/features/dragging/Dragging.js index 127a66712..b6d66e7c8 100644 --- a/lib/features/dragging/Dragging.js +++ b/lib/features/dragging/Dragging.js @@ -1,5 +1,3 @@ -var round = Math.round; - import { assign } from 'min-dash'; import { @@ -10,30 +8,30 @@ import { getOriginal, toPoint, stopPropagation -} from '../../util/Event'; +} from '../../util/Event.js'; import { set as cursorSet, unset as cursorUnset -} from '../../util/Cursor'; +} from '../../util/Cursor.js'; import { install as installClickTrap -} from '../../util/ClickTrap'; +} from '../../util/ClickTrap.js'; import { delta as deltaPos -} from '../../util/PositionUtil'; +} from '../../util/PositionUtil.js'; -import { isKey } from '../keyboard/KeyboardUtil'; +import { isKey } from '../keyboard/KeyboardUtil.js'; /** - * @typedef {import('../../util/Types').Point} Point + * @typedef {import('../../util/Types.js').Point} Point * - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../../core/ElementRegistry').default} ElementRegistry - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../selection/Selection').default} Selection + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../../core/ElementRegistry.js').default} ElementRegistry + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../selection/Selection.js').default} Selection */ var DRAG_ACTIVE_CLS = 'djs-drag-active'; @@ -217,8 +215,8 @@ export default function Dragging(eventBus, canvas, selection, elementRegistry) { // starting coordinates assign(payload, { - x: round(localStart.x + displacement.x), - y: round(localStart.y + displacement.y), + x: Math.round(localStart.x + displacement.x), + y: Math.round(localStart.y + displacement.y), dx: 0, dy: 0 }, { originalEvent: event }); @@ -252,10 +250,10 @@ export default function Dragging(eventBus, canvas, selection, elementRegistry) { // update payload with actual coordinates assign(payload, { - x: round(localCurrent.x + displacement.x), - y: round(localCurrent.y + displacement.y), - dx: round(localDelta.x), - dy: round(localDelta.y) + x: Math.round(localCurrent.x + displacement.x), + y: Math.round(localCurrent.y + displacement.y), + dx: Math.round(localDelta.x), + dy: Math.round(localDelta.y) }, { originalEvent: event }); // emit move event diff --git a/lib/features/dragging/index.js b/lib/features/dragging/index.js index 467749009..62bba8f1c 100644 --- a/lib/features/dragging/index.js +++ b/lib/features/dragging/index.js @@ -1,7 +1,7 @@ -import HoverFixModule from '../hover-fix'; -import SelectionModule from '../selection'; +import HoverFixModule from '../hover-fix/index.js'; +import SelectionModule from '../selection/index.js'; -import Dragging from './Dragging'; +import Dragging from './Dragging.js'; /** diff --git a/lib/features/editor-actions/EditorActions.js b/lib/features/editor-actions/EditorActions.js index 91f837bac..0ebb0bcf0 100644 --- a/lib/features/editor-actions/EditorActions.js +++ b/lib/features/editor-actions/EditorActions.js @@ -6,7 +6,7 @@ import { /** * @typedef {import('didi').Injector} Injector * - * @typedef {import('../../core/EventBus').default} EventBus + * @typedef {import('../../core/EventBus.js').default} EventBus */ var NOT_REGISTERED_ERROR = 'is not a registered action', diff --git a/lib/features/editor-actions/index.js b/lib/features/editor-actions/index.js index 2ab7a2beb..931122d8f 100644 --- a/lib/features/editor-actions/index.js +++ b/lib/features/editor-actions/index.js @@ -1,4 +1,4 @@ -import EditorActions from './EditorActions'; +import EditorActions from './EditorActions.js'; /** diff --git a/lib/features/global-connect/GlobalConnect.js b/lib/features/global-connect/GlobalConnect.js index ec60aa1db..7062ece84 100644 --- a/lib/features/global-connect/GlobalConnect.js +++ b/lib/features/global-connect/GlobalConnect.js @@ -2,15 +2,15 @@ var MARKER_OK = 'connect-ok', MARKER_NOT_OK = 'connect-not-ok'; /** - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../connect/Connect').default} Connect - * @typedef {import('../dragging/Dragging').default} Dragging - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../mouse/Mouse').default} Mouse - * @typedef {import('../rules/Rules').default} Rules - * @typedef {import('../tool-manager/ToolManager').default} ToolManager + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../connect/Connect.js').default} Connect + * @typedef {import('../dragging/Dragging.js').default} Dragging + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../mouse/Mouse.js').default} Mouse + * @typedef {import('../rules/Rules.js').default} Rules + * @typedef {import('../tool-manager/ToolManager.js').default} ToolManager * - * @typedef {import('../../model/Types').Element} Element + * @typedef {import('../../model/Types.js').Element} Element */ /** diff --git a/lib/features/global-connect/index.js b/lib/features/global-connect/index.js index 240ad4127..56f677a22 100644 --- a/lib/features/global-connect/index.js +++ b/lib/features/global-connect/index.js @@ -1,10 +1,10 @@ -import ConnectModule from '../connect'; -import RulesModule from '../rules'; -import DraggingModule from '../dragging'; -import ToolManagerModule from '../tool-manager'; -import MouseModule from '../mouse'; +import ConnectModule from '../connect/index.js'; +import RulesModule from '../rules/index.js'; +import DraggingModule from '../dragging/index.js'; +import ToolManagerModule from '../tool-manager/index.js'; +import MouseModule from '../mouse/index.js'; -import GlobalConnect from './GlobalConnect'; +import GlobalConnect from './GlobalConnect.js'; /** diff --git a/lib/features/grid-snapping/GridSnapping.js b/lib/features/grid-snapping/GridSnapping.js index ca8ec3b09..690a6b302 100644 --- a/lib/features/grid-snapping/GridSnapping.js +++ b/lib/features/grid-snapping/GridSnapping.js @@ -1,23 +1,23 @@ -import { - setSnapped, - isSnapped -} from '../snapping/SnapUtil'; - -import { isCmd } from '../keyboard/KeyboardUtil'; - import { assign, isNumber } from 'min-dash'; +import { + setSnapped, + isSnapped +} from '../snapping/SnapUtil.js'; + +import { isCmd } from '../keyboard/KeyboardUtil.js'; + import { SPACING, quantize -} from './GridUtil'; +} from './GridUtil.js'; /** - * @typedef {import('../../core/ElementRegistry').default} ElementRegistry - * @typedef {import('../../core/EventBus').default} EventBus + * @typedef {import('../../core/ElementRegistry.js').default} ElementRegistry + * @typedef {import('../../core/EventBus.js').default} EventBus */ var LOWER_PRIORITY = 1200; diff --git a/lib/features/grid-snapping/behavior/ResizeBehavior.js b/lib/features/grid-snapping/behavior/ResizeBehavior.js index 72f55e9fa..155495780 100644 --- a/lib/features/grid-snapping/behavior/ResizeBehavior.js +++ b/lib/features/grid-snapping/behavior/ResizeBehavior.js @@ -1,19 +1,19 @@ import inherits from 'inherits-browser'; -import CommandInterceptor from '../../../command/CommandInterceptor'; - import { assign, isString } from 'min-dash'; +import CommandInterceptor from '../../../command/CommandInterceptor.js'; + /** - * @typedef {import('../../../model/Types').Shape} Shape + * @typedef {import('../../../model/Types.js').Shape} Shape * - * @typedef {import('../../../util/Types').Rect} Rect + * @typedef {import('../../../util/Types.js').Rect} Rect * - * @typedef {import('../../../core/EventBus').default} EventBus - * @typedef {import('../../grid-snapping/GridSnapping').default} GridSnapping + * @typedef {import('../../../core/EventBus.js').default} EventBus + * @typedef {import('../../grid-snapping/GridSnapping.js').default} GridSnapping */ /** diff --git a/lib/features/grid-snapping/behavior/SpaceToolBehavior.js b/lib/features/grid-snapping/behavior/SpaceToolBehavior.js index 4cd8118ed..fdfa8e2c9 100644 --- a/lib/features/grid-snapping/behavior/SpaceToolBehavior.js +++ b/lib/features/grid-snapping/behavior/SpaceToolBehavior.js @@ -1,6 +1,6 @@ /** - * @typedef {import('../../../core/EventBus').default} EventBus - * @typedef {import('../../grid-snapping/GridSnapping').default} GridSnapping + * @typedef {import('../../../core/EventBus.js').default} EventBus + * @typedef {import('../../grid-snapping/GridSnapping.js').default} GridSnapping */ var HIGH_PRIORITY = 2000; diff --git a/lib/features/grid-snapping/behavior/index.js b/lib/features/grid-snapping/behavior/index.js index 0755a11f9..fb824bd43 100644 --- a/lib/features/grid-snapping/behavior/index.js +++ b/lib/features/grid-snapping/behavior/index.js @@ -1,5 +1,5 @@ -import ResizeBehavior from './ResizeBehavior'; -import SpaceToolBehavior from './SpaceToolBehavior'; +import ResizeBehavior from './ResizeBehavior.js'; +import SpaceToolBehavior from './SpaceToolBehavior.js'; export default { __init__: [ diff --git a/lib/features/grid-snapping/index.js b/lib/features/grid-snapping/index.js index dbf213b8d..b470734f8 100644 --- a/lib/features/grid-snapping/index.js +++ b/lib/features/grid-snapping/index.js @@ -1,6 +1,6 @@ -import GridSnapping from './GridSnapping'; +import GridSnapping from './GridSnapping.js'; -import GridSnappingBehaviorModule from './behavior'; +import GridSnappingBehaviorModule from './behavior/index.js'; /** diff --git a/lib/features/hand-tool/HandTool.js b/lib/features/hand-tool/HandTool.js index fdd79da59..20d0c133b 100644 --- a/lib/features/hand-tool/HandTool.js +++ b/lib/features/hand-tool/HandTool.js @@ -1,17 +1,17 @@ import { hasPrimaryModifier -} from '../../util/Mouse'; +} from '../../util/Mouse.js'; -import { isKey } from '../../features/keyboard/KeyboardUtil'; +import { isKey } from '../../features/keyboard/KeyboardUtil.js'; /** * @typedef {import('didi').Injector} Injector * - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../dragging/Dragging').default} Dragging - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../mouse/Mouse').default} Mouse - * @typedef {import('../tool-manager/ToolManager').default} ToolManager + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../dragging/Dragging.js').default} Dragging + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../mouse/Mouse.js').default} Mouse + * @typedef {import('../tool-manager/ToolManager.js').default} ToolManager */ var HIGH_PRIORITY = 1500; diff --git a/lib/features/hand-tool/index.js b/lib/features/hand-tool/index.js index 518939cb1..8a8173513 100644 --- a/lib/features/hand-tool/index.js +++ b/lib/features/hand-tool/index.js @@ -1,7 +1,7 @@ -import ToolManagerModule from '../tool-manager'; -import MouseModule from '../mouse'; +import ToolManagerModule from '../tool-manager/index.js'; +import MouseModule from '../mouse/index.js'; -import HandTool from './HandTool'; +import HandTool from './HandTool.js'; /** diff --git a/lib/features/hover-fix/HoverFix.js b/lib/features/hover-fix/HoverFix.js index c51c2e963..ccefaeed4 100644 --- a/lib/features/hover-fix/HoverFix.js +++ b/lib/features/hover-fix/HoverFix.js @@ -4,13 +4,13 @@ import { import { toPoint -} from '../../util/Event'; +} from '../../util/Event.js'; /** * @typedef {import('didi').Injector} Injector * - * @typedef {import('../../core/ElementRegistry').default} ElementRegistry - * @typedef {import('../../core/EventBus').default} EventBus + * @typedef {import('../../core/ElementRegistry.js').default} ElementRegistry + * @typedef {import('../../core/EventBus.js').default} EventBus */ var HIGH_PRIORITY = 1500; diff --git a/lib/features/hover-fix/index.js b/lib/features/hover-fix/index.js index 61027cafc..bc17abf50 100644 --- a/lib/features/hover-fix/index.js +++ b/lib/features/hover-fix/index.js @@ -1,4 +1,4 @@ -import HoverFix from './HoverFix'; +import HoverFix from './HoverFix.js'; /** diff --git a/lib/features/interaction-events/InteractionEvents.js b/lib/features/interaction-events/InteractionEvents.js index 9aeecef7d..44c33f5fd 100644 --- a/lib/features/interaction-events/InteractionEvents.js +++ b/lib/features/interaction-events/InteractionEvents.js @@ -9,11 +9,6 @@ import { queryAll as domQueryAll } from 'min-dom'; -import { - isPrimaryButton, - isAuxiliaryButton -} from '../../util/Mouse'; - import { append as svgAppend, attr as svgAttr, @@ -21,19 +16,24 @@ import { remove as svgRemove } from 'tiny-svg'; +import { + isPrimaryButton, + isAuxiliaryButton +} from '../../util/Mouse.js'; + import { createLine, updateLine -} from '../../util/RenderUtil'; +} from '../../util/RenderUtil.js'; /** - * @typedef {import('../../model/Types').Element} Element + * @typedef {import('../../model/Types.js').Element} Element * - * @typedef {import('../../core/ElementRegistry').default} ElementRegistry - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../../draw/Styles').default} Styles + * @typedef {import('../../core/ElementRegistry.js').default} ElementRegistry + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../../draw/Styles.js').default} Styles * - * @typedef {import('../../util/Types').Point} Point + * @typedef {import('../../util/Types.js').Point} Point */ function allowAll(event) { return true; } diff --git a/lib/features/interaction-events/index.js b/lib/features/interaction-events/index.js index 35a912124..df01e85a7 100644 --- a/lib/features/interaction-events/index.js +++ b/lib/features/interaction-events/index.js @@ -1,4 +1,4 @@ -import InteractionEvents from './InteractionEvents'; +import InteractionEvents from './InteractionEvents.js'; /** diff --git a/lib/features/keyboard-move-selection/KeyboardMoveSelection.js b/lib/features/keyboard-move-selection/KeyboardMoveSelection.js index 64dffe122..3082e8aea 100644 --- a/lib/features/keyboard-move-selection/KeyboardMoveSelection.js +++ b/lib/features/keyboard-move-selection/KeyboardMoveSelection.js @@ -3,10 +3,10 @@ import { } from 'min-dash'; /** - * @typedef {import('../keyboard/Keyboard').default} Keyboard - * @typedef {import('../modeling/Modeling').default} Modeling - * @typedef {import('../rules/Rules').default} Rules - * @typedef {import('../selection/Selection').default} Selection + * @typedef {import('../keyboard/Keyboard.js').default} Keyboard + * @typedef {import('../modeling/Modeling.js').default} Modeling + * @typedef {import('../rules/Rules.js').default} Rules + * @typedef {import('../selection/Selection.js').default} Selection */ var DEFAULT_CONFIG = { diff --git a/lib/features/keyboard-move-selection/index.js b/lib/features/keyboard-move-selection/index.js index 74cd015cf..f5cac4315 100644 --- a/lib/features/keyboard-move-selection/index.js +++ b/lib/features/keyboard-move-selection/index.js @@ -1,7 +1,7 @@ -import KeyboardModule from '../keyboard'; -import SelectionModule from '../selection'; +import KeyboardModule from '../keyboard/index.js'; +import SelectionModule from '../selection/index.js'; -import KeyboardMoveSelection from './KeyboardMoveSelection'; +import KeyboardMoveSelection from './KeyboardMoveSelection.js'; /** diff --git a/lib/features/keyboard/Keyboard.js b/lib/features/keyboard/Keyboard.js index c15c10119..7e28dd11d 100644 --- a/lib/features/keyboard/Keyboard.js +++ b/lib/features/keyboard/Keyboard.js @@ -13,10 +13,10 @@ import { isCmd, isKey, isShift -} from './KeyboardUtil'; +} from './KeyboardUtil.js'; /** - * @typedef {import('../../core/EventBus').default} EventBus + * @typedef {import('../../core/EventBus.js').default} EventBus * * @typedef {({ keyEvent: KeyboardEvent }) => any} Listener */ diff --git a/lib/features/keyboard/KeyboardBindings.js b/lib/features/keyboard/KeyboardBindings.js index 9e4c8efea..d45129963 100644 --- a/lib/features/keyboard/KeyboardBindings.js +++ b/lib/features/keyboard/KeyboardBindings.js @@ -9,12 +9,12 @@ import { KEYS_PASTE, KEYS_UNDO, KEYS_REDO -} from './KeyboardUtil'; +} from './KeyboardUtil.js'; /** - * @typedef {import('../editor-actions/EditorActions').default} EditorActions - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('./Keyboard').default} Keyboard + * @typedef {import('../editor-actions/EditorActions.js').default} EditorActions + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('./Keyboard.js').default} Keyboard */ export { diff --git a/lib/features/keyboard/index.js b/lib/features/keyboard/index.js index 3500f109f..b01c64b45 100644 --- a/lib/features/keyboard/index.js +++ b/lib/features/keyboard/index.js @@ -1,5 +1,5 @@ -import Keyboard from './Keyboard'; -import KeyboardBindings from './KeyboardBindings'; +import Keyboard from './Keyboard.js'; +import KeyboardBindings from './KeyboardBindings.js'; /** diff --git a/lib/features/label-support/LabelSupport.js b/lib/features/label-support/LabelSupport.js index 4a615cf87..bd6cbbf77 100644 --- a/lib/features/label-support/LabelSupport.js +++ b/lib/features/label-support/LabelSupport.js @@ -5,27 +5,27 @@ import { import inherits from 'inherits-browser'; -var LOW_PRIORITY = 250, - HIGH_PRIORITY = 1400; - import { add as collectionAdd, indexOf as collectionIdx -} from '../../util/Collections'; +} from '../../util/Collections.js'; -import { saveClear } from '../../util/Removal'; +import { saveClear } from '../../util/Removal.js'; -import CommandInterceptor from '../../command/CommandInterceptor'; +import CommandInterceptor from '../../command/CommandInterceptor.js'; /** - * @typedef {import('../../model/Types').Element} Element - * * @typedef {import('didi').Injector} Injector * - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../modeling/Modeling').default} Modeling + * @typedef {import('../../model/Types.js').Element} Element + * + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../modeling/Modeling.js').default} Modeling */ +var LOW_PRIORITY = 250, + HIGH_PRIORITY = 1400; + /** * A handler that makes sure labels are properly moved with * their label targets. diff --git a/lib/features/label-support/index.js b/lib/features/label-support/index.js index ae9352f2c..8b1c46afb 100644 --- a/lib/features/label-support/index.js +++ b/lib/features/label-support/index.js @@ -1,4 +1,4 @@ -import LabelSupport from './LabelSupport'; +import LabelSupport from './LabelSupport.js'; /** diff --git a/lib/features/lasso-tool/LassoTool.js b/lib/features/lasso-tool/LassoTool.js index a106aff36..6ec204d9c 100644 --- a/lib/features/lasso-tool/LassoTool.js +++ b/lib/features/lasso-tool/LassoTool.js @@ -1,10 +1,10 @@ import { values } from 'min-dash'; -import { getEnclosedElements } from '../../util/Elements'; +import { getEnclosedElements } from '../../util/Elements.js'; import { hasSecondaryModifier -} from '../../util/Mouse'; +} from '../../util/Mouse.js'; import { append as svgAppend, @@ -14,15 +14,15 @@ import { } from 'tiny-svg'; /** - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../dragging/Dragging').default} Dragging - * @typedef {import('../../core/ElementRegistry').default} ElementRegistry - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../mouse/Mouse').default} Mouse - * @typedef {import('../selection/Selection').default} Selection - * @typedef {import('../tool-manager/ToolManager').default} ToolManager + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../dragging/Dragging.js').default} Dragging + * @typedef {import('../../core/ElementRegistry.js').default} ElementRegistry + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../mouse/Mouse.js').default} Mouse + * @typedef {import('../selection/Selection.js').default} Selection + * @typedef {import('../tool-manager/ToolManager.js').default} ToolManager * - * @typedef {import('../../util/Types').Rect} Rect + * @typedef {import('../../util/Types.js').Rect} Rect */ var LASSO_TOOL_CURSOR = 'crosshair'; diff --git a/lib/features/lasso-tool/index.js b/lib/features/lasso-tool/index.js index 9d3f63b40..887a30de3 100644 --- a/lib/features/lasso-tool/index.js +++ b/lib/features/lasso-tool/index.js @@ -1,7 +1,7 @@ -import ToolManagerModule from '../tool-manager'; -import MouseModule from '../mouse'; +import ToolManagerModule from '../tool-manager/index.js'; +import MouseModule from '../mouse/index.js'; -import LassoTool from './LassoTool'; +import LassoTool from './LassoTool.js'; /** diff --git a/lib/features/modeling/Modeling.js b/lib/features/modeling/Modeling.js index bb981f590..1777de41c 100644 --- a/lib/features/modeling/Modeling.js +++ b/lib/features/modeling/Modeling.js @@ -4,47 +4,47 @@ import { isArray } from 'min-dash'; -import AlignElementsHandler from './cmd/AlignElementsHandler'; -import AppendShapeHandler from './cmd/AppendShapeHandler'; -import CreateConnectionHandler from './cmd/CreateConnectionHandler'; -import CreateElementsHandler from './cmd/CreateElementsHandler'; -import CreateLabelHandler from './cmd/CreateLabelHandler'; -import CreateShapeHandler from './cmd/CreateShapeHandler'; -import DeleteConnectionHandler from './cmd/DeleteConnectionHandler'; -import DeleteElementsHandler from './cmd/DeleteElementsHandler'; -import DeleteShapeHandler from './cmd/DeleteShapeHandler'; -import DistributeElementsHandler from './cmd/DistributeElementsHandler'; -import LayoutConnectionHandler from './cmd/LayoutConnectionHandler'; -import MoveConnectionHandler from './cmd/MoveConnectionHandler'; -import MoveElementsHandler from './cmd/MoveElementsHandler'; -import MoveShapeHandler from './cmd/MoveShapeHandler'; -import ReconnectConnectionHandler from './cmd/ReconnectConnectionHandler'; -import ReplaceShapeHandler from './cmd/ReplaceShapeHandler'; -import ResizeShapeHandler from './cmd/ResizeShapeHandler'; -import SpaceToolHandler from './cmd/SpaceToolHandler'; -import ToggleShapeCollapseHandler from './cmd/ToggleShapeCollapseHandler'; -import UpdateAttachmentHandler from './cmd/UpdateAttachmentHandler'; -import UpdateWaypointsHandler from './cmd/UpdateWaypointsHandler'; - -import { isModelElement } from '../../model'; +import AlignElementsHandler from './cmd/AlignElementsHandler.js'; +import AppendShapeHandler from './cmd/AppendShapeHandler.js'; +import CreateConnectionHandler from './cmd/CreateConnectionHandler.js'; +import CreateElementsHandler from './cmd/CreateElementsHandler.js'; +import CreateLabelHandler from './cmd/CreateLabelHandler.js'; +import CreateShapeHandler from './cmd/CreateShapeHandler.js'; +import DeleteConnectionHandler from './cmd/DeleteConnectionHandler.js'; +import DeleteElementsHandler from './cmd/DeleteElementsHandler.js'; +import DeleteShapeHandler from './cmd/DeleteShapeHandler.js'; +import DistributeElementsHandler from './cmd/DistributeElementsHandler.js'; +import LayoutConnectionHandler from './cmd/LayoutConnectionHandler.js'; +import MoveConnectionHandler from './cmd/MoveConnectionHandler.js'; +import MoveElementsHandler from './cmd/MoveElementsHandler.js'; +import MoveShapeHandler from './cmd/MoveShapeHandler.js'; +import ReconnectConnectionHandler from './cmd/ReconnectConnectionHandler.js'; +import ReplaceShapeHandler from './cmd/ReplaceShapeHandler.js'; +import ResizeShapeHandler from './cmd/ResizeShapeHandler.js'; +import SpaceToolHandler from './cmd/SpaceToolHandler.js'; +import ToggleShapeCollapseHandler from './cmd/ToggleShapeCollapseHandler.js'; +import UpdateAttachmentHandler from './cmd/UpdateAttachmentHandler.js'; +import UpdateWaypointsHandler from './cmd/UpdateWaypointsHandler.js'; + +import { isModelElement } from '../../model/index.js'; /** - * @typedef {import('../../model/Types').Element} Element - * @typedef {import('../../model/Types').Connection} Connection - * @typedef {import('../../model/Types').Parent} Parent - * @typedef {import('../../model/Types').Shape} Shape - * @typedef {import('../../model/Types').Label} Label - * - * @typedef {import('../../command/CommandStack').default} CommandStack - * @typedef {import('../../core/ElementFactory').default} ElementFactory - * @typedef {import('../../core/EventBus').default} EventBus - * - * @typedef {import('../../command/CommandStack').CommandHandlerConstructor} CommandHandlerConstructor - * - * @typedef {import('../../util/Types').Dimensions} Dimensions - * @typedef {import('../../util/Types').Direction} Direction - * @typedef {import('../../util/Types').Point} Point - * @typedef {import('../../util/Types').Rect} Rect + * @typedef {import('../../model/Types.js').Element} Element + * @typedef {import('../../model/Types.js').Connection} Connection + * @typedef {import('../../model/Types.js').Parent} Parent + * @typedef {import('../../model/Types.js').Shape} Shape + * @typedef {import('../../model/Types.js').Label} Label + * + * @typedef {import('../../command/CommandStack.js').default} CommandStack + * @typedef {import('../../core/ElementFactory.js').default} ElementFactory + * @typedef {import('../../core/EventBus.js').default} EventBus + * + * @typedef {import('../../command/CommandStack.js').CommandHandlerConstructor} CommandHandlerConstructor + * + * @typedef {import('../../util/Types.js').Dimensions} Dimensions + * @typedef {import('../../util/Types.js').Direction} Direction + * @typedef {import('../../util/Types.js').Point} Point + * @typedef {import('../../util/Types.js').Rect} Rect * * @typedef { 'x' | 'y' } ModelingDistributeAxis * diff --git a/lib/features/modeling/Modeling.spec.ts b/lib/features/modeling/Modeling.spec.ts index 73f8fc574..8e77f9407 100644 --- a/lib/features/modeling/Modeling.spec.ts +++ b/lib/features/modeling/Modeling.spec.ts @@ -1,9 +1,9 @@ -import Diagram from '../../Diagram'; +import Diagram from '../../Diagram.js'; -import ElementFactory from '../../core/ElementFactory'; +import ElementFactory from '../../core/ElementFactory.js'; -import ModelingModule from '.'; -import Modeling from './Modeling'; +import ModelingModule from './index.js'; +import Modeling from './Modeling.js'; import { Connection, @@ -11,7 +11,7 @@ import { Label, Root, Shape -} from '../../model'; +} from '../../model/index.js'; const diagram = new Diagram({ modules: [ diff --git a/lib/features/modeling/cmd/AlignElementsHandler.js b/lib/features/modeling/cmd/AlignElementsHandler.js index f4e707333..856b73e63 100644 --- a/lib/features/modeling/cmd/AlignElementsHandler.js +++ b/lib/features/modeling/cmd/AlignElementsHandler.js @@ -1,8 +1,11 @@ -import { forEach, isDefined } from 'min-dash'; +import { + forEach, + isDefined +} from 'min-dash'; /** - * @typedef {import('../../../core/Canvas').default} Canvas - * @typedef {import('../Modeling').default} Modeling + * @typedef {import('../../../core/Canvas.js').default} Canvas + * @typedef {import('../Modeling.js').default} Modeling */ /** diff --git a/lib/features/modeling/cmd/AppendShapeHandler.js b/lib/features/modeling/cmd/AppendShapeHandler.js index 6aa60c6d7..1c40ee2d6 100644 --- a/lib/features/modeling/cmd/AppendShapeHandler.js +++ b/lib/features/modeling/cmd/AppendShapeHandler.js @@ -1,13 +1,13 @@ import { some } from 'min-dash'; /** - * @typedef {import('../../../model/Types').Element} Element - * @typedef {import('../../../model/Types').Parent} Parent - * @typedef {import('../../../model/Types').Shape} Shape + * @typedef {import('../../../model/Types.js').Element} Element + * @typedef {import('../../../model/Types.js').Parent} Parent + * @typedef {import('../../../model/Types.js').Shape} Shape * - * @typedef {import('../../../util/Types').Point} Point + * @typedef {import('../../../util/Types.js').Point} Point * - * @typedef {import('../Modeling').default} Modeling + * @typedef {import('../Modeling.js').default} Modeling */ /** diff --git a/lib/features/modeling/cmd/CreateConnectionHandler.js b/lib/features/modeling/cmd/CreateConnectionHandler.js index 2bf472596..c37cd5ed9 100644 --- a/lib/features/modeling/cmd/CreateConnectionHandler.js +++ b/lib/features/modeling/cmd/CreateConnectionHandler.js @@ -1,13 +1,13 @@ /** - * @typedef {import('../../../model/Types').Element} Element - * @typedef {import('../../../model/Types').Shape} Shape + * @typedef {import('../../../model/Types.js').Element} Element + * @typedef {import('../../../model/Types.js').Shape} Shape * - * @typedef {import('../../../util/Types').Point} Point + * @typedef {import('../../../util/Types.js').Point} Point * - * @typedef {import('../Modeling').ModelingHints} ModelingHints + * @typedef {import('../Modeling.js').ModelingHints} ModelingHints * - * @typedef {import('../../../core/Canvas').default} Canvas - * @typedef {import('../../../layout/BaseLayouter').default} Layouter + * @typedef {import('../../../core/Canvas.js').default} Canvas + * @typedef {import('../../../layout/BaseLayouter.js').default} Layouter */ /** diff --git a/lib/features/modeling/cmd/CreateElementsHandler.js b/lib/features/modeling/cmd/CreateElementsHandler.js index e5c3c4cfc..7742ad5a1 100644 --- a/lib/features/modeling/cmd/CreateElementsHandler.js +++ b/lib/features/modeling/cmd/CreateElementsHandler.js @@ -12,15 +12,15 @@ import { import { getBBox, getParents -} from '../../../util/Elements'; +} from '../../../util/Elements.js'; import { isConnection, isLabel -} from '../../../util/ModelUtil'; +} from '../../../util/ModelUtil.js'; /** - * @typedef {import('../Modeling').default} Modeling + * @typedef {import('../Modeling.js').default} Modeling */ var round = Math.round; diff --git a/lib/features/modeling/cmd/CreateLabelHandler.js b/lib/features/modeling/cmd/CreateLabelHandler.js index c054b261a..ffcb11817 100644 --- a/lib/features/modeling/cmd/CreateLabelHandler.js +++ b/lib/features/modeling/cmd/CreateLabelHandler.js @@ -1,14 +1,14 @@ import inherits from 'inherits-browser'; -import CreateShapeHandler from './CreateShapeHandler'; +import CreateShapeHandler from './CreateShapeHandler.js'; /** - * @typedef {import('../../../core/Canvas').default} Canvas + * @typedef {import('../../../core/Canvas.js').default} Canvas * - * @typedef {import('../../../model/Types').Element} Element - * @typedef {import('../../../model/Types').Parent} Parent - * @typedef {import('../../../model/Types').Shape} Shape - * @typedef {import('../../../util/Types').Point} Point + * @typedef {import('../../../model/Types.js').Element} Element + * @typedef {import('../../../model/Types.js').Parent} Parent + * @typedef {import('../../../model/Types.js').Shape} Shape + * @typedef {import('../../../util/Types.js').Point} Point */ /** diff --git a/lib/features/modeling/cmd/CreateShapeHandler.js b/lib/features/modeling/cmd/CreateShapeHandler.js index 1c2b87dd7..707495fc9 100644 --- a/lib/features/modeling/cmd/CreateShapeHandler.js +++ b/lib/features/modeling/cmd/CreateShapeHandler.js @@ -1,14 +1,12 @@ import { assign } from 'min-dash'; /** - * @typedef {import('../../../model/Types').Element} Element - * @typedef {import('../../../util/Types').Point} Point + * @typedef {import('../../../model/Types.js').Element} Element + * @typedef {import('../../../util/Types.js').Point} Point * - * @typedef {import('../../../core/Canvas').default} Canvas + * @typedef {import('../../../core/Canvas.js').default} Canvas */ -var round = Math.round; - /** * A handler that implements reversible addition of shapes. @@ -54,8 +52,8 @@ CreateShapeHandler.prototype.execute = function(context) { assign(shape, positionOrBounds); } else { assign(shape, { - x: positionOrBounds.x - round(shape.width / 2), - y: positionOrBounds.y - round(shape.height / 2) + x: positionOrBounds.x - Math.round(shape.width / 2), + y: positionOrBounds.y - Math.round(shape.height / 2) }); } diff --git a/lib/features/modeling/cmd/DeleteConnectionHandler.js b/lib/features/modeling/cmd/DeleteConnectionHandler.js index 24c6b2ca8..c8b77a9d0 100644 --- a/lib/features/modeling/cmd/DeleteConnectionHandler.js +++ b/lib/features/modeling/cmd/DeleteConnectionHandler.js @@ -1,13 +1,13 @@ import { add as collectionAdd, indexOf as collectionIdx -} from '../../../util/Collections'; +} from '../../../util/Collections.js'; -import { saveClear } from '../../../util/Removal'; +import { saveClear } from '../../../util/Removal.js'; /** - * @typedef {import('../../../core/Canvas').default} Canvas - * @typedef {import('../Modeling').default} Modeling + * @typedef {import('../../../core/Canvas.js').default} Canvas + * @typedef {import('../Modeling.js').default} Modeling */ /** diff --git a/lib/features/modeling/cmd/DeleteElementsHandler.js b/lib/features/modeling/cmd/DeleteElementsHandler.js index c9e44df20..7dd49a792 100644 --- a/lib/features/modeling/cmd/DeleteElementsHandler.js +++ b/lib/features/modeling/cmd/DeleteElementsHandler.js @@ -1,8 +1,8 @@ import { forEach } from 'min-dash'; /** - * @typedef {import('../../../core/ElementRegistry').default} ElementRegistry - * @typedef {import('../Modeling').default} Modeling + * @typedef {import('../../../core/ElementRegistry.js').default} ElementRegistry + * @typedef {import('../Modeling.js').default} Modeling */ /** diff --git a/lib/features/modeling/cmd/DeleteShapeHandler.js b/lib/features/modeling/cmd/DeleteShapeHandler.js index b67d4fda5..4cc2d4ea7 100644 --- a/lib/features/modeling/cmd/DeleteShapeHandler.js +++ b/lib/features/modeling/cmd/DeleteShapeHandler.js @@ -1,15 +1,15 @@ import { add as collectionAdd, indexOf as collectionIdx -} from '../../../util/Collections'; +} from '../../../util/Collections.js'; -import { saveClear } from '../../../util/Removal'; +import { saveClear } from '../../../util/Removal.js'; -import { isConnection } from '../../../util/ModelUtil'; +import { isConnection } from '../../../util/ModelUtil.js'; /** - * @typedef {import('../../../core/Canvas').default} Canvas - * @typedef {import('../Modeling').default} Modeling + * @typedef {import('../../../core/Canvas.js').default} Canvas + * @typedef {import('../Modeling.js').default} Modeling */ /** diff --git a/lib/features/modeling/cmd/DistributeElementsHandler.js b/lib/features/modeling/cmd/DistributeElementsHandler.js index 53be4b55a..0417ae93a 100644 --- a/lib/features/modeling/cmd/DistributeElementsHandler.js +++ b/lib/features/modeling/cmd/DistributeElementsHandler.js @@ -4,7 +4,7 @@ import { } from 'min-dash'; /** - * @typedef {import('../Modeling').default} Modeling + * @typedef {import('../Modeling.js').default} Modeling */ /** diff --git a/lib/features/modeling/cmd/LayoutConnectionHandler.js b/lib/features/modeling/cmd/LayoutConnectionHandler.js index ea507b09a..5cf148c40 100644 --- a/lib/features/modeling/cmd/LayoutConnectionHandler.js +++ b/lib/features/modeling/cmd/LayoutConnectionHandler.js @@ -1,8 +1,8 @@ import { assign } from 'min-dash'; /** - * @typedef {import('../../../core/Canvas').default} Canvas - * @typedef {import('../../../layout/BaseLayouter').default} Layouter + * @typedef {import('../../../core/Canvas.js').default} Canvas + * @typedef {import('../../../layout/BaseLayouter.js').default} Layouter */ /** diff --git a/lib/features/modeling/cmd/MoveConnectionHandler.js b/lib/features/modeling/cmd/MoveConnectionHandler.js index de4d65323..62791eeb7 100644 --- a/lib/features/modeling/cmd/MoveConnectionHandler.js +++ b/lib/features/modeling/cmd/MoveConnectionHandler.js @@ -4,7 +4,7 @@ import { forEach } from 'min-dash'; import { add as collectionAdd, remove as collectionRemove -} from '../../../util/Collections'; +} from '../../../util/Collections.js'; /** diff --git a/lib/features/modeling/cmd/MoveElementsHandler.js b/lib/features/modeling/cmd/MoveElementsHandler.js index 8cf2bd25a..241580958 100644 --- a/lib/features/modeling/cmd/MoveElementsHandler.js +++ b/lib/features/modeling/cmd/MoveElementsHandler.js @@ -1,7 +1,7 @@ -import MoveHelper from './helper/MoveHelper'; +import MoveHelper from './helper/MoveHelper.js'; /** - * @typedef {import('../Modeling').default} Modeling + * @typedef {import('../Modeling.js').default} Modeling */ /** diff --git a/lib/features/modeling/cmd/MoveShapeHandler.js b/lib/features/modeling/cmd/MoveShapeHandler.js index 81565a06f..f82a7c5fe 100644 --- a/lib/features/modeling/cmd/MoveShapeHandler.js +++ b/lib/features/modeling/cmd/MoveShapeHandler.js @@ -4,20 +4,20 @@ import { pick } from 'min-dash'; -import MoveHelper from './helper/MoveHelper'; +import MoveHelper from './helper/MoveHelper.js'; import { add as collectionAdd, remove as collectionRemove -} from '../../../util/Collections'; +} from '../../../util/Collections.js'; import { getMovedSourceAnchor, getMovedTargetAnchor -} from './helper/AnchorsHelper'; +} from './helper/AnchorsHelper.js'; /** - * @typedef {import('../Modeling').default} Modeling + * @typedef {import('../Modeling.js').default} Modeling */ /** diff --git a/lib/features/modeling/cmd/ReconnectConnectionHandler.js b/lib/features/modeling/cmd/ReconnectConnectionHandler.js index 4114d41d7..4f69b6aae 100644 --- a/lib/features/modeling/cmd/ReconnectConnectionHandler.js +++ b/lib/features/modeling/cmd/ReconnectConnectionHandler.js @@ -1,7 +1,7 @@ import { isArray } from 'min-dash'; /** - * @typedef {import('../Modeling').default} Modeling + * @typedef {import('../Modeling.js').default} Modeling */ /** diff --git a/lib/features/modeling/cmd/ReplaceShapeHandler.js b/lib/features/modeling/cmd/ReplaceShapeHandler.js index 875632542..b4bd1fd4f 100644 --- a/lib/features/modeling/cmd/ReplaceShapeHandler.js +++ b/lib/features/modeling/cmd/ReplaceShapeHandler.js @@ -3,13 +3,13 @@ import { forEach } from 'min-dash'; import { getResizedSourceAnchor, getResizedTargetAnchor -} from './helper/AnchorsHelper'; +} from './helper/AnchorsHelper.js'; /** - * @typedef {import('../../model/Types').Shape} Shape + * @typedef {import('../../model/Types.js').Shape} Shape * - * @typedef {import('../Modeling').default} Modeling - * @typedef {import('../../rules/Rules').default} Rules + * @typedef {import('../Modeling.js').default} Modeling + * @typedef {import('../../rules/Rules.js').default} Rules */ /** diff --git a/lib/features/modeling/cmd/ResizeShapeHandler.js b/lib/features/modeling/cmd/ResizeShapeHandler.js index 73f6e4a17..74cade6a2 100644 --- a/lib/features/modeling/cmd/ResizeShapeHandler.js +++ b/lib/features/modeling/cmd/ResizeShapeHandler.js @@ -6,10 +6,10 @@ import { import { getResizedSourceAnchor, getResizedTargetAnchor -} from './helper/AnchorsHelper'; +} from './helper/AnchorsHelper.js'; /** - * @typedef {import('../Modeling').default} Modeling + * @typedef {import('../Modeling.js').default} Modeling */ /** diff --git a/lib/features/modeling/cmd/SpaceToolHandler.js b/lib/features/modeling/cmd/SpaceToolHandler.js index 11ce6828c..4c3c1a0dc 100644 --- a/lib/features/modeling/cmd/SpaceToolHandler.js +++ b/lib/features/modeling/cmd/SpaceToolHandler.js @@ -7,21 +7,22 @@ import { import { getWaypointsUpdatingConnections, resizeBounds -} from '../../space-tool/SpaceUtil'; +} from '../../space-tool/SpaceUtil.js'; import { getMovedSourceAnchor, getMovedTargetAnchor, getResizedSourceAnchor, getResizedTargetAnchor -} from './helper/AnchorsHelper'; +} from './helper/AnchorsHelper.js'; /** - * @typedef {import('../Modeling').default} Modeling + * @typedef {import('../Modeling.js').default} Modeling */ /** - * Add or remove space by moving and resizing shapes and updating connection waypoints. + * Add or remove space by moving and resizing shapes and + * updating connection waypoints. * * @param {Modeling} modeling */ diff --git a/lib/features/modeling/cmd/ToggleShapeCollapseHandler.js b/lib/features/modeling/cmd/ToggleShapeCollapseHandler.js index ccfe61a7f..99bec0c1d 100644 --- a/lib/features/modeling/cmd/ToggleShapeCollapseHandler.js +++ b/lib/features/modeling/cmd/ToggleShapeCollapseHandler.js @@ -4,9 +4,9 @@ import { } from 'min-dash'; /** - * @typedef {import('../../model/Types').Shape} Shape + * @typedef {import('../../model/Types.js').Shape} Shape * - * @typedef {import('../Modeling').default} Modeling + * @typedef {import('../Modeling.js').default} Modeling */ /** diff --git a/lib/features/modeling/cmd/UpdateAttachmentHandler.js b/lib/features/modeling/cmd/UpdateAttachmentHandler.js index 2a6ecda04..d6f104984 100644 --- a/lib/features/modeling/cmd/UpdateAttachmentHandler.js +++ b/lib/features/modeling/cmd/UpdateAttachmentHandler.js @@ -1,10 +1,10 @@ import { add as collectionAdd, remove as collectionRemove -} from '../../../util/Collections'; +} from '../../../util/Collections.js'; /** - * @typedef {import('../Modeling').default} Modeling + * @typedef {import('../Modeling.js').default} Modeling */ /** diff --git a/lib/features/modeling/cmd/UpdateWaypointsHandler.js b/lib/features/modeling/cmd/UpdateWaypointsHandler.js index 393067058..42868166a 100644 --- a/lib/features/modeling/cmd/UpdateWaypointsHandler.js +++ b/lib/features/modeling/cmd/UpdateWaypointsHandler.js @@ -1,3 +1,7 @@ +/** + * A handler that implements reversible updating of + * connection waypoints. + */ export default function UpdateWaypointsHandler() { } UpdateWaypointsHandler.prototype.execute = function(context) { diff --git a/lib/features/modeling/cmd/helper/AnchorsHelper.js b/lib/features/modeling/cmd/helper/AnchorsHelper.js index 2863fedec..b7d698dfa 100644 --- a/lib/features/modeling/cmd/helper/AnchorsHelper.js +++ b/lib/features/modeling/cmd/helper/AnchorsHelper.js @@ -1,22 +1,22 @@ import { - getNewAttachPoint -} from '../../../../util/AttachUtil'; + filter, + map +} from 'min-dash'; import { - getOrientation -} from '../../../../layout/LayoutUtil'; + getNewAttachPoint +} from '../../../../util/AttachUtil.js'; import { - filter, - map -} from 'min-dash'; + getOrientation +} from '../../../../layout/LayoutUtil.js'; /** - * @typedef {import('../../../../core/Types').ConnectionLike} Connection - * @typedef {import('../../../../core/Types').ShapeLike} Shape + * @typedef {import('../../../../core/Types.js').ConnectionLike} Connection + * @typedef {import('../../../../core/Types.js').ShapeLike} Shape * - * @typedef {import('../../../../util/Types').Point} Point - * @typedef {import('../../../../util/Types').Rect} Rect + * @typedef {import('../../../../util/Types.js').Point} Point + * @typedef {import('../../../../util/Types.js').Rect} Rect */ /** diff --git a/lib/features/modeling/cmd/helper/MoveClosure.js b/lib/features/modeling/cmd/helper/MoveClosure.js index 0e4a7041f..105505d1c 100644 --- a/lib/features/modeling/cmd/helper/MoveClosure.js +++ b/lib/features/modeling/cmd/helper/MoveClosure.js @@ -4,12 +4,12 @@ import { import { getClosure -} from '../../../../util/Elements'; +} from '../../../../util/Elements.js'; /** - * @typedef {import('../../../../model/Types').Connection} Connection - * @typedef {import('../../../../model/Types').Element} Element - * @typedef {import('../../../../model/Types').Shape} Shape + * @typedef {import('../../../../model/Types.js').Connection} Connection + * @typedef {import('../../../../model/Types.js').Element} Element + * @typedef {import('../../../../model/Types.js').Shape} Shape */ export default function MoveClosure() { diff --git a/lib/features/modeling/cmd/helper/MoveHelper.js b/lib/features/modeling/cmd/helper/MoveHelper.js index e69f7cce9..e8409355e 100644 --- a/lib/features/modeling/cmd/helper/MoveHelper.js +++ b/lib/features/modeling/cmd/helper/MoveHelper.js @@ -5,17 +5,17 @@ import { import { getMovedSourceAnchor, getMovedTargetAnchor -} from './AnchorsHelper'; +} from './AnchorsHelper.js'; -import MoveClosure from './MoveClosure'; +import MoveClosure from './MoveClosure.js'; /** - * @typedef {import('../../../../core/Types').ElementLike} Element - * @typedef {import('../../../../core/Types').ShapeLike} Shape + * @typedef {import('../../../../core/Types.js').ElementLike} Element + * @typedef {import('../../../../core/Types.js').ShapeLike} Shape * - * @typedef {import('../../../../util/Types').Point} Point + * @typedef {import('../../../../util/Types.js').Point} Point * - * @typedef {import('../../Modeling').default} Modeling + * @typedef {import('../../Modeling.js').default} Modeling */ /** diff --git a/lib/features/modeling/index.js b/lib/features/modeling/index.js index 73cc7ca2b..8846e5d7d 100644 --- a/lib/features/modeling/index.js +++ b/lib/features/modeling/index.js @@ -1,10 +1,10 @@ -import CommandModule from '../../command'; -import ChangeSupportModule from '../change-support'; -import SelectionModule from '../selection'; -import RulesModule from '../rules'; +import CommandModule from '../../command/index.js'; +import ChangeSupportModule from '../change-support/index.js'; +import SelectionModule from '../selection/index.js'; +import RulesModule from '../rules/index.js'; -import Modeling from './Modeling'; -import BaseLayouter from '../../layout/BaseLayouter'; +import Modeling from './Modeling.js'; +import BaseLayouter from '../../layout/BaseLayouter.js'; /** diff --git a/lib/features/mouse/Mouse.js b/lib/features/mouse/Mouse.js index 945bcd244..2495bc6de 100644 --- a/lib/features/mouse/Mouse.js +++ b/lib/features/mouse/Mouse.js @@ -1,5 +1,5 @@ /** - * @typedef {import('../../core/EventBus').default} EventBus + * @typedef {import('../../core/EventBus.js').default} EventBus */ /** diff --git a/lib/features/mouse/index.js b/lib/features/mouse/index.js index 3295ca9db..4075e5077 100644 --- a/lib/features/mouse/index.js +++ b/lib/features/mouse/index.js @@ -1,4 +1,4 @@ -import Mouse from './Mouse'; +import Mouse from './Mouse.js'; /** diff --git a/lib/features/move/Move.js b/lib/features/move/Move.js index a01a17bdf..1b3861e48 100644 --- a/lib/features/move/Move.js +++ b/lib/features/move/Move.js @@ -9,33 +9,33 @@ import { classes as svgClasses } from 'tiny-svg'; +import { + getOriginal as getOriginalEvent +} from '../../util/Event.js'; + +import { + isPrimaryButton +} from '../../util/Mouse.js'; + /** - * @typedef {import('../../core/Types').ElementLike} Element - * @typedef {import('../../core/Types').ShapeLike} Shape + * @typedef {import('../../core/Types.js').ElementLike} Element + * @typedef {import('../../core/Types.js').ShapeLike} Shape * - * @typedef {import('../dragging/Dragging').default} Dragging - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../modeling/Modeling').default} Modeling - * @typedef {import('../rules/Rules').default} Rules - * @typedef {import('../selection/Selection').default} Selection + * @typedef {import('../dragging/Dragging.js').default} Dragging + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../modeling/Modeling.js').default} Modeling + * @typedef {import('../rules/Rules.js').default} Rules + * @typedef {import('../selection/Selection.js').default} Selection */ var LOW_PRIORITY = 500, MEDIUM_PRIORITY = 1250, HIGH_PRIORITY = 1500; -import { getOriginal as getOriginalEvent } from '../../util/Event'; - -import { - isPrimaryButton -} from '../../util/Mouse'; - -var round = Math.round; - function mid(element) { return { - x: element.x + round(element.width / 2), - y: element.y + round(element.height / 2) + x: element.x + Math.round(element.width / 2), + y: element.y + Math.round(element.height / 2) }; } @@ -165,8 +165,8 @@ export default function MoveEvents( // ensure we have actual pixel values deltas // (important when zoom level was > 1 during move) - delta.x = round(delta.x); - delta.y = round(delta.y); + delta.x = Math.round(delta.x); + delta.y = Math.round(delta.y); if (delta.x === 0 && delta.y === 0) { diff --git a/lib/features/move/MovePreview.js b/lib/features/move/MovePreview.js index 3da4c6e7d..6e0093915 100644 --- a/lib/features/move/MovePreview.js +++ b/lib/features/move/MovePreview.js @@ -9,10 +9,6 @@ import { size } from 'min-dash'; -import { - selfAndAllChildren -} from '../../util/Elements'; - import { append as svgAppend, attr as svgAttr, @@ -20,17 +16,21 @@ import { remove as svgRemove } from 'tiny-svg'; -import { translate } from '../../util/SvgTransformUtil'; +import { + selfAndAllChildren +} from '../../util/Elements.js'; + +import { translate } from '../../util/SvgTransformUtil.js'; -import { isConnection } from '../../util/ModelUtil'; +import { isConnection } from '../../util/ModelUtil.js'; /** - * @typedef {import('../../model/Types').Element} Element + * @typedef {import('../../model/Types.js').Element} Element * - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../preview-support/PreviewSupport').default} PreviewSupport - * @typedef {import('../../draw/Styles').default} Styles + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../preview-support/PreviewSupport.js').default} PreviewSupport + * @typedef {import('../../draw/Styles.js').default} Styles */ var LOW_PRIORITY = 499; diff --git a/lib/features/move/index.js b/lib/features/move/index.js index 7deb7a658..07df623a4 100644 --- a/lib/features/move/index.js +++ b/lib/features/move/index.js @@ -1,12 +1,12 @@ -import InteractionEventsModule from '../interaction-events'; -import SelectionModule from '../selection'; -import OutlineModule from '../outline'; -import RulesModule from '../rules'; -import DraggingModule from '../dragging'; -import PreviewSupportModule from '../preview-support'; +import InteractionEventsModule from '../interaction-events/index.js'; +import SelectionModule from '../selection/index.js'; +import OutlineModule from '../outline/index.js'; +import RulesModule from '../rules/index.js'; +import DraggingModule from '../dragging/index.js'; +import PreviewSupportModule from '../preview-support/index.js'; -import Move from './Move'; -import MovePreview from './MovePreview'; +import Move from './Move.js'; +import MovePreview from './MovePreview.js'; /** diff --git a/lib/features/ordering/OrderingProvider.js b/lib/features/ordering/OrderingProvider.js index 9c65f6153..883a3428d 100644 --- a/lib/features/ordering/OrderingProvider.js +++ b/lib/features/ordering/OrderingProvider.js @@ -1,12 +1,12 @@ import inherits from 'inherits-browser'; -import CommandInterceptor from '../../command/CommandInterceptor'; +import CommandInterceptor from '../../command/CommandInterceptor.js'; /** - * @typedef {import('../../core/Types').ElementLike} Element - * @typedef {import('../../core/Types').ShapeLike} Shape + * @typedef {import('../../core/Types.js').ElementLike} Element + * @typedef {import('../../core/Types.js').ShapeLike} Shape * - * @typedef {import('../../core/EventBus').default} EventBus + * @typedef {import('../../core/EventBus.js').default} EventBus */ /** diff --git a/lib/features/outline/Outline.js b/lib/features/outline/Outline.js index 804fefa5e..2ef04d322 100644 --- a/lib/features/outline/Outline.js +++ b/lib/features/outline/Outline.js @@ -1,7 +1,3 @@ -import { getBBox } from '../../util/Elements'; - -var LOW_PRIORITY = 500; - import { append as svgAppend, attr as svgAttr, @@ -18,16 +14,20 @@ import { isFunction } from 'min-dash'; -var DEFAULT_PRIORITY = 1000; +import { getBBox } from '../../util/Elements.js'; /** - * @typedef {import('../../model/Types').Element} Element + * @typedef {import('../../model/Types.js').Element} Element * - * @typedef {import('./OutlineProvider').default} OutlineProvider - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../../draw/Styles').default} Styles + * @typedef {import('./OutlineProvider.js').default} OutlineProvider + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../../draw/Styles.js').default} Styles */ +var DEFAULT_PRIORITY = 1000; +var LOW_PRIORITY = 500; + + /** * @class * diff --git a/lib/features/outline/OutlineProvider.spec.ts b/lib/features/outline/OutlineProvider.spec.ts index c9260c277..0894866c3 100644 --- a/lib/features/outline/OutlineProvider.spec.ts +++ b/lib/features/outline/OutlineProvider.spec.ts @@ -3,9 +3,9 @@ import { create as svgCreate } from 'tiny-svg'; -import { Element } from '../../model/Types'; +import { Element } from '../../model/Types.js'; -import OutlineProvider, { Outline } from './OutlineProvider'; +import OutlineProvider, { Outline } from './OutlineProvider.js'; export class FooOutlineProvider implements OutlineProvider { getOutline(element: Element): Outline { diff --git a/lib/features/outline/OutlineProvider.ts b/lib/features/outline/OutlineProvider.ts index 76a6fa2a2..9e8c65805 100644 --- a/lib/features/outline/OutlineProvider.ts +++ b/lib/features/outline/OutlineProvider.ts @@ -1,4 +1,4 @@ -import { Element } from '../../model/Types'; +import { Element } from '../../model/Types.js'; export type Outline = SVGSVGElement | SVGCircleElement | SVGRectElement; diff --git a/lib/features/outline/index.js b/lib/features/outline/index.js index c565faf1e..64a8bb475 100644 --- a/lib/features/outline/index.js +++ b/lib/features/outline/index.js @@ -1,4 +1,4 @@ -import Outline from './Outline'; +import Outline from './Outline.js'; /** diff --git a/lib/features/overlays/Overlays.js b/lib/features/overlays/Overlays.js index e4c6fc9d4..f916be4b7 100644 --- a/lib/features/overlays/Overlays.js +++ b/lib/features/overlays/Overlays.js @@ -21,21 +21,16 @@ import { import { getBBox -} from '../../util/Elements'; +} from '../../util/Elements.js'; -import Ids from '../../util/IdGenerator'; - -// document wide unique overlay ids -var ids = new Ids('ov'); - -var LOW_PRIORITY = 500; +import Ids from '../../util/IdGenerator.js'; /** - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../../core/ElementRegistry').default} ElementRegistry - * @typedef {import('../../core/EventBus').default} EventBus + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../../core/ElementRegistry.js').default} ElementRegistry + * @typedef {import('../../core/EventBus.js').default} EventBus * - * @typedef {import('../../model/Types').Element} Element + * @typedef {import('../../model/Types.js').Element} Element * * @typedef { { * minZoom?: number, @@ -85,6 +80,11 @@ var LOW_PRIORITY = 500; * } | string } OverlaysFilter */ +// document wide unique overlay ids +var ids = new Ids('ov'); + +var LOW_PRIORITY = 500; + /** * A service that allows users to attach overlays to diagram elements. * diff --git a/lib/features/overlays/Overlays.spec.ts b/lib/features/overlays/Overlays.spec.ts index 1975f40b8..328e8db96 100644 --- a/lib/features/overlays/Overlays.spec.ts +++ b/lib/features/overlays/Overlays.spec.ts @@ -1,9 +1,9 @@ -import Diagram from '../../Diagram'; +import Diagram from '../../Diagram.js'; -import ElementFactory from '../../core/ElementFactory'; +import ElementFactory from '../../core/ElementFactory.js'; -import OverlaysModule from '.'; -import Overlays, { OverlayAttrs } from './Overlays'; +import OverlaysModule from './index.js'; +import Overlays, { OverlayAttrs } from './Overlays.js'; const diagram = new Diagram({ modules: [ diff --git a/lib/features/overlays/index.js b/lib/features/overlays/index.js index 4f22f6e47..8306861c4 100644 --- a/lib/features/overlays/index.js +++ b/lib/features/overlays/index.js @@ -1,4 +1,4 @@ -import Overlays from './Overlays'; +import Overlays from './Overlays.js'; /** diff --git a/lib/features/palette/Palette.js b/lib/features/palette/Palette.js index f8956fa3b..202d05a6a 100644 --- a/lib/features/palette/Palette.js +++ b/lib/features/palette/Palette.js @@ -17,14 +17,14 @@ import { import { escapeCSS -} from '../../util/EscapeUtil'; +} from '../../util/EscapeUtil.js'; /** - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../../core/EventBus').default} EventBus + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../../core/EventBus.js').default} EventBus * - * @typedef {import('./PaletteProvider').PaletteEntries} PaletteEntries - * @typedef {import('./PaletteProvider').default} PaletteProvider + * @typedef {import('./PaletteProvider.js').PaletteEntries} PaletteEntries + * @typedef {import('./PaletteProvider.js').default} PaletteProvider */ var TOGGLE_SELECTOR = '.djs-palette-toggle', diff --git a/lib/features/palette/Palette.spec.ts b/lib/features/palette/Palette.spec.ts index 262e34f5f..70172eacb 100644 --- a/lib/features/palette/Palette.spec.ts +++ b/lib/features/palette/Palette.spec.ts @@ -1,9 +1,9 @@ -import Diagram from '../../Diagram'; +import Diagram from '../../Diagram.js'; -import PaletteModule from '.'; -import Palette from './Palette'; +import PaletteModule from './index.js'; +import Palette from './Palette.js'; -import { FooPaletteProvider } from './PaletteProvider.spec'; +import { FooPaletteProvider } from './PaletteProvider.spec.js'; const diagram = new Diagram({ modules: [ diff --git a/lib/features/palette/PaletteProvider.spec.ts b/lib/features/palette/PaletteProvider.spec.ts index 04fac6dbc..297e3eeb2 100644 --- a/lib/features/palette/PaletteProvider.spec.ts +++ b/lib/features/palette/PaletteProvider.spec.ts @@ -1,4 +1,4 @@ -import PaletteProvider, { PaletteEntries, PaletteEntriesCallback } from './PaletteProvider'; +import PaletteProvider, { PaletteEntries, PaletteEntriesCallback } from './PaletteProvider.js'; export class FooPaletteProvider implements PaletteProvider { getPaletteEntries(): PaletteEntries { diff --git a/lib/features/palette/index.js b/lib/features/palette/index.js index 5dd94c5d8..99f5c49a3 100644 --- a/lib/features/palette/index.js +++ b/lib/features/palette/index.js @@ -1,4 +1,4 @@ -import Palette from './Palette'; +import Palette from './Palette.js'; /** diff --git a/lib/features/popup-menu/PopupMenu.js b/lib/features/popup-menu/PopupMenu.js index 89e406045..9f39f17da 100644 --- a/lib/features/popup-menu/PopupMenu.js +++ b/lib/features/popup-menu/PopupMenu.js @@ -1,7 +1,7 @@ import { render, html -} from '../../ui'; +} from '../../ui/index.js'; import { domify, @@ -17,21 +17,21 @@ import { isDefined } from 'min-dash'; -import PopupMenuComponent from './PopupMenuComponent'; +import PopupMenuComponent from './PopupMenuComponent.js'; /** - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../../core/EventBus').default} EventBus + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../../core/EventBus.js').default} EventBus * - * @typedef {import('../../util/Types').Point} Point + * @typedef {import('../../util/Types.js').Point} Point * - * @typedef {import('./PopupMenuProvider').PopupMenuEntries} PopupMenuEntries - * @typedef {import('./PopupMenuProvider').PopupMenuEntry} PopupMenuEntry - * @typedef {import('./PopupMenuProvider').PopupMenuHeaderEntries} PopupMenuHeaderEntries - * @typedef {import('./PopupMenuProvider').PopupMenuHeaderEntry} PopupMenuHeaderEntry - * @typedef {import('./PopupMenuProvider').default} PopupMenuProvider + * @typedef {import('./PopupMenuProvider.js').PopupMenuEntries} PopupMenuEntries + * @typedef {import('./PopupMenuProvider.js').PopupMenuEntry} PopupMenuEntry + * @typedef {import('./PopupMenuProvider.js').PopupMenuHeaderEntries} PopupMenuHeaderEntries + * @typedef {import('./PopupMenuProvider.js').PopupMenuHeaderEntry} PopupMenuHeaderEntry + * @typedef {import('./PopupMenuProvider.js').default} PopupMenuProvider * - * @typedef {import('../../model/Types').Element} Element + * @typedef {import('../../model/Types.js').Element} Element * * @typedef { { * scale?: { diff --git a/lib/features/popup-menu/PopupMenu.spec.ts b/lib/features/popup-menu/PopupMenu.spec.ts index eb2dcb5af..fe1b87661 100644 --- a/lib/features/popup-menu/PopupMenu.spec.ts +++ b/lib/features/popup-menu/PopupMenu.spec.ts @@ -1,12 +1,12 @@ -import Diagram from '../../Diagram'; +import Diagram from '../../Diagram.js'; -import ElementFactory from '../../core/ElementFactory'; +import ElementFactory from '../../core/ElementFactory.js'; -import PopupMenuModule from '.'; -import PopupMenu from './PopupMenu'; -import { PopupMenuEntry } from './PopupMenuProvider'; +import PopupMenuModule from './index.js'; +import PopupMenu from './PopupMenu.js'; +import { PopupMenuEntry } from './PopupMenuProvider.js'; -import { FooPopupMenuProvider } from './PopupMenuProvider.spec'; +import { FooPopupMenuProvider } from './PopupMenuProvider.spec.js'; const diagram = new Diagram({ modules: [ diff --git a/lib/features/popup-menu/PopupMenuComponent.js b/lib/features/popup-menu/PopupMenuComponent.js index 0561d22ed..d791338c6 100644 --- a/lib/features/popup-menu/PopupMenuComponent.js +++ b/lib/features/popup-menu/PopupMenuComponent.js @@ -1,3 +1,15 @@ +import classNames from 'clsx'; + +import { + isDefined, + isFunction +} from 'min-dash'; + +import { + closest as domClosest, + matches as domMatches +} from 'min-dom'; + import { useEffect, useRef, @@ -6,23 +18,16 @@ import { html, useMemo, useCallback -} from '../../ui'; +} from '../../ui/index.js'; -import { - closest as domClosest, - matches as domMatches -} from 'min-dom'; - -import PopupMenuList from './PopupMenuList'; -import classNames from 'clsx'; -import { isDefined, isFunction } from 'min-dash'; +import PopupMenuList from './PopupMenuList.js'; /** - * @typedef {import('./PopupMenuProvider').PopupMenuEntry} PopupMenuEntry - * @typedef {import('./PopupMenuProvider').PopupMenuHeaderEntry} PopupMenuHeaderEntry - * @typedef {import('./PopupMenuProvider').PopupMenuEmptyPlaceholderProvider | import('./PopupMenuProvider').PopupMenuEmptyPlaceholder} PopupMenuEmptyPlaceholder + * @typedef {import('./PopupMenuProvider.js').PopupMenuEntry} PopupMenuEntry + * @typedef {import('./PopupMenuProvider.js').PopupMenuHeaderEntry} PopupMenuHeaderEntry + * @typedef {import('./PopupMenuProvider.js').PopupMenuEmptyPlaceholderProvider | import('./PopupMenuProvider.js').PopupMenuEmptyPlaceholder} PopupMenuEmptyPlaceholder * - * @typedef {import('../../util/Types').Point} Point + * @typedef {import('../../util/Types.js').Point} Point */ /** diff --git a/lib/features/popup-menu/PopupMenuItem.js b/lib/features/popup-menu/PopupMenuItem.js index 368ea710b..d727845bc 100644 --- a/lib/features/popup-menu/PopupMenuItem.js +++ b/lib/features/popup-menu/PopupMenuItem.js @@ -2,10 +2,10 @@ import classNames from 'clsx'; import { html -} from '../../ui'; +} from '../../ui/index.js'; /** - * @typedef {import('./PopupMenuProvider').PopupMenuEntry} PopupMenuEntry + * @typedef {import('./PopupMenuProvider.js').PopupMenuEntry} PopupMenuEntry */ /** diff --git a/lib/features/popup-menu/PopupMenuList.js b/lib/features/popup-menu/PopupMenuList.js index fd6a9b335..5378585ab 100644 --- a/lib/features/popup-menu/PopupMenuList.js +++ b/lib/features/popup-menu/PopupMenuList.js @@ -3,12 +3,12 @@ import { useMemo, useLayoutEffect, useRef -} from '../../ui'; +} from '../../ui/index.js'; -import PopupMenuItem from './PopupMenuItem'; +import PopupMenuItem from './PopupMenuItem.js'; /** - * @typedef {import('./PopupMenuProvider').PopupMenuEntry} PopupMenuEntry + * @typedef {import('./PopupMenuProvider.js').PopupMenuEntry} PopupMenuEntry */ /** diff --git a/lib/features/popup-menu/PopupMenuProvider.spec.ts b/lib/features/popup-menu/PopupMenuProvider.spec.ts index 0344dfc2d..2ab6398cd 100644 --- a/lib/features/popup-menu/PopupMenuProvider.spec.ts +++ b/lib/features/popup-menu/PopupMenuProvider.spec.ts @@ -1,11 +1,11 @@ -import { PopupMenuTarget } from './PopupMenu'; +import { PopupMenuTarget } from './PopupMenu.js'; import PopupMenuProvider, { PopupMenuEntries, PopupMenuHeaderEntries, PopupMenuEntriesProvider, PopupMenuProviderHeaderEntriesProvider -} from './PopupMenuProvider'; +} from './PopupMenuProvider.js'; export class FooPopupMenuProvider implements PopupMenuProvider { getPopupMenuEntries(target: PopupMenuTarget): PopupMenuEntries { diff --git a/lib/features/popup-menu/PopupMenuProvider.ts b/lib/features/popup-menu/PopupMenuProvider.ts index 1fc4ef765..59b23df83 100644 --- a/lib/features/popup-menu/PopupMenuProvider.ts +++ b/lib/features/popup-menu/PopupMenuProvider.ts @@ -1,6 +1,6 @@ -import { VNode } from '@bpmn-io/diagram-js-ui'; +import { VNode } from '../../ui/index.js'; -import { PopupMenuTarget } from './PopupMenu'; +import { PopupMenuTarget } from './PopupMenu.js'; export type PopupMenuEntryAction = (event: Event, entry: PopupMenuEntry, action?: string) => any; diff --git a/lib/features/popup-menu/index.js b/lib/features/popup-menu/index.js index 366a636d0..92d3fdfc8 100644 --- a/lib/features/popup-menu/index.js +++ b/lib/features/popup-menu/index.js @@ -1,4 +1,4 @@ -import PopupMenu from './PopupMenu'; +import PopupMenu from './PopupMenu.js'; /** diff --git a/lib/features/preview-support/PreviewSupport.js b/lib/features/preview-support/PreviewSupport.js index 889e4c64e..9fccd5fbf 100644 --- a/lib/features/preview-support/PreviewSupport.js +++ b/lib/features/preview-support/PreviewSupport.js @@ -13,16 +13,16 @@ import { import { query as domQuery } from 'min-dom'; -import { getVisual } from '../../util/GraphicsUtil'; +import { getVisual } from '../../util/GraphicsUtil.js'; /** - * @typedef {import('../../core/Types').ElementLike} Element - * @typedef {import('../../core/Types').ShapeLike} Shape + * @typedef {import('../../core/Types.js').ElementLike} Element + * @typedef {import('../../core/Types.js').ShapeLike} Shape * - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../../core/ElementRegistry').default} ElementRegistry - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../../draw/Styles').default} Styles + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../../core/ElementRegistry.js').default} ElementRegistry + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../../draw/Styles.js').default} Styles */ var MARKER_TYPES = [ diff --git a/lib/features/preview-support/index.js b/lib/features/preview-support/index.js index ea7171472..82f794ec0 100644 --- a/lib/features/preview-support/index.js +++ b/lib/features/preview-support/index.js @@ -1,4 +1,4 @@ -import PreviewSupport from './PreviewSupport'; +import PreviewSupport from './PreviewSupport.js'; /** diff --git a/lib/features/replace/Replace.js b/lib/features/replace/Replace.js index 1eb95023b..ae18abc9a 100644 --- a/lib/features/replace/Replace.js +++ b/lib/features/replace/Replace.js @@ -3,13 +3,12 @@ import { } from 'min-dash'; /** - * @typedef {import('diagram-js/lib/core/EventBus').default} EventBus - * @typedef {import('../modeling/Modeling').default} Modeling + * @typedef {import('diagram-js/lib/core/EventBus.js').default} EventBus + * @typedef {import('../modeling/Modeling.js').default} Modeling * - * @typedef {import('../../core/Types').ShapeLike} Shape + * @typedef {import('../../core/Types.js').ShapeLike} Shape */ -var round = Math.round; /** * Service that allows replacing of elements. @@ -58,8 +57,8 @@ Replace.prototype.replaceElement = function(oldElement, attrs, hints) { height = attrs.height || oldElement.height, x = attrs.x || oldElement.x, y = attrs.y || oldElement.y, - centerX = round(x + width / 2), - centerY = round(y + height / 2); + centerX = Math.round(x + width / 2), + centerY = Math.round(y + height / 2); // modeling API requires center coordinates, // account for that when handling shape bounds diff --git a/lib/features/replace/index.js b/lib/features/replace/index.js index a4c4f7ff5..dc17b2b21 100644 --- a/lib/features/replace/index.js +++ b/lib/features/replace/index.js @@ -1,5 +1,5 @@ -import Replace from './Replace'; -import ReplaceSelectionBehavior from './ReplaceSelectionBehavior'; +import Replace from './Replace.js'; +import ReplaceSelectionBehavior from './ReplaceSelectionBehavior.js'; /** diff --git a/lib/features/resize/Resize.js b/lib/features/resize/Resize.js index c3cc21ebc..c30e59761 100644 --- a/lib/features/resize/Resize.js +++ b/lib/features/resize/Resize.js @@ -8,24 +8,24 @@ import { ensureConstraints, computeChildrenBBox, getMinResizeBounds -} from './ResizeUtil'; +} from './ResizeUtil.js'; import { asTRBL, getMid, roundBounds -} from '../../layout/LayoutUtil'; +} from '../../layout/LayoutUtil.js'; /** - * @typedef {import('../../core/Types').ShapeLike} Shape + * @typedef {import('../../core/Types.js').ShapeLike} Shape * - * @typedef {import('../../util/Types').Direction} Direction - * @typedef {import('../../util/Types').Point} Point + * @typedef {import('../../util/Types.js').Direction} Direction + * @typedef {import('../../util/Types.js').Point} Point * - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../dragging/Dragging').default} Dragging - * @typedef {import('../modeling/Modeling').default} Modeling - * @typedef {import('../rules/Rules').default} Rules + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../dragging/Dragging.js').default} Dragging + * @typedef {import('../modeling/Modeling.js').default} Modeling + * @typedef {import('../rules/Rules.js').default} Rules */ var DEFAULT_MIN_WIDTH = 10; diff --git a/lib/features/resize/ResizeHandles.js b/lib/features/resize/ResizeHandles.js index d5f04566a..187ce4e10 100644 --- a/lib/features/resize/ResizeHandles.js +++ b/lib/features/resize/ResizeHandles.js @@ -17,23 +17,23 @@ import { import { isPrimaryButton -} from '../../util/Mouse'; +} from '../../util/Mouse.js'; import { transform -} from '../../util/SvgTransformUtil'; +} from '../../util/SvgTransformUtil.js'; -import { getReferencePoint } from './Resize'; +import { getReferencePoint } from './Resize.js'; -import { isConnection } from '../../util/ModelUtil'; +import { isConnection } from '../../util/ModelUtil.js'; /** - * @typedef {import('../../model/Types').Element} Element + * @typedef {import('../../model/Types.js').Element} Element * - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../resize/Resize').default} Resize - * @typedef {import('../selection/Selection').default} Selection + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../resize/Resize.js').default} Resize + * @typedef {import('../selection/Selection.js').default} Selection */ var HANDLE_OFFSET = -6, diff --git a/lib/features/resize/ResizePreview.js b/lib/features/resize/ResizePreview.js index 156590a29..94126bcd6 100644 --- a/lib/features/resize/ResizePreview.js +++ b/lib/features/resize/ResizePreview.js @@ -10,9 +10,9 @@ import { } from 'tiny-svg'; /** - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../preview-support/PreviewSupport').default} PreviewSupport + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../preview-support/PreviewSupport.js').default} PreviewSupport */ /** diff --git a/lib/features/resize/ResizeUtil.js b/lib/features/resize/ResizeUtil.js index 99542258b..970746e0b 100644 --- a/lib/features/resize/ResizeUtil.js +++ b/lib/features/resize/ResizeUtil.js @@ -3,30 +3,27 @@ import { isNumber } from 'min-dash'; -var max = Math.max, - min = Math.min; - -var DEFAULT_CHILD_BOX_PADDING = 20; - import { getBBox -} from '../../util/Elements'; +} from '../../util/Elements.js'; import { asTRBL, asBounds -} from '../../layout/LayoutUtil'; +} from '../../layout/LayoutUtil.js'; /** - * @typedef {import('../../core/Types').ElementLike} Element - * @typedef {import('../../core/Types').ShapeLike} Shape + * @typedef {import('../../core/Types.js').ElementLike} Element + * @typedef {import('../../core/Types.js').ShapeLike} Shape * - * @typedef {import('../../util/Types').Direction} Direction - * @typedef {import('../../util/Types').Point} Point - * @typedef {import('../../util/Types').Rect} Rect - * @typedef {import('../../util/Types').RectTRBL} RectTRBL + * @typedef {import('../../util/Types.js').Direction} Direction + * @typedef {import('../../util/Types.js').Point} Point + * @typedef {import('../../util/Types.js').Rect} Rect + * @typedef {import('../../util/Types.js').RectTRBL} RectTRBL */ +var DEFAULT_CHILD_BOX_PADDING = 20; + /** * Substract a TRBL from another * @@ -120,11 +117,11 @@ function applyConstraints(attr, trbl, resizeConstraints) { maxValue = resizeConstraints.max && resizeConstraints.max[attr]; if (isNumber(minValue)) { - value = (/top|left/.test(attr) ? min : max)(value, minValue); + value = (/top|left/.test(attr) ? Math.min : Math.max)(value, minValue); } if (isNumber(maxValue)) { - value = (/top|left/.test(attr) ? max : min)(value, maxValue); + value = (/top|left/.test(attr) ? Math.max : Math.min)(value, maxValue); } return value; @@ -161,10 +158,10 @@ export function getMinResizeBounds(direction, currentBounds, minDimensions, chil var childrenBox = childrenBounds ? asTRBL(childrenBounds) : minBox; var combinedBox = { - top: min(minBox.top, childrenBox.top), - left: min(minBox.left, childrenBox.left), - bottom: max(minBox.bottom, childrenBox.bottom), - right: max(minBox.right, childrenBox.right) + top: Math.min(minBox.top, childrenBox.top), + left: Math.min(minBox.left, childrenBox.left), + bottom: Math.max(minBox.bottom, childrenBox.bottom), + right: Math.max(minBox.right, childrenBox.right) }; return asBounds(combinedBox); diff --git a/lib/features/resize/index.js b/lib/features/resize/index.js index 727b5b8db..a281528ff 100644 --- a/lib/features/resize/index.js +++ b/lib/features/resize/index.js @@ -1,10 +1,10 @@ -import RulesModule from '../rules'; -import DraggingModule from '../dragging'; -import PreviewSupportModule from '../preview-support'; +import RulesModule from '../rules/index.js'; +import DraggingModule from '../dragging/index.js'; +import PreviewSupportModule from '../preview-support/index.js'; -import Resize from './Resize'; -import ResizePreview from './ResizePreview'; -import ResizeHandles from './ResizeHandles'; +import Resize from './Resize.js'; +import ResizePreview from './ResizePreview.js'; +import ResizeHandles from './ResizeHandles.js'; /** diff --git a/lib/features/root-elements/RootElementsBehavior.js b/lib/features/root-elements/RootElementsBehavior.js index fb7301f55..7ec7f6bc5 100644 --- a/lib/features/root-elements/RootElementsBehavior.js +++ b/lib/features/root-elements/RootElementsBehavior.js @@ -1,11 +1,11 @@ import inherits from 'inherits-browser'; -import CommandInterceptor from '../../command/CommandInterceptor'; +import CommandInterceptor from '../../command/CommandInterceptor.js'; /** * @typedef {import('didi').Injector} Injector * - * @typedef {import('../../core/Canvas').default} Canvas + * @typedef {import('../../core/Canvas.js').default} Canvas */ /** diff --git a/lib/features/root-elements/index.js b/lib/features/root-elements/index.js index 85d1d8124..69746cc55 100644 --- a/lib/features/root-elements/index.js +++ b/lib/features/root-elements/index.js @@ -1,4 +1,4 @@ -import RootElementsBehavior from './RootElementsBehavior'; +import RootElementsBehavior from './RootElementsBehavior.js'; /** diff --git a/lib/features/rules/RuleProvider.js b/lib/features/rules/RuleProvider.js index d98093d64..fff420e3d 100644 --- a/lib/features/rules/RuleProvider.js +++ b/lib/features/rules/RuleProvider.js @@ -1,9 +1,9 @@ import inherits from 'inherits-browser'; -import CommandInterceptor from '../../command/CommandInterceptor'; +import CommandInterceptor from '../../command/CommandInterceptor.js'; /** - * @typedef {import('../../core/EventBus').default} EventBus + * @typedef {import('../../core/EventBus.js').default} EventBus */ /** diff --git a/lib/features/rules/Rules.js b/lib/features/rules/Rules.js index dc3a6c597..aceb4f858 100644 --- a/lib/features/rules/Rules.js +++ b/lib/features/rules/Rules.js @@ -9,7 +9,7 @@ * to perform the actual rule evaluation. Make sure to provide the * `commandStack` service with this module if you plan to use it. * - * Together with this implementation you may use the {@link import('./RuleProvider').default} + * Together with this implementation you may use the {@link import('./RuleProvider.js').default} * to implement your own rule checkers. * * This module is ment to be easily replaced, thus the tiny foot print. diff --git a/lib/features/rules/Rules.test.ts b/lib/features/rules/Rules.test.ts index 6cc68506b..079b8109e 100644 --- a/lib/features/rules/Rules.test.ts +++ b/lib/features/rules/Rules.test.ts @@ -1,7 +1,7 @@ -import Diagram from '../../Diagram'; +import Diagram from '../../Diagram.js'; -import RulesModule from '.'; -import Rules from './Rules'; +import RulesModule from './index.js'; +import Rules from './Rules.js'; const diagram = new Diagram({ modules: [ diff --git a/lib/features/rules/index.js b/lib/features/rules/index.js index 4c9040654..8d9881a2a 100644 --- a/lib/features/rules/index.js +++ b/lib/features/rules/index.js @@ -1,4 +1,4 @@ -import Rules from './Rules'; +import Rules from './Rules.js'; /** diff --git a/lib/features/search-pad/SearchPad.js b/lib/features/search-pad/SearchPad.js index d02eb39d3..b1a825c9f 100644 --- a/lib/features/search-pad/SearchPad.js +++ b/lib/features/search-pad/SearchPad.js @@ -10,27 +10,27 @@ import { import { getBBox as getBoundingBox -} from '../../util/Elements'; +} from '../../util/Elements.js'; import { escapeHTML -} from '../../util/EscapeUtil'; +} from '../../util/EscapeUtil.js'; -import { isKey } from '../keyboard/KeyboardUtil'; +import { isKey } from '../keyboard/KeyboardUtil.js'; /** - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../overlays/Overlays').default} Overlays - * @typedef {import('../selection/Selection').default} Selection + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../overlays/Overlays.js').default} Overlays + * @typedef {import('../selection/Selection.js').default} Selection * - * @typedef {import('../overlays/Overlays').OverlayAttrs} OverlayAttrs + * @typedef {import('../overlays/Overlays.js').OverlayAttrs} OverlayAttrs * - * @typedef {import('../../util/Types').Dimensions} Dimensions + * @typedef {import('../../util/Types.js').Dimensions} Dimensions * - * @typedef {import('./SearchPadProvider').default} SearchPadProvider - * @typedef {import('./SearchPadProvider').SearchResult} SearchResult - * @typedef {import('./SearchPadProvider').Token} Token + * @typedef {import('./SearchPadProvider.js').default} SearchPadProvider + * @typedef {import('./SearchPadProvider.js').SearchResult} SearchResult + * @typedef {import('./SearchPadProvider.js').Token} Token */ /** diff --git a/lib/features/search-pad/SearchPadProvider.ts b/lib/features/search-pad/SearchPadProvider.ts index 65eec51ae..12f2198e4 100644 --- a/lib/features/search-pad/SearchPadProvider.ts +++ b/lib/features/search-pad/SearchPadProvider.ts @@ -1,4 +1,4 @@ -import { Element } from '../../model/Types'; +import { Element } from '../../model/Types.js'; export type Token = { matched: string; diff --git a/lib/features/search-pad/SearchProvider.spec.ts b/lib/features/search-pad/SearchProvider.spec.ts index c9f647ca3..8315de949 100644 --- a/lib/features/search-pad/SearchProvider.spec.ts +++ b/lib/features/search-pad/SearchProvider.spec.ts @@ -1,6 +1,6 @@ -import SearchProvider, { SearchResult } from './SearchPadProvider'; +import SearchProvider, { SearchResult } from './SearchPadProvider.js'; -import { create } from '../../model'; +import { create } from '../../model/index.js'; export class FooSearchProvider implements SearchProvider { find(pattern: string): SearchResult[] { diff --git a/lib/features/search-pad/index.js b/lib/features/search-pad/index.js index bdc38a44b..c6021fc24 100644 --- a/lib/features/search-pad/index.js +++ b/lib/features/search-pad/index.js @@ -1,7 +1,7 @@ -import OverlaysModule from '../overlays'; -import SelectionModule from '../selection'; +import OverlaysModule from '../overlays/index.js'; +import SelectionModule from '../selection/index.js'; -import SearchPad from './SearchPad'; +import SearchPad from './SearchPad.js'; /** diff --git a/lib/features/selection/Selection.js b/lib/features/selection/Selection.js index 1f7908dd7..2c5863935 100644 --- a/lib/features/selection/Selection.js +++ b/lib/features/selection/Selection.js @@ -4,8 +4,8 @@ import { } from 'min-dash'; /** - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../../core/EventBus').default} EventBus + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../../core/EventBus.js').default} EventBus */ /** diff --git a/lib/features/selection/Selection.test.ts b/lib/features/selection/Selection.test.ts index 099fd0ae3..610d5d8ed 100644 --- a/lib/features/selection/Selection.test.ts +++ b/lib/features/selection/Selection.test.ts @@ -1,9 +1,9 @@ -import Diagram from '../../Diagram'; +import Diagram from '../../Diagram.js'; -import ElementFactory from '../../core/ElementFactory'; +import ElementFactory from '../../core/ElementFactory.js'; -import SelectionModule from '.'; -import Selection from './Selection'; +import SelectionModule from './index.js'; +import Selection from './Selection.js'; const diagram = new Diagram({ modules: [ diff --git a/lib/features/selection/SelectionBehavior.js b/lib/features/selection/SelectionBehavior.js index e5ba72968..0cad4f602 100644 --- a/lib/features/selection/SelectionBehavior.js +++ b/lib/features/selection/SelectionBehavior.js @@ -1,7 +1,7 @@ import { hasSecondaryModifier, isPrimaryButton -} from '../../util/Mouse'; +} from '../../util/Mouse.js'; import { find, @@ -9,10 +9,10 @@ import { } from 'min-dash'; /** - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../../core/ElementRegistry').default} ElementRegistry - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('./Selection').default} Selection + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../../core/ElementRegistry.js').default} ElementRegistry + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('./Selection.js').default} Selection */ /** diff --git a/lib/features/selection/SelectionVisuals.js b/lib/features/selection/SelectionVisuals.js index a2183b262..ead98e3c2 100644 --- a/lib/features/selection/SelectionVisuals.js +++ b/lib/features/selection/SelectionVisuals.js @@ -11,12 +11,12 @@ import { create as svgCreate } from 'tiny-svg'; -import { getBBox } from '../../util/Elements'; +import { getBBox } from '../../util/Elements.js'; /** - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('./Selection').default} Selection + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('./Selection.js').default} Selection */ var MARKER_HOVER = 'hover', diff --git a/lib/features/selection/index.js b/lib/features/selection/index.js index 27cb76763..867dd7c3a 100644 --- a/lib/features/selection/index.js +++ b/lib/features/selection/index.js @@ -1,9 +1,9 @@ -import InteractionEventsModule from '../interaction-events'; -import OutlineModule from '../outline'; +import InteractionEventsModule from '../interaction-events/index.js'; +import OutlineModule from '../outline/index.js'; -import Selection from './Selection'; -import SelectionVisuals from './SelectionVisuals'; -import SelectionBehavior from './SelectionBehavior'; +import Selection from './Selection.js'; +import SelectionVisuals from './SelectionVisuals.js'; +import SelectionBehavior from './SelectionBehavior.js'; /** diff --git a/lib/features/snapping/CreateMoveSnapping.js b/lib/features/snapping/CreateMoveSnapping.js index 04f42271d..e257107c4 100644 --- a/lib/features/snapping/CreateMoveSnapping.js +++ b/lib/features/snapping/CreateMoveSnapping.js @@ -1,27 +1,27 @@ -import SnapContext from './SnapContext'; +import { + forEach, + isNumber +} from 'min-dash'; + +import SnapContext from './SnapContext.js'; import { getChildren, isSnapped, mid -} from './SnapUtil'; +} from './SnapUtil.js'; -import { isCmd } from '../keyboard/KeyboardUtil'; - -import { - forEach, - isNumber -} from 'min-dash'; +import { isCmd } from '../keyboard/KeyboardUtil.js'; import { isConnection, isLabel -} from '../../util/ModelUtil'; +} from '../../util/ModelUtil.js'; /** - * @typedef {import('../../core/ElementRegistry').default} ElementRegistry - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('./Snapping').default} Snapping + * @typedef {import('../../core/ElementRegistry.js').default} ElementRegistry + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('./Snapping.js').default} Snapping */ var HIGHER_PRIORITY = 1250; diff --git a/lib/features/snapping/ResizeSnapping.js b/lib/features/snapping/ResizeSnapping.js index 17e5d98fe..4575d2cf8 100644 --- a/lib/features/snapping/ResizeSnapping.js +++ b/lib/features/snapping/ResizeSnapping.js @@ -1,4 +1,6 @@ -import SnapContext from './SnapContext'; +import { forEach } from 'min-dash'; + +import SnapContext from './SnapContext.js'; import { bottomRight, @@ -6,25 +8,23 @@ import { isSnapped, setSnapped, topLeft, -} from './SnapUtil'; +} from './SnapUtil.js'; -import { isCmd } from '../keyboard/KeyboardUtil'; +import { isCmd } from '../keyboard/KeyboardUtil.js'; import { asTRBL, getMid -} from '../../layout/LayoutUtil'; - -import { forEach } from 'min-dash'; +} from '../../layout/LayoutUtil.js'; import { isConnection, isLabel -} from '../../util/ModelUtil'; +} from '../../util/ModelUtil.js'; /** - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('./Snapping').default} Snapping + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('./Snapping.js').default} Snapping */ var HIGHER_PRIORITY = 1250; diff --git a/lib/features/snapping/SnapContext.js b/lib/features/snapping/SnapContext.js index 8f576b25b..506b5fdda 100644 --- a/lib/features/snapping/SnapContext.js +++ b/lib/features/snapping/SnapContext.js @@ -4,14 +4,14 @@ import { import { snapTo -} from './SnapUtil'; +} from './SnapUtil.js'; /** - * @typedef {import('../../model/Types').Element} Element + * @typedef {import('../../model/Types.js').Element} Element * - * @typedef {import('../../util/Types').Axis} Axis - * @typedef {import('../../util/Types').DirectionTRBL} DirectionTRBL - * @typedef {import('../../util/Types').Point} Point + * @typedef {import('../../util/Types.js').Axis} Axis + * @typedef {import('../../util/Types.js').DirectionTRBL} DirectionTRBL + * @typedef {import('../../util/Types.js').Point} Point * * @typedef {DirectionTRBL & 'mid'} SnapLocation */ diff --git a/lib/features/snapping/SnapUtil.js b/lib/features/snapping/SnapUtil.js index 941591314..1d2622f30 100644 --- a/lib/features/snapping/SnapUtil.js +++ b/lib/features/snapping/SnapUtil.js @@ -1,15 +1,12 @@ /** - * @typedef {import('../../core/Types').ConnectionLike} Connection - * @typedef {import('../../core/Types').ShapeLike} Shape + * @typedef {import('../../core/Types.js').ConnectionLike} Connection + * @typedef {import('../../core/Types.js').ShapeLike} Shape * - * @typedef {import('../../core/EventBus').Event} Event + * @typedef {import('../../core/EventBus.js').Event} Event * - * @typedef {import('../../util/Types').Axis} Axis + * @typedef {import('../../util/Types.js').Axis} Axis */ -var abs = Math.abs, - round = Math.round; - /** * Snap value to a collection of reference values. @@ -28,7 +25,7 @@ export function snapTo(value, values, tolerance) { for (idx = 0; idx < values.length; idx++) { snapValue = values[idx]; - if (abs(snapValue - value) <= tolerance) { + if (Math.abs(snapValue - value) <= tolerance) { return snapValue; } } @@ -70,8 +67,8 @@ export function mid(bounds, defaultValue) { } return { - x: round(bounds.x + bounds.width / 2), - y: round(bounds.y + bounds.height / 2) + x: Math.round(bounds.x + bounds.width / 2), + y: Math.round(bounds.y + bounds.height / 2) }; } diff --git a/lib/features/snapping/Snapping.js b/lib/features/snapping/Snapping.js index 12d003574..ca4ccac51 100644 --- a/lib/features/snapping/Snapping.js +++ b/lib/features/snapping/Snapping.js @@ -6,11 +6,6 @@ import { isObject } from 'min-dash'; -import { - isSnapped, - setSnapped -} from './SnapUtil'; - import { append as svgAppend, attr as svgAttr, @@ -18,12 +13,17 @@ import { create as svgCreate } from 'tiny-svg'; +import { + isSnapped, + setSnapped +} from './SnapUtil.js'; + /** - * @typedef {import('../../core/Canvas').default} Canvas + * @typedef {import('../../core/Canvas.js').default} Canvas * - * @typedef {import('../../core/EventBus').Event} Event + * @typedef {import('../../core/EventBus.js').Event} Event * - * @typedef {import('./SnapContext').SnapPoints} SnapPoints + * @typedef {import('./SnapContext.js').SnapPoints} SnapPoints */ var SNAP_TOLERANCE = 7; diff --git a/lib/features/snapping/index.js b/lib/features/snapping/index.js index c21bac40e..90dba04bf 100644 --- a/lib/features/snapping/index.js +++ b/lib/features/snapping/index.js @@ -1,6 +1,6 @@ -import CreateMoveSnapping from './CreateMoveSnapping'; -import ResizeSnapping from './ResizeSnapping'; -import Snapping from './Snapping'; +import CreateMoveSnapping from './CreateMoveSnapping.js'; +import ResizeSnapping from './ResizeSnapping.js'; +import Snapping from './Snapping.js'; /** diff --git a/lib/features/space-tool/SpaceTool.js b/lib/features/space-tool/SpaceTool.js index 2d47cbfe4..ed1b66dfc 100644 --- a/lib/features/space-tool/SpaceTool.js +++ b/lib/features/space-tool/SpaceTool.js @@ -8,45 +8,42 @@ import { import { asTRBL, getMid -} from '../../layout/LayoutUtil'; +} from '../../layout/LayoutUtil.js'; -import { getBBox } from '../../util/Elements'; +import { getBBox } from '../../util/Elements.js'; -import { getDirection } from './SpaceUtil'; +import { getDirection } from './SpaceUtil.js'; import { hasPrimaryModifier, hasSecondaryModifier -} from '../../util/Mouse'; +} from '../../util/Mouse.js'; -import { set as setCursor } from '../../util/Cursor'; +import { set as setCursor } from '../../util/Cursor.js'; -import { selfAndAllChildren } from '../../util/Elements'; +import { selfAndAllChildren } from '../../util/Elements.js'; import { isConnection, isLabel -} from '../../util/ModelUtil'; +} from '../../util/ModelUtil.js'; /** - * @typedef {import('../../core/Types').ShapeLike} Shape + * @typedef {import('../../core/Types.js').ShapeLike} Shape * - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../dragging/Dragging').default} Dragging - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../modeling/Modeling').default} Modeling - * @typedef {import('../mouse/Mouse').default} Mouse - * @typedef {import('../rules/Rules').default} Rules - * @typedef {import('../tool-manager/ToolManager').default} ToolManager + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../dragging/Dragging.js').default} Dragging + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../modeling/Modeling.js').default} Modeling + * @typedef {import('../mouse/Mouse.js').default} Mouse + * @typedef {import('../rules/Rules.js').default} Rules + * @typedef {import('../tool-manager/ToolManager.js').default} ToolManager * - * @typedef {import('../../util/Types').Axis} Axis - * @typedef {import('../../util/Types').Direction} Direction - * @typedef {import('../../util/Types').Point} Point + * @typedef {import('../../util/Types.js').Axis} Axis + * @typedef {import('../../util/Types.js').Direction} Direction + * @typedef {import('../../util/Types.js').Point} Point */ -var abs = Math.abs, - round = Math.round; - var AXIS_TO_DIMENSION = { x: 'width', y: 'height' @@ -142,7 +139,7 @@ export default function SpaceTool( y: 0 }; - delta[ axis ] = round(event[ 'd' + axis ]); + delta[ axis ] = Math.round(event[ 'd' + axis ]); self.makeSpace(movingShapes, resizingShapes, delta, direction, start); @@ -221,11 +218,11 @@ SpaceTool.prototype.makeSpace = function(movingShapes, resizingShapes, delta, di * @return {boolean} */ SpaceTool.prototype.init = function(event, context) { - var axis = abs(event.dx) > abs(event.dy) ? 'x' : 'y', + var axis = Math.abs(event.dx) > Math.abs(event.dy) ? 'x' : 'y', delta = event[ 'd' + axis ], start = event[ axis ] - delta; - if (abs(delta) < 5) { + if (Math.abs(delta) < 5) { return false; } diff --git a/lib/features/space-tool/SpaceToolPreview.js b/lib/features/space-tool/SpaceToolPreview.js index 8addcedcd..3965080df 100644 --- a/lib/features/space-tool/SpaceToolPreview.js +++ b/lib/features/space-tool/SpaceToolPreview.js @@ -2,11 +2,6 @@ import { forEach } from 'min-dash'; -var MARKER_DRAGGING = 'djs-dragging', - MARKER_RESIZING = 'djs-resizing'; - -var LOW_PRIORITY = 250; - import { append as svgAppend, attr as svgAttr, @@ -17,18 +12,21 @@ import { import { translate -} from '../../util/SvgTransformUtil'; +} from '../../util/SvgTransformUtil.js'; -import { isConnection } from '../../util/ModelUtil'; +import { isConnection } from '../../util/ModelUtil.js'; /** - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../../core/ElementRegistry').default} ElementRegistry - * @typedef {import('../../core/EventBus').default} EventBus - * @typedef {import('../../draw/Styles').default} Styles + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../../core/ElementRegistry.js').default} ElementRegistry + * @typedef {import('../../core/EventBus.js').default} EventBus + * @typedef {import('../../draw/Styles.js').default} Styles */ -var max = Math.max; +var MARKER_DRAGGING = 'djs-dragging', + MARKER_RESIZING = 'djs-resizing'; + +var LOW_PRIORITY = 250; /** @@ -233,10 +231,10 @@ export default function SpaceToolPreview( if (context.direction === 'e') { svgAttr(element, { - width: max(initialBounds.width + delta.x, 5) + width: Math.max(initialBounds.width + delta.x, 5) }); } else { - width = max(initialBounds.width - delta.x, 5); + width = Math.max(initialBounds.width - delta.x, 5); svgAttr(element, { width: width, @@ -246,10 +244,10 @@ export default function SpaceToolPreview( if (context.direction === 's') { svgAttr(element, { - height: max(initialBounds.height + delta.y, 5) + height: Math.max(initialBounds.height + delta.y, 5) }); } else { - height = max(initialBounds.height - delta.y, 5); + height = Math.max(initialBounds.height - delta.y, 5); svgAttr(element, { height: height, diff --git a/lib/features/space-tool/SpaceUtil.js b/lib/features/space-tool/SpaceUtil.js index 8921a9251..b2d3ef22e 100644 --- a/lib/features/space-tool/SpaceUtil.js +++ b/lib/features/space-tool/SpaceUtil.js @@ -1,14 +1,15 @@ +import { forEach } from 'min-dash'; + /** - * @typedef {import('../../core/Types').ConnectionLike} Connection - * @typedef {import('../../core/Types').ShapeLike} Shape + * @typedef {import('../../core/Types.js').ConnectionLike} Connection + * @typedef {import('../../core/Types.js').ShapeLike} Shape * - * @typedef {import('../../util/Types').Axis} Axis - * @typedef {import('../../util/Types').Direction} Direction - * @typedef {import('../../util/Types').Point} Point - * @typedef {import('../../util/Types').Rect} Rect + * @typedef {import('../../util/Types.js').Axis} Axis + * @typedef {import('../../util/Types.js').Direction} Direction + * @typedef {import('../../util/Types.js').Point} Point + * @typedef {import('../../util/Types.js').Rect} Rect */ -import { forEach } from 'min-dash'; /** * Return direction given axis and delta. diff --git a/lib/features/space-tool/index.js b/lib/features/space-tool/index.js index 714aa3c95..b206b3195 100644 --- a/lib/features/space-tool/index.js +++ b/lib/features/space-tool/index.js @@ -1,11 +1,11 @@ -import DraggingModule from '../dragging'; -import RulesModule from '../rules'; -import ToolManagerModule from '../tool-manager'; -import PreviewSupportModule from '../preview-support'; -import MouseModule from '../mouse'; +import DraggingModule from '../dragging/index.js'; +import RulesModule from '../rules/index.js'; +import ToolManagerModule from '../tool-manager/index.js'; +import PreviewSupportModule from '../preview-support/index.js'; +import MouseModule from '../mouse/index.js'; -import SpaceTool from './SpaceTool'; -import SpaceToolPreview from './SpaceToolPreview'; +import SpaceTool from './SpaceTool.js'; +import SpaceToolPreview from './SpaceToolPreview.js'; /** diff --git a/lib/features/tool-manager/ToolManager.js b/lib/features/tool-manager/ToolManager.js index d13e1b408..8ea58a535 100644 --- a/lib/features/tool-manager/ToolManager.js +++ b/lib/features/tool-manager/ToolManager.js @@ -7,10 +7,10 @@ import { } from 'min-dom'; /** - * @typedef {import('../dragging/Dragging').default} Dragging - * @typedef {import('../../core/EventBus').default} EventBus + * @typedef {import('../dragging/Dragging.js').default} Dragging + * @typedef {import('../../core/EventBus.js').default} EventBus * - * @typedef {import('../../core/EventBus').Event} Event + * @typedef {import('../../core/EventBus.js').Event} Event */ var LOW_PRIORITY = 250; diff --git a/lib/features/tool-manager/index.js b/lib/features/tool-manager/index.js index ee32f9918..7b0215463 100644 --- a/lib/features/tool-manager/index.js +++ b/lib/features/tool-manager/index.js @@ -1,6 +1,6 @@ -import DraggingModule from '../dragging'; +import DraggingModule from '../dragging/index.js'; -import ToolManager from './ToolManager'; +import ToolManager from './ToolManager.js'; /** diff --git a/lib/features/tooltips/Tooltips.js b/lib/features/tooltips/Tooltips.js index 620f87a9a..4c40e6359 100644 --- a/lib/features/tooltips/Tooltips.js +++ b/lib/features/tooltips/Tooltips.js @@ -13,13 +13,13 @@ import { delegate as domDelegate } from 'min-dom'; -import Ids from '../../util/IdGenerator'; +import Ids from '../../util/IdGenerator.js'; /** - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../../core/EventBus').default} EventBus + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../../core/EventBus.js').default} EventBus * - * @typedef {import('../../util/Types').RectTRBL} RectTRBL + * @typedef {import('../../util/Types.js').RectTRBL} RectTRBL * * @typedef { { * html: string | HTMLElement; diff --git a/lib/features/tooltips/index.js b/lib/features/tooltips/index.js index 33b45db3d..15b8f0f78 100644 --- a/lib/features/tooltips/index.js +++ b/lib/features/tooltips/index.js @@ -1,4 +1,4 @@ -import Tooltips from './Tooltips'; +import Tooltips from './Tooltips.js'; /** diff --git a/lib/i18n/I18N.js b/lib/i18n/I18N.js index 1fb31bb91..86a9a69ed 100644 --- a/lib/i18n/I18N.js +++ b/lib/i18n/I18N.js @@ -1,5 +1,5 @@ /** - * @typedef {import('../core/EventBus').default} EventBus + * @typedef {import('../core/EventBus.js').default} EventBus */ /** diff --git a/lib/i18n/index.js b/lib/i18n/index.js index 5220346c8..ca689fcc0 100644 --- a/lib/i18n/index.js +++ b/lib/i18n/index.js @@ -1,4 +1,4 @@ -import I18N from './I18N'; +import I18N from './I18N.js'; /** diff --git a/lib/i18n/translate/index.js b/lib/i18n/translate/index.js index 02bd94f35..f34f8a6ae 100644 --- a/lib/i18n/translate/index.js +++ b/lib/i18n/translate/index.js @@ -1,4 +1,4 @@ -import translate from './translate'; +import translate from './translate.js'; /** diff --git a/lib/i18n/translate/translate.spec.ts b/lib/i18n/translate/translate.spec.ts index 4d2a0a4f3..cda708bd6 100644 --- a/lib/i18n/translate/translate.spec.ts +++ b/lib/i18n/translate/translate.spec.ts @@ -1,4 +1,4 @@ -import translate from './translate'; +import translate from './translate.js'; translate('foo {{bar}}', { bar: 'baz' }); translate('foo {{bar}}'); \ No newline at end of file diff --git a/lib/layout/BaseLayouter.js b/lib/layout/BaseLayouter.js index 2d61e2e2f..03ee3b9e4 100644 --- a/lib/layout/BaseLayouter.js +++ b/lib/layout/BaseLayouter.js @@ -1,8 +1,8 @@ /** - * @typedef {import('../core/Types').ElementLike} Element - * @typedef {import('../core/Types').ConnectionLike} Connection + * @typedef {import('../core/Types.js').ElementLike} Element + * @typedef {import('../core/Types.js').ConnectionLike} Connection * - * @typedef {import('../util').Point} Point + * @typedef {import('../util/Types.js').Point} Point * * @typedef { { * connectionStart?: Point; @@ -14,7 +14,7 @@ import { getMid -} from './LayoutUtil'; +} from './LayoutUtil.js'; /** diff --git a/lib/layout/ConnectionDocking.js b/lib/layout/ConnectionDocking.js index a940c03bf..fe31230c7 100644 --- a/lib/layout/ConnectionDocking.js +++ b/lib/layout/ConnectionDocking.js @@ -1,9 +1,9 @@ /** - * @typedef {import('../../core/Types').ElementLike} Element - * @typedef {import('../../core/Types').ConnectionLike} Connection - * @typedef {import('../../core/Types').ShapeLike} Shape + * @typedef {import('../../core/Types.js').ElementLike} Element + * @typedef {import('../../core/Types.js').ConnectionLike} Connection + * @typedef {import('../../core/Types.js').ShapeLike} Shape * - * @typedef {import('../../util/Types').Point} Point + * @typedef {import('../../util/Types.js').Point} Point */ /** diff --git a/lib/layout/CroppingConnectionDocking.js b/lib/layout/CroppingConnectionDocking.js index 0c7b430bb..db91afe91 100644 --- a/lib/layout/CroppingConnectionDocking.js +++ b/lib/layout/CroppingConnectionDocking.js @@ -4,11 +4,11 @@ import { import { getElementLineIntersection -} from './LayoutUtil'; +} from './LayoutUtil.js'; /** - * @typedef {import('../core/ElementRegistry').default} ElementRegistry - * @typedef {import('../core/GraphicsFactory').default} GraphicsFactory + * @typedef {import('../core/ElementRegistry.js').default} ElementRegistry + * @typedef {import('../core/GraphicsFactory.js').default} GraphicsFactory */ function dockingToPoint(docking) { diff --git a/lib/layout/LayoutUtil.js b/lib/layout/LayoutUtil.js index dba2c43fa..3ecafc74f 100644 --- a/lib/layout/LayoutUtil.js +++ b/lib/layout/LayoutUtil.js @@ -6,21 +6,21 @@ import { import { pointDistance, pointsOnLine -} from '../util/Geometry'; +} from '../util/Geometry.js'; import intersectPaths from 'path-intersection'; -import { isConnection } from '../util/ModelUtil'; +import { isConnection } from '../util/ModelUtil.js'; /** - * @typedef {import('../core/Types').ElementLike} Element - * @typedef {import('../core/Types').ConnectionLike} Connection + * @typedef {import('../core/Types.js').ElementLike} Element + * @typedef {import('../core/Types.js').ConnectionLike} Connection * - * @typedef {import('../util/Types').DirectionTRBL} DirectionTRBL - * @typedef {import('../util/Types').Intersection} Intersection - * @typedef {import('../util/Types').Point} Point - * @typedef {import('../util/Types').Rect} Rect - * @typedef {import('../util/Types').RectTRBL} RectTRBL + * @typedef {import('../util/Types.js').DirectionTRBL} DirectionTRBL + * @typedef {import('../util/Types.js').Intersection} Intersection + * @typedef {import('../util/Types.js').Point} Point + * @typedef {import('../util/Types.js').Rect} Rect + * @typedef {import('../util/Types.js').RectTRBL} RectTRBL */ /** diff --git a/lib/layout/ManhattanLayout.js b/lib/layout/ManhattanLayout.js index 8661cd8a2..cb57707ec 100644 --- a/lib/layout/ManhattanLayout.js +++ b/lib/layout/ManhattanLayout.js @@ -8,18 +8,18 @@ import { import { getOrientation, getMid -} from './LayoutUtil'; +} from './LayoutUtil.js'; import { pointInRect, pointDistance, pointsAligned, pointsOnLine -} from '../util/Geometry'; +} from '../util/Geometry.js'; /** - * @typedef {import('../util/Types').Point} Point - * @typedef {import('../util/Types').Rect} Rect + * @typedef {import('../util/Types.js').Point} Point + * @typedef {import('../util/Types.js').Rect} Rect */ var MIN_SEGMENT_LENGTH = 20, diff --git a/lib/model/Types.ts b/lib/model/Types.ts index 5cfb686c0..d87d7334d 100644 --- a/lib/model/Types.ts +++ b/lib/model/Types.ts @@ -1,4 +1,4 @@ -import type { Point } from '../util/Types'; +import type { Point } from '../util/Types.js'; export type ElementLike = { id: string; diff --git a/lib/model/index.js b/lib/model/index.js index 6ad90b2f7..08b0cfbc8 100644 --- a/lib/model/index.js +++ b/lib/model/index.js @@ -10,11 +10,11 @@ var parentRefs = new Refs({ name: 'children', enumerable: true, collection: true incomingRefs = new Refs({ name: 'incoming', collection: true }, { name: 'target' }); /** - * @typedef {import('./Types').Element} Element - * @typedef {import('./Types').Shape} Shape - * @typedef {import('./Types').Root} Root - * @typedef {import('./Types').Label} Label - * @typedef {import('./Types').Connection} Connection + * @typedef {import('./Types.js').Element} Element + * @typedef {import('./Types.js').Shape} Shape + * @typedef {import('./Types.js').Root} Root + * @typedef {import('./Types.js').Label} Label + * @typedef {import('./Types.js').Connection} Connection */ /** diff --git a/lib/model/index.spec.ts b/lib/model/index.spec.ts index 395dd8572..c81a7c850 100644 --- a/lib/model/index.spec.ts +++ b/lib/model/index.spec.ts @@ -1,4 +1,4 @@ -import { create } from './index'; +import { create } from './index.js'; const connection = create('connection', { id: 'foo', diff --git a/lib/navigation/keyboard-move/KeyboardMove.js b/lib/navigation/keyboard-move/KeyboardMove.js index 194ea9fe6..f35367cc7 100644 --- a/lib/navigation/keyboard-move/KeyboardMove.js +++ b/lib/navigation/keyboard-move/KeyboardMove.js @@ -1,8 +1,8 @@ import { assign } from 'min-dash'; /** - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../../features/keyboard/Keyboard').default} Keyboard + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../../features/keyboard/Keyboard.js').default} Keyboard */ var DEFAULT_CONFIG = { diff --git a/lib/navigation/keyboard-move/index.js b/lib/navigation/keyboard-move/index.js index 14a786793..49761a28a 100644 --- a/lib/navigation/keyboard-move/index.js +++ b/lib/navigation/keyboard-move/index.js @@ -1,6 +1,6 @@ -import KeyboardModule from '../../features/keyboard'; +import KeyboardModule from '../../features/keyboard/index.js'; -import KeyboardMove from './KeyboardMove'; +import KeyboardMove from './KeyboardMove.js'; /** diff --git a/lib/navigation/movecanvas/MoveCanvas.js b/lib/navigation/movecanvas/MoveCanvas.js index 255ddffbe..3d944d242 100644 --- a/lib/navigation/movecanvas/MoveCanvas.js +++ b/lib/navigation/movecanvas/MoveCanvas.js @@ -1,15 +1,15 @@ import { set as cursorSet, unset as cursorUnset -} from '../../util/Cursor'; +} from '../../util/Cursor.js'; import { install as installClickTrap -} from '../../util/ClickTrap'; +} from '../../util/ClickTrap.js'; import { delta as deltaPos -} from '../../util/PositionUtil'; +} from '../../util/PositionUtil.js'; import { event as domEvent, @@ -18,11 +18,11 @@ import { import { toPoint -} from '../../util/Event'; +} from '../../util/Event.js'; /** - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../../core/EventBus').default} EventBus + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../../core/EventBus.js').default} EventBus */ var THRESHOLD = 15; diff --git a/lib/navigation/movecanvas/index.js b/lib/navigation/movecanvas/index.js index 4f84c7808..892e24dea 100644 --- a/lib/navigation/movecanvas/index.js +++ b/lib/navigation/movecanvas/index.js @@ -1,4 +1,4 @@ -import MoveCanvas from './MoveCanvas'; +import MoveCanvas from './MoveCanvas.js'; /** diff --git a/lib/navigation/zoomscroll/ZoomScroll.js b/lib/navigation/zoomscroll/ZoomScroll.js index a34313357..d81ccbd5b 100644 --- a/lib/navigation/zoomscroll/ZoomScroll.js +++ b/lib/navigation/zoomscroll/ZoomScroll.js @@ -6,25 +6,25 @@ import { import { getStepSize, cap -} from './ZoomUtil'; +} from './ZoomUtil.js'; import { log10 -} from '../../util/Math'; +} from '../../util/Math.js'; import { isMac -} from '../../util/Platform'; +} from '../../util/Platform.js'; import { bind } from 'min-dash'; /** - * @typedef {import('../../core/Canvas').default} Canvas - * @typedef {import('../../core/EventBus').default} EventBus + * @typedef {import('../../core/Canvas.js').default} Canvas + * @typedef {import('../../core/EventBus.js').default} EventBus * - * @typedef {import('../../util/Types').Point} Point + * @typedef {import('../../util/Types.js').Point} Point */ var sign = Math.sign || function(n) { diff --git a/lib/navigation/zoomscroll/ZoomUtil.js b/lib/navigation/zoomscroll/ZoomUtil.js index 8a3c6fd90..afa488f4b 100644 --- a/lib/navigation/zoomscroll/ZoomUtil.js +++ b/lib/navigation/zoomscroll/ZoomUtil.js @@ -1,6 +1,6 @@ import { log10 -} from '../../util/Math'; +} from '../../util/Math.js'; /** * Get step size for given range and number of steps. diff --git a/lib/navigation/zoomscroll/index.js b/lib/navigation/zoomscroll/index.js index 9ed057c40..24d1b0f9b 100644 --- a/lib/navigation/zoomscroll/index.js +++ b/lib/navigation/zoomscroll/index.js @@ -1,4 +1,4 @@ -import ZoomScroll from './ZoomScroll'; +import ZoomScroll from './ZoomScroll.js'; /** diff --git a/lib/util/AttachUtil.js b/lib/util/AttachUtil.js index c0754bf51..6c97c9f9d 100644 --- a/lib/util/AttachUtil.js +++ b/lib/util/AttachUtil.js @@ -2,18 +2,18 @@ import { asTRBL, getOrientation, roundPoint -} from '../layout/LayoutUtil'; +} from '../layout/LayoutUtil.js'; import { center, delta -} from './PositionUtil'; +} from './PositionUtil.js'; /** - * @typedef {import('../model/Types').Shape} Shape + * @typedef {import('../model/Types.js').Shape} Shape * - * @typedef {import('../util/Types').Point} Point - * @typedef {import('../util/Types').Rect} Rect + * @typedef {import('../util/Types.js').Point} Point + * @typedef {import('../util/Types.js').Rect} Rect */ /** diff --git a/lib/util/ClickTrap.js b/lib/util/ClickTrap.js index 7ac36e970..dcddfb08e 100644 --- a/lib/util/ClickTrap.js +++ b/lib/util/ClickTrap.js @@ -1,5 +1,5 @@ /** - * @typedef {import('../core/EventBus').default} EventBus + * @typedef {import('../core/EventBus.js').default} EventBus */ var TRAP_PRIORITY = 5000; diff --git a/lib/util/Elements.js b/lib/util/Elements.js index cc82554ca..945f1fcc6 100644 --- a/lib/util/Elements.js +++ b/lib/util/Elements.js @@ -11,11 +11,11 @@ import { } from 'min-dash'; /** - * @typedef {import('../model/Types').Connection} Connection - * @typedef {import('../model/Types').Element} Element - * @typedef {import('../model/Types').Shape} Shape + * @typedef {import('../model/Types.js').Connection} Connection + * @typedef {import('../model/Types.js').Element} Element + * @typedef {import('../model/Types.js').Shape} Shape * - * @typedef {import('../util/Types').Rect} Rect + * @typedef {import('../util/Types.js').Rect} Rect * * @typedef { { * allShapes: Record, diff --git a/lib/util/Event.js b/lib/util/Event.js index 4d3ab7c25..559f15eae 100644 --- a/lib/util/Event.js +++ b/lib/util/Event.js @@ -1,5 +1,7 @@ /** - * @typedef {import('../util/Types').Point} Point + * @typedef {import('../util/Types.js').Point} Point + * + * @typedef {import('../core/EventBus.js').Event} EventBusEvent */ function __stopPropagation(event) { @@ -11,7 +13,7 @@ function __stopPropagation(event) { } /** - * @param {import('../core/EventBus').Event} event + * @param {EventBusEvent} event * * @return {Event} */ @@ -20,7 +22,7 @@ export function getOriginal(event) { } /** - * @param {Event|import('../core/EventBus').Event} event + * @param {Event|EventBusEvent} event */ export function stopPropagation(event) { __stopPropagation(event); diff --git a/lib/util/Geometry.js b/lib/util/Geometry.js index e61ba9cea..797000b63 100644 --- a/lib/util/Geometry.js +++ b/lib/util/Geometry.js @@ -3,9 +3,9 @@ import { } from 'min-dash'; /** - * @typedef {import('../util/Types').Axis} Axis - * @typedef {import('../util/Types').Point} Point - * @typedef {import('../util/Types').Rect} Rect + * @typedef {import('../util/Types.js').Axis} Axis + * @typedef {import('../util/Types.js').Point} Point + * @typedef {import('../util/Types.js').Rect} Rect */ /** diff --git a/lib/util/LineIntersection.js b/lib/util/LineIntersection.js index 475c9e02f..86ca86352 100644 --- a/lib/util/LineIntersection.js +++ b/lib/util/LineIntersection.js @@ -1,11 +1,11 @@ +import intersectPaths from 'path-intersection'; + import { pointDistance -} from './Geometry'; - -import intersectPaths from 'path-intersection'; +} from './Geometry.js'; /** - * @typedef {import('../util/Types').Point} Point + * @typedef {import('../util/Types.js').Point} Point * * @typedef { { * bendpoint?: boolean; diff --git a/lib/util/Math.js b/lib/util/Math.js index 3e0b2b558..3d85221db 100644 --- a/lib/util/Math.js +++ b/lib/util/Math.js @@ -7,4 +7,4 @@ export function log10(x) { return Math.log(x) / Math.log(10); } -export { delta as substract } from './PositionUtil'; +export { delta as substract } from './PositionUtil.js'; diff --git a/lib/util/Mouse.js b/lib/util/Mouse.js index 16727b5db..abecfa296 100644 --- a/lib/util/Mouse.js +++ b/lib/util/Mouse.js @@ -1,14 +1,14 @@ import { getOriginal as getOriginalEvent -} from './Event'; +} from './Event.js'; import { isMac -} from './Platform'; +} from './Platform.js'; export { isMac -} from './Platform'; +} from './Platform.js'; /** * @param {MouseEvent} event diff --git a/lib/util/PositionUtil.js b/lib/util/PositionUtil.js index 3bf1bfd86..9937d279c 100644 --- a/lib/util/PositionUtil.js +++ b/lib/util/PositionUtil.js @@ -1,6 +1,6 @@ /** - * @typedef {import('../util/Types').Point} Point - * @typedef {import('../util/Types').Rect} Rect + * @typedef {import('../util/Types.js').Point} Point + * @typedef {import('../util/Types.js').Rect} Rect */ /** diff --git a/lib/util/RenderUtil.js b/lib/util/RenderUtil.js index 7bb3af13e..fe1d5eedc 100644 --- a/lib/util/RenderUtil.js +++ b/lib/util/RenderUtil.js @@ -11,7 +11,7 @@ import { /** * @typedef {(string|number)[]} Component * - * @typedef {import('../util/Types').Point} Point + * @typedef {import('../util/Types.js').Point} Point */ /** diff --git a/lib/util/RenderUtil.spec.ts b/lib/util/RenderUtil.spec.ts index b8821b227..4af318fa1 100644 --- a/lib/util/RenderUtil.spec.ts +++ b/lib/util/RenderUtil.spec.ts @@ -1,7 +1,7 @@ import { toSVGPoints, componentsToPath -} from './RenderUtil'; +} from './RenderUtil.js'; toSVGPoints([ { x: 10, y: 100 }, diff --git a/lib/util/Text.js b/lib/util/Text.js index 88e21d2f1..cc09823a4 100644 --- a/lib/util/Text.js +++ b/lib/util/Text.js @@ -18,7 +18,7 @@ import { /** - * @typedef {import('../util/Types').Dimensions} Dimensions + * @typedef {import('../util/Types.js').Dimensions} Dimensions * * @typedef { { * top: number; diff --git a/lib/util/Text.spec.ts b/lib/util/Text.spec.ts index 6205d686d..93b537cd7 100644 --- a/lib/util/Text.spec.ts +++ b/lib/util/Text.spec.ts @@ -1,6 +1,6 @@ // instantiation -import Text from './Text'; +import Text from './Text.js'; const text = new Text({ style: { diff --git a/test/TestHelper.js b/test/TestHelper.js index afb6bee2b..73fc37319 100644 --- a/test/TestHelper.js +++ b/test/TestHelper.js @@ -1,8 +1,8 @@ -export * from './helper'; +export * from './helper/index.js'; import { insertCSS -} from './helper'; +} from './helper/index.js'; import diagramCSS from '../assets/diagram-js.css'; @@ -14,8 +14,8 @@ insertCSS('diagram-js-testing.css', ); -import BoundsMatchers from './matchers/BoundsMatchers'; -import ConnectionMatchers from './matchers/ConnectionMatchers'; +import BoundsMatchers from './matchers/BoundsMatchers.js'; +import ConnectionMatchers from './matchers/ConnectionMatchers.js'; /* global chai */ diff --git a/test/helper/index.js b/test/helper/index.js index a14fe8e83..f340a7476 100644 --- a/test/helper/index.js +++ b/test/helper/index.js @@ -6,7 +6,7 @@ import { import TestContainer from 'mocha-test-container-support'; -import Diagram from '../../lib/Diagram'; +import Diagram from '../../lib/Diagram.js'; var OPTIONS, DIAGRAM_JS; diff --git a/test/matchers/BoundsMatchers.js b/test/matchers/BoundsMatchers.js index 6b765184b..06b9aee57 100644 --- a/test/matchers/BoundsMatchers.js +++ b/test/matchers/BoundsMatchers.js @@ -1,10 +1,10 @@ import { pick } from 'min-dash'; /** - * @typedef {import('../../lib/util/Types').Dimensions} Dimensions - * @typedef {import('../../lib/util/Types').Point} Point - * @typedef {import('../../lib/util/Types').Rect} Rect - * @typedef {import('../../lib/util/Types').RectTRBL} RectTRBL + * @typedef {import('../../lib/util/Types.js').Dimensions} Dimensions + * @typedef {import('../../lib/util/Types.js').Point} Point + * @typedef {import('../../lib/util/Types.js').Rect} Rect + * @typedef {import('../../lib/util/Types.js').RectTRBL} RectTRBL */ var BOUNDS_ATTRS = [ 'x', 'y', 'width', 'height' ], diff --git a/test/matchers/BoundsMatchersSpec.js b/test/matchers/BoundsMatchersSpec.js index 28f38cc00..8163c3a26 100644 --- a/test/matchers/BoundsMatchersSpec.js +++ b/test/matchers/BoundsMatchersSpec.js @@ -1,6 +1,6 @@ import { create -} from 'lib/model'; +} from 'lib/model/index.js'; describe('matchers/BoundsMatchers', function() { diff --git a/test/matchers/ConnectionMatchers.js b/test/matchers/ConnectionMatchers.js index b2f24f114..88c15e801 100644 --- a/test/matchers/ConnectionMatchers.js +++ b/test/matchers/ConnectionMatchers.js @@ -1,7 +1,7 @@ import { pick } from 'min-dash'; /** - * @typedef {import('../../lib/util/Types').Point} Point + * @typedef {import('../../lib/util/Types.js').Point} Point */ var POSITION_ATTRS = [ 'x', 'y' ]; diff --git a/test/matchers/ConnectionMatchersSpec.js b/test/matchers/ConnectionMatchersSpec.js index cee2dbe3b..a599e54a1 100644 --- a/test/matchers/ConnectionMatchersSpec.js +++ b/test/matchers/ConnectionMatchersSpec.js @@ -1,6 +1,6 @@ import { create -} from 'lib/model'; +} from 'lib/model/index.js'; describe('matchers/ConnectionMatchers', function() { diff --git a/test/spec/command/CommandInterceptorSpec.js b/test/spec/command/CommandInterceptorSpec.js index 86ff711ce..a2defb14b 100644 --- a/test/spec/command/CommandInterceptorSpec.js +++ b/test/spec/command/CommandInterceptorSpec.js @@ -1,13 +1,13 @@ +import inherits from 'inherits-browser'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; - -import inherits from 'inherits-browser'; +} from 'test/TestHelper.js'; -import cmdModule from 'lib/command'; +import cmdModule from 'lib/command/index.js'; -import CommandInterceptor from 'lib/command/CommandInterceptor'; +import CommandInterceptor from 'lib/command/CommandInterceptor.js'; // example commands diff --git a/test/spec/command/CommandStackSpec.js b/test/spec/command/CommandStackSpec.js index 3403781dd..9a2a458da 100755 --- a/test/spec/command/CommandStackSpec.js +++ b/test/spec/command/CommandStackSpec.js @@ -1,10 +1,10 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import cmdModule from 'lib/command'; +import cmdModule from 'lib/command/index.js'; // example commands diff --git a/test/spec/connection-preview/ConnectionPreviewSpec.js b/test/spec/connection-preview/ConnectionPreviewSpec.js index 76b6b3b29..143d14a5e 100755 --- a/test/spec/connection-preview/ConnectionPreviewSpec.js +++ b/test/spec/connection-preview/ConnectionPreviewSpec.js @@ -1,22 +1,25 @@ +import { + query as domQuery +} from 'min-dom'; + +import { + isDefined +} from 'min-dash'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import TestContainer from 'mocha-test-container-support'; -import modelingModule from 'lib/features/modeling'; -import connectionPreviewModule from 'lib/features/connection-preview'; - -import BaseLayouter from 'lib/layout/BaseLayouter'; -import CroppingConnectionDocking from 'lib/layout/CroppingConnectionDocking'; +import modelingModule from 'lib/features/modeling/index.js'; +import connectionPreviewModule from 'lib/features/connection-preview/index.js'; -import { - query as domQuery -} from 'min-dom'; -import { isDefined } from 'min-dash'; +import BaseLayouter from 'lib/layout/BaseLayouter.js'; +import CroppingConnectionDocking from 'lib/layout/CroppingConnectionDocking.js'; -import { getMid } from '../../../lib/layout/LayoutUtil'; +import { getMid } from '../../../lib/layout/LayoutUtil.js'; var testModules = [ modelingModule, diff --git a/test/spec/core/CanvasSpec.js b/test/spec/core/CanvasSpec.js index 27cc3f5f9..7b35685df 100644 --- a/test/spec/core/CanvasSpec.js +++ b/test/spec/core/CanvasSpec.js @@ -1,11 +1,3 @@ -import { - bootstrapDiagram, - getDiagramJS, - inject -} from 'test/TestHelper'; - -import TestContainer from 'mocha-test-container-support'; - import { merge } from 'min-dash'; import { @@ -17,7 +9,15 @@ import { classes as svgClasses } from 'tiny-svg'; -import { getChildren as getChildrenGfx } from 'lib/util/GraphicsUtil'; +import TestContainer from 'mocha-test-container-support'; + +import { + bootstrapDiagram, + getDiagramJS, + inject +} from 'test/TestHelper.js'; + +import { getChildren as getChildrenGfx } from 'lib/util/GraphicsUtil.js'; describe('Canvas', function() { diff --git a/test/spec/core/ElementRegistrySpec.js b/test/spec/core/ElementRegistrySpec.js index 18c6ab6e7..e6bf96d32 100755 --- a/test/spec/core/ElementRegistrySpec.js +++ b/test/spec/core/ElementRegistrySpec.js @@ -1,7 +1,7 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; describe('ElementRegistry', function() { diff --git a/test/spec/core/EventBusSpec.js b/test/spec/core/EventBusSpec.js index f24e8726f..fe6d28e36 100755 --- a/test/spec/core/EventBusSpec.js +++ b/test/spec/core/EventBusSpec.js @@ -1,4 +1,4 @@ -import EventBus from 'lib/core/EventBus'; +import EventBus from 'lib/core/EventBus.js'; describe('core/EventBus', function() { diff --git a/test/spec/core/GraphicsFactorySpec.js b/test/spec/core/GraphicsFactorySpec.js index 7e39e931f..408e37892 100644 --- a/test/spec/core/GraphicsFactorySpec.js +++ b/test/spec/core/GraphicsFactorySpec.js @@ -1,12 +1,12 @@ -import { - bootstrapDiagram, - inject -} from 'test/TestHelper'; - import { classes as svgClasses } from 'tiny-svg'; +import { + bootstrapDiagram, + inject +} from 'test/TestHelper.js'; + describe('GraphicsFactory', function() { diff --git a/test/spec/draw/DefaultRendererSpec.js b/test/spec/draw/DefaultRendererSpec.js index cf489d048..96c532083 100644 --- a/test/spec/draw/DefaultRendererSpec.js +++ b/test/spec/draw/DefaultRendererSpec.js @@ -1,10 +1,11 @@ +import { create } from 'tiny-svg'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; -import { create } from 'tiny-svg'; +} from 'test/TestHelper.js'; -import drawModule from 'lib/draw'; +import drawModule from 'lib/draw/index.js'; describe('draw - DefaultRenderer', function() { diff --git a/test/spec/draw/StylesSpec.js b/test/spec/draw/StylesSpec.js index c0c62a521..1f4646877 100755 --- a/test/spec/draw/StylesSpec.js +++ b/test/spec/draw/StylesSpec.js @@ -1,4 +1,4 @@ -import Styles from 'lib/draw/Styles'; +import Styles from 'lib/draw/Styles.js'; describe('draw/Styles', function() { diff --git a/test/spec/environment/MockingSpec.js b/test/spec/environment/MockingSpec.js index 914e9ded2..9c27270f0 100755 --- a/test/spec/environment/MockingSpec.js +++ b/test/spec/environment/MockingSpec.js @@ -1,10 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; - -import EventBus from 'lib/core/EventBus'; +import EventBus from 'lib/core/EventBus.js'; describe('environment/Mocking', function() { diff --git a/test/spec/features/align-elements/AlignElementsSpec.js b/test/spec/features/align-elements/AlignElementsSpec.js index aca1bdaf4..187288063 100644 --- a/test/spec/features/align-elements/AlignElementsSpec.js +++ b/test/spec/features/align-elements/AlignElementsSpec.js @@ -1,13 +1,13 @@ +import { forEach, sortBy } from 'min-dash'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; - -import { forEach, sortBy } from 'min-dash'; +} from 'test/TestHelper.js'; -import alignElementsModule from 'lib/features/align-elements'; -import modelingModule from 'lib/features/modeling'; -import testRules from './rules'; +import alignElementsModule from 'lib/features/align-elements/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import testRules from './rules/index.js'; describe('features/align-elements', function() { diff --git a/test/spec/features/align-elements/rules/TestRules.js b/test/spec/features/align-elements/rules/TestRules.js index f4cc5d1c0..20057a431 100755 --- a/test/spec/features/align-elements/rules/TestRules.js +++ b/test/spec/features/align-elements/rules/TestRules.js @@ -1,6 +1,6 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; export default function TestRules(eventBus) { RuleProvider.call(this, eventBus); diff --git a/test/spec/features/align-elements/rules/index.js b/test/spec/features/align-elements/rules/index.js index eb8ffc77c..4dc6c034e 100755 --- a/test/spec/features/align-elements/rules/index.js +++ b/test/spec/features/align-elements/rules/index.js @@ -1,4 +1,4 @@ -import TestRules from './TestRules'; +import TestRules from './TestRules.js'; export default { __init__: [ 'testRules' ], diff --git a/test/spec/features/attach-support/AttachSupportSpec.js b/test/spec/features/attach-support/AttachSupportSpec.js index ad56e858b..4a1d26bf9 100644 --- a/test/spec/features/attach-support/AttachSupportSpec.js +++ b/test/spec/features/attach-support/AttachSupportSpec.js @@ -1,25 +1,26 @@ -import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents'; +import { pick } from 'min-dash'; + +import { query as domQuery } from 'min-dom'; + +import { classes as svgClasses } from 'tiny-svg'; + +import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents.js'; import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import { pick } from 'min-dash'; - -import attachSupportModule from 'lib/features/attach-support'; -import labelSupportModule from 'lib/features/label-support'; -import modelingModule from 'lib/features/modeling'; -import moveModule from 'lib/features/move'; -import replaceModule from 'lib/features/replace'; -import spaceToolModule from 'lib/features/space-tool'; -import rulesModule from './rules'; +import attachSupportModule from 'lib/features/attach-support/index.js'; +import labelSupportModule from 'lib/features/label-support/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import moveModule from 'lib/features/move/index.js'; +import replaceModule from 'lib/features/replace/index.js'; +import spaceToolModule from 'lib/features/space-tool/index.js'; +import rulesModule from './rules/index.js'; -import { getNewAttachShapeDelta } from 'lib/util/AttachUtil'; +import { getNewAttachShapeDelta } from 'lib/util/AttachUtil.js'; -import { query as domQuery } from 'min-dom'; - -import { classes as svgClasses } from 'tiny-svg'; var ATTACH = { attach: true }; var NO_ATTACH = { attach: false }; diff --git a/test/spec/features/attach-support/rules/AttachRules.js b/test/spec/features/attach-support/rules/AttachRules.js index 2f52b3dfe..bbaa98e01 100644 --- a/test/spec/features/attach-support/rules/AttachRules.js +++ b/test/spec/features/attach-support/rules/AttachRules.js @@ -1,9 +1,10 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; - import { forEach } from 'min-dash'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; + + export default function AttachRules(eventBus) { RuleProvider.call(this, eventBus); } diff --git a/test/spec/features/attach-support/rules/index.js b/test/spec/features/attach-support/rules/index.js index d8cf22904..23c6a923b 100755 --- a/test/spec/features/attach-support/rules/index.js +++ b/test/spec/features/attach-support/rules/index.js @@ -1,4 +1,4 @@ -import AttachRules from './AttachRules'; +import AttachRules from './AttachRules.js'; export default { __init__: [ 'attachRules' ], diff --git a/test/spec/features/auto-place/AutoPlaceSpec.js b/test/spec/features/auto-place/AutoPlaceSpec.js index 425d2542e..285918d71 100644 --- a/test/spec/features/auto-place/AutoPlaceSpec.js +++ b/test/spec/features/auto-place/AutoPlaceSpec.js @@ -1,25 +1,25 @@ +import { assign } from 'min-dash'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import autoPlaceModule from 'lib/features/auto-place'; -import coreModule from 'lib/core'; -import modelingModule from 'lib/features/modeling'; -import selectionModule from 'lib/features/selection'; +import autoPlaceModule from 'lib/features/auto-place/index.js'; +import coreModule from 'lib/core/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import selectionModule from 'lib/features/selection/index.js'; -import { getMid } from 'lib/layout/LayoutUtil'; +import { getMid } from 'lib/layout/LayoutUtil.js'; import { findFreePosition, generateGetNextPosition, getConnectedAtPosition, getConnectedDistance -} from 'lib/features/auto-place/AutoPlaceUtil'; - -import { assign } from 'min-dash'; +} from 'lib/features/auto-place/AutoPlaceUtil.js'; -import { DEFAULT_DISTANCE } from 'lib/features/auto-place/AutoPlaceUtil'; +import { DEFAULT_DISTANCE } from 'lib/features/auto-place/AutoPlaceUtil.js'; describe('features/auto-place', function() { diff --git a/test/spec/features/auto-resize/AutoResizeSpec.js b/test/spec/features/auto-resize/AutoResizeSpec.js index 0525e8b8a..4d39d5ac7 100644 --- a/test/spec/features/auto-resize/AutoResizeSpec.js +++ b/test/spec/features/auto-resize/AutoResizeSpec.js @@ -1,21 +1,21 @@ +import inherits from 'inherits-browser'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; +} from '../../../util/MockEvents.js'; -import modelingModule from 'lib/features/modeling'; -import autoResizeModule from 'lib/features/auto-resize'; -import createModule from 'lib/features/create'; -import replaceModule from 'lib/features/replace'; +import modelingModule from 'lib/features/modeling/index.js'; +import autoResizeModule from 'lib/features/auto-resize/index.js'; +import createModule from 'lib/features/create/index.js'; +import replaceModule from 'lib/features/replace/index.js'; -import AutoResizeProvider from 'lib/features/auto-resize/AutoResizeProvider'; -import AutoResize from 'lib/features/auto-resize/AutoResize'; - -import inherits from 'inherits-browser'; +import AutoResizeProvider from 'lib/features/auto-resize/AutoResizeProvider.js'; +import AutoResize from 'lib/features/auto-resize/AutoResize.js'; /** diff --git a/test/spec/features/auto-scroll/AutoScrollSpec.js b/test/spec/features/auto-scroll/AutoScrollSpec.js index e9f05cb54..5c3ec3680 100644 --- a/test/spec/features/auto-scroll/AutoScrollSpec.js +++ b/test/spec/features/auto-scroll/AutoScrollSpec.js @@ -1,12 +1,12 @@ -import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents'; +import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents.js'; import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import dragModule from 'lib/features/dragging'; -import scrollModule from 'lib/features/auto-scroll'; +import dragModule from 'lib/features/dragging/index.js'; +import scrollModule from 'lib/features/auto-scroll/index.js'; describe('features/auto-scroll - AutoScroll', function() { diff --git a/test/spec/features/bendpoints/BendpointsMoveSpec.js b/test/spec/features/bendpoints/BendpointsMoveSpec.js index de9e2d14b..31bbc8848 100755 --- a/test/spec/features/bendpoints/BendpointsMoveSpec.js +++ b/test/spec/features/bendpoints/BendpointsMoveSpec.js @@ -1,29 +1,29 @@ +import { + query as domQuery, + queryAll as domQueryAll +} from 'min-dom'; + import { bootstrapDiagram, getDiagramJS, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; +} from '../../../util/MockEvents.js'; -import bendpointsModule from 'lib/features/bendpoints'; -import rulesModule from './rules'; -import connectModule from 'lib/features/connect'; -import modelingModule from 'lib/features/modeling'; -import selectModule from 'lib/features/selection'; -import connectionPreviewModule from 'lib/features/connection-preview'; -import CroppingConnectionDocking from 'lib/layout/CroppingConnectionDocking'; +import bendpointsModule from 'lib/features/bendpoints/index.js'; +import rulesModule from './rules/index.js'; +import connectModule from 'lib/features/connect/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import selectModule from 'lib/features/selection/index.js'; +import connectionPreviewModule from 'lib/features/connection-preview/index.js'; +import CroppingConnectionDocking from 'lib/layout/CroppingConnectionDocking.js'; -import { getMid } from 'lib/layout/LayoutUtil'; - -import { - query as domQuery, - queryAll as domQueryAll -} from 'min-dom'; +import { getMid } from 'lib/layout/LayoutUtil.js'; -import { isSnapped } from 'lib/features/snapping/SnapUtil'; +import { isSnapped } from 'lib/features/snapping/SnapUtil.js'; var testModules = [ bendpointsModule, diff --git a/test/spec/features/bendpoints/BendpointsSpec.js b/test/spec/features/bendpoints/BendpointsSpec.js index 24745a049..13a03a6fb 100755 --- a/test/spec/features/bendpoints/BendpointsSpec.js +++ b/test/spec/features/bendpoints/BendpointsSpec.js @@ -1,25 +1,25 @@ +import { + query as domQuery, + queryAll as domQueryAll +} from 'min-dom'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; -import bendpointsModule from 'lib/features/bendpoints'; -import rulesModule from './rules'; -import interactionModule from 'lib/features/interaction-events'; +import modelingModule from 'lib/features/modeling/index.js'; +import bendpointsModule from 'lib/features/bendpoints/index.js'; +import rulesModule from './rules/index.js'; +import interactionModule from 'lib/features/interaction-events/index.js'; import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; - -import { - query as domQuery, - queryAll as domQueryAll -} from 'min-dom'; +} from '../../../util/MockEvents.js'; import { getVisual -} from 'lib/util/GraphicsUtil'; +} from 'lib/util/GraphicsUtil.js'; describe('features/bendpoints', function() { diff --git a/test/spec/features/bendpoints/ConnectionSegmentMoveSpec.js b/test/spec/features/bendpoints/ConnectionSegmentMoveSpec.js index 77928cccd..1f2216206 100755 --- a/test/spec/features/bendpoints/ConnectionSegmentMoveSpec.js +++ b/test/spec/features/bendpoints/ConnectionSegmentMoveSpec.js @@ -2,20 +2,20 @@ import { bootstrapDiagram, getDiagramJS, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents'; +import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents.js'; -import bendpointsModule from 'lib/features/bendpoints'; -import modelingModule from 'lib/features/modeling'; -import selectModule from 'lib/features/selection'; +import bendpointsModule from 'lib/features/bendpoints/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import selectModule from 'lib/features/selection/index.js'; -import CroppingConnectionDocking from 'lib/layout/CroppingConnectionDocking'; +import CroppingConnectionDocking from 'lib/layout/CroppingConnectionDocking.js'; -import { isSnapped } from 'lib/features/snapping/SnapUtil'; +import { isSnapped } from 'lib/features/snapping/SnapUtil.js'; -import { getMid } from 'lib/layout/LayoutUtil'; -import { getConnectionIntersection } from '../../../../lib/features/bendpoints/BendpointUtil'; +import { getMid } from 'lib/layout/LayoutUtil.js'; +import { getConnectionIntersection } from '../../../../lib/features/bendpoints/BendpointUtil.js'; var layoutModule = { connectionDocking: [ 'type', CroppingConnectionDocking ] diff --git a/test/spec/features/bendpoints/GeometricUtilSpec.js b/test/spec/features/bendpoints/GeometricUtilSpec.js index 9dc7c8efa..dfe74e230 100644 --- a/test/spec/features/bendpoints/GeometricUtilSpec.js +++ b/test/spec/features/bendpoints/GeometricUtilSpec.js @@ -4,7 +4,7 @@ import { getDistancePointPoint, perpendicularFoot, rotateVector -} from 'lib/features/bendpoints/GeometricUtil'; +} from 'lib/features/bendpoints/GeometricUtil.js'; describe('features/bendpoints - GeometricUtil', function() { diff --git a/test/spec/features/bendpoints/rules/BendpointRules.js b/test/spec/features/bendpoints/rules/BendpointRules.js index 5e2d100b1..5148c85aa 100755 --- a/test/spec/features/bendpoints/rules/BendpointRules.js +++ b/test/spec/features/bendpoints/rules/BendpointRules.js @@ -1,6 +1,6 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; export default function ConnectRules(eventBus) { RuleProvider.call(this, eventBus); diff --git a/test/spec/features/bendpoints/rules/index.js b/test/spec/features/bendpoints/rules/index.js index b5be26f72..fe4884f24 100755 --- a/test/spec/features/bendpoints/rules/index.js +++ b/test/spec/features/bendpoints/rules/index.js @@ -1,4 +1,4 @@ -import BendpointRules from './BendpointRules'; +import BendpointRules from './BendpointRules.js'; export default { __init__: [ 'bendpointRules' ], diff --git a/test/spec/features/change-support/ChangeSupportSpec.js b/test/spec/features/change-support/ChangeSupportSpec.js index dc3dc03ea..ec7edacc0 100644 --- a/test/spec/features/change-support/ChangeSupportSpec.js +++ b/test/spec/features/change-support/ChangeSupportSpec.js @@ -1,10 +1,10 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; -import coreModule from 'lib/core'; +import modelingModule from 'lib/features/modeling/index.js'; +import coreModule from 'lib/core/index.js'; describe('features/change-support', function() { diff --git a/test/spec/features/clipboard/ClipboardSpec.js b/test/spec/features/clipboard/ClipboardSpec.js index ad7f2d91a..567949a6f 100644 --- a/test/spec/features/clipboard/ClipboardSpec.js +++ b/test/spec/features/clipboard/ClipboardSpec.js @@ -1,9 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import clipboardModule from 'lib/features/clipboard'; +import clipboardModule from 'lib/features/clipboard/index.js'; describe('features/clipboard', function() { diff --git a/test/spec/features/complex-preview/ComplexPreviewSpec.js b/test/spec/features/complex-preview/ComplexPreviewSpec.js index e509dff0c..dcd72e39e 100644 --- a/test/spec/features/complex-preview/ComplexPreviewSpec.js +++ b/test/spec/features/complex-preview/ComplexPreviewSpec.js @@ -1,16 +1,17 @@ +import { + query as domQuery, + queryAll as domQueryAll +} from 'min-dom'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import complexPreviewModule from 'lib/features/complex-preview'; -import modelingModule from 'lib/features/modeling'; -import rendererModule from '../preview-support/renderer'; +import complexPreviewModule from 'lib/features/complex-preview/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import rendererModule from '../preview-support/renderer/index.js'; -import { - query as domQuery, - queryAll as domQueryAll -} from 'min-dom'; var testModules = [ complexPreviewModule, diff --git a/test/spec/features/connect/ConnectSpec.js b/test/spec/features/connect/ConnectSpec.js index a0600421e..db40b8186 100755 --- a/test/spec/features/connect/ConnectSpec.js +++ b/test/spec/features/connect/ConnectSpec.js @@ -1,20 +1,20 @@ -import { - bootstrapDiagram, - inject -} from 'test/TestHelper'; - import { classes as svgClasses } from 'tiny-svg'; -import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents'; +import { + bootstrapDiagram, + inject +} from 'test/TestHelper.js'; + +import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents.js'; -import modelingModule from 'lib/features/modeling'; -import rulesModule from './rules'; -import connectModule from 'lib/features/connect'; -import connectionPreviewModule from 'lib/features/connection-preview'; +import modelingModule from 'lib/features/modeling/index.js'; +import rulesModule from './rules/index.js'; +import connectModule from 'lib/features/connect/index.js'; +import connectionPreviewModule from 'lib/features/connection-preview/index.js'; -import { getMid } from 'lib/layout/LayoutUtil'; +import { getMid } from 'lib/layout/LayoutUtil.js'; var testModules = [ diff --git a/test/spec/features/connect/rules/ConnectRules.js b/test/spec/features/connect/rules/ConnectRules.js index d2232298f..9e806f4c5 100755 --- a/test/spec/features/connect/rules/ConnectRules.js +++ b/test/spec/features/connect/rules/ConnectRules.js @@ -1,10 +1,10 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; import { isFrameElement -} from 'lib/util/Elements'; +} from 'lib/util/Elements.js'; export default function ConnectRules(eventBus) { RuleProvider.call(this, eventBus); diff --git a/test/spec/features/connect/rules/index.js b/test/spec/features/connect/rules/index.js index 5bd9b7fff..aac02c1c6 100755 --- a/test/spec/features/connect/rules/index.js +++ b/test/spec/features/connect/rules/index.js @@ -1,4 +1,4 @@ -import ConnectRules from './ConnectRules'; +import ConnectRules from './ConnectRules.js'; export default { __init__: [ 'connectRules' ], diff --git a/test/spec/features/context-pad/ContextPadSpec.js b/test/spec/features/context-pad/ContextPadSpec.js index 06a402319..a5f535253 100755 --- a/test/spec/features/context-pad/ContextPadSpec.js +++ b/test/spec/features/context-pad/ContextPadSpec.js @@ -1,13 +1,3 @@ -import { - createEvent as globalEvent -} from '../../../util/MockEvents'; - -import { - bootstrapDiagram, - getDiagramJS, - inject -} from 'test/TestHelper'; - import { assign, isArray } from 'min-dash'; import { @@ -16,12 +6,22 @@ import { classes as domClasses } from 'min-dom'; -import { getBBox } from 'lib/util/Elements'; +import { + createEvent as globalEvent +} from '../../../util/MockEvents.js'; + +import { + bootstrapDiagram, + getDiagramJS, + inject +} from 'test/TestHelper.js'; + +import { getBBox } from 'lib/util/Elements.js'; -import contextPadModule from 'lib/features/context-pad'; -import selectionModule from 'lib/features/selection'; +import contextPadModule from 'lib/features/context-pad/index.js'; +import selectionModule from 'lib/features/selection/index.js'; -import ContextPadProvider from './ContextPadProvider'; +import ContextPadProvider from './ContextPadProvider.js'; var providerModule = { __init__: [ 'contextPadProvider' ], diff --git a/test/spec/features/copy-paste/CopyPasteSpec.js b/test/spec/features/copy-paste/CopyPasteSpec.js index 75b454bac..35802c711 100644 --- a/test/spec/features/copy-paste/CopyPasteSpec.js +++ b/test/spec/features/copy-paste/CopyPasteSpec.js @@ -1,9 +1,3 @@ -import { - bootstrapDiagram, - getDiagramJS, - inject -} from 'test/TestHelper'; - import { filter, isArray, @@ -12,19 +6,25 @@ import { some } from 'min-dash'; -import attachSupportModule from 'lib/features/attach-support'; -import copyPasteModule from 'lib/features/copy-paste'; -import modelingModule from 'lib/features/modeling'; -import rulesModule from './rules'; -import selectionModule from 'lib/features/selection'; +import { + bootstrapDiagram, + getDiagramJS, + inject +} from 'test/TestHelper.js'; + +import attachSupportModule from 'lib/features/attach-support/index.js'; +import copyPasteModule from 'lib/features/copy-paste/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import rulesModule from './rules/index.js'; +import selectionModule from 'lib/features/selection/index.js'; import { isConnection, isLabel -} from '../../../../lib/util/ModelUtil'; +} from '../../../../lib/util/ModelUtil.js'; /** - * @typedef {import('../../../../lib/model/Types').Element} Element + * @typedef {import('../../../../lib/model/Types.js').Element} Element */ var HIGH_PRIORITY = 2000; diff --git a/test/spec/features/copy-paste/rules/CopyPasteRules.js b/test/spec/features/copy-paste/rules/CopyPasteRules.js index 2c8c85565..082791b19 100644 --- a/test/spec/features/copy-paste/rules/CopyPasteRules.js +++ b/test/spec/features/copy-paste/rules/CopyPasteRules.js @@ -1,6 +1,6 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; export default function CopyPasteRules(eventBus) { diff --git a/test/spec/features/copy-paste/rules/index.js b/test/spec/features/copy-paste/rules/index.js index f806ab4a2..dad7d0d1d 100644 --- a/test/spec/features/copy-paste/rules/index.js +++ b/test/spec/features/copy-paste/rules/index.js @@ -1,4 +1,4 @@ -import CopyPasteRules from './CopyPasteRules'; +import CopyPasteRules from './CopyPasteRules.js'; export default { __init__: [ 'copyPasteRules' ], diff --git a/test/spec/features/create/CreatePreviewSpec.js b/test/spec/features/create/CreatePreviewSpec.js index dee897952..15547480e 100644 --- a/test/spec/features/create/CreatePreviewSpec.js +++ b/test/spec/features/create/CreatePreviewSpec.js @@ -1,22 +1,23 @@ +import { queryAll as domQueryAll } from 'min-dom'; + +import { attr as svgAttr } from 'tiny-svg'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; +} from '../../../util/MockEvents.js'; -import modelingModule from 'lib/features/modeling'; -import moveModule from 'lib/features/move'; -import dragModule from 'lib/features/dragging'; -import createModule from 'lib/features/create'; -import attachSupportModule from 'lib/features/attach-support'; -import rulesModule from './rules'; +import modelingModule from 'lib/features/modeling/index.js'; +import moveModule from 'lib/features/move/index.js'; +import dragModule from 'lib/features/dragging/index.js'; +import createModule from 'lib/features/create/index.js'; +import attachSupportModule from 'lib/features/attach-support/index.js'; +import rulesModule from './rules/index.js'; -import { queryAll as domQueryAll } from 'min-dom'; - -import { attr as svgAttr } from 'tiny-svg'; var testModules = [ createModule, diff --git a/test/spec/features/create/CreateSpec.js b/test/spec/features/create/CreateSpec.js index 8adba2f23..2a2d24ed2 100644 --- a/test/spec/features/create/CreateSpec.js +++ b/test/spec/features/create/CreateSpec.js @@ -1,25 +1,26 @@ +import { + classes as svgClasses +} from 'tiny-svg'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; +} from '../../../util/MockEvents.js'; -import modelingModule from 'lib/features/modeling'; -import moveModule from 'lib/features/move'; -import dragModule from 'lib/features/dragging'; -import createModule from 'lib/features/create'; -import attachSupportModule from 'lib/features/attach-support'; -import connectionPreviewModule from 'lib/features/connection-preview'; -import rulesModule from './rules'; +import modelingModule from 'lib/features/modeling/index.js'; +import moveModule from 'lib/features/move/index.js'; +import dragModule from 'lib/features/dragging/index.js'; +import createModule from 'lib/features/create/index.js'; +import attachSupportModule from 'lib/features/attach-support/index.js'; +import connectionPreviewModule from 'lib/features/connection-preview/index.js'; +import rulesModule from './rules/index.js'; -import { - classes as svgClasses -} from 'tiny-svg'; +import { getMid } from 'lib/layout/LayoutUtil.js'; -import { getMid } from 'lib/layout/LayoutUtil'; var testModules = [ createModule, diff --git a/test/spec/features/create/rules/CreateRules.js b/test/spec/features/create/rules/CreateRules.js index 85c98de8c..26926705c 100755 --- a/test/spec/features/create/rules/CreateRules.js +++ b/test/spec/features/create/rules/CreateRules.js @@ -1,6 +1,6 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; export default function CreateRules(injector) { injector.invoke(RuleProvider, this); diff --git a/test/spec/features/create/rules/index.js b/test/spec/features/create/rules/index.js index b7c42f511..e796caf8a 100755 --- a/test/spec/features/create/rules/index.js +++ b/test/spec/features/create/rules/index.js @@ -1,4 +1,4 @@ -import CreateRules from './CreateRules'; +import CreateRules from './CreateRules.js'; export default { __init__: [ 'createRules' ], diff --git a/test/spec/features/distribute-elements/DistributeElementsSpec.js b/test/spec/features/distribute-elements/DistributeElementsSpec.js index 99166ad2c..fcf41f238 100644 --- a/test/spec/features/distribute-elements/DistributeElementsSpec.js +++ b/test/spec/features/distribute-elements/DistributeElementsSpec.js @@ -1,13 +1,13 @@ +import { forEach, sortBy } from 'min-dash'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; - -import { forEach, sortBy } from 'min-dash'; +} from 'test/TestHelper.js'; -import distributeElementsModule from 'lib/features/distribute-elements'; -import modelingModule from 'lib/features/modeling'; -import testRules from './rules'; +import distributeElementsModule from 'lib/features/distribute-elements/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import testRules from './rules/index.js'; function expectRanges(rangeGroups, expectedRanges) { diff --git a/test/spec/features/distribute-elements/rules/TestRules.js b/test/spec/features/distribute-elements/rules/TestRules.js index e1b6cd668..85c652636 100755 --- a/test/spec/features/distribute-elements/rules/TestRules.js +++ b/test/spec/features/distribute-elements/rules/TestRules.js @@ -1,6 +1,6 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; export default function TestRules(eventBus) { RuleProvider.call(this, eventBus); diff --git a/test/spec/features/distribute-elements/rules/index.js b/test/spec/features/distribute-elements/rules/index.js index eb8ffc77c..4dc6c034e 100755 --- a/test/spec/features/distribute-elements/rules/index.js +++ b/test/spec/features/distribute-elements/rules/index.js @@ -1,4 +1,4 @@ -import TestRules from './TestRules'; +import TestRules from './TestRules.js'; export default { __init__: [ 'testRules' ], diff --git a/test/spec/features/dragging/DraggingSpec.js b/test/spec/features/dragging/DraggingSpec.js index b704b21b4..613b57774 100644 --- a/test/spec/features/dragging/DraggingSpec.js +++ b/test/spec/features/dragging/DraggingSpec.js @@ -1,20 +1,20 @@ +import { assign } from 'min-dash'; + +import { classes as svgClasses } from 'tiny-svg'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents'; +import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents.js'; -import { assign } from 'min-dash'; - -import dragModule from 'lib/features/dragging'; -import zoomScrollModule from 'lib/navigation/zoomscroll'; -import createModule from 'lib/features/create'; -import modelingModule from 'lib/features/modeling'; +import dragModule from 'lib/features/dragging/index.js'; +import zoomScrollModule from 'lib/navigation/zoomscroll/index.js'; +import createModule from 'lib/features/create/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; -import { createKeyEvent } from 'test/util/KeyEvents'; - -import { classes as svgClasses } from 'tiny-svg'; +import { createKeyEvent } from 'test/util/KeyEvents.js'; describe('features/dragging - Dragging', function() { diff --git a/test/spec/features/editor-actions/EditorActionsSpec.js b/test/spec/features/editor-actions/EditorActionsSpec.js index ab51abbb3..f7721bfca 100644 --- a/test/spec/features/editor-actions/EditorActionsSpec.js +++ b/test/spec/features/editor-actions/EditorActionsSpec.js @@ -1,15 +1,15 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; - -import editorActionsModule from 'lib/features/editor-actions'; -import copyPasteModule from 'lib/features/copy-paste'; -import selectionModule from 'lib/features/selection'; -import keyboardMoveModule from 'lib/navigation/keyboard-move'; -import keyboardMoveSelectionModule from 'lib/features/keyboard-move-selection'; -import modelingModule from 'lib/features/modeling'; -import customRulesModule from './rules'; +} from 'test/TestHelper.js'; + +import editorActionsModule from 'lib/features/editor-actions/index.js'; +import copyPasteModule from 'lib/features/copy-paste/index.js'; +import selectionModule from 'lib/features/selection/index.js'; +import keyboardMoveModule from 'lib/navigation/keyboard-move/index.js'; +import keyboardMoveSelectionModule from 'lib/features/keyboard-move-selection/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import customRulesModule from './rules/index.js'; describe('features/editor-actions', function() { diff --git a/test/spec/features/editor-actions/rules/CustomRules.js b/test/spec/features/editor-actions/rules/CustomRules.js index b0563573c..254f6a098 100644 --- a/test/spec/features/editor-actions/rules/CustomRules.js +++ b/test/spec/features/editor-actions/rules/CustomRules.js @@ -1,6 +1,6 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; export default function CustomRules(eventBus) { RuleProvider.call(this, eventBus); diff --git a/test/spec/features/editor-actions/rules/index.js b/test/spec/features/editor-actions/rules/index.js index 69cbc264a..023c95328 100644 --- a/test/spec/features/editor-actions/rules/index.js +++ b/test/spec/features/editor-actions/rules/index.js @@ -1,4 +1,4 @@ -import CustomRules from './CustomRules'; +import CustomRules from './CustomRules.js'; export default { __init__: [ 'customRules' ], diff --git a/test/spec/features/global-connect/GlobalConnectSpec.js b/test/spec/features/global-connect/GlobalConnectSpec.js index 037299d4c..3e9b9f05f 100644 --- a/test/spec/features/global-connect/GlobalConnectSpec.js +++ b/test/spec/features/global-connect/GlobalConnectSpec.js @@ -1,13 +1,13 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents'; +import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents.js'; -import modelingModule from 'lib/features/modeling'; -import globalConnectModule from 'lib/features/global-connect'; -import rulesModule from './rules'; +import modelingModule from 'lib/features/modeling/index.js'; +import globalConnectModule from 'lib/features/global-connect/index.js'; +import rulesModule from './rules/index.js'; describe('features/global-connect-tool', function() { diff --git a/test/spec/features/global-connect/rules/GlobalConnectRules.js b/test/spec/features/global-connect/rules/GlobalConnectRules.js index d5da89247..b392d6c86 100644 --- a/test/spec/features/global-connect/rules/GlobalConnectRules.js +++ b/test/spec/features/global-connect/rules/GlobalConnectRules.js @@ -1,6 +1,6 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; export default function GlobalConnectRules(eventBus) { RuleProvider.call(this, eventBus); diff --git a/test/spec/features/global-connect/rules/index.js b/test/spec/features/global-connect/rules/index.js index 24fbe7dcd..bf3bb7a91 100755 --- a/test/spec/features/global-connect/rules/index.js +++ b/test/spec/features/global-connect/rules/index.js @@ -1,4 +1,4 @@ -import GlobalConnectRules from './GlobalConnectRules'; +import GlobalConnectRules from './GlobalConnectRules.js'; export default { __init__: [ 'globalConnectRules' ], diff --git a/test/spec/features/grid-snapping/GridSnappingSpec.js b/test/spec/features/grid-snapping/GridSnappingSpec.js index 1e4400005..6b31bb0de 100644 --- a/test/spec/features/grid-snapping/GridSnappingSpec.js +++ b/test/spec/features/grid-snapping/GridSnappingSpec.js @@ -2,21 +2,21 @@ import { bootstrapDiagram, getDiagramJS, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; -import gridSnappingModule from 'lib/features/grid-snapping'; -import bendpointsModule from 'lib/features/bendpoints'; -import connectModule from 'lib/features/connect'; -import createModule from 'lib/features/create'; -import moveModule from 'lib/features/move'; -import resizeModule from 'lib/features/resize'; +import modelingModule from 'lib/features/modeling/index.js'; +import gridSnappingModule from 'lib/features/grid-snapping/index.js'; +import bendpointsModule from 'lib/features/bendpoints/index.js'; +import connectModule from 'lib/features/connect/index.js'; +import createModule from 'lib/features/create/index.js'; +import moveModule from 'lib/features/move/index.js'; +import resizeModule from 'lib/features/resize/index.js'; -import CroppingConnectionDocking from 'lib/layout/CroppingConnectionDocking'; +import CroppingConnectionDocking from 'lib/layout/CroppingConnectionDocking.js'; -import { asTRBL } from 'lib/layout/LayoutUtil'; +import { asTRBL } from 'lib/layout/LayoutUtil.js'; -import { SPACING } from 'lib/features/grid-snapping/GridUtil'; +import { SPACING } from 'lib/features/grid-snapping/GridUtil.js'; var layoutModule = { connectionDocking: [ 'type', CroppingConnectionDocking ] @@ -24,11 +24,11 @@ var layoutModule = { import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; +} from '../../../util/MockEvents.js'; import { isString } from 'min-dash'; -import { mid } from 'lib/features/snapping/SnapUtil'; +import { mid } from 'lib/features/snapping/SnapUtil.js'; var LOW_PRIORITY = 500; diff --git a/test/spec/features/grid-snapping/behavior/ResizeBehaviorSpec.js b/test/spec/features/grid-snapping/behavior/ResizeBehaviorSpec.js index 8e8807063..5d5a14233 100644 --- a/test/spec/features/grid-snapping/behavior/ResizeBehaviorSpec.js +++ b/test/spec/features/grid-snapping/behavior/ResizeBehaviorSpec.js @@ -1,17 +1,18 @@ +import inherits from 'inherits-browser'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import autoResizeModule from 'lib/features/auto-resize'; -import gridSnappingModule from 'lib/features/grid-snapping'; -import modelingModule from 'lib/features/modeling'; -import moveModule from 'lib/features/move'; +import autoResizeModule from 'lib/features/auto-resize/index.js'; +import gridSnappingModule from 'lib/features/grid-snapping/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import moveModule from 'lib/features/move/index.js'; -import AutoResizeProvider from 'lib/features/auto-resize/AutoResizeProvider'; -import AutoResize from 'lib/features/auto-resize/AutoResize'; +import AutoResizeProvider from 'lib/features/auto-resize/AutoResizeProvider.js'; +import AutoResize from 'lib/features/auto-resize/AutoResize.js'; -import inherits from 'inherits-browser'; /** * Custom auto-resize provider. diff --git a/test/spec/features/grid-snapping/behavior/SpaceToolBehaviorSpec.js b/test/spec/features/grid-snapping/behavior/SpaceToolBehaviorSpec.js index 26e3a1bed..176ce70f0 100644 --- a/test/spec/features/grid-snapping/behavior/SpaceToolBehaviorSpec.js +++ b/test/spec/features/grid-snapping/behavior/SpaceToolBehaviorSpec.js @@ -1,16 +1,16 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import gridSnappingModule from 'lib/features/grid-snapping'; -import modelingModule from 'lib/features/modeling'; -import moveModule from 'lib/features/move'; -import spaceToolModule from 'lib/features/space-tool'; +import gridSnappingModule from 'lib/features/grid-snapping/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import moveModule from 'lib/features/move/index.js'; +import spaceToolModule from 'lib/features/space-tool/index.js'; import { createCanvasEvent as canvasEvent -} from '../../../../util/MockEvents'; +} from '../../../../util/MockEvents.js'; var spy = sinon.spy; diff --git a/test/spec/features/hand-tool/HandToolSpec.js b/test/spec/features/hand-tool/HandToolSpec.js index 33ec7ce73..53fa7b1cc 100644 --- a/test/spec/features/hand-tool/HandToolSpec.js +++ b/test/spec/features/hand-tool/HandToolSpec.js @@ -1,22 +1,23 @@ +import { + assign +} from 'min-dash'; + import { bootstrapDiagram, getDiagramJS, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents'; +import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents.js'; -import handToolModule from 'lib/features/hand-tool'; -import draggingModule from 'lib/features/dragging'; -import keyboardModule from 'lib/features/keyboard'; +import handToolModule from 'lib/features/hand-tool/index.js'; +import draggingModule from 'lib/features/dragging/index.js'; +import keyboardModule from 'lib/features/keyboard/index.js'; -import { createKeyEvent } from 'test/util/KeyEvents'; +import { createKeyEvent } from 'test/util/KeyEvents.js'; -import { - assign -} from 'min-dash'; +import { isMac } from 'lib/util/Platform.js'; -import { isMac } from 'lib/util/Platform'; var keyModifier = isMac() ? { metaKey: true } : { ctrlKey: true }; diff --git a/test/spec/features/hover-fix/HoverFixSpec.js b/test/spec/features/hover-fix/HoverFixSpec.js index 96c49cb2e..09d9ba8bb 100644 --- a/test/spec/features/hover-fix/HoverFixSpec.js +++ b/test/spec/features/hover-fix/HoverFixSpec.js @@ -1,14 +1,14 @@ +import { assign } from 'min-dash'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; - -import { assign } from 'min-dash'; +} from 'test/TestHelper.js'; -import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents'; +import { createCanvasEvent as canvasEvent } from '../../../util/MockEvents.js'; -import dragModule from 'lib/features/dragging'; -import hoverFixModule from 'lib/features/hover-fix'; +import dragModule from 'lib/features/dragging/index.js'; +import hoverFixModule from 'lib/features/hover-fix/index.js'; describe('features/hover-fix', function() { diff --git a/test/spec/features/interaction-events/InteractionEventsSpec.js b/test/spec/features/interaction-events/InteractionEventsSpec.js index 4c1de7a5d..d4a2a55a3 100755 --- a/test/spec/features/interaction-events/InteractionEventsSpec.js +++ b/test/spec/features/interaction-events/InteractionEventsSpec.js @@ -1,10 +1,3 @@ -import { - bootstrapDiagram, - inject -} from 'test/TestHelper'; - -import interactionEventsModule from 'lib/features/interaction-events'; - import { queryAll as domQueryAll } from 'min-dom'; @@ -13,6 +6,13 @@ import { filter } from 'min-dash'; +import { + bootstrapDiagram, + inject +} from 'test/TestHelper.js'; + +import interactionEventsModule from 'lib/features/interaction-events/index.js'; + var bindings = { mouseover: 'element.hover', diff --git a/test/spec/features/keyboard-move-selection/KeyboardMoveSelectionSpec.js b/test/spec/features/keyboard-move-selection/KeyboardMoveSelectionSpec.js index 931f717a5..a3199af4b 100644 --- a/test/spec/features/keyboard-move-selection/KeyboardMoveSelectionSpec.js +++ b/test/spec/features/keyboard-move-selection/KeyboardMoveSelectionSpec.js @@ -1,17 +1,17 @@ +import { forEach } from 'min-dash'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; - -import { forEach } from 'min-dash'; +} from 'test/TestHelper.js'; -import keyboardMoveSelectionModule from 'lib/features/keyboard-move-selection'; -import modelingModule from 'lib/features/modeling'; -import rulesModule from './rules'; +import keyboardMoveSelectionModule from 'lib/features/keyboard-move-selection/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import rulesModule from './rules/index.js'; -import { getMid } from 'lib/layout/LayoutUtil'; +import { getMid } from 'lib/layout/LayoutUtil.js'; -import { createKeyEvent } from 'test/util/KeyEvents'; +import { createKeyEvent } from 'test/util/KeyEvents.js'; var KEYS = { ArrowUp: 'up', diff --git a/test/spec/features/keyboard-move-selection/rules/KeyboardMoveRules.js b/test/spec/features/keyboard-move-selection/rules/KeyboardMoveRules.js index e1b02d9b0..4643d62eb 100644 --- a/test/spec/features/keyboard-move-selection/rules/KeyboardMoveRules.js +++ b/test/spec/features/keyboard-move-selection/rules/KeyboardMoveRules.js @@ -1,8 +1,9 @@ +import { find } from 'min-dash'; + import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; -import { find } from 'min-dash'; export default function CreateRules(injector) { injector.invoke(RuleProvider, this); diff --git a/test/spec/features/keyboard-move-selection/rules/index.js b/test/spec/features/keyboard-move-selection/rules/index.js index fed7bfabc..bb883fccd 100644 --- a/test/spec/features/keyboard-move-selection/rules/index.js +++ b/test/spec/features/keyboard-move-selection/rules/index.js @@ -1,4 +1,4 @@ -import KeyboardMoveRules from './KeyboardMoveRules'; +import KeyboardMoveRules from './KeyboardMoveRules.js'; export default { __init__: [ 'keyboardMoveRules' ], diff --git a/test/spec/features/keyboard/CopySpec.js b/test/spec/features/keyboard/CopySpec.js index ac2b4f713..02def3f9c 100644 --- a/test/spec/features/keyboard/CopySpec.js +++ b/test/spec/features/keyboard/CopySpec.js @@ -1,22 +1,22 @@ +import { + forEach +} from 'min-dash'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import { - forEach -} from 'min-dash'; +import copyPasteModule from 'lib/features/copy-paste/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import keyboardModule from 'lib/features/keyboard/index.js'; +import editorActionsModule from 'lib/features/editor-actions/index.js'; -import copyPasteModule from 'lib/features/copy-paste'; -import modelingModule from 'lib/features/modeling'; -import keyboardModule from 'lib/features/keyboard'; -import editorActionsModule from 'lib/features/editor-actions'; +import { createKeyEvent } from 'test/util/KeyEvents.js'; -import { createKeyEvent } from 'test/util/KeyEvents'; var KEYS_COPY = [ 'c', 'C' ]; - describe('features/keyboard - copy', function() { var defaultDiagramConfig = { diff --git a/test/spec/features/keyboard/KeyboardSpec.js b/test/spec/features/keyboard/KeyboardSpec.js index 1368de6e4..ecd95dda3 100755 --- a/test/spec/features/keyboard/KeyboardSpec.js +++ b/test/spec/features/keyboard/KeyboardSpec.js @@ -1,5 +1,3 @@ -import TestContainer from 'mocha-test-container-support'; - import { assign } from 'min-dash'; @@ -8,15 +6,17 @@ import { domify } from 'min-dom'; -import modelingModule from 'lib/features/modeling'; -import keyboardModule from 'lib/features/keyboard'; +import TestContainer from 'mocha-test-container-support'; + +import modelingModule from 'lib/features/modeling/index.js'; +import keyboardModule from 'lib/features/keyboard/index.js'; import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import { createKeyEvent } from 'test/util/KeyEvents'; +import { createKeyEvent } from 'test/util/KeyEvents.js'; describe('features/keyboard', function() { diff --git a/test/spec/features/keyboard/PasteSpec.js b/test/spec/features/keyboard/PasteSpec.js index 5e98ff0be..6bb25a3be 100644 --- a/test/spec/features/keyboard/PasteSpec.js +++ b/test/spec/features/keyboard/PasteSpec.js @@ -1,18 +1,18 @@ -import { - bootstrapDiagram, - inject -} from 'test/TestHelper'; - import { forEach } from 'min-dash'; -import copyPasteModule from 'lib/features/copy-paste'; -import modelingModule from 'lib/features/modeling'; -import keyboardModule from 'lib/features/keyboard'; -import editorActionsModule from 'lib/features/editor-actions'; +import { + bootstrapDiagram, + inject +} from 'test/TestHelper.js'; + +import copyPasteModule from 'lib/features/copy-paste/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import keyboardModule from 'lib/features/keyboard/index.js'; +import editorActionsModule from 'lib/features/editor-actions/index.js'; -import { createKeyEvent } from 'test/util/KeyEvents'; +import { createKeyEvent } from 'test/util/KeyEvents.js'; var KEYS_PASTE = [ 'v', 'V' ]; diff --git a/test/spec/features/keyboard/RedoSpec.js b/test/spec/features/keyboard/RedoSpec.js index e54da0d44..2d4841997 100644 --- a/test/spec/features/keyboard/RedoSpec.js +++ b/test/spec/features/keyboard/RedoSpec.js @@ -1,17 +1,17 @@ -import { - bootstrapDiagram, - inject -} from 'test/TestHelper'; - import { forEach } from 'min-dash'; -import modelingModule from 'lib/features/modeling'; -import editorActionsModule from 'lib/features/editor-actions'; -import keyboardModule from 'lib/features/keyboard'; +import { + bootstrapDiagram, + inject +} from 'test/TestHelper.js'; + +import modelingModule from 'lib/features/modeling/index.js'; +import editorActionsModule from 'lib/features/editor-actions/index.js'; +import keyboardModule from 'lib/features/keyboard/index.js'; -import { createKeyEvent } from 'test/util/KeyEvents'; +import { createKeyEvent } from 'test/util/KeyEvents.js'; var KEYS_REDO = [ 'y', 'Y' ]; var KEYS_UNDO = [ 'z', 'Z' ]; diff --git a/test/spec/features/keyboard/RemoveSelectionSpec.js b/test/spec/features/keyboard/RemoveSelectionSpec.js index f144755f7..0bffab4af 100644 --- a/test/spec/features/keyboard/RemoveSelectionSpec.js +++ b/test/spec/features/keyboard/RemoveSelectionSpec.js @@ -1,17 +1,18 @@ +import { + forEach +} from 'min-dash'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import { - forEach -} from 'min-dash'; +import modelingModule from 'lib/features/modeling/index.js'; +import editorActionsModule from 'lib/features/editor-actions/index.js'; +import keyboardModule from 'lib/features/keyboard/index.js'; -import modelingModule from 'lib/features/modeling'; -import editorActionsModule from 'lib/features/editor-actions'; -import keyboardModule from 'lib/features/keyboard'; +import { createKeyEvent } from 'test/util/KeyEvents.js'; -import { createKeyEvent } from 'test/util/KeyEvents'; var KEYS = [ 'Backspace', @@ -19,7 +20,6 @@ var KEYS = [ 'Del' ]; - describe('features/keyboard - remove selection', function() { var defaultDiagramConfig = { diff --git a/test/spec/features/keyboard/UndoSpec.js b/test/spec/features/keyboard/UndoSpec.js index b21de0690..04b78b61b 100644 --- a/test/spec/features/keyboard/UndoSpec.js +++ b/test/spec/features/keyboard/UndoSpec.js @@ -1,21 +1,21 @@ +import { + forEach +} from 'min-dash'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import { - forEach -} from 'min-dash'; +import modelingModule from 'lib/features/modeling/index.js'; +import editorActionsModule from 'lib/features/editor-actions/index.js'; +import keyboardModule from 'lib/features/keyboard/index.js'; -import modelingModule from 'lib/features/modeling'; -import editorActionsModule from 'lib/features/editor-actions'; -import keyboardModule from 'lib/features/keyboard'; +import { createKeyEvent } from 'test/util/KeyEvents.js'; -import { createKeyEvent } from 'test/util/KeyEvents'; var KEYS_UNDO = [ 'z', 'Z' ]; - describe('features/keyboard - undo', function() { var defaultDiagramConfig = { diff --git a/test/spec/features/keyboard/ZoomSpec.js b/test/spec/features/keyboard/ZoomSpec.js index 30951f57b..241f04ca8 100644 --- a/test/spec/features/keyboard/ZoomSpec.js +++ b/test/spec/features/keyboard/ZoomSpec.js @@ -1,17 +1,18 @@ +import { + forEach +} from 'min-dash'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import { - forEach -} from 'min-dash'; +import editorActionsModule from 'lib/features/editor-actions/index.js'; +import zoomScrollModule from 'lib/navigation/zoomscroll/index.js'; +import keyboardModule from 'lib/features/keyboard/index.js'; -import editorActionsModule from 'lib/features/editor-actions'; -import zoomScrollModule from 'lib/navigation/zoomscroll'; -import keyboardModule from 'lib/features/keyboard'; +import { createKeyEvent } from 'test/util/KeyEvents.js'; -import { createKeyEvent } from 'test/util/KeyEvents'; var KEYS = { ZOOM_IN: [ '+', 'Add', '=' ], diff --git a/test/spec/features/label-support/LabelSupportSpec.js b/test/spec/features/label-support/LabelSupportSpec.js index dfed5ccef..5592cb962 100644 --- a/test/spec/features/label-support/LabelSupportSpec.js +++ b/test/spec/features/label-support/LabelSupportSpec.js @@ -1,21 +1,21 @@ +import { + classes as svgClasses +} from 'tiny-svg'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; +} from '../../../util/MockEvents.js'; -import labelSupportModule from 'lib/features/label-support'; -import moveModule from 'lib/features/move'; -import modelingModule from 'lib/features/modeling'; -import rulesModule from './rules'; -import spaceToolModule from 'lib/features/space-tool'; - -import { - classes as svgClasses -} from 'tiny-svg'; +import labelSupportModule from 'lib/features/label-support/index.js'; +import moveModule from 'lib/features/move/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import rulesModule from './rules/index.js'; +import spaceToolModule from 'lib/features/space-tool/index.js'; describe('features/label-support', function() { diff --git a/test/spec/features/label-support/rules/LabelSupportRules.js b/test/spec/features/label-support/rules/LabelSupportRules.js index 9ba54fca5..8ba63bbaf 100755 --- a/test/spec/features/label-support/rules/LabelSupportRules.js +++ b/test/spec/features/label-support/rules/LabelSupportRules.js @@ -1,6 +1,7 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; + export default function LabelSupportRules(eventBus) { RuleProvider.call(this, eventBus); diff --git a/test/spec/features/label-support/rules/index.js b/test/spec/features/label-support/rules/index.js index 1ebbebc06..7d3b2b949 100755 --- a/test/spec/features/label-support/rules/index.js +++ b/test/spec/features/label-support/rules/index.js @@ -1,4 +1,4 @@ -import LabelSupportRules from './LabelSupportRules'; +import LabelSupportRules from './LabelSupportRules.js'; export default { __init__: [ 'labelSupportRules' ], diff --git a/test/spec/features/lasso-tool/LassoToolSpec.js b/test/spec/features/lasso-tool/LassoToolSpec.js index 184991d4e..03f918bd2 100755 --- a/test/spec/features/lasso-tool/LassoToolSpec.js +++ b/test/spec/features/lasso-tool/LassoToolSpec.js @@ -1,20 +1,20 @@ +import { + assign +} from 'min-dash'; + import { bootstrapDiagram, getDiagramJS, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; - -import { - assign -} from 'min-dash'; +} from '../../../util/MockEvents.js'; -import modelingModule from 'lib/features/modeling'; -import lassoToolModule from 'lib/features/lasso-tool'; -import draggingModule from 'lib/features/dragging'; +import modelingModule from 'lib/features/modeling/index.js'; +import lassoToolModule from 'lib/features/lasso-tool/index.js'; +import draggingModule from 'lib/features/dragging/index.js'; describe('features/lasso-tool', function() { diff --git a/test/spec/features/modeling/AppendShapeSpec.js b/test/spec/features/modeling/AppendShapeSpec.js index cc8550a20..531c0d472 100644 --- a/test/spec/features/modeling/AppendShapeSpec.js +++ b/test/spec/features/modeling/AppendShapeSpec.js @@ -1,17 +1,16 @@ -import { - bootstrapDiagram, - inject -} from 'test/TestHelper'; - import { find } from 'min-dash'; -import modelingModule from 'lib/features/modeling'; +import { + bootstrapDiagram, + inject +} from 'test/TestHelper.js'; +import modelingModule from 'lib/features/modeling/index.js'; -describe('features/modeling - append shape', function() { +describe('features/modeling - append shape', function() { beforeEach(bootstrapDiagram({ modules: [ modelingModule ] })); diff --git a/test/spec/features/modeling/CreateConnectionSpec.js b/test/spec/features/modeling/CreateConnectionSpec.js index f8fc4cb75..9d04b3a67 100644 --- a/test/spec/features/modeling/CreateConnectionSpec.js +++ b/test/spec/features/modeling/CreateConnectionSpec.js @@ -1,9 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; describe('features/modeling - create connection', function() { diff --git a/test/spec/features/modeling/CreateElementsSpec.js b/test/spec/features/modeling/CreateElementsSpec.js index ae91c567f..f4cf6e756 100644 --- a/test/spec/features/modeling/CreateElementsSpec.js +++ b/test/spec/features/modeling/CreateElementsSpec.js @@ -1,16 +1,16 @@ +import { forEach } from 'min-dash'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import autoResizeModule from 'lib/features/auto-resize'; -import modelingModule from 'lib/features/modeling'; +import autoResizeModule from 'lib/features/auto-resize/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; -import { getBBox } from 'lib/util/Elements'; +import { getBBox } from 'lib/util/Elements.js'; -import { getMid } from '../../../../lib/layout/LayoutUtil'; - -import { forEach } from 'min-dash'; +import { getMid } from '../../../../lib/layout/LayoutUtil.js'; describe('features/modeling - create elements', function() { diff --git a/test/spec/features/modeling/CreateLabelSpec.js b/test/spec/features/modeling/CreateLabelSpec.js index 9faad59ed..5cb33f6b1 100755 --- a/test/spec/features/modeling/CreateLabelSpec.js +++ b/test/spec/features/modeling/CreateLabelSpec.js @@ -1,9 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; describe('features/modeling - create label', function() { diff --git a/test/spec/features/modeling/CreateShapeSpec.js b/test/spec/features/modeling/CreateShapeSpec.js index f0b1c52c1..3d3a55f09 100644 --- a/test/spec/features/modeling/CreateShapeSpec.js +++ b/test/spec/features/modeling/CreateShapeSpec.js @@ -1,9 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; describe('features/modeling - create shape', function() { diff --git a/test/spec/features/modeling/DeleteConnectionSpec.js b/test/spec/features/modeling/DeleteConnectionSpec.js index 81f10644f..d8c507835 100755 --- a/test/spec/features/modeling/DeleteConnectionSpec.js +++ b/test/spec/features/modeling/DeleteConnectionSpec.js @@ -1,9 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; describe('features/modeling - remove connection', function() { diff --git a/test/spec/features/modeling/DeleteElementsSpec.js b/test/spec/features/modeling/DeleteElementsSpec.js index a1dbab479..88281b291 100755 --- a/test/spec/features/modeling/DeleteElementsSpec.js +++ b/test/spec/features/modeling/DeleteElementsSpec.js @@ -1,9 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; describe('features/modeling - #removeElements', function() { diff --git a/test/spec/features/modeling/DeleteShapeSpec.js b/test/spec/features/modeling/DeleteShapeSpec.js index 47fb37c8a..db530f568 100755 --- a/test/spec/features/modeling/DeleteShapeSpec.js +++ b/test/spec/features/modeling/DeleteShapeSpec.js @@ -1,11 +1,11 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; -import contextPadModule from 'lib/features/context-pad'; -import selectionModule from 'lib/features/selection'; +import modelingModule from 'lib/features/modeling/index.js'; +import contextPadModule from 'lib/features/context-pad/index.js'; +import selectionModule from 'lib/features/selection/index.js'; describe('features/modeling - #removeShape', function() { diff --git a/test/spec/features/modeling/DropShapeSpec.js b/test/spec/features/modeling/DropShapeSpec.js index a8405c786..fc55bf382 100755 --- a/test/spec/features/modeling/DropShapeSpec.js +++ b/test/spec/features/modeling/DropShapeSpec.js @@ -1,9 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; describe('features/modeling - move shape - drop', function() { diff --git a/test/spec/features/modeling/LayoutConnectionSpec.js b/test/spec/features/modeling/LayoutConnectionSpec.js index 4666caab7..4166a9896 100755 --- a/test/spec/features/modeling/LayoutConnectionSpec.js +++ b/test/spec/features/modeling/LayoutConnectionSpec.js @@ -1,12 +1,12 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import customModelingModule from './custom'; +import customModelingModule from './custom/index.js'; -var spy = sinon.spy; +var spy = sinon.spy; describe('features/modeling - layout connection', function() { diff --git a/test/spec/features/modeling/MoveConnectionSpec.js b/test/spec/features/modeling/MoveConnectionSpec.js index 121b8beed..5abae12d1 100755 --- a/test/spec/features/modeling/MoveConnectionSpec.js +++ b/test/spec/features/modeling/MoveConnectionSpec.js @@ -1,9 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; describe('features/modeling - move connection', function() { diff --git a/test/spec/features/modeling/MoveElementsSpec.js b/test/spec/features/modeling/MoveElementsSpec.js index 5011e16de..180bec8f9 100644 --- a/test/spec/features/modeling/MoveElementsSpec.js +++ b/test/spec/features/modeling/MoveElementsSpec.js @@ -1,19 +1,19 @@ +import { + pick +} from 'min-dash'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import { - pick -} from 'min-dash'; +import modelingModule from 'lib/features/modeling/index.js'; -import modelingModule from 'lib/features/modeling'; function containment(element) { return pick(element, [ 'x', 'y', 'parent' ]); } - describe('features/modeling - move elements', function() { diff --git a/test/spec/features/modeling/MoveShapeSpec.js b/test/spec/features/modeling/MoveShapeSpec.js index 6d6f04f57..2bef32867 100755 --- a/test/spec/features/modeling/MoveShapeSpec.js +++ b/test/spec/features/modeling/MoveShapeSpec.js @@ -1,9 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; describe('features/modeling - move shape', function() { diff --git a/test/spec/features/modeling/ReconnectConnectionSpec.js b/test/spec/features/modeling/ReconnectConnectionSpec.js index 125f008bc..b4fe58883 100644 --- a/test/spec/features/modeling/ReconnectConnectionSpec.js +++ b/test/spec/features/modeling/ReconnectConnectionSpec.js @@ -1,9 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; describe('features/modeling - reconnect connection', function() { diff --git a/test/spec/features/modeling/ReplaceShapeSpec.js b/test/spec/features/modeling/ReplaceShapeSpec.js index d9baad8e3..3f71eb90d 100644 --- a/test/spec/features/modeling/ReplaceShapeSpec.js +++ b/test/spec/features/modeling/ReplaceShapeSpec.js @@ -1,9 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; describe('features/modeling - replace shape', function() { diff --git a/test/spec/features/modeling/ResizeShapeSpec.js b/test/spec/features/modeling/ResizeShapeSpec.js index 68a37a237..0f5bbeef3 100644 --- a/test/spec/features/modeling/ResizeShapeSpec.js +++ b/test/spec/features/modeling/ResizeShapeSpec.js @@ -1,39 +1,39 @@ -import { - bootstrapDiagram, - inject -} from 'test/TestHelper'; - import { pick } from 'min-dash'; +import { + bootstrapDiagram, + inject +} from 'test/TestHelper.js'; + import { resizeBounds -} from 'lib/features/resize/ResizeUtil'; +} from 'lib/features/resize/ResizeUtil.js'; import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; +} from '../../../util/MockEvents.js'; + +import { getBBox } from 'lib/util/Elements.js'; -import { getBBox } from 'lib/util/Elements'; +import modelingModule from 'lib/features/modeling/index.js'; +import resizeModule from 'lib/features/resize/index.js'; +import attachModule from 'lib/features/attach-support/index.js'; -import modelingModule from 'lib/features/modeling'; -import resizeModule from 'lib/features/resize'; -import attachModule from 'lib/features/attach-support'; +import CroppingConnectionDocking from 'lib/layout/CroppingConnectionDocking.js'; + +import { getNewAttachPoint } from 'lib/util/AttachUtil.js'; -import CroppingConnectionDocking from 'lib/layout/CroppingConnectionDocking'; var layoutModule = { connectionDocking: [ 'type', CroppingConnectionDocking ] }; -import { getNewAttachPoint } from 'lib/util/AttachUtil'; - function bounds(b) { return pick(b, [ 'x', 'y', 'width', 'height' ]); } - describe('features/modeling - resize shape', function() { beforeEach(bootstrapDiagram({ diff --git a/test/spec/features/modeling/ToggleShapeCollapseSpec.js b/test/spec/features/modeling/ToggleShapeCollapseSpec.js index 09a65a512..f221308b3 100644 --- a/test/spec/features/modeling/ToggleShapeCollapseSpec.js +++ b/test/spec/features/modeling/ToggleShapeCollapseSpec.js @@ -1,9 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; describe('features/modeling - toggle collapsed', function() { diff --git a/test/spec/features/modeling/UpdateAttachmentSpec.js b/test/spec/features/modeling/UpdateAttachmentSpec.js index 8a87c0a77..5d38ca1b4 100644 --- a/test/spec/features/modeling/UpdateAttachmentSpec.js +++ b/test/spec/features/modeling/UpdateAttachmentSpec.js @@ -1,9 +1,9 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; describe('features/modeling - attach shape', function() { diff --git a/test/spec/features/modeling/custom/CustomLayouter.js b/test/spec/features/modeling/custom/CustomLayouter.js index 6db90f472..d8fa7fcb5 100644 --- a/test/spec/features/modeling/custom/CustomLayouter.js +++ b/test/spec/features/modeling/custom/CustomLayouter.js @@ -1,7 +1,7 @@ -import { getMid } from 'lib/layout/LayoutUtil'; +import { getMid } from 'lib/layout/LayoutUtil.js'; /** - * @typedef {import('../../model').Connection} Connection + * @typedef {import('../../model/index.js').Connection} Connection */ /** diff --git a/test/spec/features/modeling/custom/index.js b/test/spec/features/modeling/custom/index.js index ded4e4b4a..912cb271b 100644 --- a/test/spec/features/modeling/custom/index.js +++ b/test/spec/features/modeling/custom/index.js @@ -1,10 +1,10 @@ -import CommandModule from 'lib/command'; -import ChangeSupportModule from 'lib/features/change-support'; -import SelectionModule from 'lib/features/selection'; -import RulesModule from 'lib/features/rules'; +import CommandModule from 'lib/command/index.js'; +import ChangeSupportModule from 'lib/features/change-support/index.js'; +import SelectionModule from 'lib/features/selection/index.js'; +import RulesModule from 'lib/features/rules/index.js'; -import Modeling from 'lib/features/modeling/Modeling'; -import CustomLayouter from './CustomLayouter'; +import Modeling from 'lib/features/modeling/Modeling.js'; +import CustomLayouter from './CustomLayouter.js'; export default { diff --git a/test/spec/features/mouse/MouseSpec.js b/test/spec/features/mouse/MouseSpec.js index 3df5d2282..1bc215d9b 100644 --- a/test/spec/features/mouse/MouseSpec.js +++ b/test/spec/features/mouse/MouseSpec.js @@ -1,11 +1,11 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import mouseModule from 'lib/features/mouse'; +import mouseModule from 'lib/features/mouse/index.js'; -import { createMoveEvent } from 'lib/features/mouse/Mouse'; +import { createMoveEvent } from 'lib/features/mouse/Mouse.js'; describe('features/mouse', function() { diff --git a/test/spec/features/move/MovePreviewSpec.js b/test/spec/features/move/MovePreviewSpec.js index d924b0860..d26437948 100644 --- a/test/spec/features/move/MovePreviewSpec.js +++ b/test/spec/features/move/MovePreviewSpec.js @@ -1,18 +1,3 @@ -import { - bootstrapDiagram, - inject -} from 'test/TestHelper'; - -import { - createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; - -import modelingModule from 'lib/features/modeling'; -import moveModule from 'lib/features/move'; -import attachSupportModule from 'lib/features/attach-support'; -import rulesModule from './rules'; -import rendererModule from '../preview-support/renderer'; - import { query as domQuery, queryAll as domQueryAll @@ -22,6 +7,21 @@ import { classes as svgClasses } from 'tiny-svg'; +import { + bootstrapDiagram, + inject +} from 'test/TestHelper.js'; + +import { + createCanvasEvent as canvasEvent +} from '../../../util/MockEvents.js'; + +import modelingModule from 'lib/features/modeling/index.js'; +import moveModule from 'lib/features/move/index.js'; +import attachSupportModule from 'lib/features/attach-support/index.js'; +import rulesModule from './rules/index.js'; +import rendererModule from '../preview-support/renderer/index.js'; + describe('features/move - MovePreview', function() { diff --git a/test/spec/features/move/MoveSpec.js b/test/spec/features/move/MoveSpec.js index a32d94e72..9e0440236 100644 --- a/test/spec/features/move/MoveSpec.js +++ b/test/spec/features/move/MoveSpec.js @@ -1,20 +1,20 @@ +import { + assign, + pick +} from 'min-dash'; + import { bootstrapDiagram, getDiagramJS, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; - -import { - assign, - pick -} from 'min-dash'; +} from '../../../util/MockEvents.js'; -import modelingModule from 'lib/features/modeling'; -import moveModule from 'lib/features/move'; +import modelingModule from 'lib/features/modeling/index.js'; +import moveModule from 'lib/features/move/index.js'; describe('features/move - Move', function() { diff --git a/test/spec/features/move/rules/MoveRules.js b/test/spec/features/move/rules/MoveRules.js index b55304a28..33ce5b532 100755 --- a/test/spec/features/move/rules/MoveRules.js +++ b/test/spec/features/move/rules/MoveRules.js @@ -1,10 +1,11 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; import { isFrameElement -} from 'lib/util/Elements'; +} from 'lib/util/Elements.js'; + export default function MoveRules(eventBus) { RuleProvider.call(this, eventBus); diff --git a/test/spec/features/move/rules/index.js b/test/spec/features/move/rules/index.js index 88f5814c1..62dc0e6a7 100755 --- a/test/spec/features/move/rules/index.js +++ b/test/spec/features/move/rules/index.js @@ -1,4 +1,4 @@ -import MoveRules from './MoveRules'; +import MoveRules from './MoveRules.js'; export default { __init__: [ 'moveRules' ], diff --git a/test/spec/features/ordering/OrderingProviderSpec.js b/test/spec/features/ordering/OrderingProviderSpec.js index 562e336ab..bccddcac7 100644 --- a/test/spec/features/ordering/OrderingProviderSpec.js +++ b/test/spec/features/ordering/OrderingProviderSpec.js @@ -1,11 +1,11 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; -import moveModule from 'lib/features/move'; -import orderingProviderModule from './provider'; +import modelingModule from 'lib/features/modeling/index.js'; +import moveModule from 'lib/features/move/index.js'; +import orderingProviderModule from './provider/index.js'; describe('features/ordering', function() { diff --git a/test/spec/features/ordering/provider/TestOrderingProvider.js b/test/spec/features/ordering/provider/TestOrderingProvider.js index 663c7cc17..8272cb201 100644 --- a/test/spec/features/ordering/provider/TestOrderingProvider.js +++ b/test/spec/features/ordering/provider/TestOrderingProvider.js @@ -1,11 +1,11 @@ import inherits from 'inherits-browser'; -import OrderingProvider from 'lib/features/ordering/OrderingProvider'; - import { findIndex } from 'min-dash'; +import OrderingProvider from 'lib/features/ordering/OrderingProvider.js'; + /** * a simple ordering provider that makes sure: diff --git a/test/spec/features/ordering/provider/index.js b/test/spec/features/ordering/provider/index.js index f0a05bce2..abac790ca 100644 --- a/test/spec/features/ordering/provider/index.js +++ b/test/spec/features/ordering/provider/index.js @@ -1,4 +1,4 @@ -import TestOrderingProvider from './TestOrderingProvider'; +import TestOrderingProvider from './TestOrderingProvider.js'; export default { __init__: [ 'testOrderingProvider' ], diff --git a/test/spec/features/outline/OutlineSpec.js b/test/spec/features/outline/OutlineSpec.js index 8ec3300ed..e91e42a5b 100755 --- a/test/spec/features/outline/OutlineSpec.js +++ b/test/spec/features/outline/OutlineSpec.js @@ -1,10 +1,3 @@ -import { - bootstrapDiagram, - inject -} from 'test/TestHelper'; - -import selectionModule from 'lib/features/selection'; - import { query as domQuery } from 'min-dom'; @@ -15,6 +8,13 @@ import { attr as svgAttr } from 'tiny-svg'; +import { + bootstrapDiagram, + inject +} from 'test/TestHelper.js'; + +import selectionModule from 'lib/features/selection/index.js'; + describe('features/outline/Outline', function() { diff --git a/test/spec/features/overlays/OverlaysIntegrationSpec.js b/test/spec/features/overlays/OverlaysIntegrationSpec.js index 45dc63928..2be6a2246 100755 --- a/test/spec/features/overlays/OverlaysIntegrationSpec.js +++ b/test/spec/features/overlays/OverlaysIntegrationSpec.js @@ -1,12 +1,3 @@ -import { - bootstrapDiagram, - inject -} from 'test/TestHelper'; - -import { - createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; - import { classes as domClasses, domify, @@ -15,15 +6,24 @@ import { import $ from 'jquery'; -import overlayModule from 'lib/features/overlays'; -import selectionModule from 'lib/features/selection'; -import modelingModule from 'lib/features/modeling'; -import resizeModule from 'lib/features/resize'; -import moveModule from 'lib/features/move'; +import { + bootstrapDiagram, + inject +} from 'test/TestHelper.js'; + +import { + createCanvasEvent as canvasEvent +} from '../../../util/MockEvents.js'; + +import overlayModule from 'lib/features/overlays/index.js'; +import selectionModule from 'lib/features/selection/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import resizeModule from 'lib/features/resize/index.js'; +import moveModule from 'lib/features/move/index.js'; import { resizeBounds -} from 'lib/features/resize/ResizeUtil'; +} from 'lib/features/resize/ResizeUtil.js'; describe('features/overlay - integration', function() { diff --git a/test/spec/features/overlays/OverlaysSpec.js b/test/spec/features/overlays/OverlaysSpec.js index 510e1f4ba..fed99c0b8 100644 --- a/test/spec/features/overlays/OverlaysSpec.js +++ b/test/spec/features/overlays/OverlaysSpec.js @@ -1,9 +1,3 @@ -import { - bootstrapDiagram, - getDiagramJS, - inject -} from 'test/TestHelper'; - import { forEach, assign @@ -14,7 +8,13 @@ import { assignStyle } from 'min-dom'; -import overlayModule from 'lib/features/overlays'; +import { + bootstrapDiagram, + getDiagramJS, + inject +} from 'test/TestHelper.js'; + +import overlayModule from 'lib/features/overlays/index.js'; describe('features/overlays', function() { diff --git a/test/spec/features/palette/PaletteSpec.js b/test/spec/features/palette/PaletteSpec.js index c989853b1..38c0139bc 100755 --- a/test/spec/features/palette/PaletteSpec.js +++ b/test/spec/features/palette/PaletteSpec.js @@ -1,15 +1,3 @@ -import { - bootstrapDiagram, - getDiagramJS, - inject -} from 'test/TestHelper'; - -import { - createEvent as globalEvent -} from '../../../util/MockEvents'; - -import paletteModule from 'lib/features/palette'; - import { query as domQuery, classes as domClasses @@ -19,6 +7,18 @@ import { assign } from 'min-dash'; +import { + bootstrapDiagram, + getDiagramJS, + inject +} from 'test/TestHelper.js'; + +import { + createEvent as globalEvent +} from '../../../util/MockEvents.js'; + +import paletteModule from 'lib/features/palette/index.js'; + describe('features/palette', function() { diff --git a/test/spec/features/popup-menu/PopupMenuComponentSpec.js b/test/spec/features/popup-menu/PopupMenuComponentSpec.js index 4a9cd0dde..694b4d2c5 100644 --- a/test/spec/features/popup-menu/PopupMenuComponentSpec.js +++ b/test/spec/features/popup-menu/PopupMenuComponentSpec.js @@ -1,13 +1,13 @@ -import PopupMenuComponent from 'lib/features/popup-menu/PopupMenuComponent'; +import PopupMenuComponent from 'lib/features/popup-menu/PopupMenuComponent.js'; import { html, render -} from 'lib/ui'; +} from 'lib/ui/index.js'; import { insertCSS -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { domify, diff --git a/test/spec/features/popup-menu/PopupMenuItemSpec.js b/test/spec/features/popup-menu/PopupMenuItemSpec.js index 052197bcf..afef34202 100644 --- a/test/spec/features/popup-menu/PopupMenuItemSpec.js +++ b/test/spec/features/popup-menu/PopupMenuItemSpec.js @@ -1,13 +1,14 @@ -import PopupMenuItem from 'lib/features/popup-menu/PopupMenuItem'; +import { + query as domQuery +} from 'min-dom'; + +import PopupMenuItem from 'lib/features/popup-menu/PopupMenuItem.js'; import { html, render -} from 'lib/ui'; +} from 'lib/ui/index.js'; -import { - query as domQuery -} from 'min-dom'; describe('features/popup-menu - ', function() { diff --git a/test/spec/features/popup-menu/PopupMenuListSpec.js b/test/spec/features/popup-menu/PopupMenuListSpec.js index c20262680..610d47b8c 100644 --- a/test/spec/features/popup-menu/PopupMenuListSpec.js +++ b/test/spec/features/popup-menu/PopupMenuListSpec.js @@ -1,13 +1,13 @@ -import PopupMenuList from 'lib/features/popup-menu/PopupMenuList'; +import { + query as domQuery +} from 'min-dom'; + +import PopupMenuList from 'lib/features/popup-menu/PopupMenuList.js'; import { html, render -} from 'lib/ui'; - -import { - query as domQuery -} from 'min-dom'; +} from 'lib/ui/index.js'; describe('features/popup-menu - ', function() { diff --git a/test/spec/features/popup-menu/PopupMenuSpec.js b/test/spec/features/popup-menu/PopupMenuSpec.js index 1a5e66004..eb6294e11 100755 --- a/test/spec/features/popup-menu/PopupMenuSpec.js +++ b/test/spec/features/popup-menu/PopupMenuSpec.js @@ -1,13 +1,3 @@ -import { waitFor as originalWaitFor } from '@testing-library/preact'; - -import { - bootstrapDiagram, - getDiagramJS, - inject -} from 'test/TestHelper'; - -import testImage from './resources/a.png'; - import { assign, isFunction @@ -19,12 +9,23 @@ import { classes as domClasses } from 'min-dom'; -import { createEvent as globalEvent } from '../../../util/MockEvents'; +import { waitFor as originalWaitFor } from '@testing-library/preact'; + +import { + bootstrapDiagram, + getDiagramJS, + inject +} from 'test/TestHelper.js'; + +import testImage from './resources/a.png'; + +import { createEvent as globalEvent } from '../../../util/MockEvents.js'; + +import popupMenuModule from 'lib/features/popup-menu/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; -import popupMenuModule from 'lib/features/popup-menu'; -import modelingModule from 'lib/features/modeling'; +import { html } from 'lib/ui/index.js'; -import { html } from 'lib/ui'; const waitFor = (callback) => originalWaitFor(callback, { timeout: 10000 }); diff --git a/test/spec/features/preview-support/renderer/MarkerRenderer.js b/test/spec/features/preview-support/renderer/MarkerRenderer.js index 95b6d3bf2..49b988308 100644 --- a/test/spec/features/preview-support/renderer/MarkerRenderer.js +++ b/test/spec/features/preview-support/renderer/MarkerRenderer.js @@ -10,14 +10,14 @@ import { query as domQuery } from 'min-dom'; -import DefaultRenderer from 'lib/draw/DefaultRenderer'; +import DefaultRenderer from 'lib/draw/DefaultRenderer.js'; import { createLine -} from 'lib//util/RenderUtil'; +} from 'lib/util/RenderUtil.js'; /** - * @typedef {import('../../model').Connection} Connection + * @typedef {import('../../model/index.js').Connection} Connection */ var HIGH_PRIORITY = 3000; diff --git a/test/spec/features/preview-support/renderer/index.js b/test/spec/features/preview-support/renderer/index.js index 80b3cb1d8..ef6dc5f50 100644 --- a/test/spec/features/preview-support/renderer/index.js +++ b/test/spec/features/preview-support/renderer/index.js @@ -1,4 +1,4 @@ -import MarkerRenderer from './MarkerRenderer'; +import MarkerRenderer from './MarkerRenderer.js'; export default { __init__: [ 'defaultRenderer' ], diff --git a/test/spec/features/replace/ReplaceSelectionBehaviorSpec.js b/test/spec/features/replace/ReplaceSelectionBehaviorSpec.js index 8aef63ae8..8793a13c2 100644 --- a/test/spec/features/replace/ReplaceSelectionBehaviorSpec.js +++ b/test/spec/features/replace/ReplaceSelectionBehaviorSpec.js @@ -1,10 +1,10 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; -import replaceModule from 'lib/features/replace'; +import modelingModule from 'lib/features/modeling/index.js'; +import replaceModule from 'lib/features/replace/index.js'; describe('features/replace - ReplaceSelectionBehavior', function() { diff --git a/test/spec/features/replace/ReplaceSpec.js b/test/spec/features/replace/ReplaceSpec.js index e2e98e2bc..add87a80d 100755 --- a/test/spec/features/replace/ReplaceSpec.js +++ b/test/spec/features/replace/ReplaceSpec.js @@ -1,10 +1,7 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; - -import modelingModule from 'lib/features/modeling'; -import replaceModule from 'lib/features/replace'; +} from 'test/TestHelper.js'; import { query as domQuery @@ -14,6 +11,9 @@ import { pick } from 'min-dash'; +import modelingModule from 'lib/features/modeling/index.js'; +import replaceModule from 'lib/features/replace/index.js'; + describe('features/replace - Replace', function() { diff --git a/test/spec/features/resize/ResizeSpec.js b/test/spec/features/resize/ResizeSpec.js index 85e6e0779..12a8af483 100644 --- a/test/spec/features/resize/ResizeSpec.js +++ b/test/spec/features/resize/ResizeSpec.js @@ -1,33 +1,33 @@ +import { pick } from 'min-dash'; + +import { + query as domQuery, + queryAll as domQueryAll +} from 'min-dom'; + +import { classes as svgClasses } from 'tiny-svg'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; +} from '../../../util/MockEvents.js'; -import { pick } from 'min-dash'; +import resizeModule from 'lib/features/resize/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import rulesModule from './rules/index.js'; +import selectModule from 'lib/features/selection/index.js'; -import resizeModule from 'lib/features/resize'; -import modelingModule from 'lib/features/modeling'; -import rulesModule from './rules'; -import selectModule from 'lib/features/selection'; +import { getReferencePoint } from 'lib/features/resize/Resize.js'; -import { getReferencePoint } from 'lib/features/resize/Resize'; - -import { - query as domQuery, - queryAll as domQueryAll -} from 'min-dom'; - -import { classes as svgClasses } from 'tiny-svg'; function bounds(b) { return pick(b, [ 'x', 'y', 'width', 'height' ]); } - describe('features/resize - Resize', function() { beforeEach(bootstrapDiagram({ diff --git a/test/spec/features/resize/ResizeUtilSpec.js b/test/spec/features/resize/ResizeUtilSpec.js index 9b1fe554f..d355aca9d 100755 --- a/test/spec/features/resize/ResizeUtilSpec.js +++ b/test/spec/features/resize/ResizeUtilSpec.js @@ -4,12 +4,11 @@ import { getMinResizeBounds, resizeBounds, reattachPoint -} from 'lib/features/resize/ResizeUtil'; +} from 'lib/features/resize/ResizeUtil.js'; describe('resize/ResizeUtil', function() { - describe('resizeBounds', function() { // given diff --git a/test/spec/features/resize/rules/ResizeRules.js b/test/spec/features/resize/rules/ResizeRules.js index d469a2151..7ee82a29a 100755 --- a/test/spec/features/resize/rules/ResizeRules.js +++ b/test/spec/features/resize/rules/ResizeRules.js @@ -1,6 +1,7 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; + export default function ResizeRules(eventBus) { RuleProvider.call(this, eventBus); diff --git a/test/spec/features/resize/rules/index.js b/test/spec/features/resize/rules/index.js index 53367a356..bf4c77140 100755 --- a/test/spec/features/resize/rules/index.js +++ b/test/spec/features/resize/rules/index.js @@ -1,4 +1,4 @@ -import ResizeRules from './ResizeRules'; +import ResizeRules from './ResizeRules.js'; export default { __init__: [ 'resizeRules' ], diff --git a/test/spec/features/root-elements/RootElementsBehaviorSpec.js b/test/spec/features/root-elements/RootElementsBehaviorSpec.js index 97293b82c..baaf46ab1 100644 --- a/test/spec/features/root-elements/RootElementsBehaviorSpec.js +++ b/test/spec/features/root-elements/RootElementsBehaviorSpec.js @@ -1,12 +1,12 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import coreModule from 'lib/core'; -import commandModule from 'lib/command'; -import modelingModule from 'lib/features/modeling'; -import rootElementsModule from 'lib/features/root-elements'; +import coreModule from 'lib/core/index.js'; +import commandModule from 'lib/command/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import rootElementsModule from 'lib/features/root-elements/index.js'; describe('features/planes/RootElementsBehavior', function() { diff --git a/test/spec/features/rules/RuleProviderSpec.js b/test/spec/features/rules/RuleProviderSpec.js index 3ed3c6e0f..a3f00ebc7 100755 --- a/test/spec/features/rules/RuleProviderSpec.js +++ b/test/spec/features/rules/RuleProviderSpec.js @@ -1,17 +1,17 @@ +import inherits from 'inherits-browser'; + import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import testRulesModule from './rules'; -import sayNoRulesModule from './say-no-rules'; -import priorityRulesModule from './priority-rules'; -import rulesModule from 'lib/features/rules'; -import modelingModule from 'lib/features/modeling'; +import testRulesModule from './rules/index.js'; +import sayNoRulesModule from './say-no-rules/index.js'; +import priorityRulesModule from './priority-rules/index.js'; +import rulesModule from 'lib/features/rules/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; -import RuleProvider from 'lib/features/rules/RuleProvider'; - -import inherits from 'inherits-browser'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; describe('features/rules - RuleProvider', function() { diff --git a/test/spec/features/rules/priority-rules/PriorityRules.js b/test/spec/features/rules/priority-rules/PriorityRules.js index 07c91b4ab..3b294df49 100755 --- a/test/spec/features/rules/priority-rules/PriorityRules.js +++ b/test/spec/features/rules/priority-rules/PriorityRules.js @@ -1,6 +1,6 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; var HIGH_PRIORITY = 1500; diff --git a/test/spec/features/rules/priority-rules/index.js b/test/spec/features/rules/priority-rules/index.js index 1e76621b3..5cda0388e 100755 --- a/test/spec/features/rules/priority-rules/index.js +++ b/test/spec/features/rules/priority-rules/index.js @@ -1,4 +1,4 @@ -import PriorityRules from './PriorityRules'; +import PriorityRules from './PriorityRules.js'; export default { __init__: [ 'priorityRules' ], diff --git a/test/spec/features/rules/rules/TestRules.js b/test/spec/features/rules/rules/TestRules.js index c5159dad1..7b5764762 100755 --- a/test/spec/features/rules/rules/TestRules.js +++ b/test/spec/features/rules/rules/TestRules.js @@ -1,6 +1,6 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; export default function TestRules(eventBus) { RuleProvider.call(this, eventBus); diff --git a/test/spec/features/rules/rules/index.js b/test/spec/features/rules/rules/index.js index eb8ffc77c..4dc6c034e 100755 --- a/test/spec/features/rules/rules/index.js +++ b/test/spec/features/rules/rules/index.js @@ -1,4 +1,4 @@ -import TestRules from './TestRules'; +import TestRules from './TestRules.js'; export default { __init__: [ 'testRules' ], diff --git a/test/spec/features/rules/say-no-rules/SayNoRules.js b/test/spec/features/rules/say-no-rules/SayNoRules.js index eb892a433..21c9db5d1 100755 --- a/test/spec/features/rules/say-no-rules/SayNoRules.js +++ b/test/spec/features/rules/say-no-rules/SayNoRules.js @@ -1,6 +1,6 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; export default function SayNoRules(eventBus) { RuleProvider.call(this, eventBus); diff --git a/test/spec/features/rules/say-no-rules/index.js b/test/spec/features/rules/say-no-rules/index.js index e63f2bb2c..709fdc0cf 100755 --- a/test/spec/features/rules/say-no-rules/index.js +++ b/test/spec/features/rules/say-no-rules/index.js @@ -1,4 +1,4 @@ -import SayNoRules from './SayNoRules'; +import SayNoRules from './SayNoRules.js'; export default { __init__: [ 'sayNoRules' ], diff --git a/test/spec/features/search-pad/SearchPadSpec.js b/test/spec/features/search-pad/SearchPadSpec.js index 9114431ee..18f06679d 100644 --- a/test/spec/features/search-pad/SearchPadSpec.js +++ b/test/spec/features/search-pad/SearchPadSpec.js @@ -1,14 +1,14 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { createKeyEvent -} from 'test/util/KeyEvents'; +} from 'test/util/KeyEvents.js'; -import searchPadModule from 'lib/features/search-pad'; -import SearchPad from 'lib/features/search-pad/SearchPad'; +import searchPadModule from 'lib/features/search-pad/index.js'; +import SearchPad from 'lib/features/search-pad/SearchPad.js'; import { query as domQuery, diff --git a/test/spec/features/selection/SelectionBehaviorSpec.js b/test/spec/features/selection/SelectionBehaviorSpec.js index 0818a1628..bcb7de422 100644 --- a/test/spec/features/selection/SelectionBehaviorSpec.js +++ b/test/spec/features/selection/SelectionBehaviorSpec.js @@ -2,24 +2,24 @@ import { bootstrapDiagram, getDiagramJS, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { assign } from 'min-dash'; -import coreModule from 'lib/core'; -import createModule from 'lib/features/create'; -import draggingModule from 'lib/features/dragging'; -import modelingModule from 'lib/features/modeling'; -import moveModule from 'lib/features/move'; -import connectModule from 'lib/features/connect'; -import rulesModule from './rules'; -import selectionModule from 'lib/features/selection'; +import coreModule from 'lib/core/index.js'; +import createModule from 'lib/features/create/index.js'; +import draggingModule from 'lib/features/dragging/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import moveModule from 'lib/features/move/index.js'; +import connectModule from 'lib/features/connect/index.js'; +import rulesModule from './rules/index.js'; +import selectionModule from 'lib/features/selection/index.js'; import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; +} from '../../../util/MockEvents.js'; describe('features/selection/Selection', function() { diff --git a/test/spec/features/selection/SelectionSpec.js b/test/spec/features/selection/SelectionSpec.js index 96e10cb89..71d9b1b00 100755 --- a/test/spec/features/selection/SelectionSpec.js +++ b/test/spec/features/selection/SelectionSpec.js @@ -1,16 +1,16 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; - -import coreModule from 'lib/core'; -import createModule from 'lib/features/create'; -import draggingModule from 'lib/features/dragging'; -import modelingModule from 'lib/features/modeling'; -import moveModule from 'lib/features/move'; -import connectModule from 'lib/features/connect'; -import rulesModule from './rules'; -import selectionModule from 'lib/features/selection'; +} from 'test/TestHelper.js'; + +import coreModule from 'lib/core/index.js'; +import createModule from 'lib/features/create/index.js'; +import draggingModule from 'lib/features/dragging/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import moveModule from 'lib/features/move/index.js'; +import connectModule from 'lib/features/connect/index.js'; +import rulesModule from './rules/index.js'; +import selectionModule from 'lib/features/selection/index.js'; describe('features/selection/Selection', function() { diff --git a/test/spec/features/selection/SelectionVisualsSpec.js b/test/spec/features/selection/SelectionVisualsSpec.js index 0c240afe8..2ca61e7d0 100755 --- a/test/spec/features/selection/SelectionVisualsSpec.js +++ b/test/spec/features/selection/SelectionVisualsSpec.js @@ -1,21 +1,21 @@ -import { - bootstrapDiagram, - inject -} from 'test/TestHelper'; - -import selectionModule from 'lib/features/selection'; -import modelingModule from 'lib/features/modeling'; - import { classes as domClasses, query as domQuery } from 'min-dom'; -import { getBBox } from 'lib/util/Elements'; +import { + bootstrapDiagram, + inject +} from 'test/TestHelper.js'; + +import selectionModule from 'lib/features/selection/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; + +import { getBBox } from 'lib/util/Elements.js'; import { resizeBounds -} from 'lib/features/resize/ResizeUtil'; +} from 'lib/features/resize/ResizeUtil.js'; describe('features/selection/SelectionVisuals', function() { diff --git a/test/spec/features/selection/rules/ConnectRules.js b/test/spec/features/selection/rules/ConnectRules.js index ff2513454..1bd68b114 100755 --- a/test/spec/features/selection/rules/ConnectRules.js +++ b/test/spec/features/selection/rules/ConnectRules.js @@ -1,6 +1,6 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; export default function ConnectRules(eventBus) { RuleProvider.call(this, eventBus); diff --git a/test/spec/features/selection/rules/index.js b/test/spec/features/selection/rules/index.js index 5bd9b7fff..aac02c1c6 100755 --- a/test/spec/features/selection/rules/index.js +++ b/test/spec/features/selection/rules/index.js @@ -1,4 +1,4 @@ -import ConnectRules from './ConnectRules'; +import ConnectRules from './ConnectRules.js'; export default { __init__: [ 'connectRules' ], diff --git a/test/spec/features/snapping/SnappingSpec.js b/test/spec/features/snapping/SnappingSpec.js index daa10e4d7..10686a627 100755 --- a/test/spec/features/snapping/SnappingSpec.js +++ b/test/spec/features/snapping/SnappingSpec.js @@ -1,12 +1,12 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; -import snappingModule from 'lib/features/snapping'; -import moveModule from 'lib/features/move'; +import modelingModule from 'lib/features/modeling/index.js'; +import snappingModule from 'lib/features/snapping/index.js'; +import moveModule from 'lib/features/move/index.js'; describe('features/snapping', function() { diff --git a/test/spec/features/space-tool/SpaceToolSpec.js b/test/spec/features/space-tool/SpaceToolSpec.js index 198ba8442..70cb40459 100644 --- a/test/spec/features/space-tool/SpaceToolSpec.js +++ b/test/spec/features/space-tool/SpaceToolSpec.js @@ -7,19 +7,19 @@ import { attr as svgAttr } from 'tiny-svg'; import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import autoResizeModule from 'lib/features/auto-resize'; -import autoResizeProviderModule from './auto-resize'; -import modelingModule from 'lib/features/modeling'; -import rulesModule from './rules'; -import spaceToolModule from 'lib/features/space-tool'; +import autoResizeModule from 'lib/features/auto-resize/index.js'; +import autoResizeProviderModule from './auto-resize/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import rulesModule from './rules/index.js'; +import spaceToolModule from 'lib/features/space-tool/index.js'; import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; +} from '../../../util/MockEvents.js'; -import { isMac } from 'lib/util/Platform'; +import { isMac } from 'lib/util/Platform.js'; var keyModifier = isMac() ? { metaKey: true } : { ctrlKey: true }; diff --git a/test/spec/features/space-tool/auto-resize/CustomAutoResizeProvider.js b/test/spec/features/space-tool/auto-resize/CustomAutoResizeProvider.js index e44ac8e27..58aa6c6a8 100644 --- a/test/spec/features/space-tool/auto-resize/CustomAutoResizeProvider.js +++ b/test/spec/features/space-tool/auto-resize/CustomAutoResizeProvider.js @@ -1,6 +1,6 @@ import inherits from 'inherits-browser'; -import AutoResizeProvider from 'lib/features/auto-resize/AutoResizeProvider'; +import AutoResizeProvider from 'lib/features/auto-resize/AutoResizeProvider.js'; export default function CustomAutoResizeProvider(eventBus) { diff --git a/test/spec/features/space-tool/auto-resize/index.js b/test/spec/features/space-tool/auto-resize/index.js index 117bac0fd..7a74cc7fd 100644 --- a/test/spec/features/space-tool/auto-resize/index.js +++ b/test/spec/features/space-tool/auto-resize/index.js @@ -1,4 +1,4 @@ -import CustomAutoResizeProvider from './CustomAutoResizeProvider'; +import CustomAutoResizeProvider from './CustomAutoResizeProvider.js'; export default { __init__: [ 'customAutoResizeProvider' ], diff --git a/test/spec/features/space-tool/rules/SpaceToolRules.js b/test/spec/features/space-tool/rules/SpaceToolRules.js index 51f90ec4d..d1ba05dc4 100644 --- a/test/spec/features/space-tool/rules/SpaceToolRules.js +++ b/test/spec/features/space-tool/rules/SpaceToolRules.js @@ -1,6 +1,6 @@ import inherits from 'inherits-browser'; -import RuleProvider from 'lib/features/rules/RuleProvider'; +import RuleProvider from 'lib/features/rules/RuleProvider.js'; export default function SpaceToolRules(eventBus) { RuleProvider.call(this, eventBus); diff --git a/test/spec/features/space-tool/rules/index.js b/test/spec/features/space-tool/rules/index.js index 73ec1914c..d25b153bc 100644 --- a/test/spec/features/space-tool/rules/index.js +++ b/test/spec/features/space-tool/rules/index.js @@ -1,4 +1,4 @@ -import SpaceToolRules from './SpaceToolRules'; +import SpaceToolRules from './SpaceToolRules.js'; export default { __init__: [ 'spaceToolRules' ], diff --git a/test/spec/features/tool-manager/ToolManagerSpec.js b/test/spec/features/tool-manager/ToolManagerSpec.js index ce74cafd2..a503c8bb6 100644 --- a/test/spec/features/tool-manager/ToolManagerSpec.js +++ b/test/spec/features/tool-manager/ToolManagerSpec.js @@ -1,25 +1,32 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { createCanvasEvent as canvasEvent -} from '../../../util/MockEvents'; +} from '../../../util/MockEvents.js'; -import toolManagerModule from 'lib/features/tool-manager'; -import handToolModule from 'lib/features/hand-tool'; -import draggingModule from 'lib/features/dragging'; +import toolManagerModule from 'lib/features/tool-manager/index.js'; +import handToolModule from 'lib/features/hand-tool/index.js'; +import draggingModule from 'lib/features/dragging/index.js'; describe('features/tool-manager', function() { - beforeEach(bootstrapDiagram({ modules: [ toolManagerModule, handToolModule, draggingModule ] })); + beforeEach(bootstrapDiagram({ + modules: [ + toolManagerModule, + handToolModule, + draggingModule + ] + })); beforeEach(inject(function(dragging) { dragging.setOptions({ manual: true }); })); + describe('basics', function() { it('should register a tool', inject(function(toolManager) { diff --git a/test/spec/features/tooltips/TooltipsSpec.js b/test/spec/features/tooltips/TooltipsSpec.js index ebcc43eff..42ef4ef69 100644 --- a/test/spec/features/tooltips/TooltipsSpec.js +++ b/test/spec/features/tooltips/TooltipsSpec.js @@ -1,8 +1,3 @@ -import { - bootstrapDiagram, - inject -} from 'test/TestHelper'; - import { forEach } from 'min-dash'; @@ -12,7 +7,12 @@ import { assignStyle } from 'min-dom'; -import tooltipsModule from 'lib/features/tooltips'; +import { + bootstrapDiagram, + inject +} from 'test/TestHelper.js'; + +import tooltipsModule from 'lib/features/tooltips/index.js'; describe('features/tooltips', function() { diff --git a/test/spec/i18n/I18NSpec.js b/test/spec/i18n/I18NSpec.js index 4898581c6..f4ca64d7d 100644 --- a/test/spec/i18n/I18NSpec.js +++ b/test/spec/i18n/I18NSpec.js @@ -1,10 +1,10 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import paletteModule from 'lib/features/palette'; -import i18nModule from 'lib/i18n'; +import paletteModule from 'lib/features/palette/index.js'; +import i18nModule from 'lib/i18n/index.js'; describe('i18n', function() { diff --git a/test/spec/i18n/translate/custom-translate/custom-translate.js b/test/spec/i18n/translate/custom-translate/custom-translate.js index 1ca8f2d44..ecc8333a5 100644 --- a/test/spec/i18n/translate/custom-translate/custom-translate.js +++ b/test/spec/i18n/translate/custom-translate/custom-translate.js @@ -1,4 +1,4 @@ -import translate from 'lib/i18n/translate/translate'; +import translate from 'lib/i18n/translate/translate.js'; export default function customTranslate(template, replacements) { if (template === 'Remove') { diff --git a/test/spec/i18n/translate/custom-translate/index.js b/test/spec/i18n/translate/custom-translate/index.js index 555037942..9cdd5988e 100644 --- a/test/spec/i18n/translate/custom-translate/index.js +++ b/test/spec/i18n/translate/custom-translate/index.js @@ -1,4 +1,4 @@ -import customTranslate from './custom-translate'; +import customTranslate from './custom-translate.js'; export default { translate: [ 'value', customTranslate ] diff --git a/test/spec/i18n/translate/translateSpec.js b/test/spec/i18n/translate/translateSpec.js index d2d39b76b..c87f57243 100644 --- a/test/spec/i18n/translate/translateSpec.js +++ b/test/spec/i18n/translate/translateSpec.js @@ -1,10 +1,10 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import translateModule from 'lib/i18n/translate'; -import customTranslateModule from './custom-translate'; +import translateModule from 'lib/i18n/translate/index.js'; +import customTranslateModule from './custom-translate/index.js'; describe('i18n - translate', function() { diff --git a/test/spec/layout/CroppingConnectionDockingSpec.js b/test/spec/layout/CroppingConnectionDockingSpec.js index b781bffff..20bfdbdd8 100755 --- a/test/spec/layout/CroppingConnectionDockingSpec.js +++ b/test/spec/layout/CroppingConnectionDockingSpec.js @@ -2,7 +2,7 @@ import { bootstrapDiagram, getDiagramJS, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { append as svgAppend, @@ -10,7 +10,7 @@ import { create as svgCreate } from 'tiny-svg'; -import CroppingConnectionDocking from 'lib/layout/CroppingConnectionDocking'; +import CroppingConnectionDocking from 'lib/layout/CroppingConnectionDocking.js'; var layoutModule = { connectionDocking: [ 'type', CroppingConnectionDocking ] diff --git a/test/spec/layout/LayoutUtilSpec.js b/test/spec/layout/LayoutUtilSpec.js index a05ae2818..e925f59d2 100755 --- a/test/spec/layout/LayoutUtilSpec.js +++ b/test/spec/layout/LayoutUtilSpec.js @@ -2,7 +2,7 @@ import { filterRedundantWaypoints, getOrientation, getMid -} from 'lib/layout/LayoutUtil'; +} from 'lib/layout/LayoutUtil.js'; function rect(x, y, width, height) { diff --git a/test/spec/layout/ManhattanLayoutSpec.js b/test/spec/layout/ManhattanLayoutSpec.js index bdd8b5e1a..5f3745e08 100755 --- a/test/spec/layout/ManhattanLayoutSpec.js +++ b/test/spec/layout/ManhattanLayoutSpec.js @@ -2,7 +2,7 @@ import { connectRectangles, connectPoints, repairConnection -} from 'lib/layout/ManhattanLayout'; +} from 'lib/layout/ManhattanLayout.js'; function point(x, y) { diff --git a/test/spec/model/ModelSpec.js b/test/spec/model/ModelSpec.js index abccfe44b..32d01180b 100644 --- a/test/spec/model/ModelSpec.js +++ b/test/spec/model/ModelSpec.js @@ -1,13 +1,14 @@ import { create, isModelElement -} from 'lib/model'; +} from 'lib/model/index.js'; import { isConnection, isLabel, isRoot -} from '../../../lib/util/ModelUtil'; +} from 'lib/util/ModelUtil.js'; + describe('model', function() { diff --git a/test/spec/navigation/keyboard-move/KeyboardMoveSpec.js b/test/spec/navigation/keyboard-move/KeyboardMoveSpec.js index 36e4a5e3b..b6ed0d67a 100755 --- a/test/spec/navigation/keyboard-move/KeyboardMoveSpec.js +++ b/test/spec/navigation/keyboard-move/KeyboardMoveSpec.js @@ -1,18 +1,18 @@ +import { + assign, + forEach +} from 'min-dash'; + import { bootstrapDiagram, getDiagramJS, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import { createKeyEvent } from 'test/util/KeyEvents'; - -import { - assign, - forEach -} from 'min-dash'; +import { createKeyEvent } from 'test/util/KeyEvents.js'; -import modelingModule from 'lib/features/modeling'; -import keyboardMoveModule from 'lib/navigation/keyboard-move'; +import modelingModule from 'lib/features/modeling/index.js'; +import keyboardMoveModule from 'lib/navigation/keyboard-move/index.js'; describe('navigation/keyboard-move', function() { diff --git a/test/spec/navigation/movecanvas/MoveCanvasSpec.js b/test/spec/navigation/movecanvas/MoveCanvasSpec.js index 2829fb9e1..d569cfaf7 100755 --- a/test/spec/navigation/movecanvas/MoveCanvasSpec.js +++ b/test/spec/navigation/movecanvas/MoveCanvasSpec.js @@ -1,15 +1,15 @@ +import { + assign +} from 'min-dash'; + import { bootstrapDiagram, getDiagramJS, inject -} from 'test/TestHelper'; - -import { - assign -} from 'min-dash'; +} from 'test/TestHelper.js'; -import moveCanvasModule from 'lib/navigation/movecanvas'; -import interactionEventsModule from 'lib/features/interaction-events'; +import moveCanvasModule from 'lib/navigation/movecanvas/index.js'; +import interactionEventsModule from 'lib/features/interaction-events/index.js'; describe('navigation/movecanvas', function() { diff --git a/test/spec/navigation/zoomscoll/ZoomScrollSpec.js b/test/spec/navigation/zoomscoll/ZoomScrollSpec.js index 5dfcbd74a..0c1893333 100644 --- a/test/spec/navigation/zoomscoll/ZoomScrollSpec.js +++ b/test/spec/navigation/zoomscoll/ZoomScrollSpec.js @@ -1,9 +1,3 @@ -import { - bootstrapDiagram, - getDiagramJS, - inject -} from 'test/TestHelper'; - import { assign } from 'min-dash'; @@ -12,7 +6,13 @@ import { domify } from 'min-dom'; -import zoomScrollModule from 'lib/navigation/zoomscroll'; +import { + bootstrapDiagram, + getDiagramJS, + inject +} from 'test/TestHelper.js'; + +import zoomScrollModule from 'lib/navigation/zoomscroll/index.js'; describe('navigation/zoomscroll', function() { diff --git a/test/spec/snapping/CreateMoveSnappingSpec.js b/test/spec/snapping/CreateMoveSnappingSpec.js index 0606966ad..c0b5712a1 100644 --- a/test/spec/snapping/CreateMoveSnappingSpec.js +++ b/test/spec/snapping/CreateMoveSnappingSpec.js @@ -1,24 +1,24 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import createModule from 'lib/features/create'; -import modelingModule from 'lib/features/modeling'; -import moveModule from 'lib/features/move'; -import snappingModule from 'lib/features/snapping'; +import createModule from 'lib/features/create/index.js'; +import modelingModule from 'lib/features/modeling/index.js'; +import moveModule from 'lib/features/move/index.js'; +import snappingModule from 'lib/features/snapping/index.js'; -import SnapContext from 'lib/features/snapping/SnapContext'; +import SnapContext from 'lib/features/snapping/SnapContext.js'; import { bottomRight, mid, topLeft -} from 'lib/features/snapping/SnapUtil'; +} from 'lib/features/snapping/SnapUtil.js'; import { createCanvasEvent as canvasEventMid -} from '../../util/MockEvents'; +} from '../../util/MockEvents.js'; describe('features/snapping - CreateMoveSnapping', function() { diff --git a/test/spec/snapping/ResizeSnappingSpec.js b/test/spec/snapping/ResizeSnappingSpec.js index 1466c47d2..623e544ff 100644 --- a/test/spec/snapping/ResizeSnappingSpec.js +++ b/test/spec/snapping/ResizeSnappingSpec.js @@ -1,19 +1,19 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; -import resizeModule from 'lib/features/resize'; -import snappingModule from 'lib/features/snapping'; +import modelingModule from 'lib/features/modeling/index.js'; +import resizeModule from 'lib/features/resize/index.js'; +import snappingModule from 'lib/features/snapping/index.js'; -import SnapContext from 'lib/features/snapping/SnapContext'; +import SnapContext from 'lib/features/snapping/SnapContext.js'; -import { getReferencePoint } from 'lib/features/resize/Resize'; +import { getReferencePoint } from 'lib/features/resize/Resize.js'; import { createCanvasEvent as canvasEvent -} from '../../util/MockEvents'; +} from '../../util/MockEvents.js'; var VERY_LOW_PRIORITY = 100; diff --git a/test/spec/snapping/SnapContextSpec.js b/test/spec/snapping/SnapContextSpec.js index 5fbeb3e05..597162ad7 100644 --- a/test/spec/snapping/SnapContextSpec.js +++ b/test/spec/snapping/SnapContextSpec.js @@ -1,4 +1,4 @@ -import SnapContext from 'lib/features/snapping/SnapContext'; +import SnapContext from 'lib/features/snapping/SnapContext.js'; describe('snapping - SnapContext', function() { diff --git a/test/spec/snapping/SnapUtilSpec.js b/test/spec/snapping/SnapUtilSpec.js index 853920f3e..e1179f1c9 100644 --- a/test/spec/snapping/SnapUtilSpec.js +++ b/test/spec/snapping/SnapUtilSpec.js @@ -1,11 +1,11 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; -import { getChildren } from 'lib/features/snapping/SnapUtil'; +import { getChildren } from 'lib/features/snapping/SnapUtil.js'; describe('features/snapping - SnapUtil', function() { diff --git a/test/spec/snapping/SnappingSpec.js b/test/spec/snapping/SnappingSpec.js index bbcf3b9ea..277f6cae5 100644 --- a/test/spec/snapping/SnappingSpec.js +++ b/test/spec/snapping/SnappingSpec.js @@ -4,14 +4,14 @@ import { bootstrapDiagram, getDiagramJS, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; -import modelingModule from 'lib/features/modeling'; -import snappingModule from 'lib/features/snapping'; +import modelingModule from 'lib/features/modeling/index.js'; +import snappingModule from 'lib/features/snapping/index.js'; -import SnapContext, { SnapPoints } from 'lib/features/snapping/SnapContext'; +import SnapContext, { SnapPoints } from 'lib/features/snapping/SnapContext.js'; -import { SNAP_LINE_HIDE_DELAY } from 'lib/features/snapping/Snapping'; +import { SNAP_LINE_HIDE_DELAY } from 'lib/features/snapping/Snapping.js'; import { queryAll as domQueryAll } from 'min-dom'; diff --git a/test/spec/ui/uiSpec.js b/test/spec/ui/uiSpec.js index 4802aa1ed..f9f147c75 100644 --- a/test/spec/ui/uiSpec.js +++ b/test/spec/ui/uiSpec.js @@ -2,7 +2,7 @@ import { html, render, useState -} from 'lib/ui'; +} from 'lib/ui/index.js'; describe('ui', function() { diff --git a/test/spec/util/AttachUtilSpec.js b/test/spec/util/AttachUtilSpec.js index 3d6732907..1a62a3a4b 100644 --- a/test/spec/util/AttachUtilSpec.js +++ b/test/spec/util/AttachUtilSpec.js @@ -1,6 +1,6 @@ import { getNewAttachPoint -} from 'lib/util/AttachUtil'; +} from 'lib/util/AttachUtil.js'; describe('AttachUtil', function() { diff --git a/test/spec/util/ElementIntegrationSpec.js b/test/spec/util/ElementIntegrationSpec.js index 9d2c1fe35..18f98d18d 100644 --- a/test/spec/util/ElementIntegrationSpec.js +++ b/test/spec/util/ElementIntegrationSpec.js @@ -1,7 +1,7 @@ import { bootstrapDiagram, inject -} from 'test/TestHelper'; +} from 'test/TestHelper.js'; import { keys @@ -9,9 +9,9 @@ import { import { getEnclosedElements -} from 'lib/util/Elements'; +} from 'lib/util/Elements.js'; -import modelingModule from 'lib/features/modeling'; +import modelingModule from 'lib/features/modeling/index.js'; describe('util/Elements', function() { diff --git a/test/spec/util/ElementsSpec.js b/test/spec/util/ElementsSpec.js index 1f09a5148..9f8b666a2 100755 --- a/test/spec/util/ElementsSpec.js +++ b/test/spec/util/ElementsSpec.js @@ -5,7 +5,7 @@ import { getClosure, getParents, isFrameElement -} from 'lib/util/Elements'; +} from 'lib/util/Elements.js'; describe('util/Elements', function() { diff --git a/test/spec/util/EscapeUtilSpec.js b/test/spec/util/EscapeUtilSpec.js index 44e362c6d..139b501a5 100644 --- a/test/spec/util/EscapeUtilSpec.js +++ b/test/spec/util/EscapeUtilSpec.js @@ -1,7 +1,7 @@ import { escapeCSS, escapeHTML -} from 'lib/util/EscapeUtil'; +} from 'lib/util/EscapeUtil.js'; describe('util/EscapeUtil', function() { diff --git a/test/spec/util/GeometrySpec.js b/test/spec/util/GeometrySpec.js index fcbef9d02..bc5c25c94 100644 --- a/test/spec/util/GeometrySpec.js +++ b/test/spec/util/GeometrySpec.js @@ -1,7 +1,7 @@ import { pointsOnLine, pointsAligned -} from 'lib/util/Geometry'; +} from 'lib/util/Geometry.js'; describe('util/Geometry', function() { diff --git a/test/spec/util/IdGeneratorSpec.js b/test/spec/util/IdGeneratorSpec.js index 580c1f4a3..995b126a7 100755 --- a/test/spec/util/IdGeneratorSpec.js +++ b/test/spec/util/IdGeneratorSpec.js @@ -1,4 +1,4 @@ -import IdGenerator from 'lib/util/IdGenerator'; +import IdGenerator from 'lib/util/IdGenerator.js'; describe('util/IdGenerator', function() { diff --git a/test/spec/util/LineIntersectionSpec.js b/test/spec/util/LineIntersectionSpec.js index 407b4796f..d625fc14e 100755 --- a/test/spec/util/LineIntersectionSpec.js +++ b/test/spec/util/LineIntersectionSpec.js @@ -1,6 +1,6 @@ import { getApproxIntersection -} from 'lib/util/LineIntersection'; +} from 'lib/util/LineIntersection.js'; describe('features/bendpoints - LineIntersection', function() { diff --git a/test/spec/util/RenderUtilSpec.js b/test/spec/util/RenderUtilSpec.js index 6c5be3ffa..e4dd1d7c0 100644 --- a/test/spec/util/RenderUtilSpec.js +++ b/test/spec/util/RenderUtilSpec.js @@ -1,7 +1,7 @@ import { createLine, updateLine -} from 'lib/util/RenderUtil'; +} from 'lib/util/RenderUtil.js'; import { attr as svgAttr diff --git a/test/spec/util/TextSpec.js b/test/spec/util/TextSpec.js index 25c87b32d..e59a3dadb 100644 --- a/test/spec/util/TextSpec.js +++ b/test/spec/util/TextSpec.js @@ -10,7 +10,7 @@ import { } from 'tiny-svg'; -import TextUtil from 'lib/util/Text'; +import TextUtil from 'lib/util/Text.js'; import TestContainer from 'mocha-test-container-support'; diff --git a/test/util/MockEvents.js b/test/util/MockEvents.js index d520a630d..9abb59b08 100644 --- a/test/util/MockEvents.js +++ b/test/util/MockEvents.js @@ -2,10 +2,10 @@ import { assign } from 'min-dash'; import { getDiagramJS -} from 'test/TestHelper'; +} from '../TestHelper.js'; /** - * @typedef {import('../../lib/util/Types').Point} Point + * @typedef {import('../../lib/util/Types.js').Point} Point */ /**