From 71b627fbc7f0a4e07619e5e328cb7c358789d6f1 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 18 Aug 2025 09:34:16 +0300 Subject: [PATCH] feat(react/settings): port text formatting toolbar --- .../client/src/widgets/react/FormCheckbox.tsx | 7 +- .../src/widgets/react/FormRadioGroup.tsx | 16 +++-- apps/client/src/widgets/react/hooks.tsx | 14 +++- .../widgets/type_widgets/content_widget.tsx | 12 +--- .../type_widgets/options/appearance.tsx | 6 +- .../type_widgets/options/text_notes.tsx | 46 +++++++++++++ .../type_widgets/options/text_notes/editor.ts | 64 ------------------- 7 files changed, 80 insertions(+), 85 deletions(-) create mode 100644 apps/client/src/widgets/type_widgets/options/text_notes.tsx delete mode 100644 apps/client/src/widgets/type_widgets/options/text_notes/editor.ts diff --git a/apps/client/src/widgets/react/FormCheckbox.tsx b/apps/client/src/widgets/react/FormCheckbox.tsx index 4d6c2a384..f064e2e79 100644 --- a/apps/client/src/widgets/react/FormCheckbox.tsx +++ b/apps/client/src/widgets/react/FormCheckbox.tsx @@ -2,7 +2,7 @@ import { Tooltip } from "bootstrap"; import { useEffect, useRef, useMemo, useCallback } from "preact/hooks"; import { escapeQuotes } from "../../services/utils"; import { ComponentChildren } from "preact"; -import { memo } from "preact/compat"; +import { CSSProperties, memo } from "preact/compat"; interface FormCheckboxProps { name: string; @@ -14,9 +14,10 @@ interface FormCheckboxProps { currentValue: boolean; disabled?: boolean; onChange(newValue: boolean): void; + containerStyle?: CSSProperties; } -const FormCheckbox = memo(({ name, disabled, label, currentValue, onChange, hint }: FormCheckboxProps) => { +const FormCheckbox = memo(({ name, disabled, label, currentValue, onChange, hint, containerStyle }: FormCheckboxProps) => { const labelRef = useRef(null); // Fix: Move useEffect outside conditional @@ -46,7 +47,7 @@ const FormCheckbox = memo(({ name, disabled, label, currentValue, onChange, hint const titleText = useMemo(() => hint ? escapeQuotes(hint) : undefined, [hint]); return ( -
+