From 80e5f038778fddd420fdcaa8a9c1d5cdc0311e53 Mon Sep 17 00:00:00 2001 From: Triston Armstrong Date: Tue, 8 Oct 2024 01:34:29 -0400 Subject: [PATCH] get markdown working with existing notes cards --- bun.lockb | Bin 113992 -> 114724 bytes index.html | 5 ++++ package.json | 3 ++- .../MarkDownEditor/MarkDownEditor.tsx | 22 +++++++++++++++ src/components/MarkDownEditor/md.css | 3 +++ src/components/NoteCard.tsx | 25 +++++++----------- 6 files changed, 42 insertions(+), 16 deletions(-) create mode 100644 src/components/MarkDownEditor/MarkDownEditor.tsx create mode 100644 src/components/MarkDownEditor/md.css diff --git a/bun.lockb b/bun.lockb index 45ccfd5c794e664bebed3d86a92e3c84deb21978..dbb1abe2df37987ad8f701e3bb754fcfe37797d7 100755 GIT binary patch delta 20177 zcmeI4d0bUh_y6y{dew`fk{}`)g5nGc3aIEsOdPllpdrqRh>AIaR@wk&gOZlC&10il zS*B*0V`({MA!$ign$}a6l})DgR9a@=_c}xPd>^al`}+3#{q;RBKWFXF+G`JM@3r^Y z-0MAMKUaIAxcZXVR^?jvB^Ph$GXBDogO=`6 zF1cb$vm>H@Y;6&jYh3=sm>Z@SjK7DhV3(^ncX~ly%;Z8>>4Hv0^Q*dCjnPd+HbSP` zJPsKK4?;FUeqY7qx*A!5j6yz-j6iBz&bIT1*t`o;>We^zBd&0i^mraCLtAcM~Yz^WC$|UGALGd{x<mY-elG?~3OJ7vH7DZhYk07PuWeu$Y`AB+NoXXgXOoTI3#c#o7 zTwX&;gFmAexr4cq@&Uwx*#A{MR{0`VaSwt*dgN3zo!X^Cxdew)Jk*vqOv=xlgs1t1 zc{k=EzeFz{z0|~Nct*~wNio;u&H0d#5s%A|($VvgRvdnSlsFno@QJ<*9#TZ2Ag^%x zlr6ANp}}^=OQWrPf-$c!*X2q>FZS_B34l2{ zQ>V~R*BOX(s3m%-cVr8zo`&#IQlM%}D`SRCG}l=S$SbbHO-4W=#qK96k_r~IvML-` zkdsTuxPF6+KCQK7XC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EZ-i;LUZAAOL%8=WTO{rmI^C#F4^R}_7N8s^PyPW%x zkIxg*(_e`m;J4aiE062oegr`}5z_Wv^Ae zYkohonu;B2&%gVjk1-{!KVNhHtI=gu6xW_8oSBejP8-KfmHTOs=!)OIU;FmO{B7x4 zIA0Gbs(AO-3_lqRo?QMTs?{|NGzceS< ztduU7#bNd*N Kslab + diff --git a/package.json b/package.json index 079fc03..728dbae 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ "dependencies": { "@tauri-apps/api": "^1", "caniuse-lite": "^1.0.30001667", - "kaioken": "^0.32.1" + "kaioken": "^0.32.1", + "tiny-markdown-editor": "^0.1.26" }, "devDependencies": { "@tauri-apps/cli": "^1", diff --git a/src/components/MarkDownEditor/MarkDownEditor.tsx b/src/components/MarkDownEditor/MarkDownEditor.tsx new file mode 100644 index 0000000..95a9bc5 --- /dev/null +++ b/src/components/MarkDownEditor/MarkDownEditor.tsx @@ -0,0 +1,22 @@ +import { Editor } from 'tiny-markdown-editor' +import './md.css' +import { useEffect, useRef } from "kaioken" + +export function MarkDownEditor({ initial }: { initial: string }) { + const elRef = useRef(null) + + useEffect(() => { + if (!elRef.current) return + const editor = new Editor({ + element: elRef.current, + content: initial + }) + }, []) + + return ( +
+ ) +} diff --git a/src/components/MarkDownEditor/md.css b/src/components/MarkDownEditor/md.css new file mode 100644 index 0000000..c730965 --- /dev/null +++ b/src/components/MarkDownEditor/md.css @@ -0,0 +1,3 @@ +.TinyMDE { + @apply h-full bg-transparent overflow-y-scroll; +} diff --git a/src/components/NoteCard.tsx b/src/components/NoteCard.tsx index ab019ff..75eb98f 100644 --- a/src/components/NoteCard.tsx +++ b/src/components/NoteCard.tsx @@ -1,9 +1,12 @@ -import { signal, useRef } from "kaioken" + +import { signal, useEffect, useRef } from "kaioken" import { NotesSigal, focusedItem } from "../signals" import { useDebounce } from "../utils/useDebounce" import notes, { NoteCardType } from "../signals/notes" import { LayerEnum } from "../utils/enums" import { useThemeDetector } from "../utils/useThemeDetector" +import TinyMDE, { Editor } from 'tiny-markdown-editor' +import { MarkDownEditor } from "./MarkDownEditor/MarkDownEditor" namespace NoteCard { export interface NoteCardProps { @@ -21,6 +24,7 @@ export function NoteCard({ key: itemKey, data: item }: NoteCard.NoteCardProps) { const offsetY = useRef(0) const initialResizeX = useRef(0) const initialResizeY = useRef(0) + const el = useRef(null) const { debounce } = useDebounce() @@ -89,7 +93,7 @@ export function NoteCard({ key: itemKey, data: item }: NoteCard.NoteCardProps) { return (
focusedItem.value = itemKey} - className="text-[#333] dark:bg-[#111] dark:border-[#1c1c1c] bg-[#eee] select-none transition flex flex-col justify-stretch shadow-md rounded border border-[#ddd] absolute" + className="overflow-hidden text-[#333] dark:bg-[#111] dark:border-[#1c1c1c] bg-[#eee] select-none transition flex flex-col justify-stretch shadow-md rounded border border-[#ddd] absolute" style={{ zIndex: `${focusedItem.value == itemKey ? LayerEnum.CARD_ELEVATED : LayerEnum.CARD}`, width: `${item.dimensions.w}px`, @@ -98,7 +102,7 @@ export function NoteCard({ key: itemKey, data: item }: NoteCard.NoteCardProps) { left: `${item.position.x}px`, }} > -
+
x

-