JointJS+ Changelog v4.3.5
JointJS+ 4.3.5 ships with @joint/core 4.3.5, @joint/react 4.3.7, @joint/layout-directed-graph 4.3.5,
@joint/layout-elk 4.3.5, @joint/layout-msagl 4.3.5, and @joint/router-avoid 4.3.5.
Overview
Shadow DOM
This release fixes a number of issues with diagrams rendered inside a shadow root (e.g. a web component). Pointer
clicks, mouseleave events and dragged arrowheads in @joint/core, and ui.ContextToolbar, ui.Inspector,
ui.Keyboard, ui.SelectBox, ui.TextEditor and ui.Tooltip in JointJS+ now work the same as in the main
document.
See Web Components for an example.
dia
CellView
dia.CellView – fix mouseleave triggered on pointerup inside a shadow root
Fix an issue where element:mouseleave and link:mouseleave were triggered on pointerup when the paper was inside a
shadow root.
Graph
dia.Graph – fix the reset event not passing the replaced cells
Fix an issue where the reset event did not pass the replaced cells as the previousModels option.
LinkView
dia.LinkView – fix a dragged arrowhead not connecting inside a shadow root
Fix an issue where a dragged arrowhead did not connect to the element under the pointer when the paper was inside a shadow root.
Paper
dia.Paper – fix pointerclick events not triggered inside a shadow root
Fix an issue where element:pointerclick, link:pointerclick and blank:pointerclick were not triggered when the
paper was inside a shadow root.
dia.Paper – fix updateCellsVisibility() not hiding cells that are not rendered yet
Fix an issue where updateCellsVisibility() did not hide the cells which were not rendered yet.
dia.Paper – fix an idle autoFreeze paper staying frozen after a keyed freeze() and unfreeze()
Fix an issue where an idle paper with autoFreeze stayed frozen after freeze() and unfreeze() were called with the
same key.
dia.Paper – fix views requested during an update waiting for the next update
Fix an issue where the views requested during an update with a priority that had no updates in that update were not updated until the next one.
mvc
Dom
mvc.Dom – fix width() and height() mixing the axes
Fix an issue where width() and height() subtracted the padding and border of the other axis.
connectors
jumpover
connectors.jumpover – draw one jump over a track of close links
A link crossing a track of close links (e.g. parallel links routed next to each other) now draws one jump over the whole track, no higher than a single jump, instead of a jump for every link.
connectors.jumpover – fix the jump direction on nearly vertical lines
Fix an issue where jumps on a nearly vertical line (e.g. computed by a router) pointed to the opposite side.
connectors.jumpover – skip links that cannot cross
When looking for jumps, the connector now skips the links whose paths cannot cross the link. The results do not change.
connectors.jumpover – fix jumps drawn at old crossings on an async paper
Fix an issue where, on an async paper, the jumps of links changed in a batch were drawn at the old crossings.
connectors.jumpover – do not create the views of hidden links
The connector no longer creates the views of the links that are not visible (e.g. outside the viewport with lazy view management).
types
alg – fix the types failing to compile with TypeScript 4
Fix an issue where types/alg.d.ts imported dia and g with a .d.ts extension, which TypeScript 4 does not
allow.
layout
DirectedGraph
layout.DirectedGraph – fix layout() leaving a listener on cells
Fix an issue where layout() left a listener on the cells passed as an array.
GridLayout
layout.GridLayout – fix layout() leaving a listener on cells
Fix an issue where layout() left a listener on the cells passed as an array.
MSAGL
layout.MSAGL – fix layout() leaving a listener on cells
Fix an issue where layout() left a listener on the cells passed as an array.
format
BPMNImport
format.BPMNImport – fix fromBPMN() failing on cells with a layer attribute
Fix an issue where fromBPMN() threw an error when importing cells with a layer attribute.
Visio
format.Visio – fix horizontal and vertical lines with a shadow disappearing on import
Fix an issue where horizontal and vertical lines with a shadow were not rendered after the import.
format.Visio – apply paragraph indents to imported shape text
The paragraph IndFirst, IndLeft and IndRight indents are now applied to imported left- and right-aligned shape
text.
format.Visio – fix VisioShape.setText() writing multiple <Text> elements
VisioShape.setText() now writes the text into a single <Text> element, as a Visio file allows only one <Text>
element per shape.
format.Visio – let shapes created from a master inherit its styles and text
Fix an issue where a shape created with VisioShape.fromMaster() did not inherit the styles and the text of the
master.
format.Visio – fix links created from a master not following the exported route
Links created with VisioShape.fromMaster() now follow the route of the exported link, without the rotation and flip
of the master.
format.Visio – fix exported links not staying glued to shapes created from a master
Links exported by VisioPage.fromPaper() now stay glued in Visio to the shapes created with
VisioShape.fromMaster().
format.Visio – export the size-dependent values of a resized master instance
VisioPage.fromPaper() now exports the size-dependent values of a resized master instance.
format.Visio – write a <Connect> element for every glued link end
VisioPage.fromPaper() now writes a <Connect> element for every glued link end. Visio renders the links from their
cells and does not need it, but the import reads it to connect the links.
format.Visio – fix the PinX formula of exported links
Fix the PinX formula of the links exported by VisioPage.fromPaper().
format.Visio – fix the exported connection point of a link end with the right anchor
Fix an issue where VisioPage.fromPaper() did not export the value of the connection point of a link end with the
right anchor.
format.Visio – fix templates.fromNodes() not exporting an element with ports
Fix an issue where the templates.fromNodes() option of VisioPage.fromPaper() did not export an element with ports.
ui
Clipboard
ui.Clipboard – fix pasted and fetched cells left with a listener
Fix an issue where pasteCellsAtPoint() and fetchCellsFromLocalStorage() left a listener of a temporary graph on the
cells.
ContextToolbar
ui.ContextToolbar – fix autoClose inside a shadow root
Fix an issue where autoClose closed the toolbar when a tool or the target inside a shadow root was pressed.
Inspector
ui.Inspector – fix close() not blurring the focused input inside a shadow root
Fix an issue where close() did not blur the focused input when the inspector was inside a shadow root.
ui.Inspector – save a field whose change has not fired when the inspector is removed
Fix an issue where a field value whose change event had not fired yet (e.g. a native color picker) was not saved
when the inspector was removed.
Keyboard
ui.Keyboard – fix shortcuts triggered while typing inside a shadow root
Fix an issue where shortcuts were triggered while typing into an input inside a shadow root.
Lightbox
ui.Lightbox – fix the title bar padding when fitting the image into windowArea
Fix an issue where the padding of the title bar was not counted when the image was fitted into windowArea, so the
title did not stay inside it.
PaperScroller
ui.PaperScroller – revert the autoResizePaper layout optimization
The autoResizePaper layout optimization of 4.3.4 was reverted. It
shifted the view when the paper was updated right after the scroller was resized.
ui.PaperScroller – fix transitions that never start
Fix an issue where transitionToPoint() and transitionToRect() did not complete when no CSS transition ran (e.g. a
zero duration).
SelectBox
ui.SelectBox – fix the options closing right after they open inside a shadow root
Fix an issue where the options closed right after they opened when the select box was inside a shadow root.
Stencil
ui.Stencil – fix to load and drag a cell in a layer of the target graph
Fix an issue where a cell in a layer of the target graph (other than the default layer) could not be loaded into the stencil or dragged from it. The cell is now dropped into its layer of the target graph. Dropping a cell whose layer does not exist in the target graph throws an error.
ui.Stencil – hide unmatched links on search
Search now hides the links that do not match, as it does the elements.
TextEditor
ui.TextEditor – fix editing inside a shadow root
Fix an issue where, inside a shadow root, a pointerdown on the edited text ended the editing and the selection did not follow the keyboard.
Tooltip
ui.Tooltip – fix the tooltip hiding shortly after it opens inside a shadow root
Fix an issue where the tooltip hid shortly after it opened when its target was inside a shadow root.
react-plus
<Overlay />
<Overlay /> – fix React pointer handlers on overlay content
Fix an issue where React pointer handlers (e.g. onMouseDown, onClick) did not fire on the overlay content.
<Selection />
<Selection /> – call handle events callbacks with the params object
The handle events callbacks are now always called with the params object, as in <Halo />.
layout-elk
ElkNodeDraft – make layoutOptions optional on added labels
layoutOptions is now optional on the labels an exportElement() callback adds to an ElkNodeDraft.
router-avoid
router-avoid – update libavoid-js to v0.5
libavoid-js was updated to v0.5. The libavoid.wasm file and the worker script are now referenced with
new URL(..., import.meta.url), so bundlers that handle this pattern (e.g. webpack 5, Vite) emit them as assets
without further configuration, such as a copy plugin. By default, loadAvoidRouter() requests libavoid.wasm from
next to the libavoid-js module.
With the Vite dev server, exclude libavoid-js and @joint/router-avoid from dependency pre-bundling
(optimizeDeps.exclude). Elsewhere, serve libavoid.wasm yourself and pass its location as libavoidFilePath.
libavoid-js 0.5 requires Chrome 95, Firefox 100, Safari 16.4 or newer, and its type definitions require TypeScript
5.2 or newer.
MainThreadProvider
MainThreadProvider – free the router on destroy()
destroy() now frees the avoid router and everything added to it.
WorkerProvider
WorkerProvider – fix a shape added and removed within one batch
Fix an issue where a shape added and removed within one debounced batch was not deleted.