Simplify canvas widgets placement at one or multiple specific layers#77
Merged
Conversation
8ede9f6 to
133bb04
Compare
133bb04 to
2126ce6
Compare
* Add `CanvasPlaceAt` component to render a widget at specified non-viewport canvas layer; - Now it is possible to place widgets at `underlay` and `overLinkGeometry` layers; * Add `changeTransform` event to `CanvasApi.events` which triggers on `CanvasApi.metrics.getTransform()` changes; * Add `--reactodia-z-index-base` CSS property to override base z-index level for workspace components with a `z-index` set; * Fix `HaloLink` and visual authoring path highlight being rendered on top on elements by placing it onto `overLinkGeometry` layer; * Deprecate `canvasWidgets` prop on `DefaultWorkspace` and `ClassicWorkspace` in favor of passing widgets directly as children; * **[Breaking]** Remove `defineCanvasWidget()` and `SharedCanvasState.setCanvasWidget()`: - Canvas children are always assumed to be viewport widgets; - Use child `CanvasPlaceAt` components to render different parts at other layers instead. * **[Breaking]** Canvas widgets are not re-rendered when parent canvas is rendered and 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.
2126ce6 to
2cedb44
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.
CanvasPlaceAtcomponent to render a widget at specified non-viewport canvas layer;underlayandoverLinkGeometrylayers;changeTransformevent toCanvasApi.eventswhich triggers onCanvasApi.metrics.getTransform()changes;--reactodia-z-index-baseCSS property to override base z-index level for workspace components with az-indexset;HaloLinkand visual authoring path highlight being rendered on top on elements by placing it ontooverLinkGeometrylayer;canvasWidgetsprop onDefaultWorkspaceandClassicWorkspacein favor of passing widgets directly as children;defineCanvasWidget()andSharedCanvasState.setCanvasWidget():CanvasPlaceAtcomponents to render different parts at other layers instead.changeTransformevent when usingCanvasApi.metricsto convert between coordinates;resizeevent to track viewport size;changeCellsevent fromDiagramModelto track graph content changes.