chore: bump toolchain & fix lint

This commit is contained in:
DarkSky
2026-05-24 06:47:17 +08:00
parent adfa51a372
commit 2aa56cbccd
39 changed files with 151 additions and 130 deletions
@@ -428,13 +428,8 @@ export class AIChatComposer extends SignalWatcher(
};
private readonly addSelectedContextChip = async () => {
const {
attachments = [],
snapshot,
combinedElementsMarkdown,
docs = [],
html,
} = this.chatContextValue;
const { attachments, snapshot, combinedElementsMarkdown, docs, html } =
this.chatContextValue;
await this.removeSelectedContextChip();
const chip: SelectedContextChip = {
uuid: uuidv4(),
@@ -23,7 +23,7 @@ export interface AIPanelErrorConfig {
}
export interface AIPanelGeneratingConfig {
generatingIcon: TemplateResult<1>;
generatingIcon?: TemplateResult<1>;
height?: number;
stages?: string[];
}
@@ -67,11 +67,14 @@ interface ErrorBaseProps {
buttons?: ReactElement[];
}
const DEFAULT_ICON = <FileIcon />;
const EMPTY_BUTTONS: ReactElement[] = [];
const ErrorBase = ({
title,
subtitle,
icon = <FileIcon />,
buttons = [],
icon = DEFAULT_ICON,
buttons = EMPTY_BUTTONS,
}: ErrorBaseProps) => {
return (
<div className={clsx([styles.viewer, styles.error])}>
@@ -20,8 +20,10 @@ import { AffineShapeIcon } from '..';
import { SelectorLayout } from '../selector/selector-layout';
import * as styles from './select-page.css';
const EMPTY_INIT: string[] = [];
export const SelectPage = memo(function SelectPage({
init = [],
init = EMPTY_INIT,
onConfirm,
onCancel,
onChange: propsOnChange,
@@ -48,6 +48,8 @@ import { DropEffect } from './drop-effect';
import * as styles from './node.css';
import type { NodeOperation } from './types';
const EMPTY_OPERATIONS: NodeOperation[] = [];
export type NavigationPanelTreeNodeDropEffectData = {
source: { data: AffineDNDData['draggable'] };
treeInstruction: DropTargetTreeInstruction | null;
@@ -190,9 +192,9 @@ export const NavigationPanelTreeNode = ({
collapsible = true,
canDrop,
reorderable = true,
operations = [],
operations = EMPTY_OPERATIONS,
postfix,
childrenOperations = [],
childrenOperations = EMPTY_OPERATIONS,
childrenPlaceholder,
linkComponent: LinkComponent = WorkbenchLink,
dndData,
@@ -4,9 +4,11 @@ import { NavigationPanelTreeContext } from './context';
import * as styles from './root.css';
import type { NodeOperation } from './types';
const EMPTY_OPERATIONS: NodeOperation[] = [];
export const NavigationPanelTreeRoot = ({
children,
childrenOperations = [],
childrenOperations = EMPTY_OPERATIONS,
placeholder,
}: {
children?: React.ReactNode;
@@ -1,4 +1,4 @@
export function BulledListIcon({ color = 'currentColor' }: { color: string }) {
export function BulledListIcon({ color = 'currentColor' }: { color?: string }) {
return (
<svg
width="16"
@@ -13,10 +13,12 @@ export interface AddItemPlaceholderProps extends HTMLAttributes<HTMLDivElement>
icon?: React.ReactNode;
}
const DEFAULT_ICON = <PlusIcon />;
export const AddItemPlaceholder = ({
onClick,
label = 'Add Item',
icon = <PlusIcon />,
icon = DEFAULT_ICON,
className,
...attrs
}: AddItemPlaceholderProps) => {
@@ -22,6 +22,8 @@ import * as styles from './node.css';
interface NavigationPanelTreeNodeProps extends BaseNavigationPanelTreeNodeProps {}
const EMPTY_OPERATIONS: BaseNavigationPanelTreeNodeProps['operations'] = [];
export const NavigationPanelTreeNode = ({
children,
icon: Icon,
@@ -33,9 +35,9 @@ export const NavigationPanelTreeNode = ({
collapsed,
extractEmojiAsIcon,
setCollapsed,
operations = [],
operations = EMPTY_OPERATIONS,
postfix,
childrenOperations = [],
childrenOperations = EMPTY_OPERATIONS,
childrenPlaceholder,
linkComponent: LinkComponent = WorkbenchLink,
...otherProps
@@ -6,9 +6,11 @@ import { useMemo, useState } from 'react';
import * as styles from './root.css';
const EMPTY_OPERATIONS: NodeOperation[] = [];
export const NavigationPanelTreeRoot = ({
children,
childrenOperations = [],
childrenOperations = EMPTY_OPERATIONS,
placeholder,
}: {
children?: React.ReactNode;
@@ -33,11 +33,13 @@ export interface SettingDropdownSelectProps<
native?: boolean;
}
const EMPTY_OPTIONS: DropdownItem<string>[] = [];
export const SettingDropdownSelect = <
V extends string = string,
E extends boolean | undefined = true,
>({
options = [],
options = EMPTY_OPTIONS as DropdownItem<V>[],
value,
emitValue = true,
onChange,
@@ -98,7 +100,7 @@ export const NativeSettingDropdownSelect = <
V extends string = string,
E extends boolean | undefined = true,
>({
options = [],
options = EMPTY_OPTIONS as DropdownItem<V>[],
value,
emitValue = true,
onChange,
@@ -85,7 +85,7 @@ const DatabaseBacklinkRow = ({
row$,
onChange,
}: {
defaultOpen: boolean;
defaultOpen?: boolean;
row$: Observable<DatabaseRow | undefined>;
onChange?: (
row: DatabaseRow,
@@ -20,10 +20,12 @@ import { HighlightText } from './highlight-text';
type Groups = { group?: QuickSearchGroup; items: QuickSearchItem[] }[];
const EMPTY_GROUPS: Groups = [];
export const CMDK = ({
className,
query,
groups: newGroups = [],
groups: newGroups = EMPTY_GROUPS,
error,
inputLabel,
placeholder,
@@ -3,7 +3,7 @@ import { Fragment, useMemo } from 'react';
import * as styles from './highlight-text.css';
type HighlightProps = {
text: string;
text?: string;
start: string;
end: string;
};