ttcMD: adds additional formatting to card to make an unstyled block

ttcMD components: tweaked the look of accordions to stack together properly
This commit is contained in:
2024-03-14 06:58:04 -06:00
parent 192479020d
commit 606a90b050
4 changed files with 31 additions and 11 deletions

View File

@@ -24,7 +24,9 @@ export const Accordion: FC<PropsWithChildren<IProps>> = (
className="flex justify-between cursor-pointer"
onClick={() => !expandOnHover && setOpen(!open)}
>
{title}
<div className="accordion-title">
{title}
</div>
<div
className={`
group-hover/hover:-rotate-180

View File

@@ -56,20 +56,22 @@ TokenIdentifiers.set("grid", {
});
TokenIdentifiers.set("card", {
rx: /\[{2}\n+([\s\S]*?)\n+\]{2}/g,
rx: /\[{2}([\s\S]*?)\n+\]{2}/g,
search(s, start, end) {
const rx = /\[\[/g;
const crx = /\]\]/g;
return search(s, start, end, rx, crx);
},
parse(s) {
const rx = /\[{2}\n+([\s\S]*)\n+\]{2}/;
const [_, content] = s.match(rx) || ["", "Unable to parse card"];
const rx = /\[{2}(!?)\n+([\s\S]*)\n+\]{2}/;
const [_, isBlock, content] = s.match(rx) || ["", "Unable to parse card"];
return {
content: content.trim(),
raw: s,
metadata: {},
metadata: {
isBlock,
},
type: "card",
uuid: crypto.randomUUID(),
};