Releases: reactodia/reactodia-workspace
Releases · reactodia/reactodia-workspace
Release list
v0.35.1
🐛 Fixed
- Fix relation having changed
databut missing fromAuthoringStatewhen the source or target entity becomes deleted then restored back. - Fix grouped relation (
RelationGroupitem) does not updating itsdatawhen changed byEditorController. - Fix
ConnectionsMenudisplaying no links when there is only a single incoming/outgoing relation type. (by @cristianvasquez) - Restore scroll position in
ConnectionsMenuwhen going back to relation types from instances list. - Exclude collapsed
DropdownMenuandUnifiedSearchcontent from Tab-navigation. - Exclude canvas elements from Tab-navigation unless the element is only one selected.
- Block canvas interacton (including Tab-navigation) when displaying a blocking modal overlay i.e. an overlay task or viewport-centered dialog.
- Fix Tab-navigation order on
DefaultWorkspaceandClassicWorkspaceto generally follow top-to-bottom then left-to-right when moving focus. - Auto-focus within dialogs by default (via
autoFocusprop) to avoid losing focus when a dialog displayed in the modal overlay or opened by already unmounted trigger element.
v0.35.0
🚀 New Features
- Make tree- and list-like components more accessible:
- Change
ClassTree,InstancesSearch,ConnectionsMenu,SearchResultsandDropdownMenuto be "focus group" components with support for keyboard interaction (arrow keys to move focus or toggle tree items, space to select); - Add proper
aria-*attributes for "focus group" containers and children e.g.treeandtreeitemroles;
- Change
- Support creating standalone workspace state (context) separated from UI components:
- Workspace state can be created with
createWorkspace()and provided to the UI components viaWorkspaceProvider; - Allow nested definitions of
WorkspaceRootto use built-in styling outside the workspace component.
- Workspace state can be created with
🐛 Fixed
- Fix partially or fully hidden outlines for
WorkspaceLayoutItemheaders andNavigatortoggle button. - Fix undo/redo not adding or removing graph elements or links after
DataDiagramModel.discardLayout()call (e.g. by a reload fromuseLoadedWorkspace()). - Fix small input width overflow in
UnifiedSearchwhen resized to the minimum size. - Fix
Navigatorto avoid animating expand/collapse transition on the initial mount. - Fix unintended scroll instead of canvas zoom on mouse wheel event over non-scrollable elements rendered with
CanvasPlaceAt(whenzoomOptions.requireCtrlisfalse):- Allow to explicitly prevent zoom on mouse wheel over a non-scrollable element with
data-reactodia-prevent-zoomattribute.
- Allow to explicitly prevent zoom on mouse wheel over a non-scrollable element with
- Fix accidentally moving elements or links with touch controls when panning which were also not recorded in the command history.
⏱ Performance
- Fix canvas panning optimization not being applied due to incorrect
z-indexvalue.
🔧 Maintenance
- Update dev-depencies:
viteto v8,typescriptto v6, other packages to lastest minor versions:sass,vitest,playwright,@comunica/query-sparql-rdfjs-lite, eslint-related.
💅 Polish
- Improve
WorkspaceLayout*item resize handing:- Enable size transition on expand/collapse
WorkspaceLayoutRowitems; - Set a default minimum non-wrapping size on item width via
--reactodia-accordion-item-min-width; - Auto-collapse items after resize if the final size is less than
minSizefor that item; - Prevent toggle buttons on
WorkspaceLayoutRowchildren from being partially hidden when corresponding item is collapsed.
- Enable size transition on expand/collapse
- Export
TranslationProviderandDefaultTranslationto be able to useuseTranslation()outside the workspace component:- Export default (fallback) bundle for
enlanguage:DefaultTranslationBundle. - Remove deprecated
Translation.formatIri()method (useDataLocaleProvider.formatIri()instead).
- Export default (fallback) bundle for
- Extend
CommandBatch.discard()to acceptrevertoption to be able to revert the batch without storing it first. - Always display ungroup buttons on
StandardGroupwhen the element is single-selected. - Allow to configure
SearchResultsutility component withisItemDisabledandmultiSelectionprops:- Remove
singleSelectOnClickmode fromSearchResultsas it mostly superseded bymultiSelection.
- Remove
- Extend
ListElementViewutility component to accept any other additional HTML props.
v0.34.1
🐛 Fixed
- Fix stale/non-saved data when calling
applyChanges()immediately afterupdateData()inEntityEditorandRelationEditor. - Fix
SelectionAction*components not updating on selection change when provided as children toHalo.
💅 Polish
- Allow to control the placement of newly created entity elements from
ClassTreeandSearchSectionElementTypesviaplaceCreatedEntityprop. - Expose
fixedElementsoption forperformLayout()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 witharia-label(i.e. regions); - Add
roleforCanvaslayers,Toolbar,ZoomControl,UnifiedSearch(and other search inputs); - Add
aria-labelandaria-keyshortcutsforToolbarAction,SelectionAction,LinkAction.
- Allow to resize and toggle
v0.34.0
🚀 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
Selectionwith touch whenCanvasApi.pointerModeisselection; - Allow to establish new links with
SelectionActionEstablishLinkon touchscreen; - Allow to move link source or target with
LinkActionMoveEndpointon touchscreen; - Make
ZoomOptions.requireCtrldefault tofalseto zoom without holdingCtrli.e. like on a map. - Enable
showPointerModeToggleonZoomControlby default (can be disabled by passingfalse).
- [💥Breaking] Extend and make optional built-in property editing form support:
- Extract property editor inputs into separate entry point
@reactodia/workspace/formsto be able to use external forms implementation without always bundling the built-in one; - Provide
InputText,InputListandInputSelectbasic form inputs; - Provide
InputFileform input withMemoryFileUploaderimplementation forFileUploadProviderinterface; VisualAuthoringnow requirespropertyEditorprop with changed contract, which have to return an editor component in all cases.DefaultPropertyEditorin combination with imported inputs provides default (built-in) property editing experience, but custom editors can be implemented withEntityEditorandRelationEditor"provider" components.
- Extract property editor inputs into separate entry point
- 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,ClassicEntityandSelectionActionAnchor; - Add
useResolvedAssetUrl()helper hook to simplify resolving asset URLs from components;
- Resolve anchors and image thumbnail URLs in
- Support conditionally rendering
WorkspaceLayout*child components by passingnullinstead of a child to remove it:- Allow to hide left and right panels in
ClassicWorkspaceby passingnullto the corresponding props; - Allow to provide
classNameandstyletoWorkspaceLayout*components.
- Allow to hide left and right panels in
- Add
Translation.textOptional()to support common translation string defaults with ability to provide separate string for each case:- Use
search_defaults.input.placeholderfor a search input field; - Use
visual_authoring.dialog.apply.{label, text}for an "Apply" button inVisualAuthoringdialogs.
- Use
- Allow to customize default dialog sizes for built-in dialogs and persist user-changed sizes with
dialogSettingsProviderprop onWorkspace:- Default provider persists user-changed dialog sizes in-memory based on
dialogType.
- Default provider persists user-changed dialog sizes in-memory based on
💅 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 aDataProvider. - Provide
onlySelectedproperty to link templates the same way as for element templates. - Allow to configure whether
ClassTreeandSearchSectionElementTypestree items should be draggable. - Allow to configure
SparqlDataProvider.lookup()vialookupQueryandfilterInnerPreludesettings.
🔧 Maintenance
- Preparations to extract generic scrollable paper component
Paperfrom diagram-specific state and logic:- Replace
reactodia-paper-areaCSS class byreactodia-canvas-areaandreactodia-paper. - Deprecate
CanvasMetrics.areain favor ofCanvasMetrics.pane.
- Replace
- Remove
AbortScopeutility class (can be trivially replaced by the built-inAbortSignal.any()function).
v0.33.0
🚀 New Features
- Allow to open "Edit entity" dialog from
VisualAuthoringfor 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
sourceandtargetentities toMetadataProvider.getRelationShape().
- Allow to order properties with
🐛 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
requireCtrlinzoomOptionsis setfalse. - 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
Selectioncomponent. - Re-validate entities and links with
ValidationProviderwhen added or removed via undo/redo. - Fix marking
AnnotationLinkwithTemplateProperties.LayoutOnlywhen importing a diagram layout.
💅 Polish
- Remove superfluous "Type" fields from the default "Edit entity" dialog.
- Provide
translationand currentlanguagetoValidationProvider.validate()method. - Allow to specify related property IRI when returning a validation item for a relation from
ValidationProvider. - Display language selector in
FormInputTextonly when shapedatatypeisrdf:langStringoruniqueLangis set to eithertrueorfalse(the selector will be hidden by default whendatatypeisxsd:string). - Deprecate getting
Translationinstance fromWorkspaceContext: useuseTranslation()hook instead to be able to subscribe to translation bundle changes in the future.
v0.32.0
🐛 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 methodReact warning when callingcenterTo(),centerContent(),zoomToFit()onCanvasApifrom a lifecycle method. - Fix labels not loading for element and link type selectors in
VisualAuthoringdialogs unless already preloaded from the diagram. - Use default property editor for entities or relations when
VisualAuthoring.propertyEditorreturnsundefined. - Fix
prepareLabelsoption forSparqlDataProviderto be applied forknownElementTypes(),knownLinkTypes(),elementTypes(),linkTypes(),propertyTypes()andelements. - Fix
SparqlDataProvider.elements()to always return entities with sorted types.
💅 Polish
- Allow to set
classNameandstyleon workspace root when usingDefaultWorkspaceorClassicWorkspace. - 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
LinkMarkerCircleandLinkMarkerDiamondbuilt-in link marker styles in addition to existingLinkMarkerArrowhead:- Built-in link markers now use
context-strokeasstroke/fillvalue to match link path color.
- Built-in link markers now use
- Provide
translationand currentlanguagetocreateEntity()andcreateRelation()methods ofMetadataProvider. - Add
RdfDataProvider.clear()to clear all added graphs to the provider. - Add
datatypePredicatesoption forRdfDataProviderto explicitly place connectedNamedNodeproperty values into entity/relation properties as if they were literals. - Add
originPropertyoption toCompositeDataProviderandorigintoDataProviderDefinitionto attach information about source provider for an entity or relation as a property value:DataProviderDefinition.originreplaces previous non-configurablenameprop (which is marked as deprecated now).
- Add
anyoption forToolbarActionSavepropertymodeto 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.
v0.31.2
🐛 Fixed
- Fix
AnnotationSupportnot unsubscribing fromAnnotationTopicat unmount which causes two annotations to be created fromSelectionActionAnnotatein 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.
v0.31.1
🐛 Fixed
- Fix incorrect canvas viewport position when
zoomToFit()or similar operation is called immediately after element position changes; - Omit properties without values in
StandardEntity,StandardRelationandClassicEntity.
v0.31.0
🚀 New Features
- Simplify canvas widgets placement at one or multiple layers:
- Canvas children are always assumed to be viewport widgets;
- Add
CanvasPlaceAtcomponent to render its children at specified non-viewport canvas layer instead; - Support new placement layers:
underlaylayer to place components under all canvas content,overLinkGeometrylayer to place components above link geometry (connections) but under link labels; - [💥Breaking] Remove
defineCanvasWidget()andSharedCanvasState.setCanvasWidget()(useCanvasPlaceAtto display components at canvas layers instead).
- Support to import and export diagram layout with custom element and link cell types (derived from
ElementorLink):- Introduce an optional contract for
ElementorLink-derived cell types to be serializable:SerializableElementCellandSerializableLinkCell; - When implemented, the corresponding cell types can be exported and later imported with the diagram;
DataDiagramModel.importLayout()will accept known cell types viaelementCellTypesandlinkCellTypesto import.
- Introduce an optional contract for
- Support diagram-only annotations:
- Add
AnnotationElementandAnnotationLinkelements 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
NoteTemplateandNoteLinkTemplatewhich useNoteAnnotation,NoteEntityandNoteLinktemplate components; - Add
AnnotationSupportcanvas widget which enables annotations in the UI (can be configured or disabled viaannotationsprop onDefaultWorkspaceandClassicWorkspace); - Support annotation elements in
SelectionActionEstablishLinkand newSelectionActionAnnotatecomponents; - Support annotation links in
LinkActionDelete,LinkActionMoveEndpointcomponents. - Add
DefaultRenameLinkProviderand use it by default to allow to change annotation link labels.
- Add
- Support user-resizable element templates with
ElementSizetemplate state property:- Resizable elements display "box with handles" in the
Haloto change the size; - Changed element sizes are captured and restored by
RestoreGeometrycommand.
- Resizable elements display "box with handles" in the
- Allow to customize link template separately for each link instead of only based on its link type IRI in
linkTemplateResolverforCanvas. - Allow to configure
DropOnCanvasto allow only some drop events and provide items to place on the canvas. - Support keyboard hotkeys for
LinkActioncomponents to act on a currently selected link.
🐛 Fixed
- Fix link rendering lagging behind when moving elements.
- Fix
RdfDataProvider.links()returning empty results when called withlinkTypeIdsparameter. - Fix
HaloLinkand visual authoring link path highlight being rendered on top on elements by placing it ontooverLinkGeometrywidget layer instead. - Fix
HaloLinklink 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
DraggableHandleto avoid using staleonDragHandleandonEndDragHandleprop values. - Fix being able to execute disabled
SelectionActionvia keyboard hotkey. - Fix throwing an error while trying to access
CanvasApi.metricsmembers before theCanvasis 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
changeTransformevent when usingCanvasApi.metricsto convert between coordinates; - Subscribe to canvas
resizeevent to track viewport size; - Subscribe to
changeCellsevent fromDiagramModelto track graph content changes.
- Subscribe to canvas
- Add
TemplateProps.onlySelectedflag 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.
- Add
- Avoid eager link type creation for relation links, only create and fetch them on first render.
💅 Polish
- [💥Breaking] Use typed
TemplateStateforElement.elementStateandLink.linkStateto 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-swith default value600pxwhich makes dialog fill the viewport if the available width is less or equal to that value.
- This is controlled by new CSS property
- Allow to override base z-index level for workspace components with a set z-index value via
--reactodia-z-index-baseCSS property; - Make
Halomargin configurable via CSS property--reactodia-selection-single-box-margin. - Highlight link path in
HaloLinkwith--reactodia-selection-link-colorcolor by default. - Add
changeTransformevent toCanvasApi.eventswhich triggers onCanvasApi.metrics.getTransform()changes, i.e. when coordinate mapping changes due to scale or canvas size is re-adjusted. - Add
DiagramModel.cellsVersionproperty which updates on every element or link addition/removal/reordering to be able to subscribe tochangeCellsevent withuseSyncStore()hook. - Deprecate
canvasWidgetsprop onDefaultWorkspaceandClassicWorkspacein favor of passing widgets directly as children. - Mark placeholder entity data with
PlaceholderDataPropertyproperty key to distinguish not-loaded-yet elements withEntityElement.isPlaceholderData():- Add
DataDiagramModel.requestData()as a convenient method to load all placeholder entities at once.
- Add
- Move expanded element state from distinct property on
Elementto be stored inElement.elementStatewithTemplateProperties.Expandedproperty:- All existing properties, methods and commands works as before but use element template state as storage for expanded state;
changeExpandedevent is removed from element events, usechangeElementStateevent instead;- When exporting the diagram the expanded state is serialized only with
elementStatewhile usingisExpandedproperty when importing the diagram for backward compatibility.
- Introduce
ElementTemplate.supportsproperty 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
DefaultLinkTemplateandDefaultLinkand alias them toStandardLinkTemplateandStandardRelation; - Change CSS class for standard element template from
reactodia-standard-templatetoreactodia-standard-element; - Change CSS class for default link template from
reactodia-default-linktoreactodia-standard-link; - Change translation groups from
standard_template/default_link_templatetostandard_element/standard_link.
- Deprecate
- Move "expand/collapse on double click" global element behavior to
StandardEntityandClassicEntityimplementation 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
StandardEntityexpanded state (can be re-enabled by settingshowActionsprop totrue). - Deprecate
WorkpaceContext.{group, ungroupAll, ungroupSome}methods in favor of free functionsgroupEntities(),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.
v0.30.1
🐛 Fixed
- Fix
BaseMetadataProvidernot delegatingcanModifyRelationmethod from object passed in its constructor. - Make
CanvasApi.{exportSvg, exportRaster}export images referenced in CSS stylesheets or inline styles frommask(mask-image) orbackground(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
Selectiondoes not adding an undo command to the history.
⏱ Performance
- Avoid unnecessary component updates in
HaloandHaloLinkwhen multiple elements are selected.
💅 Polish
- Expose
contentPaddingoption forCanvasApi.{exportSvg, exportRaster}methods to configure padding for the exported diagram.