mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-11-20 03:49:45 +00:00
feat: auto-hide presentation toolbar when not hovered (#1923)
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Blocked by required conditions
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
Some checks are pending
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / E2E Tests (win32-x64 on windows-latest) (push) Blocked by required conditions
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / E2E Tests (darwin-arm64 on macos-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-22.04) (push) Blocked by required conditions
tinymist::ci / E2E Tests (linux-x64 on ubuntu-latest) (push) Blocked by required conditions
tinymist::ci / E2E Tests (win32-x64 on windows-2022) (push) Blocked by required conditions
tinymist::ci / build-binary (push) Blocked by required conditions
tinymist::ci / build-vsc-assets (push) Blocked by required conditions
tinymist::ci / build-vscode (push) Blocked by required conditions
tinymist::ci / build-vscode-others (push) Blocked by required conditions
tinymist::ci / publish-vscode (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
* docs: update changelog * feat: auto-hide presentation toolbar when not hovered * fix: grab state * fix: bugs
This commit is contained in:
parent
2dc138f4d3
commit
ca22cf9e05
4 changed files with 25 additions and 6 deletions
|
|
@ -37,6 +37,7 @@ The changelog lines unspecified with authors are all written by the @Myriad-Drea
|
|||
### Code Analysis
|
||||
|
||||
* (Fix) Truncating value repr with 10MB limit in https://github.com/Myriad-Dreamin/tinymist/pull/1850
|
||||
* (Fix) Updated the docs link from `pattern` to `tiling` by @YDX-2147483647 in https://github.com/Myriad-Dreamin/tinymist/pull/1906
|
||||
* Resolving definitions with dynamic analysis in https://github.com/Myriad-Dreamin/tinymist/pull/1904
|
||||
|
||||
### Docstring
|
||||
|
|
@ -64,6 +65,7 @@ The changelog lines unspecified with authors are all written by the @Myriad-Drea
|
|||
* Added flake.nix in https://github.com/Myriad-Dreamin/tinymist/pull/1843
|
||||
* Removed debug symbol links in https://github.com/Myriad-Dreamin/tinymist/pull/1836
|
||||
* Generating typlite, config reference markdown files in https://github.com/Myriad-Dreamin/tinymist/pull/1868, https://github.com/Myriad-Dreamin/tinymist/pull/1881, https://github.com/Myriad-Dreamin/tinymist/pull/1885, and https://github.com/Myriad-Dreamin/tinymist/pull/1886
|
||||
* Added software specification for LLM in https://github.com/Myriad-Dreamin/tinymist/pull/1917 and https://github.com/Myriad-Dreamin/tinymist/pull/1918
|
||||
|
||||
**Full Changelog**: https://github.com/Myriad-Dreamin/tinymist/compare/v0.13.14...v0.13.16
|
||||
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@
|
|||
<!-- reserving 1px to hide height border, margin-top: -1px; -->
|
||||
<div id="typst-container" style="width: 100%">
|
||||
<div id="typst-container-top" style="width: 100%; z-index: 1">
|
||||
<div id="typst-top-toolbar" style="width: 100%">
|
||||
<div id="typst-top-toolbar" style="width: calc(100% - 24px)">
|
||||
<div
|
||||
id="typst-top-toolbar-start"
|
||||
class="flex-row"
|
||||
|
|
|
|||
|
|
@ -14,10 +14,21 @@ export function setupDrag() {
|
|||
};
|
||||
moved = true;
|
||||
};
|
||||
const goodDrag = (element: HTMLElement | null): element is HTMLElement => {
|
||||
if (!element) return false;
|
||||
// is not child of id=typst-container-top
|
||||
while (element) {
|
||||
if (element.id === "typst-container-top") {
|
||||
return false;
|
||||
}
|
||||
element = element.parentElement;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
const mouseUpHandler = function () {
|
||||
document.removeEventListener("mousemove", mouseMoveHandler);
|
||||
document.removeEventListener("mouseup", mouseUpHandler);
|
||||
if (!containerElement) return;
|
||||
if (!goodDrag(containerElement)) return;
|
||||
if (!moved) {
|
||||
document.getSelection()?.removeAllRanges();
|
||||
}
|
||||
|
|
@ -29,7 +40,7 @@ export function setupDrag() {
|
|||
x: e.clientX,
|
||||
y: e.clientY,
|
||||
};
|
||||
if (!containerElement) return;
|
||||
if (!goodDrag(containerElement)) return;
|
||||
const elementUnderMouse = e.target as HTMLElement | null;
|
||||
if (elementUnderMouse !== null && elementUnderMouse.classList.contains("tsel")) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -71,10 +71,16 @@
|
|||
width: 100%;
|
||||
height: 100%;
|
||||
flex: 1;
|
||||
max-height: calc(100vh - 35px);
|
||||
max-height: 100vh;
|
||||
}
|
||||
|
||||
#typst-container.mode-slide #typst-container-top {
|
||||
flex: 0 0 35px;
|
||||
display: flex;
|
||||
height: 35px;
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
transition: opacity 0.1s ease;
|
||||
}
|
||||
|
||||
#typst-container.mode-slide #typst-container-top:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue