Support diagram-only annotation elements and links#82
Merged
Conversation
591a21b to
7430ee8
Compare
* Add `AnnotationElement` and `AnnotationLink` diagram cell types representing diagram-only elements and links which exports and imports with the diagram but does not exists in the data graph: - Support annotation elements in `SelectionActionEstablishLink` and new `SelectionActionAnnotate` components; - Support annotation links in `LinkActionDelete`, `LinkActionMoveEndpoint` components. * Display and edit annotations with new built-in templates `NoteTemplate` and `NoteLinkTemplate` which use `NoteAnnotation`, `NoteEntity` and `NoteLink` template components: - Change `defaultElementTemplate` to `defaultElementResolver`, `defaultLinkTemplate` to `defaultLinkResolver` in `SharedCanvasState` to support new default fallbacks. * Add `AnnotationContent` and `ColorVariant` element template state properties to support editable annotations: - Support `ColorVariant` template state property as default fallback for non-entity elements in `typeStyleResolver`. * 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; - Add `setTemplateProperty()` utility function to easily set or unset template state property. * Add `ElementTemplate.supports` property to tell template capabilities such as ability to expand/collapse or resized by user. * Add `TemplateProps.onlySelected` flag to use in the element templates to track if the element is the only one selected without performance penalty. * 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. * Fix `DraggableHandle` to avoid using stale `onDragHandle` and `onEndDragHandle` prop values. * Refactor various places to support annotations: - Extract internal `DragLinkMover` as a utility component to use as base for `DragEditLayer` and `AnnotationLinkMover`; - Add internal `ContentEditablePlaintext` utility component; - Add internal `ResizableBox` utility component; * Use small subset of [carbon design icons](https://github.com/carbon-design-system/carbon-icons) for various buttons.
7430ee8 to
a7d6361
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AnnotationElementandAnnotationLinkdiagram cell types representing diagram-only elements and links which exports and imports with the diagram but does not exists in the data graph:SelectionActionEstablishLinkand newSelectionActionAnnotatecomponents;LinkActionDelete,LinkActionMoveEndpointcomponents.NoteTemplateandNoteLinkTemplatewhich useNoteAnnotation,NoteEntityandNoteLinktemplate components:defaultElementTemplatetodefaultElementResolver,defaultLinkTemplatetodefaultLinkResolverinSharedCanvasStateto support new default fallbacks.AnnotationContentandColorVariantelement template state properties to support editable annotations:ColorVarianttemplate state property as default fallback for non-entity elements intypeStyleResolver.ElementSizetemplate state property andElementTemplate.resizableflag:Haloto change the size;RestoreGeometrycommand;setTemplateProperty()utility function to easily set or unset template state property.TemplateProps.onlySelectedflag to use in the element templates to track if the element is the only one selected without performance penalty.Halomargin configurable via CSS property--reactodia-selection-single-box-margin.HaloLinkwith--reactodia-selection-link-colorcolor by default.DraggableHandleto avoid using staleonDragHandleandonEndDragHandleprop values.DragLinkMoveras a utility component to use as base forDragEditLayerandAnnotationLinkMover;ContentEditablePlaintextutility component;ResizableBoxutility component;