Skip to content

Releases: reactodia/reactodia-workspace

v0.34.1

29 Mar 22:11

Choose a tag to compare

🐛 Fixed

  • Fix stale/non-saved data when calling applyChanges() immediately after updateData() in EntityEditor and RelationEditor.
  • Fix SelectionAction* components not updating on selection change when provided as children to Halo.

💅 Polish

  • Allow to control the placement of newly created entity elements from ClassTree and SearchSectionElementTypes via placeCreatedEntity prop.
  • Expose fixedElements option for performLayout() to be able to constrain elements not to move (if supported by the layout function).
  • Improve ARIA-attributes and other accessibility interaction:
    • Allow to resize and toggle WorkspaceLayout* with a keyboard;
    • Change WorkspaceLayout* to be <section> elements with aria-label (i.e. regions);
    • Add role for Canvas layers, Toolbar, ZoomControl, UnifiedSearch (and other search inputs);
    • Add aria-label and aria-keyshortcuts for ToolbarAction, SelectionAction, LinkAction.

Link to the CHANGELOG v0.34.1

v0.34.0

25 Mar 20:37

Choose a tag to compare

🚀 New Features

  • Support proper graph manipulation on touchscreen devices:
    • Allow to move and resize elements on touchscreen;
    • Allow to manipulate link vertices on touchscreen (only in Firefox for now due to bug);
    • Allow to select multiple elements with Selection with touch when CanvasApi.pointerMode is selection;
    • Allow to establish new links with SelectionActionEstablishLink on touchscreen;
    • Allow to move link source or target with LinkActionMoveEndpoint on touchscreen;
    • Make ZoomOptions.requireCtrl default to false to zoom without holding Ctrl i.e. like on a map.
    • Enable showPointerModeToggle on ZoomControl by default (can be disabled by passing false).
  • [💥Breaking] Extend and make optional built-in property editing form support:
    • Extract property editor inputs into separate entry point @reactodia/workspace/forms to be able to use external forms implementation without always bundling the built-in one;
    • Provide InputText, InputList and InputSelect basic form inputs;
    • Provide InputFile form input with MemoryFileUploader implementation for FileUploadProvider interface;
    • VisualAuthoring now requires propertyEditor prop with changed contract, which have to return an editor component in all cases.
    • DefaultPropertyEditor in combination with imported inputs provides default (built-in) property editing experience, but custom editors can be implemented with EntityEditor and RelationEditor "provider" components.
  • Allow to customize how resource anchors and asset URLs (e.g. images or downloadable files) are resolved via DataLocaleProvider.{prepareAnchor, resolveAssetUrl}:
    • Resolve anchors and image thumbnail URLs in StandardEntity, ClassicEntity and SelectionActionAnchor;
    • Add useResolvedAssetUrl() helper hook to simplify resolving asset URLs from components;
  • Support conditionally rendering WorkspaceLayout* child components by passing null instead of a child to remove it:
    • Allow to hide left and right panels in ClassicWorkspace by passing null to the corresponding props;
    • Allow to provide className and style to WorkspaceLayout* components.
  • Add Translation.textOptional() to support common translation string defaults with ability to provide separate string for each case:
    • Use search_defaults.input.placeholder for a search input field;
    • Use visual_authoring.dialog.apply.{label, text} for an "Apply" button in VisualAuthoring dialogs.
  • Allow to customize default dialog sizes for built-in dialogs and persist user-changed sizes with dialogSettingsProvider prop on Workspace:
    • Default provider persists user-changed dialog sizes in-memory based on dialogType.

💅 Polish

  • Expose useAsync() utility hook to simplify data loading from via a single Promise-returning task.
  • Expose useProvidedEntities() utility hook to have a simple way to load non-canvas entities with cache from a DataProvider.
  • Provide onlySelected property to link templates the same way as for element templates.
  • Allow to configure whether ClassTree and SearchSectionElementTypes tree items should be draggable.
  • Allow to configure SparqlDataProvider.lookup() via lookupQuery and filterInnerPrelude settings.

🔧 Maintenance

  • Preparations to extract generic scrollable paper component Paper from diagram-specific state and logic:
    • Replace reactodia-paper-area CSS class by reactodia-canvas-area and reactodia-paper.
    • Deprecate CanvasMetrics.area in favor of CanvasMetrics.pane.
  • Remove AbortScope utility class (can be trivially replaced by the built-in AbortSignal.any() function).

Link to the CHANGELOG v0.34.0

v0.33.0

16 Mar 19:08

Choose a tag to compare

🚀 New Features

  • Allow to open "Edit entity" dialog from VisualAuthoring for an entity not present on the canvas (e.g. to edit related or well-known entities).
  • Extends metadata support for editing an entity or relation properties:
    • Allow to order properties with MetadataPropertyShape.order;
    • Allow to specify default value with MetadataValueShape.defaultValue;
    • Provide source and target entities to MetadataProvider.getRelationShape().

🐛 Fixed

  • Fix stale rendering (i.e. missing links after moving an endpoint until an element move) due to the lost scheduled layer updates.
  • Fix unable to scroll inside canvas components and templates when requireCtrl in zoomOptions is set false.
  • Disallow moving relation source or target to another entity in authoring mode if the relation after move already exists on the canvas.
  • Disable changing an entity IRI in a form when MetadataProvider.canModifyEntity() disallows it.
  • Move link vertices together with source and target elements if both are selected in Selection component.
  • Re-validate entities and links with ValidationProvider when added or removed via undo/redo.
  • Fix marking AnnotationLink with TemplateProperties.LayoutOnly when importing a diagram layout.

💅 Polish

  • Remove superfluous "Type" fields from the default "Edit entity" dialog.
  • Provide translation and current language to ValidationProvider.validate() method.
  • Allow to specify related property IRI when returning a validation item for a relation from ValidationProvider.
  • Display language selector in FormInputText only when shape datatype is rdf:langString or uniqueLang is set to either true or false (the selector will be hidden by default when datatype is xsd:string).
  • Deprecate getting Translation instance from WorkspaceContext: use useTranslation() hook instead to be able to subscribe to translation bundle changes in the future.

Link to the CHANGELOG v0.33.0

v0.32.0

10 Mar 21:04

Choose a tag to compare

🐛 Fixed

  • Avoid marking grouped relation as "layout only" when importing a diagram (only grouped relation links themselves).
  • Fix being unable to pan the canvas in Firefox when an graph element with a scrollbar inside was present.
  • Fix a freeze when opening a class tree in authoring mode when MetadataProvider.filterConstructibleTypes() returns without any delay.
  • Fix calling MetadataProvider.canConnect() with only source and without target when dragging over an element to establish a new link.
  • Fix flushSync was called from inside a lifecycle method React warning when calling centerTo(), centerContent(), zoomToFit() on CanvasApi from a lifecycle method.
  • Fix labels not loading for element and link type selectors in VisualAuthoring dialogs unless already preloaded from the diagram.
  • Use default property editor for entities or relations when VisualAuthoring.propertyEditor returns undefined.
  • Fix prepareLabels option for SparqlDataProvider to be applied for knownElementTypes(), knownLinkTypes(), elementTypes(), linkTypes(), propertyTypes() and elements.
  • Fix SparqlDataProvider.elements() to always return entities with sorted types.

💅 Polish

  • Allow to set className and style on workspace root when using DefaultWorkspace or ClassicWorkspace.
  • Allow to customize link label style separately for each property type in StandardRelation.
  • Allow to customize relation property editor with the built-in relation type selector RelationTypeSelector.
  • Export LinkMarkerCircle and LinkMarkerDiamond built-in link marker styles in addition to existing LinkMarkerArrowhead:
    • Built-in link markers now use context-stroke as stroke/fill value to match link path color.
  • Provide translation and current language to createEntity() and createRelation() methods of MetadataProvider.
  • Add RdfDataProvider.clear() to clear all added graphs to the provider.
  • Add datatypePredicates option for RdfDataProvider to explicitly place connected NamedNode property values into entity/relation properties as if they were literals.
  • Add originProperty option to CompositeDataProvider and origin to DataProviderDefinition to attach information about source provider for an entity or relation as a property value:
    • DataProviderDefinition.origin replaces previous non-configurable name prop (which is marked as deprecated now).
  • Add any option for ToolbarActionSave property mode to be able to save when either diagram or authoring state has changes.
  • Increase default maximum fallback size when exporting a raster image to 8192x8192 px as it well supported in the current browsers.

Link to the CHANGELOG v0.32.0

v0.31.2

27 Nov 23:25

Choose a tag to compare

🐛 Fixed

  • Fix AnnotationSupport not unsubscribing from AnnotationTopic at unmount which causes two annotations to be created from SelectionActionAnnotate in React development mode.
  • Fix undo/redo history not working after panning or pinch-zoom gesture on touch devices.
  • Fix keyboard hotkeys for selection actions not working after focusing on search input then clicking back on the selection box.

Link to the CHANGELOG v0.31.2

v0.31.1

27 Nov 23:24

Choose a tag to compare

🐛 Fixed

  • Fix incorrect canvas viewport position when zoomToFit() or similar operation is called immediately after element position changes;
  • Omit properties without values in StandardEntity, StandardRelation and ClassicEntity.

Link to the CHANGELOG v0.31.1

v0.31.0

14 Nov 23:00

Choose a tag to compare

🚀 New Features

  • Simplify canvas widgets placement at one or multiple layers:
    • Canvas children are always assumed to be viewport widgets;
    • Add CanvasPlaceAt component to render its children at specified non-viewport canvas layer instead;
    • Support new placement layers: underlay layer to place components under all canvas content, overLinkGeometry layer to place components above link geometry (connections) but under link labels;
    • [💥Breaking] Remove defineCanvasWidget() and SharedCanvasState.setCanvasWidget() (use CanvasPlaceAt to display components at canvas layers instead).
  • Support to import and export diagram layout with custom element and link cell types (derived from Element or Link):
    • Introduce an optional contract for Element or Link-derived cell types to be serializable: SerializableElementCell and SerializableLinkCell;
    • When implemented, the corresponding cell types can be exported and later imported with the diagram;
    • DataDiagramModel.importLayout() will accept known cell types via elementCellTypes and linkCellTypes to import.
  • Support diagram-only annotations:
    • Add AnnotationElement and AnnotationLink elements and links which exports and imports with the diagram but does not exists in the data graph;
    • Rendered by default with new built-in templates NoteTemplate and NoteLinkTemplate which use NoteAnnotation, NoteEntity and NoteLink template components;
    • Add AnnotationSupport canvas widget which enables annotations in the UI (can be configured or disabled via annotations prop on DefaultWorkspace and ClassicWorkspace);
    • Support annotation elements in SelectionActionEstablishLink and new SelectionActionAnnotate components;
    • Support annotation links in LinkActionDelete, LinkActionMoveEndpoint components.
    • Add DefaultRenameLinkProvider and use it by default to allow to change annotation link labels.
  • Support user-resizable element templates with ElementSize template state property:
    • Resizable elements display "box with handles" in the Halo to change the size;
    • Changed element sizes are captured and restored by RestoreGeometry command.
  • Allow to customize link template separately for each link instead of only based on its link type IRI in linkTemplateResolver for Canvas.
  • Allow to configure DropOnCanvas to allow only some drop events and provide items to place on the canvas.
  • Support keyboard hotkeys for LinkAction components to act on a currently selected link.

🐛 Fixed

  • Fix link rendering lagging behind when moving elements.
  • Fix RdfDataProvider.links() returning empty results when called with linkTypeIds parameter.
  • Fix HaloLink and visual authoring link path highlight being rendered on top on elements by placing it onto overLinkGeometry widget layer instead.
  • Fix HaloLink link path highlighting not updating on link re-route.
  • Fix element template state not being restored when ungrouping entities.
  • Fix missing element decorations after re-importing the same diagram.
  • Fix DraggableHandle to avoid using stale onDragHandle and onEndDragHandle prop values.
  • Fix being able to execute disabled SelectionAction via keyboard hotkey.
  • Fix throwing an error while trying to access CanvasApi.metrics members before the Canvas is fully mounted.

⏱ Performance

  • [💥Breaking] Canvas widgets are not automatically updated when parent canvas is rendered to reduce unnecessary re-renders, and now require explicit subscriptions:
    • Subscribe to canvas changeTransform event when using CanvasApi.metrics to convert between coordinates;
    • Subscribe to canvas resize event to track viewport size;
    • Subscribe to changeCells event from DiagramModel to track graph content changes.
  • Add TemplateProps.onlySelected flag to use in the element templates to track if the element is the only one selected without performance penalty.
  • Avoid per-layer frame delay when processing canvas layer updates without calling RenderingState.syncUpdate():
    • Add useLayerDebouncedStore() hook as more flexible way to debounce and update with the canvas layer.
  • Avoid eager link type creation for relation links, only create and fetch them on first render.

💅 Polish

  • [💥Breaking] Use typed TemplateState for Element.elementState and Link.linkState to avoid accidental type mismatch.
  • Make dialogs fill the available viewport when the viewport width is small:
    • This is controlled by new CSS property --reactodia-dialog-viewport-breakpoint-s with default value 600px which makes dialog fill the viewport if the available width is less or equal to that value.
  • Allow to override base z-index level for workspace components with a set z-index value via --reactodia-z-index-base CSS property;
  • Make Halo margin configurable via CSS property --reactodia-selection-single-box-margin.
  • Highlight link path in HaloLink with --reactodia-selection-link-color color by default.
  • Add changeTransform event to CanvasApi.events which triggers on CanvasApi.metrics.getTransform() changes, i.e. when coordinate mapping changes due to scale or canvas size is re-adjusted.
  • Add DiagramModel.cellsVersion property which updates on every element or link addition/removal/reordering to be able to subscribe to changeCells event with useSyncStore() hook.
  • Deprecate canvasWidgets prop on DefaultWorkspace and ClassicWorkspace in favor of passing widgets directly as children.
  • Mark placeholder entity data with PlaceholderDataProperty property key to distinguish not-loaded-yet elements with EntityElement.isPlaceholderData():
    • Add DataDiagramModel.requestData() as a convenient method to load all placeholder entities at once.
  • Move expanded element state from distinct property on Element to be stored in Element.elementState with TemplateProperties.Expanded property:
    • All existing properties, methods and commands works as before but use element template state as storage for expanded state;
    • changeExpanded event is removed from element events, use changeElementState event instead;
    • When exporting the diagram the expanded state is serialized only with elementState while using isExpanded property when importing the diagram for backward compatibility.
  • Introduce ElementTemplate.supports property for templates to tell its capabilities such as ability to expand/collapse or resized by user.
  • Use consistent naming for standard element and link templates:
    • Deprecate DefaultLinkTemplate and DefaultLink and alias them to StandardLinkTemplate and StandardRelation;
    • Change CSS class for standard element template from reactodia-standard-template to reactodia-standard-element;
    • Change CSS class for default link template from reactodia-default-link to reactodia-standard-link;
    • Change translation groups from standard_template / default_link_template to standard_element / standard_link.
  • Move "expand/collapse on double click" global element behavior to StandardEntity and ClassicEntity implementation only.
  • Change MetadataProvider.{createEntity, createRelation} to return result object with initial template state in addition to the data to customize the created cells (i.e. new elements can be expanded or collapsed).
  • Add EditorController.applyAuthoringChanges() method to apply current authoring changes to the diagram (i.e. change entity data, delete relations, etc) and reset the change state to be empty.
  • Deprecate and hide by default "Edit" and "Delete" action buttons in StandardEntity expanded state (can be re-enabled by setting showActions prop to true).
  • Deprecate WorkpaceContext.{group, ungroupAll, ungroupSome} methods in favor of free functions groupEntities(), ungroupAllEntities(), ungroupSomeEntities().

🔧 Maintenance

  • Use Vite to build the library instead of Webpack to reduce build time by 70% and produced bundle size by 38%.
  • Update Vitest to v4.
  • Use small subset of carbon design icons for various buttons.

Link to the CHANGELOG v0.31.0

v0.30.1

26 Jun 23:07

Choose a tag to compare

🐛 Fixed

  • Fix BaseMetadataProvider not delegating canModifyRelation method from object passed in its constructor.
  • Make CanvasApi.{exportSvg, exportRaster} export images referenced in CSS stylesheets or inline styles from mask (mask-image) or background (background-image) CSS properties.
  • Fix incomplete styles for exported canvas due to non-captured custom CSS property values in Chromium-based browsers.
  • Fix issues when setting a mutable selection array, e.g. model.setSelection(model.elements).
  • Fix moving elements with Selection does not adding an undo command to the history.

⏱ Performance

  • Avoid unnecessary component updates in Halo and HaloLink when multiple elements are selected.

💅 Polish

  • Expose contentPadding option for CanvasApi.{exportSvg, exportRaster} methods to configure padding for the exported diagram.

Link to the CHANGELOG v0.30.1

v0.30.0

14 Jun 22:26

Choose a tag to compare

🚀 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

v0.29.1

24 Mar 22:24

Choose a tag to compare

🐛 Fixed

  • Fix "max update exceeded in componentDidUpdate()" error that can be triggered in InstancesSearch in some cases.

Link to the CHANGELOG v0.29.1