🚀 New Features
- Support authoring relation properties:
- Add
MetadataProvider.getRelationShape() interface method to get editor metadata for relation properties, and allow to return canEdit: true from MetadataProvider.canModifyRelation() to display relation properties editor;
- Display "edit" and "delete" inline entity actions:
- Add option
inlineEntityActions (defaults to true) for VisualAuthoring to display entity actions inline at the top of each entity;
- Improve the style for "cancel" (discard) action on entities and relations to make it consistent with other inline actions.
- Add
ElementDecoration component to display additional decorations over canvas elements either from the template itself or from outside the element:
- Element decorations are not included in the computed element bounds but are exported with the canvas unless explicitly marked with
data-reactodia-no-export attribute (as with other canvas elements).
- Support keyboard hotkeys for the focused canvas:
- Allow to specify arbitrary hotkeys to
ToolbarAction and SelectionAction components, export useCanvasHotkey() hook to bind hotkey from any canvas widget;
- Add default hotkeys for components:
Selection (Ctrl+A: select all), ToolbarActionUndo (Ctrl+Z), ToolbarActionRedo (Ctrl+Shift+Z), SelectionActionRemove (Delete, same as before), SelectionActionGroup (G).
- [💥Breaking] Use separate HTML paper layer to display
LinkLabel components instead of an SVG canvas, which allows to use CSS for layout, backgrounds and improves rendering performance:
textClass, textStyle, rectClass and rectStyle are replaced by className and style props;
- CSS should use HTML styling properties instead of SVG variants, e.g.
color and background-color instead of stroke and fill;
- Label content should be placed directly as children to the component instead of using
content prop.
- Select entity label and image using
DataLocaleProvider based on its properties:
- [💥Breaking] Remove
ElementModel.{label, image} properties and instead use DataDiagramModel.locale methods to select them based on ElementModel.properties instead;
- Allow to override data locale provider (default is
DefaultDataLocaleProvider) by passing locale option to model.importLayout() or model.createNewDiagram();
🐛 Fixed
- Always display validation state for an entities and relations in case when the target does not have any authoring changes.
- Display elliptical authoring state overlays for elliptically-shaped entity elements.
- Use provided
duration in CanvasApi.animateGraph() for element transitions without the need to override the styles.
- Trigger
keydown, keyup, scroll and contextMenu canvas events only from a non-widget layer.
- Fix marking existing relation as new or changed after moving its source or target to its original source or target.
⏱ Performance
- Optimize diagram loading time by avoiding unnecessary updates and separating a measuring element sizes step from applying the sizes to the rendering state.
💅 Polish
- Export
BaseMetadataProvider as a stable base to instantiate or extend when implementing custom metadata providers.
- Re-use and un-deprecate
model.locale formatting object with DataLocaleProvider interface type:
- Deprecate
Translation.formatIri() in favor of locale.formatIri();
- Replace other deprecated methods of
locale with: selectEntityLabel(), selectEntityImageUrl(), formatEntityLabel(), formatEntityTypeList();
- Provide gradual customization options for the built-in entity and relation property editor:
- Expose ability to customize property input in authoring forms with
inputResolver option for VisualAuthoring component;
- Export built-in inputs
FormInputList and FormInputText, as well as FormInputSingleProps and FormInputMultiProps props interfaces to implement custom property inputs.
- [💥Breaking] Rename the following constants for consistency in naming style:
DIAGRAM_CONTEXT_URL_V1 -> DiagramContextV1,
PLACEHOLDER_ELEMENT_TYPE -> PlaceholderEntityType,
PLACEHOLDER_LINK_TYPE -> PlaceholderRelationType;
- Support the ability to expand up the
Dropdown, DropdownMenu and Toolbar by setting direction to "up" e.g. for docking the toolbar to the bottom of the viewport.
- Allow to return
iconMonochrome: true for a type style to automatically apply dark theme filter for the icon.
- Support optional dependency list in
useEventStore() to re-subscribe to store if needed.
🔧 Maintenance
- Make library compatible with React v19, while continuing support for v17 and v18.
- Increase
IndexedDbCachedProvider.DB_VERSION to 4 due to ElementModel changes.
- Remove deprecated
LocaleFormatter, DataGraphLocaleFormatter and FormattedProperty types.
- Simplify the exported canvas SVG by using a single
<foreignObject> to hold the whole element layer instead of a separate one for each canvas element.
Link to the CHANGELOG v0.30.0