@tnotesjs/core 0.6.1 → 0.8.0
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.
- package/commands/BaseCommand.ts +58 -0
- package/commands/build/BuildCommand.ts +25 -0
- package/commands/build/PreviewCommand.ts +29 -0
- package/commands/build/index.ts +8 -0
- package/commands/dev/DevCommand.ts +75 -0
- package/commands/dev/index.ts +7 -0
- package/commands/git/PullCommand.ts +25 -0
- package/commands/git/PushCommand.ts +64 -0
- package/commands/git/index.ts +8 -0
- package/commands/index.ts +11 -0
- package/commands/init-sub-repo/InitSubRepoCommand.ts +206 -0
- package/commands/init-sub-repo/index.ts +1 -0
- package/commands/misc/HelpCommand.ts +104 -0
- package/commands/misc/index.ts +7 -0
- package/commands/models.ts +87 -0
- package/commands/note/CreateNoteCommand.ts +160 -0
- package/commands/note/RenameNoteCommand.ts +147 -0
- package/commands/note/UpdateNoteConfigCommand.ts +78 -0
- package/commands/note/index.ts +9 -0
- package/commands/registry.ts +47 -0
- package/commands/update/UpdateCommand.ts +219 -0
- package/commands/update/index.ts +7 -0
- package/commands/update-completed-count/UpdateCompletedCountCommand.ts +208 -0
- package/commands/update-completed-count/index.ts +5 -0
- package/config/templates.ts +0 -5
- package/dist/{chunk-5F5RJ2HV.cjs → chunk-7FEANCT6.cjs} +16 -7
- package/dist/chunk-AGVER5MX.cjs +1746 -0
- package/dist/{chunk-TJ4527KA.cjs → chunk-BL22KD4V.cjs} +324 -950
- package/dist/{chunk-56PKXCOX.js → chunk-GWG75A5M.js} +13 -4
- package/dist/{chunk-DUTS75WQ.js → chunk-XNO3PCEH.js} +374 -1000
- package/dist/chunk-ZEQS64PE.js +1746 -0
- package/dist/cli/index.cjs +76 -155
- package/dist/cli/index.js +10 -89
- package/dist/markdown/index.cjs +8 -12
- package/dist/markdown/index.d.cts +1 -1
- package/dist/markdown/index.d.ts +1 -1
- package/dist/markdown/index.js +7 -11
- package/dist/{types-CwBWwNVv.d.ts → types-C_d0fFeD.d.ts} +8 -1
- package/dist/{types-CpsEy8lA.d.cts → types-MRBGgJTX.d.cts} +8 -1
- package/dist/vitepress/config/index.cjs +402 -178
- package/dist/vitepress/config/index.js +392 -168
- package/dist/workspace/index.cjs +4 -1202
- package/dist/workspace/index.d.cts +2 -2
- package/dist/workspace/index.d.ts +2 -2
- package/dist/workspace/index.js +4 -1202
- package/markdown/components.ts +86 -0
- package/markdown/index.ts +17 -0
- package/markdown/noteFormatter.test.ts +44 -0
- package/markdown/noteFormatter.ts +237 -0
- package/package.json +7 -3
- package/services/file-watcher/folderChangeHandler.ts +19 -15
- package/services/file-watcher/globalUpdateCoordinator.ts +21 -27
- package/services/file-watcher/service.ts +1 -6
- package/services/index.ts +0 -1
- package/services/note/service.ts +4 -6
- package/services/readme/service.ts +11 -18
- package/services/reconcileToc.ts +20 -0
- package/utils/index.ts +0 -9
- package/{services/toc → utils}/moveTocInside.test.ts +1 -1
- package/vitepress/components/BilibiliOutsidePlayer/BilibiliOutsidePlayer.vue +9 -18
- package/vitepress/components/EnWordList/EnWordList.vue +16 -662
- package/vitepress/components/Footprints/Footprints.vue +15 -537
- package/vitepress/components/Mermaid/Mermaid.vue +13 -588
- package/vitepress/components/MindmapPreview/MindmapPreview.vue +12 -434
- package/vitepress/components/MindmapPreview/markdown.ts +1 -1
- package/vitepress/components/NotesTable/NotesTable.vue +11 -130
- package/vitepress/components/constants.ts +2 -2
- package/vitepress/components/sidebar.data.ts +8 -5
- package/vitepress/configs/markdown.config.ts +170 -26
- package/vitepress/plugins/sidebarStructurePlugin.ts +242 -145
- package/vitepress/theme/index.ts +9 -13
- package/vitepress/theme/styles/base.scss +15 -0
- package/workspace/atomic.ts +113 -0
- package/workspace/errors.ts +27 -0
- package/workspace/index.ts +40 -0
- package/workspace/mutationQueue.ts +28 -0
- package/workspace/paths.ts +64 -0
- package/workspace/reconcile.test.ts +300 -0
- package/workspace/reconcile.ts +95 -0
- package/workspace/scanner.ts +292 -0
- package/workspace/types.ts +224 -0
- package/workspace/workspace.test.ts +333 -0
- package/workspace/workspace.ts +1020 -0
- package/dist/chunk-3R7QSABB.cjs +0 -502
- package/dist/chunk-CZXRQPFJ.js +0 -11
- package/dist/chunk-HXED7KVT.cjs +0 -11
- package/dist/chunk-U6IBLREL.js +0 -502
- package/services/toc/index.ts +0 -5
- package/services/toc/service.ts +0 -759
- package/utils/migrateReadmeToToc.test.ts +0 -111
- package/utils/migrateReadmeToToc.ts +0 -135
- package/vitepress/components/EnWordList/RightClickMenu.vue +0 -93
package/dist/cli/index.js
CHANGED
|
@@ -15,11 +15,9 @@ import {
|
|
|
15
15
|
NoteService,
|
|
16
16
|
ROOT_CONFIG_PATH,
|
|
17
17
|
ROOT_DIR_PATH,
|
|
18
|
-
ROOT_README_PATH,
|
|
19
18
|
ROOT_TOC_PATH,
|
|
20
19
|
ReadmeService,
|
|
21
20
|
RenameNoteCommand,
|
|
22
|
-
TocService,
|
|
23
21
|
UpdateNoteConfigCommand,
|
|
24
22
|
VitepressService,
|
|
25
23
|
buildInitContext,
|
|
@@ -30,26 +28,22 @@ import {
|
|
|
30
28
|
handleError,
|
|
31
29
|
isAlreadyInitialized,
|
|
32
30
|
logger,
|
|
33
|
-
migrateReadmeToToc,
|
|
34
31
|
parseArgs,
|
|
35
32
|
parseReadmeCompletedNotes,
|
|
33
|
+
reconcileTocFromFiles,
|
|
36
34
|
runCommand,
|
|
37
35
|
validatePort,
|
|
38
36
|
validateTopic
|
|
39
|
-
} from "../chunk-
|
|
37
|
+
} from "../chunk-XNO3PCEH.js";
|
|
40
38
|
import {
|
|
41
39
|
ConfigManager,
|
|
42
40
|
getConfigManager,
|
|
43
41
|
stripDeprecatedRootItemFields
|
|
44
42
|
} from "../chunk-UJG3UU5X.js";
|
|
45
43
|
import {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
processTocEmptyLines,
|
|
50
|
-
resolveNoteFromIndex
|
|
51
|
-
} from "../chunk-U6IBLREL.js";
|
|
52
|
-
import "../chunk-CZXRQPFJ.js";
|
|
44
|
+
parseTocCompletedNotes
|
|
45
|
+
} from "../chunk-ZEQS64PE.js";
|
|
46
|
+
import "../chunk-GWG75A5M.js";
|
|
53
47
|
|
|
54
48
|
// commands/update/UpdateCommand.ts
|
|
55
49
|
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
@@ -284,15 +278,13 @@ var DevCommand = class extends BaseCommand {
|
|
|
284
278
|
this.fileWatcherService = new FileWatcherService();
|
|
285
279
|
this.noteIndexCache = NoteIndexCache.getInstance();
|
|
286
280
|
this.noteManager = NoteManager.getInstance();
|
|
287
|
-
this.tocService = TocService.getInstance();
|
|
288
281
|
this.vitepressService = new VitepressService();
|
|
289
282
|
}
|
|
290
283
|
async run() {
|
|
291
284
|
const notes = this.noteManager.scanNotes();
|
|
292
285
|
this.logger.info(`\u626B\u63CF\u5230 ${notes.length} \u7BC7\u7B14\u8BB0`);
|
|
293
286
|
this.noteIndexCache.initialize(notes);
|
|
294
|
-
|
|
295
|
-
await this.tocService.regenerateSidebar(notes);
|
|
287
|
+
await reconcileTocFromFiles(ROOT_DIR_PATH);
|
|
296
288
|
const result = await this.vitepressService.startServer();
|
|
297
289
|
if (result) {
|
|
298
290
|
const versionInfo = result.version ? `\uFF08v${result.version}\uFF09` : "";
|
|
@@ -387,11 +379,7 @@ var InitSubRepoCommand = class extends BaseCommand {
|
|
|
387
379
|
try {
|
|
388
380
|
this.logger.info("");
|
|
389
381
|
this.logger.info("\u6B63\u5728\u89C4\u8303\u5316 TOC.md \u5E76\u751F\u6210 sidebar.json...");
|
|
390
|
-
|
|
391
|
-
const tocService = TocService.getInstance();
|
|
392
|
-
const notes = noteService.getAllNotes();
|
|
393
|
-
await tocService.normalizeToc(notes);
|
|
394
|
-
await tocService.regenerateSidebar(notes);
|
|
382
|
+
await reconcileTocFromFiles(ROOT_DIR_PATH);
|
|
395
383
|
this.logger.success("sidebar.json \u5DF2\u751F\u6210");
|
|
396
384
|
} catch (error) {
|
|
397
385
|
this.logger.warn(
|
|
@@ -470,68 +458,6 @@ var InitSubRepoCommand = class extends BaseCommand {
|
|
|
470
458
|
}
|
|
471
459
|
};
|
|
472
460
|
|
|
473
|
-
// commands/init-toc/InitTocCommand.ts
|
|
474
|
-
import { existsSync as existsSync2, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
|
|
475
|
-
var InitTocCommand = class extends BaseCommand {
|
|
476
|
-
constructor() {
|
|
477
|
-
super("init-toc");
|
|
478
|
-
this.noteManager = NoteManager.getInstance();
|
|
479
|
-
this.tocService = TocService.getInstance();
|
|
480
|
-
}
|
|
481
|
-
async run() {
|
|
482
|
-
if (!existsSync2(ROOT_README_PATH)) {
|
|
483
|
-
throw new Error(`README.md \u4E0D\u5B58\u5728: ${ROOT_README_PATH}`);
|
|
484
|
-
}
|
|
485
|
-
const readmeContent = readFileSync3(ROOT_README_PATH, "utf-8");
|
|
486
|
-
const notes = this.noteManager.scanNotes();
|
|
487
|
-
const { entries, warnings } = migrateReadmeToToc(readmeContent);
|
|
488
|
-
for (const warning of warnings) {
|
|
489
|
-
this.logger.warn(warning);
|
|
490
|
-
}
|
|
491
|
-
const lines = [];
|
|
492
|
-
let skipped = 0;
|
|
493
|
-
for (const entry of entries) {
|
|
494
|
-
if (entry.kind === "folder") {
|
|
495
|
-
lines.push(buildFolderTocLine(entry.folderTitle, entry.indent));
|
|
496
|
-
continue;
|
|
497
|
-
}
|
|
498
|
-
const note = resolveNoteFromIndex(entry.noteIndex, notes);
|
|
499
|
-
if (!note) {
|
|
500
|
-
skipped++;
|
|
501
|
-
this.logger.warn(
|
|
502
|
-
`\u8DF3\u8FC7 README \u4E2D\u5B58\u5728\u4F46 notes/ \u76EE\u5F55\u4E2D\u4E0D\u5B58\u5728\u7684\u7B14\u8BB0: ${entry.noteIndex}`
|
|
503
|
-
);
|
|
504
|
-
continue;
|
|
505
|
-
}
|
|
506
|
-
lines.push(buildTocLine(note, entry.indent, entry.completed));
|
|
507
|
-
}
|
|
508
|
-
if (lines.length === 0) {
|
|
509
|
-
throw new Error(
|
|
510
|
-
"\u672A\u80FD\u4ECE README.md \u89E3\u6790\u5230\u4EFB\u4F55\u6709\u6548\u7B14\u8BB0\u6761\u76EE\uFF0CTOC.md \u672A\u5199\u5165"
|
|
511
|
-
);
|
|
512
|
-
}
|
|
513
|
-
const content = processTocEmptyLines(lines).join("\n");
|
|
514
|
-
writeFileSync2(ROOT_TOC_PATH, content, "utf-8");
|
|
515
|
-
await this.tocService.regenerateSidebar(notes);
|
|
516
|
-
this.logger.success(
|
|
517
|
-
`TOC.md \u5DF2\u4ECE README.md \u521D\u59CB\u5316\uFF08${lines.length} \u6761\u7B14\u8BB0${skipped > 0 ? `\uFF0C\u8DF3\u8FC7 ${skipped} \u6761` : ""}\uFF09`
|
|
518
|
-
);
|
|
519
|
-
this.logger.info(`\u8F93\u51FA\u8DEF\u5F84: ${ROOT_TOC_PATH}`);
|
|
520
|
-
this.logger.info(
|
|
521
|
-
"\u8FC7\u6E21\u547D\u4EE4 init-toc \u4EC5\u5728 v0.2.x \u63D0\u4F9B\uFF0Cv0.3.x \u5C06\u79FB\u9664\uFF1B\u540E\u7EED\u8BF7\u4F7F\u7528 TOC.md + pnpm tn:update"
|
|
522
|
-
);
|
|
523
|
-
const listedIndexes = new Set(
|
|
524
|
-
entries.filter((e) => e.kind === "note").map((e) => e.noteIndex)
|
|
525
|
-
);
|
|
526
|
-
const missingInReadme = notes.filter((n) => !listedIndexes.has(n.index));
|
|
527
|
-
if (missingInReadme.length > 0) {
|
|
528
|
-
this.logger.info(
|
|
529
|
-
`README \u4E2D\u672A\u5217\u51FA ${missingInReadme.length} \u7BC7\u7B14\u8BB0\uFF0C\u53EF\u6267\u884C pnpm tn:update \u8FFD\u52A0\u5230 TOC.md`
|
|
530
|
-
);
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
};
|
|
534
|
-
|
|
535
461
|
// commands/misc/HelpCommand.ts
|
|
536
462
|
var COMMAND_CATEGORIES = {
|
|
537
463
|
\u5F00\u53D1\u548C\u6784\u5EFA: [COMMAND_NAMES.DEV, COMMAND_NAMES.BUILD, COMMAND_NAMES.PREVIEW],
|
|
@@ -541,7 +467,6 @@ var COMMAND_CATEGORIES = {
|
|
|
541
467
|
COMMAND_NAMES.CREATE_NOTES
|
|
542
468
|
],
|
|
543
469
|
"Git \u64CD\u4F5C": [COMMAND_NAMES.PUSH, COMMAND_NAMES.PULL],
|
|
544
|
-
"\u8FC1\u79FB\uFF08v0.2.x \u8FC7\u6E21\uFF09": [COMMAND_NAMES.INIT_TOC],
|
|
545
470
|
\u521D\u59CB\u5316: [COMMAND_NAMES.INIT_SUB_REPO],
|
|
546
471
|
\u5176\u4ED6: [COMMAND_NAMES.HELP]
|
|
547
472
|
};
|
|
@@ -586,9 +511,6 @@ var HelpCommand = class extends BaseCommand {
|
|
|
586
511
|
this.logger.info(" pnpm tn:build");
|
|
587
512
|
this.logger.info(" pnpm tn:create-notes # \u6279\u91CF\u521B\u5EFA\u7B14\u8BB0");
|
|
588
513
|
this.logger.info(" pnpm tn:update");
|
|
589
|
-
this.logger.info(
|
|
590
|
-
" pnpm tn:init-toc # v0.1.x \u2192 v0.2.x\uFF1A\u4ECE README.md \u751F\u6210 TOC.md"
|
|
591
|
-
);
|
|
592
514
|
this.logger.info(
|
|
593
515
|
" pnpm tn:update-completed-count # \u751F\u6210\u5F53\u524D\u77E5\u8BC6\u5E93\u6700\u8FD1 12 \u4E2A\u6708\u7684\u5B8C\u6210\u7B14\u8BB0\u6570\u91CF\u7EDF\u8BA1"
|
|
594
516
|
);
|
|
@@ -728,7 +650,7 @@ var CreateNoteCommand = class extends BaseCommand {
|
|
|
728
650
|
|
|
729
651
|
// commands/update-completed-count/UpdateCompletedCountCommand.ts
|
|
730
652
|
import { execSync } from "child_process";
|
|
731
|
-
import { readFileSync as
|
|
653
|
+
import { readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
|
|
732
654
|
var UpdateCompletedCountCommand = class extends BaseCommand {
|
|
733
655
|
constructor() {
|
|
734
656
|
super("update-completed-count");
|
|
@@ -742,7 +664,7 @@ var UpdateCompletedCountCommand = class extends BaseCommand {
|
|
|
742
664
|
async updateCurrentRepo() {
|
|
743
665
|
const startTime = Date.now();
|
|
744
666
|
try {
|
|
745
|
-
const configContent =
|
|
667
|
+
const configContent = readFileSync3(ROOT_CONFIG_PATH, "utf-8");
|
|
746
668
|
const config = JSON.parse(configContent);
|
|
747
669
|
this.logger.info("\u5F00\u59CB\u66F4\u65B0\u5B8C\u6210\u7B14\u8BB0\u6570\u91CF\u5386\u53F2\u8BB0\u5F55...");
|
|
748
670
|
const completedNotesCountHistory = await this.getCompletedNotesCountHistory();
|
|
@@ -753,7 +675,7 @@ var UpdateCompletedCountCommand = class extends BaseCommand {
|
|
|
753
675
|
stripDeprecatedRootItemFields(
|
|
754
676
|
config.root_item
|
|
755
677
|
);
|
|
756
|
-
|
|
678
|
+
writeFileSync2(ROOT_CONFIG_PATH, JSON.stringify(config, null, 2), "utf-8");
|
|
757
679
|
const duration = Date.now() - startTime;
|
|
758
680
|
const monthKeys = Object.keys(completedNotesCountHistory);
|
|
759
681
|
const currentKey = monthKeys[monthKeys.length - 1];
|
|
@@ -872,7 +794,6 @@ var commandFactories = {
|
|
|
872
794
|
"create-notes": () => new CreateNoteCommand(),
|
|
873
795
|
"dev": () => new DevCommand(),
|
|
874
796
|
"init-sub-repo": () => new InitSubRepoCommand(),
|
|
875
|
-
"init-toc": () => new InitTocCommand(),
|
|
876
797
|
"help": () => new HelpCommand(),
|
|
877
798
|
"preview": () => new PreviewCommand(),
|
|
878
799
|
"pull": () => new PullCommand(),
|
package/dist/markdown/index.cjs
CHANGED
|
@@ -2,32 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('../chunk-HXED7KVT.cjs');
|
|
5
|
+
var _chunk7FEANCT6cjs = require('../chunk-7FEANCT6.cjs');
|
|
7
6
|
|
|
8
7
|
// markdown/components.ts
|
|
9
8
|
var TNOTES_COMPONENTS = [
|
|
10
9
|
{
|
|
11
|
-
name: "
|
|
12
|
-
aliases: ["B"],
|
|
10
|
+
name: "BilibiliVideo",
|
|
13
11
|
kind: "block-component",
|
|
14
12
|
editable: "visual"
|
|
15
13
|
},
|
|
16
14
|
{
|
|
17
|
-
name: "
|
|
18
|
-
aliases: ["E"],
|
|
15
|
+
name: "WordList",
|
|
19
16
|
kind: "block-component",
|
|
20
17
|
editable: "visual"
|
|
21
18
|
},
|
|
22
19
|
{
|
|
23
20
|
name: "Footprints",
|
|
24
|
-
aliases: ["F"],
|
|
25
21
|
kind: "block-component",
|
|
26
22
|
editable: "visual"
|
|
27
23
|
},
|
|
28
24
|
{
|
|
29
25
|
name: "NotesTable",
|
|
30
|
-
aliases: ["N"],
|
|
31
26
|
kind: "block-component",
|
|
32
27
|
editable: "visual"
|
|
33
28
|
},
|
|
@@ -37,7 +32,8 @@ var TNOTES_COMPONENTS = [
|
|
|
37
32
|
editable: "visual"
|
|
38
33
|
},
|
|
39
34
|
{
|
|
40
|
-
name: "
|
|
35
|
+
name: "Mindmap",
|
|
36
|
+
aliases: ["MindmapPreview"],
|
|
41
37
|
kind: "block-component",
|
|
42
38
|
editable: "visual"
|
|
43
39
|
},
|
|
@@ -58,14 +54,14 @@ var TNOTES_COMPONENTS = [
|
|
|
58
54
|
},
|
|
59
55
|
{ name: "swiper", kind: "container", editable: "visual" },
|
|
60
56
|
{ name: "code-group", kind: "container", editable: "visual" },
|
|
57
|
+
{ name: "footprints", kind: "container", editable: "visual" },
|
|
61
58
|
{ name: "details", kind: "container", editable: "visual" },
|
|
62
59
|
{ name: "info", kind: "container", editable: "visual" },
|
|
63
60
|
{ name: "tip", kind: "container", editable: "visual" },
|
|
64
61
|
{ name: "warning", kind: "container", editable: "visual" },
|
|
65
62
|
{ name: "danger", kind: "container", editable: "visual" },
|
|
66
63
|
{ name: "mermaid", kind: "fenced-language", editable: "visual" },
|
|
67
|
-
{ name: "mindmap", kind: "fenced-language", editable: "visual" }
|
|
68
|
-
{ name: "markmap", kind: "fenced-language", editable: "visual" }
|
|
64
|
+
{ name: "mindmap", kind: "fenced-language", editable: "visual" }
|
|
69
65
|
];
|
|
70
66
|
function findTNotesComponent(name) {
|
|
71
67
|
const normalized = name.toLowerCase();
|
|
@@ -79,4 +75,4 @@ function findTNotesComponent(name) {
|
|
|
79
75
|
|
|
80
76
|
|
|
81
77
|
|
|
82
|
-
exports.NOTE_TOC_END_TAG =
|
|
78
|
+
exports.NOTE_TOC_END_TAG = _chunk7FEANCT6cjs.NOTE_TOC_END_TAG; exports.NOTE_TOC_START_TAG = _chunk7FEANCT6cjs.NOTE_TOC_START_TAG; exports.TNOTES_COMPONENTS = TNOTES_COMPONENTS; exports.findTNotesComponent = findTNotesComponent; exports.formatTNotesNote = _chunk7FEANCT6cjs.formatTNotesNote;
|
package/dist/markdown/index.d.ts
CHANGED
package/dist/markdown/index.js
CHANGED
|
@@ -2,32 +2,27 @@ import {
|
|
|
2
2
|
NOTE_TOC_END_TAG,
|
|
3
3
|
NOTE_TOC_START_TAG,
|
|
4
4
|
formatTNotesNote
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-CZXRQPFJ.js";
|
|
5
|
+
} from "../chunk-GWG75A5M.js";
|
|
7
6
|
|
|
8
7
|
// markdown/components.ts
|
|
9
8
|
var TNOTES_COMPONENTS = [
|
|
10
9
|
{
|
|
11
|
-
name: "
|
|
12
|
-
aliases: ["B"],
|
|
10
|
+
name: "BilibiliVideo",
|
|
13
11
|
kind: "block-component",
|
|
14
12
|
editable: "visual"
|
|
15
13
|
},
|
|
16
14
|
{
|
|
17
|
-
name: "
|
|
18
|
-
aliases: ["E"],
|
|
15
|
+
name: "WordList",
|
|
19
16
|
kind: "block-component",
|
|
20
17
|
editable: "visual"
|
|
21
18
|
},
|
|
22
19
|
{
|
|
23
20
|
name: "Footprints",
|
|
24
|
-
aliases: ["F"],
|
|
25
21
|
kind: "block-component",
|
|
26
22
|
editable: "visual"
|
|
27
23
|
},
|
|
28
24
|
{
|
|
29
25
|
name: "NotesTable",
|
|
30
|
-
aliases: ["N"],
|
|
31
26
|
kind: "block-component",
|
|
32
27
|
editable: "visual"
|
|
33
28
|
},
|
|
@@ -37,7 +32,8 @@ var TNOTES_COMPONENTS = [
|
|
|
37
32
|
editable: "visual"
|
|
38
33
|
},
|
|
39
34
|
{
|
|
40
|
-
name: "
|
|
35
|
+
name: "Mindmap",
|
|
36
|
+
aliases: ["MindmapPreview"],
|
|
41
37
|
kind: "block-component",
|
|
42
38
|
editable: "visual"
|
|
43
39
|
},
|
|
@@ -58,14 +54,14 @@ var TNOTES_COMPONENTS = [
|
|
|
58
54
|
},
|
|
59
55
|
{ name: "swiper", kind: "container", editable: "visual" },
|
|
60
56
|
{ name: "code-group", kind: "container", editable: "visual" },
|
|
57
|
+
{ name: "footprints", kind: "container", editable: "visual" },
|
|
61
58
|
{ name: "details", kind: "container", editable: "visual" },
|
|
62
59
|
{ name: "info", kind: "container", editable: "visual" },
|
|
63
60
|
{ name: "tip", kind: "container", editable: "visual" },
|
|
64
61
|
{ name: "warning", kind: "container", editable: "visual" },
|
|
65
62
|
{ name: "danger", kind: "container", editable: "visual" },
|
|
66
63
|
{ name: "mermaid", kind: "fenced-language", editable: "visual" },
|
|
67
|
-
{ name: "mindmap", kind: "fenced-language", editable: "visual" }
|
|
68
|
-
{ name: "markmap", kind: "fenced-language", editable: "visual" }
|
|
64
|
+
{ name: "mindmap", kind: "fenced-language", editable: "visual" }
|
|
69
65
|
];
|
|
70
66
|
function findTNotesComponent(name) {
|
|
71
67
|
const normalized = name.toLowerCase();
|
|
@@ -86,7 +86,7 @@ interface NoteDocument extends WorkspaceNoteSummary {
|
|
|
86
86
|
}
|
|
87
87
|
interface ChangedFile {
|
|
88
88
|
path: string;
|
|
89
|
-
kind: 'created' | 'updated' | 'deleted' | 'renamed';
|
|
89
|
+
kind: 'created' | 'updated' | 'deleted' | 'renamed' | 'trashed';
|
|
90
90
|
previousPath?: string;
|
|
91
91
|
}
|
|
92
92
|
interface MutationResult<T> {
|
|
@@ -211,6 +211,13 @@ interface TNotesWorkspace {
|
|
|
211
211
|
previewDelete(entry: TocEntryRef): Promise<DeleteTocEntryPreview>;
|
|
212
212
|
deleteEntry(input: DeleteTocEntryInput): Promise<MutationResult<KnowledgeBaseSnapshot>>;
|
|
213
213
|
setDone(input: UpdateNoteConfigInput): Promise<MutationResult<NoteDocument>>;
|
|
214
|
+
/**
|
|
215
|
+
* Align TOC.md + sidebar.json with the filesystem truth (files-first).
|
|
216
|
+
* Valid notes missing from the TOC are appended (root level, by index);
|
|
217
|
+
* note dirs with a missing/invalid config are soft-deleted to
|
|
218
|
+
* notes/.trash/. Idempotent: no changes -> changedFiles = [].
|
|
219
|
+
*/
|
|
220
|
+
reconcileFromFiles(): Promise<MutationResult<KnowledgeBaseSnapshot>>;
|
|
214
221
|
};
|
|
215
222
|
attachments: {
|
|
216
223
|
writeLocal(input: WriteAttachmentInput): Promise<MutationResult<AttachmentResult>>;
|
|
@@ -86,7 +86,7 @@ interface NoteDocument extends WorkspaceNoteSummary {
|
|
|
86
86
|
}
|
|
87
87
|
interface ChangedFile {
|
|
88
88
|
path: string;
|
|
89
|
-
kind: 'created' | 'updated' | 'deleted' | 'renamed';
|
|
89
|
+
kind: 'created' | 'updated' | 'deleted' | 'renamed' | 'trashed';
|
|
90
90
|
previousPath?: string;
|
|
91
91
|
}
|
|
92
92
|
interface MutationResult<T> {
|
|
@@ -211,6 +211,13 @@ interface TNotesWorkspace {
|
|
|
211
211
|
previewDelete(entry: TocEntryRef): Promise<DeleteTocEntryPreview>;
|
|
212
212
|
deleteEntry(input: DeleteTocEntryInput): Promise<MutationResult<KnowledgeBaseSnapshot>>;
|
|
213
213
|
setDone(input: UpdateNoteConfigInput): Promise<MutationResult<NoteDocument>>;
|
|
214
|
+
/**
|
|
215
|
+
* Align TOC.md + sidebar.json with the filesystem truth (files-first).
|
|
216
|
+
* Valid notes missing from the TOC are appended (root level, by index);
|
|
217
|
+
* note dirs with a missing/invalid config are soft-deleted to
|
|
218
|
+
* notes/.trash/. Idempotent: no changes -> changedFiles = [].
|
|
219
|
+
*/
|
|
220
|
+
reconcileFromFiles(): Promise<MutationResult<KnowledgeBaseSnapshot>>;
|
|
214
221
|
};
|
|
215
222
|
attachments: {
|
|
216
223
|
writeLocal(input: WriteAttachmentInput): Promise<MutationResult<AttachmentResult>>;
|