Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

ui fixes

Ammar Ahmed7f7096fe0673
diff --git a/packages/editor/src/extensions/task-list/component.tsx b/packages/editor/src/extensions/task-list/component.tsx
index 0f5ca7e6c..5c503acb5 100644
--- a/packages/editor/src/extensions/task-list/component.tsx
+++ b/packages/editor/src/extensions/task-list/component.tsx
@@ -99,7 +99,7 @@ export function TaskListComponent(
sx={{
position: "relative",
bg: "bgSecondary",
- py: 1,
+ py: 2,
borderRadius: "default",
mb: 2,
alignItems: "center",
diff --git a/packages/editor/src/toolbar/components/counter.tsx b/packages/editor/src/toolbar/components/counter.tsx
index 14828a932..b3638a881 100644
--- a/packages/editor/src/toolbar/components/counter.tsx
+++ b/packages/editor/src/toolbar/components/counter.tsx
@@ -1,4 +1,5 @@
import { Flex, Text } from "rebass";
+import Button from "../../components/button";
import { ToolButton } from "./tool-button";
export type CounterProps = {
@@ -28,14 +29,22 @@ export function Counter(props: CounterProps) {
variant={"small"}
onClick={onDecrease}
/>
- <Text
- variant={"body"}
- sx={{ fontSize: "subBody", mx: 1, textAlign: "center" }}
- title={`Reset ${title}`}
+
+ <Button
+ sx={{
+ bg: "transparent",
+ }}
onClick={onReset}
>
- {value}
- </Text>
+ <Text
+ variant={"body"}
+ sx={{ fontSize: "subBody", mx: 1, textAlign: "center" }}
+ title={`Reset ${title}`}
+ >
+ {value}
+ </Text>
+ </Button>
+
<ToolButton
toggled={false}
title={`Increase ${title}`}
diff --git a/packages/editor/src/toolbar/components/dropdown.tsx b/packages/editor/src/toolbar/components/dropdown.tsx
index fc18b3492..81d05467a 100644
--- a/packages/editor/src/toolbar/components/dropdown.tsx
+++ b/packages/editor/src/toolbar/components/dropdown.tsx
@@ -21,7 +21,6 @@ export function Dropdown(props: DropdownProps) {
const toolbarLocation = useToolbarLocation();
const isMobile = useIsMobile();
const isBottom = toolbarLocation === "bottom";
-
return (
<>
<Button
@@ -76,9 +75,11 @@ export function Dropdown(props: DropdownProps) {
sx={{
minWidth: menuWidth,
maxWidth: isBottom ? "95vw" : "auto",
- p: isBottom ? 1 : 0,
flexDirection: isBottom ? "row" : "column",
overflowX: isBottom ? "auto" : "hidden",
+ marginRight: isBottom ? "10px" : 0,
+ display: "flex",
+ alignItems: isBottom ? "center" : "unset",
}}
/>
</>
diff --git a/packages/editor/src/toolbar/components/more-tools.tsx b/packages/editor/src/toolbar/components/more-tools.tsx
index 262a0aa24..acb3f22e3 100644
--- a/packages/editor/src/toolbar/components/more-tools.tsx
+++ b/packages/editor/src/toolbar/components/more-tools.tsx
@@ -47,7 +47,8 @@ export function MoreTools(props: MoreToolsProps) {
editor={editor}
sx={{
flex: 1,
- p: 1,
+ px: isBottom ? 0 : 1,
+ height: "50px",
boxShadow: "menu",
bg: "background",
borderRadius: "default",
diff --git a/packages/editor/src/toolbar/components/split-button.tsx b/packages/editor/src/toolbar/components/split-button.tsx
index efab204e3..77ce6b81e 100644
--- a/packages/editor/src/toolbar/components/split-button.tsx
+++ b/packages/editor/src/toolbar/components/split-button.tsx
@@ -1,5 +1,5 @@
import { PropsWithChildren, useRef, useState } from "react";
-import { Button, Flex } from "rebass";
+import { Flex } from "rebass";
import { Icons } from "../icons";
import { Icon } from "./icon";
import { ToolButton, ToolButtonProps } from "./tool-button";
@@ -9,6 +9,7 @@ import {
PopupWrapperProps,
} from "../../components/popup-presenter";
import { PositionOptions } from "../../utils/position";
+import Button from "../../components/button";
export type SplitButtonProps = ToolButtonProps & { onOpen: () => void };
export function SplitButton(props: PropsWithChildren<SplitButtonProps>) {
@@ -39,7 +40,6 @@ export function SplitButton(props: PropsWithChildren<SplitButtonProps>) {
},
}}
onClick={onOpen}
- onMouseDown={(e) => e.preventDefault()}
>
<Icon
path={
diff --git a/packages/editor/src/toolbar/icons.ts b/packages/editor/src/toolbar/icons.ts
index 4143424c5..4ab981e22 100644
--- a/packages/editor/src/toolbar/icons.ts
+++ b/packages/editor/src/toolbar/icons.ts
@@ -92,8 +92,12 @@ import {
mdiTableOff,
mdiRectangleOutline,
mdiRectangle,
+<<<<<<< HEAD
mdiImageEdit,
mdiImageEditOutline,
+=======
+ mdiArrowLeft,
+>>>>>>> 565b7be (ui fixes)
} from "@mdi/js";
export const Icons = {
@@ -178,6 +182,7 @@ export const Icons = {
chevronRight: mdiChevronRight,
chevronLeft: mdiChevronLeft,
circle: mdiCircle,
+ arrowLeft: mdiArrowLeft,
none: "",
};
diff --git a/packages/editor/src/toolbar/popups/color-picker.tsx b/packages/editor/src/toolbar/popups/color-picker.tsx
index eb2fd3f44..1c1c80db8 100644
--- a/packages/editor/src/toolbar/popups/color-picker.tsx
+++ b/packages/editor/src/toolbar/popups/color-picker.tsx
@@ -1,11 +1,11 @@
-import { Box, Button, Flex, Text } from "rebass";
+import { Box, Flex, Text } from "rebass";
import { Input } from "@rebass/forms";
import { Icon } from "../components/icon";
import { Icons } from "../icons";
import { useState } from "react";
import tinycolor from "tinycolor2";
import { HexColorPicker } from "react-colorful";
-
+import Button from "../../components/button";
export const DEFAULT_COLORS = [
"#e91e63",
"#9c27b0",
@@ -181,6 +181,11 @@ export function ColorPicker(props: ColorPickerProps) {
variant={"icon"}
sx={{ display: ["block", "none"], px: 2 }}
onClick={onClose}
+ onTouchStart={(e) => e.preventDefault()}
+ onTouchEnd={(e) => {
+ e.preventDefault();
+ onClose();
+ }}
>
<Icon path={Icons.close} size="big" />
</Button>
diff --git a/packages/editor/src/toolbar/popups/embed-popup.tsx b/packages/editor/src/toolbar/popups/embed-popup.tsx
index 4e071664d..e9eff0431 100644
--- a/packages/editor/src/toolbar/popups/embed-popup.tsx
+++ b/packages/editor/src/toolbar/popups/embed-popup.tsx
@@ -88,6 +88,7 @@ export function EmbedPopup(props: EmbedPopupProps) {
value={src}
autoFocus
onChange={(e) => setSrc(e.target.value)}
+ autoCapitalize="none"
sx={{ fontSize: "body" }}
/>
<Flex sx={{ alignItems: "center", mt: 1 }}>
@@ -133,6 +134,8 @@ export function EmbedPopup(props: EmbedPopupProps) {
alignSelf: ["stretch", "end", "end"],
my: 1,
mr: 1,
+ ml: [1, 0],
+ py: 2,
}}
onClick={() => {
setError(null);
diff --git a/packages/editor/src/toolbar/popups/image-upload.tsx b/packages/editor/src/toolbar/popups/image-upload.tsx
index 7e1c918b5..95d824b42 100644
--- a/packages/editor/src/toolbar/popups/image-upload.tsx
+++ b/packages/editor/src/toolbar/popups/image-upload.tsx
@@ -1,7 +1,8 @@
import { Input } from "@rebass/forms";
import { useState } from "react";
-import { Flex, Button } from "rebass";
+import { Flex } from "rebass";
import { ImageAttributes } from "../../extensions/image";
+import Button from "../../components/button";
import { Popup } from "../components/popup";
export type ImageUploadPopupProps = {
@@ -17,6 +18,9 @@ export function ImageUploadPopup(props: ImageUploadPopupProps) {
<Flex sx={{ p: 1, flexDirection: "column", width: ["auto", 250] }}>
<Input
type="url"
+ sx={{
+ height: "45px",
+ }}
autoFocus
placeholder="Paste Image URL here"
value={url}
@@ -27,7 +31,8 @@ export function ImageUploadPopup(props: ImageUploadPopupProps) {
sx={{
alignSelf: ["stretch", "end", "end"],
my: 1,
- mr: 1,
+ mr: [0, 1],
+ py: 2,
}}
onClick={async () => {
const response = await fetch(url);
diff --git a/packages/editor/src/toolbar/tools/block.tsx b/packages/editor/src/toolbar/tools/block.tsx
index d5bca03b5..c44003acd 100644
--- a/packages/editor/src/toolbar/tools/block.tsx
+++ b/packages/editor/src/toolbar/tools/block.tsx
@@ -6,7 +6,7 @@ import { IconNames, Icons } from "../icons";
import { useEffect, useMemo, useRef, useState } from "react";
import { Dropdown } from "../components/dropdown";
import { Icon } from "../components/icon";
-import { Box, Button, Flex, Text } from "rebass";
+import { Box, Flex, Text } from "rebass";
import { Popup } from "../components/popup";
import { EmbedPopup } from "../popups/embed-popup";
import { TablePopup } from "../popups/table-popup";
@@ -21,6 +21,7 @@ import { ActionSheetPresenter } from "../../components/action-sheet";
import { getToolbarElement } from "../utils/dom";
import { showPopup } from "../../components/popup-presenter";
import { ImageUploadPopup } from "../popups/image-upload";
+import Button from "../../components/button";
export function InsertBlock(props: ToolProps) {
const buttonRef = useRef<HTMLButtonElement | null>();
diff --git a/packages/editor/src/toolbar/tools/colors.tsx b/packages/editor/src/toolbar/tools/colors.tsx
index 3225f9575..3d57e4c13 100644
--- a/packages/editor/src/toolbar/tools/colors.tsx
+++ b/packages/editor/src/toolbar/tools/colors.tsx
@@ -1,19 +1,13 @@
-import { ToolProps } from "../types";
import { Editor } from "@tiptap/core";
-import { Box, Button, Flex, Text } from "rebass";
-import { Input } from "@rebass/forms";
-import { Icon } from "../components/icon";
-import { Icons } from "../icons";
-import { ToolButton } from "../components/tool-button";
-import { SplitButton } from "../components/split-button";
-import { useEffect, useRef, useState } from "react";
+import { useState } from "react";
import tinycolor from "tinycolor2";
-import { HexColorPicker, HexColorInput } from "react-colorful";
-import { getToolbarElement } from "../utils/dom";
-import { useToolbarLocation } from "../stores/toolbar-store";
-import { ColorPicker } from "../popups/color-picker";
-import { useEditorContext } from "../../components/popup-presenter/popuprenderer";
import { PopupWrapper } from "../../components/popup-presenter";
+import { useEditorContext } from "../../components/popup-presenter/popuprenderer";
+import { SplitButton } from "../components/split-button";
+import { ColorPicker } from "../popups/color-picker";
+import { useToolbarLocation } from "../stores/toolbar-store";
+import { ToolProps } from "../types";
+import { getToolbarElement } from "../utils/dom";
type ColorToolProps = ToolProps & {
onColorChange: (editor: Editor, color?: string) => void;
@@ -48,10 +42,15 @@ export function ColorTool(props: ColorToolProps) {
mr: 0,
bg: _isActive ? activeColor : "transparent",
":hover": {
- bg: _isActive ? tColor.darken(5).toRgbString() : "transparent",
+ bg:
+ _isActive && !isBottom
+ ? tColor.darken(5).toRgbString()
+ : "transparent",
},
}}
- onOpen={() => setIsOpen((s) => !s)}
+ onOpen={() => {
+ setIsOpen((s) => !s);
+ }}
toggled={isOpen}
>
<PopupWrapper
diff --git a/packages/editor/src/toolbar/tools/font.tsx b/packages/editor/src/toolbar/tools/font.tsx
index fa1de27bd..617808544 100644
--- a/packages/editor/src/toolbar/tools/font.tsx
+++ b/packages/editor/src/toolbar/tools/font.tsx
@@ -2,7 +2,7 @@ import { ToolProps } from "../types";
import { Dropdown } from "../components/dropdown";
import { MenuItem } from "../../components/menu/types";
import { Editor } from "@tiptap/core";
-import { useCallback } from "react";
+import { useCallback, useEffect } from "react";
import { Counter } from "../components/counter";
const defaultFontSizes = [
diff --git a/packages/editor/src/toolbar/tools/index.ts b/packages/editor/src/toolbar/tools/index.ts
index 41b599dec..528e0f4f9 100644
--- a/packages/editor/src/toolbar/tools/index.ts
+++ b/packages/editor/src/toolbar/tools/index.ts
@@ -74,6 +74,7 @@ const tools = {
rtl: RightToLeft,
textColor: TextColor,
highlight: Highlight,
+<<<<<<< HEAD
imageSettings: ImageSettings,
imageAlignCenter: ImageAlignCenter,
@@ -81,6 +82,8 @@ const tools = {
imageAlignRight: ImageAlignRight,
imageProperties: ImageProperties,
+=======
+>>>>>>> 565b7be (ui fixes)
tableSettings: TableSettings,
columnProperties: ColumnProperties,
rowProperties: RowProperties,