chore: merge
This commit is contained in:
@@ -58,6 +58,7 @@
|
||||
|
||||
.rich-text-link__url {
|
||||
@include formInput;
|
||||
padding-right: base(1.75);
|
||||
min-width: base(12);
|
||||
width: 100%;
|
||||
background: rgba($color-background-gray, .1);
|
||||
|
||||
@@ -69,6 +69,7 @@ const Link = ({ attributes, children, element }) => {
|
||||
}}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault();
|
||||
close();
|
||||
}
|
||||
}}
|
||||
|
||||
@@ -9,13 +9,21 @@ export const unwrapLink = (editor: Editor): void => {
|
||||
Transforms.unwrapNodes(editor, { match: (n) => Element.isElement(n) && n.type === 'link' });
|
||||
};
|
||||
|
||||
export const wrapLink = (editor: Editor, url?: string, newTab?: boolean): void => {
|
||||
export const wrapLink = (editor, url?: string, newTab?: boolean): void => {
|
||||
if (isLinkActive(editor)) {
|
||||
unwrapLink(editor);
|
||||
}
|
||||
|
||||
const { selection } = editor;
|
||||
const isCollapsed = selection && Range.isCollapsed(selection);
|
||||
const { selection, blurSelection } = editor;
|
||||
|
||||
if (blurSelection) {
|
||||
Transforms.select(editor, blurSelection);
|
||||
}
|
||||
|
||||
const selectionToUse = selection || blurSelection;
|
||||
|
||||
const isCollapsed = selectionToUse && Range.isCollapsed(selectionToUse);
|
||||
|
||||
const link = {
|
||||
type: 'link',
|
||||
url,
|
||||
|
||||
@@ -50,6 +50,12 @@ const EditView: React.FC<IndexProps> = (props) => {
|
||||
const state = await buildStateFromSchema(fields, json.doc);
|
||||
setInitialState(state);
|
||||
setSubmissionCount((count) => count + 1);
|
||||
|
||||
history.push({
|
||||
state: {
|
||||
data: json.doc,
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user