@musnows/scriverse 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,6 @@
1
1
  const fieldLabels = Object.freeze({
2
2
  name: "标准名",
3
+ code: "编号",
3
4
  aliases: "别名",
4
5
  raceId: "种族",
5
6
  species: "种族",
@@ -15,7 +16,8 @@ const fieldLabels = Object.freeze({
15
16
  export function describeCharacterVersionChanges(snapshot, previousSnapshot) {
16
17
  if (!previousSnapshot) return ["建立人物档案"];
17
18
  return [...new Set(Object.entries(fieldLabels).filter(([key]) => (
18
- JSON.stringify(snapshot?.[key] ?? null) !== JSON.stringify(previousSnapshot?.[key] ?? null)
19
+ JSON.stringify(key === "code" ? String(snapshot?.[key] ?? "") : (snapshot?.[key] ?? null))
20
+ !== JSON.stringify(key === "code" ? String(previousSnapshot?.[key] ?? "") : (previousSnapshot?.[key] ?? null))
19
21
  )).map(([, label]) => label))];
20
22
  }
21
23
 
@@ -10,7 +10,7 @@
10
10
  <link rel="icon" href="/icon.svg?v=20260712" type="image/svg+xml">
11
11
  <link rel="manifest" href="/site.webmanifest">
12
12
  <link rel="stylesheet" href="/vendor/vditor/dist/index.css?v=3.11.2">
13
- <link rel="stylesheet" href="/styles.css?v=20260723-open-prs-6">
13
+ <link rel="stylesheet" href="/styles.css?v=20260724-account-menu-identity">
14
14
  </head>
15
15
  <body class="auth-pending">
16
16
  <section id="auth-view" class="auth-view hidden" aria-labelledby="auth-title">
@@ -25,7 +25,8 @@
25
25
  </div>
26
26
  <form id="login-form" class="auth-form">
27
27
  <label>用户名<input name="username" autocomplete="username" maxlength="100" required></label>
28
- <label>密码<span class="password-field"><input id="login-password" name="password" type="password" autocomplete="current-password" maxlength="200" required><button class="password-toggle" type="button" data-password-toggle="login-password" aria-label="显示密码" aria-pressed="false" title="显示密码"><svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M2.5 12s3.3-5.5 9.5-5.5S21.5 12 21.5 12 18.2 17.5 12 17.5 2.5 12 2.5 12Z"/><circle cx="12" cy="12" r="2.8"/></svg></button></span></label>
28
+ <label>密码<span class="password-field"><input id="login-password" name="password" type="password" autocomplete="current-password" maxlength="200" required aria-describedby="login-lock-hint"><button class="password-toggle" type="button" data-password-toggle="login-password" aria-label="显示密码" aria-pressed="false" title="显示密码"><svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M2.5 12s3.3-5.5 9.5-5.5S21.5 12 21.5 12 18.2 17.5 12 17.5 2.5 12 2.5 12Z"/><circle cx="12" cy="12" r="2.8"/></svg></button></span></label>
29
+ <p id="login-lock-hint" class="auth-security-hint">5 分钟内连续输错 5 次密码,登录将锁定 30 分钟。</p>
29
30
  <div class="auth-captcha">
30
31
  <label>验证码<input name="captchaAnswer" autocomplete="off" inputmode="text" maxlength="8" spellcheck="false" required aria-describedby="login-captcha-hint"></label>
31
32
  <button id="login-captcha-refresh" class="auth-captcha-image" type="button" aria-label="刷新验证码" title="刷新验证码">
@@ -55,6 +56,10 @@
55
56
  </form>
56
57
  <p id="auth-error" class="auth-error" role="alert"></p>
57
58
  </div>
59
+ <footer class="product-footer auth-product-footer" data-product-footer aria-label="叙界项目信息">
60
+ <span class="product-footer-meta"><span>© <time data-product-footer-year></time> <a href="https://github.com/musnows" target="_blank" rel="noopener noreferrer">musnows</a></span><span aria-hidden="true">·</span><span>叙界 <span data-product-footer-version>v—</span></span><span aria-hidden="true">·</span><a href="https://github.com/musnows/Scriverse" target="_blank" rel="noopener noreferrer" aria-label="在 GitHub 查看叙界仓库">GitHub</a></span>
61
+ <span class="product-footer-development hidden" data-product-footer-development>开发模式</span>
62
+ </footer>
58
63
  </section>
59
64
  <div id="app" class="app-shell">
60
65
  <header class="topbar">
@@ -70,12 +75,12 @@
70
75
  <span id="save-state" class="save-state">就绪</span>
71
76
  <button id="account-button" class="account-button" type="button" aria-haspopup="menu" aria-expanded="false"><span id="account-avatar" class="user-avatar account-avatar" aria-hidden="true"><span class="user-avatar-fallback">作</span></span><span id="account-name">账户</span></button>
72
77
  <div id="account-menu" class="account-menu hidden" role="menu">
73
- <strong id="account-menu-name">账户</strong><small id="account-menu-role">普通用户</small>
78
+ <strong id="account-menu-name" class="account-menu-name"><span id="account-menu-display-name">账户</span><span id="account-menu-username" class="account-menu-username">@account</span></strong><small id="account-menu-role">普通用户</small>
74
79
  <button id="onboarding-menu-button" type="button" role="menuitem">功能导览</button>
75
80
  <button id="account-settings-button" type="button" role="menuitem">账户设置</button>
76
81
  <button id="logout-button" type="button" role="menuitem">退出登录</button>
77
82
  </div>
78
- <button id="top-search-button" class="topbar-icon-button" type="button" aria-label="全文检索" title="全文检索" disabled>
83
+ <button id="top-search-button" class="topbar-icon-button" type="button" aria-label="全文检索" title="全文检索(Command/Ctrl+F)" disabled>
79
84
  <svg class="topbar-icon" viewBox="0 0 24 24" aria-hidden="true"><circle cx="11" cy="11" r="6.5"/><path d="m16.2 16.2 4.3 4.3"/></svg>
80
85
  </button>
81
86
  <button id="theme-toggle" class="theme-toggle" type="button" aria-label="切换到黑夜模式" title="切换到黑夜模式" aria-pressed="false">
@@ -108,7 +113,7 @@
108
113
  <button type="button" data-module="organizations"><svg class="nav-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M22 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/></svg>组织</button>
109
114
  <button type="button" data-module="timeline"><svg class="nav-icon" viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="10"/><path d="M12 6v6l4 2"/></svg>时间轴</button>
110
115
  <button type="button" data-module="relationships"><svg class="nav-icon" viewBox="0 0 24 24" aria-hidden="true"><circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><path d="m8.59 13.51 6.83 3.98"/><path d="m15.41 6.51-6.82 3.98"/></svg>关系</button>
111
- <button type="button" data-module="outlines"><svg class="nav-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="m3 17 2 2 4-4"/><path d="m3 7 2 2 4-4"/><path d="M13 6h8"/><path d="M13 12h8"/><path d="M13 18h8"/></svg><span class="nav-label">大纲与伏笔</span></button>
116
+ <button type="button" data-module="outlines"><svg class="nav-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="m3 17 2 2 4-4"/><path d="m3 7 2 2 4-4"/><path d="M13 6h8"/><path d="M13 12h8"/><path d="M13 18h8"/></svg><span class="nav-label">大纲/伏笔</span></button>
112
117
  <button class="ai-analysis-entry" type="button" data-module="tasks"><svg class="nav-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"/><path d="M20 3v4"/><path d="M22 5h-4"/><path d="M4 17v2"/><path d="M5 18H3"/></svg>AI 分析</button>
113
118
  <button id="module-more-button" type="button" aria-expanded="false"><svg class="nav-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg><span class="nav-label">更多</span></button>
114
119
  <button class="module-nav-secondary hidden" type="button" data-module="races"><svg class="nav-icon" viewBox="0 0 24 24" aria-hidden="true"><circle cx="11" cy="4" r="2"/><circle cx="18" cy="8" r="2"/><circle cx="20" cy="16" r="2"/><path d="M9 10a5 5 0 0 1 5 5v3.5a3.5 3.5 0 0 1-6.84 1.045Q6.52 17.48 4.46 16.84A3.5 3.5 0 0 1 5.5 10Z"/></svg>种族</button>
@@ -133,6 +138,10 @@
133
138
  <button id="shelf-new-work" class="primary-button" type="button">新建作品</button>
134
139
  </div>
135
140
  <div id="book-shelf" class="book-shelf" data-testid="book-shelf"></div>
141
+ <footer class="product-footer" data-product-footer aria-label="叙界项目信息">
142
+ <span class="product-footer-meta"><span>© <time data-product-footer-year></time> <a href="https://github.com/musnows" target="_blank" rel="noopener noreferrer">musnows</a></span><span aria-hidden="true">·</span><span>叙界 <span data-product-footer-version>v—</span></span><span aria-hidden="true">·</span><a href="https://github.com/musnows/Scriverse" target="_blank" rel="noopener noreferrer" aria-label="在 GitHub 查看叙界仓库">GitHub</a></span>
143
+ <span class="product-footer-development hidden" data-product-footer-development>开发模式</span>
144
+ </footer>
136
145
  </section>
137
146
 
138
147
  <section id="platform-ai-view" class="shelf-view hidden" aria-labelledby="platform-ai-title">
@@ -157,6 +166,10 @@
157
166
  <button id="export-button" class="settings-hub-card" type="button" data-settings-action="export"><span class="settings-card-mark">MD</span><strong>导出作品</strong><small>将当前作品安全导出为 Markdown</small></button>
158
167
  </div>
159
168
  <p id="settings-work-note" class="settings-work-note"></p>
169
+ <footer class="product-footer settings-product-footer" data-product-footer aria-label="叙界项目信息">
170
+ <span class="product-footer-meta"><span>© <time data-product-footer-year></time> <a href="https://github.com/musnows" target="_blank" rel="noopener noreferrer">musnows</a></span><span aria-hidden="true">·</span><span>叙界 <span data-product-footer-version>v—</span></span><span aria-hidden="true">·</span><a href="https://github.com/musnows/Scriverse" target="_blank" rel="noopener noreferrer" aria-label="在 GitHub 查看叙界仓库">GitHub</a></span>
171
+ <span class="product-footer-development hidden" data-product-footer-development>开发模式</span>
172
+ </footer>
160
173
  </section>
161
174
 
162
175
  <section id="welcome-view" class="welcome-view hidden">
@@ -180,7 +193,6 @@
180
193
  <button id="insight-button" class="ghost-button" type="button">章节概览</button>
181
194
  <button id="versions-button" class="ghost-button" type="button">版本</button>
182
195
  <button id="tidy-blank-lines-button" class="ghost-button" type="button">整理空行</button>
183
- <button id="toggle-whitespace-button" class="ghost-button" type="button" aria-pressed="true" title="用点标记半角空格,用方框标记全角空格,用箭头标记 Tab">隐藏空白符</button>
184
196
  <button id="save-button" class="primary-button" type="button">保存正文</button>
185
197
  </div>
186
198
  </div>
@@ -202,7 +214,9 @@
202
214
  <h1 id="module-title">模块</h1>
203
215
  <p id="module-description"></p>
204
216
  </div>
205
- <button id="module-create-button" class="primary-button" type="button">新建</button>
217
+ <div id="module-header-actions" class="module-header-actions">
218
+ <button id="module-create-button" class="primary-button" type="button">新建</button>
219
+ </div>
206
220
  </div>
207
221
  <div id="module-content" class="module-content"></div>
208
222
  </section>
@@ -364,6 +378,10 @@
364
378
  <button id="setting-editor-submit" class="primary-button" type="submit">保存设定</button>
365
379
  </header>
366
380
  <div class="setting-editor-workspace">
381
+ <section id="setting-editor-management" class="entity-editor-management hidden" aria-label="设定档案操作">
382
+ <div><strong>档案操作</strong><small>版本历史和高风险操作集中在编辑面板内。</small></div>
383
+ <div class="entity-editor-management-actions"><button id="setting-editor-confirm" class="ghost-button hidden" type="button">确认候选</button><button id="setting-editor-deprecate" class="ghost-button hidden" type="button">弃用</button><button id="setting-editor-history" class="ghost-button" type="button">版本历史</button><button id="setting-editor-delete" class="danger-button" type="button">删除设定</button></div>
384
+ </section>
367
385
  <main class="setting-editor-content">
368
386
  <div class="setting-markdown-field" data-vditor-editor-field>
369
387
  <div id="setting-editor-markdown" class="vditor-editor-host" data-vditor-editor aria-label="Markdown 编辑器"></div>
@@ -382,6 +400,8 @@
382
400
  </div>
383
401
  <div class="character-editor-header-actions">
384
402
  <button id="character-history-button" class="ghost-button" type="button" aria-controls="character-history-panel" aria-expanded="false">版本历史</button>
403
+ <button id="character-merge-button" class="ghost-button hidden" type="button">合并角色</button>
404
+ <button id="character-delete-button" class="danger-button hidden" type="button">删除角色</button>
385
405
  </div>
386
406
  </header>
387
407
  <div class="character-editor-workspace">
@@ -411,7 +431,12 @@
411
431
  <span id="knowledge-editor-eyebrow" class="eyebrow">世界档案</span>
412
432
  <div class="character-editor-title-row"><h1 id="knowledge-editor-title">新建档案</h1><span id="knowledge-editor-version" class="character-version-badge">新档案</span></div>
413
433
  </div>
414
- <div class="character-editor-header-actions"><span id="knowledge-editor-header-note" class="knowledge-editor-header-note">独立资料页</span></div>
434
+ <div class="character-editor-header-actions">
435
+ <span id="knowledge-editor-header-note" class="knowledge-editor-header-note">独立资料页</span>
436
+ <button id="knowledge-editor-history" class="ghost-button hidden" type="button">版本历史</button>
437
+ <button id="knowledge-editor-merge" class="ghost-button hidden" type="button">合并档案</button>
438
+ <button id="knowledge-editor-delete" class="danger-button hidden" type="button">删除档案</button>
439
+ </div>
415
440
  </header>
416
441
  <div class="character-editor-workspace knowledge-editor-workspace">
417
442
  <nav id="knowledge-editor-nav" class="character-editor-nav" role="tablist" aria-label="世界档案编辑分区"></nav>
@@ -488,6 +513,10 @@
488
513
  <option value="relaxed">宽松</option>
489
514
  </select>
490
515
  </label>
516
+ <section class="work-access-field appearance-whitespace-field" aria-labelledby="appearance-whitespace-title">
517
+ <div><strong id="appearance-whitespace-title">正文空白符</strong><small>即时显示或隐藏空格、全角空格和 Tab 的可视标记。</small></div>
518
+ <button id="toggle-whitespace-appearance" class="ghost-button" data-toggle-whitespace type="button" aria-pressed="true">隐藏空白符</button>
519
+ </section>
491
520
  <div id="font-preview" class="font-preview" aria-live="polite">
492
521
  <strong>字体预览 Typography 0123</strong>
493
522
  <span>中文默认使用黑体,English letters always use monospace.</span>
@@ -654,6 +683,6 @@
654
683
  <div id="auth-loading" class="auth-loading" role="status" aria-label="正在载入工作台"></div>
655
684
  <script id="vditorIconScript" src="/vendor/vditor/dist/js/icons/ant.js?v=3.11.2"></script>
656
685
  <script src="/vendor/vditor/dist/index.min.js?v=3.11.2"></script>
657
- <script type="module" src="/app.js?v=20260723-character-save-hint"></script>
686
+ <script type="module" src="/app.js?v=20260724-account-menu-identity"></script>
658
687
  </body>
659
688
  </html>
@@ -0,0 +1,9 @@
1
+ export type KeyboardShortcutEvent = {
2
+ key?: unknown;
3
+ metaKey?: boolean;
4
+ ctrlKey?: boolean;
5
+ altKey?: boolean;
6
+ shiftKey?: boolean;
7
+ };
8
+
9
+ export function isGlobalSearchShortcut(event?: KeyboardShortcutEvent | null): boolean;
@@ -0,0 +1,4 @@
1
+ export function isGlobalSearchShortcut(event) {
2
+ if (!event || String(event.key ?? "").toLowerCase() !== "f") return false;
3
+ return (Boolean(event.metaKey) || Boolean(event.ctrlKey)) && !event.altKey && !event.shiftKey;
4
+ }
@@ -23,6 +23,16 @@ const NETWORK_LAYOUTS = Object.freeze({
23
23
  });
24
24
  const RELATIONSHIP_EDGE_GAP = 24;
25
25
  let relationshipRendererSequence = 0;
26
+
27
+ export function getRelationshipNetworkInitialScale(nodeCount, expanded = false) {
28
+ if (expanded) return 1;
29
+ const count = Math.max(0, Number(nodeCount) || 0);
30
+ if (count > 180) return 1.35;
31
+ if (count > 120) return 1.25;
32
+ if (count > 80) return 1.16;
33
+ return 1;
34
+ }
35
+
26
36
  const GALAXY_CELESTIAL_PALETTES = Object.freeze([
27
37
  Object.freeze({ key: "solar", hue: 42, saturation: 96, lightness: 68, color: "#ffc95f", core: "#fff8d4", rim: "#9f3c18", atmosphere: "rgba(255,184,72,.58)", ring: "rgba(255,222,151,.72)" }),
28
38
  Object.freeze({ key: "azure", hue: 211, saturation: 94, lightness: 68, color: "#61b8ff", core: "#effaff", rim: "#173b85", atmosphere: "rgba(79,156,255,.56)", ring: "rgba(164,214,255,.68)" }),
@@ -296,6 +306,44 @@ export function buildRelationshipGraph(characters, relationships) {
296
306
  return { nodes, edges, nodeById, warnings, stats: { nodeCount: nodes.length, edgeCount: edges.length, maxDegree } };
297
307
  }
298
308
 
309
+ function separateOverlappingNetworkNodes(nodes, layout) {
310
+ const iterations = nodes.length > 150 ? 44 : 24;
311
+ const padding = nodes.length > 120 ? 12 : 9;
312
+ for (let iteration = 0; iteration < iterations; iteration += 1) {
313
+ let overlapCount = 0;
314
+ for (let leftIndex = 0; leftIndex < nodes.length; leftIndex += 1) {
315
+ const left = nodes[leftIndex];
316
+ for (let rightIndex = leftIndex + 1; rightIndex < nodes.length; rightIndex += 1) {
317
+ const right = nodes[rightIndex];
318
+ let dx = right.x - left.x;
319
+ let dy = right.y - left.y;
320
+ let distance = Math.hypot(dx, dy);
321
+ if (distance < 0.001) {
322
+ const angle = (hashString(`${left.id}:${right.id}`) / 4294967296) * Math.PI * 2;
323
+ dx = Math.cos(angle);
324
+ dy = Math.sin(angle);
325
+ distance = 1;
326
+ }
327
+ const minimumDistance = left.radius + right.radius + padding;
328
+ if (distance >= minimumDistance) continue;
329
+ overlapCount += 1;
330
+ const correction = (minimumDistance - distance) * 0.52;
331
+ const nx = dx / distance;
332
+ const ny = dy / distance;
333
+ left.x -= nx * correction;
334
+ left.y -= ny * correction;
335
+ right.x += nx * correction;
336
+ right.y += ny * correction;
337
+ }
338
+ }
339
+ for (const node of nodes) {
340
+ node.x = clamp(node.x, layout.marginX + node.radius, layout.width - layout.marginX - node.radius);
341
+ node.y = clamp(node.y, layout.marginY + node.radius, layout.height - layout.marginY - node.radius);
342
+ }
343
+ if (!overlapCount) break;
344
+ }
345
+ }
346
+
299
347
  export function layoutRelationshipNetwork(graph, seed = "relationship-network", options = {}) {
300
348
  const layout = options.expanded ? NETWORK_LAYOUTS.expanded : NETWORK_LAYOUTS.standard;
301
349
  const random = seededRandom(hashString(`${seed}:${graph.nodes.map((node) => node.id).join("|")}`));
@@ -390,6 +438,7 @@ export function layoutRelationshipNetwork(graph, seed = "relationship-network",
390
438
  node.x = layout.marginX + (node.x - minX) / width * (layout.width - layout.marginX * 2);
391
439
  node.y = layout.marginY + (node.y - minY) / height * (layout.height - layout.marginY * 2);
392
440
  }
441
+ separateOverlappingNetworkNodes(nodes, layout);
393
442
  }
394
443
  return { nodes, byId, width: layout.width, height: layout.height };
395
444
  }
@@ -694,7 +743,7 @@ export function renderRelationshipMindMap(container, graph, options = {}) {
694
743
  let selectedId = null;
695
744
  let selectedEdgeId = null;
696
745
  let hoveredId = null;
697
- let viewScale = 1;
746
+ let viewScale = getRelationshipNetworkInitialScale(graph.nodes.length, options.expanded);
698
747
  let viewX = 0;
699
748
  let viewY = 0;
700
749
  let animationFrame = null;
@@ -880,6 +929,7 @@ export function renderRelationshipMindMap(container, graph, options = {}) {
880
929
  stage.append(svg);
881
930
 
882
931
  const nodeElements = new Map();
932
+ const defaultLabelLimit = graph.nodes.length > 180 ? 36 : graph.nodes.length > 120 ? 48 : graph.nodes.length > 80 ? 64 : graph.nodes.length;
883
933
  const updateNodePosition = (nodeId) => {
884
934
  const position = positions.get(nodeId);
885
935
  const button = nodeElements.get(nodeId);
@@ -1201,6 +1251,7 @@ export function renderRelationshipMindMap(container, graph, options = {}) {
1201
1251
  button.className = `mind-node network-node obsidian-node${node.locked ? " is-locked" : ""}${node.degree === 0 ? " is-isolated" : ""}`;
1202
1252
  button.dataset.nodeId = node.id;
1203
1253
  button.dataset.groupKey = node.groupKey || appearance.group.key;
1254
+ button.classList.toggle("is-label-visible", graph.nodes.indexOf(node) < defaultLabelLimit || node.degree >= 4);
1204
1255
  button.style.setProperty("--node-size", `${nodeSize}px`);
1205
1256
  button.style.setProperty("--node-color", node.color || appearance.color);
1206
1257
  button.style.setProperty("--node-glow", node.glow || appearance.glow);
@@ -1304,6 +1355,14 @@ export function renderRelationshipMindMap(container, graph, options = {}) {
1304
1355
  viewY = 0;
1305
1356
  updateViewTransform(true);
1306
1357
  };
1358
+ const setDefaultView = (animate = false) => {
1359
+ viewScale = getRelationshipNetworkInitialScale(graph.nodes.length, options.expanded);
1360
+ const width = viewport.clientWidth;
1361
+ const height = viewport.clientHeight;
1362
+ viewX = width ? (width - width * viewScale) / 2 : 0;
1363
+ viewY = height ? (height - height * viewScale) / 2 : 0;
1364
+ updateViewTransform(animate);
1365
+ };
1307
1366
  const animatePositions = (targets, duration = 650) => {
1308
1367
  freezePhysics();
1309
1368
  if (animationFrame) window.cancelAnimationFrame(animationFrame);
@@ -1342,7 +1401,7 @@ export function renderRelationshipMindMap(container, graph, options = {}) {
1342
1401
  hoveredId = null;
1343
1402
  freezePhysics();
1344
1403
  refreshHighlight();
1345
- fitView();
1404
+ setDefaultView(true);
1346
1405
  animatePositions(originalPositions);
1347
1406
  });
1348
1407
 
@@ -1393,6 +1452,7 @@ export function renderRelationshipMindMap(container, graph, options = {}) {
1393
1452
  clearGraphHighlight();
1394
1453
  shell.append(toolbar, viewport);
1395
1454
  container.append(shell);
1455
+ setDefaultView();
1396
1456
  return {
1397
1457
  destroy() {
1398
1458
  destroyed = true;