Skip to content

Commit

Permalink
Merge pull request #268 from vivid-planet/rte-blockquote
Browse files Browse the repository at this point in the history
Rte blockquote
  • Loading branch information
rabengraph authored Dec 22, 2020
2 parents ec3ecca + 2601c39 commit d6b6fc9
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/comet-admin-rte/src/core/Controls/useBlockTypes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ const defaultDropdownFeatures = [
name: "header-six",
label: <FormattedMessage {...headerMessage} values={{ level: 6 }} />,
},
{
name: "blockquote",
label: <FormattedMessage id="cometAdmin.rte.controls.blockType.blockquote" defaultMessage="Blockquote" />,
},
];

const defaultListsFeatures = [
Expand Down Expand Up @@ -87,6 +91,8 @@ export default function useBlockTypes({ editorState, setEditorState, supportedTh
return supportedThings.includes("header-five");
case "header-six":
return supportedThings.includes("header-six");
case "blockquote":
return supportedThings.includes("blockquote");
default:
return false;
}
Expand Down
1 change: 1 addition & 0 deletions packages/comet-admin-rte/src/core/Rte.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export type SupportedThings =
| "header-six"
| "ordered-list"
| "unordered-list"
| "blockquote"
| "history"
| "link"
| "links-remove";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const removeUnsupportedBlockTypes: FilterEditorStateBeforeUpdateFn = (newState,
"header-four": "header-four",
"header-five": "header-five",
"header-six": "header-six",
blockquote: "blockquote",
"ordered-list": "ordered-list-item",
"unordered-list": "unordered-list-item",
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const rteOptions: IRteOptions = {
"header-four",
"header-five",
"header-six",
"blockquote",
"ordered-list",
"unordered-list",
"history",
Expand Down
9 changes: 9 additions & 0 deletions packages/comet-admin-stories/src/react-admin-rte/helper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,15 @@ export const exampleContent = {
entityRanges: [],
data: {},
},
{
key: "eggda",
text: "Blockquote",
type: "blockquote",
depth: 0,
inlineStyleRanges: [],
entityRanges: [],
data: {},
},
{
key: "2fi99",
text: "Überschrift Custom",
Expand Down

0 comments on commit d6b6fc9

Please sign in to comment.