mn-docs-mcp 1.0.0 → 1.1.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.
Files changed (77) hide show
  1. package/.trae/documents/libmn_cleanup_plan.md +51 -0
  2. package/.trae/documents/libmn_doc_restructure_plan.md +140 -0
  3. package/.trae/documents/libmn_indentation_plan.md +116 -0
  4. package/.trae/documents/libmn_title_hierarchy_plan.md +91 -0
  5. package/README.md +9 -7
  6. package/next-env.d.ts +6 -0
  7. package/next.config.mjs +14 -0
  8. package/package.json +25 -10
  9. package/postcss.config.mjs +7 -0
  10. package/scripts/sync-definitions.mjs +33 -0
  11. package/source.config.ts +5 -0
  12. package/src/app/[[...slug]]/page.tsx +259 -0
  13. package/src/app/api/search/route.ts +6 -0
  14. package/src/app/global.css +81 -0
  15. package/src/app/layout.tsx +33 -0
  16. package/src/components/JsbApiFooter.tsx +251 -0
  17. package/src/content/docs/{guides/contributing.md → contributing.md} +27 -2
  18. package/src/content/docs/{guides/cookbook → cookbook}/addon-settings.md +2 -2
  19. package/src/content/docs/{guides/cookbook → cookbook}/embed-webview-panel.md +2 -2
  20. package/src/content/docs/cookbook/meta.json +13 -0
  21. package/src/content/docs/{guides/cookbook → cookbook}/network-api-call.md +2 -2
  22. package/src/content/docs/{guides/cookbook → cookbook}/webview-bidirectional-js.md +1 -1
  23. package/src/content/docs/guides/meta.json +14 -0
  24. package/src/content/docs/guides/mindmap-and-selection.md +1 -1
  25. package/src/content/docs/guides/native-ui.md +2 -2
  26. package/src/content/docs/guides/network-requests.md +1 -1
  27. package/src/content/docs/guides/notes-and-database.md +1 -1
  28. package/src/content/docs/guides/storage-and-files.md +1 -1
  29. package/src/content/docs/index.mdx +13 -38
  30. package/src/content/docs/libmn/data-converter.md +1572 -0
  31. package/src/content/docs/libmn/frame.md +279 -0
  32. package/src/content/docs/libmn/headers.md +234 -0
  33. package/src/content/docs/libmn/index.md +60 -0
  34. package/src/content/docs/libmn/internal-exposed.md +46 -0
  35. package/src/content/docs/libmn/locale.md +307 -0
  36. package/src/content/docs/libmn/menu.md +77 -0
  37. package/src/content/docs/libmn/meta.json +27 -0
  38. package/src/content/docs/libmn/mnbutton.md +966 -0
  39. package/src/content/docs/libmn/mncomment.md +533 -0
  40. package/src/content/docs/libmn/mnconnection.md +717 -0
  41. package/src/content/docs/libmn/mndocument.md +309 -0
  42. package/src/content/docs/libmn/mnextension-panel.md +340 -0
  43. package/src/content/docs/libmn/mnnote.md +533 -0
  44. package/src/content/docs/libmn/mnnotebook.md +725 -0
  45. package/src/content/docs/libmn/mnutil.md +2936 -0
  46. package/src/content/docs/libmn/mnwebview.md +693 -0
  47. package/src/content/docs/libmn/mustache.md +65 -0
  48. package/src/content/docs/libmn/response.md +352 -0
  49. package/src/content/docs/libmn/runtime-assets.md +64 -0
  50. package/src/content/docs/libmn/runtime-web-view-host.md +77 -0
  51. package/src/content/docs/libmn/runtime.md +178 -0
  52. package/src/content/docs/libmn/vendor-globals.md +34 -0
  53. package/src/content/docs/meta.json +11 -0
  54. package/src/content/docs/reference/foundation/meta.json +4 -0
  55. package/src/content/docs/reference/foundation/ns-user-defaults.md +1 -1
  56. package/src/content/docs/reference/global/meta.json +18 -0
  57. package/src/content/docs/reference/marginnote/mb-book-note.md +50 -53
  58. package/src/content/docs/reference/marginnote/meta.json +18 -0
  59. package/src/content/docs/reference/marginnote/study-controller.md +17 -17
  60. package/src/content/docs/reference/meta.json +14 -0
  61. package/src/content/docs/reference/quartzcore/meta.json +4 -0
  62. package/src/content/docs/reference/uikit/meta.json +4 -0
  63. package/src/content/docs/reference/uikit/uiwebview.md +2 -2
  64. package/src/content/docs/reference/utility/meta.json +4 -0
  65. package/src/lib/layout.tsx +31 -0
  66. package/src/lib/source.ts +7 -0
  67. package/tsconfig.json +42 -3
  68. package/astro.config.mjs +0 -130
  69. package/src/client/jsb-api-footer.ts +0 -242
  70. package/src/components/Footer.astro +0 -57
  71. package/src/components/Search.astro +0 -330
  72. package/src/content.config.ts +0 -7
  73. package/src/styles/starlight-overrides.css +0 -23
  74. /package/src/content/docs/{guides/cookbook → cookbook}/append-selection-as-comment.md +0 -0
  75. /package/src/content/docs/{guides/cookbook → cookbook}/batch-rename-notes.md +0 -0
  76. /package/src/content/docs/{guides/cookbook → cookbook}/export-notebook.md +0 -0
  77. /package/src/content/docs/{guides/cookbook → cookbook}/focus-note-in-mindmap.md +0 -0
@@ -0,0 +1,533 @@
1
+ ---
2
+ title: MNComment
3
+ description: LibMN中的MNComment对象API文档。
4
+ ---
5
+
6
+ `MNComment`是用于处理卡片评论的对象,提供评论类型识别、内容读取、媒体数据获取和链接管理等功能,访问和管理评论数据。
7
+
8
+ ## 构造函数
9
+
10
+ ```ts
11
+ new MNComment(comment: NoteComment)
12
+ ```
13
+
14
+ 构造一个新的MNComment实例。
15
+
16
+ | 参数名 | 类型 | 必填 | 说明 |
17
+ |:-------|:-----|:-----|:-----|
18
+ | `comment` | `NoteComment` | 是 | 原生评论对象。 |
19
+
20
+ ## 类成员(Class members)
21
+
22
+ ### 属性
23
+
24
+ 无。
25
+
26
+ ### 方法
27
+
28
+ #### `commentBelongsToType`
29
+
30
+ ##### 类型
31
+
32
+ ```ts
33
+ static commentBelongsToType(comment: NoteComment,types: string[]): boolean
34
+ ```
35
+
36
+ ##### 说明
37
+
38
+ 判断评论是否属于给定类型集合,支持原始`comment.type`和标准化类型名两种匹配。
39
+
40
+ ##### 参数
41
+
42
+ | 参数名 | 类型 | 必填 | 说明 |
43
+ |:----------|:--------------|:-----|:-------------------------------------------|
44
+ | `comment` | `NoteComment` | 是 | 原生评论对象。 |
45
+ | `types` | `string[]` | 是 | 允许的类型列表,支持原始type和规范化type。 |
46
+
47
+ ##### 返回值
48
+
49
+ - 类型:`boolean`
50
+ - 语义:命中任一类型返回true,没有命中返回false。
51
+
52
+ #### `getCommentType`
53
+
54
+ ##### 类型
55
+
56
+ ```ts
57
+ static getCommentType(comment: NoteComment): string|undefined
58
+ ```
59
+
60
+ ##### 说明
61
+
62
+ 根据评论内容和原始type返回标准化评论类型。
63
+
64
+ ##### 参数
65
+
66
+ | 参数名 | 类型 | 必填 | 说明 |
67
+ |:----------|:--------------|:-----|:-------------------|
68
+ | `comment` | `NoteComment` | 是 | 待识别的评论对象。 |
69
+
70
+ ##### 返回值
71
+
72
+ - 类型:`string|undefined`
73
+ - 语义:返回规范化类型字符串,无法识别时返回undefined。
74
+
75
+ ## 实例成员(Instance members)
76
+
77
+ ### 属性
78
+
79
+ #### `imageId`
80
+
81
+ ##### 类型
82
+
83
+ ```ts
84
+ get imageId(): string|undefined
85
+ ```
86
+
87
+ ##### 说明
88
+
89
+ 返回图片评论对应的媒体hash。
90
+
91
+ ##### 返回值
92
+
93
+ - 类型:`string|undefined`
94
+ - 语义:图片型评论返回媒体hash,非图片型返回undefined。
95
+
96
+ #### `imageData`
97
+
98
+ ##### 类型
99
+
100
+ ```ts
101
+ get imageData(): NSData|undefined
102
+ ```
103
+
104
+ ##### 说明
105
+
106
+ 返回图片评论对应的媒体二进制数据。
107
+
108
+ ##### 返回值
109
+
110
+ - 类型:`NSData|undefined`
111
+ - 语义:图片型评论返回图片二进制数据,其他类型返回undefined。
112
+
113
+ #### `videoId`
114
+
115
+ ##### 类型
116
+
117
+ ```ts
118
+ get videoId(): string|undefined
119
+ ```
120
+
121
+ ##### 说明
122
+
123
+ 返回音视频评论对应的媒体hash。
124
+
125
+ ##### 返回值
126
+
127
+ - 类型:`string|undefined`
128
+ - 语义:audioComment返回hash,其他类型返回undefined。
129
+
130
+ #### `audioId`
131
+
132
+ ##### 类型
133
+
134
+ ```ts
135
+ get audioId(): string|undefined
136
+ ```
137
+
138
+ ##### 说明
139
+
140
+ 返回音频评论对应的媒体hash。
141
+
142
+ ##### 返回值
143
+
144
+ - 类型:`string|undefined`
145
+ - 语义:audioComment返回hash,其他类型返回undefined。
146
+
147
+ #### `audioData`
148
+
149
+ ##### 类型
150
+
151
+ ```ts
152
+ get audioData(): NSData|undefined
153
+ ```
154
+
155
+ ##### 说明
156
+
157
+ 返回音频评论对应的媒体二进制数据。
158
+
159
+ ##### 返回值
160
+
161
+ - 类型:`NSData|undefined`
162
+ - 语义:audioComment返回媒体数据,其他类型返回undefined。
163
+
164
+ #### `videoData`
165
+
166
+ ##### 类型
167
+
168
+ ```ts
169
+ get videoData(): NSData|undefined
170
+ ```
171
+
172
+ ##### 说明
173
+
174
+ 返回音视频评论对应的媒体二进制数据。
175
+
176
+ ##### 返回值
177
+
178
+ - 类型:`NSData|undefined`
179
+ - 语义:audioComment返回媒体数据,其他类型返回undefined。
180
+
181
+ #### `text`
182
+
183
+ ##### 类型
184
+
185
+ ```ts
186
+ get text(): string
187
+ ```
188
+
189
+ ##### 说明
190
+
191
+ 返回当前评论的文本内容。
192
+
193
+ ##### 返回值
194
+
195
+ - 类型:`string`
196
+ - 语义:有文本时返回文本,没有可用文本时返回空字符串。
197
+
198
+ #### `markdown`
199
+
200
+ ##### 类型
201
+
202
+ ```ts
203
+ get markdown(): boolean
204
+ ```
205
+
206
+ ##### 说明
207
+
208
+ 判断当前评论是否为Markdown评论。
209
+
210
+ ##### 返回值
211
+
212
+ - 类型:`boolean`
213
+ - 语义:类型为markdownComment时返回true,否则返回false。
214
+
215
+ #### `markdown`
216
+
217
+ ##### 类型
218
+
219
+ ```ts
220
+ set markdown(markdown: boolean): void
221
+ ```
222
+
223
+ ##### 说明
224
+
225
+ 在普通文本评论和Markdown评论之间切换。
226
+
227
+ ##### 返回值
228
+
229
+ - 类型:`void`
230
+ - 语义:完成切换后立即返回。
231
+
232
+ #### `text`
233
+
234
+ ##### 类型
235
+
236
+ ```ts
237
+ set text(text: string): void
238
+ ```
239
+
240
+ ##### 说明
241
+
242
+ 更新当前评论文本,并同步写回原始卡片评论。
243
+
244
+ ##### 返回值
245
+
246
+ - 类型:`void`
247
+ - 语义:写入完成后立即返回。
248
+
249
+ #### `tags`
250
+
251
+ ##### 类型
252
+
253
+ ```ts
254
+ get tags(): string[]|undefined
255
+ ```
256
+
257
+ ##### 说明
258
+
259
+ 返回标签评论中的标签列表。
260
+
261
+ ##### 返回值
262
+
263
+ - 类型:`string[]|undefined`
264
+ - 语义:tagComment返回以#开头的标签列表,其他类型返回undefined。
265
+
266
+ #### `direction`
267
+
268
+ ##### 类型
269
+
270
+ ```ts
271
+ get direction(): 'one-way'|'both'|undefined
272
+ ```
273
+
274
+ ##### 说明
275
+
276
+ 返回链接评论的链接方向。
277
+
278
+ ##### 返回值
279
+
280
+ - 类型:`'one-way'|'both'|undefined`
281
+ - 语义:linkComment返回方向值,其他类型返回undefined。
282
+
283
+ #### `direction`
284
+
285
+ ##### 类型
286
+
287
+ ```ts
288
+ set direction(direction: 'one-way'|'both'): void
289
+ ```
290
+
291
+ ##### 说明
292
+
293
+ 设置链接评论方向,并同步处理反向链接。
294
+
295
+ ##### 返回值
296
+
297
+ - 类型:`void`
298
+ - 语义:执行方向切换后返回。
299
+
300
+ #### `note`
301
+
302
+ ##### 类型
303
+
304
+ ```ts
305
+ get note(): MNNote|undefined
306
+ ```
307
+
308
+ ##### 说明
309
+
310
+ 返回链接或留白评论关联的目标卡片。
311
+
312
+ ##### 返回值
313
+
314
+ - 类型:`MNNote|undefined`
315
+ - 语义:可解析时返回MNNote实例,无法关联卡片时返回undefined。
316
+
317
+ ### 方法
318
+
319
+ #### `refresh`
320
+
321
+ ##### 类型
322
+
323
+ ```ts
324
+ refresh(): void
325
+ ```
326
+
327
+ ##### 说明
328
+
329
+ 按`originalNoteId`和`index`重新读取评论内容并刷新类型。
330
+
331
+ ##### 参数
332
+
333
+ 无。
334
+
335
+ ##### 返回值
336
+
337
+ - 类型:`void`
338
+ - 语义:同步完成后返回。
339
+
340
+ #### `copyImage`
341
+
342
+ ##### 类型
343
+
344
+ ```ts
345
+ copyImage(): void
346
+ ```
347
+
348
+ ##### 说明
349
+
350
+ 复制当前评论对应的图片数据到剪贴板。
351
+
352
+ ##### 参数
353
+
354
+ 无。
355
+
356
+ ##### 返回值
357
+
358
+ - 类型:`void`
359
+ - 语义:复制动作触发后立即返回。
360
+
361
+ #### `copyText`
362
+
363
+ ##### 类型
364
+
365
+ ```ts
366
+ copyText(): void
367
+ ```
368
+
369
+ ##### 说明
370
+
371
+ 复制当前评论文本到剪贴板。
372
+
373
+ ##### 参数
374
+
375
+ 无。
376
+
377
+ ##### 返回值
378
+
379
+ - 类型:`void`
380
+ - 语义:复制动作触发后立即返回。
381
+
382
+ #### `copy`
383
+
384
+ ##### 类型
385
+
386
+ ```ts
387
+ copy(): void
388
+ ```
389
+
390
+ ##### 说明
391
+
392
+ 按评论类型自动复制文本或图片内容。
393
+
394
+ ##### 参数
395
+
396
+ 无。
397
+
398
+ ##### 返回值
399
+
400
+ - 类型:`void`
401
+ - 语义:复制动作触发后立即返回。
402
+
403
+ #### `remove`
404
+
405
+ ##### 类型
406
+
407
+ ```ts
408
+ remove(): void
409
+ ```
410
+
411
+ ##### 说明
412
+
413
+ 从原始卡片中删除当前评论。
414
+
415
+ ##### 参数
416
+
417
+ 无。
418
+
419
+ ##### 返回值
420
+
421
+ - 类型:`void`
422
+ - 语义:删除动作发起后返回。
423
+
424
+ #### `replaceLink`
425
+
426
+ ##### 类型
427
+
428
+ ```ts
429
+ replaceLink(note: MNNote|MbBookNote|string): void
430
+ ```
431
+
432
+ ##### 说明
433
+
434
+ 将链接评论目标替换为指定卡片,并根据方向维护反向链接。
435
+
436
+ ##### 参数
437
+
438
+ | 参数名 | 类型 | 必填 | 说明 |
439
+ |:-------|:---------|:-----------|:---------|
440
+ | `note` | `MNNote\|MbBookNote\|string` | 是 | 目标卡片。 |
441
+
442
+ ##### 返回值
443
+
444
+ - 类型:`void`
445
+ - 语义:替换完成后返回。
446
+
447
+ #### `hasBackLink`
448
+
449
+ ##### 类型
450
+
451
+ ```ts
452
+ hasBackLink(): boolean
453
+ ```
454
+
455
+ ##### 说明
456
+
457
+ 检查当前链接评论是否存在反向链接。
458
+
459
+ ##### 参数
460
+
461
+ 无。
462
+
463
+ ##### 返回值
464
+
465
+ - 类型:`boolean`
466
+ - 语义:存在反链返回true,不存在返回false。
467
+
468
+ #### `removeBackLink`
469
+
470
+ ##### 类型
471
+
472
+ ```ts
473
+ removeBackLink(): void
474
+ ```
475
+
476
+ ##### 说明
477
+
478
+ 移除当前链接评论对应的反向链接。
479
+
480
+ ##### 参数
481
+
482
+ 无。
483
+
484
+ ##### 返回值
485
+
486
+ - 类型:`void`
487
+ - 语义:反链删除完成后返回。
488
+
489
+ #### `addBackLink`
490
+
491
+ ##### 类型
492
+
493
+ ```ts
494
+ addBackLink(force: boolean): void
495
+ ```
496
+
497
+ ##### 说明
498
+
499
+ 为当前链接评论补充反向链接。
500
+
501
+ ##### 参数
502
+
503
+ | 参数名 | 类型 | 必填 | 说明 |
504
+ |:--------|:----------|:-----|:--------------------------------------------|
505
+ | `force` | `boolean` | 否 | 为true时忽略当前direction,强制尝试补反链。 |
506
+
507
+ ##### 返回值
508
+
509
+ - 类型:`void`
510
+ - 语义:补反链动作完成后返回。
511
+
512
+ #### `belongsToType`
513
+
514
+ ##### 类型
515
+
516
+ ```ts
517
+ belongsToType(types: string[]): boolean
518
+ ```
519
+
520
+ ##### 说明
521
+
522
+ 判断当前评论实例是否命中类型列表。
523
+
524
+ ##### 参数
525
+
526
+ | 参数名 | 类型 | 必填 | 说明 |
527
+ |:--------|:-----------|:-----|:-----------------|
528
+ | `types` | `string[]` | 是 | 允许的类型列表。 |
529
+
530
+ ##### 返回值
531
+
532
+ - 类型:`boolean`
533
+ - 语义:实例类型命中列表返回true,否则返回false。