refac: styling

This commit is contained in:
Timothy J. Baek
2024-10-18 22:56:04 -07:00
parent a3728e6957
commit 5e96922eba
3 changed files with 52 additions and 27 deletions

View File

@@ -6,7 +6,8 @@
info: 'bg-blue-500/20 text-blue-700 dark:text-blue-200 ',
success: 'bg-green-500/20 text-green-700 dark:text-green-200',
warning: 'bg-yellow-500/20 text-yellow-700 dark:text-yellow-200',
error: 'bg-red-500/20 text-red-700 dark:text-red-200'
error: 'bg-red-500/20 text-red-700 dark:text-red-200',
mute: 'bg-gray-500/20 text-gray-700 dark:text-gray-200'
};
</script>

View File

@@ -186,21 +186,52 @@
'Mod-z': undo,
'Mod-y': redo,
Space: handleSpace,
Enter: chainCommands(
(state, dispatch, view) => {
if (isEmptyListItem(state)) {
return exitList(state, dispatch);
}
return false;
},
(state, dispatch, view) => {
if (isInList(state)) {
return splitListItem(schema.nodes.list_item)(state, dispatch);
}
return false;
},
baseKeymap.Enter
),
Enter: (state, dispatch, view) => {
if (shiftEnter) {
eventDispatch('submit');
return true;
}
return chainCommands(
(state, dispatch, view) => {
if (isEmptyListItem(state)) {
return exitList(state, dispatch);
}
return false;
},
(state, dispatch, view) => {
if (isInList(state)) {
return splitListItem(schema.nodes.list_item)(state, dispatch);
}
return false;
},
baseKeymap.Enter
)(state, dispatch, view);
},
'Shift-Enter': (state, dispatch, view) => {
if (shiftEnter) {
return chainCommands(
(state, dispatch, view) => {
if (isEmptyListItem(state)) {
return exitList(state, dispatch);
}
return false;
},
(state, dispatch, view) => {
if (isInList(state)) {
return splitListItem(schema.nodes.list_item)(state, dispatch);
}
return false;
},
baseKeymap.Enter
)(state, dispatch, view);
} else {
return baseKeymap.Enter(state, dispatch, view);
}
return false;
},
// Prevent default tab navigation and provide indent/outdent behavior inside lists:
Tab: (state, dispatch, view) => {
const { $from } = state.selection;