|
@@ -1341,6 +1341,20 @@ const inputEvent = (element: Element, config: ISearchOption, inputTimeout: numbe
|
|
return inputTimeout;
|
|
return inputTimeout;
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+const getAttr =(block:IBlock) => {
|
|
|
|
+ let attrHTML = "";
|
|
|
|
+ if (block.name) {
|
|
|
|
+ attrHTML += `<span class="b3-list-item__meta fn__flex" style="max-width: 30%"><svg class="b3-list-item__hinticon"><use xlink:href="#iconN"></use></svg><span class="b3-list-item__hinttext">${block.name}</span></span>`;
|
|
|
|
+ }
|
|
|
|
+ if (block.alias) {
|
|
|
|
+ attrHTML += `<span class="b3-list-item__meta fn__flex" style="max-width: 30%"><svg class="b3-list-item__hinticon"><use xlink:href="#iconA"></use></svg><span class="b3-list-item__hinttext">${block.alias}</span></span>`;
|
|
|
|
+ }
|
|
|
|
+ if (block.memo) {
|
|
|
|
+ attrHTML += `<span class="b3-list-item__meta fn__flex" style="max-width: 30%"><svg class="b3-list-item__hinticon"><use xlink:href="#iconM"></use></svg><span class="b3-list-item__hinttext">${block.memo}</span></span>`;
|
|
|
|
+ }
|
|
|
|
+ return attrHTML;
|
|
|
|
+}
|
|
|
|
+
|
|
const onSearch = (data: IBlock[], edit: Protyle, element: Element, config: ISearchOption) => {
|
|
const onSearch = (data: IBlock[], edit: Protyle, element: Element, config: ISearchOption) => {
|
|
let resultHTML = "";
|
|
let resultHTML = "";
|
|
data.forEach((item, index) => {
|
|
data.forEach((item, index) => {
|
|
@@ -1351,13 +1365,14 @@ const onSearch = (data: IBlock[], edit: Protyle, element: Element, config: ISear
|
|
<svg class="b3-list-item__arrow b3-list-item__arrow--open"><use xlink:href="#iconRight"></use></svg>
|
|
<svg class="b3-list-item__arrow b3-list-item__arrow--open"><use xlink:href="#iconRight"></use></svg>
|
|
</span>
|
|
</span>
|
|
${unicode2Emoji(getNotebookIcon(item.box) || Constants.SIYUAN_IMAGE_NOTE, "b3-list-item__graphic", true)}
|
|
${unicode2Emoji(getNotebookIcon(item.box) || Constants.SIYUAN_IMAGE_NOTE, "b3-list-item__graphic", true)}
|
|
-<span class="b3-list-item__text ariaLabel" style="color: var(--b3-theme-on-surface)" aria-label="${escapeAttr(title)}">${escapeGreat(title)}</span>
|
|
|
|
|
|
+<span class="b3-list-item__text ariaLabel" style="color: var(--b3-theme-on-surface)" aria-label="${escapeAriaLabel(title)}">${escapeGreat(title)}</span>
|
|
</div><div>`;
|
|
</div><div>`;
|
|
item.children.forEach((childItem, childIndex) => {
|
|
item.children.forEach((childItem, childIndex) => {
|
|
resultHTML += `<div style="padding-left: 36px" data-type="search-item" class="b3-list-item${childIndex === 0 && index === 0 ? " b3-list-item--focus" : ""}" data-node-id="${childItem.id}" data-root-id="${childItem.rootID}">
|
|
resultHTML += `<div style="padding-left: 36px" data-type="search-item" class="b3-list-item${childIndex === 0 && index === 0 ? " b3-list-item--focus" : ""}" data-node-id="${childItem.id}" data-root-id="${childItem.rootID}">
|
|
<svg class="b3-list-item__graphic"><use xlink:href="#${getIconByType(childItem.type)}"></use></svg>
|
|
<svg class="b3-list-item__graphic"><use xlink:href="#${getIconByType(childItem.type)}"></use></svg>
|
|
${unicode2Emoji(childItem.ial.icon, "b3-list-item__graphic", true)}
|
|
${unicode2Emoji(childItem.ial.icon, "b3-list-item__graphic", true)}
|
|
<span class="b3-list-item__text">${childItem.content}</span>
|
|
<span class="b3-list-item__text">${childItem.content}</span>
|
|
|
|
+${getAttr(childItem)}
|
|
</div>`;
|
|
</div>`;
|
|
});
|
|
});
|
|
resultHTML += "</div>";
|
|
resultHTML += "</div>";
|
|
@@ -1366,6 +1381,7 @@ ${unicode2Emoji(childItem.ial.icon, "b3-list-item__graphic", true)}
|
|
<svg class="b3-list-item__graphic"><use xlink:href="#${getIconByType(item.type)}"></use></svg>
|
|
<svg class="b3-list-item__graphic"><use xlink:href="#${getIconByType(item.type)}"></use></svg>
|
|
${unicode2Emoji(item.ial.icon, "b3-list-item__graphic", true)}
|
|
${unicode2Emoji(item.ial.icon, "b3-list-item__graphic", true)}
|
|
<span class="b3-list-item__text">${item.content}</span>
|
|
<span class="b3-list-item__text">${item.content}</span>
|
|
|
|
+${getAttr(item)}
|
|
<span class="b3-list-item__meta b3-list-item__meta--ellipsis ariaLabel" aria-label="${escapeAriaLabel(title)}">${escapeGreat(title)}</span>
|
|
<span class="b3-list-item__meta b3-list-item__meta--ellipsis ariaLabel" aria-label="${escapeAriaLabel(title)}">${escapeGreat(title)}</span>
|
|
</div>`;
|
|
</div>`;
|
|
}
|
|
}
|