mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 09:00:12 +01:00
This commit is contained in:
parent
f95172353c
commit
fadd3f5b52
14 changed files with 56 additions and 24 deletions
|
|
@ -1,11 +1,9 @@
|
||||||
.layout {
|
.layout {
|
||||||
&__wnd--active {
|
&__wnd--active .layout-tab-bar .item--focus {
|
||||||
.layout-tab-bar .item--focus {
|
box-shadow: inset 0 -2px 0 0 var(--b3-theme-primary);
|
||||||
box-shadow: inset 0 -2px 0 0 var(--b3-theme-primary);
|
|
||||||
|
|
||||||
& > .item__text {
|
& > .item__text {
|
||||||
color: var(--b3-theme-on-background);
|
color: var(--b3-theme-on-background);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
top: 0;
|
top: 0;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
border-left: 1px solid var(--b3-theme-background-light);
|
border-left: 1px solid var(--b3-theme-background-light);
|
||||||
left: -55px;
|
left: -47px;
|
||||||
}
|
}
|
||||||
|
|
||||||
& > ul li:before {
|
& > ul li:before {
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,36 @@ body {
|
||||||
max-height: 100%;
|
max-height: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
&.body--blur .toolbar {
|
&.body--blur {
|
||||||
background: var(--b3-toolbar-blur-background);
|
.toolbar {
|
||||||
|
background: var(--b3-toolbar-blur-background);
|
||||||
|
}
|
||||||
|
|
||||||
|
.layout {
|
||||||
|
&__wnd--active .layout-tab-bar .item--focus {
|
||||||
|
box-shadow: inset 0 -2px 0 0 var(--b3-theme-background-light);
|
||||||
|
|
||||||
|
& > .item__text {
|
||||||
|
color: var(--b3-theme-on-surface);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__tab--active {
|
||||||
|
.b3-list--background .b3-list-item--focus:not(.dragover):not(.dragover__top):not(.dragover__bottom) {
|
||||||
|
background-color: var(--b3-list-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
.graph__svg,
|
||||||
|
.inbox__list {
|
||||||
|
background-color: var(--b3-theme-surface);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.dock__item--activefocus {
|
||||||
|
color: var(--b3-theme-on-surface-light) !important;
|
||||||
|
background-color: var(--b3-theme-background-light) !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.body--win32 {
|
&.body--win32 {
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ export const openSetting = () => {
|
||||||
content: `<div class="fn__flex-column" style="border-radius: 4px;overflow: hidden;position: relative">
|
content: `<div class="fn__flex-column" style="border-radius: 4px;overflow: hidden;position: relative">
|
||||||
<div class="b3-form__icon search__header"><svg class="b3-form__icon-icon"><use xlink:href="#iconSearch"></use></svg><input class="b3-text-field b3-text-field--text fn__block b3-form__icon-input"></div>
|
<div class="b3-form__icon search__header"><svg class="b3-form__icon-icon"><use xlink:href="#iconSearch"></use></svg><input class="b3-text-field b3-text-field--text fn__block b3-form__icon-input"></div>
|
||||||
<div class="fn__flex-1 fn__flex">
|
<div class="fn__flex-1 fn__flex">
|
||||||
<ul class="b3-tab-bar b3-list b3-list--background" style="user-select:none;width: 180px;height:${height}px;overflow: auto">
|
<ul class="b3-tab-bar b3-list b3-list--background" style="user-select:none;width: 180px;height:${height}px;overflow: auto;padding: 8px 0;box-sizing: border-box">
|
||||||
<li data-name="editor" class="b3-list-item--focus b3-list-item b3-list-item--big"><svg class="b3-list-item__graphic"><use xlink:href="#iconEdit"></use></svg>${window.siyuan.languages.editor}</li>
|
<li data-name="editor" class="b3-list-item--focus b3-list-item b3-list-item--big"><svg class="b3-list-item__graphic"><use xlink:href="#iconEdit"></use></svg>${window.siyuan.languages.editor}</li>
|
||||||
<li data-name="filetree" class="b3-list-item b3-list-item--big"><svg class="b3-list-item__graphic"><use xlink:href="#iconFiles"></use></svg>${window.siyuan.languages.fileTree}</li>
|
<li data-name="filetree" class="b3-list-item b3-list-item--big"><svg class="b3-list-item__graphic"><use xlink:href="#iconFiles"></use></svg>${window.siyuan.languages.fileTree}</li>
|
||||||
<li data-name="image" class="b3-list-item b3-list-item--big"><svg class="b3-list-item__graphic"><use xlink:href="#iconImage"></use></svg>${window.siyuan.languages.assets}</li>
|
<li data-name="image" class="b3-list-item b3-list-item--big"><svg class="b3-list-item__graphic"><use xlink:href="#iconImage"></use></svg>${window.siyuan.languages.assets}</li>
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ export class Bookmark extends Model {
|
||||||
<span class="fn__space"></span>
|
<span class="fn__space"></span>
|
||||||
<span data-type="min" class="block__icon b3-tooltips b3-tooltips__sw" aria-label="${window.siyuan.languages.min} ${updateHotkeyTip(window.siyuan.config.keymap.general.closeTab.custom)}"><svg><use xlink:href='#iconMin'></use></svg></span>
|
<span data-type="min" class="block__icon b3-tooltips b3-tooltips__sw" aria-label="${window.siyuan.languages.min} ${updateHotkeyTip(window.siyuan.config.keymap.general.closeTab.custom)}"><svg><use xlink:href='#iconMin'></use></svg></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="fn__flex-1"></div>`;
|
<div class="fn__flex-1" style="margin-bottom: 8px"></div>`;
|
||||||
this.tree = new Tree({
|
this.tree = new Tree({
|
||||||
element: this.element.lastElementChild as HTMLElement,
|
element: this.element.lastElementChild as HTMLElement,
|
||||||
data: null,
|
data: null,
|
||||||
|
|
|
||||||
|
|
@ -285,7 +285,7 @@ ${(Lute.New()).MarkdownStr("", data.shorthandContent)}
|
||||||
if (response.data.data.shorthands.length === 0) {
|
if (response.data.data.shorthands.length === 0) {
|
||||||
html = '<ul class="b3-list b3-list--background"><li class="b3-list--empty">打开帮助文档搜索 <b>收集箱</b> 查看使用说明</li></ul>';
|
html = '<ul class="b3-list b3-list--background"><li class="b3-list--empty">打开帮助文档搜索 <b>收集箱</b> 查看使用说明</li></ul>';
|
||||||
} else {
|
} else {
|
||||||
html = "<ul class=\"b3-list b3-list--background\">";
|
html = '<ul style="padding: 8px 0" class="b3-list b3-list--background">';
|
||||||
response.data.data.shorthands.forEach((item: IInbox) => {
|
response.data.data.shorthands.forEach((item: IInbox) => {
|
||||||
html += `<li style="padding-left: 0" data-id="${item.oId}" class="b3-list-item">
|
html += `<li style="padding-left: 0" data-id="${item.oId}" class="b3-list-item">
|
||||||
<label data-type="select" class="fn__flex">
|
<label data-type="select" class="fn__flex">
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ export class Outline extends Model {
|
||||||
<span data-type="min" class="${this.type === "local" ? "fn__none " : ""}block__icon b3-tooltips b3-tooltips__sw" aria-label="${window.siyuan.languages.min} ${updateHotkeyTip(window.siyuan.config.keymap.general.closeTab.custom)}"><svg><use xlink:href='#iconMin'></use></svg></span>
|
<span data-type="min" class="${this.type === "local" ? "fn__none " : ""}block__icon b3-tooltips b3-tooltips__sw" aria-label="${window.siyuan.languages.min} ${updateHotkeyTip(window.siyuan.config.keymap.general.closeTab.custom)}"><svg><use xlink:href='#iconMin'></use></svg></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="b3-list-item"></div>
|
<div class="b3-list-item"></div>
|
||||||
<div class="fn__flex-1"></div>`;
|
<div class="fn__flex-1" style="margin-bottom: 8px"></div>`;
|
||||||
this.element = options.tab.panelElement.lastElementChild as HTMLElement;
|
this.element = options.tab.panelElement.lastElementChild as HTMLElement;
|
||||||
this.headerElement = options.tab.panelElement.firstElementChild as HTMLElement;
|
this.headerElement = options.tab.panelElement.firstElementChild as HTMLElement;
|
||||||
this.tree = new Tree({
|
this.tree = new Tree({
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ export class Tag extends Model {
|
||||||
<span class="fn__space"></span>
|
<span class="fn__space"></span>
|
||||||
<span data-type="min" class="block__icon b3-tooltips b3-tooltips__sw" aria-label="${window.siyuan.languages.min} ${updateHotkeyTip(window.siyuan.config.keymap.general.closeTab.custom)}"><svg><use xlink:href='#iconMin'></use></svg></span>
|
<span data-type="min" class="block__icon b3-tooltips b3-tooltips__sw" aria-label="${window.siyuan.languages.min} ${updateHotkeyTip(window.siyuan.config.keymap.general.closeTab.custom)}"><svg><use xlink:href='#iconMin'></use></svg></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="fn__flex-1"></div>`;
|
<div class="fn__flex-1" style="margin-bottom: 8px"></div>`;
|
||||||
|
|
||||||
this.tree = new Tree({
|
this.tree = new Tree({
|
||||||
element: this.element.lastElementChild as HTMLElement,
|
element: this.element.lastElementChild as HTMLElement,
|
||||||
|
|
|
||||||
|
|
@ -412,11 +412,15 @@ export const layoutToJSON = (layout: Layout | Wnd | Tab | Model, json: any) => {
|
||||||
|
|
||||||
export const resizeDrag = () => {
|
export const resizeDrag = () => {
|
||||||
const dragElement = document.getElementById("drag");
|
const dragElement = document.getElementById("drag");
|
||||||
const right = dragElement.getBoundingClientRect().left - document.querySelector("#windowControls").clientWidth - document.querySelector("#barSearch").clientWidth * 4;
|
const width = dragElement.clientWidth
|
||||||
if (right < dragElement.clientWidth) {
|
const left = dragElement.getBoundingClientRect().left
|
||||||
dragElement.style.paddingRight = right + "px";
|
const right = document.querySelector("#windowControls").clientWidth + document.querySelector("#barSearch").clientWidth * 4;
|
||||||
|
if (left > right && left - right < width) {
|
||||||
|
dragElement.style.paddingRight = (left - right) + "px";
|
||||||
|
} else if (left < right && right - left < width) {
|
||||||
|
dragElement.style.paddingLeft = (right - left) + "px";
|
||||||
} else {
|
} else {
|
||||||
dragElement.style.paddingRight = "";
|
dragElement.style.padding = "";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -209,7 +209,7 @@ ${unicode2Emoji(emoji.unicode, true)}</button>`;
|
||||||
if (hintData.html === "separator") {
|
if (hintData.html === "separator") {
|
||||||
hintsHTML += '<div class="b3-menu__separator"></div>';
|
hintsHTML += '<div class="b3-menu__separator"></div>';
|
||||||
} else {
|
} else {
|
||||||
hintsHTML += `<button class="b3-list-item b3-list-item--two fn__block${focusClass}" data-value="${encodeURIComponent(hintData.value)}">${hintData.html}</button>`;
|
hintsHTML += `<button style="width: calc(100% - 16px)" class="b3-list-item b3-list-item--two${focusClass}" data-value="${encodeURIComponent(hintData.value)}">${hintData.html}</button>`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (hasSearch) {
|
if (hasSearch) {
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ export class Search extends Model {
|
||||||
</div>
|
</div>
|
||||||
<div id="globalSearchResult" class="b3-list-item ft__smaller ft__on-surface"></div>
|
<div id="globalSearchResult" class="b3-list-item ft__smaller ft__on-surface"></div>
|
||||||
<div id="globalSearchList" class="fn__flex-1 b3-list b3-list--background"></div>
|
<div id="globalSearchList" class="fn__flex-1 b3-list b3-list--background"></div>
|
||||||
|
<div class="fn__hr"></div>
|
||||||
<div class="fn__loading fn__loading--top"><img width="120px" src="/stage/loading-pure.svg"></div>
|
<div class="fn__loading fn__loading--top"><img width="120px" src="/stage/loading-pure.svg"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="fn__flex-1" id="searchPreview"></div>
|
<div class="fn__flex-1" id="searchPreview"></div>
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,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>
|
<svg class="svg ft__on-surface" id="searchFilter" style="height: 19px;float: left"><use xlink:href="#iconSettings"></use></svg>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div id="searchList" style="position:relative;height:calc(50% - 69px);overflow: auto" class="b3-list b3-list--background search__list"></div>
|
<div id="searchList" style="position:relative;height:calc(50% - 69px);overflow: auto;padding-bottom: 8px" class="b3-list b3-list--background search__list"></div>
|
||||||
<div id="searchPreview" class="fn__flex-1 spread-search__preview"></div></div>
|
<div id="searchPreview" class="fn__flex-1 spread-search__preview"></div></div>
|
||||||
<div id="searchFilterPanel" class="fn__none spread-search__filter">
|
<div id="searchFilterPanel" class="fn__none spread-search__filter">
|
||||||
<label class="fn__flex">
|
<label class="fn__flex">
|
||||||
|
|
|
||||||
|
|
@ -259,7 +259,7 @@ export const openHistory = () => {
|
||||||
<button data-type="rebuildIndex" class="b3-button b3-button--outline">${window.siyuan.languages.rebuildIndex}</button>
|
<button data-type="rebuildIndex" class="b3-button b3-button--outline">${window.siyuan.languages.rebuildIndex}</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="fn__flex fn__flex-1"${isMobile() ? ' style="flex-direction: column;"' : ""}>
|
<div class="fn__flex fn__flex-1"${isMobile() ? ' style="flex-direction: column;"' : ""}>
|
||||||
<ul style="${isMobile() ? "height: 30%" : "width:200px"};overflow: auto;" class="b3-list b3-list--background">
|
<ul style="${isMobile() ? "height: 30%" : "width:200px"};overflow: auto;padding-bottom: 8px;" class="b3-list b3-list--background">
|
||||||
<li class="b3-list--empty">${window.siyuan.languages.emptyContent}</li>
|
<li class="b3-list--empty">${window.siyuan.languages.emptyContent}</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="fn__flex-1 history__text fn__none" data-type="assetPanel"></div>
|
<div class="fn__flex-1 history__text fn__none" data-type="assetPanel"></div>
|
||||||
|
|
@ -267,7 +267,7 @@ export const openHistory = () => {
|
||||||
<div class="fn__flex-1 history__text fn__none" style="padding: 0" data-type="docPanel"></div>
|
<div class="fn__flex-1 history__text fn__none" style="padding: 0" data-type="docPanel"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ul data-type="notebook" style="background-color: var(--b3-theme-background);border-radius: 0 0 4px 4px" class="fn__none b3-list b3-list--background">
|
<ul data-type="notebook" style="background-color: var(--b3-theme-background);border-radius: 0 0 4px 4px;padding-bottom: 8px;" class="fn__none b3-list b3-list--background">
|
||||||
<li class="b3-list--empty">${window.siyuan.languages.emptyContent}</li>
|
<li class="b3-list--empty">${window.siyuan.languages.emptyContent}</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div data-type="repo" class="fn__none history__repo">
|
<div data-type="repo" class="fn__none history__repo">
|
||||||
|
|
@ -286,7 +286,7 @@ export const openHistory = () => {
|
||||||
<svg><use xlink:href="#iconAdd"></use></svg>${window.siyuan.languages.createSnapshot}
|
<svg><use xlink:href="#iconAdd"></use></svg>${window.siyuan.languages.createSnapshot}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<ul style="background: var(--b3-theme-background);" class="b3-list b3-list--background fn__flex-1">
|
<ul style="background: var(--b3-theme-background);padding-bottom: 8px;" class="b3-list b3-list--background fn__flex-1">
|
||||||
<li class="b3-list--empty">${window.siyuan.languages.emptyContent}</li>
|
<li class="b3-list--empty">${window.siyuan.languages.emptyContent}</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,8 @@ export const movePathTo = async (notebookId: string, path: string, focus = true)
|
||||||
<svg class="b3-form__icon-icon"><use xlink:href="#iconSearch"></use></svg>
|
<svg class="b3-form__icon-icon"><use xlink:href="#iconSearch"></use></svg>
|
||||||
<input class="b3-text-field fn__block b3-form__icon-input" value="" placeholder="${window.siyuan.languages.search}">
|
<input class="b3-text-field fn__block b3-form__icon-input" value="" placeholder="${window.siyuan.languages.search}">
|
||||||
</div>
|
</div>
|
||||||
<ul id="foldList" class="b3-list b3-list--background" style="height: 50vh;overflow: auto;position: relative"></ul>`,
|
<ul id="foldList" class="b3-list b3-list--background" style="height: 50vh;overflow: auto;position: relative"></ul>
|
||||||
|
<div class="fn__hr"></div>`,
|
||||||
width: isMobile() ? "80vw" : "50vw",
|
width: isMobile() ? "80vw" : "50vw",
|
||||||
destroyCallback() {
|
destroyCallback() {
|
||||||
if (range && focus) {
|
if (range && focus) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue