feat: excalidraw integration (#214)

* update tiptap version

* excalidraw init

* cleanup

* better file handling and other fixes

* use different modal to fix excalidraw cursor position issue
* see https://github.com/excalidraw/excalidraw/issues/7312
* fix websocket in vite dev mode

* WIP

* add align attribute

* fix table

* menu icons

* Render image in excalidraw html
* add size to custom SVG components

* rewrite undefined font urls
This commit is contained in:
Philip Okugbe
2024-08-31 19:11:07 +01:00
committed by GitHub
parent 77b541ec71
commit 38e9eef2dc
26 changed files with 1440 additions and 799 deletions

View File

@@ -1,12 +1,13 @@
import React, { memo, useCallback, useEffect, useState } from "react";
import { Slider } from "@mantine/core";
import { memo, useCallback, useEffect, useState } from 'react';
import { Slider } from '@mantine/core';
export type ImageWidthProps = {
onChange: (value: number) => void;
value: number;
width?: string;
};
export const NodeWidthResize = memo(({ onChange, value }: ImageWidthProps) => {
export const NodeWidthResize = memo(({ onChange, value, width }: ImageWidthProps) => {
const [currentValue, setCurrentValue] = useState(value);
useEffect(() => {
@@ -17,16 +18,17 @@ export const NodeWidthResize = memo(({ onChange, value }: ImageWidthProps) => {
(newValue: number) => {
onChange(newValue);
},
[onChange],
[onChange]
);
return (
<Slider
p={"sm"}
p={'sm'}
min={10}
value={currentValue}
onChange={setCurrentValue}
onChangeEnd={handleChange}
w={width || 100}
label={(value) => `${value}%`}
/>
);