File tree Expand file tree Collapse file tree 3 files changed +14
-6
lines changed
src/json-crdt-peritext-ui/plugins/toolbar Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 11// biome-ignore lint: lint/style/useImportType
22import * as React from 'react' ;
3+ import { FormattingNewGeneric } from './FormattingNewGeneric' ;
34import type { EditProps } from '../../../types' ;
45
56export interface FormattingNewProps extends EditProps { }
67
78export const FormattingNew : React . FC < FormattingNewProps > = ( props ) => {
89 const Edit = props . formatting . behavior . data ( ) . Edit ;
910
10- return Edit ? < Edit isNew { ...props } /> : < div > new renderer not provided </ div > ;
11+ return Edit ? < Edit isNew { ...props } /> : < FormattingNewGeneric { ... props } / >;
1112} ;
Original file line number Diff line number Diff line change 1+ // biome-ignore lint: lint/style/useImportType
2+ import * as React from 'react' ;
3+ import type { EditProps } from '../../../types' ;
4+
5+ export interface FormattingNewGenericProps extends EditProps { }
6+
7+ export const FormattingNewGeneric : React . FC < FormattingNewGenericProps > = ( { formatting} ) => {
8+
9+ return (
10+ < div > Generic configurator</ div >
11+ ) ;
12+ } ;
Original file line number Diff line number Diff line change @@ -73,20 +73,15 @@ export class ToolbarState implements UiLifeCycles {
7373 // }
7474
7575 public startSliceConfig ( tag : SliceTypeCon | string | number , menu ?: MenuItem ) : NewFormatting | undefined {
76- console . log ( 1 ) ;
7776 const editor = this . txt . editor ;
7877 const behavior = editor . getRegistry ( ) . get ( tag ) ;
79- console . log ( 2 ) ;
8078 const range = editor . mainCursor ( ) ?. range ( ) ;
8179 if ( ! range ) return ;
82- console . log ( 3 ) ;
8380 const newSlice = this . newSlice ;
8481 if ( ! behavior ) {
85- console . log ( 4 ) ;
8682 newSlice . next ( void 0 ) ;
8783 return ;
8884 }
89- console . log ( 5 ) ;
9085 const formatting = new NewFormatting ( behavior , range , this ) ;
9186 newSlice . next ( formatting ) ;
9287 return formatting ;
You can’t perform that action at this time.
0 commit comments