This commit is contained in:
Vanessa 2022-09-01 14:20:36 +08:00
parent a503df823f
commit 70b3b0fc3b
3 changed files with 11 additions and 3 deletions

View file

@ -36,6 +36,13 @@
top: 20px;
}
&__list .custom-icon {
height: 16px;
width: 16px;
float: left;
margin-top: 6px;
}
&__label {
cursor: pointer;
flex: 1;
@ -61,7 +68,6 @@
}
}
.protyle-search {
display: flex;
background-color: var(--b3-theme-surface);

View file

@ -12,6 +12,7 @@ import {getAllModels} from "../layout/getAll";
import {showMessage} from "../dialog/message";
import {focusByRange} from "../protyle/util/selection";
import {reloadProtyle} from "../protyle/util/reload";
import {unicode2Emoji} from "../emoji";
let protyle: Protyle;
export const openSearch = async (hotkey: string, key?: string, notebookId?: string, searchPath?: string) => {
@ -141,7 +142,7 @@ export const openSearch = async (hotkey: string, key?: string, notebookId?: stri
<svg class="svg ft__on-surface" id="searchFilter" style="height: 19px;float: left"><use xlink:href="#iconSettings"></use></svg>
</span>
</div>
<div id="searchList" style="position:relative;height:calc(50% - 69px);overflow: auto" class="b3-list b3-list--background"></div>
<div id="searchList" style="position:relative;height:calc(50% - 69px);overflow: auto" class="b3-list b3-list--background search__list"></div>
<div id="searchPreview" class="fn__flex-1 spread-search__preview"></div></div>
<div id="searchFilterPanel" class="fn__none spread-search__filter">
<label class="fn__flex">
@ -692,7 +693,7 @@ const onSearch = (data: IBlock[], dialog: Dialog) => {
const title = escapeHtml(getNotebookName(item.box)) + getDisplayName(item.hPath, false);
resultHTML += `<div data-type="search-item" class="b3-list-item${index === 0 ? " b3-list-item--focus" : ""}" data-node-id="${item.id}" data-root-id="${item.rootID}">
<svg class="b3-list-item__graphic"><use xlink:href="#${getIconByType(item.type)}"></use></svg>
<span class="b3-list-item__text">${item.content}</span>
<span class="b3-list-item__text">${unicode2Emoji(item.ial.icon)}${item.ial.icon ? "&nbsp;" : ""}${item.content}</span>
<span class="b3-list-item__meta b3-list-item__meta--ellipsis" title="${Lute.EscapeHTMLStr(title)}">${Lute.EscapeHTMLStr(title)}</span>
</div>`;
});

View file

@ -451,6 +451,7 @@ declare interface IBlock {
refs?: IBlock[];
children?: IBlock[]
length?: number
ial: IObject
}
declare interface IModels {