Merge pull request #737 from buster-so/nate/report-hot-fix

Remove unused elements
This commit is contained in:
Nate Kelley 2025-08-21 15:38:55 -06:00 committed by GitHub
commit 111955042c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 57 additions and 63 deletions

View File

@ -156,28 +156,28 @@ export const menuGroups: MenuGroup[] = [
}
}))
},
{
group: MenuGroupLabels.media,
items: [
{
icon: <NodeTypeIcons.image />,
keywords: NodeTypeLabels.image?.keywords,
label: NodeTypeLabels.image.label,
value: KEYS.img
},
{
icon: <NodeTypeIcons.embed />,
keywords: NodeTypeLabels.embed?.keywords,
label: NodeTypeLabels.embed.label,
value: KEYS.mediaEmbed
}
].map((item) => ({
...item,
onSelect: (editor, value) => {
insertBlock(editor, value);
}
}))
},
// {
// group: MenuGroupLabels.media,
// items: [
// {
// icon: <NodeTypeIcons.image />,
// keywords: NodeTypeLabels.image?.keywords,
// label: NodeTypeLabels.image.label,
// value: KEYS.img
// },
// {
// icon: <NodeTypeIcons.embed />,
// keywords: NodeTypeLabels.embed?.keywords,
// label: NodeTypeLabels.embed.label,
// value: KEYS.mediaEmbed
// }
// ].map((item) => ({
// ...item,
// onSelect: (editor, value) => {
// insertBlock(editor, value);
// }
// }))
// },
{
group: MenuGroupLabels.advancedBlocks,
items: [
@ -192,14 +192,14 @@ export const menuGroups: MenuGroup[] = [
keywords: NodeTypeLabels.columnsThree.keywords,
label: NodeTypeLabels.columnsThree.label,
value: 'action_three_columns'
},
{
focusEditor: false,
icon: <NodeTypeIcons.equation />,
keywords: NodeTypeLabels.equation.keywords,
label: NodeTypeLabels.equation.label,
value: KEYS.equation
}
// {
// focusEditor: false,
// icon: <NodeTypeIcons.equation />,
// keywords: NodeTypeLabels.equation.keywords,
// label: NodeTypeLabels.equation.label,
// value: KEYS.equation
// }
].map((item) => ({
...item,
onSelect: (editor, value) => {
@ -210,26 +210,26 @@ export const menuGroups: MenuGroup[] = [
{
group: MenuGroupLabels.inline,
items: [
{
icon: <NodeTypeIcons.link />,
keywords: NodeTypeLabels.link?.keywords,
label: NodeTypeLabels.link.label,
value: KEYS.link
},
// {
// icon: <NodeTypeIcons.link />,
// keywords: NodeTypeLabels.link?.keywords,
// label: NodeTypeLabels.link.label,
// value: KEYS.link
// },
{
focusEditor: true,
icon: <NodeTypeIcons.calendar />,
keywords: NodeTypeLabels.date.keywords,
label: NodeTypeLabels.date.label,
value: KEYS.date
},
{
focusEditor: false,
icon: <NodeTypeIcons.equation />,
keywords: NodeTypeLabels.inlineEquation.keywords,
label: NodeTypeLabels.inlineEquation.label,
value: KEYS.inlineEquation
}
// {
// focusEditor: false,
// icon: <NodeTypeIcons.equation />,
// keywords: NodeTypeLabels.inlineEquation.keywords,
// label: NodeTypeLabels.inlineEquation.label,
// value: KEYS.inlineEquation
// }
].map((item) => ({
...item,
onSelect: (editor, value) => {

View File

@ -41,21 +41,21 @@ const insertBlockMap: Record<string, (editor: PlateEditor, type: string) => void
[KEYS.audio]: (editor) => insertAudioPlaceholder(editor, { select: true }),
[KEYS.callout]: (editor) => insertCallout(editor, { select: true }),
[KEYS.codeBlock]: (editor) => insertCodeBlock(editor, { select: true }),
[KEYS.equation]: (editor) => insertEquation(editor, { select: true }),
// [KEYS.equation]: (editor) => insertEquation(editor, { select: true }),
[KEYS.file]: (editor) => insertFilePlaceholder(editor, { select: true }),
[KEYS.img]: (editor) => insertImagePlaceholder(editor, { select: true }),
[KEYS.mediaEmbed]: (editor) =>
editor.tf.insertNodes(editor.api.create.block({ type: KEYS.mediaEmbed }), { select: true }),
[KEYS.table]: (editor) => editor.getTransforms(TablePlugin).insert.table({}, { select: true }),
// [KEYS.img]: (editor) => insertImagePlaceholder(editor, { select: true }),
// [KEYS.mediaEmbed]: (editor) =>
// editor.tf.insertNodes(editor.api.create.block({ type: KEYS.mediaEmbed }), { select: true }),
// [KEYS.table]: (editor) => editor.getTransforms(TablePlugin).insert.table({}, { select: true }),
[KEYS.toc]: (editor) => insertToc(editor, { select: true }),
[KEYS.video]: (editor) => insertVideoPlaceholder(editor, { select: true }),
[CUSTOM_KEYS.metric]: (editor) => insertMetric(editor, { select: true })
};
const insertInlineMap: Record<string, (editor: PlateEditor, type: string) => void> = {
[KEYS.date]: (editor) => insertDate(editor, { select: true }),
[KEYS.inlineEquation]: (editor) => insertInlineEquation(editor, '', { select: true }),
[KEYS.link]: (editor) => triggerFloatingLink(editor, { focused: true })
[KEYS.date]: (editor) => insertDate(editor, { select: true })
//[KEYS.inlineEquation]: (editor) => insertInlineEquation(editor, '', { select: true }),
// [KEYS.link]: (editor) => triggerFloatingLink(editor, { focused: true })
};
export const insertBlock = (editor: PlateEditor, type: string) => {

View File

@ -53,19 +53,13 @@ export const StreamContentPlugin = createPlatePlugin({
}
// Prevent undo/redo and defer normalization for performance
editor.tf.withScrolling(
() => {
editor.tf.withoutSaving(() => {
editor.tf.withoutNormalizing(() => {
const operations = buildUpdateOperations(editor, chunks);
executeOperations(operations);
});
});
},
{
scrollOptions: { behavior: 'smooth' }
}
);
editor.tf.withoutSaving(() => {
editor.tf.withoutNormalizing(() => {
const operations = buildUpdateOperations(editor, chunks);
executeOperations(operations);
});
});
}
}
}));