diff --git a/biome.json b/biome.json index bc66183bb1..5d1595c84d 100644 --- a/biome.json +++ b/biome.json @@ -39,6 +39,9 @@ "noStaticOnlyClass": "off", "useOptionalChain": "off", "noUselessLabel": "off" + }, + "a11y": { + "noSvgWithoutTitle": "off" } } } diff --git a/src/json-crdt-extensions/peritext/editor/Editor.ts b/src/json-crdt-extensions/peritext/editor/Editor.ts index b402eb28e8..a63911b76d 100644 --- a/src/json-crdt-extensions/peritext/editor/Editor.ts +++ b/src/json-crdt-extensions/peritext/editor/Editor.ts @@ -123,7 +123,7 @@ export class Editor implements Printable { /** * Returns relative count of cursors (cardinality). - * + * * @returns 0 if there are no cursors, 1 if there is exactly one cursor, 2 if * there are more than one cursor. */ diff --git a/src/json-crdt-peritext-ui/__demos__/components/App.tsx b/src/json-crdt-peritext-ui/__demos__/components/App.tsx index 4f3168b87e..54287f61dc 100644 --- a/src/json-crdt-peritext-ui/__demos__/components/App.tsx +++ b/src/json-crdt-peritext-ui/__demos__/components/App.tsx @@ -17,7 +17,7 @@ export const App: React.FC = () => { peritext.refresh(); return [model, peritext] as const; }); - + const plugins = React.useMemo(() => { const cursorPlugin = new CursorPlugin(); const toolbarPlugin = new ToolbarPlugin(); diff --git a/src/json-crdt-peritext-ui/components/BasicButton/index.tsx b/src/json-crdt-peritext-ui/components/BasicButton/index.tsx index 6725e14320..2fcde05780 100644 --- a/src/json-crdt-peritext-ui/components/BasicButton/index.tsx +++ b/src/json-crdt-peritext-ui/components/BasicButton/index.tsx @@ -1,3 +1,4 @@ +// biome-ignore lint: React is used for JSX import * as React from 'react'; import {rule, lightTheme as theme, useRule, useTheme} from 'nano-theme'; import {Link} from 'nice-ui/lib/1-inline/Link'; @@ -75,8 +76,8 @@ export const BasicButton: React.FC = ({ const dynamicBlockClass = useRule(({g}) => ({ // col: g(0.2), // svg: { - // fill: g(0.5), - // col: g(0.5), + // fill: g(0.5), + // col: g(0.5), // }, '&:hover': { // col: g(0.2), diff --git a/src/json-crdt-peritext-ui/plugins/cursor/CursorPlugin.ts b/src/json-crdt-peritext-ui/plugins/cursor/CursorPlugin.ts index 487540ff80..549ebce314 100644 --- a/src/json-crdt-peritext-ui/plugins/cursor/CursorPlugin.ts +++ b/src/json-crdt-peritext-ui/plugins/cursor/CursorPlugin.ts @@ -17,5 +17,6 @@ export class CursorPlugin implements PeritextPlugin { public readonly focus: PeritextPlugin['focus'] = (props, children) => h(RenderFocus, props, children); public readonly anchor: PeritextPlugin['anchor'] = (props, children) => h(RenderAnchor, props, children); public readonly inline: PeritextPlugin['inline'] = (props, children) => h(RenderInline, props as any, children); - public readonly peritext: PeritextPlugin['peritext'] = (props, children, ctx) => h(RenderPeritext, {...props, children, ctx, plugin: this}); -}; + public readonly peritext: PeritextPlugin['peritext'] = (props, children, ctx) => + h(RenderPeritext, {...props, children, ctx, plugin: this}); +} diff --git a/src/json-crdt-peritext-ui/plugins/cursor/RenderPeritext.tsx b/src/json-crdt-peritext-ui/plugins/cursor/RenderPeritext.tsx index 71687e1ee5..2ea913c8a6 100644 --- a/src/json-crdt-peritext-ui/plugins/cursor/RenderPeritext.tsx +++ b/src/json-crdt-peritext-ui/plugins/cursor/RenderPeritext.tsx @@ -12,6 +12,7 @@ export interface RenderPeritextProps extends PeritextViewProps { } export const RenderPeritext: React.FC = ({ctx, plugin, children}) => { + // biome-ignore lint: explicit dependency handling const value: CursorPluginContextValue = React.useMemo( () => ({ ctx, diff --git a/src/json-crdt-peritext-ui/plugins/debug/DebugPlugin.tsx b/src/json-crdt-peritext-ui/plugins/debug/DebugPlugin.tsx index 4649ed88a5..387ed0c9b9 100644 --- a/src/json-crdt-peritext-ui/plugins/debug/DebugPlugin.tsx +++ b/src/json-crdt-peritext-ui/plugins/debug/DebugPlugin.tsx @@ -7,11 +7,15 @@ import type {PeritextPlugin} from '../../react/types'; export type DebugPluginOpts = Pick; export class DebugPlugin implements PeritextPlugin { - constructor (protected readonly opts: DebugPluginOpts = {}) {} + constructor(protected readonly opts: DebugPluginOpts = {}) {} - public readonly inline: PeritextPlugin['inline'] = (props, children) => {children}; + public readonly inline: PeritextPlugin['inline'] = (props, children) => ( + {children} + ); - public readonly block: PeritextPlugin['block'] = (props, children) => {children}; + public readonly block: PeritextPlugin['block'] = (props, children) => ( + {children} + ); public readonly peritext: PeritextPlugin['peritext'] = (props, children, ctx) => ( diff --git a/src/json-crdt-peritext-ui/plugins/toolbar/CaretToolbar/index.tsx b/src/json-crdt-peritext-ui/plugins/toolbar/CaretToolbar/index.tsx index b20a7d6385..0c348af3bd 100644 --- a/src/json-crdt-peritext-ui/plugins/toolbar/CaretToolbar/index.tsx +++ b/src/json-crdt-peritext-ui/plugins/toolbar/CaretToolbar/index.tsx @@ -18,23 +18,50 @@ const blockClass = rule({ an: introAnimation + ' .1s forwards', }); -export interface CaretToolbarProps {} +// biome-ignore lint: empty interface +export type CaretToolbarProps = {}; export const CaretToolbar: React.FC = () => { return ( {}}> - + + + {}}> - + + + {}}> - + + + {}}> - + + + diff --git a/src/json-crdt-peritext-ui/plugins/toolbar/RenderCaret.tsx b/src/json-crdt-peritext-ui/plugins/toolbar/RenderCaret.tsx index 4d97615bdf..0e4b3cd96f 100644 --- a/src/json-crdt-peritext-ui/plugins/toolbar/RenderCaret.tsx +++ b/src/json-crdt-peritext-ui/plugins/toolbar/RenderCaret.tsx @@ -1,3 +1,4 @@ +// biome-ignore lint: React is used for JSX import * as React from 'react'; import {rule} from 'nano-theme'; import {CaretToolbar} from './CaretToolbar'; diff --git a/src/json-crdt-peritext-ui/plugins/toolbar/ToolbarPlugin.ts b/src/json-crdt-peritext-ui/plugins/toolbar/ToolbarPlugin.ts index b6d01a7e51..83d7c73f41 100644 --- a/src/json-crdt-peritext-ui/plugins/toolbar/ToolbarPlugin.ts +++ b/src/json-crdt-peritext-ui/plugins/toolbar/ToolbarPlugin.ts @@ -10,12 +10,13 @@ const h = React.createElement; export class ToolbarPlugin implements PeritextPlugin { public readonly text: PeritextPlugin['text'] = text; - + public readonly inline: PeritextPlugin['inline'] = (props, children) => h(RenderInline, props as any, children); public readonly block: PeritextPlugin['block'] = (props, children) => h(RenderBlock, props as any, children); - public readonly peritext: PeritextPlugin['peritext'] = (props, children, ctx) => h(RenderPeritext, {...props, children, ctx}); + public readonly peritext: PeritextPlugin['peritext'] = (props, children, ctx) => + h(RenderPeritext, {...props, children, ctx}); public readonly caret: PeritextPlugin['caret'] = (props, children) => h(RenderCaret, props, children); -}; +}