mirror of
https://github.com/zadam/trilium.git
synced 2025-11-13 00:35:50 +01:00
chore(react/ribbon): fix size of attribute widget
This commit is contained in:
@@ -10,7 +10,7 @@ interface CKEditorOpts {
|
|||||||
disableNewlines?: boolean;
|
disableNewlines?: boolean;
|
||||||
disableSpellcheck?: boolean;
|
disableSpellcheck?: boolean;
|
||||||
onChange?: (newValue?: string) => void;
|
onChange?: (newValue?: string) => void;
|
||||||
onClick?: (e, pos?: ModelPosition | null) => void;
|
onClick?: (e: MouseEvent, pos?: ModelPosition | null) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function CKEditor({ currentValue, className, tabIndex, editor, config, disableNewlines, disableSpellcheck, onChange, onClick }: CKEditorOpts) {
|
export default function CKEditor({ currentValue, className, tabIndex, editor, config, disableNewlines, disableSpellcheck, onChange, onClick }: CKEditorOpts) {
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import FBlob from "../../entities/fblob";
|
|||||||
import NoteContextAwareWidget from "../note_context_aware_widget";
|
import NoteContextAwareWidget from "../note_context_aware_widget";
|
||||||
import { Ref, RefObject, VNode } from "preact";
|
import { Ref, RefObject, VNode } from "preact";
|
||||||
import { Tooltip } from "bootstrap";
|
import { Tooltip } from "bootstrap";
|
||||||
|
import { CSSProperties } from "preact/compat";
|
||||||
|
|
||||||
type TriliumEventHandler<T extends EventNames> = (data: EventData<T>) => void;
|
type TriliumEventHandler<T extends EventNames> = (data: EventData<T>) => void;
|
||||||
const registeredHandlers: Map<Component, Map<EventNames, TriliumEventHandler<any>[]>> = new Map();
|
const registeredHandlers: Map<Component, Map<EventNames, TriliumEventHandler<any>[]>> = new Map();
|
||||||
@@ -415,9 +416,10 @@ export function useNoteBlob(note: FNote | null | undefined): [ FBlob | null | un
|
|||||||
return [ blob ] as const;
|
return [ blob ] as const;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useLegacyWidget<T extends BasicWidget>(widgetFactory: () => T, { noteContext, containerClassName }: {
|
export function useLegacyWidget<T extends BasicWidget>(widgetFactory: () => T, { noteContext, containerClassName, containerStyle }: {
|
||||||
noteContext?: NoteContext;
|
noteContext?: NoteContext;
|
||||||
containerClassName?: string;
|
containerClassName?: string;
|
||||||
|
containerStyle?: CSSProperties;
|
||||||
} = {}): [VNode, T] {
|
} = {}): [VNode, T] {
|
||||||
const ref = useRef<HTMLDivElement>(null);
|
const ref = useRef<HTMLDivElement>(null);
|
||||||
const parentComponent = useContext(ParentComponent);
|
const parentComponent = useContext(ParentComponent);
|
||||||
@@ -454,7 +456,7 @@ export function useLegacyWidget<T extends BasicWidget>(widgetFactory: () => T, {
|
|||||||
}
|
}
|
||||||
}, [ noteContext ]);
|
}, [ noteContext ]);
|
||||||
|
|
||||||
return [ <div className={containerClassName} ref={ref} />, widget ]
|
return [ <div className={containerClassName} style={containerStyle} ref={ref} />, widget ]
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -331,4 +331,9 @@
|
|||||||
.attribute-list-editor p {
|
.attribute-list-editor p {
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.attribute-list .attr-detail {
|
||||||
|
contain: none;
|
||||||
|
}
|
||||||
|
|
||||||
/* #endregion */
|
/* #endregion */
|
||||||
Reference in New Issue
Block a user