Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:sparkles: Add mind map document layout guides https://github.com/siyuan-note/siyuan/issues/20694

Daniel71885c5c0f88
diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-h361q1i/20200924093441-ft2rhps.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-h361q1i/20200924093441-ft2rhps.sy
index a7f6dec062..0a43a3befb 100644
--- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-h361q1i/20200924093441-ft2rhps.sy
+++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-h361q1i/20200924093441-ft2rhps.sy
@@ -8,7 +8,7 @@
"title": "Formatting elements",
"title-img": "background-color:#269;background-image: linear-gradient(white 2px, transparent 2px),linear-gradient(90deg, white 2px, transparent 2px),linear-gradient(rgba(255,255,255,.3) 1px, transparent 1px),linear-gradient(90deg, rgba(255,255,255,.3) 1px, transparent 1px);background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;background-position:-2px -2px, -2px -2px, -1px -1px, -1px -1px;",
"type": "doc",
- "updated": "20261024212002"
+ "updated": "20261025114801"
},
"Children": [
{
@@ -2052,7 +2052,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20210104091509-v1x69oc",
- "updated": "20261024212002"
+ "updated": "20261025114801"
},
"Children": [
{
@@ -2168,7 +2168,7 @@
"Type": "NodeHeading",
"Properties": {
"id": "20261024161816-f51bzy4",
- "updated": "20261024212002"
+ "updated": "20261025114801"
},
"Children": [
{
@@ -2239,7 +2239,7 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261024194010-0bhyie7",
- "updated": "20261024212002"
+ "updated": "20261025114801"
},
"Children": [
{
@@ -2253,7 +2253,7 @@
},
{
"Type": "NodeText",
- "Data": " to edit the document view. The fixed frame has the same size as the document viewport on entry. It is centered when the fullscreen viewport is taller, or aligned to the top center otherwise, and follows window resizing. Pan and zoom the map beneath the frame, then exit fullscreen with this mode still enabled to apply the framed view to the document. Click the button again to cancel the pending view change. Locking the canvas also cancels an unapplied view change."
+ "Data": " to edit the document view. The solid frame includes dashed horizontal and vertical center guides and a faint dot grid to help judge position and scale. The fixed frame has the same size as the document viewport on entry. It is centered when the fullscreen viewport is taller, or aligned to the top center otherwise, and follows window resizing. Pan and zoom the map beneath the frame, then exit fullscreen with this mode still enabled to apply the framed view to the document. Click the button again to cancel the pending view change. Locking the canvas also cancels an unapplied view change."
}
]
},
diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-abz7w6k/20200825162036-4dx365o.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-abz7w6k/20200825162036-4dx365o.sy
index 7ef417c56c..fbfa0e12e1 100644
--- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-abz7w6k/20200825162036-4dx365o.sy
+++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180320-abz7w6k/20200825162036-4dx365o.sy
@@ -8,7 +8,7 @@
"title": "排版元素",
"title-img": "background-color: hsl(2, 57%, 40%);background-image: repeating-linear-gradient(transparent, transparent 50px, rgba(0,0,0,.4) 50px, rgba(0,0,0,.4) 53px, transparent 53px, transparent 63px, rgba(0,0,0,.4) 63px, rgba(0,0,0,.4) 66px, transparent 66px, transparent 116px, rgba(0,0,0,.5) 116px, rgba(0,0,0,.5) 166px, rgba(255,255,255,.2) 166px, rgba(255,255,255,.2) 169px, rgba(0,0,0,.5) 169px, rgba(0,0,0,.5) 179px, rgba(255,255,255,.2) 179px, rgba(255,255,255,.2) 182px, rgba(0,0,0,.5) 182px, rgba(0,0,0,.5) 232px, transparent 232px),repeating-linear-gradient(270deg, transparent, transparent 50px, rgba(0,0,0,.4) 50px, rgba(0,0,0,.4) 53px, transparent 53px, transparent 63px, rgba(0,0,0,.4) 63px, rgba(0,0,0,.4) 66px, transparent 66px, transparent 116px, rgba(0,0,0,.5) 116px, rgba(0,0,0,.5) 166px, rgba(255,255,255,.2) 166px, rgba(255,255,255,.2) 169px, rgba(0,0,0,.5) 169px, rgba(0,0,0,.5) 179px, rgba(255,255,255,.2) 179px, rgba(255,255,255,.2) 182px, rgba(0,0,0,.5) 182px, rgba(0,0,0,.5) 232px, transparent 232px),repeating-linear-gradient(125deg, transparent, transparent 2px, rgba(0,0,0,.2) 2px, rgba(0,0,0,.2) 3px, transparent 3px, transparent 5px, rgba(0,0,0,.2) 5px);",
"type": "doc",
- "updated": "20261024212002"
+ "updated": "20261025114801"
},
"Children": [
{
@@ -2055,7 +2055,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20210104091228-wdpx6ev",
- "updated": "20261024212002"
+ "updated": "20261025114801"
},
"Children": [
{
@@ -2094,7 +2094,7 @@
"Type": "NodeHeading",
"Properties": {
"id": "20261024161816-k1vwtue",
- "updated": "20261024212002"
+ "updated": "20261025114801"
},
"Children": [
{
@@ -2165,7 +2165,7 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261024194010-bf2m0k7",
- "updated": "20261024212002"
+ "updated": "20261025114801"
},
"Children": [
{
@@ -2179,7 +2179,7 @@
},
{
"Type": "NodeText",
- "Data": " 开启布局调整。取景框与进入全屏前的文档视口等大,全屏视口更高时居中,否则按顶部中点对齐,并随窗口尺寸变化更新位置。参照固定取景框平移或缩放导图,保持此模式开启并退出全屏,即可将框内视角应用到文档;再次点击按钮关闭则取消本次视角调整。锁定画布也会取消尚未应用的视角调整。"
+ "Data": " 开启布局调整。实线取景框内的横纵中心虚线和低对比度点状网格可辅助判断位置与比例。取景框与进入全屏前的文档视口等大,全屏视口更高时居中,否则按顶部中点对齐,并随窗口尺寸变化更新位置。参照固定取景框平移或缩放导图,保持此模式开启并退出全屏,即可将框内视角应用到文档;再次点击按钮关闭则取消本次视角调整。锁定画布也会取消尚未应用的视角调整。"
}
]
},
diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226120854-dr1jfx2/20211226121319-emrk2yy.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226120854-dr1jfx2/20211226121319-emrk2yy.sy
index 821f605810..89841ce6f3 100644
--- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226120854-dr1jfx2/20211226121319-emrk2yy.sy
+++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226120854-dr1jfx2/20211226121319-emrk2yy.sy
@@ -8,7 +8,7 @@
"title": "排版元素",
"title-img": "background-color: hsl(2, 57%, 40%);background-image: repeating-linear-gradient(transparent, transparent 50px, rgba(0,0,0,.4) 50px, rgba(0,0,0,.4) 53px, transparent 53px, transparent 63px, rgba(0,0,0,.4) 63px, rgba(0,0,0,.4) 66px, transparent 66px, transparent 116px, rgba(0,0,0,.5) 116px, rgba(0,0,0,.5) 166px, rgba(255,255,255,.2) 166px, rgba(255,255,255,.2) 169px, rgba(0,0,0,.5) 169px, rgba(0,0,0,.5) 179px, rgba(255,255,255,.2) 179px, rgba(255,255,255,.2) 182px, rgba(0,0,0,.5) 182px, rgba(0,0,0,.5) 232px, transparent 232px),repeating-linear-gradient(270deg, transparent, transparent 50px, rgba(0,0,0,.4) 50px, rgba(0,0,0,.4) 53px, transparent 53px, transparent 63px, rgba(0,0,0,.4) 63px, rgba(0,0,0,.4) 66px, transparent 66px, transparent 116px, rgba(0,0,0,.5) 116px, rgba(0,0,0,.5) 166px, rgba(255,255,255,.2) 166px, rgba(255,255,255,.2) 169px, rgba(0,0,0,.5) 169px, rgba(0,0,0,.5) 179px, rgba(255,255,255,.2) 179px, rgba(255,255,255,.2) 182px, rgba(0,0,0,.5) 182px, rgba(0,0,0,.5) 232px, transparent 232px),repeating-linear-gradient(125deg, transparent, transparent 2px, rgba(0,0,0,.2) 2px, rgba(0,0,0,.2) 3px, transparent 3px, transparent 5px, rgba(0,0,0,.2) 5px);",
"type": "doc",
- "updated": "20261024212002"
+ "updated": "20261025114801"
},
"Children": [
{
@@ -2053,7 +2053,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20211226122008-731sqd6",
- "updated": "20261024212002"
+ "updated": "20261025114801"
},
"Children": [
{
@@ -2092,7 +2092,7 @@
"Type": "NodeHeading",
"Properties": {
"id": "20261024161816-xvhal7o",
- "updated": "20261024212002"
+ "updated": "20261025114801"
},
"Children": [
{
@@ -2163,7 +2163,7 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261024194010-jykxx0r",
- "updated": "20261024212002"
+ "updated": "20261025114801"
},
"Children": [
{
@@ -2177,7 +2177,7 @@
},
{
"Type": "NodeText",
- "Data": " 開啟版面配置調整。取景框與進入全螢幕前的文件視口等大,全螢幕視口較高時置中,否則依頂部中點對齊,並隨視窗尺寸變化更新位置。參照固定取景框平移或縮放導圖,保持此模式開啟並離開全螢幕,即可將框內視角套用至文件;再次點擊按鈕關閉則取消本次視角調整。鎖定畫布也會取消尚未套用的視角調整。"
+ "Data": " 開啟版面配置調整。實線取景框內的橫縱中心虛線和低對比度點狀網格可輔助判斷位置與比例。取景框與進入全螢幕前的文件視口等大,全螢幕視口較高時置中,否則依頂部中點對齊,並隨視窗尺寸變化更新位置。參照固定取景框平移或縮放導圖,保持此模式開啟並離開全螢幕,即可將框內視角套用至文件;再次點擊按鈕關閉則取消本次視角調整。鎖定畫布也會取消尚未套用的視角調整。"
}
]
},
diff --git a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-hnu6o79/20240530101000-3qhz7br.sy b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-hnu6o79/20240530101000-3qhz7br.sy
index bc3d29b336..8189b69e63 100644
--- a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-hnu6o79/20240530101000-3qhz7br.sy
+++ b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-hnu6o79/20240530101000-3qhz7br.sy
@@ -9,7 +9,7 @@
"title": "書式要素",
"title-img": "background-color:#269;background-image: linear-gradient(white 2px, transparent 2px),linear-gradient(90deg, white 2px, transparent 2px),linear-gradient(rgba(255,255,255,.3) 1px, transparent 1px),linear-gradient(90deg, rgba(255,255,255,.3) 1px, transparent 1px);background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;background-position:-2px -2px, -2px -2px, -1px -1px, -1px -1px;",
"type": "doc",
- "updated": "20261024212002"
+ "updated": "20261025114801"
},
"Children": [
{
@@ -2177,7 +2177,7 @@
"Properties": {
"ID": "20240530101000-ch5e4vh",
"id": "20240530101000-1ev7xub",
- "updated": "20261024212002"
+ "updated": "20261025114801"
},
"Children": [
{
@@ -2216,7 +2216,7 @@
"Type": "NodeHeading",
"Properties": {
"id": "20261024161816-8fr1gcz",
- "updated": "20261024212002"
+ "updated": "20261025114801"
},
"Children": [
{
@@ -2319,7 +2319,7 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261024194010-7e94tir",
- "updated": "20261024212002"
+ "updated": "20261025114801"
},
"Children": [
{
@@ -2333,7 +2333,7 @@
},
{
"Type": "NodeText",
- "Data": " をクリックすると、レイアウトの調整を開始できます。固定枠の大きさは全画面表示に入る前の文書の表示領域と同じです。全画面の表示領域のほうが高い場合は中央に、それ以外は上端中央に揃い、ウィンドウのサイズに応じて位置が更新されます。枠を基準に導図を移動・拡大縮小し、このモードを有効にしたまま全画面表示を終了すると、枠内の表示位置と倍率が文書に適用されます。ボタンをもう一度クリックすると、未適用の表示位置の調整を取り消します。キャンバスをロックした場合も未適用の調整は取り消されます。"
+ "Data": " をクリックすると、レイアウトの調整を開始できます。実線の枠内には、水平方向と垂直方向の中心を示す破線と淡い点状グリッドが表示され、位置と倍率を調整する目安になります。固定枠の大きさは全画面表示に入る前の文書の表示領域と同じです。全画面の表示領域のほうが高い場合は中央に、それ以外は上端中央に揃い、ウィンドウのサイズに応じて位置が更新されます。枠を基準に導図を移動・拡大縮小し、このモードを有効にしたまま全画面表示を終了すると、枠内の表示位置と倍率が文書に適用されます。ボタンをもう一度クリックすると、未適用の表示位置の調整を取り消します。キャンバスをロックした場合も未適用の調整は取り消されます。"
}
]
},
diff --git a/app/src/assets/scss/protyle/_mindmap-view.scss b/app/src/assets/scss/protyle/_mindmap-view.scss
index 8ad883c186..1bd70c835f 100644
--- a/app/src/assets/scss/protyle/_mindmap-view.scss
+++ b/app/src/assets/scss/protyle/_mindmap-view.scss
@@ -254,9 +254,36 @@
top: 0;
left: 0;
pointer-events: none;
- border: 1px dashed var(--b3-theme-primary);
+ color: var(--b3-theme-primary);
+ border: 1px solid currentColor;
+ border-radius: var(--b3-border-radius);
+ overflow: hidden;
+ background-image: radial-gradient(circle, color-mix(in srgb, currentColor 24%, transparent) 1px, transparent 1px);
+ background-size: 24px 24px;
+ background-position: center;
box-sizing: border-box;
z-index: 4;
+
+ &::before,
+ &::after {
+ content: "";
+ position: absolute;
+ opacity: .5;
+ }
+
+ &::before {
+ top: 0;
+ bottom: 0;
+ left: 50%;
+ border-left: 1px dashed currentColor;
+ }
+
+ &::after {
+ left: 0;
+ right: 0;
+ top: 50%;
+ border-top: 1px dashed currentColor;
+ }
}
&__selection-box {
diff --git a/app/src/protyle/render/listMindmap/fullscreen.test.ts b/app/src/protyle/render/listMindmap/fullscreen.test.ts
index 3850c8f3ff..356d71cb2a 100644
--- a/app/src/protyle/render/listMindmap/fullscreen.test.ts
+++ b/app/src/protyle/render/listMindmap/fullscreen.test.ts
@@ -36,7 +36,8 @@ const browserCases = async (source: string, css: string) => {
parent.style.cssText = `width:${mobile ? 320 : 760}px;transform:translateX(5px);overflow:hidden`;
const host = document.createElement("div");
host.style.cssText = `--mindmap-view-height:${mobile ? 300 : 460}px;` +
- `--b3-theme-background:${dark ? "#222" : "#fff"};--b3-theme-primary:#3574f0;--b3-border-color:#888`;
+ `--b3-theme-background:${dark ? "#222" : "#fff"};` +
+ `--b3-theme-primary:${dark ? "#8ab4f8" : "#3574f0"};--b3-border-color:#888;--b3-border-radius:8px`;
parent.append(host);
document.body.append(parent);
const holder = document.createElement("div");
@@ -56,6 +57,7 @@ const browserCases = async (source: string, css: string) => {
check.ok(preview.hidden);
check.ok(button("listMindmapDocumentLayout").hidden, "the layout control is fullscreen-only");
const initialStyle = host.style.cssText;
+ const documentRadius = getComputedStyle(host).borderTopLeftRadius;
for (const scale of [.75, 1.25]) {
view.zoomAt(scale);
const documentCenter = center();
@@ -135,8 +137,29 @@ const browserCases = async (source: string, css: string) => {
(viewport.clientWidth - rect.width) / 2) < .1);
check.ok(Math.abs(rect.top - viewportRect.top -
Math.max(0, (viewport.clientHeight - rect.height) / 2)) < .1);
- check.equal(getComputedStyle(preview).pointerEvents, "none", "the frame does not intercept gestures");
- check.equal(getComputedStyle(preview).borderTopStyle, "dashed");
+ const style = getComputedStyle(preview);
+ const canvasStyle = getComputedStyle(host);
+ check.equal(style.pointerEvents, "none", "the frame does not intercept gestures");
+ check.equal(style.borderTopStyle, "solid");
+ check.equal(style.borderTopColor, canvasStyle.outlineColor, "the frame follows the active canvas color");
+ check.equal(style.borderTopWidth, canvasStyle.outlineWidth);
+ check.equal(style.borderTopLeftRadius, documentRadius, "the frame keeps the document canvas radius");
+ check.match(style.backgroundImage, /radial-gradient/);
+ check.equal(style.backgroundSize, "24px 24px");
+ check.equal(style.backgroundPosition, "50% 50%");
+ check.equal(style.overflow, "hidden", "dots and guides stay inside the rounded frame");
+ const vertical = getComputedStyle(preview, "::before");
+ const horizontal = getComputedStyle(preview, "::after");
+ check.equal(vertical.borderLeftStyle, "dashed");
+ check.equal(horizontal.borderTopStyle, "dashed");
+ check.equal(vertical.borderLeftColor, style.borderTopColor);
+ check.equal(horizontal.borderTopColor, style.borderTopColor);
+ check.ok(Math.abs(parseFloat(vertical.left) - preview.clientWidth / 2) < .1);
+ check.ok(Math.abs(parseFloat(horizontal.top) - preview.clientHeight / 2) < .1);
+ for (const guide of [vertical, horizontal]) {
+ check.ok(Number(guide.opacity) > 0 && Number(guide.opacity) < 1);
+ check.equal(guide.pointerEvents, "none");
+ }
check.equal(button("listMindmapDocumentLayout").getAttribute("aria-pressed"), "true");
};
const captureLayout = () => {