Virtual whiteboard for sketching hand-drawn like diagrams
feat: browse libraries styles fixed (#2694)
Benja Kugler7c3513b9df80
diff --git a/src/components/LayerUI.scss b/src/components/LayerUI.scssindex e4aa902982..494d3ba224 100644--- a/src/components/LayerUI.scss+++ b/src/components/LayerUI.scss@@ -7,11 +7,23 @@align-items: center;justify-content: center;- .browse-libraries {- position: absolute;- right: 12px;- top: 16px;- white-space: nowrap;+ .layer-ui__library-header {+ display: flex;+ align-items: center;+ width: 100%;+ margin: 2px 0;++ button {+ // 2px from the left to account for focus border of left-most button+ margin: 0 2px;+ }++ a {+ margin-left: auto;+ // 17px for scrollbar (needed for overlay scrollbars on Big Sur?) + 1px extra+ padding-right: 18px;+ white-space: nowrap;+ }}}diff --git a/src/components/LayerUI.tsx b/src/components/LayerUI.tsxindex ec3b17e910..5a806e829b 100644--- a/src/components/LayerUI.tsx+++ b/src/components/LayerUI.tsx@@ -124,9 +124,42 @@ const LibraryMenuItems = ({let addedPendingElements = false;rows.push(- <>+ <div className="layer-ui__library-header">+ <ToolButton+ key="import"+ type="button"+ title={t("buttons.load")}+ aria-label={t("buttons.load")}+ icon={load}+ onClick={() => {+ importLibraryFromJSON()+ .then(() => {+ // Maybe we should close and open the menu so that the items get updated.+ // But for now we just close the menu.+ setAppState({ isLibraryOpen: false });+ })+ .catch(muteFSAbortError)+ .catch((error) => {+ setAppState({ errorMessage: error.message });+ });+ }}+ />+ <ToolButton+ key="export"+ type="button"+ title={t("buttons.export")}+ aria-label={t("buttons.export")}+ icon={exportFile}+ onClick={() => {+ saveLibraryAsJSON()+ .catch(muteFSAbortError)+ .catch((error) => {+ setAppState({ errorMessage: error.message });+ });+ }}+ />+<a- className="browse-libraries"href="https://libraries.excalidraw.com"target="_excalidraw_libraries"onClick={() => {@@ -135,48 +168,7 @@ const LibraryMenuItems = ({>{t("labels.libraries")}</a>-- <Stack.Row- align="center"- gap={1}- key={"actions"}- style={{ padding: "2px" }}- >- <ToolButton- key="import"- type="button"- title={t("buttons.load")}- aria-label={t("buttons.load")}- icon={load}- onClick={() => {- importLibraryFromJSON()- .then(() => {- // Maybe we should close and open the menu so that the items get updated.- // But for now we just close the menu.- setAppState({ isLibraryOpen: false });- })- .catch(muteFSAbortError)- .catch((error) => {- setAppState({ errorMessage: error.message });- });- }}- />- <ToolButton- key="export"- type="button"- title={t("buttons.export")}- aria-label={t("buttons.export")}- icon={exportFile}- onClick={() => {- saveLibraryAsJSON()- .catch(muteFSAbortError)- .catch((error) => {- setAppState({ errorMessage: error.message });- });- }}- />- </Stack.Row>- </>,+ </div>,);for (let row = 0; row < numRows; row++) {