From 979728e6c8c74ad755014f33711b999fb7f77642 Mon Sep 17 00:00:00 2001 From: Benjamin Toby Date: Thu, 2 Oct 2025 08:16:11 +0100 Subject: [PATCH] Updates --- bun.lockb | Bin components/lib/(partials)/ModalComponent.tsx | 4 +- .../lib/(partials)/PopoverComponent.tsx | 2 + components/lib/base.css | 2 + components/lib/editors/AceEditor.tsx | 10 +- components/lib/editors/TinyMCE/index.tsx | 7 +- components/lib/editors/TinyMCE/useTinyMCE.tsx | 3 +- components/lib/elements/Card.tsx | 2 +- components/lib/elements/CopySlug.tsx | 59 +++++++++++ .../lib/elements/HeaderNavLinkComponent.tsx | 4 +- components/lib/elements/LinkList.tsx | 3 +- components/lib/elements/Paper.tsx | 2 +- components/lib/elements/Search.tsx | 4 +- components/lib/elements/Tabs.tsx | 5 + components/lib/elements/Tag.tsx | 2 +- .../lib/elements/ai/AIPromptActionSection.tsx | 81 ++++++++++++++ components/lib/elements/ai/AIPromptBlock.tsx | 98 +++++++++++++++++ .../lib/elements/ai/AIPromptHistoryModal.tsx | 99 ++++++++++++++++++ .../lib/elements/ai/AIPromptPreview.tsx | 51 +++++++++ components/lib/form/Checkbox.tsx | 41 +++++--- components/lib/form/FileUpload.tsx | 44 ++++++-- components/lib/form/Input/index.tsx | 19 +++- components/lib/form/Radios.tsx | 79 ++++++++++++++ components/lib/form/SearchSelect.tsx | 93 ++++++++-------- components/lib/form/Select.tsx | 7 +- components/lib/hooks/useWebSocket.tsx | 5 +- .../lib/hooks/useWebSocketEventHandler.tsx | 5 +- components/lib/layout/Img.tsx | 31 ++++-- components/lib/mdx/mdx-components.tsx | 1 + components/pages/Home/(data)/work.ts | 32 +++++- 30 files changed, 695 insertions(+), 100 deletions(-) mode change 100755 => 100644 bun.lockb create mode 100644 components/lib/elements/CopySlug.tsx create mode 100644 components/lib/elements/ai/AIPromptActionSection.tsx create mode 100644 components/lib/elements/ai/AIPromptBlock.tsx create mode 100644 components/lib/elements/ai/AIPromptHistoryModal.tsx create mode 100644 components/lib/elements/ai/AIPromptPreview.tsx create mode 100644 components/lib/form/Radios.tsx diff --git a/bun.lockb b/bun.lockb old mode 100755 new mode 100644 diff --git a/components/lib/(partials)/ModalComponent.tsx b/components/lib/(partials)/ModalComponent.tsx index 0ac05fa..ff71a83 100644 --- a/components/lib/(partials)/ModalComponent.tsx +++ b/components/lib/(partials)/ModalComponent.tsx @@ -1,4 +1,4 @@ -import React, { DetailedHTMLProps, HTMLAttributes } from "react"; +import React from "react"; import { twMerge } from "tailwind-merge"; import ReactDOM from "react-dom"; import Button from "../layout/Button"; @@ -25,6 +25,8 @@ export default function ModalComponent({ open, setOpen, ...props }: Props) { "flex flex-col items-center justify-center p-4", "twui-modal-root" )} + role="dialog" + aria-modal="true" >
{/*
{ + try { + return JSON.stringify(JSON.parse(content), null, 4); + } catch (error) { + return content; + } + })(), placeholder: placeholder ? placeholder : "", enableBasicAutocompletion: true, enableLiveAutocompletion: true, @@ -108,7 +114,7 @@ export default function AceEditor({ return function () { editor.destroy(); }; - }, [refresh, darkMode, ready, externalRefresh]); + }, [refresh, darkMode, ready, externalRefresh, content]); React.useEffect(() => { const htmlClassName = document.documentElement.className; diff --git a/components/lib/editors/TinyMCE/index.tsx b/components/lib/editors/TinyMCE/index.tsx index 09ac948..7d8c7b1 100644 --- a/components/lib/editors/TinyMCE/index.tsx +++ b/components/lib/editors/TinyMCE/index.tsx @@ -84,7 +84,7 @@ export default function TinyMCEEditor({ if (defaultValue) editor.setContent(defaultValue); setReady(true); - editor.on("input", (e) => { + editor.on("change", (e) => { changeHandler?.(editor.getContent()); }); @@ -92,7 +92,7 @@ export default function TinyMCEEditor({ useParentStyles(editor); } }, - base_url: "https://datasquirel.com/tinymce-public", + base_url: "https://www.datasquirel.com/tinymce-public", body_class: "twui-tinymce", placeholder, relative_urls: true, @@ -118,6 +118,9 @@ export default function TinyMCEEditor({ "bg-background-light dark:bg-background-dark", wrapperWrapperProps?.className )} + onInput={(e) => { + console.log(`Input Detected`); + }} > {showLabel && (