mirror of
https://github.com/open-webui/open-webui
synced 2024-11-22 08:07:55 +00:00
refac: styling
This commit is contained in:
parent
a3728e6957
commit
5e96922eba
@ -6,7 +6,8 @@
|
|||||||
info: 'bg-blue-500/20 text-blue-700 dark:text-blue-200 ',
|
info: 'bg-blue-500/20 text-blue-700 dark:text-blue-200 ',
|
||||||
success: 'bg-green-500/20 text-green-700 dark:text-green-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',
|
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>
|
</script>
|
||||||
|
|
||||||
|
@ -186,7 +186,13 @@
|
|||||||
'Mod-z': undo,
|
'Mod-z': undo,
|
||||||
'Mod-y': redo,
|
'Mod-y': redo,
|
||||||
Space: handleSpace,
|
Space: handleSpace,
|
||||||
Enter: chainCommands(
|
|
||||||
|
Enter: (state, dispatch, view) => {
|
||||||
|
if (shiftEnter) {
|
||||||
|
eventDispatch('submit');
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return chainCommands(
|
||||||
(state, dispatch, view) => {
|
(state, dispatch, view) => {
|
||||||
if (isEmptyListItem(state)) {
|
if (isEmptyListItem(state)) {
|
||||||
return exitList(state, dispatch);
|
return exitList(state, dispatch);
|
||||||
@ -200,7 +206,32 @@
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
baseKeymap.Enter
|
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:
|
// Prevent default tab navigation and provide indent/outdent behavior inside lists:
|
||||||
Tab: (state, dispatch, view) => {
|
Tab: (state, dispatch, view) => {
|
||||||
const { $from } = state.selection;
|
const { $from } = state.selection;
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
import Pencil from '../icons/Pencil.svelte';
|
import Pencil from '../icons/Pencil.svelte';
|
||||||
import DeleteConfirmDialog from '../common/ConfirmDialog.svelte';
|
import DeleteConfirmDialog from '../common/ConfirmDialog.svelte';
|
||||||
import ItemMenu from './Knowledge/ItemMenu.svelte';
|
import ItemMenu from './Knowledge/ItemMenu.svelte';
|
||||||
|
import Badge from '../common/Badge.svelte';
|
||||||
|
|
||||||
let query = '';
|
let query = '';
|
||||||
let selectedItem = null;
|
let selectedItem = null;
|
||||||
@ -167,20 +168,12 @@
|
|||||||
<div class="mt-5 flex justify-between">
|
<div class="mt-5 flex justify-between">
|
||||||
<div>
|
<div>
|
||||||
{#if item?.meta?.document}
|
{#if item?.meta?.document}
|
||||||
<div
|
<Badge type="mute" content={$i18n.t('Document')} />
|
||||||
class="bg-gray-500/20 text-gray-700 dark:text-gray-200 rounded uppercase text-xs font-bold px-1"
|
|
||||||
>
|
|
||||||
{$i18n.t('Document')}
|
|
||||||
</div>
|
|
||||||
{:else}
|
{:else}
|
||||||
<div
|
<Badge type="success" content={$i18n.t('Collection')} />
|
||||||
class="bg-green-500/20 text-green-700 dark:text-green-200 rounded uppercase text-xs font-bold px-1"
|
|
||||||
>
|
|
||||||
{$i18n.t('Collection')}
|
|
||||||
</div>
|
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div class=" text-xs text-gray-500">
|
<div class=" text-xs text-gray-500 line-clamp-1">
|
||||||
{$i18n.t('Updated')}
|
{$i18n.t('Updated')}
|
||||||
{dayjs(item.updated_at * 1000).fromNow()}
|
{dayjs(item.updated_at * 1000).fromNow()}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user