mirror of https://github.com/buster-so/buster.git
Merge pull request #737 from buster-so/nate/report-hot-fix
Remove unused elements
This commit is contained in:
commit
111955042c
|
@ -156,28 +156,28 @@ export const menuGroups: MenuGroup[] = [
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
group: MenuGroupLabels.media,
|
// group: MenuGroupLabels.media,
|
||||||
items: [
|
// items: [
|
||||||
{
|
// {
|
||||||
icon: <NodeTypeIcons.image />,
|
// icon: <NodeTypeIcons.image />,
|
||||||
keywords: NodeTypeLabels.image?.keywords,
|
// keywords: NodeTypeLabels.image?.keywords,
|
||||||
label: NodeTypeLabels.image.label,
|
// label: NodeTypeLabels.image.label,
|
||||||
value: KEYS.img
|
// value: KEYS.img
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
icon: <NodeTypeIcons.embed />,
|
// icon: <NodeTypeIcons.embed />,
|
||||||
keywords: NodeTypeLabels.embed?.keywords,
|
// keywords: NodeTypeLabels.embed?.keywords,
|
||||||
label: NodeTypeLabels.embed.label,
|
// label: NodeTypeLabels.embed.label,
|
||||||
value: KEYS.mediaEmbed
|
// value: KEYS.mediaEmbed
|
||||||
}
|
// }
|
||||||
].map((item) => ({
|
// ].map((item) => ({
|
||||||
...item,
|
// ...item,
|
||||||
onSelect: (editor, value) => {
|
// onSelect: (editor, value) => {
|
||||||
insertBlock(editor, value);
|
// insertBlock(editor, value);
|
||||||
}
|
// }
|
||||||
}))
|
// }))
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
group: MenuGroupLabels.advancedBlocks,
|
group: MenuGroupLabels.advancedBlocks,
|
||||||
items: [
|
items: [
|
||||||
|
@ -192,14 +192,14 @@ export const menuGroups: MenuGroup[] = [
|
||||||
keywords: NodeTypeLabels.columnsThree.keywords,
|
keywords: NodeTypeLabels.columnsThree.keywords,
|
||||||
label: NodeTypeLabels.columnsThree.label,
|
label: NodeTypeLabels.columnsThree.label,
|
||||||
value: 'action_three_columns'
|
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) => ({
|
].map((item) => ({
|
||||||
...item,
|
...item,
|
||||||
onSelect: (editor, value) => {
|
onSelect: (editor, value) => {
|
||||||
|
@ -210,26 +210,26 @@ export const menuGroups: MenuGroup[] = [
|
||||||
{
|
{
|
||||||
group: MenuGroupLabels.inline,
|
group: MenuGroupLabels.inline,
|
||||||
items: [
|
items: [
|
||||||
{
|
// {
|
||||||
icon: <NodeTypeIcons.link />,
|
// icon: <NodeTypeIcons.link />,
|
||||||
keywords: NodeTypeLabels.link?.keywords,
|
// keywords: NodeTypeLabels.link?.keywords,
|
||||||
label: NodeTypeLabels.link.label,
|
// label: NodeTypeLabels.link.label,
|
||||||
value: KEYS.link
|
// value: KEYS.link
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
focusEditor: true,
|
focusEditor: true,
|
||||||
icon: <NodeTypeIcons.calendar />,
|
icon: <NodeTypeIcons.calendar />,
|
||||||
keywords: NodeTypeLabels.date.keywords,
|
keywords: NodeTypeLabels.date.keywords,
|
||||||
label: NodeTypeLabels.date.label,
|
label: NodeTypeLabels.date.label,
|
||||||
value: KEYS.date
|
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) => ({
|
].map((item) => ({
|
||||||
...item,
|
...item,
|
||||||
onSelect: (editor, value) => {
|
onSelect: (editor, value) => {
|
||||||
|
|
|
@ -41,21 +41,21 @@ const insertBlockMap: Record<string, (editor: PlateEditor, type: string) => void
|
||||||
[KEYS.audio]: (editor) => insertAudioPlaceholder(editor, { select: true }),
|
[KEYS.audio]: (editor) => insertAudioPlaceholder(editor, { select: true }),
|
||||||
[KEYS.callout]: (editor) => insertCallout(editor, { select: true }),
|
[KEYS.callout]: (editor) => insertCallout(editor, { select: true }),
|
||||||
[KEYS.codeBlock]: (editor) => insertCodeBlock(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.file]: (editor) => insertFilePlaceholder(editor, { select: true }),
|
||||||
[KEYS.img]: (editor) => insertImagePlaceholder(editor, { select: true }),
|
// [KEYS.img]: (editor) => insertImagePlaceholder(editor, { select: true }),
|
||||||
[KEYS.mediaEmbed]: (editor) =>
|
// [KEYS.mediaEmbed]: (editor) =>
|
||||||
editor.tf.insertNodes(editor.api.create.block({ type: KEYS.mediaEmbed }), { select: true }),
|
// editor.tf.insertNodes(editor.api.create.block({ type: KEYS.mediaEmbed }), { select: true }),
|
||||||
[KEYS.table]: (editor) => editor.getTransforms(TablePlugin).insert.table({}, { select: true }),
|
// [KEYS.table]: (editor) => editor.getTransforms(TablePlugin).insert.table({}, { select: true }),
|
||||||
[KEYS.toc]: (editor) => insertToc(editor, { select: true }),
|
[KEYS.toc]: (editor) => insertToc(editor, { select: true }),
|
||||||
[KEYS.video]: (editor) => insertVideoPlaceholder(editor, { select: true }),
|
[KEYS.video]: (editor) => insertVideoPlaceholder(editor, { select: true }),
|
||||||
[CUSTOM_KEYS.metric]: (editor) => insertMetric(editor, { select: true })
|
[CUSTOM_KEYS.metric]: (editor) => insertMetric(editor, { select: true })
|
||||||
};
|
};
|
||||||
|
|
||||||
const insertInlineMap: Record<string, (editor: PlateEditor, type: string) => void> = {
|
const insertInlineMap: Record<string, (editor: PlateEditor, type: string) => void> = {
|
||||||
[KEYS.date]: (editor) => insertDate(editor, { select: true }),
|
[KEYS.date]: (editor) => insertDate(editor, { select: true })
|
||||||
[KEYS.inlineEquation]: (editor) => insertInlineEquation(editor, '', { select: true }),
|
//[KEYS.inlineEquation]: (editor) => insertInlineEquation(editor, '', { select: true }),
|
||||||
[KEYS.link]: (editor) => triggerFloatingLink(editor, { focused: true })
|
// [KEYS.link]: (editor) => triggerFloatingLink(editor, { focused: true })
|
||||||
};
|
};
|
||||||
|
|
||||||
export const insertBlock = (editor: PlateEditor, type: string) => {
|
export const insertBlock = (editor: PlateEditor, type: string) => {
|
||||||
|
|
|
@ -53,19 +53,13 @@ export const StreamContentPlugin = createPlatePlugin({
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent undo/redo and defer normalization for performance
|
// Prevent undo/redo and defer normalization for performance
|
||||||
editor.tf.withScrolling(
|
|
||||||
() => {
|
editor.tf.withoutSaving(() => {
|
||||||
editor.tf.withoutSaving(() => {
|
editor.tf.withoutNormalizing(() => {
|
||||||
editor.tf.withoutNormalizing(() => {
|
const operations = buildUpdateOperations(editor, chunks);
|
||||||
const operations = buildUpdateOperations(editor, chunks);
|
executeOperations(operations);
|
||||||
executeOperations(operations);
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
},
|
|
||||||
{
|
|
||||||
scrollOptions: { behavior: 'smooth' }
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
Loading…
Reference in New Issue