Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
refactor(client): import from `preact/compat` only what compat alone provides
Elian Doranefb7660c3904
diff --git a/apps/client/src/widgets/collections/board/card_toolbar.tsx b/apps/client/src/widgets/collections/board/card_toolbar.tsxindex 3d1fd0a6fb..a0e4336b3f 100644--- a/apps/client/src/widgets/collections/board/card_toolbar.tsx+++ b/apps/client/src/widgets/collections/board/card_toolbar.tsx@@ -1,8 +1,8 @@import "./card_toolbar.css";import clsx from "clsx";-import { type ComponentChildren, createContext } from "preact";-import { createPortal, useSyncExternalStore } from "preact/compat";+import { type ComponentChildren, createContext, createPortal } from "preact";+import { useSyncExternalStore } from "preact/compat";import { useCallback, useContext, useEffect, useRef, useState } from "preact/hooks";import { t } from "../../../services/i18n";diff --git a/apps/client/src/widgets/collections/board/group_by.tsx b/apps/client/src/widgets/collections/board/group_by.tsxindex 9ac918993b..c20eeda1b0 100644--- a/apps/client/src/widgets/collections/board/group_by.tsx+++ b/apps/client/src/widgets/collections/board/group_by.tsx@@ -1,6 +1,6 @@import { DEFAULT_BOARD_GROUP_BY, normalizeBoardGroupBy } from "@triliumnext/commons";-import { createPortal } from "preact/compat";+import { createPortal } from "preact";import { useCallback, useRef, useState } from "preact/hooks";import type FNote from "../../../entities/fnote";diff --git a/apps/client/src/widgets/collections/board/index.tsx b/apps/client/src/widgets/collections/board/index.tsxindex 576474544b..a7547b9e39 100644--- a/apps/client/src/widgets/collections/board/index.tsx+++ b/apps/client/src/widgets/collections/board/index.tsx@@ -3,10 +3,10 @@ import "./index.css";import clsx from "clsx";import {- ComponentChildren, createContext, Fragment, TargetedFocusEvent, TargetedKeyboardEvent,- TargetedMouseEvent, TargetedPointerEvent+ ComponentChildren, createContext, createPortal, Fragment, RefObject, TargetedFocusEvent,+ TargetedKeyboardEvent, TargetedMouseEvent, TargetedPointerEvent} from "preact";-import { createPortal, RefObject, useSyncExternalStore } from "preact/compat";+import { useSyncExternalStore } from "preact/compat";import {Dispatch, StateUpdater, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState} from "preact/hooks";diff --git a/apps/client/src/widgets/collections/table/index.tsx b/apps/client/src/widgets/collections/table/index.tsxindex 1ac37dbf74..d1a185a15f 100644--- a/apps/client/src/widgets/collections/table/index.tsx+++ b/apps/client/src/widgets/collections/table/index.tsx@@ -1,6 +1,6 @@import "./index.css";-import { createPortal } from "preact/compat";+import { createPortal } from "preact";import { useCallback, useContext, useEffect, useMemo, useRef, useState } from "preact/hooks";import { DataTreeModule, EditModule, FormatModule, FrozenColumnsModule, InteractionModule, MoveColumnsModule, MoveRowsModule, Options, PersistenceModule, ResizeColumnsModule, RowComponent,SortModule, Tabulator as VanillaTabulator} from 'tabulator-tables';diff --git a/apps/client/src/widgets/dialogs/about.tsx b/apps/client/src/widgets/dialogs/about.tsxindex e5e9891729..410478f03e 100644--- a/apps/client/src/widgets/dialogs/about.tsx+++ b/apps/client/src/widgets/dialogs/about.tsx@@ -3,7 +3,8 @@ import "./about.css";import type { AppInfo, Contributor, ContributorList } from "@triliumnext/commons";import clsx from "clsx";import type { ComponentChildren } from "preact";-import { memo,useMemo } from "preact/compat";+import { memo } from "preact/compat";+import { useMemo } from "preact/hooks";import { useCallback, useRef,useState } from "preact/hooks";import { Fragment } from "preact/jsx-runtime";import type React from "react";diff --git a/apps/client/src/widgets/dialogs/revisions.tsx b/apps/client/src/widgets/dialogs/revisions.tsxindex 894e9a3eb9..7afa15f2e5 100644--- a/apps/client/src/widgets/dialogs/revisions.tsx+++ b/apps/client/src/widgets/dialogs/revisions.tsx@@ -4,8 +4,7 @@ import { dayjs, type RevisionItem, type RevisionPojo, safeHostname, safeLinkPrevimport clsx from "clsx";import { diffWords } from "diff";import HtmlDiff from "htmldiff-js";-import { Fragment } from "preact";-import type { CSSProperties } from "preact/compat";+import { type CSSProperties, Fragment } from "preact";import { Dispatch, StateUpdater, useEffect, useRef, useState } from "preact/hooks";import appContext from "../../components/app_context";diff --git a/apps/client/src/widgets/layout/StatusBar.tsx b/apps/client/src/widgets/layout/StatusBar.tsxindex f2c2aac8ee..4a6885d421 100644--- a/apps/client/src/widgets/layout/StatusBar.tsx+++ b/apps/client/src/widgets/layout/StatusBar.tsx@@ -2,8 +2,7 @@ import "./StatusBar.css";import { Locale, NOTE_TYPE_ICONS, NoteType } from "@triliumnext/commons";import clsx from "clsx";-import { type ComponentChildren, RefObject } from "preact";-import { createPortal } from "preact/compat";+import { type ComponentChildren, createPortal, RefObject } from "preact";import { useCallback, useContext, useEffect, useMemo, useRef, useState } from "preact/hooks";import appContext, { CommandNames } from "../../components/app_context";diff --git a/apps/client/src/widgets/mobile_widgets/TabSwitcher.tsx b/apps/client/src/widgets/mobile_widgets/TabSwitcher.tsxindex 024f567ea4..57cf431f9f 100644--- a/apps/client/src/widgets/mobile_widgets/TabSwitcher.tsx+++ b/apps/client/src/widgets/mobile_widgets/TabSwitcher.tsx@@ -1,8 +1,7 @@import "./TabSwitcher.css";import clsx from "clsx";-import { ComponentChild } from "preact";-import { createPortal, Fragment } from "preact/compat";+import { ComponentChild, createPortal, Fragment } from "preact";import { useCallback, useEffect, useRef, useState } from "preact/hooks";import appContext, { CommandNames } from "../../components/app_context";diff --git a/apps/client/src/widgets/mobile_widgets/mobile_detail_menu.tsx b/apps/client/src/widgets/mobile_widgets/mobile_detail_menu.tsxindex e9e9136a88..be46fd908a 100644--- a/apps/client/src/widgets/mobile_widgets/mobile_detail_menu.tsx+++ b/apps/client/src/widgets/mobile_widgets/mobile_detail_menu.tsx@@ -1,6 +1,7 @@import "./mobile_detail_menu.css";-import { createPortal, useRef, useState } from "preact/compat";+import { createPortal } from "preact";+import { useRef, useState } from "preact/hooks";import FNote, { NotePathRecord } from "../../entities/fnote";import { t } from "../../services/i18n";diff --git a/apps/client/src/widgets/react/Alert.tsx b/apps/client/src/widgets/react/Alert.tsxindex 0dab00b4a1..9702422bb3 100644--- a/apps/client/src/widgets/react/Alert.tsx+++ b/apps/client/src/widgets/react/Alert.tsx@@ -1,5 +1,4 @@-import { ComponentChildren } from "preact";-import { CSSProperties } from "preact/compat";+import { ComponentChildren, CSSProperties } from "preact";interface AlertProps {type: "info" | "danger" | "warning";diff --git a/apps/client/src/widgets/react/CKEditor.tsx b/apps/client/src/widgets/react/CKEditor.tsxindex be95f5c316..07739ee95d 100644--- a/apps/client/src/widgets/react/CKEditor.tsx+++ b/apps/client/src/widgets/react/CKEditor.tsx@@ -1,7 +1,7 @@import type { CKTextEditor, AttributeEditor, EditorConfig, ModelPosition } from "@triliumnext/ckeditor5";import type { DISPLAYABLE_LOCALE_IDS } from "@triliumnext/commons";import { RefObject } from "preact";-import { useEffect, useImperativeHandle, useRef } from "preact/compat";+import { useEffect, useImperativeHandle, useRef } from "preact/hooks";export interface CKEditorApi {focus(): void;diff --git a/apps/client/src/widgets/react/Column.tsx b/apps/client/src/widgets/react/Column.tsxindex 8fd70bf389..3ce9678ad6 100644--- a/apps/client/src/widgets/react/Column.tsx+++ b/apps/client/src/widgets/react/Column.tsx@@ -1,5 +1,4 @@-import type { ComponentChildren } from "preact";-import { CSSProperties } from "preact/compat";+import type { ComponentChildren, CSSProperties } from "preact";interface ColumnProps {md?: number;diff --git a/apps/client/src/widgets/react/ContextualHelp.tsx b/apps/client/src/widgets/react/ContextualHelp.tsxindex 945a4dcefc..a114923f1e 100644--- a/apps/client/src/widgets/react/ContextualHelp.tsx+++ b/apps/client/src/widgets/react/ContextualHelp.tsx@@ -1,8 +1,7 @@import "./ContextualHelp.css";import { Tooltip } from "bootstrap";-import type { RefObject } from "preact";-import { createPortal } from "preact/compat";+import { createPortal, type RefObject } from "preact";import { useMemo, useRef, useState } from "preact/hooks";import { t } from "../../services/i18n";diff --git a/apps/client/src/widgets/react/Dropdown.tsx b/apps/client/src/widgets/react/Dropdown.tsxindex b636d2a5fd..74bb855bcc 100644--- a/apps/client/src/widgets/react/Dropdown.tsx+++ b/apps/client/src/widgets/react/Dropdown.tsx@@ -1,8 +1,9 @@import type { Placement } from "@floating-ui/dom";import type { Tooltip } from "bootstrap";import clsx from "clsx";-import { ButtonHTMLAttributes, ComponentChildren, RefObject } from "preact";-import { CSSProperties, HTMLProps } from "preact/compat";+import {+ ButtonHTMLAttributes, ComponentChildren, CSSProperties, HTMLAttributes, RefObject+} from "preact";import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "preact/hooks";import { isMobile, isNarrowLayout, onNarrowLayoutChange } from "../../services/utils";@@ -16,7 +17,7 @@ type DataAttributes = {[key: `data-${string}`]: string | number | boolean | undefined;};-export interface DropdownProps extends Pick<HTMLProps<HTMLDivElement>, "id" | "className"> {+export interface DropdownProps extends Pick<HTMLAttributes<HTMLDivElement>, "id" | "className"> {buttonClassName?: string;buttonProps?: Partial<ButtonHTMLAttributes<HTMLButtonElement> & DataAttributes>;children: ComponentChildren;diff --git a/apps/client/src/widgets/react/FormGroup.tsx b/apps/client/src/widgets/react/FormGroup.tsxindex 7ba466cb11..3035f4296e 100644--- a/apps/client/src/widgets/react/FormGroup.tsx+++ b/apps/client/src/widgets/react/FormGroup.tsx@@ -1,5 +1,4 @@-import { cloneElement, ComponentChildren, RefObject, VNode } from "preact";-import { CSSProperties } from "preact/compat";+import { cloneElement, ComponentChildren, CSSProperties, RefObject, VNode } from "preact";import { useUniqueName } from "./hooks";diff --git a/apps/client/src/widgets/react/FormList.tsx b/apps/client/src/widgets/react/FormList.tsxindex bb4ee83c29..ceaa92562a 100644--- a/apps/client/src/widgets/react/FormList.tsx+++ b/apps/client/src/widgets/react/FormList.tsx@@ -4,8 +4,8 @@ import { autoUpdate } from "@floating-ui/dom";import type { KeyboardActionNames } from "@triliumnext/commons";import type { Tooltip } from "bootstrap";import clsx from "clsx";-import { ComponentChildren, RefObject } from "preact";-import { createPortal, type CSSProperties, useContext, useLayoutEffect, useMemo, useRef } from "preact/compat";+import { ComponentChildren, createPortal, type CSSProperties, RefObject } from "preact";+import { useContext, useLayoutEffect, useMemo, useRef } from "preact/hooks";import { getActionSync } from "../../services/keyboard_actions";import { handleRightToLeftPlacement, isMobile, openInAppHelpFromUrl } from "../../services/utils";diff --git a/apps/client/src/widgets/react/FormSelect.tsx b/apps/client/src/widgets/react/FormSelect.tsxindex b8f10c1536..82fc01dde3 100644--- a/apps/client/src/widgets/react/FormSelect.tsx+++ b/apps/client/src/widgets/react/FormSelect.tsx@@ -1,5 +1,4 @@-import type { ComponentChildren } from "preact";-import { CSSProperties } from "preact/compat";+import type { ComponentChildren, CSSProperties } from "preact";type OnChangeListener = (newValue: string) => void;diff --git a/apps/client/src/widgets/react/FormTextArea.tsx b/apps/client/src/widgets/react/FormTextArea.tsxindex 47fa66fe05..66da43e43c 100644--- a/apps/client/src/widgets/react/FormTextArea.tsx+++ b/apps/client/src/widgets/react/FormTextArea.tsx@@ -1,4 +1,4 @@-import { RefObject, TextareaHTMLAttributes } from "preact/compat";+import { RefObject, TextareaHTMLAttributes } from "preact";interface FormTextAreaProps extends Omit<TextareaHTMLAttributes, "onBlur" | "onChange"> {id?: string;diff --git a/apps/client/src/widgets/react/FormTextBox.tsx b/apps/client/src/widgets/react/FormTextBox.tsxindex aec30921e2..2cc279dec8 100644--- a/apps/client/src/widgets/react/FormTextBox.tsx+++ b/apps/client/src/widgets/react/FormTextBox.tsx@@ -1,5 +1,5 @@-import type { AccessibleInputHTMLAttributes } from "preact";-import { useEffect, useRef, type InputHTMLAttributes, type RefObject } from "preact/compat";+import type { AccessibleInputHTMLAttributes, InputHTMLAttributes, RefObject } from "preact";+import { useEffect, useRef } from "preact/hooks";export interface FormTextBoxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "onBlur" | "value"> {id?: string;diff --git a/apps/client/src/widgets/react/HelpButton.tsx b/apps/client/src/widgets/react/HelpButton.tsxindex fb5e3c4dc0..c6f98ecf7e 100644--- a/apps/client/src/widgets/react/HelpButton.tsx+++ b/apps/client/src/widgets/react/HelpButton.tsx@@ -1,4 +1,4 @@-import { CSSProperties } from "preact/compat";+import { CSSProperties } from "preact";import { useContext } from "preact/hooks";import appContext from "../../components/app_context";diff --git a/apps/client/src/widgets/react/IconPicker.tsx b/apps/client/src/widgets/react/IconPicker.tsxindex d4e2289339..b19e450ddb 100644--- a/apps/client/src/widgets/react/IconPicker.tsx+++ b/apps/client/src/widgets/react/IconPicker.tsx@@ -3,8 +3,7 @@ import "./IconPicker.css";import { IconRegistry } from "@triliumnext/commons";import type { Tooltip } from "bootstrap";import clsx from "clsx";-import { CSSProperties } from "preact";-import { createPortal } from "preact/compat";+import { createPortal, CSSProperties } from "preact";import { useEffect, useMemo, useRef, useState } from "preact/hooks";import type React from "react";import { CellComponentProps, Grid } from "react-window";diff --git a/apps/client/src/widgets/react/IsolatedFrame.tsx b/apps/client/src/widgets/react/IsolatedFrame.tsxindex a6fe96dfaf..4735f458e6 100644--- a/apps/client/src/widgets/react/IsolatedFrame.tsx+++ b/apps/client/src/widgets/react/IsolatedFrame.tsx@@ -1,5 +1,4 @@-import { ComponentChildren } from "preact";-import { createPortal } from "preact/compat";+import { ComponentChildren, createPortal } from "preact";import { useLayoutEffect, useRef, useState } from "preact/hooks";import { useColorScheme } from "./hooks";diff --git a/apps/client/src/widgets/react/NoteAutocomplete.tsx b/apps/client/src/widgets/react/NoteAutocomplete.tsxindex 8917bcda0e..713c5db277 100644--- a/apps/client/src/widgets/react/NoteAutocomplete.tsx+++ b/apps/client/src/widgets/react/NoteAutocomplete.tsx@@ -4,8 +4,9 @@ import "./NoteAutocomplete.css";import type { ReferenceElement } from "@floating-ui/dom";import { NOTE_TYPE_ICONS } from "@triliumnext/commons";import clsx from "clsx";-import { type ComponentChildren, type RefObject, render, type VNode } from "preact";-import { createPortal, type CSSProperties } from "preact/compat";+import {+ type ComponentChildren, createPortal, type CSSProperties, type RefObject, render, type VNode+} from "preact";import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "preact/hooks";import appContext from "../../components/app_context";diff --git a/apps/client/src/widgets/react/NoteList.tsx b/apps/client/src/widgets/react/NoteList.tsxindex 9f8e585f7b..47ced37cc1 100644--- a/apps/client/src/widgets/react/NoteList.tsx+++ b/apps/client/src/widgets/react/NoteList.tsx@@ -1,4 +1,4 @@-import type { CSSProperties } from "preact/compat";+import type { CSSProperties } from "preact";import { useEffect, useState } from "preact/hooks";import type FNote from "../../entities/fnote";diff --git a/apps/client/src/widgets/react/Popover.tsx b/apps/client/src/widgets/react/Popover.tsxindex 90456845fc..f2300d6a82 100644--- a/apps/client/src/widgets/react/Popover.tsx+++ b/apps/client/src/widgets/react/Popover.tsx@@ -2,8 +2,7 @@ import "./Popover.css";import { autoUpdate, type Placement, type VirtualElement } from "@floating-ui/dom";import clsx from "clsx";-import { ComponentChildren } from "preact";-import { createPortal } from "preact/compat";+import { ComponentChildren, createPortal } from "preact";import { useEffect, useRef } from "preact/hooks";import { FLOATING_LAYER_SELECTOR, isWithinFloatingLayer } from "./floating_layers";diff --git a/apps/client/src/widgets/react/Popup.tsx b/apps/client/src/widgets/react/Popup.tsxindex 3eba1773eb..38c77f8ac8 100644--- a/apps/client/src/widgets/react/Popup.tsx+++ b/apps/client/src/widgets/react/Popup.tsx@@ -2,8 +2,9 @@ import "./Popup.css";import { arrow, autoUpdate, computePosition, flip, hide, offset, type OffsetOptions, type Placement, type ReferenceElement, shift, size } from "@floating-ui/dom";import clsx from "clsx";-import { type ComponentChildren, createContext, type HTMLAttributes, type Ref } from "preact";-import { createPortal } from "preact/compat";+import {+ type ComponentChildren, createContext, createPortal, type HTMLAttributes, type Ref+} from "preact";import { useCallback, useContext, useLayoutEffect, useMemo, useRef } from "preact/hooks";/**diff --git a/apps/client/src/widgets/react/PromotedAttributesCard.tsx b/apps/client/src/widgets/react/PromotedAttributesCard.tsxindex 5922d8ef8e..3ea55a412a 100644--- a/apps/client/src/widgets/react/PromotedAttributesCard.tsx+++ b/apps/client/src/widgets/react/PromotedAttributesCard.tsx@@ -1,6 +1,6 @@import "./PromotedAttributesCard.css";-import { createPortal } from "preact/compat";+import { createPortal } from "preact";import { useCallback, useMemo, useRef, useState } from "preact/hooks";import type FNote from "../../entities/fnote";diff --git a/apps/client/src/widgets/react/RawHtml.tsx b/apps/client/src/widgets/react/RawHtml.tsxindex 36d3872354..ddae8e3f16 100644--- a/apps/client/src/widgets/react/RawHtml.tsx+++ b/apps/client/src/widgets/react/RawHtml.tsx@@ -1,13 +1,13 @@import type { HighlightedTokenInfo } from "@triliumnext/commons";import DOMPurify from "dompurify";-import type { CSSProperties, HTMLProps, RefObject } from "preact/compat";+import type { CSSProperties, HTMLAttributes, RefObject } from "preact";import { useLayoutEffect, useRef } from "preact/hooks";import { useImperativeSearchHighlighlighting } from "./hooks";type HTMLElementLike = string | HTMLElement | JQuery<HTMLElement>;-interface RawHtmlProps extends Pick<HTMLProps<HTMLElement>, "tabindex" | "dir"> {+interface RawHtmlProps extends Pick<HTMLAttributes<HTMLElement>, "tabindex" | "dir"> {className?: string;html?: HTMLElementLike;style?: CSSProperties;diff --git a/apps/client/src/widgets/react/hooks.tsx b/apps/client/src/widgets/react/hooks.tsxindex a136905ea1..2c3b983dfa 100644--- a/apps/client/src/widgets/react/hooks.tsx+++ b/apps/client/src/widgets/react/hooks.tsx@@ -2,8 +2,8 @@ import type { CKTextEditor } from "@triliumnext/ckeditor5";import { FilterLabelsByType, HighlightedTokenInfo, KeyboardActionNames, NoteType, OptionNames, RelationNames } from "@triliumnext/commons";import { Tooltip } from "bootstrap";import Mark from "mark.js";-import { Ref, RefObject, VNode } from "preact";-import { CSSProperties, useSyncExternalStore } from "preact/compat";+import { CSSProperties, Ref, RefObject, VNode } from "preact";+import { useSyncExternalStore } from "preact/compat";import { useCallback, useContext, useDebugValue, useEffect, useLayoutEffect, useMemo, useRef, useState } from "preact/hooks";import appContext, { EventData, EventNames } from "../../components/app_context";diff --git a/apps/client/src/widgets/react/scroll_fade.ts b/apps/client/src/widgets/react/scroll_fade.tsindex d4953f8763..5f624f7942 100644--- a/apps/client/src/widgets/react/scroll_fade.ts+++ b/apps/client/src/widgets/react/scroll_fade.ts@@ -1,8 +1,7 @@import "./scroll_fade.css";import clsx from "clsx";-import { RefObject } from "preact";-import { CSSProperties } from "preact/compat";+import { CSSProperties, RefObject } from "preact";import { useCallback, useEffect, useRef, useState } from "preact/hooks";import { useTrackedElement } from "./hooks";diff --git a/apps/client/src/widgets/ribbon/BasicPropertiesTab.tsx b/apps/client/src/widgets/ribbon/BasicPropertiesTab.tsxindex c43c56481b..a73c2c74fa 100644--- a/apps/client/src/widgets/ribbon/BasicPropertiesTab.tsx+++ b/apps/client/src/widgets/ribbon/BasicPropertiesTab.tsx@@ -1,7 +1,7 @@import "./BasicPropertiesTab.css";import { MimeType, NoteType, ToggleInParentResponse } from "@triliumnext/commons";-import { createPortal } from "preact/compat";+import { createPortal } from "preact";import { Dispatch, StateUpdater, useCallback, useEffect, useMemo, useState } from "preact/hooks";import FNote from "../../entities/fnote";diff --git a/apps/client/src/widgets/ribbon/InheritedAttributesTab.tsx b/apps/client/src/widgets/ribbon/InheritedAttributesTab.tsxindex ace4b1eeba..cc55637ced 100644--- a/apps/client/src/widgets/ribbon/InheritedAttributesTab.tsx+++ b/apps/client/src/widgets/ribbon/InheritedAttributesTab.tsx@@ -1,6 +1,6 @@import "./InheritedAttributesTab.css";-import { createPortal } from "preact/compat";+import { createPortal } from "preact";import { useEffect, useRef, useState } from "preact/hooks";import FAttribute from "../../entities/fattribute";diff --git a/apps/client/src/widgets/ribbon/components/AttributeEditor.tsx b/apps/client/src/widgets/ribbon/components/AttributeEditor.tsxindex 92a1a93642..28ebe92566 100644--- a/apps/client/src/widgets/ribbon/components/AttributeEditor.tsx+++ b/apps/client/src/widgets/ribbon/components/AttributeEditor.tsx@@ -3,8 +3,7 @@ import "./AttributeEditor.css";import type { AttributeEditor as CKEditorAttributeEditor, ModelElement, ModelNode, ModelPosition, MentionHostedFeed } from "@triliumnext/ckeditor5";import { AttributeType } from "@triliumnext/commons";import clsx from "clsx";-import { RefObject } from "preact";-import { createPortal } from "preact/compat";+import { createPortal, RefObject } from "preact";import { useEffect, useImperativeHandle, useMemo, useRef, useState } from "preact/hooks";import type { CommandData, FilteredCommandNames } from "../../../components/app_context";diff --git a/apps/client/src/widgets/shortcut_hints/shortcut_hints_panel.tsx b/apps/client/src/widgets/shortcut_hints/shortcut_hints_panel.tsxindex e99d348e6e..725766915d 100644--- a/apps/client/src/widgets/shortcut_hints/shortcut_hints_panel.tsx+++ b/apps/client/src/widgets/shortcut_hints/shortcut_hints_panel.tsx@@ -3,7 +3,7 @@ import "./shortcut_hints_panel.css";import { autoUpdate } from "@floating-ui/dom";import clsx from "clsx";-import { createPortal } from "preact/compat";+import { createPortal } from "preact";import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "preact/hooks";import { t } from "../../services/i18n.js";diff --git a/apps/client/src/widgets/sidebar/AttributeList.tsx b/apps/client/src/widgets/sidebar/AttributeList.tsxindex 59bc137451..7b147a1912 100644--- a/apps/client/src/widgets/sidebar/AttributeList.tsx+++ b/apps/client/src/widgets/sidebar/AttributeList.tsx@@ -3,8 +3,7 @@ import "./AttributeList.css";import { promotedAttributeDefinitionParser } from "@triliumnext/commons";import clsx from "clsx";-import { ComponentChildren } from "preact";-import { createPortal } from "preact/compat";+import { ComponentChildren, createPortal } from "preact";import { useContext, useEffect, useRef, useState } from "preact/hooks";import FAttribute from "../../entities/fattribute";diff --git a/apps/client/src/widgets/type_widgets/llm_chat/retry_image.tsx b/apps/client/src/widgets/type_widgets/llm_chat/retry_image.tsxindex 75baba2a58..de293b86ac 100644--- a/apps/client/src/widgets/type_widgets/llm_chat/retry_image.tsx+++ b/apps/client/src/widgets/type_widgets/llm_chat/retry_image.tsx@@ -1,5 +1,4 @@-import type { AccessibleImgHTMLAttributes } from "preact";-import { type ImgHTMLAttributes } from "preact/compat";+import type { AccessibleImgHTMLAttributes, ImgHTMLAttributes } from "preact";import { useCallback, useEffect, useRef, useState } from "preact/hooks";/**diff --git a/apps/client/src/widgets/type_widgets/mind_map/MindMap.tsx b/apps/client/src/widgets/type_widgets/mind_map/MindMap.tsxindex d5e76745c4..17fa4f3ef3 100644--- a/apps/client/src/widgets/type_widgets/mind_map/MindMap.tsx+++ b/apps/client/src/widgets/type_widgets/mind_map/MindMap.tsx@@ -4,8 +4,7 @@ import "./MindMap.css";import { NOTE_TYPE_IMAGE_ATTACHMENTS } from "@triliumnext/commons";import { t } from "i18next";import { DARK_THEME, default as VanillaMindElixir, MindElixirData, MindElixirInstance, NodeObj, Operation, Theme, THEME as LIGHT_THEME } from "mind-elixir";-import { ComponentChildren, HTMLAttributes, RefObject } from "preact";-import { createPortal } from "preact/compat";+import { ComponentChildren, createPortal, HTMLAttributes, RefObject } from "preact";import { useCallback, useEffect, useRef, useState } from "preact/hooks";import { sanitizeNoteContentHtml } from "../../../services/sanitize_content";diff --git a/apps/client/src/widgets/type_widgets/options/appearance_fonts.tsx b/apps/client/src/widgets/type_widgets/options/appearance_fonts.tsxindex ef697f5345..382ea5ad33 100644--- a/apps/client/src/widgets/type_widgets/options/appearance_fonts.tsx+++ b/apps/client/src/widgets/type_widgets/options/appearance_fonts.tsx@@ -2,8 +2,7 @@ import "./appearance_fonts.css";import { customFontFamily, customFontNoteId, customFontOption, FontFamily, OptionNames, SYSTEM_MONOSPACE_FONT_STACK, SYSTEM_SANS_SERIF_FONT_STACK, UserFont } from "@triliumnext/commons";import clsx from "clsx";-import { ComponentChildren, Fragment } from "preact";-import { createPortal } from "preact/compat";+import { ComponentChildren, createPortal, Fragment } from "preact";import { useEffect, useMemo, useRef, useState } from "preact/hooks";import { Trans } from "react-i18next";diff --git a/apps/client/src/widgets/type_widgets/options/components/OptionsSection.tsx b/apps/client/src/widgets/type_widgets/options/components/OptionsSection.tsxindex fc0e3cf447..da4b5ed0a7 100644--- a/apps/client/src/widgets/type_widgets/options/components/OptionsSection.tsx+++ b/apps/client/src/widgets/type_widgets/options/components/OptionsSection.tsx@@ -1,7 +1,6 @@import "./OptionsSection.css";-import type { ComponentChildren } from "preact";-import { CSSProperties } from "preact/compat";+import type { ComponentChildren, CSSProperties } from "preact";import HelpButton from "../../../react/HelpButton";diff --git a/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsx b/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsxindex af591ae743..3b03ea3e89 100644--- a/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsx+++ b/apps/client/src/widgets/type_widgets/options/llm/AddProviderModal.tsx@@ -1,7 +1,7 @@import "./AddProviderModal.css";import type { LlmModelInfo } from "@triliumnext/commons";-import { createPortal } from "preact/compat";+import { createPortal } from "preact";import { useMemo, useState } from "preact/hooks";import { Trans } from "react-i18next";diff --git a/apps/client/src/widgets/type_widgets/options/password.tsx b/apps/client/src/widgets/type_widgets/options/password.tsxindex 242f1eb1e8..ca00e463f8 100644--- a/apps/client/src/widgets/type_widgets/options/password.tsx+++ b/apps/client/src/widgets/type_widgets/options/password.tsx@@ -1,7 +1,7 @@import "./password.css";import { ChangePasswordResponse, OAuthStatus, TOTPStatus } from "@triliumnext/commons";-import { createPortal } from "preact/compat";+import { createPortal } from "preact";import { useCallback, useEffect, useState } from "preact/hooks";import dialog from "../../../services/dialog";diff --git a/apps/client/src/widgets/type_widgets/options/text_notes.tsx b/apps/client/src/widgets/type_widgets/options/text_notes.tsxindex 9d3ea91777..fa14782814 100644--- a/apps/client/src/widgets/type_widgets/options/text_notes.tsx+++ b/apps/client/src/widgets/type_widgets/options/text_notes.tsx@@ -2,7 +2,7 @@ import "./text_notes.css";import { normalizeMimeTypeForCKEditor } from "@triliumnext/commons";import { getThemeVariant, Themes } from "@triliumnext/highlightjs";-import type { CSSProperties } from "preact/compat";+import type { CSSProperties } from "preact";import { useEffect, useMemo, useRef, useState } from "preact/hooks";import { isExperimentalFeatureEnabled } from "../../../services/experimental_features";diff --git a/apps/client/src/widgets/type_widgets/options/totp.tsx b/apps/client/src/widgets/type_widgets/options/totp.tsxindex 0223e68b5d..3941d348fe 100644--- a/apps/client/src/widgets/type_widgets/options/totp.tsx+++ b/apps/client/src/widgets/type_widgets/options/totp.tsx@@ -1,8 +1,7 @@import "./totp.css";import { TOTPEnableResponse, TOTPGenerate, TOTPRecoveryKeysResponse, TOTPStatus, TOTPVerifyResponse } from "@triliumnext/commons";-import { ComponentChildren, RefObject } from "preact";-import { createPortal } from "preact/compat";+import { ComponentChildren, createPortal, RefObject } from "preact";import { useCallback, useEffect, useMemo, useRef, useState } from "preact/hooks";import qrcode from "qrcode-generator";import { Trans } from "react-i18next";diff --git a/apps/client/src/widgets/type_widgets/relation_map/RelationMap.tsx b/apps/client/src/widgets/type_widgets/relation_map/RelationMap.tsxindex ee27497f28..31e035a040 100644--- a/apps/client/src/widgets/type_widgets/relation_map/RelationMap.tsx+++ b/apps/client/src/widgets/type_widgets/relation_map/RelationMap.tsx@@ -6,8 +6,7 @@ import { jsPlumbInstance, OnConnectionBindInfo } from "jsplumb";// handful of calls the map made when it was written and knows nothing of the rest — the ends of the// zoom range, or unsubscribing from a report.import panzoom, { PanZoom, PanZoomOptions } from "panzoom";-import { RefObject } from "preact";-import { HTMLProps } from "preact/compat";+import { HTMLAttributes, RefObject } from "preact";import { useCallback, useEffect, useMemo, useRef, useState } from "preact/hooks";import FNote from "../../../entities/fnote";@@ -377,7 +376,7 @@ function useNoteCreation({ ntxId, note, containerRef, mapApiRef }: {function useNoteDragging({ containerRef, mapApiRef }: {containerRef: RefObject<HTMLDivElement | null>;mapApiRef: RefObject<RelationMapApi | null>;-}): Pick<HTMLProps<HTMLDivElement>, "onDrop" | "onDragOver"> {+}): Pick<HTMLAttributes<HTMLDivElement>, "onDrop" | "onDragOver"> {const dragProps = useMemo(() => ({onDrop(ev: DragEvent) {const container = containerRef.current;diff --git a/apps/client/src/widgets/type_widgets/relation_map/jsplumb.tsx b/apps/client/src/widgets/type_widgets/relation_map/jsplumb.tsxindex 81d47fc7f4..12644224ad 100644--- a/apps/client/src/widgets/type_widgets/relation_map/jsplumb.tsx+++ b/apps/client/src/widgets/type_widgets/relation_map/jsplumb.tsx@@ -1,6 +1,5 @@import { jsPlumb, Defaults, jsPlumbInstance, DragOptions, OnConnectionBindInfo } from "jsplumb";-import { ComponentChildren, createContext, RefObject } from "preact";-import { HTMLProps } from "preact/compat";+import { ComponentChildren, createContext, HTMLAttributes, RefObject } from "preact";import { useContext, useEffect, useRef } from "preact/hooks";const JsPlumbInstance = createContext<RefObject<jsPlumbInstance | null> | undefined>(undefined);@@ -63,7 +62,7 @@ export function JsPlumbItem({ x, y, children, draggable, sourceConfig, targetCondraggable?: DragOptions;sourceConfig?: object;targetConfig?: object;-} & Pick<HTMLProps<HTMLDivElement>, "id" | "className" | "onContextMenu">) {+} & Pick<HTMLAttributes<HTMLDivElement>, "id" | "className" | "onContextMenu">) {const containerRef = useRef<HTMLDivElement>(null);const apiRef = useContext(JsPlumbInstance);diff --git a/apps/client/src/widgets/type_widgets/text/CKEditorWithWatchdog.tsx b/apps/client/src/widgets/type_widgets/text/CKEditorWithWatchdog.tsxindex 36c209acea..44f1bdfc73 100644--- a/apps/client/src/widgets/type_widgets/text/CKEditorWithWatchdog.tsx+++ b/apps/client/src/widgets/type_widgets/text/CKEditorWithWatchdog.tsx@@ -1,6 +1,7 @@import { CKTextEditor, ClassicEditor, EditorWatchdog, PopupEditor, SnippetDefinition, type WatchdogConfig } from "@triliumnext/ckeditor5";import { DISPLAYABLE_LOCALE_IDS } from "@triliumnext/commons";-import { HTMLProps, RefObject, useEffect, useImperativeHandle, useRef, useState } from "preact/compat";+import { HTMLAttributes, RefObject } from "preact";+import { useEffect, useImperativeHandle, useRef, useState } from "preact/hooks";import froca from "../../../services/froca";import link from "../../../services/link";@@ -41,7 +42,7 @@ export interface NotificationEventData {title: string;}-interface CKEditorWithWatchdogProps extends Pick<HTMLProps<HTMLDivElement>, "className" | "tabIndex"> {+interface CKEditorWithWatchdogProps extends Pick<HTMLAttributes<HTMLDivElement>, "className" | "tabIndex"> {contentLanguage: string | null | undefined;isClassicEditor?: boolean;watchdogRef: RefObject<EditorWatchdog | null>;diff --git a/apps/client/src/widgets/type_widgets/text/EditableText.tsx b/apps/client/src/widgets/type_widgets/text/EditableText.tsxindex 796a1f7057..5ebca5f7a9 100644--- a/apps/client/src/widgets/type_widgets/text/EditableText.tsx+++ b/apps/client/src/widgets/type_widgets/text/EditableText.tsx@@ -10,7 +10,7 @@ import {SnippetDefinition} from "@triliumnext/ckeditor5";import { deferred } from "@triliumnext/commons";-import { createPortal } from "preact/compat";+import { createPortal } from "preact";import { useCallback, useEffect, useRef, useState } from "preact/hooks";import appContext from "../../../components/app_context";