From ee703206b067383977891c63b906767d1946404b Mon Sep 17 00:00:00 2001 From: Aakansha Doshi Date: Sat, 16 Jan 2021 22:20:46 +0530 Subject: [PATCH 01/16] docs: update changelog and release 0.2.0 (#2725) * docs(changelog): update changelog and release 0.2.0 * fix * Add missing API's * update * fix * fix * Apply suggestions from code review * remove * fix * fix --- src/packages/excalidraw/CHANGELOG.md | 26 ++++++++++++- src/packages/excalidraw/README.md | 45 +++++++++++++++++++++++ src/packages/excalidraw/package-lock.json | 2 +- src/packages/excalidraw/package.json | 2 +- 4 files changed, 72 insertions(+), 3 deletions(-) diff --git a/src/packages/excalidraw/CHANGELOG.md b/src/packages/excalidraw/CHANGELOG.md index aa0ec43ba5..f161523892 100644 --- a/src/packages/excalidraw/CHANGELOG.md +++ b/src/packages/excalidraw/CHANGELOG.md @@ -12,15 +12,21 @@ The change should be grouped under one of the below section and must contain PR Please add the latest change on the top under the correct section. --> -## [Unreleased] +## 0.2.0 ### Features +- Add toast [#2772](https://github.com/excalidraw/excalidraw/pull/2772) - Add `cmd+o` shortcut to load scene [#2732](https://github.com/excalidraw/excalidraw/pull/2732) - Remove language picker, and add `langCode`, `renderFooter` [#2644](https://github.com/excalidraw/excalidraw/pull/2644): - BREAKING: removed the language picker from UI. It is now the host app's responsibility to implement a language picker if desirable, using the newly added [`renderFooter`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#renderFooter) prop. The reasoning is that the i18n should be controlled by the app itself, not by the nested Excalidraw component. - Added [`langCode`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#langCode) prop to control the UI language. - Add support for `exportToBackend` prop to allow host apps to implement shareable links [#2612](https://github.com/excalidraw/excalidraw/pull/2612/files) +- Require use of a preset dialog size; adjust dialog sizing [#2684](https://github.com/excalidraw/excalidraw/pull/2684) +- Add line chart and paste dialog selection [#2670](https://github.com/excalidraw/excalidraw/pull/2670) +- Tweak editing behavior [#2668](https://github.com/excalidraw/excalidraw/pull/2668) +- Change title to Excalidraw after a timeout +- Checkmark to toggle context-menu-items [#2645](https://github.com/excalidraw/excalidraw/pull/2645) - Add zoom to selection [#2522](https://github.com/excalidraw/excalidraw/pull/2522) - Insert Library items in the middle of the screen [#2527](https://github.com/excalidraw/excalidraw/pull/2527) - Show shortcut context menu [#2501](https://github.com/excalidraw/excalidraw/pull/2501) @@ -31,7 +37,12 @@ Please add the latest change on the top under the correct section. ### Fixes +- Fix typo for initialData and point all links to master [#2707](https://github.com/excalidraw/excalidraw/pull/2707) +- Fix compile error [#2685](https://github.com/excalidraw/excalidraw/pull/2685) +- Center zoom on iPhone and iPad [#2642](https://github.com/excalidraw/excalidraw/pull/2642) - Allow text-selecting in dialogs & reset cursor [#2783](https://github.com/excalidraw/excalidraw/pull/2783) +- Don't render due to zoom after unmount [#2779](https://github.com/excalidraw/excalidraw/pull/2779) +- Track the chart type correctly [#2773](https://github.com/excalidraw/excalidraw/pull/2773) - Fix late-render due to debounced zoom [#2779](https://github.com/excalidraw/excalidraw/pull/2779) - Fix initialization when browser tab not focused [#2677](https://github.com/excalidraw/excalidraw/pull/2677) - Consistent case for export locale strings [#2622](https://github.com/excalidraw/excalidraw/pull/2622) @@ -47,6 +58,11 @@ Please add the latest change on the top under the correct section. ### Improvements - Added Zen Mode to the context menu [#2734](https://github.com/excalidraw/excalidraw/pull/2734) +- Do not reset to selection for draw tool [#2721]((https://github.com/excalidraw/excalidraw/pull/2721) +- Make dialogs look more like dialogs [#2686](https://github.com/excalidraw/excalidraw/pull/2686) +- Browse libraries styles fixed [#2694](https://github.com/excalidraw/excalidraw/pull/2694) +- Change hint for 2-point lines on resize [#2655](https://github.com/excalidraw/excalidraw/pull/2655) +- Align items in context menu [#2640](https://github.com/excalidraw/excalidraw/pull/2640) - Do not reset to selection when using the draw tool [#2721](https://github.com/excalidraw/excalidraw/pull/2721) - Display proper tooltip for 2-point lines during resize, and normalize modifier key labels in hints [#2655](https://github.com/excalidraw/excalidraw/pull/2655) - Improve error message around importing images [#2619](https://github.com/excalidraw/excalidraw/pull/2619) @@ -56,6 +72,14 @@ Please add the latest change on the top under the correct section. - Hide shortcuts on pickers for mobile [#2508](https://github.com/excalidraw/excalidraw/pull/2508) - Hide stats and scrollToContent-button when mobile menus open [#2509](https://github.com/excalidraw/excalidraw/pull/2509) +### Refactor + +- refactor: Converting span to kbd tag [#2774](https://github.com/excalidraw/excalidraw/pull/2774) +- Media queries [#2680](https://github.com/excalidraw/excalidraw/pull/2680) +- Remove duplicate entry from en.json[#2654](https://github.com/excalidraw/excalidraw/pull/2654) +- Remove the word toggle from labels [#2648](https://github.com/excalidraw/excalidraw/pull/2648) +- + ### Chore - Bump ini from 1.3.5 to 1.3.7 in /src/packages/excalidraw [#2500](https://github.com/excalidraw/excalidraw/pull/2500) diff --git a/src/packages/excalidraw/README.md b/src/packages/excalidraw/README.md index 36c76f6687..12adfb6bfb 100644 --- a/src/packages/excalidraw/README.md +++ b/src/packages/excalidraw/README.md @@ -142,6 +142,51 @@ export default function App() { | [`langCode`](#langCode) | string | `en` | Language code string | | [`renderFooter `](#renderFooter) | Function | | Function that renders custom UI footer | +### `Extra API's` + +#### `getSceneVersion` + +**How to use** + +
+import { getSceneVersion } from "@excalidraw/excalidraw";
+getSceneVersion(elements:  ExcalidrawElement [])
+
+ +This function returns the current scene version. + +#### `getSyncableElements` + +**_Signature_** + +
+getSyncableElements(elements:  ExcalidrawElement []):ExcalidrawElement []
+
+ +**How to use** + +```js +import { getSyncableElements } from "@excalidraw/excalidraw"; +``` + +This function returns all the deleted elements of the scene. + +### `getElementMap` + +**_Signature_** + +
+getElementsMap(elements:  ExcalidrawElement []): {[id: string]: ExcalidrawElement}
+
+ +**How to use** + +```js +import { getElementsMap } from "@excalidraw/excalidraw"; +``` + +This function returns an object where each element is mapped to its id. + #### `width` This props defines the `width` of the Excalidraw component. Defaults to `window.innerWidth` if not passed. diff --git a/src/packages/excalidraw/package-lock.json b/src/packages/excalidraw/package-lock.json index 9e2c3df72f..2b5f7c7569 100644 --- a/src/packages/excalidraw/package-lock.json +++ b/src/packages/excalidraw/package-lock.json @@ -1,6 +1,6 @@ { "name": "@excalidraw/excalidraw", - "version": "0.1.1", + "version": "0.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/packages/excalidraw/package.json b/src/packages/excalidraw/package.json index 62125fe9f9..8c0a529abb 100644 --- a/src/packages/excalidraw/package.json +++ b/src/packages/excalidraw/package.json @@ -1,6 +1,6 @@ { "name": "@excalidraw/excalidraw", - "version": "0.1.1", + "version": "0.2.0", "main": "dist/excalidraw.min.js", "files": [ "dist/*" From c799b28a0ed3ac4b3643cd86b66ef5c72a7d0d3f Mon Sep 17 00:00:00 2001 From: Lipis Date: Sat, 16 Jan 2021 19:59:26 +0200 Subject: [PATCH 02/16] fix: Count all versions (#2798) --- src/constants.ts | 1 + src/excalidraw-app/index.tsx | 16 ++++------------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/constants.ts b/src/constants.ts index b577da57a6..f783bb5fa5 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -90,3 +90,4 @@ export const TAP_TWICE_TIMEOUT = 300; export const TOUCH_CTX_MENU_TIMEOUT = 500; export const TITLE_TIMEOUT = 10000; export const TOAST_TIMEOUT = 5000; +export const VERSION_TIMEOUT = 15000; diff --git a/src/excalidraw-app/index.tsx b/src/excalidraw-app/index.tsx index 9dbdf544fa..e90664e8e5 100644 --- a/src/excalidraw-app/index.tsx +++ b/src/excalidraw-app/index.tsx @@ -11,7 +11,7 @@ import { getDefaultAppState } from "../appState"; import { ExcalidrawImperativeAPI } from "../components/App"; import { ErrorDialog } from "../components/ErrorDialog"; import { TopErrorBoundary } from "../components/TopErrorBoundary"; -import { APP_NAME, EVENT, TITLE_TIMEOUT } from "../constants"; +import { APP_NAME, EVENT, TITLE_TIMEOUT, VERSION_TIMEOUT } from "../constants"; import { ImportedDataState } from "../data/types"; import { ExcalidrawElement, @@ -229,18 +229,10 @@ function ExcalidrawWrapper(props: { collab: CollabAPI }) { const { collab } = props; useEffect(() => { - // delayed by 15 sec so that the app has a time to load the latest SW + // Delayed so that the app has a time to load the latest SW setTimeout(() => { - const version = getVersion(); - const loggedVersion = window.localStorage.getItem( - "excalidraw-lastLoggedVersion", - ); - // prevent logging on multiple visits - if (version && version !== loggedVersion) { - window.localStorage.setItem("excalidraw-lastLoggedVersion", version); - trackEvent("load", "version", version); - } - }, 15000); + trackEvent("load", "version", getVersion()); + }, VERSION_TIMEOUT); excalidrawRef.current!.readyPromise.then((excalidrawApi) => { initializeScene({ From e26f374ca6175d70d182e9353dae209b71f28e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Forja?= Date: Sat, 16 Jan 2021 18:49:13 +0000 Subject: [PATCH 03/16] improvement: Enhance resize for non generic elements (#2720) --- src/components/App.tsx | 3 - src/element/index.ts | 1 - src/element/resizeElements.ts | 317 ++++++++++++---------------------- src/element/resizeTest.ts | 54 ------ src/math.ts | 58 ------- src/tests/resize.test.tsx | 2 +- 6 files changed, 112 insertions(+), 323 deletions(-) diff --git a/src/components/App.tsx b/src/components/App.tsx index faca963c6f..d680034c5f 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -3587,9 +3587,6 @@ class App extends React.Component { transformElements( pointerDownState, transformHandleType, - (newTransformHandle) => { - pointerDownState.resize.handleType = newTransformHandle; - }, selectedElements, pointerDownState.resize.arrowDirection, getRotateWithDiscreteAngleKey(event), diff --git a/src/element/index.ts b/src/element/index.ts index e49bc633e3..63fdcfff49 100644 --- a/src/element/index.ts +++ b/src/element/index.ts @@ -34,7 +34,6 @@ export { export { resizeTest, getCursorForResizingElement, - normalizeTransformHandleType, getElementWithTransformHandleType, getTransformHandleTypeFromCoords, } from "./resizeTest"; diff --git a/src/element/resizeElements.ts b/src/element/resizeElements.ts index 199e3a4824..96c216b06e 100644 --- a/src/element/resizeElements.ts +++ b/src/element/resizeElements.ts @@ -4,7 +4,6 @@ import { rescalePoints } from "../points"; import { rotate, adjustXYWithRotation, - getFlipAdjustment, centerPoint, rotatePoint, } from "../math"; @@ -13,21 +12,16 @@ import { ExcalidrawTextElement, NonDeletedExcalidrawElement, NonDeleted, - ExcalidrawGenericElement, - ExcalidrawElement, } from "./types"; import { getElementAbsoluteCoords, getCommonBounds, getResizedElementAbsoluteCoords, } from "./bounds"; -import { isGenericElement, isLinearElement, isTextElement } from "./typeChecks"; +import { isLinearElement, isTextElement } from "./typeChecks"; import { mutateElement } from "./mutateElement"; import { getPerfectElementSize } from "./sizeHelpers"; -import { - getCursorForResizingElement, - normalizeTransformHandleType, -} from "./resizeTest"; +import { getCursorForResizingElement } from "./resizeTest"; import { measureText, getFontString } from "../utils"; import { updateBoundElements } from "./binding"; import { @@ -49,7 +43,6 @@ const normalizeAngle = (angle: number): number => { export const transformElements = ( pointerDownState: PointerDownState, transformHandleType: MaybeTransformHandleType, - setTransformHandle: (nextTransformHandle: MaybeTransformHandleType) => void, selectedElements: readonly NonDeletedExcalidrawElement[], resizeArrowDirection: "origin" | "end", isRotateWithDiscreteAngle: boolean, @@ -101,36 +94,15 @@ export const transformElements = ( ); updateBoundElements(element); } else if (transformHandleType) { - if (isGenericElement(element)) { - resizeSingleGenericElement( - pointerDownState.originalElements.get(element.id) as typeof element, - shouldKeepSidesRatio, - element, - transformHandleType, - isResizeCenterPoint, - pointerX, - pointerY, - ); - } else { - const keepSquareAspectRatio = shouldKeepSidesRatio; - resizeSingleNonGenericElement( - element, - transformHandleType, - isResizeCenterPoint, - keepSquareAspectRatio, - pointerX, - pointerY, - ); - setTransformHandle( - normalizeTransformHandleType(element, transformHandleType), - ); - if (element.width < 0) { - mutateElement(element, { width: -element.width }); - } - if (element.height < 0) { - mutateElement(element, { height: -element.height }); - } - } + resizeSingleElement( + pointerDownState.originalElements.get(element.id) as typeof element, + shouldKeepSidesRatio, + element, + transformHandleType, + isResizeCenterPoint, + pointerX, + pointerY, + ); } // update cursor @@ -414,8 +386,8 @@ const resizeSingleTextElement = ( } }; -const resizeSingleGenericElement = ( - stateAtResizeStart: NonDeleted, +const resizeSingleElement = ( + stateAtResizeStart: NonDeletedExcalidrawElement, shouldKeepSidesRatio: boolean, element: NonDeletedExcalidrawElement, transformHandleDirection: TransformHandleDirection, @@ -423,251 +395,184 @@ const resizeSingleGenericElement = ( pointerX: number, pointerY: number, ) => { - const [x1, y1, x2, y2] = getElementAbsoluteCoords(stateAtResizeStart); + // Gets bounds corners + const [x1, y1, x2, y2] = getResizedElementAbsoluteCoords( + stateAtResizeStart, + stateAtResizeStart.width, + stateAtResizeStart.height, + ); const startTopLeft: Point = [x1, y1]; const startBottomRight: Point = [x2, y2]; const startCenter: Point = centerPoint(startTopLeft, startBottomRight); // Calculate new dimensions based on cursor position - let newWidth = stateAtResizeStart.width; - let newHeight = stateAtResizeStart.height; const rotatedPointer = rotatePoint( [pointerX, pointerY], startCenter, -stateAtResizeStart.angle, ); + + //Get bounds corners rendered on screen + const [esx1, esy1, esx2, esy2] = getResizedElementAbsoluteCoords( + element, + element.width, + element.height, + ); + const boundsCurrentWidth = esx2 - esx1; + const boundsCurrentHeight = esy2 - esy1; + + // It's important we set the initial scale value based on the width and height at resize start, + // otherwise previous dimensions affected by modifiers will be taken into account. + const atStartBoundsWidth = startBottomRight[0] - startTopLeft[0]; + const atStartBoundsHeight = startBottomRight[1] - startTopLeft[1]; + let scaleX = atStartBoundsWidth / boundsCurrentWidth; + let scaleY = atStartBoundsHeight / boundsCurrentHeight; + if (transformHandleDirection.includes("e")) { - newWidth = rotatedPointer[0] - startTopLeft[0]; + scaleX = (rotatedPointer[0] - startTopLeft[0]) / boundsCurrentWidth; } if (transformHandleDirection.includes("s")) { - newHeight = rotatedPointer[1] - startTopLeft[1]; + scaleY = (rotatedPointer[1] - startTopLeft[1]) / boundsCurrentHeight; } if (transformHandleDirection.includes("w")) { - newWidth = startBottomRight[0] - rotatedPointer[0]; + scaleX = (startBottomRight[0] - rotatedPointer[0]) / boundsCurrentWidth; } if (transformHandleDirection.includes("n")) { - newHeight = startBottomRight[1] - rotatedPointer[1]; + scaleY = (startBottomRight[1] - rotatedPointer[1]) / boundsCurrentHeight; } + // Linear elements dimensions differ from bounds dimensions + const eleInitialWidth = stateAtResizeStart.width; + const eleInitialHeight = stateAtResizeStart.height; + // We have to use dimensions of element on screen, otherwise the scaling of the + // dimensions won't match the cursor for linear elements. + let eleNewWidth = element.width * scaleX; + let eleNewHeight = element.height * scaleY; // adjust dimensions for resizing from center if (isResizeFromCenter) { - newWidth = 2 * newWidth - stateAtResizeStart.width; - newHeight = 2 * newHeight - stateAtResizeStart.height; + eleNewWidth = 2 * eleNewWidth - eleInitialWidth; + eleNewHeight = 2 * eleNewHeight - eleInitialHeight; } // adjust dimensions to keep sides ratio if (shouldKeepSidesRatio) { - const widthRatio = Math.abs(newWidth) / stateAtResizeStart.width; - const heightRatio = Math.abs(newHeight) / stateAtResizeStart.height; + const widthRatio = Math.abs(eleNewWidth) / eleInitialWidth; + const heightRatio = Math.abs(eleNewHeight) / eleInitialHeight; if (transformHandleDirection.length === 1) { - newHeight *= widthRatio; - newWidth *= heightRatio; + eleNewHeight *= widthRatio; + eleNewWidth *= heightRatio; } if (transformHandleDirection.length === 2) { const ratio = Math.max(widthRatio, heightRatio); - newWidth = stateAtResizeStart.width * ratio * Math.sign(newWidth); - newHeight = stateAtResizeStart.height * ratio * Math.sign(newHeight); + eleNewWidth = eleInitialWidth * ratio * Math.sign(eleNewWidth); + eleNewHeight = eleInitialHeight * ratio * Math.sign(eleNewHeight); } } + const [ + newBoundsX1, + newBoundsY1, + newBoundsX2, + newBoundsY2, + ] = getResizedElementAbsoluteCoords( + stateAtResizeStart, + eleNewWidth, + eleNewHeight, + ); + const newBoundsWidth = newBoundsX2 - newBoundsX1; + const newBoundsHeight = newBoundsY2 - newBoundsY1; + // Calculate new topLeft based on fixed corner during resize - let newTopLeft = startTopLeft as [number, number]; + let newTopLeft = [...startTopLeft] as [number, number]; if (["n", "w", "nw"].includes(transformHandleDirection)) { newTopLeft = [ - startBottomRight[0] - Math.abs(newWidth), - startBottomRight[1] - Math.abs(newHeight), + startBottomRight[0] - Math.abs(newBoundsWidth), + startBottomRight[1] - Math.abs(newBoundsHeight), ]; } if (transformHandleDirection === "ne") { - const bottomLeft = [ - stateAtResizeStart.x, - stateAtResizeStart.y + stateAtResizeStart.height, - ]; - newTopLeft = [bottomLeft[0], bottomLeft[1] - Math.abs(newHeight)]; + const bottomLeft = [startTopLeft[0], startBottomRight[1]]; + newTopLeft = [bottomLeft[0], bottomLeft[1] - Math.abs(newBoundsHeight)]; } if (transformHandleDirection === "sw") { - const topRight = [ - stateAtResizeStart.x + stateAtResizeStart.width, - stateAtResizeStart.y, - ]; - newTopLeft = [topRight[0] - Math.abs(newWidth), topRight[1]]; + const topRight = [startBottomRight[0], startTopLeft[1]]; + newTopLeft = [topRight[0] - Math.abs(newBoundsWidth), topRight[1]]; } // Keeps opposite handle fixed during resize if (shouldKeepSidesRatio) { if (["s", "n"].includes(transformHandleDirection)) { - newTopLeft[0] = startCenter[0] - newWidth / 2; + newTopLeft[0] = startCenter[0] - newBoundsWidth / 2; } if (["e", "w"].includes(transformHandleDirection)) { - newTopLeft[1] = startCenter[1] - newHeight / 2; + newTopLeft[1] = startCenter[1] - newBoundsHeight / 2; } } // Flip horizontally - if (newWidth < 0) { + if (eleNewWidth < 0) { if (transformHandleDirection.includes("e")) { - newTopLeft[0] -= Math.abs(newWidth); + newTopLeft[0] -= Math.abs(newBoundsWidth); } if (transformHandleDirection.includes("w")) { - newTopLeft[0] += Math.abs(newWidth); + newTopLeft[0] += Math.abs(newBoundsWidth); } } // Flip vertically - if (newHeight < 0) { + if (eleNewHeight < 0) { if (transformHandleDirection.includes("s")) { - newTopLeft[1] -= Math.abs(newHeight); + newTopLeft[1] -= Math.abs(newBoundsHeight); } if (transformHandleDirection.includes("n")) { - newTopLeft[1] += Math.abs(newHeight); + newTopLeft[1] += Math.abs(newBoundsHeight); } } if (isResizeFromCenter) { - newTopLeft[0] = startCenter[0] - Math.abs(newWidth) / 2; - newTopLeft[1] = startCenter[1] - Math.abs(newHeight) / 2; + newTopLeft[0] = startCenter[0] - Math.abs(newBoundsWidth) / 2; + newTopLeft[1] = startCenter[1] - Math.abs(newBoundsHeight) / 2; } // adjust topLeft to new rotation point const angle = stateAtResizeStart.angle; const rotatedTopLeft = rotatePoint(newTopLeft, startCenter, angle); const newCenter: Point = [ - newTopLeft[0] + Math.abs(newWidth) / 2, - newTopLeft[1] + Math.abs(newHeight) / 2, + newTopLeft[0] + Math.abs(newBoundsWidth) / 2, + newTopLeft[1] + Math.abs(newBoundsHeight) / 2, ]; const rotatedNewCenter = rotatePoint(newCenter, startCenter, angle); newTopLeft = rotatePoint(rotatedTopLeft, rotatedNewCenter, -angle); - const resizedElement = { - width: Math.abs(newWidth), - height: Math.abs(newHeight), - x: newTopLeft[0], - y: newTopLeft[1], - }; - updateBoundElements(element, { - newSize: { width: resizedElement.width, height: resizedElement.height }, - }); - mutateElement(element, resizedElement); -}; - -const resizeSingleNonGenericElement = ( - element: NonDeleted>, - transformHandleType: "n" | "s" | "w" | "e" | "nw" | "ne" | "sw" | "se", - isResizeFromCenter: boolean, - keepSquareAspectRatio: boolean, - pointerX: number, - pointerY: number, -) => { - const [x1, y1, x2, y2] = getElementAbsoluteCoords(element); - const cx = (x1 + x2) / 2; - const cy = (y1 + y2) / 2; - - // rotation pointer with reverse angle - const [rotatedX, rotatedY] = rotate( - pointerX, - pointerY, - cx, - cy, - -element.angle, + // Readjust points for linear elements + const rescaledPoints = rescalePointsInElement( + stateAtResizeStart, + eleNewWidth, + eleNewHeight, ); + // For linear elements (x,y) are the coordinates of the first drawn point not the top-left corner + // So we need to readjust (x,y) to be where the first point should be + const newOrigin = [...newTopLeft]; + newOrigin[0] += stateAtResizeStart.x - newBoundsX1; + newOrigin[1] += stateAtResizeStart.y - newBoundsY1; - let scaleX = 1; - let scaleY = 1; - if ( - transformHandleType === "e" || - transformHandleType === "ne" || - transformHandleType === "se" - ) { - scaleX = (rotatedX - x1) / (x2 - x1); - } - if ( - transformHandleType === "s" || - transformHandleType === "sw" || - transformHandleType === "se" - ) { - scaleY = (rotatedY - y1) / (y2 - y1); - } - if ( - transformHandleType === "w" || - transformHandleType === "nw" || - transformHandleType === "sw" - ) { - scaleX = (x2 - rotatedX) / (x2 - x1); - } - if ( - transformHandleType === "n" || - transformHandleType === "nw" || - transformHandleType === "ne" - ) { - scaleY = (y2 - rotatedY) / (y2 - y1); - } - let nextWidth = element.width * scaleX; - let nextHeight = element.height * scaleY; - if (keepSquareAspectRatio) { - nextWidth = nextHeight = Math.max(nextWidth, nextHeight); - } - - const [nextX1, nextY1, nextX2, nextY2] = getResizedElementAbsoluteCoords( - element, - nextWidth, - nextHeight, - ); - const deltaX1 = (x1 - nextX1) / 2; - const deltaY1 = (y1 - nextY1) / 2; - const deltaX2 = (x2 - nextX2) / 2; - const deltaY2 = (y2 - nextY2) / 2; - - const rescaledPoints = rescalePointsInElement(element, nextWidth, nextHeight); - - updateBoundElements(element, { - newSize: { width: nextWidth, height: nextHeight }, - }); - const [finalX1, finalY1, finalX2, finalY2] = getResizedElementAbsoluteCoords( - { - ...element, - ...rescaledPoints, - }, - Math.abs(nextWidth), - Math.abs(nextHeight), - ); - const [flipDiffX, flipDiffY] = getFlipAdjustment( - transformHandleType, - nextWidth, - nextHeight, - nextX1, - nextY1, - nextX2, - nextY2, - finalX1, - finalY1, - finalX2, - finalY2, - isLinearElement(element), - element.angle, - ); - const [nextElementX, nextElementY] = adjustXYWithRotation( - getSidesForTransformHandle(transformHandleType, isResizeFromCenter), - element.x - flipDiffX, - element.y - flipDiffY, - element.angle, - deltaX1, - deltaY1, - deltaX2, - deltaY2, - ); + const resizedElement = { + width: Math.abs(eleNewWidth), + height: Math.abs(eleNewHeight), + x: newOrigin[0], + y: newOrigin[1], + ...rescaledPoints, + }; if ( - nextWidth !== 0 && - nextHeight !== 0 && - Number.isFinite(nextElementX) && - Number.isFinite(nextElementY) + resizedElement.width !== 0 && + resizedElement.height !== 0 && + Number.isFinite(resizedElement.x) && + Number.isFinite(resizedElement.y) ) { - mutateElement(element, { - width: nextWidth, - height: nextHeight, - x: nextElementX, - y: nextElementY, - ...rescaledPoints, + updateBoundElements(element, { + newSize: { width: resizedElement.width, height: resizedElement.height }, }); + mutateElement(element, resizedElement); } }; diff --git a/src/element/resizeTest.ts b/src/element/resizeTest.ts index 4471244dd3..3a794e2c59 100644 --- a/src/element/resizeTest.ts +++ b/src/element/resizeTest.ts @@ -173,57 +173,3 @@ export const getCursorForResizingElement = (resizingElement: { return cursor ? `${cursor}-resize` : ""; }; - -export const normalizeTransformHandleType = ( - element: ExcalidrawElement, - transformHandleType: TransformHandleType, -): TransformHandleType => { - if (element.width >= 0 && element.height >= 0) { - return transformHandleType; - } - - if (element.width < 0 && element.height < 0) { - switch (transformHandleType) { - case "nw": - return "se"; - case "ne": - return "sw"; - case "se": - return "nw"; - case "sw": - return "ne"; - } - } else if (element.width < 0) { - switch (transformHandleType) { - case "nw": - return "ne"; - case "ne": - return "nw"; - case "se": - return "sw"; - case "sw": - return "se"; - case "e": - return "w"; - case "w": - return "e"; - } - } else { - switch (transformHandleType) { - case "nw": - return "sw"; - case "ne": - return "se"; - case "se": - return "ne"; - case "sw": - return "nw"; - case "n": - return "s"; - case "s": - return "n"; - } - } - - return transformHandleType; -}; diff --git a/src/math.ts b/src/math.ts index dadc6ccca5..15a8aa6e3a 100644 --- a/src/math.ts +++ b/src/math.ts @@ -70,64 +70,6 @@ export const adjustXYWithRotation = ( return [x, y]; }; -export const getFlipAdjustment = ( - side: "n" | "s" | "w" | "e" | "nw" | "ne" | "sw" | "se", - nextWidth: number, - nextHeight: number, - nextX1: number, - nextY1: number, - nextX2: number, - nextY2: number, - finalX1: number, - finalY1: number, - finalX2: number, - finalY2: number, - needsRotation: boolean, - angle: number, -): [number, number] => { - const cos = Math.cos(angle); - const sin = Math.sin(angle); - let flipDiffX = 0; - let flipDiffY = 0; - if (nextWidth < 0) { - if (side === "e" || side === "ne" || side === "se") { - if (needsRotation) { - flipDiffX += (finalX2 - nextX1) * cos; - flipDiffY += (finalX2 - nextX1) * sin; - } else { - flipDiffX += finalX2 - nextX1; - } - } - if (side === "w" || side === "nw" || side === "sw") { - if (needsRotation) { - flipDiffX += (finalX1 - nextX2) * cos; - flipDiffY += (finalX1 - nextX2) * sin; - } else { - flipDiffX += finalX1 - nextX2; - } - } - } - if (nextHeight < 0) { - if (side === "s" || side === "se" || side === "sw") { - if (needsRotation) { - flipDiffY += (finalY2 - nextY1) * cos; - flipDiffX += (finalY2 - nextY1) * -sin; - } else { - flipDiffY += finalY2 - nextY1; - } - } - if (side === "n" || side === "ne" || side === "nw") { - if (needsRotation) { - flipDiffY += (finalY1 - nextY2) * cos; - flipDiffX += (finalY1 - nextY2) * -sin; - } else { - flipDiffY += finalY1 - nextY2; - } - } - } - return [flipDiffX, flipDiffY]; -}; - export const getPointOnAPath = (point: Point, path: Point[]) => { const [px, py] = point; const [start, ...other] = path; diff --git a/src/tests/resize.test.tsx b/src/tests/resize.test.tsx index 8d207c08ef..70c79fe6b9 100644 --- a/src/tests/resize.test.tsx +++ b/src/tests/resize.test.tsx @@ -41,7 +41,7 @@ describe("resize rectangle ellipses and diamond elements", () => { ${"s"} | ${[_, 39]} | ${[100, 139]} | ${[elemData.x, elemData.x]} ${"e"} | ${[-20, _]} | ${[80, 100]} | ${[elemData.x, elemData.y]} ${"w"} | ${[-20, _]} | ${[120, 100]} | ${[-20, elemData.y]} - ${"ne"} | ${[10, 55]} | ${[110, 45]} | ${[elemData.x, 55]} + ${"ne"} | ${[5, 55]} | ${[105, 45]} | ${[elemData.x, 55]} ${"se"} | ${[-30, -10]} | ${[70, 90]} | ${[elemData.x, elemData.y]} ${"nw"} | ${[-300, -200]} | ${[400, 300]} | ${[-300, -200]} ${"sw"} | ${[40, -20]} | ${[60, 80]} | ${[40, 0]} From 1e16a6e5bd12566ee3f5eefd8e38c511d97b25dd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 17 Jan 2021 11:26:44 +0200 Subject: [PATCH 04/16] chore(deps): bump @types/socket.io-client from 1.4.34 to 1.4.35 (#2811) Bumps [@types/socket.io-client](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/socket.io-client) from 1.4.34 to 1.4.35. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/socket.io-client) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8ee2b67388..e5725c0523 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3360,9 +3360,9 @@ } }, "@types/socket.io-client": { - "version": "1.4.34", - "resolved": "https://registry.npmjs.org/@types/socket.io-client/-/socket.io-client-1.4.34.tgz", - "integrity": "sha512-Lzia5OTQFJZJ5R4HsEEldywiiqT9+W2rDbyHJiiTGqOcju89sCsQ8aUXDljY6Ls33wKZZGC0bfMhr/VpOyjtXg==" + "version": "1.4.35", + "resolved": "https://registry.npmjs.org/@types/socket.io-client/-/socket.io-client-1.4.35.tgz", + "integrity": "sha512-MI8YmxFS+jMkIziycT5ickBWK1sZwDwy16mgH/j99Mcom6zRG/NimNGQ3vJV0uX5G6g/hEw0FG3w3b3sT5OUGw==" }, "@types/source-list-map": { "version": "0.1.2", diff --git a/package.json b/package.json index 540fae371d..f4c7caaa3f 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@types/jest": "26.0.20", "@types/react": "17.0.0", "@types/react-dom": "17.0.0", - "@types/socket.io-client": "1.4.34", + "@types/socket.io-client": "1.4.35", "browser-nativefs": "0.12.0", "clsx": "1.1.1", "firebase": "8.2.2", From 553bf2956fb3fae23c098fe6c4647d298b9fc575 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 17 Jan 2021 11:27:01 +0200 Subject: [PATCH 05/16] chore(deps): bump @sentry/browser from 5.29.2 to 5.30.0 (#2809) Bumps [@sentry/browser](https://github.com/getsentry/sentry-javascript) from 5.29.2 to 5.30.0. - [Release notes](https://github.com/getsentry/sentry-javascript/releases) - [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-javascript/compare/5.29.2...5.30.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 103 +++++++++++++++++++++++++++++++++++----------- package.json | 2 +- 2 files changed, 80 insertions(+), 25 deletions(-) diff --git a/package-lock.json b/package-lock.json index e5725c0523..82515f11bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2663,36 +2663,84 @@ } }, "@sentry/browser": { - "version": "5.29.2", - "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-5.29.2.tgz", - "integrity": "sha512-uxZ7y7rp85tJll+RZtXRhXPbnFnOaxZqJEv05vJlXBtBNLQtlczV5iCtU9mZRLVHDtmZ5VVKUV8IKXntEqqDpQ==", + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-5.30.0.tgz", + "integrity": "sha512-rOb58ZNVJWh1VuMuBG1mL9r54nZqKeaIlwSlvzJfc89vyfd7n6tQ1UXMN383QBz/MS5H5z44Hy5eE+7pCrYAfw==", "requires": { - "@sentry/core": "5.29.2", - "@sentry/types": "5.29.2", - "@sentry/utils": "5.29.2", + "@sentry/core": "5.30.0", + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", "tslib": "^1.9.3" + }, + "dependencies": { + "@sentry/types": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.30.0.tgz", + "integrity": "sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==" + }, + "@sentry/utils": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-5.30.0.tgz", + "integrity": "sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww==", + "requires": { + "@sentry/types": "5.30.0", + "tslib": "^1.9.3" + } + } } }, "@sentry/core": { - "version": "5.29.2", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.29.2.tgz", - "integrity": "sha512-7WYkoxB5IdlNEbwOwqSU64erUKH4laavPsM0/yQ+jojM76ErxlgEF0u//p5WaLPRzh3iDSt6BH+9TL45oNZeZw==", - "requires": { - "@sentry/hub": "5.29.2", - "@sentry/minimal": "5.29.2", - "@sentry/types": "5.29.2", - "@sentry/utils": "5.29.2", + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.30.0.tgz", + "integrity": "sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg==", + "requires": { + "@sentry/hub": "5.30.0", + "@sentry/minimal": "5.30.0", + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", "tslib": "^1.9.3" + }, + "dependencies": { + "@sentry/types": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.30.0.tgz", + "integrity": "sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==" + }, + "@sentry/utils": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-5.30.0.tgz", + "integrity": "sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww==", + "requires": { + "@sentry/types": "5.30.0", + "tslib": "^1.9.3" + } + } } }, "@sentry/hub": { - "version": "5.29.2", - "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.29.2.tgz", - "integrity": "sha512-LaAIo2hwUk9ykeh9RF0cwLy6IRw+DjEee8l1HfEaDFUM6TPGlNNGObMJNXb9/95jzWp7jWwOpQjoIE3jepdQJQ==", + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.30.0.tgz", + "integrity": "sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ==", "requires": { - "@sentry/types": "5.29.2", - "@sentry/utils": "5.29.2", + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", "tslib": "^1.9.3" + }, + "dependencies": { + "@sentry/types": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.30.0.tgz", + "integrity": "sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==" + }, + "@sentry/utils": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-5.30.0.tgz", + "integrity": "sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww==", + "requires": { + "@sentry/types": "5.30.0", + "tslib": "^1.9.3" + } + } } }, "@sentry/integrations": { @@ -2707,13 +2755,20 @@ } }, "@sentry/minimal": { - "version": "5.29.2", - "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.29.2.tgz", - "integrity": "sha512-0aINSm8fGA1KyM7PavOBe1GDZDxrvnKt+oFnU0L+bTcw8Lr+of+v6Kwd97rkLRNOLw621xP076dL/7LSIzMuhw==", + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.30.0.tgz", + "integrity": "sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw==", "requires": { - "@sentry/hub": "5.29.2", - "@sentry/types": "5.29.2", + "@sentry/hub": "5.30.0", + "@sentry/types": "5.30.0", "tslib": "^1.9.3" + }, + "dependencies": { + "@sentry/types": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.30.0.tgz", + "integrity": "sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==" + } } }, "@sentry/types": { diff --git a/package.json b/package.json index f4c7caaa3f..6385be46df 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ ] }, "dependencies": { - "@sentry/browser": "5.29.2", + "@sentry/browser": "5.30.0", "@sentry/integrations": "5.29.2", "@testing-library/jest-dom": "5.11.8", "@testing-library/react": "11.2.3", From 7a9ed2cfa157bc67909075f44253b9f84bef80d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 17 Jan 2021 11:27:12 +0200 Subject: [PATCH 06/16] chore(deps-dev): bump firebase-tools from 9.1.2 to 9.2.1 (#2808) Bumps [firebase-tools](https://github.com/firebase/firebase-tools) from 9.1.2 to 9.2.1. - [Release notes](https://github.com/firebase/firebase-tools/releases) - [Commits](https://github.com/firebase/firebase-tools/compare/v9.1.2...v9.2.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 90 +++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/package-lock.json b/package-lock.json index 82515f11bc..2f49d78a16 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1649,17 +1649,17 @@ "dev": true }, "@google-cloud/pubsub": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/@google-cloud/pubsub/-/pubsub-2.7.0.tgz", - "integrity": "sha512-wc/XOo5Ibo3GWmuaLu80EBIhXSdu2vf99HUqBbdsSSkmRNIka2HqoIhLlOFnnncQn0lZnGL7wtKGIDLoH9LiBg==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/@google-cloud/pubsub/-/pubsub-2.8.0.tgz", + "integrity": "sha512-AoSKAbpHCoLq6jO9vMX+K6hJhkayafan24Rs2RKHU8Y0qF6IGSm1+ly0OG12TgziHWg818/6dljWWKgwDcp8KA==", "dev": true, "requires": { "@google-cloud/paginator": "^3.0.0", "@google-cloud/precise-date": "^2.0.0", "@google-cloud/projectify": "^2.0.0", "@google-cloud/promisify": "^2.0.0", - "@opentelemetry/api": "^0.11.0", - "@opentelemetry/tracing": "^0.11.0", + "@opentelemetry/api": "^0.12.0", + "@opentelemetry/tracing": "^0.12.0", "@types/duplexify": "^3.6.0", "@types/long": "^4.0.0", "arrify": "^2.0.0", @@ -2460,28 +2460,28 @@ } }, "@opentelemetry/api": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-0.11.0.tgz", - "integrity": "sha512-K+1ADLMxduhsXoZ0GRfi9Pw162FvzBQLDQlHru1lg86rpIU+4XqdJkSGo6y3Kg+GmOWq1HNHOA/ydw/rzHQkRg==", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-0.12.0.tgz", + "integrity": "sha512-Dn4vU5GlaBrIWzLpsM6xbJwKHdlpwBQ4Bd+cL9ofJP3hKT8jBXpBpribmyaqAzrajzzl2Yt8uTa9rFVLfjDAvw==", "dev": true, "requires": { - "@opentelemetry/context-base": "^0.11.0" + "@opentelemetry/context-base": "^0.12.0" } }, "@opentelemetry/context-base": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/context-base/-/context-base-0.11.0.tgz", - "integrity": "sha512-ESRk+572bftles7CVlugAj5Azrz61VO0MO0TS2pE9MLVL/zGmWuUBQryART6/nsrFqo+v9HPt37GPNcECTZR1w==", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/context-base/-/context-base-0.12.0.tgz", + "integrity": "sha512-UXwSsXo3F3yZ1dIBOG9ID8v2r9e+bqLWoizCtTb8rXtwF+N5TM7hzzvQz72o3nBU+zrI/D5e+OqAYK8ZgDd3DA==", "dev": true }, "@opentelemetry/core": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-0.11.0.tgz", - "integrity": "sha512-ZEKjBXeDGBqzouz0uJmrbEKNExEsQOhsZ3tJDCLcz5dUNoVw642oIn2LYWdQK2YdIfZbEmltiF65/csGsaBtFA==", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-0.12.0.tgz", + "integrity": "sha512-oLZIkmTNWTJXzo1eA4dGu/S7wOVtylsgnEsCmhSJGhrJVDXm1eW/aGuNs3DVBeuxp0ZvQLAul3/PThsC3YrnzA==", "dev": true, "requires": { - "@opentelemetry/api": "^0.11.0", - "@opentelemetry/context-base": "^0.11.0", + "@opentelemetry/api": "^0.12.0", + "@opentelemetry/context-base": "^0.12.0", "semver": "^7.1.3" }, "dependencies": { @@ -2506,32 +2506,32 @@ } }, "@opentelemetry/resources": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-0.11.0.tgz", - "integrity": "sha512-o7DwV1TcezqBtS5YW2AWBcn01nVpPptIbTr966PLlVBcS//w8LkjeOShiSZxQ0lmV4b2en0FiSouSDoXk/5qIQ==", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-0.12.0.tgz", + "integrity": "sha512-8cYvIKB68cyupc7D6SWzkLtt13mbjgxMahL4JKCM6hWPyiGSJlPFEAey4XFXI5LLpPZRYTPHLVoLqI/xwCFZZA==", "dev": true, "requires": { - "@opentelemetry/api": "^0.11.0", - "@opentelemetry/core": "^0.11.0" + "@opentelemetry/api": "^0.12.0", + "@opentelemetry/core": "^0.12.0" } }, "@opentelemetry/semantic-conventions": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-0.11.0.tgz", - "integrity": "sha512-xsthnI/J+Cx0YVDGgUzvrH0ZTtfNtl866M454NarYwDrc0JvC24sYw+XS5PJyk2KDzAHtb0vlrumUc1OAut/Fw==", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-0.12.0.tgz", + "integrity": "sha512-BuCcDW0uLNYYTns0/LwXkJ8lp8aDm7kpS+WunEmPAPRSCe6ciOYRvzn5reqJfX93rf+6A3U2SgrBnCTH+0qoQQ==", "dev": true }, "@opentelemetry/tracing": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/tracing/-/tracing-0.11.0.tgz", - "integrity": "sha512-QweFmxzl32BcyzwdWCNjVXZT1WeENNS/RWETq/ohqu+fAsTcMyGcr6cOq/yDdFmtBy+bm5WVVdeByEjNS+c4/w==", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/tracing/-/tracing-0.12.0.tgz", + "integrity": "sha512-2TUGhTGkhgnxTciHCNAILPSeyXageJewRqfP9wOrx65sKd/jgvNYoY8nYf4EVWVMirDOxKDsmYgUkjdQrwb2dg==", "dev": true, "requires": { - "@opentelemetry/api": "^0.11.0", - "@opentelemetry/context-base": "^0.11.0", - "@opentelemetry/core": "^0.11.0", - "@opentelemetry/resources": "^0.11.0", - "@opentelemetry/semantic-conventions": "^0.11.0" + "@opentelemetry/api": "^0.12.0", + "@opentelemetry/context-base": "^0.12.0", + "@opentelemetry/core": "^0.12.0", + "@opentelemetry/resources": "^0.12.0", + "@opentelemetry/semantic-conventions": "^0.12.0" } }, "@pmmmwh/react-refresh-webpack-plugin": { @@ -8552,9 +8552,9 @@ } }, "qs": { - "version": "6.9.4", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz", - "integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==", + "version": "6.9.6", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.6.tgz", + "integrity": "sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ==", "dev": true }, "semver": { @@ -9088,9 +9088,9 @@ } }, "firebase-tools": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/firebase-tools/-/firebase-tools-9.1.2.tgz", - "integrity": "sha512-YUiqMuQ+nbdCNpahSO0eyKxxVfT0nDdijkUEUplTGArkDwqdOKPIxVqHj1edq7GEPXTRWlk7zibnbOnCCHaedw==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/firebase-tools/-/firebase-tools-9.2.1.tgz", + "integrity": "sha512-sD4wfB5hs/8IKXV6AJOmkpvXf/St7gVc9QeW4Qz21PG7CkirgRf6FqcYkPKtBcro4wfj48dihnYx/IO1+XPTGg==", "dev": true, "requires": { "@google-cloud/pubsub": "^2.7.0", @@ -10193,9 +10193,9 @@ }, "dependencies": { "@types/node": { - "version": "13.13.39", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.39.tgz", - "integrity": "sha512-wct+WgRTTkBm2R3vbrFOqyZM5w0g+D8KnhstG9463CJBVC3UVZHMToge7iMBR1vDl/I+NWFHUeK9X+JcF0rWKw==", + "version": "13.13.40", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.40.tgz", + "integrity": "sha512-eKaRo87lu1yAXrzEJl0zcJxfUMDT5/mZalFyOkT44rnQps41eS2pfWzbaulSPpQLFNy29bFqn+Y5lOTL8ATlEQ==", "dev": true }, "duplexify": { @@ -17700,9 +17700,9 @@ } }, "proxy-agent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-4.0.0.tgz", - "integrity": "sha512-8P0Y2SkwvKjiGU1IkEfYuTteioMIDFxPL4/j49zzt5Mz3pG1KO+mIrDG1qH0PQUHTTczjwGcYl+EzfXiFj5vUQ==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-4.0.1.tgz", + "integrity": "sha512-ODnQnW2jc/FUVwHHuaZEfN5otg/fMbvMxz9nMSUQfJ9JU7q2SZvSULSsjLloVgJOiv9yhc8GlNMKc4GkFmcVEA==", "dev": true, "requires": { "agent-base": "^6.0.0", diff --git a/package.json b/package.json index 6385be46df..aae415b00e 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "@types/pako": "1.0.1", "eslint-config-prettier": "7.1.0", "eslint-plugin-prettier": "3.3.1", - "firebase-tools": "9.1.2", + "firebase-tools": "9.2.1", "husky": "4.3.7", "jest-canvas-mock": "2.3.0", "lint-staged": "10.5.3", From 12337a54a353253b68a9f0cbcd4d4d7a96bc3d12 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 17 Jan 2021 11:27:38 +0200 Subject: [PATCH 07/16] chore(deps): bump @testing-library/jest-dom from 5.11.8 to 5.11.9 (#2805) Bumps [@testing-library/jest-dom](https://github.com/testing-library/jest-dom) from 5.11.8 to 5.11.9. - [Release notes](https://github.com/testing-library/jest-dom/releases) - [Changelog](https://github.com/testing-library/jest-dom/blob/master/CHANGELOG.md) - [Commits](https://github.com/testing-library/jest-dom/compare/v5.11.8...v5.11.9) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2f49d78a16..132be2218f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3047,9 +3047,9 @@ } }, "@testing-library/jest-dom": { - "version": "5.11.8", - "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-5.11.8.tgz", - "integrity": "sha512-ScyKrWQM5xNcr79PkSewnA79CLaoxVskE+f7knTOhDD9ftZSA1Jw8mj+pneqhEu3x37ncNfW84NUr7lqK+mXjA==", + "version": "5.11.9", + "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-5.11.9.tgz", + "integrity": "sha512-Mn2gnA9d1wStlAIT2NU8J15LNob0YFBVjs2aEQ3j8rsfRQo+lAs7/ui1i2TGaJjapLmuNPLTsrm+nPjmZDwpcQ==", "requires": { "@babel/runtime": "^7.9.2", "@types/testing-library__jest-dom": "^5.9.1", diff --git a/package.json b/package.json index aae415b00e..0d0cd102c7 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "dependencies": { "@sentry/browser": "5.30.0", "@sentry/integrations": "5.29.2", - "@testing-library/jest-dom": "5.11.8", + "@testing-library/jest-dom": "5.11.9", "@testing-library/react": "11.2.3", "@types/jest": "26.0.20", "@types/react": "17.0.0", From f8e890df7bb6d127456da7eee9de636d4e480b57 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 17 Jan 2021 11:28:23 +0200 Subject: [PATCH 08/16] chore(deps-dev): bump mini-css-extract-plugin from 1.3.3 to 1.3.4 in /src/packages/excalidraw (#2802) Bumps [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) from 1.3.3 to 1.3.4. - [Release notes](https://github.com/webpack-contrib/mini-css-extract-plugin/releases) - [Changelog](https://github.com/webpack-contrib/mini-css-extract-plugin/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack-contrib/mini-css-extract-plugin/compare/v1.3.3...v1.3.4) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/packages/excalidraw/package-lock.json | 6 +++--- src/packages/excalidraw/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/packages/excalidraw/package-lock.json b/src/packages/excalidraw/package-lock.json index 2b5f7c7569..04917b594c 100644 --- a/src/packages/excalidraw/package-lock.json +++ b/src/packages/excalidraw/package-lock.json @@ -2456,9 +2456,9 @@ "dev": true }, "mini-css-extract-plugin": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-1.3.3.tgz", - "integrity": "sha512-7lvliDSMiuZc81kI+5/qxvn47SCM7BehXex3f2c6l/pR3Goj58IQxZh9nuPQ3AkGQgoETyXuIqLDaO5Oa0TyBw==", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-1.3.4.tgz", + "integrity": "sha512-dNjqyeogUd8ucUgw5sxm1ahvSfSUgef7smbmATRSbDm4EmNx5kQA6VdUEhEeCKSjX6CTYjb5vxgMUvRjqP3uHg==", "dev": true, "requires": { "loader-utils": "^2.0.0", diff --git a/src/packages/excalidraw/package.json b/src/packages/excalidraw/package.json index 8c0a529abb..f02771053f 100644 --- a/src/packages/excalidraw/package.json +++ b/src/packages/excalidraw/package.json @@ -54,7 +54,7 @@ "cross-env": "7.0.3", "css-loader": "5.0.1", "file-loader": "6.2.0", - "mini-css-extract-plugin": "1.3.3", + "mini-css-extract-plugin": "1.3.4", "sass-loader": "10.1.0", "terser-webpack-plugin": "5.1.1", "ts-loader": "8.0.14", From 33a7cf0d3f8a67606eeb8ba8060d25abdd3969c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 17 Jan 2021 11:31:17 +0200 Subject: [PATCH 09/16] chore(deps): bump firebase from 8.2.2 to 8.2.3 (#2810) Bumps [firebase](https://github.com/firebase/firebase-js-sdk) from 8.2.2 to 8.2.3. - [Release notes](https://github.com/firebase/firebase-js-sdk/releases) - [Changelog](https://github.com/firebase/firebase-js-sdk/blob/master/CHANGELOG.md) - [Commits](https://github.com/firebase/firebase-js-sdk/commits/firebase@8.2.3) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 132be2218f..9fa977d4de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1368,9 +1368,9 @@ } }, "@firebase/database": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/@firebase/database/-/database-0.8.2.tgz", - "integrity": "sha512-E86yrom0Ii+61UScG44y1q3H3NuozzGGTGbYmiyTe1qK8Qvzuiu7yyfdDnqFW2fkeKvTRLoDeCpgZy27FgEndQ==", + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/@firebase/database/-/database-0.8.3.tgz", + "integrity": "sha512-i29rr3kcPltIkA8La9M1lgsSxx9bfu5lCQ0T+tbJptZ3UpqpcL1NzCcZa24cJjiLgq3HQNPyLvUvCtcPSFDlRg==", "requires": { "@firebase/auth-interop-types": "0.1.5", "@firebase/component": "0.1.21", @@ -9067,15 +9067,15 @@ } }, "firebase": { - "version": "8.2.2", - "resolved": "https://registry.npmjs.org/firebase/-/firebase-8.2.2.tgz", - "integrity": "sha512-a07aW2TTAA9S7p4mx5pu8hvtVokJEjAQlAocHKOWwmRJRIduE9Vvr/3i50FtujT5gGNr0Qm+EyWyB+/7TJiwnw==", + "version": "8.2.3", + "resolved": "https://registry.npmjs.org/firebase/-/firebase-8.2.3.tgz", + "integrity": "sha512-WdbcGSiLxiW/kGZT+EyqD9z3Md7kR35+k9qMjDn/twiIrm6Hh7Qi/Z69cqxhKW6+4uK5ghXIF28CjK67OyD9Qw==", "requires": { "@firebase/analytics": "0.6.2", "@firebase/app": "0.6.13", "@firebase/app-types": "0.6.1", "@firebase/auth": "0.16.1", - "@firebase/database": "0.8.2", + "@firebase/database": "0.8.3", "@firebase/firestore": "2.1.2", "@firebase/functions": "0.6.1", "@firebase/installations": "0.4.19", diff --git a/package.json b/package.json index 0d0cd102c7..4a696cc453 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "@types/socket.io-client": "1.4.35", "browser-nativefs": "0.12.0", "clsx": "1.1.1", - "firebase": "8.2.2", + "firebase": "8.2.3", "i18next-browser-languagedetector": "6.0.1", "lodash.throttle": "4.1.1", "nanoid": "3.1.20", From da2ad4f37c9a4129bfbaa5b35166fd62d9314802 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 17 Jan 2021 11:31:45 +0200 Subject: [PATCH 10/16] chore(deps-dev): bump sass-loader from 10.1.0 to 10.1.1 in /src/packages/excalidraw (#2801) Bumps [sass-loader](https://github.com/webpack-contrib/sass-loader) from 10.1.0 to 10.1.1. - [Release notes](https://github.com/webpack-contrib/sass-loader/releases) - [Changelog](https://github.com/webpack-contrib/sass-loader/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack-contrib/sass-loader/compare/v10.1.0...v10.1.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/packages/excalidraw/package-lock.json | 6 +++--- src/packages/excalidraw/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/packages/excalidraw/package-lock.json b/src/packages/excalidraw/package-lock.json index 04917b594c..b6ef9b20e6 100644 --- a/src/packages/excalidraw/package-lock.json +++ b/src/packages/excalidraw/package-lock.json @@ -2841,9 +2841,9 @@ "dev": true }, "sass-loader": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-10.1.0.tgz", - "integrity": "sha512-ZCKAlczLBbFd3aGAhowpYEy69Te3Z68cg8bnHHl6WnSCvnKpbM6pQrz957HWMa8LKVuhnD9uMplmMAHwGQtHeg==", + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-10.1.1.tgz", + "integrity": "sha512-W6gVDXAd5hR/WHsPicvZdjAWHBcEJ44UahgxcIE196fW2ong0ZHMPO1kZuI5q0VlvMQZh32gpv69PLWQm70qrw==", "dev": true, "requires": { "klona": "^2.0.4", diff --git a/src/packages/excalidraw/package.json b/src/packages/excalidraw/package.json index f02771053f..c7696e3bee 100644 --- a/src/packages/excalidraw/package.json +++ b/src/packages/excalidraw/package.json @@ -55,7 +55,7 @@ "css-loader": "5.0.1", "file-loader": "6.2.0", "mini-css-extract-plugin": "1.3.4", - "sass-loader": "10.1.0", + "sass-loader": "10.1.1", "terser-webpack-plugin": "5.1.1", "ts-loader": "8.0.14", "webpack": "5.12.3", From 0ea29675dfda3cdd1a9d9b078545fdfbcbbbde22 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 17 Jan 2021 11:31:59 +0200 Subject: [PATCH 11/16] chore(deps-dev): bump webpack from 5.12.3 to 5.15.0 in /src/packages/excalidraw (#2800) Bumps [webpack](https://github.com/webpack/webpack) from 5.12.3 to 5.15.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.12.3...v5.15.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/packages/excalidraw/package-lock.json | 35 +++++++++-------------- src/packages/excalidraw/package.json | 2 +- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/src/packages/excalidraw/package-lock.json b/src/packages/excalidraw/package-lock.json index b6ef9b20e6..adf8c95a19 100644 --- a/src/packages/excalidraw/package-lock.json +++ b/src/packages/excalidraw/package-lock.json @@ -1933,6 +1933,12 @@ "prr": "~1.0.1" } }, + "es-module-lexer": { + "version": "0.3.26", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.3.26.tgz", + "integrity": "sha512-Va0Q/xqtrss45hWzP8CZJwzGSZJjDM5/MJRE3IXXnUCcVLElR9BRaE9F62BopysASyc4nM3uwhSW7FFB9nlWAA==", + "dev": true + }, "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -3251,9 +3257,9 @@ } }, "webpack": { - "version": "5.12.3", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.12.3.tgz", - "integrity": "sha512-7tiQmcTnKhZwbf7X7sEfXe0pgkGjUZjT6JfYkZHvvIb4/ZsXl1rJu5PxsJoN7W3v5sNSP/8TgBoiOdDqVdvK5w==", + "version": "5.15.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.15.0.tgz", + "integrity": "sha512-y/xG+ONDz78yn3VvP6gAvGr1/gkxOgitvHSXBmquyN8KDtrGEyE3K9WkXOPB7QmfcOBCpO4ELXwNcCYQnEmexA==", "dev": true, "requires": { "@types/eslint-scope": "^3.7.0", @@ -3264,7 +3270,8 @@ "acorn": "^8.0.4", "browserslist": "^4.14.5", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.3.1", + "enhanced-resolve": "^5.7.0", + "es-module-lexer": "^0.3.26", "eslint-scope": "^5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", @@ -3282,9 +3289,9 @@ }, "dependencies": { "enhanced-resolve": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.5.0.tgz", - "integrity": "sha512-b4a6BasBCoLzri4MdaeOlDMpls2oioI28CF17csMiav9dq46yvQaKPFNUrCHB6VqQokBDG2VIEEL81jMiQ6Wtw==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.7.0.tgz", + "integrity": "sha512-6njwt/NsZFUKhM6j9U8hzVyD4E4r0x7NQzhTCbcWOJ0IQjNSAoalWmb0AE51Wn+fwan5qVESWi7t2ToBxs9vrw==", "dev": true, "requires": { "graceful-fs": "^4.2.4", @@ -3360,20 +3367,6 @@ "integrity": "sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw==", "dev": true }, - "terser-webpack-plugin": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.1.1.tgz", - "integrity": "sha512-5XNNXZiR8YO6X6KhSGXfY0QrGrCRlSwAEjIIrlRQR4W8nP69TaJUlh3bkuac6zzgspiGPfKEHcY295MMVExl5Q==", - "dev": true, - "requires": { - "jest-worker": "^26.6.2", - "p-limit": "^3.1.0", - "schema-utils": "^3.0.0", - "serialize-javascript": "^5.0.1", - "source-map": "^0.6.1", - "terser": "^5.5.1" - } - }, "webpack-sources": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-2.2.0.tgz", diff --git a/src/packages/excalidraw/package.json b/src/packages/excalidraw/package.json index c7696e3bee..ac8e795a8d 100644 --- a/src/packages/excalidraw/package.json +++ b/src/packages/excalidraw/package.json @@ -58,7 +58,7 @@ "sass-loader": "10.1.1", "terser-webpack-plugin": "5.1.1", "ts-loader": "8.0.14", - "webpack": "5.12.3", + "webpack": "5.15.0", "webpack-bundle-analyzer": "4.3.0", "webpack-cli": "4.3.1" }, From e72ff6be66c92b3a2b9700fa933ca5fd979e5fc4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 17 Jan 2021 11:33:02 +0200 Subject: [PATCH 12/16] chore(deps-dev): bump webpack from 5.12.3 to 5.15.0 in /src/packages/utils (#2803) Bumps [webpack](https://github.com/webpack/webpack) from 5.12.3 to 5.15.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.12.3...v5.15.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- src/packages/utils/package-lock.json | 27 +++++++++++++++++---------- src/packages/utils/package.json | 2 +- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/packages/utils/package-lock.json b/src/packages/utils/package-lock.json index ae614fd651..a870701b82 100644 --- a/src/packages/utils/package-lock.json +++ b/src/packages/utils/package-lock.json @@ -1109,9 +1109,9 @@ "dev": true }, "@types/node": { - "version": "14.14.20", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.20.tgz", - "integrity": "sha512-Y93R97Ouif9JEOWPIUyU+eyIdyRqQR0I8Ez1dzku4hDx34NWh4HbtIc3WNzwB1Y9ULvNGeu5B8h8bVL5cAk4/A==", + "version": "14.14.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.21.tgz", + "integrity": "sha512-cHYfKsnwllYhjOzuC5q1VpguABBeecUp24yFluHpn/BQaVxB1CuQ1FSRZCzrPxrkIfWISXV2LbeoBthLWg0+0A==", "dev": true }, "@webassemblyjs/ast": { @@ -1783,6 +1783,12 @@ "prr": "~1.0.1" } }, + "es-module-lexer": { + "version": "0.3.26", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.3.26.tgz", + "integrity": "sha512-Va0Q/xqtrss45hWzP8CZJwzGSZJjDM5/MJRE3IXXnUCcVLElR9BRaE9F62BopysASyc4nM3uwhSW7FFB9nlWAA==", + "dev": true + }, "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -2918,9 +2924,9 @@ } }, "webpack": { - "version": "5.12.3", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.12.3.tgz", - "integrity": "sha512-7tiQmcTnKhZwbf7X7sEfXe0pgkGjUZjT6JfYkZHvvIb4/ZsXl1rJu5PxsJoN7W3v5sNSP/8TgBoiOdDqVdvK5w==", + "version": "5.15.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.15.0.tgz", + "integrity": "sha512-y/xG+ONDz78yn3VvP6gAvGr1/gkxOgitvHSXBmquyN8KDtrGEyE3K9WkXOPB7QmfcOBCpO4ELXwNcCYQnEmexA==", "dev": true, "requires": { "@types/eslint-scope": "^3.7.0", @@ -2931,7 +2937,8 @@ "acorn": "^8.0.4", "browserslist": "^4.14.5", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.3.1", + "enhanced-resolve": "^5.7.0", + "es-module-lexer": "^0.3.26", "eslint-scope": "^5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", @@ -2949,9 +2956,9 @@ }, "dependencies": { "enhanced-resolve": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.5.0.tgz", - "integrity": "sha512-b4a6BasBCoLzri4MdaeOlDMpls2oioI28CF17csMiav9dq46yvQaKPFNUrCHB6VqQokBDG2VIEEL81jMiQ6Wtw==", + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.7.0.tgz", + "integrity": "sha512-6njwt/NsZFUKhM6j9U8hzVyD4E4r0x7NQzhTCbcWOJ0IQjNSAoalWmb0AE51Wn+fwan5qVESWi7t2ToBxs9vrw==", "dev": true, "requires": { "graceful-fs": "^4.2.4", diff --git a/src/packages/utils/package.json b/src/packages/utils/package.json index 2c994c67a1..6145e6befb 100644 --- a/src/packages/utils/package.json +++ b/src/packages/utils/package.json @@ -46,7 +46,7 @@ "cross-env": "7.0.3", "file-loader": "6.2.0", "ts-loader": "8.0.14", - "webpack": "5.12.3", + "webpack": "5.15.0", "webpack-bundle-analyzer": "4.3.0", "webpack-cli": "4.3.1" }, From a7a2936f7c4d6db69895a3c2c298f6e634eefd43 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 17 Jan 2021 11:33:15 +0200 Subject: [PATCH 13/16] chore(deps): bump @sentry/integrations from 5.29.2 to 5.30.0 (#2807) Bumps [@sentry/integrations](https://github.com/getsentry/sentry-javascript) from 5.29.2 to 5.30.0. - [Release notes](https://github.com/getsentry/sentry-javascript/releases) - [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-javascript/compare/5.29.2...5.30.0) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 24 ++++++++++++------------ package.json | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9fa977d4de..72e6d1f580 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2744,12 +2744,12 @@ } }, "@sentry/integrations": { - "version": "5.29.2", - "resolved": "https://registry.npmjs.org/@sentry/integrations/-/integrations-5.29.2.tgz", - "integrity": "sha512-bH50B0xubbHrJFq8xZRxOc5BgXe1PXKfC0OqQkhhSd+Bu2WDLCHcn0CEzV+8thZTYkipAoFAFJNdEWcsM2Wcew==", + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/integrations/-/integrations-5.30.0.tgz", + "integrity": "sha512-Fqh4ALLoQWdd+1ih0iBduANWFyNmFWMxwvBu3V/wLDRi8OcquI0lEzWai1InzTJTiNhRHPnhuU++l/vkO0OCww==", "requires": { - "@sentry/types": "5.29.2", - "@sentry/utils": "5.29.2", + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", "localforage": "1.8.1", "tslib": "^1.9.3" } @@ -2772,16 +2772,16 @@ } }, "@sentry/types": { - "version": "5.29.2", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.29.2.tgz", - "integrity": "sha512-dM9wgt8wy4WRty75QkqQgrw9FV9F+BOMfmc0iaX13Qos7i6Qs2Q0dxtJ83SoR4YGtW8URaHzlDtWlGs5egBiMA==" + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.30.0.tgz", + "integrity": "sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==" }, "@sentry/utils": { - "version": "5.29.2", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-5.29.2.tgz", - "integrity": "sha512-nEwQIDjtFkeE4k6yIk4Ka5XjGRklNLThWLs2xfXlL7uwrYOH2B9UBBOOIRUraBm/g/Xrra3xsam/kRxuiwtXZQ==", + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-5.30.0.tgz", + "integrity": "sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww==", "requires": { - "@sentry/types": "5.29.2", + "@sentry/types": "5.30.0", "tslib": "^1.9.3" } }, diff --git a/package.json b/package.json index 4a696cc453..9b68a8143e 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ }, "dependencies": { "@sentry/browser": "5.30.0", - "@sentry/integrations": "5.29.2", + "@sentry/integrations": "5.30.0", "@testing-library/jest-dom": "5.11.9", "@testing-library/react": "11.2.3", "@types/jest": "26.0.20", From 07cc8589262dc1aa9a9e3fc49cd6ce2641826f65 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 17 Jan 2021 11:33:24 +0200 Subject: [PATCH 14/16] chore(deps-dev): bump husky from 4.3.7 to 4.3.8 (#2804) Bumps [husky](https://github.com/typicode/husky) from 4.3.7 to 4.3.8. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v4.3.7...v4.3.8) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 72e6d1f580..50291bceac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10831,9 +10831,9 @@ "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==" }, "husky": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/husky/-/husky-4.3.7.tgz", - "integrity": "sha512-0fQlcCDq/xypoyYSJvEuzbDPHFf8ZF9IXKJxlrnvxABTSzK1VPT2RKYQKrcgJ+YD39swgoB6sbzywUqFxUiqjw==", + "version": "4.3.8", + "resolved": "https://registry.npmjs.org/husky/-/husky-4.3.8.tgz", + "integrity": "sha512-LCqqsB0PzJQ/AlCgfrfzRe3e3+NvmefAdKQhRYpxS4u6clblBoDdzzvHi8fmxKRzvMxPY/1WZWzomPZww0Anow==", "dev": true, "requires": { "chalk": "^4.0.0", diff --git a/package.json b/package.json index 9b68a8143e..e7e2c900f8 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "eslint-config-prettier": "7.1.0", "eslint-plugin-prettier": "3.3.1", "firebase-tools": "9.2.1", - "husky": "4.3.7", + "husky": "4.3.8", "jest-canvas-mock": "2.3.0", "lint-staged": "10.5.3", "pepjs": "0.5.3", From ce2c341910ec14b20162c0e3fc11f982f56cd2e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Victor=20Mass=C3=A9?= Date: Sun, 17 Jan 2021 17:46:23 +0100 Subject: [PATCH 15/16] feat: Change shortcuts menu to help menu (#2812) Co-authored-by: Panayiotis Lipiridis --- src/actions/actionMenu.tsx | 4 +- src/actions/shortcuts.ts | 2 +- src/appState.ts | 4 +- src/components/Actions.tsx | 6 +- src/components/App.tsx | 2 +- src/components/Dialog.scss | 1 + src/components/Dialog.tsx | 4 +- .../{ShortcutsDialog.scss => HelpDialog.scss} | 29 +- src/components/HelpDialog.tsx | 348 ++++++++++++++++++ src/components/HelpIcon.tsx | 14 +- src/components/LayerUI.tsx | 8 +- src/components/ShortcutsDialog.tsx | 321 ---------------- src/css/styles.scss | 3 +- src/css/theme.scss | 1 + src/locales/en.json | 24 +- .../regressionTests.test.tsx.snap | 134 +++---- src/types.ts | 2 +- 17 files changed, 470 insertions(+), 437 deletions(-) rename src/components/{ShortcutsDialog.scss => HelpDialog.scss} (60%) create mode 100644 src/components/HelpDialog.tsx delete mode 100644 src/components/ShortcutsDialog.tsx diff --git a/src/actions/actionMenu.tsx b/src/actions/actionMenu.tsx index 6ae29e5194..c56999d78c 100644 --- a/src/actions/actionMenu.tsx +++ b/src/actions/actionMenu.tsx @@ -74,13 +74,13 @@ export const actionShortcuts = register({ return { appState: { ...appState, - showShortcutsDialog: true, + showHelpDialog: true, }, commitToHistory: false, }; }, PanelComponent: ({ updateData }) => ( - + ), keyTest: (event) => event.key === KEYS.QUESTION_MARK, }); diff --git a/src/actions/shortcuts.ts b/src/actions/shortcuts.ts index e2fcf595ac..a12b30ac71 100644 --- a/src/actions/shortcuts.ts +++ b/src/actions/shortcuts.ts @@ -34,7 +34,7 @@ const shortcutMap: Record = { delete: [getShortcutKey("Del")], duplicateSelection: [ getShortcutKey("CtrlOrCmd+D"), - getShortcutKey(`Alt+${t("shortcutsDialog.drag")}`), + getShortcutKey(`Alt+${t("helpDialog.drag")}`), ], sendBackward: [getShortcutKey("CtrlOrCmd+[")], bringForward: [getShortcutKey("CtrlOrCmd+]")], diff --git a/src/appState.ts b/src/appState.ts index dd2aeb8a23..be3a87603e 100644 --- a/src/appState.ts +++ b/src/appState.ts @@ -63,7 +63,7 @@ export const getDefaultAppState = (): Omit< selectionElement: null, shouldAddWatermark: false, shouldCacheIgnoreZoom: false, - showShortcutsDialog: false, + showHelpDialog: false, showStats: false, startBoundElement: null, suggestedBindings: [], @@ -142,7 +142,7 @@ const APP_STATE_STORAGE_CONF = (< selectionElement: { browser: false, export: false }, shouldAddWatermark: { browser: true, export: false }, shouldCacheIgnoreZoom: { browser: true, export: false }, - showShortcutsDialog: { browser: false, export: false }, + showHelpDialog: { browser: false, export: false }, showStats: { browser: true, export: false }, startBoundElement: { browser: false, export: false }, suggestedBindings: { browser: false, export: false }, diff --git a/src/components/Actions.tsx b/src/components/Actions.tsx index 177fd61c2b..2798caccd6 100644 --- a/src/components/Actions.tsx +++ b/src/components/Actions.tsx @@ -163,9 +163,9 @@ export const ShapesSwitcher = ({ {SHAPES.map(({ value, icon, key }, index) => { const label = t(`toolBar.${value}`); const letter = typeof key === "string" ? key : key[0]; - const shortcut = `${capitalizeString(letter)} ${t( - "shortcutsDialog.or", - )} ${index + 1}`; + const shortcut = `${capitalizeString(letter)} ${t("helpDialog.or")} ${ + index + 1 + }`; return ( { if (event.key === KEYS.QUESTION_MARK) { this.setState({ - showShortcutsDialog: true, + showHelpDialog: true, }); } diff --git a/src/components/Dialog.scss b/src/components/Dialog.scss index b694669b74..c00a908844 100644 --- a/src/components/Dialog.scss +++ b/src/components/Dialog.scss @@ -15,6 +15,7 @@ padding: calc(var(--space-factor) * 2); text-align: center; font-variant: small-caps; + font-size: 1.2em; } .Dialog__titleContent { diff --git a/src/components/Dialog.tsx b/src/components/Dialog.tsx index aa2ef7c010..217b625c4c 100644 --- a/src/components/Dialog.tsx +++ b/src/components/Dialog.tsx @@ -80,7 +80,7 @@ export const Dialog = (props: { onCloseRequest={props.onCloseRequest} > -

+

{props.title} -

+
{props.children}
diff --git a/src/components/ShortcutsDialog.scss b/src/components/HelpDialog.scss similarity index 60% rename from src/components/ShortcutsDialog.scss rename to src/components/HelpDialog.scss index 6cb6898c37..88e1eb696f 100644 --- a/src/components/ShortcutsDialog.scss +++ b/src/components/HelpDialog.scss @@ -1,23 +1,28 @@ @import "../css/_variables"; .excalidraw { - .ShortcutsDialog-island { + .HelpDialog h3 { + border-bottom: 1px solid var(--button-gray-2); + padding-bottom: 4px; + } + + .HelpDialog--island { border: 1px solid var(--button-gray-2); margin-bottom: 16px; } - .ShortcutsDialog-island-title { + .HelpDialog--island-title { margin: 0; padding: 4px; background-color: var(--button-gray-1); text-align: center; } - .ShorcutsDialog-shortcut { + .HelpDialog--shortcut { border-top: 1px solid var(--button-gray-2); } - .ShorcutsDialog-key { + .HelpDialog--key { word-break: keep-all; border: 1px solid var(--button-gray-2); padding: 2px 8px; @@ -32,12 +37,20 @@ font-family: inherit; } - .ShortcutsDialog-footer { + .HelpDialog--header { display: flex; flex-direction: row; justify-content: space-evenly; - border-top: 1px solid var(--button-gray-2); - margin-top: 8px; - padding-top: 16px; + margin-bottom: 32px; + padding-bottom: 16px; + } + + .HelpDialog--btn { + border: 1px solid var(--link-color); + padding: 8px 32px; + border-radius: 4px; + } + .HelpDialog--btn:hover { + text-decoration: none; } } diff --git a/src/components/HelpDialog.tsx b/src/components/HelpDialog.tsx new file mode 100644 index 0000000000..fa72a2da55 --- /dev/null +++ b/src/components/HelpDialog.tsx @@ -0,0 +1,348 @@ +import React from "react"; +import { t } from "../i18n"; +import { isDarwin } from "../keys"; +import { Dialog } from "./Dialog"; +import { getShortcutKey } from "../utils"; +import "./HelpDialog.scss"; + +const Header = () => ( + +); + +const Section = (props: { title: string; children: React.ReactNode }) => ( + <> +

{props.title}

+ {props.children} + +); + +const Columns = (props: { children: React.ReactNode }) => ( +
+ {props.children} +
+); + +const Column = (props: { children: React.ReactNode }) => ( +
{props.children}
+); + +const ShortcutIsland = (props: { + caption: string; + children: React.ReactNode; +}) => ( +
+

{props.caption}

+ {props.children} +
+); + +const Shortcut = (props: { + label: string; + shortcuts: string[]; + isOr: boolean; +}) => { + return ( +
+
+
+ {props.label} +
+
+ {props.shortcuts.map((shortcut, index) => ( + + {shortcut} + {props.isOr && + index !== props.shortcuts.length - 1 && + t("helpDialog.or")} + + ))} +
+
+
+ ); +}; + +Shortcut.defaultProps = { + isOr: true, +}; + +const ShortcutKey = (props: { children: React.ReactNode }) => ( + +); + +export const HelpDialog = ({ onClose }: { onClose?: () => void }) => { + const handleClose = React.useCallback(() => { + if (onClose) { + onClose(); + } + }, [onClose]); + + return ( + <> + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + ); +}; diff --git a/src/components/HelpIcon.tsx b/src/components/HelpIcon.tsx index d114117be3..8ec09d4e11 100644 --- a/src/components/HelpIcon.tsx +++ b/src/components/HelpIcon.tsx @@ -1,4 +1,5 @@ import React from "react"; +import { questionCircle } from "../components/icons"; type HelpIconProps = { title?: string; @@ -7,19 +8,8 @@ type HelpIconProps = { onClick?(): void; }; -const ICON = ( - - - -); - export const HelpIcon = (props: HelpIconProps) => ( ); diff --git a/src/components/LayerUI.tsx b/src/components/LayerUI.tsx index fbd5fdee0c..d13a741d5b 100644 --- a/src/components/LayerUI.tsx +++ b/src/components/LayerUI.tsx @@ -36,7 +36,7 @@ import { LockIcon } from "./LockIcon"; import { MobileMenu } from "./MobileMenu"; import { PasteChartDialog } from "./PasteChartDialog"; import { Section } from "./Section"; -import { ShortcutsDialog } from "./ShortcutsDialog"; +import { HelpDialog } from "./HelpDialog"; import Stack from "./Stack"; import { ToolButton } from "./ToolButton"; import { Tooltip } from "./Tooltip"; @@ -566,10 +566,8 @@ const LayerUI = ({ onClose={() => setAppState({ errorMessage: null })} /> )} - {appState.showShortcutsDialog && ( - setAppState({ showShortcutsDialog: false })} - /> + {appState.showHelpDialog && ( + setAppState({ showHelpDialog: false })} /> )} {appState.pasteDialog.shown && ( ( -
- {props.children} -
-); - -const Column = (props: { children: React.ReactNode }) => ( -
{props.children}
-); - -const ShortcutIsland = (props: { - caption: string; - children: React.ReactNode; -}) => ( -
-

{props.caption}

- {props.children} -
-); - -const Shortcut = (props: { - label: string; - shortcuts: string[]; - isOr: boolean; -}) => { - return ( -
-
-
- {props.label} -
-
- {props.shortcuts.map((shortcut, index) => ( - - {shortcut} - {props.isOr && - index !== props.shortcuts.length - 1 && - t("shortcutsDialog.or")} - - ))} -
-
-
- ); -}; - -Shortcut.defaultProps = { - isOr: true, -}; - -const ShortcutKey = (props: { children: React.ReactNode }) => ( - -); - -const Footer = () => ( - -); - -export const ShortcutsDialog = ({ onClose }: { onClose?: () => void }) => { - const handleClose = React.useCallback(() => { - if (onClose) { - onClose(); - } - }, [onClose]); - - return ( - <> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - ); -}; diff --git a/src/css/styles.scss b/src/css/styles.scss index c2fcd527b3..da616124ed 100644 --- a/src/css/styles.scss +++ b/src/css/styles.scss @@ -13,7 +13,7 @@ a { font-weight: 500; text-decoration: none; - color: $oc-blue-7; /* OC Blue 7 */ + color: var(--link-color); &:hover { text-decoration: underline; @@ -431,6 +431,7 @@ cursor: pointer; fill: $oc-gray-6; bottom: 14px; + width: 1.5rem; :root[dir="ltr"] & { right: 14px; diff --git a/src/css/theme.scss b/src/css/theme.scss index 4de90d83d9..ca88d84047 100644 --- a/src/css/theme.scss +++ b/src/css/theme.scss @@ -32,6 +32,7 @@ --popup-text-color: #{$oc-black}; --popup-text-inverted-color: #{$oc-white}; --dialog-border: #{$oc-gray-6}; + --link-color: #{$oc-blue-7}; } .excalidraw { diff --git a/src/locales/en.json b/src/locales/en.json index 23a642852d..c4d06be615 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -199,24 +199,26 @@ "errorDialog": { "title": "Error" }, - "shortcutsDialog": { - "title": "Keyboard shortcuts", - "shapes": "Shapes", - "or": "or", + "helpDialog": { + "blog": "Read our blog", "click": "click", - "drag": "drag", "curvedArrow": "Curved arrow", "curvedLine": "Curved line", + "documentation": "Documentation", + "drag": "drag", "editor": "Editor", - "view": "View", - "blog": "Read our blog", - "howto": "Follow our guides", "github": "Found an issue? Submit", - "textNewLine": "Add new line (text)", + "howto": "Follow our guides", + "or": "or", + "preventBinding": "Prevent arrow binding", + "shapes": "Shapes", + "shortcuts": "Keyboard shortcuts", "textFinish": "Finish editing (text)", + "textNewLine": "Add new line (text)", + "title": "Help", + "view": "View", "zoomToFit": "Zoom to fit all elements", - "zoomToSelection": "Zoom to selection", - "preventBinding": "Prevent arrow binding" + "zoomToSelection": "Zoom to selection" }, "encrypted": { "tooltip": "Your drawings are end-to-end encrypted so Excalidraw's servers will never see them." diff --git a/src/tests/__snapshots__/regressionTests.test.tsx.snap b/src/tests/__snapshots__/regressionTests.test.tsx.snap index 12270bcb85..ce23cf2dec 100644 --- a/src/tests/__snapshots__/regressionTests.test.tsx.snap +++ b/src/tests/__snapshots__/regressionTests.test.tsx.snap @@ -70,7 +70,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -536,7 +536,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -984,7 +984,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -1760,7 +1760,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -1967,7 +1967,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -2418,7 +2418,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -2666,7 +2666,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -2831,7 +2831,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -3303,7 +3303,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -3612,7 +3612,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -3816,7 +3816,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -4056,7 +4056,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -4307,7 +4307,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -4708,7 +4708,7 @@ Object { }, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -4979,7 +4979,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -5304,7 +5304,7 @@ Object { }, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -5488,7 +5488,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -5650,7 +5650,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -6108,7 +6108,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -6417,7 +6417,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -8454,7 +8454,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -8815,7 +8815,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -9066,7 +9066,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -9318,7 +9318,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -9626,7 +9626,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -9788,7 +9788,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -9950,7 +9950,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -10112,7 +10112,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -10304,7 +10304,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -10496,7 +10496,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -10688,7 +10688,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -10880,7 +10880,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -11042,7 +11042,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -11204,7 +11204,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -11396,7 +11396,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -11558,7 +11558,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -11761,7 +11761,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -12468,7 +12468,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -12715,7 +12715,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": true, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -12813,7 +12813,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -12913,7 +12913,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -13075,7 +13075,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -13381,7 +13381,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -13687,7 +13687,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -13847,7 +13847,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -14043,7 +14043,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -14296,7 +14296,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -14612,7 +14612,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -15449,7 +15449,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -15755,7 +15755,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -16065,7 +16065,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -16441,7 +16441,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -16612,7 +16612,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -16925,7 +16925,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -17165,7 +17165,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -17420,7 +17420,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -17735,7 +17735,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -17835,7 +17835,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -18008,7 +18008,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -18814,7 +18814,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -18916,7 +18916,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -19692,7 +19692,7 @@ Object { }, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -20093,7 +20093,7 @@ Object { }, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -20340,7 +20340,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": true, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -20440,7 +20440,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -20934,7 +20934,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], @@ -21032,7 +21032,7 @@ Object { "selectionElement": null, "shouldAddWatermark": false, "shouldCacheIgnoreZoom": false, - "showShortcutsDialog": false, + "showHelpDialog": false, "showStats": false, "startBoundElement": null, "suggestedBindings": Array [], diff --git a/src/types.ts b/src/types.ts index 24b2e81514..b94872def7 100644 --- a/src/types.ts +++ b/src/types.ts @@ -81,7 +81,7 @@ export type AppState = { selectedElementIds: { [id: string]: boolean }; previousSelectedElementIds: { [id: string]: boolean }; shouldCacheIgnoreZoom: boolean; - showShortcutsDialog: boolean; + showHelpDialog: boolean; toastMessage: string | null; zenModeEnabled: boolean; appearance: "light" | "dark"; From 68347ba476c5b0f5da8e0d063dcb0babf56906d5 Mon Sep 17 00:00:00 2001 From: Aakansha Doshi Date: Sun, 17 Jan 2021 23:18:19 +0530 Subject: [PATCH 16/16] docs(changelog): add about extra api's in changelog and separate package and library updates (#2813) --- src/packages/excalidraw/CHANGELOG.md | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/packages/excalidraw/CHANGELOG.md b/src/packages/excalidraw/CHANGELOG.md index f161523892..18d774d77a 100644 --- a/src/packages/excalidraw/CHANGELOG.md +++ b/src/packages/excalidraw/CHANGELOG.md @@ -14,14 +14,27 @@ Please add the latest change on the top under the correct section. ## 0.2.0 +## Excalidraw API + ### Features -- Add toast [#2772](https://github.com/excalidraw/excalidraw/pull/2772) -- Add `cmd+o` shortcut to load scene [#2732](https://github.com/excalidraw/excalidraw/pull/2732) +- Exported few [Extra API's](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#extra-apis) which can be used by the host to communicate with Excalidraw. + - Remove language picker, and add `langCode`, `renderFooter` [#2644](https://github.com/excalidraw/excalidraw/pull/2644): - BREAKING: removed the language picker from UI. It is now the host app's responsibility to implement a language picker if desirable, using the newly added [`renderFooter`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#renderFooter) prop. The reasoning is that the i18n should be controlled by the app itself, not by the nested Excalidraw component. - Added [`langCode`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#langCode) prop to control the UI language. - Add support for `exportToBackend` prop to allow host apps to implement shareable links [#2612](https://github.com/excalidraw/excalidraw/pull/2612/files) + +### Fixes + +- Hide collaboration button when the prop `onCollabButtonClick` is not provided [#2598](https://github.com/excalidraw/excalidraw/pull/2598) + +## Excalidraw Library + +### Features + +- Add toast [#2772](https://github.com/excalidraw/excalidraw/pull/2772) +- Add `cmd+o` shortcut to load scene [#2732](https://github.com/excalidraw/excalidraw/pull/2732) - Require use of a preset dialog size; adjust dialog sizing [#2684](https://github.com/excalidraw/excalidraw/pull/2684) - Add line chart and paste dialog selection [#2670](https://github.com/excalidraw/excalidraw/pull/2670) - Tweak editing behavior [#2668](https://github.com/excalidraw/excalidraw/pull/2668) @@ -37,7 +50,6 @@ Please add the latest change on the top under the correct section. ### Fixes -- Fix typo for initialData and point all links to master [#2707](https://github.com/excalidraw/excalidraw/pull/2707) - Fix compile error [#2685](https://github.com/excalidraw/excalidraw/pull/2685) - Center zoom on iPhone and iPad [#2642](https://github.com/excalidraw/excalidraw/pull/2642) - Allow text-selecting in dialogs & reset cursor [#2783](https://github.com/excalidraw/excalidraw/pull/2783) @@ -48,7 +60,6 @@ Please add the latest change on the top under the correct section. - Consistent case for export locale strings [#2622](https://github.com/excalidraw/excalidraw/pull/2622) - Remove unnecessary console.error as it was polluting Sentry [#2637](https://github.com/excalidraw/excalidraw/pull/2637) - Fix scroll-to-center on init for non-zero canvas offsets [#2445](https://github.com/excalidraw/excalidraw/pull/2445) -- Hide collab button when onCollabButtonClick not supplied [#2598](https://github.com/excalidraw/excalidraw/pull/2598) - Fix resizing the pasted charts [#2586](https://github.com/excalidraw/excalidraw/pull/2586) - Fix element visibility and zoom on cursor when canvas offset isn't 0. [#2534](https://github.com/excalidraw/excalidraw/pull/2534) - Fix Library Menu Layout [#2502](https://github.com/excalidraw/excalidraw/pull/2502) @@ -80,10 +91,6 @@ Please add the latest change on the top under the correct section. - Remove the word toggle from labels [#2648](https://github.com/excalidraw/excalidraw/pull/2648) - -### Chore - -- Bump ini from 1.3.5 to 1.3.7 in /src/packages/excalidraw [#2500](https://github.com/excalidraw/excalidraw/pull/2500) - ### Docs - Document some of the more exotic element props [#2673](https://github.com/excalidraw/excalidraw/pull/2673)