From 2cbb14eeb9781b7ed5032cb648efbe82059cbcce Mon Sep 17 00:00:00 2001 From: Carlos Cano Date: Wed, 9 Oct 2024 23:00:23 +0300 Subject: [PATCH] Applied manually all Alkemio changes to version 0.17.6 --- README.md | 114 ++++++++++++++++++ package.json | 4 +- packages/excalidraw/CHANGELOG.md | 12 ++ packages/excalidraw/actions/actionCanvas.tsx | 13 ++ packages/excalidraw/appState.ts | 2 + packages/excalidraw/clipboard.test.ts | 36 +++--- packages/excalidraw/clipboard.ts | 10 +- packages/excalidraw/components/Actions.scss | 16 +++ packages/excalidraw/components/Actions.tsx | 1 + packages/excalidraw/components/App.tsx | 24 +++- packages/excalidraw/components/LayerUI.tsx | 31 ++++- .../components/LockElementButton.tsx | 53 ++++++++ packages/excalidraw/components/ToolIcon.scss | 5 +- packages/excalidraw/components/icons.tsx | 5 + packages/excalidraw/data/types.ts | 2 + packages/excalidraw/element/textWysiwyg.tsx | 4 +- packages/excalidraw/locales/en.json | 2 + packages/excalidraw/package.json | 4 +- .../__snapshots__/contextmenu.test.tsx.snap | 17 +++ .../regressionTests.test.tsx.snap | 52 ++++++++ .../packages/__snapshots__/utils.test.ts.snap | 1 + packages/excalidraw/tests/selection.test.tsx | 31 ++--- packages/excalidraw/types.ts | 2 + .../utils/__snapshots__/utils.test.ts.snap | 1 + scripts/prerelease.js | 2 +- scripts/updateChangelog.js | 4 +- 26 files changed, 393 insertions(+), 55 deletions(-) create mode 100644 packages/excalidraw/components/LockElementButton.tsx diff --git a/README.md b/README.md index e8cd3b06fa86..ad5a50a875ba 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,117 @@ + +

Alkemio Logo + +

+

Enabling society to collaborate. Building a better future, together.

+# Alkemio fork of Excalidraw v0.17.0 + +### Upgrade procedure +``` + git fetch --tags upstream + git checkout 0.16.1-alkemio-1 + git merge v0.17.0 + git push --set-upstream origin 0.17.0-alkemio-1 +``` + +### List of differences with standard Excalidraw +- ZoomToFit feature exposed through the external API +- Added ZoomToFit button to the zoom toolbar +- Added ZoomToFit flag to initialData to fit items on load +- Modified the paste functionality to avoid pasting elements (such as images) as JSON when editing text. +- Added `hideLibraryButton` to the appState to be able to hide the button from outside. +- Changed the toolbar Lock button behavior. Now it locks/unlocks elements instead of the tool in use +- Changed the load from file behavior to fix multi-user collaboration bug. Now elements loaded will have version number > currentScene version number + +### Testing locally inside Alkemio client +``` +npm link +cd ../client-web +npm link @alkemio/excalidraw --save +``` + +### Build and publish the new npm package: +Find in json files any `'alkemio-XX'` and set the version you want to publish +``` +yarn +cd src/packages/excalidraw +yarn install +yarn build:umd +yarn pack +yarn publish +``` + +## Change Log + +### Alkemio fork of Excalidraw v0.17.0-alkemio-4 +- Added `hideLibraryButton` to the appState to be able to hide the button from outside. +- Changed the toolbar Lock button behavior. Now it locks/unlocks elements instead of the tool in use + +### Alkemio fork of Excalidraw v0.17.0-alkemio-3-beta +- Changed behavior. Pasting elements is better handled and now it doesn't end up as a big text node with JSON inside. + +### Alkemio fork of Excalidraw v0.17.0 +- Upgraded from Excalidraw v0.16.1 to v0.17.0 +- Applied the new styles of the buttons to Alkemio's ZoomToFit added button. + + +### Alkemio fork of Excalidraw v0.16.1 + +- Upgraded from Excalidraw v0.15.2 to v0.16.1 + + - Sync master branch from github + - `git pull` + - Sync tags: + + ``` + $ git fetch --tags upstream + ## Assuming upstream is already pointing to the excalidraw repo, if not, just run: + $ git remote add upstream git@github.com:excalidraw/excalidraw.git + ``` + + - Checkout a new Branch pointing to the same commit as the tag: + + ``` + $ git checkout -b branch-v0.16.1 tags/v0.16.1 + ``` + + - Push the new branch to GitHub and create the PR there or merge localy if there are conflicts + +- Fixed merge conflicts and a small issue with the zoomToFit icon, they have added a function with the same name. + +### Alkemio fork of Excalidraw v0.15.2 + +#### Modifications: + +- ZoomToFit feature exposed through the external API +- Added ZoomToFit button to the zoom toolbar +- Added ZoomToFit flag to initialData to fit items on load + +#### Development guidelines + +- First of all, Excalidraw uses yarn as package manager, so first thing to do is make sure you have yarn installed in your system. `npm install --global yarn`. +- Clone the repository to a local folder: `git clone git@github.com:alkem-io/excalidraw.git` and create a feature branch to store your work. +- Follow the original Excalidraw instructions below to run and debug with the included test application - Just `yarn ; yarn start` should work. +- To test/debug Excalidraw inside our client-web application: + - Execute `npm link` in the root of your cloned repository. + - Go to your client-web folder and execute: `npm link @alkemio/excalidraw --save` +- When you're done with the development commit and push everything, create a Pull Request in the alkem-io/excalidraw repository to merge your branch to develop. +- Once is merged to `develop`, checkout `develop` branch and see below how to build and publish the package to NPM repository. +- Make sure you switch back the package in your client-web to use the published @alkemio/excalidraw package's new version instead of the old one or the linked one if you changed it. + +#### Build and publish a new npm package: + +``` +yarn +cd src/packages/excalidraw +yarn install +yarn build:umd +yarn pack +yarn publish +``` + +
+ + diff --git a/package.json b/package.json index 350f1469fbaa..b5bcee09ad60 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "private": true, + "private": false, "name": "excalidraw-monorepo", "workspaces": [ "excalidraw-app", @@ -56,7 +56,7 @@ "engines": { "node": "18.0.0 - 20.x.x" }, - "homepage": ".", + "homepage": "https://github.com/alkem-io/excalidraw-fork", "prettier": "@excalidraw/prettier-config", "scripts": { "build-node": "node ./scripts/build-node.js", diff --git a/packages/excalidraw/CHANGELOG.md b/packages/excalidraw/CHANGELOG.md index 9c5d4f5642de..f61e6197887c 100644 --- a/packages/excalidraw/CHANGELOG.md +++ b/packages/excalidraw/CHANGELOG.md @@ -77,6 +77,18 @@ Please add the latest change on the top under the correct section. - `appState.openDialog` type was changed from `null | string` to `null | { name: string }`. [#7336](https://github.com/excalidraw/excalidraw/pull/7336) + +## Alkemio Fork +- First version of Alkemio forked Excalidraw +- ZoomToFit feature exposed through the external API +- Added ZoomToFit button to the zoom toolbar +- Added ZoomToFit flag to initialData to fit items on load +- [Alkemio Fork of Excalidraw: Expose Zoom to fit feature #1](todo) +- Added `hideLibraryButton` to the appState to be able to hide the button from outside. +- Changed the toolbar Lock button behavior. Now it locks/unlocks elements instead of the tool in use +- Changed behavior. Pasting elements is better handled and now it doesn't end up as a big text node with JSON inside. + + ## 0.17.3 (2024-02-09) ### Fixes diff --git a/packages/excalidraw/actions/actionCanvas.tsx b/packages/excalidraw/actions/actionCanvas.tsx index 0503e50f756a..10f5004e6a5f 100644 --- a/packages/excalidraw/actions/actionCanvas.tsx +++ b/packages/excalidraw/actions/actionCanvas.tsx @@ -7,6 +7,7 @@ import { zoomAreaIcon, ZoomInIcon, ZoomOutIcon, + ZoomToFitIcon, ZoomResetIcon, } from "../components/icons"; import { ToolButton } from "../components/ToolButton"; @@ -438,6 +439,18 @@ export const actionZoomToFit = register({ event.shiftKey && !event.altKey && !event[KEYS.CTRL_OR_CMD], + PanelComponent: ({ updateData, data }) => ( + { + updateData(null); + }} + /> + ), }); export const actionToggleTheme = register({ diff --git a/packages/excalidraw/appState.ts b/packages/excalidraw/appState.ts index a0ab233c9e8c..cc8185f46f3e 100644 --- a/packages/excalidraw/appState.ts +++ b/packages/excalidraw/appState.ts @@ -94,6 +94,7 @@ export const getDefaultAppState = (): Omit< value: 1 as NormalizedZoomValue, }, viewModeEnabled: false, + hideLibraryButton: false, pendingImageElementId: null, showHyperlinkPopup: false, selectedLinearElement: null, @@ -209,6 +210,7 @@ const APP_STATE_STORAGE_CONF = (< zenModeEnabled: { browser: true, export: false, server: false }, zoom: { browser: true, export: false, server: false }, viewModeEnabled: { browser: false, export: false, server: false }, + hideLibraryButton: { browser: false, export: false, server: false }, pendingImageElementId: { browser: false, export: false, server: false }, showHyperlinkPopup: { browser: false, export: false, server: false }, selectedLinearElement: { browser: true, export: false, server: false }, diff --git a/packages/excalidraw/clipboard.test.ts b/packages/excalidraw/clipboard.test.ts index 770bcc90e794..2220b187d3f5 100644 --- a/packages/excalidraw/clipboard.test.ts +++ b/packages/excalidraw/clipboard.test.ts @@ -6,13 +6,13 @@ import { import { API } from "./tests/helpers/api"; describe("parseClipboard()", () => { - it("should parse JSON as plaintext if not excalidraw-api/clipboard data", async () => { + it("should parse JSON as plaintext if not excalidraw-api/clipboard data", () => { let text; let clipboardData; // ------------------------------------------------------------------------- text = "123"; - clipboardData = await parseClipboard( + clipboardData = parseClipboard( createPasteEvent({ types: { "text/plain": text } }), ); expect(clipboardData.text).toBe(text); @@ -20,7 +20,7 @@ describe("parseClipboard()", () => { // ------------------------------------------------------------------------- text = "[123]"; - clipboardData = await parseClipboard( + clipboardData = parseClipboard( createPasteEvent({ types: { "text/plain": text } }), ); expect(clipboardData.text).toBe(text); @@ -28,17 +28,17 @@ describe("parseClipboard()", () => { // ------------------------------------------------------------------------- text = JSON.stringify({ val: 42 }); - clipboardData = await parseClipboard( + clipboardData = parseClipboard( createPasteEvent({ types: { "text/plain": text } }), ); expect(clipboardData.text).toBe(text); }); - it("should parse valid excalidraw JSON if inside text/plain", async () => { + it("should parse valid excalidraw JSON if inside text/plain", () => { const rect = API.createElement({ type: "rectangle" }); const json = serializeAsClipboardJSON({ elements: [rect], files: null }); - const clipboardData = await parseClipboard( + const clipboardData = parseClipboard( createPasteEvent({ types: { "text/plain": json, @@ -48,14 +48,14 @@ describe("parseClipboard()", () => { expect(clipboardData.elements).toEqual([rect]); }); - it("should parse valid excalidraw JSON if inside text/html", async () => { + it("should parse valid excalidraw JSON if inside text/html", () => { const rect = API.createElement({ type: "rectangle" }); let json; let clipboardData; // ------------------------------------------------------------------------- json = serializeAsClipboardJSON({ elements: [rect], files: null }); - clipboardData = await parseClipboard( + clipboardData = parseClipboard( createPasteEvent({ types: { "text/html": json, @@ -65,7 +65,7 @@ describe("parseClipboard()", () => { expect(clipboardData.elements).toEqual([rect]); // ------------------------------------------------------------------------- json = serializeAsClipboardJSON({ elements: [rect], files: null }); - clipboardData = await parseClipboard( + clipboardData = parseClipboard( createPasteEvent({ types: { "text/html": `
${json}
`, @@ -76,10 +76,10 @@ describe("parseClipboard()", () => { // ------------------------------------------------------------------------- }); - it("should parse `src` urls out of text/html", async () => { + it("should parse `src` urls out of text/html", () => { let clipboardData; // ------------------------------------------------------------------------- - clipboardData = await parseClipboard( + clipboardData = parseClipboard( createPasteEvent({ types: { "text/html": ``, @@ -93,7 +93,7 @@ describe("parseClipboard()", () => { }, ]); // ------------------------------------------------------------------------- - clipboardData = await parseClipboard( + clipboardData = parseClipboard( createPasteEvent({ types: { "text/html": `
`, @@ -112,8 +112,8 @@ describe("parseClipboard()", () => { ]); }); - it("should parse text content alongside `src` urls out of text/html", async () => { - const clipboardData = await parseClipboard( + it("should parse text content alongside `src` urls out of text/html", () => { + const clipboardData = parseClipboard( createPasteEvent({ types: { "text/html": `hello
my friend!`, @@ -137,10 +137,10 @@ describe("parseClipboard()", () => { ]); }); - it("should parse spreadsheet from either text/plain and text/html", async () => { + it("should parse spreadsheet from either text/plain and text/html", () => { let clipboardData; // ------------------------------------------------------------------------- - clipboardData = await parseClipboard( + clipboardData = parseClipboard( createPasteEvent({ types: { "text/plain": `a b @@ -156,7 +156,7 @@ describe("parseClipboard()", () => { values: [2, 5, 10], }); // ------------------------------------------------------------------------- - clipboardData = await parseClipboard( + clipboardData = parseClipboard( createPasteEvent({ types: { "text/html": `a b @@ -172,7 +172,7 @@ describe("parseClipboard()", () => { values: [2, 5, 10], }); // ------------------------------------------------------------------------- - clipboardData = await parseClipboard( + clipboardData = parseClipboard( createPasteEvent({ types: { "text/html": ` diff --git a/packages/excalidraw/clipboard.ts b/packages/excalidraw/clipboard.ts index e24961c647cc..1375b34d2742 100644 --- a/packages/excalidraw/clipboard.ts +++ b/packages/excalidraw/clipboard.ts @@ -295,10 +295,10 @@ export const readSystemClipboard = async () => { /** * Parses "paste" ClipboardEvent. */ -const parseClipboardEvent = async ( +const parseClipboardEvent = ( event: ClipboardEvent, isPlainPaste = false, -): Promise => { +): ParsedClipboardEvent => { try { const mixedContent = !isPlainPaste && event && maybeParseHTMLPaste(event); @@ -329,11 +329,11 @@ const parseClipboardEvent = async ( /** * Attempts to parse clipboard. Prefers system clipboard. */ -export const parseClipboard = async ( +export const parseClipboard = ( event: ClipboardEvent, isPlainPaste = false, -): Promise => { - const parsedEventData = await parseClipboardEvent(event, isPlainPaste); +): ClipboardData => { + const parsedEventData = parseClipboardEvent(event, isPlainPaste); if (parsedEventData.type === "mixedContent") { return { diff --git a/packages/excalidraw/components/Actions.scss b/packages/excalidraw/components/Actions.scss index 5826628de185..0cf4bd3f9c14 100644 --- a/packages/excalidraw/components/Actions.scss +++ b/packages/excalidraw/components/Actions.scss @@ -48,6 +48,22 @@ } .zoom-in-button { + /* + Added zoom-to-fit button, so this button is no longer the last button, removed the rounded border: + border-top-right-radius: var(--border-radius-lg) !important; + border-bottom-right-radius: var(--border-radius-lg) !important; + */ + :root[dir="rtl"] & { + transform: scaleX(-1); + } + + .ToolIcon__icon { + border-top-left-radius: 0 !important; + border-bottom-left-radius: 0 !important; + } + } + + .zoom-to-fit-button { border-top-right-radius: var(--border-radius-lg) !important; border-bottom-right-radius: var(--border-radius-lg) !important; diff --git a/packages/excalidraw/components/Actions.tsx b/packages/excalidraw/components/Actions.tsx index dd224e104ac1..2bdd50bb2234 100644 --- a/packages/excalidraw/components/Actions.tsx +++ b/packages/excalidraw/components/Actions.tsx @@ -429,6 +429,7 @@ export const ZoomActions = ({ {renderAction("zoomOut")} {renderAction("resetZoom")} {renderAction("zoomIn")} + {renderAction("zoomToFit")} ); diff --git a/packages/excalidraw/components/App.tsx b/packages/excalidraw/components/App.tsx index f9c41074b7c9..e641becacc20 100644 --- a/packages/excalidraw/components/App.tsx +++ b/packages/excalidraw/components/App.tsx @@ -35,6 +35,7 @@ import { actionToggleElementLock, actionToggleLinearEditor, actionToggleObjectsSnapMode, + actionZoomToFit, } from "../actions"; import { createRedoAction, createUndoAction } from "../actions/actionHistory"; import { ActionManager } from "../actions/manager"; @@ -684,6 +685,7 @@ class App extends React.Component { clear: this.resetHistory, }, scrollToContent: this.scrollToContent, + zoomToFit: this.zoomToFit, getSceneElements: this.getSceneElements, getAppState: () => this.state, getFiles: () => this.files, @@ -2335,6 +2337,12 @@ class App extends React.Component { }), }; } + if (initialData?.zoomToFit) { + // defer to after loading all elements + setTimeout(() => { + this.actionManager.executeAction(actionZoomToFit); + }); + } // FontFaceSet loadingdone event we listen on may not always fire // (looking at you Safari), so on init we manually load fonts for current // text elements on canvas, and rerender them once done. This also @@ -2945,6 +2953,10 @@ class App extends React.Component { return; } + // These two lines are moved up by Alkemio to avoid pasting images json as text inside text elements + let file = event?.clipboardData?.files[0]; + const data = parseClipboard(event, isPlainPaste); + const elementUnderCursor = document.elementFromPoint( this.lastViewportPosition.x, this.lastViewportPosition.y, @@ -2952,7 +2964,8 @@ class App extends React.Component { if ( event && (!(elementUnderCursor instanceof HTMLCanvasElement) || - isWritableElement(target)) + isWritableElement(target)) && + !data.elements // If there are any elements, they will not be inserted as text ) { return; } @@ -2965,11 +2978,6 @@ class App extends React.Component { this.state, ); - // must be called in the same frame (thus before any awaits) as the paste - // event else some browsers (FF...) will clear the clipboardData - // (something something security) - let file = event?.clipboardData?.files[0]; - const data = await parseClipboard(event, isPlainPaste); if (!file && !isPlainPaste) { if (data.mixedContent) { return this.addElementsFromMixedContentPaste(data.mixedContent, { @@ -3617,6 +3625,10 @@ class App extends React.Component { } }; + zoomToFit = () => { + this.actionManager.executeAction(actionZoomToFit); + }; + /** use when changing scrollX/scrollY/zoom based on user interaction */ private translateCanvas: React.Component["setState"] = ( state, diff --git a/packages/excalidraw/components/LayerUI.tsx b/packages/excalidraw/components/LayerUI.tsx index eb802713896d..0da592bc2815 100644 --- a/packages/excalidraw/components/LayerUI.tsx +++ b/packages/excalidraw/components/LayerUI.tsx @@ -27,7 +27,7 @@ import { FixedSideContainer } from "./FixedSideContainer"; import { HintViewer } from "./HintViewer"; import { Island } from "./Island"; import { LoadingMessage } from "./LoadingMessage"; -import { LockButton } from "./LockButton"; +import { LockElementButton } from "./LockElementButton"; import { MobileMenu } from "./MobileMenu"; import { PasteChartDialog } from "./PasteChartDialog"; import { Section } from "./Section"; @@ -63,6 +63,7 @@ import Scene from "../scene/Scene"; import { LaserPointerButton } from "./LaserPointerButton"; import { MagicSettings } from "./MagicSettings"; import { TTDDialog } from "./TTDDialog/TTDDialog"; +import { actionToggleElementLock } from "../actions"; interface LayerUIProps { actionManager: ActionManager; @@ -234,6 +235,15 @@ const LayerUI = ({ ); + const allElementsLocked = (elementsIds: string[]) => { + if (elementsIds.length === 0) { + return false; + } + return elements + .filter((element) => elementsIds.includes(element.id)) + .every((element) => element.locked); + }; + const renderFixedSideContainer = () => { const shouldRenderSelectedShapeActions = showSelectedShapeActions( appState, @@ -282,11 +292,29 @@ const LayerUI = ({ title={t("toolBar.penMode")} penDetected={appState.penDetected} /> + {/* + Removed: + */} + + actionManager.executeAction( + actionToggleElementLock, + ) + } + title={t("toolBar.lockElements")} + />
@@ -347,6 +375,7 @@ const LayerUI = ({ )} {renderTopRightUI?.(device.editor.isMobile, appState)} {!appState.viewModeEnabled && + !appState.hideLibraryButton && // hide button when sidebar docked (!isSidebarDocked || appState.openSidebar?.name !== DEFAULT_SIDEBAR.name) && ( diff --git a/packages/excalidraw/components/LockElementButton.tsx b/packages/excalidraw/components/LockElementButton.tsx new file mode 100644 index 000000000000..a4e3dc0de580 --- /dev/null +++ b/packages/excalidraw/components/LockElementButton.tsx @@ -0,0 +1,53 @@ +import "./ToolIcon.scss"; + +import clsx from "clsx"; +import { ToolButtonSize } from "./ToolButton"; +import { LockedIcon, UnlockedIcon } from "./icons"; + +type LockElementIconProps = { + title?: string; + name?: string; + checked: boolean; + disabled?: boolean; + onChange?(): void; + isMobile?: boolean; +}; + +const DEFAULT_SIZE: ToolButtonSize = "medium"; + +const ICONS = { + CHECKED: LockedIcon, + UNCHECKED: UnlockedIcon, +}; + +export const LockElementButton = (props: LockElementIconProps) => { + return ( + + ); +}; diff --git a/packages/excalidraw/components/ToolIcon.scss b/packages/excalidraw/components/ToolIcon.scss index dfba270b5bd5..48fc41ce93a0 100644 --- a/packages/excalidraw/components/ToolIcon.scss +++ b/packages/excalidraw/components/ToolIcon.scss @@ -17,7 +17,10 @@ @include toolbarButtonColorStates; } - + .ToolIcon.disabled { + cursor: default; + opacity: 0.5; + } .ToolIcon--plain { background-color: transparent; .ToolIcon__icon { diff --git a/packages/excalidraw/components/icons.tsx b/packages/excalidraw/components/icons.tsx index 02965c91dafe..84386659f6d4 100644 --- a/packages/excalidraw/components/icons.tsx +++ b/packages/excalidraw/components/icons.tsx @@ -592,6 +592,11 @@ export const zoomOut = createIcon( { width: 448, height: 512 }, ); +export const ZoomToFitIcon = createIcon( + "M17.3 5.3l-2.89 2.87 1.42 1.42L18.7 6.7 21 9V3h-6zM9 3H3v6l2.3-2.3 2.87 2.89 1.42-1.42L6.7 5.3zm-.83 11.41L5.3 17.3 3 15v6h6l-2.3-2.3 2.89-2.87zm7.66 0l-1.42 1.42 2.89 2.87L15 21h6v-6l-2.3 2.3z", + { width: 24, height: 24 }, +); + export const done = createIcon( "M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z", ); diff --git a/packages/excalidraw/data/types.ts b/packages/excalidraw/data/types.ts index 69112b6b6c5b..d4bb98ff02b0 100644 --- a/packages/excalidraw/data/types.ts +++ b/packages/excalidraw/data/types.ts @@ -42,6 +42,8 @@ export interface ImportedDataState { > > | null; scrollToContent?: boolean; + zoomToFit?: boolean; + hideLibraryButton?: boolean; libraryItems?: LibraryItems_anyVersion; files?: BinaryFiles; } diff --git a/packages/excalidraw/element/textWysiwyg.tsx b/packages/excalidraw/element/textWysiwyg.tsx index 7dfdbc615881..591158dc02d9 100644 --- a/packages/excalidraw/element/textWysiwyg.tsx +++ b/packages/excalidraw/element/textWysiwyg.tsx @@ -304,8 +304,8 @@ export const textWysiwyg = ({ updateWysiwygStyle(); if (onChange) { - editable.onpaste = async (event) => { - const clipboardData = await parseClipboard(event, true); + editable.onpaste = (event) => { + const clipboardData = parseClipboard(event, true); if (!clipboardData.text) { return; } diff --git a/packages/excalidraw/locales/en.json b/packages/excalidraw/locales/en.json index fb5b148d35b4..15488fd20f07 100644 --- a/packages/excalidraw/locales/en.json +++ b/packages/excalidraw/locales/en.json @@ -256,6 +256,8 @@ "text": "Text", "library": "Library", "lock": "Keep selected tool active after drawing", + "lockElements": "Toggle Lock for selected elements", + "zoomToFit": "Zoom to fit all elements", "penMode": "Pen mode - prevent touch", "link": "Add / Update link for a selected shape", "eraser": "Eraser", diff --git a/packages/excalidraw/package.json b/packages/excalidraw/package.json index d142bdd02b88..8a9c16d80dd5 100644 --- a/packages/excalidraw/package.json +++ b/packages/excalidraw/package.json @@ -1,6 +1,6 @@ { - "name": "@excalidraw/excalidraw", - "version": "0.17.1", + "name": "@alkemio/excalidraw", + "version": "0.17.6-alkemio-1", "main": "./dist/prod/index.js", "type": "module", "module": "./dist/prod/index.js", diff --git a/packages/excalidraw/tests/__snapshots__/contextmenu.test.tsx.snap b/packages/excalidraw/tests/__snapshots__/contextmenu.test.tsx.snap index fe869ab1fc37..45046c35f92c 100644 --- a/packages/excalidraw/tests/__snapshots__/contextmenu.test.tsx.snap +++ b/packages/excalidraw/tests/__snapshots__/contextmenu.test.tsx.snap @@ -838,6 +838,7 @@ exports[`contextMenu element > right-clicking on a group should select whole gro "frameToHighlight": null, "gridSize": null, "height": 100, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -1036,6 +1037,7 @@ exports[`contextMenu element > selecting 'Add to library' in context menu adds e "frameToHighlight": null, "gridSize": null, "height": 100, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -1244,6 +1246,7 @@ exports[`contextMenu element > selecting 'Bring forward' in context menu brings "frameToHighlight": null, "gridSize": null, "height": 100, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -1567,6 +1570,7 @@ exports[`contextMenu element > selecting 'Bring to front' in context menu brings "frameToHighlight": null, "gridSize": null, "height": 100, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -1890,6 +1894,7 @@ exports[`contextMenu element > selecting 'Copy styles' in context menu copies st "frameToHighlight": null, "gridSize": null, "height": 100, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -2098,6 +2103,7 @@ exports[`contextMenu element > selecting 'Delete' in context menu deletes elemen "frameToHighlight": null, "gridSize": null, "height": 100, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -2330,6 +2336,7 @@ exports[`contextMenu element > selecting 'Duplicate' in context menu duplicates "frameToHighlight": null, "gridSize": null, "height": 100, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -2623,6 +2630,7 @@ exports[`contextMenu element > selecting 'Group selection' in context menu group "frameToHighlight": null, "gridSize": null, "height": 100, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -2984,6 +2992,7 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s "frameToHighlight": null, "gridSize": null, "height": 100, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -3451,6 +3460,7 @@ exports[`contextMenu element > selecting 'Send backward' in context menu sends e "frameToHighlight": null, "gridSize": null, "height": 100, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -3766,6 +3776,7 @@ exports[`contextMenu element > selecting 'Send to back' in context menu sends el "frameToHighlight": null, "gridSize": null, "height": 100, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -4081,6 +4092,7 @@ exports[`contextMenu element > selecting 'Ungroup selection' in context menu ung "frameToHighlight": null, "gridSize": null, "height": 100, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -5265,6 +5277,7 @@ exports[`contextMenu element > shows 'Group selection' in context menu for multi "frameToHighlight": null, "gridSize": null, "height": 100, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -6390,6 +6403,7 @@ exports[`contextMenu element > shows 'Ungroup selection' in context menu for gro "frameToHighlight": null, "gridSize": null, "height": 100, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -7312,6 +7326,7 @@ exports[`contextMenu element > shows context menu for canvas > [end of test] app "frameToHighlight": null, "gridSize": null, "height": 100, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -8222,6 +8237,7 @@ exports[`contextMenu element > shows context menu for element > [end of test] ap "frameToHighlight": null, "gridSize": null, "height": 100, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -9114,6 +9130,7 @@ exports[`contextMenu element > shows context menu for element > [end of test] ap "frameToHighlight": null, "gridSize": null, "height": 100, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, diff --git a/packages/excalidraw/tests/__snapshots__/regressionTests.test.tsx.snap b/packages/excalidraw/tests/__snapshots__/regressionTests.test.tsx.snap index a1b238c639a1..7ebf2e54bc10 100644 --- a/packages/excalidraw/tests/__snapshots__/regressionTests.test.tsx.snap +++ b/packages/excalidraw/tests/__snapshots__/regressionTests.test.tsx.snap @@ -49,6 +49,7 @@ exports[`given element A and group of elements B and given both are selected whe "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -451,6 +452,7 @@ exports[`given element A and group of elements B and given both are selected whe "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -844,6 +846,7 @@ exports[`regression tests > Cmd/Ctrl-click exclusively select element under poin "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": false, "isLoading": false, "isResizing": false, @@ -1378,6 +1381,7 @@ exports[`regression tests > Drags selected element when hitting only bounding bo "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -1573,6 +1577,7 @@ exports[`regression tests > adjusts z order when grouping > [end of test] appSta "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -1935,6 +1940,7 @@ exports[`regression tests > alt-drag duplicates an element > [end of test] appSt "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -2164,6 +2170,7 @@ exports[`regression tests > arrow keys > [end of test] appState 1`] = ` "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -2333,6 +2340,7 @@ exports[`regression tests > can drag element that covers another element, while "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -2642,6 +2650,7 @@ exports[`regression tests > change the properties of a shape > [end of test] app "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -2877,6 +2886,7 @@ exports[`regression tests > click on an element and drag it > [dragged] appState "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -3109,6 +3119,7 @@ exports[`regression tests > click on an element and drag it > [end of test] appS "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -3328,6 +3339,7 @@ exports[`regression tests > click to select a shape > [end of test] appState 1`] "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -3573,6 +3585,7 @@ exports[`regression tests > click-drag to select a group > [end of test] appStat "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -3873,6 +3886,7 @@ exports[`regression tests > deleting last but one element in editing group shoul "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -4306,6 +4320,7 @@ exports[`regression tests > deselects group of selected elements on pointer down "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -4608,6 +4623,7 @@ exports[`regression tests > deselects group of selected elements on pointer up w "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -4880,6 +4896,7 @@ exports[`regression tests > deselects selected element on pointer down when poin "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -5079,6 +5096,7 @@ exports[`regression tests > deselects selected element, on pointer up, when clic "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -5267,6 +5285,7 @@ exports[`regression tests > double click to edit a group > [end of test] appStat "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -5638,6 +5657,7 @@ exports[`regression tests > drags selected elements from point inside common bou "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -5917,6 +5937,7 @@ exports[`regression tests > draw every type of shape > [end of test] appState 1` "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -6697,6 +6718,7 @@ exports[`regression tests > given a group of selected elements with an element t "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -7016,6 +7038,7 @@ exports[`regression tests > given a selected element A and a not selected elemen "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -7281,6 +7304,7 @@ exports[`regression tests > given selected element A with lower z-index than uns "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -7504,6 +7528,7 @@ exports[`regression tests > given selected element A with lower z-index than uns "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -7730,6 +7755,7 @@ exports[`regression tests > key 2 selects rectangle tool > [end of test] appStat "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -7899,6 +7925,7 @@ exports[`regression tests > key 3 selects diamond tool > [end of test] appState "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -8068,6 +8095,7 @@ exports[`regression tests > key 4 selects ellipse tool > [end of test] appState "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -8237,6 +8265,7 @@ exports[`regression tests > key 5 selects arrow tool > [end of test] appState 1` "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -8446,6 +8475,7 @@ exports[`regression tests > key 6 selects line tool > [end of test] appState 1`] "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -8655,6 +8685,7 @@ exports[`regression tests > key 7 selects freedraw tool > [end of test] appState "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -8838,6 +8869,7 @@ exports[`regression tests > key a selects arrow tool > [end of test] appState 1` "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -9047,6 +9079,7 @@ exports[`regression tests > key d selects diamond tool > [end of test] appState "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -9216,6 +9249,7 @@ exports[`regression tests > key l selects line tool > [end of test] appState 1`] "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -9425,6 +9459,7 @@ exports[`regression tests > key o selects ellipse tool > [end of test] appState "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -9594,6 +9629,7 @@ exports[`regression tests > key p selects freedraw tool > [end of test] appState "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -9777,6 +9813,7 @@ exports[`regression tests > key r selects rectangle tool > [end of test] appStat "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -9946,6 +9983,7 @@ exports[`regression tests > make a group and duplicate it > [end of test] appSta "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -10449,6 +10487,7 @@ exports[`regression tests > noop interaction after undo shouldn't create history "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -10715,6 +10754,7 @@ exports[`regression tests > pinch-to-zoom works > [end of test] appState 1`] = ` "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -10830,6 +10870,7 @@ exports[`regression tests > shift click on selected element should deselect it o "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -11018,6 +11059,7 @@ exports[`regression tests > shift-click to multiselect, then drag > [end of test "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -11318,6 +11360,7 @@ exports[`regression tests > should group elements and ungroup them > [end of tes "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -11719,6 +11762,7 @@ exports[`regression tests > single-clicking on a subgroup of a selected group sh "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -12321,6 +12365,7 @@ exports[`regression tests > spacebar + drag scrolls the canvas > [end of test] a "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -12439,6 +12484,7 @@ exports[`regression tests > supports nested groups > [end of test] appState 1`] "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -13040,6 +13086,7 @@ exports[`regression tests > switches from group of selected elements to another "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -13397,6 +13444,7 @@ exports[`regression tests > switches selected element on pointer down > [end of "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -13651,6 +13699,7 @@ exports[`regression tests > two-finger scroll works > [end of test] appState 1`] "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -13766,6 +13815,7 @@ exports[`regression tests > undo/redo drawing an element > [end of test] appStat "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -14133,6 +14183,7 @@ exports[`regression tests > updates fontSize & fontFamily appState > [end of tes "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, @@ -14248,6 +14299,7 @@ exports[`regression tests > zoom hotkeys > [end of test] appState 1`] = ` "frameToHighlight": null, "gridSize": null, "height": 768, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, diff --git a/packages/excalidraw/tests/packages/__snapshots__/utils.test.ts.snap b/packages/excalidraw/tests/packages/__snapshots__/utils.test.ts.snap index 610d97eb32b4..cc994b76b0a9 100644 --- a/packages/excalidraw/tests/packages/__snapshots__/utils.test.ts.snap +++ b/packages/excalidraw/tests/packages/__snapshots__/utils.test.ts.snap @@ -49,6 +49,7 @@ exports[`exportToSvg > with default arguments 1`] = ` }, "frameToHighlight": null, "gridSize": null, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, diff --git a/packages/excalidraw/tests/selection.test.tsx b/packages/excalidraw/tests/selection.test.tsx index 18e0dfe2a395..bc7428d679f9 100644 --- a/packages/excalidraw/tests/selection.test.tsx +++ b/packages/excalidraw/tests/selection.test.tsx @@ -476,21 +476,22 @@ describe("select single element on the scene", () => { }); }); -describe("tool locking & selection", () => { - it("should not select newly created element while tool is locked", async () => { - await render(); - - UI.clickTool("lock"); - expect(h.state.activeTool.locked).toBe(true); - - for (const { value } of Object.values(SHAPES)) { - if (value !== "image" && value !== "selection" && value !== "eraser") { - const element = UI.createElement(value); - expect(h.state.selectedElementIds[element.id]).not.toBe(true); - } - } - }); -}); +// This test makes no sense, we have removed the "Lock tool" functionality and now it's locking the selected elements +// describe("tool locking & selection", () => { +// it("should not select newly created element while tool is locked", async () => { +// await render(); + +// UI.clickTool("lock"); +// expect(h.state.activeTool.locked).toBe(true); + +// for (const { value } of Object.values(SHAPES)) { +// if (value !== "image" && value !== "selection" && value !== "eraser") { +// const element = UI.createElement(value); +// expect(h.state.selectedElementIds[element.id]).not.toBe(true); +// } +// } +// }); +// }); describe("selectedElementIds stability", () => { beforeEach(async () => { diff --git a/packages/excalidraw/types.ts b/packages/excalidraw/types.ts index 6f1eeebac974..85971c2e5181 100644 --- a/packages/excalidraw/types.ts +++ b/packages/excalidraw/types.ts @@ -321,6 +321,7 @@ export interface AppState { theme: Theme; gridSize: number | null; viewModeEnabled: boolean; + hideLibraryButton: boolean; /** top-most selected groups (i.e. does not include nested groups) */ selectedGroupIds: { [groupId: string]: boolean }; @@ -686,6 +687,7 @@ export interface ExcalidrawImperativeAPI { getFiles: () => InstanceType["files"]; getName: InstanceType["getName"]; scrollToContent: InstanceType["scrollToContent"]; + zoomToFit: InstanceType["zoomToFit"]; registerAction: (action: Action) => void; refresh: InstanceType["refresh"]; setToast: InstanceType["setToast"]; diff --git a/packages/utils/__snapshots__/utils.test.ts.snap b/packages/utils/__snapshots__/utils.test.ts.snap index fdcb71295c8d..29e989c53d43 100644 --- a/packages/utils/__snapshots__/utils.test.ts.snap +++ b/packages/utils/__snapshots__/utils.test.ts.snap @@ -49,6 +49,7 @@ exports[`exportToSvg > with default arguments 1`] = ` }, "frameToHighlight": null, "gridSize": null, + "hideLibraryButton": false, "isBindingEnabled": true, "isLoading": false, "isResizing": false, diff --git a/scripts/prerelease.js b/scripts/prerelease.js index 1641f99e1968..9f03e7ee0ff6 100644 --- a/scripts/prerelease.js +++ b/scripts/prerelease.js @@ -19,7 +19,7 @@ const prerelease = async (nextVersion) => { updatePackageVersion(nextVersion); await exec(`git add -u`); await exec( - `git commit -m "docs: release @excalidraw/excalidraw@${nextVersion} 🎉"`, + `git commit -m "docs: release @alkemio/excalidraw@${nextVersion} 🎉"`, ); console.info("Done!"); diff --git a/scripts/updateChangelog.js b/scripts/updateChangelog.js index b9291b711613..ac1d5357ae96 100644 --- a/scripts/updateChangelog.js +++ b/scripts/updateChangelog.js @@ -23,7 +23,7 @@ const headerForType = { const badCommits = []; const getCommitHashForLastVersion = async () => { try { - const commitMessage = `"release @excalidraw/excalidraw@${lastVersion}"`; + const commitMessage = `"release @alkemio/excalidraw@${lastVersion}"`; const { stdout } = await exec( `git log --format=format:"%H" --grep=${commitMessage}`, ); @@ -36,7 +36,7 @@ const getCommitHashForLastVersion = async () => { const getLibraryCommitsSinceLastRelease = async () => { const commitHash = await getCommitHashForLastVersion(); const { stdout } = await exec( - `git log --pretty=format:%s ${commitHash}...master`, + `git log --pretty=format:%s ${commitHash}...develop`, ); const commitsSinceLastRelease = stdout.split("\n"); const commitList = {};