Skip to content

Commit

Permalink
add plugin entry in customize section
Browse files Browse the repository at this point in the history
  • Loading branch information
archie9211 committed Oct 9, 2023
1 parent dffc3d7 commit b83f555
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
19 changes: 18 additions & 1 deletion apps/www/src/config/customizer-items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { KEY_NODE_ID } from '@udecode/plate-node-id';
import { KEY_NORMALIZE_TYPES } from '@udecode/plate-normalizers';
import { ELEMENT_PARAGRAPH } from '@udecode/plate-paragraph';
import { KEY_RESET_NODE } from '@udecode/plate-reset-node';
import { KEY_SELECT_ON_BACKSPACE } from '@udecode/plate-select';
import { KEY_DELETE, KEY_SELECT_ON_BACKSPACE } from '@udecode/plate-select';
import { KEY_BLOCK_SELECTION } from '@udecode/plate-selection';
import { KEY_DESERIALIZE_CSV } from '@udecode/plate-serializer-csv';
import { KEY_DESERIALIZE_DOCX } from '@udecode/plate-serializer-docx';
Expand Down Expand Up @@ -957,6 +957,23 @@ export const customizerItems: Record<string, SettingPlugin> = {
badges: [customizerBadges.handler],
route: customizerPlugins.media.route,
},
[KEY_DELETE]: {
id: KEY_DELETE,
npmPackage: '@udecode/plate-select',
pluginFactory: 'createDeletePlugin',
pluginOptions: [
`options: {`,
` query: {`,
` allow: [`,
` // ELEMENT_IMAGE, ELEMENT_HR`,
` ],`,
` },`,
`},`,
],
label: 'Forward Delete Plugin',
badges: [customizerBadges.handler],
route: customizerPlugins.media.route,
},
[KEY_SINGLE_LINE]: {
id: KEY_SINGLE_LINE,
npmPackage: '@udecode/plate-break',
Expand Down
4 changes: 3 additions & 1 deletion apps/www/src/config/customizer-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { KEY_NODE_ID } from '@udecode/plate-node-id';
import { KEY_NORMALIZE_TYPES } from '@udecode/plate-normalizers';
import { ELEMENT_PARAGRAPH } from '@udecode/plate-paragraph';
import { KEY_RESET_NODE } from '@udecode/plate-reset-node';
import { KEY_SELECT_ON_BACKSPACE } from '@udecode/plate-select';
import { KEY_DELETE, KEY_SELECT_ON_BACKSPACE } from '@udecode/plate-select';
import { KEY_BLOCK_SELECTION } from '@udecode/plate-selection';
import { KEY_DESERIALIZE_CSV } from '@udecode/plate-serializer-csv';
import { KEY_DESERIALIZE_DOCX } from '@udecode/plate-serializer-docx';
Expand Down Expand Up @@ -117,6 +117,7 @@ export const customizerList = [
customizerItems[KEY_NORMALIZE_TYPES],
customizerItems[KEY_RESET_NODE],
customizerItems[KEY_SELECT_ON_BACKSPACE],
customizerItems[KEY_DELETE],
customizerItems[KEY_SINGLE_LINE],
customizerItems[KEY_SOFT_BREAK],
customizerItems[KEY_TABBABLE],
Expand Down Expand Up @@ -182,6 +183,7 @@ export const orderedPluginKeys = [
KEY_NORMALIZE_TYPES,
KEY_RESET_NODE,
KEY_SELECT_ON_BACKSPACE,
KEY_DELETE,
KEY_SINGLE_LINE,
KEY_SOFT_BREAK,
KEY_TABBABLE,
Expand Down
3 changes: 2 additions & 1 deletion apps/www/src/config/descriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { KEY_NODE_ID } from '@udecode/plate-node-id';
import { KEY_NORMALIZE_TYPES } from '@udecode/plate-normalizers';
import { ELEMENT_PARAGRAPH } from '@udecode/plate-paragraph';
import { KEY_RESET_NODE } from '@udecode/plate-reset-node';
import { KEY_SELECT_ON_BACKSPACE } from '@udecode/plate-select';
import { KEY_DELETE, KEY_SELECT_ON_BACKSPACE } from '@udecode/plate-select';
import { KEY_BLOCK_SELECTION } from '@udecode/plate-selection';
import { KEY_DESERIALIZE_CSV } from '@udecode/plate-serializer-csv';
import { KEY_DESERIALIZE_DOCX } from '@udecode/plate-serializer-docx';
Expand Down Expand Up @@ -94,6 +94,7 @@ export const descriptions: Record<string, string> = {
[KEY_RESET_NODE]: 'Reset the block type using rules.',
[KEY_SELECT_ON_BACKSPACE]:
'Select the preceding block instead of deleting when pressing backspace.',
[KEY_DELETE]: 'Enable forward delete plugin',
[KEY_SINGLE_LINE]: 'Restrict the editor to a single block.',
[KEY_SOFT_BREAK]:
'Insert line breaks within a block of text without starting a new block.',
Expand Down

0 comments on commit b83f555

Please sign in to comment.