docstring_tokens
stringlengths 18
16.9k
| code_tokens
stringlengths 75
1.81M
| html_url
stringlengths 74
116
| file_name
stringlengths 3
311
|
---|---|---|---|
keep keep add keep keep keep keep
|
<mask> if (onClose) {
<mask> onClose();
<mask> }
<mask> }, [onClose]);
<mask>
<mask> return (
<mask> <>
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> add event.stopPropagation(); </s> add event.stopPropagation(); </s> remove perform: (_elements, appState) => {
</s> add perform: (_elements, appState, _, { focusContainer }) => {
if (appState.showHelpDialog) {
focusContainer();
} </s> remove private onKeyDown = withBatchedUpdates((event: KeyboardEvent) => {
// normalize `event.key` when CapsLock is pressed #2372
if (
"Proxy" in window &&
((!event.shiftKey && /^[A-Z]$/.test(event.key)) ||
(event.shiftKey && /^[a-z]$/.test(event.key)))
) {
event = new Proxy(event, {
get(ev: any, prop) {
const value = ev[prop];
if (typeof value === "function") {
// fix for Proxies hijacking `this`
return value.bind(ev);
}
return prop === "key"
? // CapsLock inverts capitalization based on ShiftKey, so invert
// it back
event.shiftKey
? ev.key.toUpperCase()
: ev.key.toLowerCase()
: value;
},
});
}
if (
(isWritableElement(event.target) && event.key !== KEYS.ESCAPE) ||
// case: using arrows to move between buttons
(isArrowKey(event.key) && isInputLike(event.target))
) {
return;
}
</s> add private onKeyDown = withBatchedUpdates(
(event: React.KeyboardEvent | KeyboardEvent) => {
// normalize `event.key` when CapsLock is pressed #2372
if (
"Proxy" in window &&
((!event.shiftKey && /^[A-Z]$/.test(event.key)) ||
(event.shiftKey && /^[a-z]$/.test(event.key)))
) {
event = new Proxy(event, {
get(ev: any, prop) {
const value = ev[prop];
if (typeof value === "function") {
// fix for Proxies hijacking `this`
return value.bind(ev);
}
return prop === "key"
? // CapsLock inverts capitalization based on ShiftKey, so invert
// it back
event.shiftKey
? ev.key.toUpperCase()
: ev.key.toLowerCase()
: value;
},
});
} </s> remove className={clsx("excalidraw", {
</s> add className={clsx("excalidraw excalidraw-container", { </s> remove }
if (event.key === KEYS.SPACE && gesture.pointers.size === 0) {
isHoldingSpace = true;
setCursor(this.canvas, CURSOR_TYPE.GRABBING);
}
});
</s> add },
);
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/components/ErrorDialog.tsx
|
keep keep keep add keep keep keep keep
|
<mask> event.preventDefault();
<mask> onClose();
<mask> }
<mask> event.nativeEvent.stopImmediatePropagation();
<mask> };
<mask>
<mask> return (
<mask> <div
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> add event.stopPropagation(); </s> add document.querySelector<HTMLElement>(".excalidraw-container")?.focus(); </s> add event.stopPropagation(); </s> remove className={clsx("excalidraw", {
</s> add className={clsx("excalidraw excalidraw-container", { </s> add focusContainer={this.focusContainer} </s> add public focusContainer = () => {
this.excalidrawContainerRef.current?.focus();
};
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/components/IconPicker.tsx
|
keep add keep keep keep keep keep
|
<mask> libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
<mask> UIOptions: AppProps["UIOptions"];
<mask> }
<mask>
<mask> const useOnClickOutside = (
<mask> ref: RefObject<HTMLElement>,
<mask> cb: (event: MouseEvent) => void,
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> add focusContainer: () => void; </s> add focusContainer: () => void; </s> add focusContainer, </s> add focusNearestParent(event.target); </s> add event.stopPropagation(); </s> add focusContainer,
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/components/LayerUI.tsx
|
keep keep keep add keep keep keep keep keep
|
<mask> pendingElements,
<mask> setAppState,
<mask> setLibraryItems,
<mask> libraryReturnUrl,
<mask> }: {
<mask> library: LibraryItems;
<mask> pendingElements: LibraryItem;
<mask> onRemoveFromLibrary: (index: number) => void;
<mask> onInsertShape: (elements: LibraryItem) => void;
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> add focusContainer, </s> add focusContainer, </s> add focusContainer: () => void; </s> remove app: { canvas: HTMLCanvasElement | null },
</s> add app: AppAPI, </s> add focusContainer: () => void; </s> add import { focusNearestParent } from "../utils";
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/components/LayerUI.tsx
|
keep add keep keep keep keep keep keep
|
<mask> setLibraryItems: (library: LibraryItems) => void;
<mask> libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
<mask> }) => {
<mask> const isMobile = useIsMobile();
<mask> const numCells = library.length + (pendingElements.length > 0 ? 1 : 0);
<mask> const CELLS_PER_ROW = isMobile ? 4 : 6;
<mask> const numRows = Math.max(1, Math.ceil(numCells / CELLS_PER_ROW));
<mask> const rows = [];
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> add focusContainer, </s> remove window.document.activeElement.blur();
</s> add focusContainer(); </s> remove selectedElements.forEach((element) => {
mutateElement(element, {
x: element.x + offsetX,
y: element.y + offsetY,
});
</s> add if (isArrowKey(event.key)) {
const step =
(this.state.gridSize &&
(event.shiftKey
? ELEMENT_TRANSLATE_AMOUNT
: this.state.gridSize)) ||
(event.shiftKey
? ELEMENT_SHIFT_TRANSLATE_AMOUNT
: ELEMENT_TRANSLATE_AMOUNT);
const selectedElements = this.scene
.getElements()
.filter((element) => this.state.selectedElementIds[element.id]);
let offsetX = 0;
let offsetY = 0;
if (event.key === KEYS.ARROW_LEFT) {
offsetX = -step;
} else if (event.key === KEYS.ARROW_RIGHT) {
offsetX = step;
} else if (event.key === KEYS.ARROW_UP) {
offsetY = -step;
} else if (event.key === KEYS.ARROW_DOWN) {
offsetY = step;
}
selectedElements.forEach((element) => {
mutateElement(element, {
x: element.x + offsetX,
y: element.y + offsetY,
}); </s> remove if (isArrowKey(event.key)) {
const step =
(this.state.gridSize &&
(event.shiftKey ? ELEMENT_TRANSLATE_AMOUNT : this.state.gridSize)) ||
(event.shiftKey
? ELEMENT_SHIFT_TRANSLATE_AMOUNT
: ELEMENT_TRANSLATE_AMOUNT);
const selectedElements = this.scene
.getElements()
.filter((element) => this.state.selectedElementIds[element.id]);
let offsetX = 0;
let offsetY = 0;
if (event.key === KEYS.ARROW_LEFT) {
offsetX = -step;
} else if (event.key === KEYS.ARROW_RIGHT) {
offsetX = step;
} else if (event.key === KEYS.ARROW_UP) {
offsetY = -step;
} else if (event.key === KEYS.ARROW_DOWN) {
offsetY = step;
</s> add if (event.code === CODES.NINE) {
this.setState({ isLibraryOpen: !this.state.isLibraryOpen }); </s> add focusContainer: () => void; </s> add focusContainer: () => void;
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/components/LayerUI.tsx
|
keep add keep keep keep keep keep
|
<mask> Library.resetLibrary();
<mask> setLibraryItems([]);
<mask> }
<mask> }}
<mask> />
<mask> </>
<mask> )}
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove <HelpDialog onClose={() => setAppState({ showHelpDialog: false })} />
</s> add <HelpDialog
onClose={() => {
const helpIcon = document.querySelector(
".help-icon",
)! as HTMLElement;
helpIcon.focus();
setAppState({ showHelpDialog: false });
}}
/> </s> add focusContainer={focusContainer} </s> add focusContainer={this.focusContainer} </s> add tabIndex={0} </s> add handleKeyboardGlobally={handleKeyboardGlobally} </s> add handleKeyboardGlobally={true}
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/components/LayerUI.tsx
|
keep keep keep add keep keep keep keep keep keep
|
<mask> pendingElements,
<mask> onAddToLibrary,
<mask> setAppState,
<mask> libraryReturnUrl,
<mask> }: {
<mask> pendingElements: LibraryItem;
<mask> onClickOutside: (event: MouseEvent) => void;
<mask> onInsertShape: (elements: LibraryItem) => void;
<mask> onAddToLibrary: () => void;
<mask> setAppState: React.Component<any, AppState>["setState"];
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> add focusContainer, </s> add focusContainer: () => void; </s> add focusContainer: () => void; </s> remove handleKeyDown: (event: KeyboardEvent) => boolean;
</s> add handleKeyDown: (event: React.KeyboardEvent | KeyboardEvent) => boolean; </s> add focusContainer: () => void; </s> add focusContainer,
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/components/LayerUI.tsx
|
keep keep add keep keep keep keep keep
|
<mask> onAddToLibrary: () => void;
<mask> setAppState: React.Component<any, AppState>["setState"];
<mask> libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
<mask> }) => {
<mask> const ref = useRef<HTMLDivElement | null>(null);
<mask> useOnClickOutside(ref, (event) => {
<mask> // If click on the library icon, do nothing.
<mask> if ((event.target as Element).closest(".ToolIcon_type_button__library")) {
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> add focusContainer, </s> add focusContainer: () => void; </s> remove type App = { canvas: HTMLCanvasElement | null; props: AppProps };
</s> add type App = {
canvas: HTMLCanvasElement | null;
focusContainer: () => void;
props: AppProps;
}; </s> add focusContainer: () => void; </s> remove fireEvent.keyDown(document, { key: KEYS.ESCAPE });
</s> add fireEvent.keyDown(document, {
key: KEYS.ESCAPE,
}); </s> remove fireEvent.keyDown(document, { key: KEYS.ESCAPE });
</s> add fireEvent.keyDown(document, {
key: KEYS.ESCAPE,
});
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/components/LayerUI.tsx
|
keep keep add keep keep keep keep keep keep
|
<mask> setAppState={setAppState}
<mask> setLibraryItems={setLibraryItems}
<mask> libraryReturnUrl={libraryReturnUrl}
<mask> />
<mask> )}
<mask> </Island>
<mask> );
<mask> };
<mask>
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> add focusContainer={focusContainer} </s> remove <HelpDialog onClose={() => setAppState({ showHelpDialog: false })} />
</s> add <HelpDialog
onClose={() => {
const helpIcon = document.querySelector(
".help-icon",
)! as HTMLElement;
helpIcon.focus();
setAppState({ showHelpDialog: false });
}}
/> </s> add handleKeyboardGlobally={handleKeyboardGlobally} </s> add focusContainer(); </s> add focusContainer={this.focusContainer} </s> add handleKeyboardGlobally: boolean;
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/components/LayerUI.tsx
|
keep add keep keep keep keep keep keep
|
<mask> libraryReturnUrl,
<mask> UIOptions,
<mask> }: LayerUIProps) => {
<mask> const isMobile = useIsMobile();
<mask>
<mask> const renderEncryptedIcon = () => (
<mask> <a
<mask> className={clsx("encrypted-icon tooltip zen-mode-visibility", {
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> add focusContainer: () => void; </s> add focusContainer, </s> add focusContainer, </s> remove describe("add element to the scene when pointer dragging long enough", () => {
it("rectangle", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("rectangle");
fireEvent.click(tool);
</s> add describe("Test dragCreate", () => {
describe("add element to the scene when pointer dragging long enough", () => {
it("rectangle", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("rectangle");
fireEvent.click(tool); </s> add if (this.excalidrawContainerRef.current) {
this.focusContainer();
}
</s> remove it("rectangle", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("rectangle");
fireEvent.click(tool);
</s> add it("rectangle", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("rectangle");
fireEvent.click(tool);
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/components/LayerUI.tsx
|
keep keep add keep keep keep keep keep keep
|
<mask> onAddToLibrary={deselectItems}
<mask> setAppState={setAppState}
<mask> libraryReturnUrl={libraryReturnUrl}
<mask> />
<mask> ) : null;
<mask>
<mask> const renderFixedSideContainer = () => {
<mask> const shouldRenderSelectedShapeActions = showSelectedShapeActions(
<mask> appState,
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> add focusContainer={focusContainer} </s> add focusContainer: () => void; </s> remove <HelpDialog onClose={() => setAppState({ showHelpDialog: false })} />
</s> add <HelpDialog
onClose={() => {
const helpIcon = document.querySelector(
".help-icon",
)! as HTMLElement;
helpIcon.focus();
setAppState({ showHelpDialog: false });
}}
/> </s> remove perform: (elements, appState, _, { canvas }) => {
</s> add perform: (elements, appState, _, { canvas, focusContainer }) => { </s> remove describe("add element to the scene when pointer dragging long enough", () => {
it("rectangle", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("rectangle");
fireEvent.click(tool);
</s> add describe("Test dragCreate", () => {
describe("add element to the scene when pointer dragging long enough", () => {
it("rectangle", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("rectangle");
fireEvent.click(tool); </s> remove it("rectangle", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("rectangle");
fireEvent.click(tool);
</s> add it("rectangle", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("rectangle");
fireEvent.click(tool);
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/components/LayerUI.tsx
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> onClose={() => setAppState({ errorMessage: null })}
<mask> />
<mask> )}
<mask> {appState.showHelpDialog && (
<mask> <HelpDialog onClose={() => setAppState({ showHelpDialog: false })} />
<mask> )}
<mask> {appState.pasteDialog.shown && (
<mask> <PasteChartDialog
<mask> setAppState={setAppState}
<mask> appState={appState}
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> add focusContainer={focusContainer} </s> add focusContainer={this.focusContainer} </s> add focusContainer(); </s> add handleKeyboardGlobally={true} </s> remove className={clsx("excalidraw", {
</s> add className={clsx("excalidraw excalidraw-container", { </s> add focusContainer={focusContainer}
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/components/LayerUI.tsx
|
keep keep add keep keep keep keep
|
<mask> border-radius: 6px;
<mask> box-sizing: border-box;
<mask>
<mask> @include isMobile {
<mask> max-width: 100%;
<mask> border: 0;
<mask> border-radius: 0;
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove if (isArrowKey(event.key)) {
const step =
(this.state.gridSize &&
(event.shiftKey ? ELEMENT_TRANSLATE_AMOUNT : this.state.gridSize)) ||
(event.shiftKey
? ELEMENT_SHIFT_TRANSLATE_AMOUNT
: ELEMENT_TRANSLATE_AMOUNT);
const selectedElements = this.scene
.getElements()
.filter((element) => this.state.selectedElementIds[element.id]);
let offsetX = 0;
let offsetY = 0;
if (event.key === KEYS.ARROW_LEFT) {
offsetX = -step;
} else if (event.key === KEYS.ARROW_RIGHT) {
offsetX = step;
} else if (event.key === KEYS.ARROW_UP) {
offsetY = -step;
} else if (event.key === KEYS.ARROW_DOWN) {
offsetY = step;
</s> add if (event.code === CODES.NINE) {
this.setState({ isLibraryOpen: !this.state.isLibraryOpen }); </s> remove selectedElements.forEach((element) => {
mutateElement(element, {
x: element.x + offsetX,
y: element.y + offsetY,
});
</s> add if (isArrowKey(event.key)) {
const step =
(this.state.gridSize &&
(event.shiftKey
? ELEMENT_TRANSLATE_AMOUNT
: this.state.gridSize)) ||
(event.shiftKey
? ELEMENT_SHIFT_TRANSLATE_AMOUNT
: ELEMENT_TRANSLATE_AMOUNT);
const selectedElements = this.scene
.getElements()
.filter((element) => this.state.selectedElementIds[element.id]);
let offsetX = 0;
let offsetY = 0;
if (event.key === KEYS.ARROW_LEFT) {
offsetX = -step;
} else if (event.key === KEYS.ARROW_RIGHT) {
offsetX = step;
} else if (event.key === KEYS.ARROW_UP) {
offsetY = -step;
} else if (event.key === KEYS.ARROW_DOWN) {
offsetY = step;
}
selectedElements.forEach((element) => {
mutateElement(element, {
x: element.x + offsetX,
y: element.y + offsetY,
}); </s> add &:focus {
outline: none;
}
</s> add focusContainer, </s> add if (this.excalidrawContainerRef.current) {
this.focusContainer();
}
</s> add focusContainer: () => void;
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/components/Modal.scss
|
keep keep add keep keep keep keep keep
|
<mask> const handleKeydown = (event: React.KeyboardEvent) => {
<mask> if (event.key === KEYS.ESCAPE) {
<mask> event.nativeEvent.stopImmediatePropagation();
<mask> props.onCloseRequest();
<mask> }
<mask> };
<mask>
<mask> return createPortal(
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> add focusNearestParent(event.target); </s> remove if (isArrowKey(event.key)) {
const step =
(this.state.gridSize &&
(event.shiftKey ? ELEMENT_TRANSLATE_AMOUNT : this.state.gridSize)) ||
(event.shiftKey
? ELEMENT_SHIFT_TRANSLATE_AMOUNT
: ELEMENT_TRANSLATE_AMOUNT);
const selectedElements = this.scene
.getElements()
.filter((element) => this.state.selectedElementIds[element.id]);
let offsetX = 0;
let offsetY = 0;
if (event.key === KEYS.ARROW_LEFT) {
offsetX = -step;
} else if (event.key === KEYS.ARROW_RIGHT) {
offsetX = step;
} else if (event.key === KEYS.ARROW_UP) {
offsetY = -step;
} else if (event.key === KEYS.ARROW_DOWN) {
offsetY = step;
</s> add if (event.code === CODES.NINE) {
this.setState({ isLibraryOpen: !this.state.isLibraryOpen }); </s> remove }
if (event.key === KEYS.SPACE && gesture.pointers.size === 0) {
isHoldingSpace = true;
setCursor(this.canvas, CURSOR_TYPE.GRABBING);
}
});
</s> add },
); </s> remove selectedElements.forEach((element) => {
mutateElement(element, {
x: element.x + offsetX,
y: element.y + offsetY,
});
</s> add if (isArrowKey(event.key)) {
const step =
(this.state.gridSize &&
(event.shiftKey
? ELEMENT_TRANSLATE_AMOUNT
: this.state.gridSize)) ||
(event.shiftKey
? ELEMENT_SHIFT_TRANSLATE_AMOUNT
: ELEMENT_TRANSLATE_AMOUNT);
const selectedElements = this.scene
.getElements()
.filter((element) => this.state.selectedElementIds[element.id]);
let offsetX = 0;
let offsetY = 0;
if (event.key === KEYS.ARROW_LEFT) {
offsetX = -step;
} else if (event.key === KEYS.ARROW_RIGHT) {
offsetX = step;
} else if (event.key === KEYS.ARROW_UP) {
offsetY = -step;
} else if (event.key === KEYS.ARROW_DOWN) {
offsetY = step;
}
selectedElements.forEach((element) => {
mutateElement(element, {
x: element.x + offsetX,
y: element.y + offsetY,
}); </s> remove } else if (
!event.ctrlKey &&
!event.altKey &&
!event.metaKey &&
this.state.draggingElement === null
) {
const shape = findShapeByKey(event.key);
if (shape) {
this.selectShapeTool(shape);
} else if (event.key === KEYS.Q) {
this.toggleLock();
</s> add if (event.key === KEYS.SPACE && gesture.pointers.size === 0) {
isHoldingSpace = true;
setCursor(this.canvas, CURSOR_TYPE.GRABBING); </s> remove event.preventDefault();
} else if (event.key === KEYS.ENTER) {
const selectedElements = getSelectedElements(
this.scene.getElements(),
this.state,
);
</s> add event.preventDefault();
} else if (event.key === KEYS.ENTER) {
const selectedElements = getSelectedElements(
this.scene.getElements(),
this.state,
);
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/components/Modal.tsx
|
keep keep keep add keep keep keep keep
|
<mask> <div className="Modal__background" onClick={props.onCloseRequest}></div>
<mask> <div
<mask> className="Modal__content"
<mask> style={{ "--max-width": `${props.maxWidth}px` }}
<mask> >
<mask> {props.children}
<mask> </div>
<mask> </div>,
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> add focusContainer={this.focusContainer} </s> add event.stopPropagation(); </s> add event.stopPropagation(); </s> remove className={clsx("excalidraw", {
</s> add className={clsx("excalidraw excalidraw-container", { </s> add focusContainer(); </s> add tabIndex={0}
onKeyDown={
this.props.handleKeyboardGlobally ? undefined : this.onKeyDown
}
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/components/Modal.tsx
|
keep keep add keep keep keep keep
|
<mask> import "./TextInput.scss";
<mask>
<mask> import React, { Component } from "react";
<mask>
<mask> type Props = {
<mask> value: string;
<mask> onChange: (value: string) => void;
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove type App = { canvas: HTMLCanvasElement | null; props: AppProps };
</s> add type App = {
canvas: HTMLCanvasElement | null;
focusContainer: () => void;
props: AppProps;
}; </s> remove perform: (elements, appState, _, { canvas }) => {
</s> add perform: (elements, appState, _, { canvas, focusContainer }) => { </s> remove app: { canvas: HTMLCanvasElement | null },
</s> add app: AppAPI, </s> add focusContainer: () => void; </s> add type AppAPI = { canvas: HTMLCanvasElement | null; focusContainer(): void };
</s> add handleKeyboardGlobally?: boolean;
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/components/ProjectName.tsx
|
keep add keep keep keep keep keep
|
<mask> };
<mask> private handleBlur = (event: any) => {
<mask> const value = event.target.value;
<mask> if (value !== this.props.value) {
<mask> this.props.onChange(value);
<mask> }
<mask> };
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> add event.stopPropagation(); </s> add } finally {
this.focusContainer(); </s> add export const focusNearestParent = (element: HTMLInputElement) => {
let parent = element.parentElement;
while (parent) {
if (parent.tabIndex > -1) {
parent.focus();
return;
}
parent = parent.parentElement;
}
}; </s> add public focusContainer = () => {
this.excalidrawContainerRef.current?.focus();
};
</s> remove private onKeyDown = withBatchedUpdates((event: KeyboardEvent) => {
// normalize `event.key` when CapsLock is pressed #2372
if (
"Proxy" in window &&
((!event.shiftKey && /^[A-Z]$/.test(event.key)) ||
(event.shiftKey && /^[a-z]$/.test(event.key)))
) {
event = new Proxy(event, {
get(ev: any, prop) {
const value = ev[prop];
if (typeof value === "function") {
// fix for Proxies hijacking `this`
return value.bind(ev);
}
return prop === "key"
? // CapsLock inverts capitalization based on ShiftKey, so invert
// it back
event.shiftKey
? ev.key.toUpperCase()
: ev.key.toLowerCase()
: value;
},
});
}
if (
(isWritableElement(event.target) && event.key !== KEYS.ESCAPE) ||
// case: using arrows to move between buttons
(isArrowKey(event.key) && isInputLike(event.target))
) {
return;
}
</s> add private onKeyDown = withBatchedUpdates(
(event: React.KeyboardEvent | KeyboardEvent) => {
// normalize `event.key` when CapsLock is pressed #2372
if (
"Proxy" in window &&
((!event.shiftKey && /^[A-Z]$/.test(event.key)) ||
(event.shiftKey && /^[a-z]$/.test(event.key)))
) {
event = new Proxy(event, {
get(ev: any, prop) {
const value = ev[prop];
if (typeof value === "function") {
// fix for Proxies hijacking `this`
return value.bind(ev);
}
return prop === "key"
? // CapsLock inverts capitalization based on ShiftKey, so invert
// it back
event.shiftKey
? ev.key.toUpperCase()
: ev.key.toLowerCase()
: value;
},
});
} </s> remove cleanup();
</s> add
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/components/ProjectName.tsx
|
keep keep add keep keep keep keep
|
<mask> height: 100%;
<mask> width: 100%;
<mask>
<mask> // serves 2 purposes:
<mask> // 1. prevent selecting text outside the component when double-clicking or
<mask> // dragging inside it (e.g. on canvas)
<mask> // 2. prevent selecting UI, both from the inside, and from outside the
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove exports[`add element to the scene when pointer dragging long enough arrow 1`] = `1`;
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough arrow 1`] = `1`; </s> remove exports[`add element to the scene when pointer dragging long enough arrow 2`] = `
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough arrow 2`] = ` </s> remove exports[`add element to the scene when pointer dragging long enough ellipse 1`] = `1`;
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough ellipse 1`] = `1`; </s> remove exports[`add element to the scene when pointer dragging long enough rectangle 1`] = `1`;
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough rectangle 1`] = `1`; </s> remove exports[`add element to the scene when pointer dragging long enough diamond 1`] = `1`;
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough diamond 1`] = `1`; </s> remove exports[`add element to the scene when pointer dragging long enough rectangle 2`] = `
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough rectangle 2`] = `
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/css/styles.scss
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> onSubmit({
<mask> text: normalizeText(editable.value),
<mask> viaKeyboard: submittedViaKeyboard,
<mask> });
<mask> cleanup();
<mask> };
<mask>
<mask> const cleanup = () => {
<mask> if (isDestroyed) {
<mask> return;
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> add export const focusNearestParent = (element: HTMLInputElement) => {
let parent = element.parentElement;
while (parent) {
if (parent.tabIndex > -1) {
parent.focus();
return;
}
parent = parent.parentElement;
}
}; </s> add public focusContainer = () => {
this.excalidrawContainerRef.current?.focus();
};
</s> add focusNearestParent(event.target); </s> remove if (this.state.viewModeEnabled) {
return;
}
</s> add if (this.actionManager.handleKeyDown(event)) {
return;
} </s> remove if (this.actionManager.handleKeyDown(event)) {
return;
}
</s> add if (event.key === KEYS.QUESTION_MARK) {
this.setState({
showHelpDialog: true,
});
} </s> remove describe("do not add element to the scene if size is too small", () => {
beforeAll(() => {
mockBoundingClientRect();
});
afterAll(() => {
restoreOriginalGetBoundingClientRect();
});
</s> add describe("do not add element to the scene if size is too small", () => {
beforeAll(() => {
mockBoundingClientRect();
});
afterAll(() => {
restoreOriginalGetBoundingClientRect();
});
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/element/textWysiwyg.tsx
|
keep keep keep add keep keep keep keep keep
|
<mask> renderFooter={renderFooter}
<mask> langCode={langCode}
<mask> renderCustomStats={renderCustomStats}
<mask> detectScroll={false}
<mask> />
<mask> {excalidrawAPI && <CollabWrapper excalidrawAPI={excalidrawAPI} />}
<mask> {errorMessage && (
<mask> <ErrorDialog
<mask> message={errorMessage}
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> add focusContainer={this.focusContainer} </s> remove <HelpDialog onClose={() => setAppState({ showHelpDialog: false })} />
</s> add <HelpDialog
onClose={() => {
const helpIcon = document.querySelector(
".help-icon",
)! as HTMLElement;
helpIcon.focus();
setAppState({ showHelpDialog: false });
}}
/> </s> add handleKeyboardGlobally={handleKeyboardGlobally} </s> add event.preventDefault();
return; </s> remove selectedElements.length === 1 &&
!isLinearElement(selectedElements[0])
</s> add !event.ctrlKey &&
!event.altKey &&
!event.metaKey &&
this.state.draggingElement === null </s> remove const selectedElement = selectedElements[0];
this.startTextEditing({
sceneX: selectedElement.x + selectedElement.width / 2,
sceneY: selectedElement.y + selectedElement.height / 2,
});
event.preventDefault();
return;
</s> add const shape = findShapeByKey(event.key);
if (shape) {
this.selectShapeTool(shape);
} else if (event.key === KEYS.Q) {
this.toggleLock();
}
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/excalidraw-app/index.tsx
|
keep keep keep add keep keep keep keep keep
|
<mask> name,
<mask> renderCustomStats,
<mask> onPaste,
<mask> detectScroll = true,
<mask> } = props;
<mask>
<mask> const canvasActions = props.UIOptions?.canvasActions;
<mask>
<mask> const UIOptions = {
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove handleKeyDown(event: KeyboardEvent) {
</s> add handleKeyDown(event: React.KeyboardEvent | KeyboardEvent) { </s> remove it("arrow", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("arrow");
fireEvent.click(tool);
</s> add it("arrow", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("arrow");
fireEvent.click(tool); </s> remove it("ellipse", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("ellipse");
fireEvent.click(tool);
</s> add it("ellipse", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("ellipse");
fireEvent.click(tool); </s> remove it("line", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("line");
fireEvent.click(tool);
</s> add it("line", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("line");
fireEvent.click(tool); </s> remove it("diamond", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("diamond");
fireEvent.click(tool);
</s> add it("diamond", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("diamond");
fireEvent.click(tool); </s> remove it("rectangle", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("rectangle");
fireEvent.click(tool);
</s> add it("rectangle", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("rectangle");
fireEvent.click(tool);
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/packages/excalidraw/index.tsx
|
keep keep keep add keep keep keep keep
|
<mask> renderCustomStats={renderCustomStats}
<mask> UIOptions={UIOptions}
<mask> onPaste={onPaste}
<mask> detectScroll={detectScroll}
<mask> />
<mask> </InitializeApp>
<mask> );
<mask> };
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> add focusContainer={focusContainer} </s> add handleKeyboardGlobally={true} </s> add focusContainer={this.focusContainer} </s> remove <HelpDialog onClose={() => setAppState({ showHelpDialog: false })} />
</s> add <HelpDialog
onClose={() => {
const helpIcon = document.querySelector(
".help-icon",
)! as HTMLElement;
helpIcon.focus();
setAppState({ showHelpDialog: false });
}}
/> </s> add focusContainer(); </s> add handleKeyboardGlobally: boolean;
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/packages/excalidraw/index.tsx
|
keep keep replace keep replace keep
|
<mask> // Jest Snapshot v1, https://goo.gl/fbAQLP
<mask>
<mask> exports[`add element to the scene when pointer dragging long enough arrow 1`] = `1`;
<mask>
<mask> exports[`add element to the scene when pointer dragging long enough arrow 2`] = `
<mask> Object {
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove exports[`add element to the scene when pointer dragging long enough rectangle 1`] = `1`;
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough rectangle 1`] = `1`; </s> remove exports[`add element to the scene when pointer dragging long enough diamond 1`] = `1`;
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough diamond 1`] = `1`; </s> remove exports[`add element to the scene when pointer dragging long enough ellipse 1`] = `1`;
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough ellipse 1`] = `1`; </s> remove exports[`add element to the scene when pointer dragging long enough rectangle 2`] = `
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough rectangle 2`] = ` </s> remove exports[`add element to the scene when pointer dragging long enough diamond 2`] = `
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough diamond 2`] = `
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/__snapshots__/dragCreate.test.tsx.snap
|
keep keep keep keep replace keep replace keep
|
<mask> "y": 20,
<mask> }
<mask> `;
<mask>
<mask> exports[`add element to the scene when pointer dragging long enough diamond 1`] = `1`;
<mask>
<mask> exports[`add element to the scene when pointer dragging long enough diamond 2`] = `
<mask> Object {
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove exports[`add element to the scene when pointer dragging long enough ellipse 1`] = `1`;
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough ellipse 1`] = `1`; </s> remove exports[`add element to the scene when pointer dragging long enough rectangle 1`] = `1`;
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough rectangle 1`] = `1`; </s> remove exports[`add element to the scene when pointer dragging long enough rectangle 2`] = `
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough rectangle 2`] = ` </s> remove exports[`add element to the scene when pointer dragging long enough ellipse 2`] = `
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough ellipse 2`] = ` </s> remove exports[`add element to the scene when pointer dragging long enough arrow 1`] = `1`;
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough arrow 1`] = `1`;
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/__snapshots__/dragCreate.test.tsx.snap
|
keep keep keep replace keep replace keep
|
<mask> }
<mask> `;
<mask>
<mask> exports[`add element to the scene when pointer dragging long enough ellipse 1`] = `1`;
<mask>
<mask> exports[`add element to the scene when pointer dragging long enough ellipse 2`] = `
<mask> Object {
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove exports[`add element to the scene when pointer dragging long enough diamond 1`] = `1`;
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough diamond 1`] = `1`; </s> remove exports[`add element to the scene when pointer dragging long enough rectangle 1`] = `1`;
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough rectangle 1`] = `1`; </s> remove exports[`add element to the scene when pointer dragging long enough diamond 2`] = `
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough diamond 2`] = ` </s> remove exports[`add element to the scene when pointer dragging long enough rectangle 2`] = `
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough rectangle 2`] = ` </s> remove exports[`add element to the scene when pointer dragging long enough arrow 1`] = `1`;
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough arrow 1`] = `1`;
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/__snapshots__/dragCreate.test.tsx.snap
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> "y": 20,
<mask> }
<mask> `;
<mask>
<mask> exports[`add element to the scene when pointer dragging long enough line 1`] = `
<mask> Object {
<mask> "angle": 0,
<mask> "backgroundColor": "transparent",
<mask> "boundElementIds": null,
<mask> "endArrowhead": null,
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove exports[`add element to the scene when pointer dragging long enough diamond 2`] = `
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough diamond 2`] = ` </s> remove exports[`add element to the scene when pointer dragging long enough ellipse 2`] = `
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough ellipse 2`] = ` </s> remove exports[`add element to the scene when pointer dragging long enough rectangle 2`] = `
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough rectangle 2`] = ` </s> remove exports[`add element to the scene when pointer dragging long enough arrow 2`] = `
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough arrow 2`] = ` </s> remove exports[`add element to the scene when pointer dragging long enough diamond 1`] = `1`;
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough diamond 1`] = `1`; </s> remove exports[`add element to the scene when pointer dragging long enough ellipse 1`] = `1`;
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough ellipse 1`] = `1`;
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/__snapshots__/dragCreate.test.tsx.snap
|
keep keep replace keep replace keep
|
<mask> `;
<mask>
<mask> exports[`add element to the scene when pointer dragging long enough rectangle 1`] = `1`;
<mask>
<mask> exports[`add element to the scene when pointer dragging long enough rectangle 2`] = `
<mask> Object {
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove exports[`add element to the scene when pointer dragging long enough ellipse 1`] = `1`;
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough ellipse 1`] = `1`; </s> remove exports[`add element to the scene when pointer dragging long enough diamond 1`] = `1`;
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough diamond 1`] = `1`; </s> remove exports[`add element to the scene when pointer dragging long enough diamond 2`] = `
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough diamond 2`] = ` </s> remove exports[`add element to the scene when pointer dragging long enough ellipse 2`] = `
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough ellipse 2`] = ` </s> remove exports[`add element to the scene when pointer dragging long enough arrow 1`] = `1`;
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough arrow 1`] = `1`;
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/__snapshots__/dragCreate.test.tsx.snap
|
keep keep keep keep replace replace replace replace replace replace keep replace keep
|
<mask> });
<mask>
<mask> const { h } = window;
<mask>
<mask> describe("add element to the scene when pointer dragging long enough", () => {
<mask> it("rectangle", async () => {
<mask> const { getByToolName, container } = await render(<ExcalidrawApp />);
<mask> // select tool
<mask> const tool = getByToolName("rectangle");
<mask> fireEvent.click(tool);
<mask>
<mask> const canvas = container.querySelector("canvas")!;
<mask>
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> fireEvent.click(tool);
<mask>
<mask> const canvas = container.querySelector("canvas")!;
<mask>
<mask> // start from (30, 20)
<mask> fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
<mask>
<mask> // move to (60,70)
<mask> fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
<mask>
<mask> // finish (position does not matter)
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
</s> add // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 }); </s> remove // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
</s> add // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 }); </s> remove // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
</s> add // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 }); </s> remove // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
</s> add // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 }); </s> remove // move to (60,70)
fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
</s> add // move to (60,70)
fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 }); </s> remove // move to (60,70)
fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
</s> add // move to (60,70)
fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask>
<mask> // start from (30, 20)
<mask> fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
<mask>
<mask> // move to (60,70)
<mask> fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
<mask>
<mask> // finish (position does not matter)
<mask> fireEvent.pointerUp(canvas);
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(8);
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove // move to (60,70)
fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
</s> add // move to (60,70)
fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 }); </s> remove // move to (60,70)
fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
</s> add // move to (60,70)
fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 }); </s> remove // move to (60,70)
fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
</s> add // move to (60,70)
fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 }); </s> remove // move to (60,70)
fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
</s> add // move to (60,70)
fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 }); </s> remove // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
</s> add // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 }); </s> remove // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
</s> add // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask>
<mask> // move to (60,70)
<mask> fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
<mask>
<mask> // finish (position does not matter)
<mask> fireEvent.pointerUp(canvas);
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(8);
<mask> expect(h.state.selectionElement).toBeNull();
<mask>
<mask> expect(h.elements.length).toEqual(1);
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove // finish (position does not matter)
fireEvent.pointerUp(canvas);
</s> add // finish (position does not matter)
fireEvent.pointerUp(canvas); </s> remove // finish (position does not matter)
fireEvent.pointerUp(canvas);
</s> add // finish (position does not matter)
fireEvent.pointerUp(canvas); </s> remove // finish (position does not matter)
fireEvent.pointerUp(canvas);
</s> add // finish (position does not matter)
fireEvent.pointerUp(canvas); </s> remove // finish (position does not matter)
fireEvent.pointerUp(canvas);
</s> add // finish (position does not matter)
fireEvent.pointerUp(canvas); </s> remove // move to (60,70)
fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
</s> add // move to (60,70)
fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 }); </s> remove // move to (60,70)
fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
</s> add // move to (60,70)
fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask>
<mask> // finish (position does not matter)
<mask> fireEvent.pointerUp(canvas);
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(8);
<mask> expect(h.state.selectionElement).toBeNull();
<mask>
<mask> expect(h.elements.length).toEqual(1);
<mask> expect(h.elements[0].type).toEqual("rectangle");
<mask> expect(h.elements[0].x).toEqual(30);
<mask> expect(h.elements[0].y).toEqual(20);
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull();
</s> add expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull(); </s> remove expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull();
</s> add expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull(); </s> remove expect(h.elements.length).toEqual(1);
expect(h.elements[0].type).toEqual("rectangle");
expect(h.elements[0].x).toEqual(30);
expect(h.elements[0].y).toEqual(20);
expect(h.elements[0].width).toEqual(30); // 60 - 30
expect(h.elements[0].height).toEqual(50); // 70 - 20
</s> add expect(h.elements.length).toEqual(1);
expect(h.elements[0].type).toEqual("rectangle");
expect(h.elements[0].x).toEqual(30);
expect(h.elements[0].y).toEqual(20);
expect(h.elements[0].width).toEqual(30); // 60 - 30
expect(h.elements[0].height).toEqual(50); // 70 - 20 </s> remove expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull();
</s> add expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull(); </s> remove expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull();
</s> add expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull(); </s> remove // finish (position does not matter)
fireEvent.pointerUp(canvas);
</s> add // finish (position does not matter)
fireEvent.pointerUp(canvas);
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep replace replace replace replace replace replace keep replace replace replace keep keep keep keep
|
<mask> expect(h.state.selectionElement).toBeNull();
<mask>
<mask> expect(h.elements.length).toEqual(1);
<mask> expect(h.elements[0].type).toEqual("rectangle");
<mask> expect(h.elements[0].x).toEqual(30);
<mask> expect(h.elements[0].y).toEqual(20);
<mask> expect(h.elements[0].width).toEqual(30); // 60 - 30
<mask> expect(h.elements[0].height).toEqual(50); // 70 - 20
<mask>
<mask> expect(h.elements.length).toMatchSnapshot();
<mask> h.elements.forEach((element) => expect(element).toMatchSnapshot());
<mask> });
<mask>
<mask> it("ellipse", async () => {
<mask> const { getByToolName, container } = await render(<ExcalidrawApp />);
<mask> // select tool
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove expect(h.elements.length).toMatchSnapshot();
h.elements.forEach((element) => expect(element).toMatchSnapshot());
});
</s> add expect(h.elements.length).toMatchSnapshot();
h.elements.forEach((element) => expect(element).toMatchSnapshot());
}); </s> remove expect(h.elements.length).toMatchSnapshot();
h.elements.forEach((element) => expect(element).toMatchSnapshot());
});
</s> add expect(h.elements.length).toMatchSnapshot();
h.elements.forEach((element) => expect(element).toMatchSnapshot());
}); </s> remove expect(h.elements.length).toEqual(1);
expect(h.elements[0].type).toEqual("diamond");
expect(h.elements[0].x).toEqual(30);
expect(h.elements[0].y).toEqual(20);
expect(h.elements[0].width).toEqual(30); // 60 - 30
expect(h.elements[0].height).toEqual(50); // 70 - 20
</s> add expect(h.elements.length).toEqual(1);
expect(h.elements[0].type).toEqual("diamond");
expect(h.elements[0].x).toEqual(30);
expect(h.elements[0].y).toEqual(20);
expect(h.elements[0].width).toEqual(30); // 60 - 30
expect(h.elements[0].height).toEqual(50); // 70 - 20 </s> remove expect(h.elements.length).toEqual(1);
expect(h.elements[0].type).toEqual("ellipse");
expect(h.elements[0].x).toEqual(30);
expect(h.elements[0].y).toEqual(20);
expect(h.elements[0].width).toEqual(30); // 60 - 30
expect(h.elements[0].height).toEqual(50); // 70 - 20
</s> add expect(h.elements.length).toEqual(1);
expect(h.elements[0].type).toEqual("ellipse");
expect(h.elements[0].x).toEqual(30);
expect(h.elements[0].y).toEqual(20);
expect(h.elements[0].width).toEqual(30); // 60 - 30
expect(h.elements[0].height).toEqual(50); // 70 - 20 </s> remove expect(h.elements.length).toMatchSnapshot();
h.elements.forEach((element) => expect(element).toMatchSnapshot());
});
</s> add expect(h.elements.length).toMatchSnapshot();
h.elements.forEach((element) => expect(element).toMatchSnapshot());
});
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep replace replace replace replace replace keep replace keep keep keep
|
<mask> h.elements.forEach((element) => expect(element).toMatchSnapshot());
<mask> });
<mask>
<mask> it("ellipse", async () => {
<mask> const { getByToolName, container } = await render(<ExcalidrawApp />);
<mask> // select tool
<mask> const tool = getByToolName("ellipse");
<mask> fireEvent.click(tool);
<mask>
<mask> const canvas = container.querySelector("canvas")!;
<mask>
<mask> // start from (30, 20)
<mask> fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> fireEvent.click(tool);
<mask>
<mask> const canvas = container.querySelector("canvas")!;
<mask>
<mask> // start from (30, 20)
<mask> fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
<mask>
<mask> // move to (60,70)
<mask> fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
<mask>
<mask> // finish (position does not matter)
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask>
<mask> // start from (30, 20)
<mask> fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
<mask>
<mask> // move to (60,70)
<mask> fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
<mask>
<mask> // finish (position does not matter)
<mask> fireEvent.pointerUp(canvas);
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(8);
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask>
<mask> // move to (60,70)
<mask> fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
<mask>
<mask> // finish (position does not matter)
<mask> fireEvent.pointerUp(canvas);
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(8);
<mask> expect(h.state.selectionElement).toBeNull();
<mask>
<mask> expect(h.elements.length).toEqual(1);
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask>
<mask> // finish (position does not matter)
<mask> fireEvent.pointerUp(canvas);
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(8);
<mask> expect(h.state.selectionElement).toBeNull();
<mask>
<mask> expect(h.elements.length).toEqual(1);
<mask> expect(h.elements[0].type).toEqual("ellipse");
<mask> expect(h.elements[0].x).toEqual(30);
<mask> expect(h.elements[0].y).toEqual(20);
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull();
</s> add expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull(); </s> remove expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull();
</s> add expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull(); </s> remove expect(h.elements.length).toEqual(1);
expect(h.elements[0].type).toEqual("ellipse");
expect(h.elements[0].x).toEqual(30);
expect(h.elements[0].y).toEqual(20);
expect(h.elements[0].width).toEqual(30); // 60 - 30
expect(h.elements[0].height).toEqual(50); // 70 - 20
</s> add expect(h.elements.length).toEqual(1);
expect(h.elements[0].type).toEqual("ellipse");
expect(h.elements[0].x).toEqual(30);
expect(h.elements[0].y).toEqual(20);
expect(h.elements[0].width).toEqual(30); // 60 - 30
expect(h.elements[0].height).toEqual(50); // 70 - 20 </s> remove expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull();
</s> add expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull(); </s> remove expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull();
</s> add expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull(); </s> remove // finish (position does not matter)
fireEvent.pointerUp(canvas);
</s> add // finish (position does not matter)
fireEvent.pointerUp(canvas);
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep replace replace replace replace replace replace keep replace replace replace keep keep keep keep
|
<mask> expect(renderScene).toHaveBeenCalledTimes(8);
<mask> expect(h.state.selectionElement).toBeNull();
<mask>
<mask> expect(h.elements.length).toEqual(1);
<mask> expect(h.elements[0].type).toEqual("ellipse");
<mask> expect(h.elements[0].x).toEqual(30);
<mask> expect(h.elements[0].y).toEqual(20);
<mask> expect(h.elements[0].width).toEqual(30); // 60 - 30
<mask> expect(h.elements[0].height).toEqual(50); // 70 - 20
<mask>
<mask> expect(h.elements.length).toMatchSnapshot();
<mask> h.elements.forEach((element) => expect(element).toMatchSnapshot());
<mask> });
<mask>
<mask> it("diamond", async () => {
<mask> const { getByToolName, container } = await render(<ExcalidrawApp />);
<mask> // select tool
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove expect(h.elements.length).toMatchSnapshot();
h.elements.forEach((element) => expect(element).toMatchSnapshot());
});
</s> add expect(h.elements.length).toMatchSnapshot();
h.elements.forEach((element) => expect(element).toMatchSnapshot());
}); </s> remove expect(h.elements.length).toMatchSnapshot();
h.elements.forEach((element) => expect(element).toMatchSnapshot());
});
</s> add expect(h.elements.length).toMatchSnapshot();
h.elements.forEach((element) => expect(element).toMatchSnapshot());
}); </s> remove expect(h.elements.length).toEqual(1);
expect(h.elements[0].type).toEqual("diamond");
expect(h.elements[0].x).toEqual(30);
expect(h.elements[0].y).toEqual(20);
expect(h.elements[0].width).toEqual(30); // 60 - 30
expect(h.elements[0].height).toEqual(50); // 70 - 20
</s> add expect(h.elements.length).toEqual(1);
expect(h.elements[0].type).toEqual("diamond");
expect(h.elements[0].x).toEqual(30);
expect(h.elements[0].y).toEqual(20);
expect(h.elements[0].width).toEqual(30); // 60 - 30
expect(h.elements[0].height).toEqual(50); // 70 - 20 </s> remove expect(h.elements.length).toEqual(1);
expect(h.elements[0].type).toEqual("rectangle");
expect(h.elements[0].x).toEqual(30);
expect(h.elements[0].y).toEqual(20);
expect(h.elements[0].width).toEqual(30); // 60 - 30
expect(h.elements[0].height).toEqual(50); // 70 - 20
</s> add expect(h.elements.length).toEqual(1);
expect(h.elements[0].type).toEqual("rectangle");
expect(h.elements[0].x).toEqual(30);
expect(h.elements[0].y).toEqual(20);
expect(h.elements[0].width).toEqual(30); // 60 - 30
expect(h.elements[0].height).toEqual(50); // 70 - 20 </s> remove expect(h.elements.length).toMatchSnapshot();
h.elements.forEach((element) => expect(element).toMatchSnapshot());
});
</s> add expect(h.elements.length).toMatchSnapshot();
h.elements.forEach((element) => expect(element).toMatchSnapshot());
});
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep replace replace replace replace replace keep replace
|
<mask> h.elements.forEach((element) => expect(element).toMatchSnapshot());
<mask> });
<mask>
<mask> it("diamond", async () => {
<mask> const { getByToolName, container } = await render(<ExcalidrawApp />);
<mask> // select tool
<mask> const tool = getByToolName("diamond");
<mask> fireEvent.click(tool);
<mask>
<mask> const canvas = container.querySelector("canvas")!;
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> fireEvent.click(tool);
<mask>
<mask> const canvas = container.querySelector("canvas")!;
<mask>
<mask> // start from (30, 20)
<mask> fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
<mask>
<mask> // move to (60,70)
<mask> fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
<mask>
<mask> // finish (position does not matter)
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask>
<mask> // start from (30, 20)
<mask> fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
<mask>
<mask> // move to (60,70)
<mask> fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
<mask>
<mask> // finish (position does not matter)
<mask> fireEvent.pointerUp(canvas);
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(8);
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask>
<mask> // move to (60,70)
<mask> fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
<mask>
<mask> // finish (position does not matter)
<mask> fireEvent.pointerUp(canvas);
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(8);
<mask> expect(h.state.selectionElement).toBeNull();
<mask>
<mask> expect(h.elements.length).toEqual(1);
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask>
<mask> // finish (position does not matter)
<mask> fireEvent.pointerUp(canvas);
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(8);
<mask> expect(h.state.selectionElement).toBeNull();
<mask>
<mask> expect(h.elements.length).toEqual(1);
<mask> expect(h.elements[0].type).toEqual("diamond");
<mask> expect(h.elements[0].x).toEqual(30);
<mask> expect(h.elements[0].y).toEqual(20);
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull();
</s> add expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull(); </s> remove expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull();
</s> add expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull(); </s> remove expect(h.elements.length).toEqual(1);
expect(h.elements[0].type).toEqual("diamond");
expect(h.elements[0].x).toEqual(30);
expect(h.elements[0].y).toEqual(20);
expect(h.elements[0].width).toEqual(30); // 60 - 30
expect(h.elements[0].height).toEqual(50); // 70 - 20
</s> add expect(h.elements.length).toEqual(1);
expect(h.elements[0].type).toEqual("diamond");
expect(h.elements[0].x).toEqual(30);
expect(h.elements[0].y).toEqual(20);
expect(h.elements[0].width).toEqual(30); // 60 - 30
expect(h.elements[0].height).toEqual(50); // 70 - 20 </s> remove expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull();
</s> add expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull(); </s> remove expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull();
</s> add expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull(); </s> remove // finish (position does not matter)
fireEvent.pointerUp(canvas);
</s> add // finish (position does not matter)
fireEvent.pointerUp(canvas);
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep replace replace replace replace replace replace keep replace replace replace keep keep keep keep
|
<mask> expect(h.state.selectionElement).toBeNull();
<mask>
<mask> expect(h.elements.length).toEqual(1);
<mask> expect(h.elements[0].type).toEqual("diamond");
<mask> expect(h.elements[0].x).toEqual(30);
<mask> expect(h.elements[0].y).toEqual(20);
<mask> expect(h.elements[0].width).toEqual(30); // 60 - 30
<mask> expect(h.elements[0].height).toEqual(50); // 70 - 20
<mask>
<mask> expect(h.elements.length).toMatchSnapshot();
<mask> h.elements.forEach((element) => expect(element).toMatchSnapshot());
<mask> });
<mask>
<mask> it("arrow", async () => {
<mask> const { getByToolName, container } = await render(<ExcalidrawApp />);
<mask> // select tool
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove expect(h.elements.length).toMatchSnapshot();
h.elements.forEach((element) => expect(element).toMatchSnapshot());
});
</s> add expect(h.elements.length).toMatchSnapshot();
h.elements.forEach((element) => expect(element).toMatchSnapshot());
}); </s> remove expect(h.elements.length).toMatchSnapshot();
h.elements.forEach((element) => expect(element).toMatchSnapshot());
});
</s> add expect(h.elements.length).toMatchSnapshot();
h.elements.forEach((element) => expect(element).toMatchSnapshot());
}); </s> remove expect(h.elements.length).toEqual(1);
expect(h.elements[0].type).toEqual("rectangle");
expect(h.elements[0].x).toEqual(30);
expect(h.elements[0].y).toEqual(20);
expect(h.elements[0].width).toEqual(30); // 60 - 30
expect(h.elements[0].height).toEqual(50); // 70 - 20
</s> add expect(h.elements.length).toEqual(1);
expect(h.elements[0].type).toEqual("rectangle");
expect(h.elements[0].x).toEqual(30);
expect(h.elements[0].y).toEqual(20);
expect(h.elements[0].width).toEqual(30); // 60 - 30
expect(h.elements[0].height).toEqual(50); // 70 - 20 </s> remove expect(h.elements.length).toEqual(1);
expect(h.elements[0].type).toEqual("ellipse");
expect(h.elements[0].x).toEqual(30);
expect(h.elements[0].y).toEqual(20);
expect(h.elements[0].width).toEqual(30); // 60 - 30
expect(h.elements[0].height).toEqual(50); // 70 - 20
</s> add expect(h.elements.length).toEqual(1);
expect(h.elements[0].type).toEqual("ellipse");
expect(h.elements[0].x).toEqual(30);
expect(h.elements[0].y).toEqual(20);
expect(h.elements[0].width).toEqual(30); // 60 - 30
expect(h.elements[0].height).toEqual(50); // 70 - 20 </s> remove expect(h.elements.length).toMatchSnapshot();
h.elements.forEach((element) => expect(element).toMatchSnapshot());
});
</s> add expect(h.elements.length).toMatchSnapshot();
h.elements.forEach((element) => expect(element).toMatchSnapshot());
});
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep replace replace replace replace replace keep replace
|
<mask> h.elements.forEach((element) => expect(element).toMatchSnapshot());
<mask> });
<mask>
<mask> it("arrow", async () => {
<mask> const { getByToolName, container } = await render(<ExcalidrawApp />);
<mask> // select tool
<mask> const tool = getByToolName("arrow");
<mask> fireEvent.click(tool);
<mask>
<mask> const canvas = container.querySelector("canvas")!;
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> fireEvent.click(tool);
<mask>
<mask> const canvas = container.querySelector("canvas")!;
<mask>
<mask> // start from (30, 20)
<mask> fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
<mask>
<mask> // move to (60,70)
<mask> fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
<mask>
<mask> // finish (position does not matter)
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask>
<mask> // start from (30, 20)
<mask> fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
<mask>
<mask> // move to (60,70)
<mask> fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
<mask>
<mask> // finish (position does not matter)
<mask> fireEvent.pointerUp(canvas);
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(8);
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask>
<mask> // move to (60,70)
<mask> fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
<mask>
<mask> // finish (position does not matter)
<mask> fireEvent.pointerUp(canvas);
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(8);
<mask> expect(h.state.selectionElement).toBeNull();
<mask>
<mask> expect(h.elements.length).toEqual(1);
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep keep keep keep replace keep
|
<mask>
<mask> // finish (position does not matter)
<mask> fireEvent.pointerUp(canvas);
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(8);
<mask> expect(h.state.selectionElement).toBeNull();
<mask>
<mask> expect(h.elements.length).toEqual(1);
<mask>
<mask> const element = h.elements[0] as ExcalidrawLinearElement;
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(8);
<mask> expect(h.state.selectionElement).toBeNull();
<mask>
<mask> expect(h.elements.length).toEqual(1);
<mask>
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull();
</s> add expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull(); </s> remove expect(h.elements.length).toEqual(1);
</s> add expect(h.elements.length).toEqual(1); </s> remove const element = h.elements[0] as ExcalidrawLinearElement;
</s> add const element = h.elements[0] as ExcalidrawLinearElement; </s> remove const element = h.elements[0] as ExcalidrawLinearElement;
</s> add const element = h.elements[0] as ExcalidrawLinearElement; </s> remove expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull();
</s> add expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull();
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep replace keep replace replace replace replace replace replace keep
|
<mask>
<mask> expect(h.elements.length).toEqual(1);
<mask>
<mask> const element = h.elements[0] as ExcalidrawLinearElement;
<mask>
<mask> expect(element.type).toEqual("arrow");
<mask> expect(element.x).toEqual(30);
<mask> expect(element.y).toEqual(20);
<mask> expect(element.points.length).toEqual(2);
<mask> expect(element.points[0]).toEqual([0, 0]);
<mask> expect(element.points[1]).toEqual([30, 50]); // (60 - 30, 70 - 20)
<mask>
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove expect(element.type).toEqual("line");
expect(element.x).toEqual(30);
expect(element.y).toEqual(20);
expect(element.points.length).toEqual(2);
expect(element.points[0]).toEqual([0, 0]);
expect(element.points[1]).toEqual([30, 50]); // (60 - 30, 70 - 20)
</s> add expect(element.type).toEqual("line");
expect(element.x).toEqual(30);
expect(element.y).toEqual(20);
expect(element.points.length).toEqual(2);
expect(element.points[0]).toEqual([0, 0]);
expect(element.points[1]).toEqual([30, 50]); // (60 - 30, 70 - 20) </s> remove const element = h.elements[0] as ExcalidrawLinearElement;
</s> add const element = h.elements[0] as ExcalidrawLinearElement; </s> remove expect(h.elements.length).toMatchSnapshot();
h.elements.forEach((element) => expect(element).toMatchSnapshot());
});
</s> add expect(h.elements.length).toMatchSnapshot();
h.elements.forEach((element) => expect(element).toMatchSnapshot());
}); </s> remove h.elements.forEach((element) => expect(element).toMatchSnapshot());
</s> add h.elements.forEach((element) => expect(element).toMatchSnapshot());
}); </s> remove expect(h.elements.length).toEqual(1);
</s> add expect(h.elements.length).toEqual(1);
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep replace replace replace keep replace replace replace replace replace keep keep keep keep
|
<mask> expect(element.points[0]).toEqual([0, 0]);
<mask> expect(element.points[1]).toEqual([30, 50]); // (60 - 30, 70 - 20)
<mask>
<mask> expect(h.elements.length).toMatchSnapshot();
<mask> h.elements.forEach((element) => expect(element).toMatchSnapshot());
<mask> });
<mask>
<mask> it("line", async () => {
<mask> const { getByToolName, container } = await render(<ExcalidrawApp />);
<mask> // select tool
<mask> const tool = getByToolName("line");
<mask> fireEvent.click(tool);
<mask>
<mask> const canvas = container.querySelector("canvas")!;
<mask>
<mask> // start from (30, 20)
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove it("line", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("line");
fireEvent.click(tool);
</s> add it("line", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("line");
fireEvent.click(tool); </s> remove expect(element.type).toEqual("arrow");
expect(element.x).toEqual(30);
expect(element.y).toEqual(20);
expect(element.points.length).toEqual(2);
expect(element.points[0]).toEqual([0, 0]);
expect(element.points[1]).toEqual([30, 50]); // (60 - 30, 70 - 20)
</s> add expect(element.type).toEqual("arrow");
expect(element.x).toEqual(30);
expect(element.y).toEqual(20);
expect(element.points.length).toEqual(2);
expect(element.points[0]).toEqual([0, 0]);
expect(element.points[1]).toEqual([30, 50]); // (60 - 30, 70 - 20) </s> remove it("arrow", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("arrow");
fireEvent.click(tool);
</s> add it("arrow", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("arrow");
fireEvent.click(tool); </s> remove it("ellipse", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("ellipse");
fireEvent.click(tool);
</s> add it("ellipse", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("ellipse");
fireEvent.click(tool); </s> remove it("diamond", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("diamond");
fireEvent.click(tool);
</s> add it("diamond", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("diamond");
fireEvent.click(tool);
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep replace keep replace replace keep
|
<mask>
<mask> const canvas = container.querySelector("canvas")!;
<mask>
<mask> // start from (30, 20)
<mask> fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
<mask>
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask>
<mask> // start from (30, 20)
<mask> fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
<mask>
<mask> // move to (60,70)
<mask> fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
<mask>
<mask> // finish (position does not matter)
<mask> fireEvent.pointerUp(canvas);
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(8);
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask>
<mask> // move to (60,70)
<mask> fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
<mask>
<mask> // finish (position does not matter)
<mask> fireEvent.pointerUp(canvas);
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(8);
<mask> expect(h.state.selectionElement).toBeNull();
<mask>
<mask> expect(h.elements.length).toEqual(1);
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep keep keep keep replace keep keep keep keep
|
<mask>
<mask> // finish (position does not matter)
<mask> fireEvent.pointerUp(canvas);
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(8);
<mask> expect(h.state.selectionElement).toBeNull();
<mask>
<mask> expect(h.elements.length).toEqual(1);
<mask>
<mask> const element = h.elements[0] as ExcalidrawLinearElement;
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(8);
<mask> expect(h.state.selectionElement).toBeNull();
<mask>
<mask> expect(h.elements.length).toEqual(1);
<mask>
<mask> const element = h.elements[0] as ExcalidrawLinearElement;
<mask>
<mask> expect(element.type).toEqual("line");
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep replace keep replace replace replace replace replace replace keep
|
<mask> expect(h.elements.length).toEqual(1);
<mask>
<mask> const element = h.elements[0] as ExcalidrawLinearElement;
<mask>
<mask> expect(element.type).toEqual("line");
<mask> expect(element.x).toEqual(30);
<mask> expect(element.y).toEqual(20);
<mask> expect(element.points.length).toEqual(2);
<mask> expect(element.points[0]).toEqual([0, 0]);
<mask> expect(element.points[1]).toEqual([30, 50]); // (60 - 30, 70 - 20)
<mask>
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove expect(element.type).toEqual("arrow");
expect(element.x).toEqual(30);
expect(element.y).toEqual(20);
expect(element.points.length).toEqual(2);
expect(element.points[0]).toEqual([0, 0]);
expect(element.points[1]).toEqual([30, 50]); // (60 - 30, 70 - 20)
</s> add expect(element.type).toEqual("arrow");
expect(element.x).toEqual(30);
expect(element.y).toEqual(20);
expect(element.points.length).toEqual(2);
expect(element.points[0]).toEqual([0, 0]);
expect(element.points[1]).toEqual([30, 50]); // (60 - 30, 70 - 20) </s> remove const element = h.elements[0] as ExcalidrawLinearElement;
</s> add const element = h.elements[0] as ExcalidrawLinearElement; </s> remove expect(h.elements.length).toMatchSnapshot();
h.elements.forEach((element) => expect(element).toMatchSnapshot());
});
</s> add expect(h.elements.length).toMatchSnapshot();
h.elements.forEach((element) => expect(element).toMatchSnapshot());
}); </s> remove h.elements.forEach((element) => expect(element).toMatchSnapshot());
</s> add h.elements.forEach((element) => expect(element).toMatchSnapshot());
}); </s> remove expect(h.elements.length).toEqual(1);
</s> add expect(h.elements.length).toEqual(1);
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep replace keep replace keep keep
|
<mask>
<mask> h.elements.forEach((element) => expect(element).toMatchSnapshot());
<mask> });
<mask> });
<mask>
<mask> describe("do not add element to the scene if size is too small", () => {
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove describe("do not add element to the scene if size is too small", () => {
beforeAll(() => {
mockBoundingClientRect();
});
afterAll(() => {
restoreOriginalGetBoundingClientRect();
});
</s> add describe("do not add element to the scene if size is too small", () => {
beforeAll(() => {
mockBoundingClientRect();
});
afterAll(() => {
restoreOriginalGetBoundingClientRect();
}); </s> remove describe("add element to the scene when pointer dragging long enough", () => {
it("rectangle", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("rectangle");
fireEvent.click(tool);
</s> add describe("Test dragCreate", () => {
describe("add element to the scene when pointer dragging long enough", () => {
it("rectangle", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("rectangle");
fireEvent.click(tool); </s> remove exports[`add element to the scene when pointer dragging long enough diamond 1`] = `1`;
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough diamond 1`] = `1`; </s> remove exports[`add element to the scene when pointer dragging long enough ellipse 1`] = `1`;
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough ellipse 1`] = `1`; </s> remove exports[`add element to the scene when pointer dragging long enough rectangle 1`] = `1`;
</s> add exports[`Test dragCreate add element to the scene when pointer dragging long enough rectangle 1`] = `1`;
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep replace replace replace replace replace replace replace keep replace replace replace replace replace keep keep keep
|
<mask> });
<mask> });
<mask>
<mask> describe("do not add element to the scene if size is too small", () => {
<mask> beforeAll(() => {
<mask> mockBoundingClientRect();
<mask> });
<mask> afterAll(() => {
<mask> restoreOriginalGetBoundingClientRect();
<mask> });
<mask>
<mask> it("rectangle", async () => {
<mask> const { getByToolName, container } = await render(<ExcalidrawApp />);
<mask> // select tool
<mask> const tool = getByToolName("rectangle");
<mask> fireEvent.click(tool);
<mask>
<mask> const canvas = container.querySelector("canvas")!;
<mask>
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove describe("add element to the scene when pointer dragging long enough", () => {
it("rectangle", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("rectangle");
fireEvent.click(tool);
</s> add describe("Test dragCreate", () => {
describe("add element to the scene when pointer dragging long enough", () => {
it("rectangle", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("rectangle");
fireEvent.click(tool); </s> remove });
</s> add </s> remove h.elements.forEach((element) => expect(element).toMatchSnapshot());
</s> add h.elements.forEach((element) => expect(element).toMatchSnapshot());
}); </s> remove it("arrow", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("arrow");
fireEvent.click(tool);
</s> add it("arrow", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("arrow");
fireEvent.click(tool); </s> remove it("ellipse", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("ellipse");
fireEvent.click(tool);
</s> add it("ellipse", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("ellipse");
fireEvent.click(tool);
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep replace keep replace replace keep keep
|
<mask> const tool = getByToolName("rectangle");
<mask> fireEvent.click(tool);
<mask>
<mask> const canvas = container.querySelector("canvas")!;
<mask>
<mask> // start from (30, 20)
<mask> fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
<mask>
<mask> // finish (position does not matter)
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove const canvas = container.querySelector("canvas")!;
</s> add const canvas = container.querySelector("canvas")!; </s> remove const canvas = container.querySelector("canvas")!;
</s> add const canvas = container.querySelector("canvas")!; </s> remove const canvas = container.querySelector("canvas")!;
</s> add const canvas = container.querySelector("canvas")!; </s> remove const canvas = container.querySelector("canvas")!;
</s> add const canvas = container.querySelector("canvas")!; </s> remove const canvas = container.querySelector("canvas")!;
</s> add const canvas = container.querySelector("canvas")!;
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask>
<mask> // start from (30, 20)
<mask> fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
<mask>
<mask> // finish (position does not matter)
<mask> fireEvent.pointerUp(canvas);
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(6);
<mask> expect(h.state.selectionElement).toBeNull();
<mask> expect(h.elements.length).toEqual(0);
<mask> });
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove // finish (position does not matter)
fireEvent.pointerUp(canvas);
</s> add // finish (position does not matter)
fireEvent.pointerUp(canvas); </s> remove // finish (position does not matter)
fireEvent.pointerUp(canvas);
</s> add // finish (position does not matter)
fireEvent.pointerUp(canvas); </s> remove // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
</s> add // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 }); </s> remove // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
</s> add // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 }); </s> remove // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
</s> add // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 }); </s> remove // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
</s> add // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace replace replace keep replace replace replace replace replace keep keep
|
<mask>
<mask> // finish (position does not matter)
<mask> fireEvent.pointerUp(canvas);
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(6);
<mask> expect(h.state.selectionElement).toBeNull();
<mask> expect(h.elements.length).toEqual(0);
<mask> });
<mask>
<mask> it("ellipse", async () => {
<mask> const { getByToolName, container } = await render(<ExcalidrawApp />);
<mask> // select tool
<mask> const tool = getByToolName("ellipse");
<mask> fireEvent.click(tool);
<mask>
<mask> const canvas = container.querySelector("canvas")!;
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove expect(renderScene).toHaveBeenCalledTimes(6);
expect(h.state.selectionElement).toBeNull();
expect(h.elements.length).toEqual(0);
});
</s> add expect(renderScene).toHaveBeenCalledTimes(6);
expect(h.state.selectionElement).toBeNull();
expect(h.elements.length).toEqual(0);
}); </s> remove expect(renderScene).toHaveBeenCalledTimes(6);
expect(h.state.selectionElement).toBeNull();
expect(h.elements.length).toEqual(0);
});
</s> add expect(renderScene).toHaveBeenCalledTimes(6);
expect(h.state.selectionElement).toBeNull();
expect(h.elements.length).toEqual(0);
}); </s> remove it("ellipse", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("ellipse");
fireEvent.click(tool);
</s> add it("ellipse", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("ellipse");
fireEvent.click(tool); </s> remove it("arrow", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("arrow");
fireEvent.click(tool);
</s> add it("arrow", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("arrow");
fireEvent.click(tool); </s> remove it("line", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("line");
fireEvent.click(tool);
</s> add it("line", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("line");
fireEvent.click(tool);
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace keep replace replace keep keep keep
|
<mask> // select tool
<mask> const tool = getByToolName("ellipse");
<mask> fireEvent.click(tool);
<mask>
<mask> const canvas = container.querySelector("canvas")!;
<mask>
<mask> // start from (30, 20)
<mask> fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
<mask>
<mask> // finish (position does not matter)
<mask> fireEvent.pointerUp(canvas);
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask>
<mask> // start from (30, 20)
<mask> fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
<mask>
<mask> // finish (position does not matter)
<mask> fireEvent.pointerUp(canvas);
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(6);
<mask> expect(h.state.selectionElement).toBeNull();
<mask> expect(h.elements.length).toEqual(0);
<mask> });
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep replace replace replace replace keep replace replace replace replace replace
|
<mask> // finish (position does not matter)
<mask> fireEvent.pointerUp(canvas);
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(6);
<mask> expect(h.state.selectionElement).toBeNull();
<mask> expect(h.elements.length).toEqual(0);
<mask> });
<mask>
<mask> it("diamond", async () => {
<mask> const { getByToolName, container } = await render(<ExcalidrawApp />);
<mask> // select tool
<mask> const tool = getByToolName("diamond");
<mask> fireEvent.click(tool);
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove expect(renderScene).toHaveBeenCalledTimes(6);
expect(h.state.selectionElement).toBeNull();
expect(h.elements.length).toEqual(0);
});
</s> add expect(renderScene).toHaveBeenCalledTimes(6);
expect(h.state.selectionElement).toBeNull();
expect(h.elements.length).toEqual(0);
}); </s> remove expect(renderScene).toHaveBeenCalledTimes(6);
expect(h.state.selectionElement).toBeNull();
expect(h.elements.length).toEqual(0);
});
</s> add expect(renderScene).toHaveBeenCalledTimes(6);
expect(h.state.selectionElement).toBeNull();
expect(h.elements.length).toEqual(0);
}); </s> remove it("diamond", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("diamond");
fireEvent.click(tool);
</s> add it("diamond", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("diamond");
fireEvent.click(tool); </s> remove it("line", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("line");
fireEvent.click(tool);
</s> add it("line", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("line");
fireEvent.click(tool); </s> remove it("arrow", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("arrow");
fireEvent.click(tool);
</s> add it("arrow", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("arrow");
fireEvent.click(tool);
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep replace keep replace replace keep
|
<mask>
<mask> const canvas = container.querySelector("canvas")!;
<mask>
<mask> // start from (30, 20)
<mask> fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
<mask>
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask>
<mask> // start from (30, 20)
<mask> fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
<mask>
<mask> // finish (position does not matter)
<mask> fireEvent.pointerUp(canvas);
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(6);
<mask> expect(h.state.selectionElement).toBeNull();
<mask> expect(h.elements.length).toEqual(0);
<mask> });
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep replace replace replace replace keep replace replace replace replace replace keep
|
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(6);
<mask> expect(h.state.selectionElement).toBeNull();
<mask> expect(h.elements.length).toEqual(0);
<mask> });
<mask>
<mask> it("arrow", async () => {
<mask> const { getByToolName, container } = await render(<ExcalidrawApp />);
<mask> // select tool
<mask> const tool = getByToolName("arrow");
<mask> fireEvent.click(tool);
<mask>
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove it("arrow", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("arrow");
fireEvent.click(tool);
</s> add it("arrow", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("arrow");
fireEvent.click(tool); </s> remove expect(renderScene).toHaveBeenCalledTimes(6);
expect(h.state.selectionElement).toBeNull();
expect(h.elements.length).toEqual(0);
});
</s> add expect(renderScene).toHaveBeenCalledTimes(6);
expect(h.state.selectionElement).toBeNull();
expect(h.elements.length).toEqual(0);
}); </s> remove expect(renderScene).toHaveBeenCalledTimes(6);
expect(h.state.selectionElement).toBeNull();
expect(h.elements.length).toEqual(0);
});
</s> add expect(renderScene).toHaveBeenCalledTimes(6);
expect(h.state.selectionElement).toBeNull();
expect(h.elements.length).toEqual(0);
}); </s> remove it("diamond", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("diamond");
fireEvent.click(tool);
</s> add it("diamond", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("diamond");
fireEvent.click(tool); </s> remove it("ellipse", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("ellipse");
fireEvent.click(tool);
</s> add it("ellipse", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("ellipse");
fireEvent.click(tool);
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep replace keep replace replace keep keep keep keep
|
<mask> const tool = getByToolName("arrow");
<mask> fireEvent.click(tool);
<mask>
<mask> const canvas = container.querySelector("canvas")!;
<mask>
<mask> // start from (30, 20)
<mask> fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
<mask>
<mask> // finish (position does not matter)
<mask> fireEvent.pointerUp(canvas);
<mask>
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask>
<mask> // start from (30, 20)
<mask> fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
<mask>
<mask> // finish (position does not matter)
<mask> fireEvent.pointerUp(canvas);
<mask>
<mask> // we need to finalize it because arrows and lines enter multi-mode
<mask> fireEvent.keyDown(document, { key: KEYS.ENTER });
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(7);
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove // we need to finalize it because arrows and lines enter multi-mode
fireEvent.keyDown(document, { key: KEYS.ENTER });
</s> add // we need to finalize it because arrows and lines enter multi-mode
fireEvent.keyDown(document, {
key: KEYS.ENTER,
}); </s> remove // we need to finalize it because arrows and lines enter multi-mode
fireEvent.keyDown(document, { key: KEYS.ENTER });
</s> add // we need to finalize it because arrows and lines enter multi-mode
fireEvent.keyDown(document, {
key: KEYS.ENTER,
}); </s> remove // finish (position does not matter)
fireEvent.pointerUp(canvas);
</s> add // finish (position does not matter)
fireEvent.pointerUp(canvas); </s> remove expect(renderScene).toHaveBeenCalledTimes(7);
expect(h.state.selectionElement).toBeNull();
expect(h.elements.length).toEqual(0);
</s> add expect(renderScene).toHaveBeenCalledTimes(7);
expect(h.state.selectionElement).toBeNull();
expect(h.elements.length).toEqual(0);
}); </s> remove // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
</s> add // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 }); </s> remove // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
</s> add // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask>
<mask> // finish (position does not matter)
<mask> fireEvent.pointerUp(canvas);
<mask>
<mask> // we need to finalize it because arrows and lines enter multi-mode
<mask> fireEvent.keyDown(document, { key: KEYS.ENTER });
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(7);
<mask> expect(h.state.selectionElement).toBeNull();
<mask> expect(h.elements.length).toEqual(0);
<mask> });
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove // we need to finalize it because arrows and lines enter multi-mode
fireEvent.keyDown(document, { key: KEYS.ENTER });
</s> add // we need to finalize it because arrows and lines enter multi-mode
fireEvent.keyDown(document, {
key: KEYS.ENTER,
}); </s> remove expect(renderScene).toHaveBeenCalledTimes(7);
expect(h.state.selectionElement).toBeNull();
expect(h.elements.length).toEqual(0);
</s> add expect(renderScene).toHaveBeenCalledTimes(7);
expect(h.state.selectionElement).toBeNull();
expect(h.elements.length).toEqual(0);
}); </s> remove // finish (position does not matter)
fireEvent.pointerUp(canvas);
</s> add // finish (position does not matter)
fireEvent.pointerUp(canvas); </s> remove // finish (position does not matter)
fireEvent.pointerUp(canvas);
</s> add // finish (position does not matter)
fireEvent.pointerUp(canvas); </s> remove expect(renderScene).toHaveBeenCalledTimes(7);
expect(h.state.selectionElement).toBeNull();
expect(h.elements.length).toEqual(0);
});
</s> add expect(renderScene).toHaveBeenCalledTimes(7);
expect(h.state.selectionElement).toBeNull();
expect(h.elements.length).toEqual(0);
}); </s> remove // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
</s> add // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep replace replace replace replace keep replace replace replace replace replace keep keep keep
|
<mask> fireEvent.keyDown(document, { key: KEYS.ENTER });
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(7);
<mask> expect(h.state.selectionElement).toBeNull();
<mask> expect(h.elements.length).toEqual(0);
<mask> });
<mask>
<mask> it("line", async () => {
<mask> const { getByToolName, container } = await render(<ExcalidrawApp />);
<mask> // select tool
<mask> const tool = getByToolName("line");
<mask> fireEvent.click(tool);
<mask>
<mask> const canvas = container.querySelector("canvas")!;
<mask>
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove it("line", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("line");
fireEvent.click(tool);
</s> add it("line", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("line");
fireEvent.click(tool); </s> remove it("arrow", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("arrow");
fireEvent.click(tool);
</s> add it("arrow", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("arrow");
fireEvent.click(tool); </s> remove it("diamond", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("diamond");
fireEvent.click(tool);
</s> add it("diamond", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("diamond");
fireEvent.click(tool); </s> remove it("ellipse", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("ellipse");
fireEvent.click(tool);
</s> add it("ellipse", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("ellipse");
fireEvent.click(tool); </s> remove it("rectangle", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("rectangle");
fireEvent.click(tool);
</s> add it("rectangle", async () => {
const { getByToolName, container } = await render(<ExcalidrawApp />);
// select tool
const tool = getByToolName("rectangle");
fireEvent.click(tool);
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep replace keep replace replace keep keep keep keep
|
<mask> const tool = getByToolName("line");
<mask> fireEvent.click(tool);
<mask>
<mask> const canvas = container.querySelector("canvas")!;
<mask>
<mask> // start from (30, 20)
<mask> fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
<mask>
<mask> // finish (position does not matter)
<mask> fireEvent.pointerUp(canvas);
<mask>
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask>
<mask> // start from (30, 20)
<mask> fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
<mask>
<mask> // finish (position does not matter)
<mask> fireEvent.pointerUp(canvas);
<mask>
<mask> // we need to finalize it because arrows and lines enter multi-mode
<mask> fireEvent.keyDown(document, { key: KEYS.ENTER });
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(7);
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask>
<mask> // finish (position does not matter)
<mask> fireEvent.pointerUp(canvas);
<mask>
<mask> // we need to finalize it because arrows and lines enter multi-mode
<mask> fireEvent.keyDown(document, { key: KEYS.ENTER });
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(7);
<mask> expect(h.state.selectionElement).toBeNull();
<mask> expect(h.elements.length).toEqual(0);
<mask> });
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace replace replace keep keep
|
<mask>
<mask> // we need to finalize it because arrows and lines enter multi-mode
<mask> fireEvent.keyDown(document, { key: KEYS.ENTER });
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(7);
<mask> expect(h.state.selectionElement).toBeNull();
<mask> expect(h.elements.length).toEqual(0);
<mask> });
<mask> });
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove // we need to finalize it because arrows and lines enter multi-mode
fireEvent.keyDown(document, { key: KEYS.ENTER });
</s> add // we need to finalize it because arrows and lines enter multi-mode
fireEvent.keyDown(document, {
key: KEYS.ENTER,
}); </s> remove // we need to finalize it because arrows and lines enter multi-mode
fireEvent.keyDown(document, { key: KEYS.ENTER });
</s> add // we need to finalize it because arrows and lines enter multi-mode
fireEvent.keyDown(document, {
key: KEYS.ENTER,
}); </s> remove expect(renderScene).toHaveBeenCalledTimes(7);
expect(h.state.selectionElement).toBeNull();
expect(h.elements.length).toEqual(0);
});
</s> add expect(renderScene).toHaveBeenCalledTimes(7);
expect(h.state.selectionElement).toBeNull();
expect(h.elements.length).toEqual(0);
}); </s> remove // finish (position does not matter)
fireEvent.pointerUp(canvas);
</s> add // finish (position does not matter)
fireEvent.pointerUp(canvas); </s> remove // finish (position does not matter)
fireEvent.pointerUp(canvas);
</s> add // finish (position does not matter)
fireEvent.pointerUp(canvas); </s> remove // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
</s> add // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/dragCreate.test.tsx
|
keep keep keep keep replace keep keep keep keep keep
|
<mask>
<mask> // done
<mask> fireEvent.pointerDown(canvas);
<mask> fireEvent.pointerUp(canvas);
<mask> fireEvent.keyDown(document, { key: KEYS.ENTER });
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(14);
<mask> expect(h.elements.length).toEqual(1);
<mask>
<mask> const element = h.elements[0] as ExcalidrawLinearElement;
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove fireEvent.keyDown(document, { key: KEYS.ENTER });
</s> add fireEvent.keyDown(document, {
key: KEYS.ENTER,
}); </s> remove const element = h.elements[0] as ExcalidrawLinearElement;
</s> add const element = h.elements[0] as ExcalidrawLinearElement; </s> remove const element = h.elements[0] as ExcalidrawLinearElement;
</s> add const element = h.elements[0] as ExcalidrawLinearElement; </s> remove expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull();
</s> add expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull(); </s> remove expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull();
</s> add expect(renderScene).toHaveBeenCalledTimes(8);
expect(h.state.selectionElement).toBeNull(); </s> remove expect(h.elements.length).toEqual(1);
</s> add expect(h.elements.length).toEqual(1);
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/multiPointCreate.test.tsx
|
keep keep keep keep replace keep keep keep keep keep
|
<mask>
<mask> // done
<mask> fireEvent.pointerDown(canvas);
<mask> fireEvent.pointerUp(canvas);
<mask> fireEvent.keyDown(document, { key: KEYS.ENTER });
<mask>
<mask> expect(renderScene).toHaveBeenCalledTimes(14);
<mask> expect(h.elements.length).toEqual(1);
<mask>
<mask> const element = h.elements[0] as ExcalidrawLinearElement;
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/multiPointCreate.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> });
<mask>
<mask> it("zoom hotkeys", () => {
<mask> expect(h.state.zoom.value).toBe(1);
<mask> fireEvent.keyDown(document, { code: CODES.EQUAL, ctrlKey: true });
<mask> fireEvent.keyUp(document, { code: CODES.EQUAL, ctrlKey: true });
<mask> expect(h.state.zoom.value).toBeGreaterThan(1);
<mask> fireEvent.keyDown(document, { code: CODES.MINUS, ctrlKey: true });
<mask> fireEvent.keyUp(document, { code: CODES.MINUS, ctrlKey: true });
<mask> expect(h.state.zoom.value).toBe(1);
<mask> });
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove fireEvent.keyDown(document, { code: CODES.MINUS, ctrlKey: true });
fireEvent.keyUp(document, { code: CODES.MINUS, ctrlKey: true });
</s> add fireEvent.keyDown(document, {
code: CODES.MINUS,
ctrlKey: true,
});
fireEvent.keyUp(document, {
code: CODES.MINUS,
ctrlKey: true,
}); </s> remove document.addEventListener(EVENT.KEYDOWN, this.onKeyDown, false);
</s> add if (this.props.handleKeyboardGlobally) {
document.addEventListener(EVENT.KEYDOWN, this.onKeyDown, false);
} </s> remove fireEvent.keyDown(document, { key: KEYS.ESCAPE });
</s> add fireEvent.keyDown(document, {
key: KEYS.ESCAPE,
}); </s> remove fireEvent.keyDown(document, { key: KEYS.ESCAPE });
</s> add fireEvent.keyDown(document, {
key: KEYS.ESCAPE,
}); </s> remove fireEvent.keyDown(document, { key: KEYS.ESCAPE });
</s> add fireEvent.keyDown(document, {
key: KEYS.ESCAPE,
}); </s> remove fireEvent.keyDown(document, { key: KEYS.ESCAPE });
</s> add fireEvent.keyDown(document, {
key: KEYS.ESCAPE,
});
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/regressionTests.test.tsx
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> expect(h.state.zoom.value).toBe(1);
<mask> fireEvent.keyDown(document, { code: CODES.EQUAL, ctrlKey: true });
<mask> fireEvent.keyUp(document, { code: CODES.EQUAL, ctrlKey: true });
<mask> expect(h.state.zoom.value).toBeGreaterThan(1);
<mask> fireEvent.keyDown(document, { code: CODES.MINUS, ctrlKey: true });
<mask> fireEvent.keyUp(document, { code: CODES.MINUS, ctrlKey: true });
<mask> expect(h.state.zoom.value).toBe(1);
<mask> });
<mask>
<mask> it("rerenders UI on language change", async () => {
<mask> // select rectangle tool to show properties menu
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove fireEvent.keyDown(document, { code: CODES.EQUAL, ctrlKey: true });
fireEvent.keyUp(document, { code: CODES.EQUAL, ctrlKey: true });
</s> add fireEvent.keyDown(document, {
code: CODES.EQUAL,
ctrlKey: true,
});
fireEvent.keyUp(document, {
code: CODES.EQUAL,
ctrlKey: true,
}); </s> remove fireEvent.keyDown(document, { key: KEYS.ESCAPE });
</s> add fireEvent.keyDown(document, {
key: KEYS.ESCAPE,
}); </s> remove fireEvent.keyDown(document, { key: KEYS.ESCAPE });
</s> add fireEvent.keyDown(document, {
key: KEYS.ESCAPE,
}); </s> remove fireEvent.keyDown(document, { key: KEYS.ESCAPE });
</s> add fireEvent.keyDown(document, {
key: KEYS.ESCAPE,
}); </s> remove document.addEventListener(EVENT.KEYDOWN, this.onKeyDown, false);
</s> add if (this.props.handleKeyboardGlobally) {
document.addEventListener(EVENT.KEYDOWN, this.onKeyDown, false);
} </s> remove expect(renderScene).toHaveBeenCalledTimes(7);
expect(h.state.selectionElement).toBeNull();
expect(h.elements.length).toEqual(0);
});
</s> add expect(renderScene).toHaveBeenCalledTimes(7);
expect(h.state.selectionElement).toBeNull();
expect(h.elements.length).toEqual(0);
});
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/regressionTests.test.tsx
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> fireEvent.click(tool);
<mask> fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
<mask> fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
<mask> fireEvent.pointerUp(canvas);
<mask> fireEvent.keyDown(document, { key: KEYS.ESCAPE });
<mask> }
<mask>
<mask> const tool = getByToolName("selection");
<mask> fireEvent.click(tool);
<mask> // click on a line on the rectangle
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove fireEvent.keyDown(document, { key: KEYS.ESCAPE });
</s> add fireEvent.keyDown(document, {
key: KEYS.ESCAPE,
}); </s> remove fireEvent.keyDown(document, { key: KEYS.ESCAPE });
</s> add fireEvent.keyDown(document, {
key: KEYS.ESCAPE,
}); </s> remove fireEvent.keyDown(document, { key: KEYS.ESCAPE });
</s> add fireEvent.keyDown(document, {
key: KEYS.ESCAPE,
}); </s> remove fireEvent.keyDown(document, { key: KEYS.ESCAPE });
</s> add fireEvent.keyDown(document, {
key: KEYS.ESCAPE,
}); </s> remove // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
</s> add // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 }); </s> remove // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
</s> add // start from (30, 20)
fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/selection.test.tsx
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> fireEvent.click(tool);
<mask> fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
<mask> fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
<mask> fireEvent.pointerUp(canvas);
<mask> fireEvent.keyDown(document, { key: KEYS.ESCAPE });
<mask> }
<mask>
<mask> const tool = getByToolName("selection");
<mask> fireEvent.click(tool);
<mask> // click on a line on the rectangle
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/selection.test.tsx
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> fireEvent.click(tool);
<mask> fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
<mask> fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
<mask> fireEvent.pointerUp(canvas);
<mask> fireEvent.keyDown(document, { key: KEYS.ESCAPE });
<mask> }
<mask>
<mask> const tool = getByToolName("selection");
<mask> fireEvent.click(tool);
<mask> // click on a line on the rectangle
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/selection.test.tsx
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> fireEvent.click(tool);
<mask> fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
<mask> fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
<mask> fireEvent.pointerUp(canvas);
<mask> fireEvent.keyDown(document, { key: KEYS.ESCAPE });
<mask> }
<mask>
<mask> /*
<mask> 1 2 3 4 5 6 7 8 9
<mask> 1
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove fireEvent.keyDown(document, { key: KEYS.ESCAPE });
</s> add fireEvent.keyDown(document, {
key: KEYS.ESCAPE,
}); </s> remove fireEvent.keyDown(document, { key: KEYS.ESCAPE });
</s> add fireEvent.keyDown(document, {
key: KEYS.ESCAPE,
}); </s> remove fireEvent.keyDown(document, { key: KEYS.ESCAPE });
</s> add fireEvent.keyDown(document, {
key: KEYS.ESCAPE,
}); </s> remove fireEvent.keyDown(document, { key: KEYS.ESCAPE });
</s> add fireEvent.keyDown(document, {
key: KEYS.ESCAPE,
}); </s> remove // move to (60,70)
fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
</s> add // move to (60,70)
fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 }); </s> remove // move to (60,70)
fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
</s> add // move to (60,70)
fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/selection.test.tsx
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> fireEvent.click(tool);
<mask> fireEvent.pointerDown(canvas, { clientX: 30, clientY: 20 });
<mask> fireEvent.pointerMove(canvas, { clientX: 60, clientY: 70 });
<mask> fireEvent.pointerUp(canvas);
<mask> fireEvent.keyDown(document, { key: KEYS.ESCAPE });
<mask> }
<mask>
<mask> /*
<mask> 1 2 3 4 5 6 7 8 9
<mask> 1
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]>
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/tests/selection.test.tsx
|
keep keep keep add keep keep keep keep keep keep
|
<mask> appState: AppState,
<mask> ) => JSX.Element;
<mask> UIOptions?: UIOptions;
<mask> detectScroll?: boolean;
<mask> }
<mask>
<mask> export type SceneData = {
<mask> elements?: ImportedDataState["elements"];
<mask> appState?: ImportedDataState["appState"];
<mask> collaborators?: Map<string, Collaborator>;
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> remove app: { canvas: HTMLCanvasElement | null },
</s> add app: AppAPI, </s> remove event: KeyboardEvent,
</s> add event: React.KeyboardEvent | KeyboardEvent, </s> add type AppAPI = { canvas: HTMLCanvasElement | null; focusContainer(): void };
</s> remove perform: (_elements, appState) => {
</s> add perform: (_elements, appState, _, { focusContainer }) => {
if (appState.showHelpDialog) {
focusContainer();
} </s> remove handleKeyDown: (event: KeyboardEvent) => boolean;
</s> add handleKeyDown: (event: React.KeyboardEvent | KeyboardEvent) => boolean; </s> remove type App = { canvas: HTMLCanvasElement | null; props: AppProps };
</s> add type App = {
canvas: HTMLCanvasElement | null;
focusContainer: () => void;
props: AppProps;
};
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/types.ts
|
keep keep add keep
|
<mask> canvasActions: Required<CanvasActions>;
<mask> };
<mask> detectScroll: boolean;
<mask> };
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> add type AppAPI = { canvas: HTMLCanvasElement | null; focusContainer(): void };
</s> add focusNearestParent(event.target); </s> add } finally {
this.focusContainer(); </s> add public focusContainer = () => {
this.excalidrawContainerRef.current?.focus();
};
</s> add event.stopPropagation(); </s> add handleKeyboardGlobally={handleKeyboardGlobally}
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/types.ts
|
keep keep keep add
|
<mask> parent = parent.parentElement;
<mask> }
<mask> return document;
<mask> };
</s> feat: Bind keyboard events to the current excalidraw container and add handleKeyboardGlobally prop to allow host to bind to document (#3430)
* fix: Bind keyboard events to excalidraw container
* fix cases around blurring
* fix modal rendering so keyboard shortcuts work on modal as well
* Revert "fix modal rendering so keyboard shortcuts work on modal as well"
This reverts commit 2c8ec6be8eff7d308591467fe2c33cfbca16138f.
* Attach keyboard event in react way so we need not handle portals separately (modals)
* dnt propagate esc event when modal shown
* focus the container when help dialog closed with shift+?
* focus the help icon when help dialog on close triggered
* move focusNearestTabbableParent to util
* rename util to focusNearestParent and remove outline from excal and modal
* Add prop bindKeyGlobally to decide if keyboard events should be binded to document and allow it in excal app, revert tests
* fix
* focus container after installing library, reset library and closing error dialog
* fix tests and create util to focus container
* Add excalidraw-container class to focus on the container
* pass focus container to library to focus current instance of excal
* update docs
* remove util as it wont be used anywhere
* fix propagation not being stopped for React keyboard handling
* tweak reamde
Co-authored-by: David Luzar <[email protected]>
* tweak changelog
* rename prop to handleKeyboardGlobally
Co-authored-by: dwelle <[email protected]> </s> add public focusContainer = () => {
this.excalidrawContainerRef.current?.focus();
};
</s> add event.stopPropagation(); </s> add event.stopPropagation(); </s> add event.stopPropagation(); </s> add focusNearestParent(event.target); </s> add } finally {
this.focusContainer();
|
https://github.com/excalidraw/excalidraw/commit/d126d04d179ec10aca05bf7b3b2a0fb3eb04f739
|
src/utils.ts
|
keep keep keep keep replace replace replace keep keep keep keep keep
|
<mask> "semver": "^6.3.0"
<mask> }
<mask> },
<mask> "node-sass": {
<mask> "version": "4.14.0",
<mask> "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.14.0.tgz",
<mask> "integrity": "sha512-AxqU+DFpk0lEz95sI6jO0hU0Rwyw7BXVEv6o9OItoXLyeygPeaSpiV4rwQb10JiTghHaa0gZeD21sz+OsQluaw==",
<mask> "requires": {
<mask> "async-foreach": "^0.1.3",
<mask> "chalk": "^1.1.1",
<mask> "cross-spawn": "^3.0.0",
<mask> "gaze": "^1.0.0",
</s> Bump node-sass from 4.14.0 to 4.14.1 (#1579)
Bumps [node-sass](https://github.com/sass/node-sass) from 4.14.0 to 4.14.1.
- [Release notes](https://github.com/sass/node-sass/releases)
- [Changelog](https://github.com/sass/node-sass/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sass/node-sass/compare/v4.14.0...v4.14.1)
Signed-off-by: dependabot-preview[bot] <[email protected]>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> </s> remove "yargs": "^7.0.0"
},
"dependencies": {
"ansi-regex": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
},
"camelcase": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz",
"integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo="
},
"cliui": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz",
"integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=",
"requires": {
"string-width": "^1.0.1",
"strip-ansi": "^3.0.1",
"wrap-ansi": "^2.0.0"
}
},
"find-up": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
"integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=",
"requires": {
"path-exists": "^2.0.0",
"pinkie-promise": "^2.0.0"
}
},
"get-caller-file": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz",
"integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w=="
},
"invert-kv": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz",
"integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY="
},
"is-fullwidth-code-point": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
"requires": {
"number-is-nan": "^1.0.0"
}
},
"lcid": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz",
"integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=",
"requires": {
"invert-kv": "^1.0.0"
}
},
"load-json-file": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
"integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=",
"requires": {
"graceful-fs": "^4.1.2",
"parse-json": "^2.2.0",
"pify": "^2.0.0",
"pinkie-promise": "^2.0.0",
"strip-bom": "^2.0.0"
}
},
"os-locale": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
"integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=",
"requires": {
"lcid": "^1.0.0"
}
},
"parse-json": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz",
"integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=",
"requires": {
"error-ex": "^1.2.0"
}
},
"path-exists": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz",
"integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=",
"requires": {
"pinkie-promise": "^2.0.0"
}
},
"path-type": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz",
"integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=",
"requires": {
"graceful-fs": "^4.1.2",
"pify": "^2.0.0",
"pinkie-promise": "^2.0.0"
}
},
"pify": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
},
"read-pkg": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz",
"integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=",
"requires": {
"load-json-file": "^1.0.0",
"normalize-package-data": "^2.3.2",
"path-type": "^1.0.0"
}
},
"read-pkg-up": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz",
"integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=",
"requires": {
"find-up": "^1.0.0",
"read-pkg": "^1.0.0"
}
},
"require-main-filename": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz",
"integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE="
},
"string-width": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
"strip-ansi": "^3.0.0"
}
},
"strip-ansi": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"requires": {
"ansi-regex": "^2.0.0"
}
},
"strip-bom": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz",
"integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=",
"requires": {
"is-utf8": "^0.2.0"
}
},
"which-module": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz",
"integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8="
},
"wrap-ansi": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
"integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=",
"requires": {
"string-width": "^1.0.1",
"strip-ansi": "^3.0.1"
}
},
"y18n": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
"integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE="
},
"yargs": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz",
"integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=",
"requires": {
"camelcase": "^3.0.0",
"cliui": "^3.2.0",
"decamelize": "^1.1.1",
"get-caller-file": "^1.0.1",
"os-locale": "^1.4.0",
"read-pkg-up": "^1.0.1",
"require-directory": "^2.1.1",
"require-main-filename": "^1.0.1",
"set-blocking": "^2.0.0",
"string-width": "^1.0.2",
"which-module": "^1.0.0",
"y18n": "^3.2.1",
"yargs-parser": "^5.0.0"
}
},
"yargs-parser": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz",
"integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=",
"requires": {
"camelcase": "^3.0.0"
}
}
</s> add "yargs": "^13.3.2" </s> remove "version": "2.2.4",
"resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.4.tgz",
"integrity": "sha1-E/vWPNHK8JCLn9k0dq1DpR0eC0k=",
</s> add "version": "2.2.5",
"resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.5.tgz",
"integrity": "sha512-VFWDAHOe6mRuT4mZRd4eKE+d8Uedrk6Xnh7Sh9b4NGufQLQjOrvf/MQoOdx+0s92L89FeyUUNfU597j/3uNpag==", </s> remove "sass-graph": "^2.2.4",
</s> add "sass-graph": "2.2.5", </s> remove "node-sass": "4.14.0",
</s> add "node-sass": "4.14.1",
|
https://github.com/excalidraw/excalidraw/commit/d18e35ed7e344ba931c91a62d470b5c1c582c373
|
package-lock.json
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> "nan": "^2.13.2",
<mask> "node-gyp": "^3.8.0",
<mask> "npmlog": "^4.0.0",
<mask> "request": "^2.88.0",
<mask> "sass-graph": "^2.2.4",
<mask> "stdout-stream": "^1.4.0",
<mask> "true-case-path": "^1.0.2"
<mask> },
<mask> "dependencies": {
<mask> "ansi-regex": {
</s> Bump node-sass from 4.14.0 to 4.14.1 (#1579)
Bumps [node-sass](https://github.com/sass/node-sass) from 4.14.0 to 4.14.1.
- [Release notes](https://github.com/sass/node-sass/releases)
- [Changelog](https://github.com/sass/node-sass/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sass/node-sass/compare/v4.14.0...v4.14.1)
Signed-off-by: dependabot-preview[bot] <[email protected]>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> </s> remove "yargs": "^7.0.0"
},
"dependencies": {
"ansi-regex": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
},
"camelcase": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz",
"integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo="
},
"cliui": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz",
"integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=",
"requires": {
"string-width": "^1.0.1",
"strip-ansi": "^3.0.1",
"wrap-ansi": "^2.0.0"
}
},
"find-up": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
"integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=",
"requires": {
"path-exists": "^2.0.0",
"pinkie-promise": "^2.0.0"
}
},
"get-caller-file": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz",
"integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w=="
},
"invert-kv": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz",
"integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY="
},
"is-fullwidth-code-point": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
"requires": {
"number-is-nan": "^1.0.0"
}
},
"lcid": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz",
"integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=",
"requires": {
"invert-kv": "^1.0.0"
}
},
"load-json-file": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
"integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=",
"requires": {
"graceful-fs": "^4.1.2",
"parse-json": "^2.2.0",
"pify": "^2.0.0",
"pinkie-promise": "^2.0.0",
"strip-bom": "^2.0.0"
}
},
"os-locale": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
"integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=",
"requires": {
"lcid": "^1.0.0"
}
},
"parse-json": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz",
"integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=",
"requires": {
"error-ex": "^1.2.0"
}
},
"path-exists": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz",
"integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=",
"requires": {
"pinkie-promise": "^2.0.0"
}
},
"path-type": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz",
"integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=",
"requires": {
"graceful-fs": "^4.1.2",
"pify": "^2.0.0",
"pinkie-promise": "^2.0.0"
}
},
"pify": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
},
"read-pkg": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz",
"integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=",
"requires": {
"load-json-file": "^1.0.0",
"normalize-package-data": "^2.3.2",
"path-type": "^1.0.0"
}
},
"read-pkg-up": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz",
"integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=",
"requires": {
"find-up": "^1.0.0",
"read-pkg": "^1.0.0"
}
},
"require-main-filename": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz",
"integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE="
},
"string-width": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
"strip-ansi": "^3.0.0"
}
},
"strip-ansi": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"requires": {
"ansi-regex": "^2.0.0"
}
},
"strip-bom": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz",
"integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=",
"requires": {
"is-utf8": "^0.2.0"
}
},
"which-module": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz",
"integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8="
},
"wrap-ansi": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
"integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=",
"requires": {
"string-width": "^1.0.1",
"strip-ansi": "^3.0.1"
}
},
"y18n": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
"integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE="
},
"yargs": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz",
"integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=",
"requires": {
"camelcase": "^3.0.0",
"cliui": "^3.2.0",
"decamelize": "^1.1.1",
"get-caller-file": "^1.0.1",
"os-locale": "^1.4.0",
"read-pkg-up": "^1.0.1",
"require-directory": "^2.1.1",
"require-main-filename": "^1.0.1",
"set-blocking": "^2.0.0",
"string-width": "^1.0.2",
"which-module": "^1.0.0",
"y18n": "^3.2.1",
"yargs-parser": "^5.0.0"
}
},
"yargs-parser": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz",
"integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=",
"requires": {
"camelcase": "^3.0.0"
}
}
</s> add "yargs": "^13.3.2" </s> remove "version": "2.2.4",
"resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.4.tgz",
"integrity": "sha1-E/vWPNHK8JCLn9k0dq1DpR0eC0k=",
</s> add "version": "2.2.5",
"resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.5.tgz",
"integrity": "sha512-VFWDAHOe6mRuT4mZRd4eKE+d8Uedrk6Xnh7Sh9b4NGufQLQjOrvf/MQoOdx+0s92L89FeyUUNfU597j/3uNpag==", </s> remove "version": "4.14.0",
"resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.14.0.tgz",
"integrity": "sha512-AxqU+DFpk0lEz95sI6jO0hU0Rwyw7BXVEv6o9OItoXLyeygPeaSpiV4rwQb10JiTghHaa0gZeD21sz+OsQluaw==",
</s> add "version": "4.14.1",
"resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.14.1.tgz",
"integrity": "sha512-sjCuOlvGyCJS40R8BscF5vhVlQjNN069NtQ1gSxyK1u9iqvn6tf7O1R4GNowVZfiZUCRt5MmMs1xd+4V/7Yr0g==", </s> remove "node-sass": "4.14.0",
</s> add "node-sass": "4.14.1",
|
https://github.com/excalidraw/excalidraw/commit/d18e35ed7e344ba931c91a62d470b5c1c582c373
|
package-lock.json
|
keep keep replace replace replace keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep
|
<mask> },
<mask> "sass-graph": {
<mask> "version": "2.2.4",
<mask> "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.4.tgz",
<mask> "integrity": "sha1-E/vWPNHK8JCLn9k0dq1DpR0eC0k=",
<mask> "requires": {
<mask> "glob": "^7.0.0",
<mask> "lodash": "^4.0.0",
<mask> "scss-tokenizer": "^0.2.3",
<mask> "yargs": "^7.0.0"
<mask> },
<mask> "dependencies": {
<mask> "ansi-regex": {
<mask> "version": "2.1.1",
<mask> "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
<mask> "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
<mask> },
<mask> "camelcase": {
<mask> "version": "3.0.0",
<mask> "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz",
<mask> "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo="
<mask> },
<mask> "cliui": {
<mask> "version": "3.2.0",
<mask> "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz",
<mask> "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=",
<mask> "requires": {
<mask> "string-width": "^1.0.1",
<mask> "strip-ansi": "^3.0.1",
<mask> "wrap-ansi": "^2.0.0"
<mask> }
<mask> },
<mask> "find-up": {
<mask> "version": "1.1.2",
<mask> "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
<mask> "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=",
<mask> "requires": {
<mask> "path-exists": "^2.0.0",
<mask> "pinkie-promise": "^2.0.0"
<mask> }
<mask> },
<mask> "get-caller-file": {
<mask> "version": "1.0.3",
<mask> "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz",
<mask> "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w=="
<mask> },
<mask> "invert-kv": {
<mask> "version": "1.0.0",
<mask> "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz",
<mask> "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY="
<mask> },
<mask> "is-fullwidth-code-point": {
<mask> "version": "1.0.0",
<mask> "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
<mask> "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
<mask> "requires": {
<mask> "number-is-nan": "^1.0.0"
<mask> }
<mask> },
<mask> "lcid": {
<mask> "version": "1.0.0",
<mask> "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz",
<mask> "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=",
<mask> "requires": {
<mask> "invert-kv": "^1.0.0"
<mask> }
<mask> },
<mask> "load-json-file": {
<mask> "version": "1.1.0",
<mask> "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
<mask> "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=",
<mask> "requires": {
<mask> "graceful-fs": "^4.1.2",
<mask> "parse-json": "^2.2.0",
<mask> "pify": "^2.0.0",
<mask> "pinkie-promise": "^2.0.0",
<mask> "strip-bom": "^2.0.0"
<mask> }
<mask> },
<mask> "os-locale": {
<mask> "version": "1.4.0",
<mask> "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
<mask> "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=",
<mask> "requires": {
<mask> "lcid": "^1.0.0"
<mask> }
<mask> },
<mask> "parse-json": {
<mask> "version": "2.2.0",
<mask> "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz",
<mask> "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=",
<mask> "requires": {
<mask> "error-ex": "^1.2.0"
<mask> }
<mask> },
<mask> "path-exists": {
<mask> "version": "2.1.0",
<mask> "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz",
<mask> "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=",
<mask> "requires": {
<mask> "pinkie-promise": "^2.0.0"
<mask> }
<mask> },
<mask> "path-type": {
<mask> "version": "1.1.0",
<mask> "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz",
<mask> "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=",
<mask> "requires": {
<mask> "graceful-fs": "^4.1.2",
<mask> "pify": "^2.0.0",
<mask> "pinkie-promise": "^2.0.0"
<mask> }
<mask> },
<mask> "pify": {
<mask> "version": "2.3.0",
<mask> "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
<mask> "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
<mask> },
<mask> "read-pkg": {
<mask> "version": "1.1.0",
<mask> "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz",
<mask> "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=",
<mask> "requires": {
<mask> "load-json-file": "^1.0.0",
<mask> "normalize-package-data": "^2.3.2",
<mask> "path-type": "^1.0.0"
<mask> }
<mask> },
<mask> "read-pkg-up": {
<mask> "version": "1.0.1",
<mask> "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz",
<mask> "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=",
<mask> "requires": {
<mask> "find-up": "^1.0.0",
<mask> "read-pkg": "^1.0.0"
<mask> }
<mask> },
<mask> "require-main-filename": {
<mask> "version": "1.0.1",
<mask> "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz",
<mask> "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE="
<mask> },
<mask> "string-width": {
<mask> "version": "1.0.2",
<mask> "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
<mask> "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
<mask> "requires": {
<mask> "code-point-at": "^1.0.0",
<mask> "is-fullwidth-code-point": "^1.0.0",
<mask> "strip-ansi": "^3.0.0"
<mask> }
<mask> },
<mask> "strip-ansi": {
<mask> "version": "3.0.1",
<mask> "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
<mask> "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
<mask> "requires": {
<mask> "ansi-regex": "^2.0.0"
<mask> }
<mask> },
<mask> "strip-bom": {
<mask> "version": "2.0.0",
<mask> "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz",
<mask> "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=",
<mask> "requires": {
<mask> "is-utf8": "^0.2.0"
<mask> }
<mask> },
<mask> "which-module": {
<mask> "version": "1.0.0",
<mask> "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz",
<mask> "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8="
<mask> },
<mask> "wrap-ansi": {
<mask> "version": "2.1.0",
<mask> "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
<mask> "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=",
<mask> "requires": {
<mask> "string-width": "^1.0.1",
<mask> "strip-ansi": "^3.0.1"
<mask> }
<mask> },
<mask> "y18n": {
<mask> "version": "3.2.1",
<mask> "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
<mask> "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE="
<mask> },
<mask> "yargs": {
<mask> "version": "7.1.0",
<mask> "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz",
<mask> "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=",
<mask> "requires": {
<mask> "camelcase": "^3.0.0",
<mask> "cliui": "^3.2.0",
<mask> "decamelize": "^1.1.1",
<mask> "get-caller-file": "^1.0.1",
<mask> "os-locale": "^1.4.0",
<mask> "read-pkg-up": "^1.0.1",
<mask> "require-directory": "^2.1.1",
<mask> "require-main-filename": "^1.0.1",
<mask> "set-blocking": "^2.0.0",
<mask> "string-width": "^1.0.2",
<mask> "which-module": "^1.0.0",
<mask> "y18n": "^3.2.1",
<mask> "yargs-parser": "^5.0.0"
<mask> }
<mask> },
<mask> "yargs-parser": {
<mask> "version": "5.0.0",
<mask> "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz",
<mask> "integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=",
<mask> "requires": {
<mask> "camelcase": "^3.0.0"
<mask> }
<mask> }
<mask> }
<mask> },
</s> Bump node-sass from 4.14.0 to 4.14.1 (#1579)
Bumps [node-sass](https://github.com/sass/node-sass) from 4.14.0 to 4.14.1.
- [Release notes](https://github.com/sass/node-sass/releases)
- [Changelog](https://github.com/sass/node-sass/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sass/node-sass/compare/v4.14.0...v4.14.1)
Signed-off-by: dependabot-preview[bot] <[email protected]>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> </s> remove "version": "4.14.0",
"resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.14.0.tgz",
"integrity": "sha512-AxqU+DFpk0lEz95sI6jO0hU0Rwyw7BXVEv6o9OItoXLyeygPeaSpiV4rwQb10JiTghHaa0gZeD21sz+OsQluaw==",
</s> add "version": "4.14.1",
"resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.14.1.tgz",
"integrity": "sha512-sjCuOlvGyCJS40R8BscF5vhVlQjNN069NtQ1gSxyK1u9iqvn6tf7O1R4GNowVZfiZUCRt5MmMs1xd+4V/7Yr0g==", </s> remove "sass-graph": "^2.2.4",
</s> add "sass-graph": "2.2.5", </s> remove "node-sass": "4.14.0",
</s> add "node-sass": "4.14.1",
|
https://github.com/excalidraw/excalidraw/commit/d18e35ed7e344ba931c91a62d470b5c1c582c373
|
package-lock.json
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> "browser-nativefs": "0.7.3",
<mask> "i18next-browser-languagedetector": "4.1.1",
<mask> "lodash.throttle": "4.1.1",
<mask> "nanoid": "2.1.11",
<mask> "node-sass": "4.14.0",
<mask> "open-color": "1.7.0",
<mask> "points-on-curve": "0.2.0",
<mask> "pwacompat": "2.0.11",
<mask> "react": "16.13.1",
<mask> "react-dom": "16.13.1",
</s> Bump node-sass from 4.14.0 to 4.14.1 (#1579)
Bumps [node-sass](https://github.com/sass/node-sass) from 4.14.0 to 4.14.1.
- [Release notes](https://github.com/sass/node-sass/releases)
- [Changelog](https://github.com/sass/node-sass/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sass/node-sass/compare/v4.14.0...v4.14.1)
Signed-off-by: dependabot-preview[bot] <[email protected]>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> </s> remove "version": "4.14.0",
"resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.14.0.tgz",
"integrity": "sha512-AxqU+DFpk0lEz95sI6jO0hU0Rwyw7BXVEv6o9OItoXLyeygPeaSpiV4rwQb10JiTghHaa0gZeD21sz+OsQluaw==",
</s> add "version": "4.14.1",
"resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.14.1.tgz",
"integrity": "sha512-sjCuOlvGyCJS40R8BscF5vhVlQjNN069NtQ1gSxyK1u9iqvn6tf7O1R4GNowVZfiZUCRt5MmMs1xd+4V/7Yr0g==", </s> remove "yargs": "^7.0.0"
},
"dependencies": {
"ansi-regex": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
},
"camelcase": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz",
"integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo="
},
"cliui": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz",
"integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=",
"requires": {
"string-width": "^1.0.1",
"strip-ansi": "^3.0.1",
"wrap-ansi": "^2.0.0"
}
},
"find-up": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
"integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=",
"requires": {
"path-exists": "^2.0.0",
"pinkie-promise": "^2.0.0"
}
},
"get-caller-file": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz",
"integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w=="
},
"invert-kv": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz",
"integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY="
},
"is-fullwidth-code-point": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
"requires": {
"number-is-nan": "^1.0.0"
}
},
"lcid": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz",
"integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=",
"requires": {
"invert-kv": "^1.0.0"
}
},
"load-json-file": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
"integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=",
"requires": {
"graceful-fs": "^4.1.2",
"parse-json": "^2.2.0",
"pify": "^2.0.0",
"pinkie-promise": "^2.0.0",
"strip-bom": "^2.0.0"
}
},
"os-locale": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
"integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=",
"requires": {
"lcid": "^1.0.0"
}
},
"parse-json": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz",
"integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=",
"requires": {
"error-ex": "^1.2.0"
}
},
"path-exists": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz",
"integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=",
"requires": {
"pinkie-promise": "^2.0.0"
}
},
"path-type": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz",
"integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=",
"requires": {
"graceful-fs": "^4.1.2",
"pify": "^2.0.0",
"pinkie-promise": "^2.0.0"
}
},
"pify": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
},
"read-pkg": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz",
"integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=",
"requires": {
"load-json-file": "^1.0.0",
"normalize-package-data": "^2.3.2",
"path-type": "^1.0.0"
}
},
"read-pkg-up": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz",
"integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=",
"requires": {
"find-up": "^1.0.0",
"read-pkg": "^1.0.0"
}
},
"require-main-filename": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz",
"integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE="
},
"string-width": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
"strip-ansi": "^3.0.0"
}
},
"strip-ansi": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"requires": {
"ansi-regex": "^2.0.0"
}
},
"strip-bom": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz",
"integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=",
"requires": {
"is-utf8": "^0.2.0"
}
},
"which-module": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz",
"integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8="
},
"wrap-ansi": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
"integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=",
"requires": {
"string-width": "^1.0.1",
"strip-ansi": "^3.0.1"
}
},
"y18n": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
"integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE="
},
"yargs": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz",
"integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=",
"requires": {
"camelcase": "^3.0.0",
"cliui": "^3.2.0",
"decamelize": "^1.1.1",
"get-caller-file": "^1.0.1",
"os-locale": "^1.4.0",
"read-pkg-up": "^1.0.1",
"require-directory": "^2.1.1",
"require-main-filename": "^1.0.1",
"set-blocking": "^2.0.0",
"string-width": "^1.0.2",
"which-module": "^1.0.0",
"y18n": "^3.2.1",
"yargs-parser": "^5.0.0"
}
},
"yargs-parser": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz",
"integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=",
"requires": {
"camelcase": "^3.0.0"
}
}
</s> add "yargs": "^13.3.2" </s> remove "version": "2.2.4",
"resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.4.tgz",
"integrity": "sha1-E/vWPNHK8JCLn9k0dq1DpR0eC0k=",
</s> add "version": "2.2.5",
"resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.5.tgz",
"integrity": "sha512-VFWDAHOe6mRuT4mZRd4eKE+d8Uedrk6Xnh7Sh9b4NGufQLQjOrvf/MQoOdx+0s92L89FeyUUNfU597j/3uNpag==", </s> remove "sass-graph": "^2.2.4",
</s> add "sass-graph": "2.2.5",
|
https://github.com/excalidraw/excalidraw/commit/d18e35ed7e344ba931c91a62d470b5c1c582c373
|
package.json
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> updateBoundElements,
<mask> } from "../element/binding";
<mask> import { LinearElementEditor } from "../element/linearElementEditor";
<mask> import { mutateElement, newElementWith } from "../element/mutateElement";
<mask> import { deepCopyElement, newFreeDrawElement } from "../element/newElement";
<mask> import {
<mask> hasBoundTextElement,
<mask> isBindingElement,
<mask> isBindingElementType,
<mask> isBoundToContainer,
</s> fix: refresh text dimensions only after font load done (#5878)
* fix: refresh text dimensions only after font load done
* fix snaps </s> remove this.scene.getElementsIncludingDeleted().forEach((element) => {
if (isTextElement(element)) {
invalidateShapeForElement(element);
}
});
</s> add this.scene.replaceAllElements([
...this.scene.getElementsIncludingDeleted().map((element) => {
if (isTextElement(element)) {
invalidateShapeForElement(element);
return newElementWith(element, {
...refreshTextDimensions(element),
});
}
return element;
}),
]); </s> remove refreshDimensions = true,
</s> add refreshDimensions = false, </s> remove elements: restoreElements(data?.elements, localElements, true),
</s> add elements: restoreElements(data?.elements, localElements), </s> remove refreshDimensions = true,
</s> add refreshDimensions = false, </s> remove "width": 1,
</s> add "width": 100, </s> remove "width": 1,
</s> add "width": 100,
|
https://github.com/excalidraw/excalidraw/commit/d273acb7e49a1681e24b9c5b0b373dfcccee8ff6
|
src/components/App.tsx
|
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
|
<mask> event.preventDefault();
<mask> };
<mask>
<mask> private onFontLoaded = () => {
<mask> this.scene.getElementsIncludingDeleted().forEach((element) => {
<mask> if (isTextElement(element)) {
<mask> invalidateShapeForElement(element);
<mask> }
<mask> });
<mask> this.onSceneUpdated();
<mask> };
<mask>
<mask> private resetHistory = () => {
<mask> this.history.clear();
</s> fix: refresh text dimensions only after font load done (#5878)
* fix: refresh text dimensions only after font load done
* fix snaps </s> remove refreshDimensions = true,
</s> add refreshDimensions = false, </s> remove refreshDimensions = true,
</s> add refreshDimensions = false, </s> remove elements: restoreElements(data?.elements, localElements, true),
</s> add elements: restoreElements(data?.elements, localElements), </s> remove import { deepCopyElement, newFreeDrawElement } from "../element/newElement";
</s> add import {
deepCopyElement,
newFreeDrawElement,
refreshTextDimensions,
} from "../element/newElement"; </s> remove "width": 1,
</s> add "width": 100, </s> remove "width": 1,
</s> add "width": 100,
|
https://github.com/excalidraw/excalidraw/commit/d273acb7e49a1681e24b9c5b0b373dfcccee8ff6
|
src/components/App.tsx
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> };
<mask>
<mask> const restoreElement = (
<mask> element: Exclude<ExcalidrawElement, ExcalidrawSelectionElement>,
<mask> refreshDimensions = true,
<mask> ): typeof element | null => {
<mask> switch (element.type) {
<mask> case "text":
<mask> let fontSize = element.fontSize;
<mask> let fontFamily = element.fontFamily;
</s> fix: refresh text dimensions only after font load done (#5878)
* fix: refresh text dimensions only after font load done
* fix snaps </s> remove refreshDimensions = true,
</s> add refreshDimensions = false, </s> remove this.scene.getElementsIncludingDeleted().forEach((element) => {
if (isTextElement(element)) {
invalidateShapeForElement(element);
}
});
</s> add this.scene.replaceAllElements([
...this.scene.getElementsIncludingDeleted().map((element) => {
if (isTextElement(element)) {
invalidateShapeForElement(element);
return newElementWith(element, {
...refreshTextDimensions(element),
});
}
return element;
}),
]); </s> remove elements: restoreElements(data?.elements, localElements, true),
</s> add elements: restoreElements(data?.elements, localElements), </s> remove import { deepCopyElement, newFreeDrawElement } from "../element/newElement";
</s> add import {
deepCopyElement,
newFreeDrawElement,
refreshTextDimensions,
} from "../element/newElement"; </s> remove "width": 1,
</s> add "width": 100, </s> remove "height": 0,
</s> add "height": 100,
|
https://github.com/excalidraw/excalidraw/commit/d273acb7e49a1681e24b9c5b0b373dfcccee8ff6
|
src/data/restore.ts
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> export const restoreElements = (
<mask> elements: ImportedDataState["elements"],
<mask> /** NOTE doesn't serve for reconciliation */
<mask> localElements: readonly ExcalidrawElement[] | null | undefined,
<mask> refreshDimensions = true,
<mask> ): ExcalidrawElement[] => {
<mask> const localElementsMap = localElements ? arrayToMap(localElements) : null;
<mask> return (elements || []).reduce((elements, element) => {
<mask> // filtering out selection, which is legacy, no longer kept in elements,
<mask> // and causing issues if retained
</s> fix: refresh text dimensions only after font load done (#5878)
* fix: refresh text dimensions only after font load done
* fix snaps </s> remove elements: restoreElements(data?.elements, localElements, true),
</s> add elements: restoreElements(data?.elements, localElements), </s> remove refreshDimensions = true,
</s> add refreshDimensions = false, </s> remove this.scene.getElementsIncludingDeleted().forEach((element) => {
if (isTextElement(element)) {
invalidateShapeForElement(element);
}
});
</s> add this.scene.replaceAllElements([
...this.scene.getElementsIncludingDeleted().map((element) => {
if (isTextElement(element)) {
invalidateShapeForElement(element);
return newElementWith(element, {
...refreshTextDimensions(element),
});
}
return element;
}),
]); </s> remove import { deepCopyElement, newFreeDrawElement } from "../element/newElement";
</s> add import {
deepCopyElement,
newFreeDrawElement,
refreshTextDimensions,
} from "../element/newElement"; </s> remove "width": 1,
</s> add "width": 100, </s> remove "height": 0,
</s> add "height": 100,
|
https://github.com/excalidraw/excalidraw/commit/d273acb7e49a1681e24b9c5b0b373dfcccee8ff6
|
src/data/restore.ts
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> localAppState: Partial<AppState> | null | undefined,
<mask> localElements: readonly ExcalidrawElement[] | null | undefined,
<mask> ): RestoredDataState => {
<mask> return {
<mask> elements: restoreElements(data?.elements, localElements, true),
<mask> appState: restoreAppState(data?.appState, localAppState || null),
<mask> files: data?.files || {},
<mask> };
<mask> };
<mask>
</s> fix: refresh text dimensions only after font load done (#5878)
* fix: refresh text dimensions only after font load done
* fix snaps </s> remove refreshDimensions = true,
</s> add refreshDimensions = false, </s> remove refreshDimensions = true,
</s> add refreshDimensions = false, </s> remove this.scene.getElementsIncludingDeleted().forEach((element) => {
if (isTextElement(element)) {
invalidateShapeForElement(element);
}
});
</s> add this.scene.replaceAllElements([
...this.scene.getElementsIncludingDeleted().map((element) => {
if (isTextElement(element)) {
invalidateShapeForElement(element);
return newElementWith(element, {
...refreshTextDimensions(element),
});
}
return element;
}),
]); </s> remove import { deepCopyElement, newFreeDrawElement } from "../element/newElement";
</s> add import {
deepCopyElement,
newFreeDrawElement,
refreshTextDimensions,
} from "../element/newElement"; </s> remove "width": 1,
</s> add "width": 100, </s> remove "height": 0,
</s> add "height": 100,
|
https://github.com/excalidraw/excalidraw/commit/d273acb7e49a1681e24b9c5b0b373dfcccee8ff6
|
src/data/restore.ts
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> "fillStyle": "hachure",
<mask> "fontFamily": 1,
<mask> "fontSize": 14,
<mask> "groupIds": Array [],
<mask> "height": 0,
<mask> "id": "id-text01",
<mask> "isDeleted": false,
<mask> "link": null,
<mask> "locked": false,
<mask> "opacity": 100,
</s> fix: refresh text dimensions only after font load done (#5878)
* fix: refresh text dimensions only after font load done
* fix snaps </s> remove "height": 0,
</s> add "height": 100, </s> remove "width": 1,
</s> add "width": 100, </s> remove "width": 1,
</s> add "width": 100, </s> remove refreshDimensions = true,
</s> add refreshDimensions = false, </s> remove refreshDimensions = true,
</s> add refreshDimensions = false, </s> remove elements: restoreElements(data?.elements, localElements, true),
</s> add elements: restoreElements(data?.elements, localElements),
|
https://github.com/excalidraw/excalidraw/commit/d273acb7e49a1681e24b9c5b0b373dfcccee8ff6
|
src/tests/data/__snapshots__/restore.test.ts.snap
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> "updated": 1,
<mask> "version": 1,
<mask> "versionNonce": 0,
<mask> "verticalAlign": "middle",
<mask> "width": 1,
<mask> "x": -0.5,
<mask> "y": 0,
<mask> }
<mask> `;
<mask>
</s> fix: refresh text dimensions only after font load done (#5878)
* fix: refresh text dimensions only after font load done
* fix snaps </s> remove "width": 1,
</s> add "width": 100, </s> remove "height": 0,
</s> add "height": 100, </s> remove "height": 0,
</s> add "height": 100, </s> remove import { deepCopyElement, newFreeDrawElement } from "../element/newElement";
</s> add import {
deepCopyElement,
newFreeDrawElement,
refreshTextDimensions,
} from "../element/newElement"; </s> remove this.scene.getElementsIncludingDeleted().forEach((element) => {
if (isTextElement(element)) {
invalidateShapeForElement(element);
}
});
</s> add this.scene.replaceAllElements([
...this.scene.getElementsIncludingDeleted().map((element) => {
if (isTextElement(element)) {
invalidateShapeForElement(element);
return newElementWith(element, {
...refreshTextDimensions(element),
});
}
return element;
}),
]); </s> remove elements: restoreElements(data?.elements, localElements, true),
</s> add elements: restoreElements(data?.elements, localElements),
|
https://github.com/excalidraw/excalidraw/commit/d273acb7e49a1681e24b9c5b0b373dfcccee8ff6
|
src/tests/data/__snapshots__/restore.test.ts.snap
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> "fillStyle": "hachure",
<mask> "fontFamily": 1,
<mask> "fontSize": 10,
<mask> "groupIds": Array [],
<mask> "height": 0,
<mask> "id": "id-text01",
<mask> "isDeleted": false,
<mask> "link": null,
<mask> "locked": false,
<mask> "opacity": 100,
</s> fix: refresh text dimensions only after font load done (#5878)
* fix: refresh text dimensions only after font load done
* fix snaps </s> remove "height": 0,
</s> add "height": 100, </s> remove "width": 1,
</s> add "width": 100, </s> remove "width": 1,
</s> add "width": 100, </s> remove refreshDimensions = true,
</s> add refreshDimensions = false, </s> remove refreshDimensions = true,
</s> add refreshDimensions = false, </s> remove elements: restoreElements(data?.elements, localElements, true),
</s> add elements: restoreElements(data?.elements, localElements),
|
https://github.com/excalidraw/excalidraw/commit/d273acb7e49a1681e24b9c5b0b373dfcccee8ff6
|
src/tests/data/__snapshots__/restore.test.ts.snap
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.