Merge remote-tracking branch 'origin/master' into aakansha-mermaid

This commit is contained in:
Aakansha Doshi 2023-09-04 13:15:24 +05:30
commit d393a1c048
18 changed files with 342 additions and 158 deletions

View file

@ -1234,6 +1234,7 @@ class App extends React.Component<AppProps, AppState> {
}}
/>
<InteractiveCanvas
containerRef={this.excalidrawContainerRef}
canvas={this.interactiveCanvas}
elements={canvasElements}
visibleElements={visibleElements}
@ -5884,7 +5885,7 @@ class App extends React.Component<AppProps, AppState> {
.map((element) => element.id),
);
const elements = this.scene.getNonDeletedElements();
const elements = this.scene.getElementsIncludingDeleted();
for (const element of elements) {
if (

View file

@ -16,6 +16,7 @@ import type {
import type { NonDeletedExcalidrawElement } from "../../element/types";
type InteractiveCanvasProps = {
containerRef: React.RefObject<HTMLDivElement>;
canvas: HTMLCanvasElement | null;
elements: readonly NonDeletedExcalidrawElement[];
visibleElements: readonly NonDeletedExcalidrawElement[];
@ -105,9 +106,12 @@ const InteractiveCanvas = (props: InteractiveCanvasProps) => {
cursorButton[socketId] = user.button;
});
const selectionColor = getComputedStyle(
document.querySelector(".excalidraw")!,
).getPropertyValue("--color-selection");
const selectionColor =
(props.containerRef?.current &&
getComputedStyle(props.containerRef.current).getPropertyValue(
"--color-selection",
)) ||
"#6965db";
renderInteractiveScene(
{
@ -162,7 +166,7 @@ const InteractiveCanvas = (props: InteractiveCanvasProps) => {
const getRelevantAppStateProps = (
appState: AppState,
): Omit<InteractiveCanvasAppState, "editingElement"> => ({
): InteractiveCanvasAppState => ({
zoom: appState.zoom,
scrollX: appState.scrollX,
scrollY: appState.scrollY,

View file

@ -61,13 +61,7 @@ const StaticCanvas = (props: StaticCanvasProps) => {
const getRelevantAppStateProps = (
appState: AppState,
): Omit<
StaticCanvasAppState,
| "editingElement"
| "selectedElementIds"
| "editingGroupId"
| "frameToHighlight"
> => ({
): StaticCanvasAppState => ({
zoom: appState.zoom,
scrollX: appState.scrollX,
scrollY: appState.scrollY,
@ -84,6 +78,9 @@ const getRelevantAppStateProps = (
selectedElementsAreBeingDragged: appState.selectedElementsAreBeingDragged,
gridSize: appState.gridSize,
frameRendering: appState.frameRendering,
selectedElementIds: appState.selectedElementIds,
frameToHighlight: appState.frameToHighlight,
editingGroupId: appState.editingGroupId,
});
const areEqual = (