d126d04d17
* 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 <luzar.david@gmail.com> * tweak changelog * rename prop to handleKeyboardGlobally Co-authored-by: dwelle <luzar.david@gmail.com>
170 lines
3.6 KiB
Plaintext
170 lines
3.6 KiB
Plaintext
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
exports[`Test dragCreate add element to the scene when pointer dragging long enough arrow 1`] = `1`;
|
|
|
|
exports[`Test dragCreate add element to the scene when pointer dragging long enough arrow 2`] = `
|
|
Object {
|
|
"angle": 0,
|
|
"backgroundColor": "transparent",
|
|
"boundElementIds": null,
|
|
"endArrowhead": "arrow",
|
|
"endBinding": null,
|
|
"fillStyle": "hachure",
|
|
"groupIds": Array [],
|
|
"height": 50,
|
|
"id": "id0",
|
|
"isDeleted": false,
|
|
"lastCommittedPoint": null,
|
|
"opacity": 100,
|
|
"points": Array [
|
|
Array [
|
|
0,
|
|
0,
|
|
],
|
|
Array [
|
|
30,
|
|
50,
|
|
],
|
|
],
|
|
"roughness": 1,
|
|
"seed": 337897,
|
|
"startArrowhead": null,
|
|
"startBinding": null,
|
|
"strokeColor": "#000000",
|
|
"strokeSharpness": "round",
|
|
"strokeStyle": "solid",
|
|
"strokeWidth": 1,
|
|
"type": "arrow",
|
|
"version": 3,
|
|
"versionNonce": 449462985,
|
|
"width": 30,
|
|
"x": 30,
|
|
"y": 20,
|
|
}
|
|
`;
|
|
|
|
exports[`Test dragCreate add element to the scene when pointer dragging long enough diamond 1`] = `1`;
|
|
|
|
exports[`Test dragCreate add element to the scene when pointer dragging long enough diamond 2`] = `
|
|
Object {
|
|
"angle": 0,
|
|
"backgroundColor": "transparent",
|
|
"boundElementIds": null,
|
|
"fillStyle": "hachure",
|
|
"groupIds": Array [],
|
|
"height": 50,
|
|
"id": "id0",
|
|
"isDeleted": false,
|
|
"opacity": 100,
|
|
"roughness": 1,
|
|
"seed": 337897,
|
|
"strokeColor": "#000000",
|
|
"strokeSharpness": "sharp",
|
|
"strokeStyle": "solid",
|
|
"strokeWidth": 1,
|
|
"type": "diamond",
|
|
"version": 2,
|
|
"versionNonce": 1278240551,
|
|
"width": 30,
|
|
"x": 30,
|
|
"y": 20,
|
|
}
|
|
`;
|
|
|
|
exports[`Test dragCreate add element to the scene when pointer dragging long enough ellipse 1`] = `1`;
|
|
|
|
exports[`Test dragCreate add element to the scene when pointer dragging long enough ellipse 2`] = `
|
|
Object {
|
|
"angle": 0,
|
|
"backgroundColor": "transparent",
|
|
"boundElementIds": null,
|
|
"fillStyle": "hachure",
|
|
"groupIds": Array [],
|
|
"height": 50,
|
|
"id": "id0",
|
|
"isDeleted": false,
|
|
"opacity": 100,
|
|
"roughness": 1,
|
|
"seed": 337897,
|
|
"strokeColor": "#000000",
|
|
"strokeSharpness": "sharp",
|
|
"strokeStyle": "solid",
|
|
"strokeWidth": 1,
|
|
"type": "ellipse",
|
|
"version": 2,
|
|
"versionNonce": 1278240551,
|
|
"width": 30,
|
|
"x": 30,
|
|
"y": 20,
|
|
}
|
|
`;
|
|
|
|
exports[`Test dragCreate add element to the scene when pointer dragging long enough line 1`] = `
|
|
Object {
|
|
"angle": 0,
|
|
"backgroundColor": "transparent",
|
|
"boundElementIds": null,
|
|
"endArrowhead": null,
|
|
"endBinding": null,
|
|
"fillStyle": "hachure",
|
|
"groupIds": Array [],
|
|
"height": 50,
|
|
"id": "id0",
|
|
"isDeleted": false,
|
|
"lastCommittedPoint": null,
|
|
"opacity": 100,
|
|
"points": Array [
|
|
Array [
|
|
0,
|
|
0,
|
|
],
|
|
Array [
|
|
30,
|
|
50,
|
|
],
|
|
],
|
|
"roughness": 1,
|
|
"seed": 337897,
|
|
"startArrowhead": null,
|
|
"startBinding": null,
|
|
"strokeColor": "#000000",
|
|
"strokeSharpness": "round",
|
|
"strokeStyle": "solid",
|
|
"strokeWidth": 1,
|
|
"type": "line",
|
|
"version": 3,
|
|
"versionNonce": 449462985,
|
|
"width": 30,
|
|
"x": 30,
|
|
"y": 20,
|
|
}
|
|
`;
|
|
|
|
exports[`Test dragCreate add element to the scene when pointer dragging long enough rectangle 1`] = `1`;
|
|
|
|
exports[`Test dragCreate add element to the scene when pointer dragging long enough rectangle 2`] = `
|
|
Object {
|
|
"angle": 0,
|
|
"backgroundColor": "transparent",
|
|
"boundElementIds": null,
|
|
"fillStyle": "hachure",
|
|
"groupIds": Array [],
|
|
"height": 50,
|
|
"id": "id0",
|
|
"isDeleted": false,
|
|
"opacity": 100,
|
|
"roughness": 1,
|
|
"seed": 337897,
|
|
"strokeColor": "#000000",
|
|
"strokeSharpness": "sharp",
|
|
"strokeStyle": "solid",
|
|
"strokeWidth": 1,
|
|
"type": "rectangle",
|
|
"version": 2,
|
|
"versionNonce": 1278240551,
|
|
"width": 30,
|
|
"x": 30,
|
|
"y": 20,
|
|
}
|
|
`;
|