├── !!!meta.json ├── README.md ├── index.html ├── navigation.html ├── style.css └── trilium-simple-mind-map ├── CopyImageReferenceButton.js ├── CopyImageReferenceButton ├── config.js └── utils.js ├── NoteTemplate └── simple-mind-map.json ├── SmmLinkRender.js ├── SmmLinkRender ├── customThemeList.clone.html ├── simpleMindMap.common.js.clone.html ├── themes.cjs.min.js.clone.html └── utils.js ├── SmmTextNoteRenderWidget.js ├── TriliumSmmWidget.js ├── TriliumSmmWidget ├── QuickSearchWidget.js ├── RichTextToolbarWidget.js ├── SmmIconWidget.js ├── SmmRender.js ├── SmmRender │ ├── config.clone.html │ ├── customThemeList.js │ ├── customThemeList │ │ └── vcMelon.js │ ├── simpleMindMap.common.js │ ├── themeList.js │ ├── themes.cjs.min.js │ └── utils.clone.html ├── config.js ├── config │ ├── language.js │ └── language │ │ ├── en_us.js │ │ └── zh_cn.js └── utils.js ├── assets ├── 1_share_page.ejs │ └── tree_item.dat ├── css.css ├── share_page.ejs └── template.ejs └── 快捷键.html /!!!meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "formatVersion": 2, 3 | "appVersion": "0.63.7", 4 | "files": [ 5 | { 6 | "noteId": "clY0NcA8ubmX", 7 | "notePath": [ 8 | "clY0NcA8ubmX" 9 | ], 10 | "isClone": false, 11 | "title": "trilium-simple-mind-map", 12 | "notePosition": 350, 13 | "prefix": null, 14 | "isExpanded": true, 15 | "type": "text", 16 | "mime": "text/html", 17 | "format": "html", 18 | "dirFileName": "trilium-simple-mind-map", 19 | "noImport": false, 20 | "attributes": [ 21 | { 22 | "type": "label", 23 | "name": "smmWidgetVersion", 24 | "value": "v1.2.1", 25 | "isInheritable": false, 26 | "position": 10 27 | } 28 | ], 29 | "attachments": [], 30 | "children": [ 31 | { 32 | "noteId": "UQudKpJa1KHD", 33 | "notePath": [ 34 | "clY0NcA8ubmX", 35 | "UQudKpJa1KHD" 36 | ], 37 | "isClone": false, 38 | "title": "TriliumSmmWidget", 39 | "notePosition": 20, 40 | "prefix": null, 41 | "isExpanded": false, 42 | "type": "code", 43 | "mime": "application/javascript;env=frontend", 44 | "dataFileName": "TriliumSmmWidget.js", 45 | "dirFileName": "TriliumSmmWidget", 46 | "noImport": false, 47 | "attributes": [ 48 | { 49 | "type": "label", 50 | "name": "widget", 51 | "value": "", 52 | "isInheritable": false, 53 | "position": 10 54 | } 55 | ], 56 | "attachments": [], 57 | "children": [ 58 | { 59 | "noteId": "lF9ps1Nmyl5W", 60 | "notePath": [ 61 | "clY0NcA8ubmX", 62 | "UQudKpJa1KHD", 63 | "lF9ps1Nmyl5W" 64 | ], 65 | "isClone": false, 66 | "title": "config", 67 | "notePosition": 10, 68 | "prefix": null, 69 | "isExpanded": false, 70 | "type": "code", 71 | "mime": "application/javascript;env=frontend", 72 | "dataFileName": "config.js", 73 | "dirFileName": "config", 74 | "noImport": false, 75 | "attributes": [ 76 | { 77 | "type": "label", 78 | "name": "smmWidgetVersion", 79 | "value": "v1.2.1", 80 | "isInheritable": false, 81 | "position": 10 82 | } 83 | ], 84 | "attachments": [], 85 | "children": [ 86 | { 87 | "noteId": "I7mZFeZhPs5k", 88 | "notePath": [ 89 | "clY0NcA8ubmX", 90 | "UQudKpJa1KHD", 91 | "lF9ps1Nmyl5W", 92 | "I7mZFeZhPs5k" 93 | ], 94 | "isClone": false, 95 | "title": "language", 96 | "notePosition": 10, 97 | "prefix": null, 98 | "isExpanded": false, 99 | "type": "code", 100 | "mime": "application/javascript;env=frontend", 101 | "dataFileName": "language.js", 102 | "dirFileName": "language", 103 | "noImport": false, 104 | "attributes": [], 105 | "attachments": [], 106 | "children": [ 107 | { 108 | "noteId": "jspGqvHxUPPs", 109 | "notePath": [ 110 | "clY0NcA8ubmX", 111 | "UQudKpJa1KHD", 112 | "lF9ps1Nmyl5W", 113 | "I7mZFeZhPs5k", 114 | "jspGqvHxUPPs" 115 | ], 116 | "isClone": false, 117 | "title": "zh_cn", 118 | "notePosition": 10, 119 | "prefix": null, 120 | "isExpanded": false, 121 | "type": "code", 122 | "mime": "application/javascript;env=frontend", 123 | "dataFileName": "zh_cn.js", 124 | "noImport": false, 125 | "attributes": [], 126 | "attachments": [] 127 | }, 128 | { 129 | "noteId": "QAAgRXLLD627", 130 | "notePath": [ 131 | "clY0NcA8ubmX", 132 | "UQudKpJa1KHD", 133 | "lF9ps1Nmyl5W", 134 | "I7mZFeZhPs5k", 135 | "QAAgRXLLD627" 136 | ], 137 | "isClone": false, 138 | "title": "en_us", 139 | "notePosition": 20, 140 | "prefix": null, 141 | "isExpanded": false, 142 | "type": "code", 143 | "mime": "application/javascript;env=frontend", 144 | "dataFileName": "en_us.js", 145 | "noImport": false, 146 | "attributes": [], 147 | "attachments": [] 148 | } 149 | ] 150 | }, 151 | { 152 | "noteId": "2SWEW1LFvcjG", 153 | "notePath": [ 154 | "clY0NcA8ubmX", 155 | "UQudKpJa1KHD", 156 | "lF9ps1Nmyl5W", 157 | "2SWEW1LFvcjG" 158 | ], 159 | "isClone": false, 160 | "title": "db", 161 | "notePosition": 20, 162 | "prefix": null, 163 | "isExpanded": false, 164 | "type": "code", 165 | "mime": "application/json", 166 | "dataFileName": "db.json", 167 | "noImport": false, 168 | "attributes": [ 169 | { 170 | "type": "label", 171 | "name": "smmWidgetConfigDb", 172 | "value": "", 173 | "isInheritable": false, 174 | "position": 10 175 | } 176 | ], 177 | "attachments": [] 178 | } 179 | ] 180 | }, 181 | { 182 | "noteId": "qRNv8X9WMTl6", 183 | "notePath": [ 184 | "clY0NcA8ubmX", 185 | "UQudKpJa1KHD", 186 | "qRNv8X9WMTl6" 187 | ], 188 | "isClone": false, 189 | "title": "utils", 190 | "notePosition": 20, 191 | "prefix": null, 192 | "isExpanded": false, 193 | "type": "code", 194 | "mime": "application/javascript;env=frontend", 195 | "dataFileName": "utils.js", 196 | "noImport": false, 197 | "attributes": [], 198 | "attachments": [] 199 | }, 200 | { 201 | "noteId": "sQthH2ecpx7n", 202 | "notePath": [ 203 | "clY0NcA8ubmX", 204 | "UQudKpJa1KHD", 205 | "sQthH2ecpx7n" 206 | ], 207 | "isClone": false, 208 | "title": "SmmRender", 209 | "notePosition": 30, 210 | "prefix": null, 211 | "isExpanded": false, 212 | "type": "code", 213 | "mime": "application/javascript;env=frontend", 214 | "dataFileName": "SmmRender.js", 215 | "dirFileName": "SmmRender", 216 | "noImport": false, 217 | "attributes": [], 218 | "attachments": [], 219 | "children": [ 220 | { 221 | "noteId": "lF9ps1Nmyl5W", 222 | "notePath": [ 223 | "clY0NcA8ubmX", 224 | "UQudKpJa1KHD", 225 | "sQthH2ecpx7n", 226 | "lF9ps1Nmyl5W" 227 | ], 228 | "isClone": true, 229 | "title": "config", 230 | "prefix": null, 231 | "type": "text", 232 | "format": "html", 233 | "dataFileName": "config.clone.html", 234 | "noImport": false 235 | }, 236 | { 237 | "noteId": "qRNv8X9WMTl6", 238 | "notePath": [ 239 | "clY0NcA8ubmX", 240 | "UQudKpJa1KHD", 241 | "sQthH2ecpx7n", 242 | "qRNv8X9WMTl6" 243 | ], 244 | "isClone": true, 245 | "title": "utils", 246 | "prefix": null, 247 | "type": "text", 248 | "format": "html", 249 | "dataFileName": "utils.clone.html", 250 | "noImport": false 251 | }, 252 | { 253 | "noteId": "ILuta7EXbMqq", 254 | "notePath": [ 255 | "clY0NcA8ubmX", 256 | "UQudKpJa1KHD", 257 | "sQthH2ecpx7n", 258 | "ILuta7EXbMqq" 259 | ], 260 | "isClone": false, 261 | "title": "simpleMindMap.common.js", 262 | "notePosition": 30, 263 | "prefix": null, 264 | "isExpanded": false, 265 | "type": "file", 266 | "mime": "text/javascript", 267 | "dataFileName": "simpleMindMap.common.js", 268 | "noImport": false, 269 | "attributes": [ 270 | { 271 | "type": "label", 272 | "name": "originalFileName", 273 | "value": "simpleMindMap.common.js", 274 | "isInheritable": false, 275 | "position": 10 276 | } 277 | ], 278 | "attachments": [] 279 | }, 280 | { 281 | "noteId": "ohHksPMhmE6P", 282 | "notePath": [ 283 | "clY0NcA8ubmX", 284 | "UQudKpJa1KHD", 285 | "sQthH2ecpx7n", 286 | "ohHksPMhmE6P" 287 | ], 288 | "isClone": false, 289 | "title": "customThemeList", 290 | "notePosition": 50, 291 | "prefix": null, 292 | "isExpanded": false, 293 | "type": "code", 294 | "mime": "application/javascript;env=frontend", 295 | "dataFileName": "customThemeList.js", 296 | "dirFileName": "customThemeList", 297 | "noImport": false, 298 | "attributes": [], 299 | "attachments": [], 300 | "children": [ 301 | { 302 | "noteId": "WgPyQtwzZhjO", 303 | "notePath": [ 304 | "clY0NcA8ubmX", 305 | "UQudKpJa1KHD", 306 | "sQthH2ecpx7n", 307 | "ohHksPMhmE6P", 308 | "WgPyQtwzZhjO" 309 | ], 310 | "isClone": false, 311 | "title": "vcMelon", 312 | "notePosition": 10, 313 | "prefix": null, 314 | "isExpanded": false, 315 | "type": "code", 316 | "mime": "application/javascript;env=frontend", 317 | "dataFileName": "vcMelon.js", 318 | "noImport": false, 319 | "attributes": [], 320 | "attachments": [] 321 | } 322 | ] 323 | }, 324 | { 325 | "noteId": "sT8W2p2AY09v", 326 | "notePath": [ 327 | "clY0NcA8ubmX", 328 | "UQudKpJa1KHD", 329 | "sQthH2ecpx7n", 330 | "sT8W2p2AY09v" 331 | ], 332 | "isClone": false, 333 | "title": "themeList", 334 | "notePosition": 60, 335 | "prefix": null, 336 | "isExpanded": false, 337 | "type": "code", 338 | "mime": "application/javascript;env=frontend", 339 | "dataFileName": "themeList.js", 340 | "noImport": false, 341 | "attributes": [], 342 | "attachments": [] 343 | }, 344 | { 345 | "noteId": "0QaS4N4G8C4c", 346 | "notePath": [ 347 | "clY0NcA8ubmX", 348 | "UQudKpJa1KHD", 349 | "sQthH2ecpx7n", 350 | "0QaS4N4G8C4c" 351 | ], 352 | "isClone": false, 353 | "title": "themes.cjs.min.js", 354 | "notePosition": 70, 355 | "prefix": null, 356 | "isExpanded": false, 357 | "type": "file", 358 | "mime": "application/javascript", 359 | "dataFileName": "themes.cjs.min.js", 360 | "noImport": false, 361 | "attributes": [ 362 | { 363 | "type": "label", 364 | "name": "originalFileName", 365 | "value": "themes.cjs.min.js", 366 | "isInheritable": false, 367 | "position": 10 368 | } 369 | ], 370 | "attachments": [] 371 | } 372 | ] 373 | }, 374 | { 375 | "noteId": "Ik1moip5b3vX", 376 | "notePath": [ 377 | "clY0NcA8ubmX", 378 | "UQudKpJa1KHD", 379 | "Ik1moip5b3vX" 380 | ], 381 | "isClone": false, 382 | "title": "QuickSearchWidget", 383 | "notePosition": 40, 384 | "prefix": null, 385 | "isExpanded": false, 386 | "type": "code", 387 | "mime": "application/javascript;env=frontend", 388 | "dataFileName": "QuickSearchWidget.js", 389 | "noImport": false, 390 | "attributes": [], 391 | "attachments": [] 392 | }, 393 | { 394 | "noteId": "pKfYiJnbuQzC", 395 | "notePath": [ 396 | "clY0NcA8ubmX", 397 | "UQudKpJa1KHD", 398 | "pKfYiJnbuQzC" 399 | ], 400 | "isClone": false, 401 | "title": "SmmIconWidget", 402 | "notePosition": 50, 403 | "prefix": null, 404 | "isExpanded": false, 405 | "type": "code", 406 | "mime": "application/javascript;env=frontend", 407 | "dataFileName": "SmmIconWidget.js", 408 | "noImport": false, 409 | "attributes": [], 410 | "attachments": [] 411 | }, 412 | { 413 | "noteId": "u7Hkmj5m5wmn", 414 | "notePath": [ 415 | "clY0NcA8ubmX", 416 | "UQudKpJa1KHD", 417 | "u7Hkmj5m5wmn" 418 | ], 419 | "isClone": false, 420 | "title": "RichTextToolbarWidget", 421 | "notePosition": 60, 422 | "prefix": null, 423 | "isExpanded": false, 424 | "type": "code", 425 | "mime": "application/javascript;env=frontend", 426 | "dataFileName": "RichTextToolbarWidget.js", 427 | "noImport": false, 428 | "attributes": [], 429 | "attachments": [] 430 | } 431 | ] 432 | }, 433 | { 434 | "noteId": "BtT8aPxq7IhA", 435 | "notePath": [ 436 | "clY0NcA8ubmX", 437 | "BtT8aPxq7IhA" 438 | ], 439 | "isClone": false, 440 | "title": "CopyImageReferenceButton", 441 | "notePosition": 30, 442 | "prefix": null, 443 | "isExpanded": false, 444 | "type": "code", 445 | "mime": "application/javascript;env=frontend", 446 | "dataFileName": "CopyImageReferenceButton.js", 447 | "dirFileName": "CopyImageReferenceButton", 448 | "noImport": false, 449 | "attributes": [ 450 | { 451 | "type": "label", 452 | "name": "disabled:widget", 453 | "value": "", 454 | "isInheritable": false, 455 | "position": 10 456 | } 457 | ], 458 | "attachments": [], 459 | "children": [ 460 | { 461 | "noteId": "19X1eX6yBFyP", 462 | "notePath": [ 463 | "clY0NcA8ubmX", 464 | "BtT8aPxq7IhA", 465 | "19X1eX6yBFyP" 466 | ], 467 | "isClone": false, 468 | "title": "utils", 469 | "notePosition": 1, 470 | "prefix": null, 471 | "isExpanded": false, 472 | "type": "code", 473 | "mime": "application/javascript;env=frontend", 474 | "dataFileName": "utils.js", 475 | "noImport": false, 476 | "attributes": [], 477 | "attachments": [] 478 | }, 479 | { 480 | "noteId": "THpT9v2Ylv9c", 481 | "notePath": [ 482 | "clY0NcA8ubmX", 483 | "BtT8aPxq7IhA", 484 | "THpT9v2Ylv9c" 485 | ], 486 | "isClone": false, 487 | "title": "config", 488 | "notePosition": 11, 489 | "prefix": null, 490 | "isExpanded": false, 491 | "type": "code", 492 | "mime": "application/javascript;env=frontend", 493 | "dataFileName": "config.js", 494 | "noImport": false, 495 | "attributes": [], 496 | "attachments": [] 497 | } 498 | ] 499 | }, 500 | { 501 | "noteId": "5t57Sjiyluw9", 502 | "notePath": [ 503 | "clY0NcA8ubmX", 504 | "5t57Sjiyluw9" 505 | ], 506 | "isClone": false, 507 | "title": "SmmLinkRender", 508 | "notePosition": 40, 509 | "prefix": null, 510 | "isExpanded": false, 511 | "type": "code", 512 | "mime": "application/javascript;env=frontend", 513 | "dataFileName": "SmmLinkRender.js", 514 | "dirFileName": "SmmLinkRender", 515 | "noImport": false, 516 | "attributes": [ 517 | { 518 | "type": "label", 519 | "name": "widget", 520 | "value": "", 521 | "isInheritable": false, 522 | "position": 10 523 | } 524 | ], 525 | "attachments": [], 526 | "children": [ 527 | { 528 | "noteId": "ILuta7EXbMqq", 529 | "notePath": [ 530 | "clY0NcA8ubmX", 531 | "5t57Sjiyluw9", 532 | "ILuta7EXbMqq" 533 | ], 534 | "isClone": true, 535 | "title": "simpleMindMap.common.js", 536 | "prefix": null, 537 | "type": "text", 538 | "format": "html", 539 | "dataFileName": "simpleMindMap.common.js.clone.html", 540 | "noImport": false 541 | }, 542 | { 543 | "noteId": "0QaS4N4G8C4c", 544 | "notePath": [ 545 | "clY0NcA8ubmX", 546 | "5t57Sjiyluw9", 547 | "0QaS4N4G8C4c" 548 | ], 549 | "isClone": true, 550 | "title": "themes.cjs.min.js", 551 | "prefix": null, 552 | "type": "text", 553 | "format": "html", 554 | "dataFileName": "themes.cjs.min.js.clone.html", 555 | "noImport": false 556 | }, 557 | { 558 | "noteId": "VrVIdwYsZXTk", 559 | "notePath": [ 560 | "clY0NcA8ubmX", 561 | "5t57Sjiyluw9", 562 | "VrVIdwYsZXTk" 563 | ], 564 | "isClone": false, 565 | "title": "utils", 566 | "notePosition": 20, 567 | "prefix": null, 568 | "isExpanded": false, 569 | "type": "code", 570 | "mime": "application/javascript;env=frontend", 571 | "dataFileName": "utils.js", 572 | "noImport": false, 573 | "attributes": [], 574 | "attachments": [] 575 | }, 576 | { 577 | "noteId": "ohHksPMhmE6P", 578 | "notePath": [ 579 | "clY0NcA8ubmX", 580 | "5t57Sjiyluw9", 581 | "ohHksPMhmE6P" 582 | ], 583 | "isClone": true, 584 | "title": "customThemeList", 585 | "prefix": null, 586 | "type": "text", 587 | "format": "html", 588 | "dataFileName": "customThemeList.clone.html", 589 | "noImport": false 590 | } 591 | ] 592 | }, 593 | { 594 | "noteId": "bGZuXqkWStve", 595 | "notePath": [ 596 | "clY0NcA8ubmX", 597 | "bGZuXqkWStve" 598 | ], 599 | "isClone": false, 600 | "title": "SmmTextNoteRenderWidget", 601 | "notePosition": 50, 602 | "prefix": null, 603 | "isExpanded": false, 604 | "type": "code", 605 | "mime": "application/javascript;env=frontend", 606 | "dataFileName": "SmmTextNoteRenderWidget.js", 607 | "noImport": false, 608 | "attributes": [ 609 | { 610 | "type": "label", 611 | "name": "widget", 612 | "value": "", 613 | "isInheritable": false, 614 | "position": 10 615 | } 616 | ], 617 | "attachments": [] 618 | }, 619 | { 620 | "noteId": "mX7as1JcvBct", 621 | "notePath": [ 622 | "clY0NcA8ubmX", 623 | "mX7as1JcvBct" 624 | ], 625 | "isClone": false, 626 | "title": "NoteTemplate", 627 | "notePosition": 70, 628 | "prefix": null, 629 | "isExpanded": false, 630 | "type": "text", 631 | "mime": "text/html", 632 | "format": "html", 633 | "dirFileName": "NoteTemplate", 634 | "noImport": false, 635 | "attributes": [], 636 | "attachments": [], 637 | "children": [ 638 | { 639 | "noteId": "71rUdabKjq2f", 640 | "notePath": [ 641 | "clY0NcA8ubmX", 642 | "mX7as1JcvBct", 643 | "71rUdabKjq2f" 644 | ], 645 | "isClone": false, 646 | "title": "simple-mind-map", 647 | "notePosition": 10, 648 | "prefix": null, 649 | "isExpanded": false, 650 | "type": "code", 651 | "mime": "application/json", 652 | "dataFileName": "simple-mind-map.json", 653 | "noImport": false, 654 | "attributes": [ 655 | { 656 | "type": "label", 657 | "name": "template", 658 | "value": "", 659 | "isInheritable": false, 660 | "position": 20 661 | }, 662 | { 663 | "type": "label", 664 | "name": "iconClass", 665 | "value": "bx bx-bolt-circle", 666 | "isInheritable": false, 667 | "position": 40 668 | }, 669 | { 670 | "type": "label", 671 | "name": "hideChildrenOverview", 672 | "value": "", 673 | "isInheritable": false, 674 | "position": 30 675 | }, 676 | { 677 | "type": "label", 678 | "name": "simpleMindMap", 679 | "value": "", 680 | "isInheritable": false, 681 | "position": 10 682 | }, 683 | { 684 | "type": "relation", 685 | "name": "shareTemplate", 686 | "value": "CvUcsD7uy8xV", 687 | "isInheritable": false, 688 | "position": 50 689 | } 690 | ], 691 | "attachments": [] 692 | } 693 | ] 694 | }, 695 | { 696 | "noteId": "k4lLu5jass0y", 697 | "notePath": [ 698 | "clY0NcA8ubmX", 699 | "k4lLu5jass0y" 700 | ], 701 | "isClone": false, 702 | "title": "assets", 703 | "notePosition": 90, 704 | "prefix": null, 705 | "isExpanded": false, 706 | "type": "text", 707 | "mime": "text/html", 708 | "format": "html", 709 | "dirFileName": "assets", 710 | "noImport": false, 711 | "attributes": [ 712 | { 713 | "type": "label", 714 | "name": "smmWidgetVersion", 715 | "value": "v1.2.1", 716 | "isInheritable": false, 717 | "position": 10 718 | } 719 | ], 720 | "attachments": [], 721 | "children": [ 722 | { 723 | "noteId": "CvUcsD7uy8xV", 724 | "notePath": [ 725 | "clY0NcA8ubmX", 726 | "k4lLu5jass0y", 727 | "CvUcsD7uy8xV" 728 | ], 729 | "isClone": false, 730 | "title": "share_page.ejs", 731 | "notePosition": 10, 732 | "prefix": null, 733 | "isExpanded": false, 734 | "type": "code", 735 | "mime": "application/x-ejs", 736 | "dataFileName": "share_page.ejs", 737 | "dirFileName": "1_share_page.ejs", 738 | "noImport": false, 739 | "attributes": [ 740 | { 741 | "type": "label", 742 | "name": "shareHiddenFromTree", 743 | "value": "", 744 | "isInheritable": false, 745 | "position": 10 746 | } 747 | ], 748 | "attachments": [], 749 | "children": [ 750 | { 751 | "noteId": "XHNEkgKuqZDH", 752 | "notePath": [ 753 | "clY0NcA8ubmX", 754 | "k4lLu5jass0y", 755 | "CvUcsD7uy8xV", 756 | "XHNEkgKuqZDH" 757 | ], 758 | "isClone": false, 759 | "title": "tree_item", 760 | "notePosition": 10, 761 | "prefix": null, 762 | "isExpanded": false, 763 | "type": "code", 764 | "mime": "application/x-ejs", 765 | "dataFileName": "tree_item.dat", 766 | "noImport": false, 767 | "attributes": [], 768 | "attachments": [] 769 | } 770 | ] 771 | }, 772 | { 773 | "noteId": "SBnI513xNuOo", 774 | "notePath": [ 775 | "clY0NcA8ubmX", 776 | "k4lLu5jass0y", 777 | "SBnI513xNuOo" 778 | ], 779 | "isClone": false, 780 | "title": "template.ejs", 781 | "notePosition": 20, 782 | "prefix": null, 783 | "isExpanded": false, 784 | "type": "code", 785 | "mime": "application/x-ejs", 786 | "dataFileName": "template.ejs", 787 | "noImport": false, 788 | "attributes": [ 789 | { 790 | "type": "label", 791 | "name": "smmWidgetTemplate", 792 | "value": "", 793 | "isInheritable": false, 794 | "position": 10 795 | } 796 | ], 797 | "attachments": [] 798 | }, 799 | { 800 | "noteId": "vhq3k9FfJVwJ", 801 | "notePath": [ 802 | "clY0NcA8ubmX", 803 | "k4lLu5jass0y", 804 | "vhq3k9FfJVwJ" 805 | ], 806 | "isClone": false, 807 | "title": "css", 808 | "notePosition": 40, 809 | "prefix": null, 810 | "isExpanded": false, 811 | "type": "code", 812 | "mime": "text/css", 813 | "dataFileName": "css.css", 814 | "noImport": false, 815 | "attributes": [ 816 | { 817 | "type": "label", 818 | "name": "smmWidgetCss", 819 | "value": "", 820 | "isInheritable": false, 821 | "position": 10 822 | } 823 | ], 824 | "attachments": [] 825 | } 826 | ] 827 | }, 828 | { 829 | "noteId": "uZl2xsivEFSP", 830 | "notePath": [ 831 | "clY0NcA8ubmX", 832 | "uZl2xsivEFSP" 833 | ], 834 | "isClone": false, 835 | "title": "快捷键", 836 | "notePosition": 110, 837 | "prefix": null, 838 | "isExpanded": false, 839 | "type": "text", 840 | "mime": "text/html", 841 | "format": "html", 842 | "dataFileName": "快捷键.html", 843 | "noImport": false, 844 | "attributes": [], 845 | "attachments": [] 846 | } 847 | ] 848 | }, 849 | { 850 | "noImport": true, 851 | "dataFileName": "navigation.html" 852 | }, 853 | { 854 | "noImport": true, 855 | "dataFileName": "index.html" 856 | }, 857 | { 858 | "noImport": true, 859 | "dataFileName": "style.css" 860 | } 861 | ] 862 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## trilium-simple-mind-map 2 | ### 预览 3 | ![image](https://github.com/user-attachments/assets/292b6fbc-353f-418c-9142-f55f7228bb57) 4 | 5 | 6 | Powered by [simple-mind-map](https://github.com/wanglin2/mind-map)([Trilium](https://github.com/zadam/trilium) 0.63.7) 7 | 8 | *注意*:请勿在网络不通畅时编辑思维导图笔记,请及时使用trilium的【保存笔记历史】功能对思维导图笔记进行备份,以防数据丢失。 9 | ### 结构 10 | 1. TriliumSmmWidget:将插件渲染到note-detail-pane 11 | 2. SmmRender:用于smm功能的调用和页面渲染 12 | 3. QuickSearchWidget:提取自trilium源码,快速搜索笔记并获取选中笔记的链接地址和名称 13 | 4. CopyImageReferenceButton:提取自trilium源码,可以根据searchString复制图像引用到剪切板 14 | 5. SmmLinkRender:在超链接笔记的预览提示框中,渲染思维导图 15 | 6. SmmTextNoteRenderWidget:在text笔记中渲染思维导图,还有些问题,但不影响使用 16 | ### 安装 17 | 1. 导入笔记,取消勾选安全导入选项(如果您不熟悉trilium的小部件,请谨慎操作) 18 | 2. 重新加载页面,开始使用 19 | ### 更新 20 | 1. 导入笔记 21 | 2. 如果需要保留之前的模板关系,可以保留旧版本的【模板】中的【simple-mind-map】笔记,然后复制新导入的【simple-mind-map】笔记的属性(关系和标签)和内容替换旧版本 22 | 3. 旧版本中【simple-mind-map】笔记包含的模板数据可按需保留或修改,其余笔记或数据删除不影响插件,如果确认已经不再需要旧版本,可以进行删除 23 | ### 使用 24 | #### 如何新建思维导图笔记 25 | 1. 在插入子笔记的菜单中可以看到simple-mind-map选项,参考[Template · zadam/trilium Wiki](https://github.com/zadam/trilium/wiki/Template#instance-note) 26 | #### 如何自定义主题 27 | 1. 参考【customThemeList】笔记进行配置 28 | 2. 获取更多主题可以查看主题扩展插件[simple-mind-map-plugin-themes](https://github.com/wanglin2/simple-mind-map-plugin-themes) 29 | 3. 自定义主题在【SmmLinkRender】插件中自动渲染为classic4主题 30 | #### 如何切换语言 31 | 1. 在【config】笔记中修改LANGUAGE变量即可更换语言,目前支持zh_cn、en_us两个选项 32 | #### 如何在分享页面渲染思维导图 33 | 1. 【share_page.ejs】打开分享笔记选项 34 | 2. 在【simple-mind-map】模板笔记添加关系 ~shareTemplate=share_page.ejs,并打开分享笔记选项 35 | 3. 针对单个思维导图笔记进行渲染可为笔记单独添加关系 ~shareTemplate=share_page.ejs 36 | 4. 注意此处的share_page.ejs为笔记链接不是文字 37 | 5. 如果使用了其他的shareTemplate请参考【share_page.ejs】的54-114行自行修改 38 | #### 如何避免数据丢失 39 | 1. 请勿在网络不通畅时编辑思维导图笔记,该行为可能会导致数据丢失,请在编辑思维导图后及时使用trilium的【保存笔记历史】功能对思维导图笔记进行备份,以防数据丢失 40 | 2. 若已使用【保存笔记历史】功能,出现数据丢失后,可在【笔记修改历史】中恢复历史笔记数据 41 | ### 更新计划 42 | 1. 已无更新计划,如果您有功能需求,可以在issue中提出 -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /navigation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /style.css: -------------------------------------------------------------------------------- 1 | /* !!!!!! TRILIUM CUSTOM CHANGES !!!!!! */ 2 | 3 | .printed-content .ck-widget__selection-handle, .printed-content .ck-widget__type-around { /* gets rid of triangles: https://github.com/zadam/trilium/issues/1129 */ 4 | display: none; 5 | } 6 | 7 | /* 8 | * CKEditor 5 (v41.0.0) content styles. 9 | * Generated on Fri, 26 Jan 2024 10:23:49 GMT. 10 | * For more information, check out https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/content-styles.html 11 | */ 12 | 13 | :root { 14 | --ck-color-image-caption-background: hsl(0, 0%, 97%); 15 | --ck-color-image-caption-text: hsl(0, 0%, 20%); 16 | --ck-color-mention-background: hsla(341, 100%, 30%, 0.1); 17 | --ck-color-mention-text: hsl(341, 100%, 30%); 18 | --ck-color-selector-caption-background: hsl(0, 0%, 97%); 19 | --ck-color-selector-caption-text: hsl(0, 0%, 20%); 20 | --ck-highlight-marker-blue: hsl(201, 97%, 72%); 21 | --ck-highlight-marker-green: hsl(120, 93%, 68%); 22 | --ck-highlight-marker-pink: hsl(345, 96%, 73%); 23 | --ck-highlight-marker-yellow: hsl(60, 97%, 73%); 24 | --ck-highlight-pen-green: hsl(112, 100%, 27%); 25 | --ck-highlight-pen-red: hsl(0, 85%, 49%); 26 | --ck-image-style-spacing: 1.5em; 27 | --ck-inline-image-style-spacing: calc(var(--ck-image-style-spacing) / 2); 28 | --ck-todo-list-checkmark-size: 16px; 29 | } 30 | 31 | /* @ckeditor/ckeditor5-table/theme/tablecolumnresize.css */ 32 | .ck-content .table .ck-table-resized { 33 | table-layout: fixed; 34 | } 35 | /* @ckeditor/ckeditor5-table/theme/tablecolumnresize.css */ 36 | .ck-content .table table { 37 | overflow: hidden; 38 | } 39 | /* @ckeditor/ckeditor5-table/theme/tablecolumnresize.css */ 40 | .ck-content .table td, 41 | .ck-content .table th { 42 | overflow-wrap: break-word; 43 | position: relative; 44 | } 45 | /* @ckeditor/ckeditor5-table/theme/table.css */ 46 | .ck-content .table { 47 | margin: 0.9em auto; 48 | display: table; 49 | } 50 | /* @ckeditor/ckeditor5-table/theme/table.css */ 51 | .ck-content .table table { 52 | border-collapse: collapse; 53 | border-spacing: 0; 54 | width: 100%; 55 | height: 100%; 56 | border: 1px double hsl(0, 0%, 70%); 57 | } 58 | /* @ckeditor/ckeditor5-table/theme/table.css */ 59 | .ck-content .table table td, 60 | .ck-content .table table th { 61 | min-width: 2em; 62 | padding: .4em; 63 | border: 1px solid hsl(0, 0%, 75%); 64 | } 65 | /* @ckeditor/ckeditor5-table/theme/table.css */ 66 | .ck-content .table table th { 67 | font-weight: bold; 68 | background: hsla(0, 0%, 0%, 5%); 69 | } 70 | /* @ckeditor/ckeditor5-table/theme/table.css */ 71 | .ck-content[dir="rtl"] .table th { 72 | text-align: right; 73 | } 74 | /* @ckeditor/ckeditor5-table/theme/table.css */ 75 | .ck-content[dir="ltr"] .table th { 76 | text-align: left; 77 | } 78 | /* @ckeditor/ckeditor5-table/theme/tablecaption.css */ 79 | .ck-content .table > figcaption { 80 | display: table-caption; 81 | caption-side: top; 82 | word-break: break-word; 83 | text-align: center; 84 | color: var(--ck-color-selector-caption-text); 85 | background-color: var(--ck-color-selector-caption-background); 86 | padding: .6em; 87 | font-size: .75em; 88 | outline-offset: -1px; 89 | } 90 | /* @ckeditor/ckeditor5-page-break/theme/pagebreak.css */ 91 | .ck-content .page-break { 92 | position: relative; 93 | clear: both; 94 | padding: 5px 0; 95 | display: flex; 96 | align-items: center; 97 | justify-content: center; 98 | } 99 | /* @ckeditor/ckeditor5-page-break/theme/pagebreak.css */ 100 | .ck-content .page-break::after { 101 | content: ''; 102 | position: absolute; 103 | border-bottom: 2px dashed hsl(0, 0%, 77%); 104 | width: 100%; 105 | } 106 | /* @ckeditor/ckeditor5-page-break/theme/pagebreak.css */ 107 | .ck-content .page-break__label { 108 | position: relative; 109 | z-index: 1; 110 | padding: .3em .6em; 111 | display: block; 112 | text-transform: uppercase; 113 | border: 1px solid hsl(0, 0%, 77%); 114 | border-radius: 2px; 115 | font-family: Helvetica, Arial, Tahoma, Verdana, Sans-Serif; 116 | font-size: 0.75em; 117 | font-weight: bold; 118 | color: hsl(0, 0%, 20%); 119 | background: hsl(0, 0%, 100%); 120 | box-shadow: 2px 2px 1px hsla(0, 0%, 0%, 0.15); 121 | -webkit-user-select: none; 122 | -moz-user-select: none; 123 | -ms-user-select: none; 124 | user-select: none; 125 | } 126 | /* @ckeditor/ckeditor5-media-embed/theme/mediaembed.css */ 127 | .ck-content .media { 128 | clear: both; 129 | margin: 0.9em 0; 130 | display: block; 131 | min-width: 15em; 132 | } 133 | /* @ckeditor/ckeditor5-list/theme/todolist.css */ 134 | .ck-content .todo-list { 135 | list-style: none; 136 | } 137 | /* @ckeditor/ckeditor5-list/theme/todolist.css */ 138 | .ck-content .todo-list li { 139 | position: relative; 140 | margin-bottom: 5px; 141 | } 142 | /* @ckeditor/ckeditor5-list/theme/todolist.css */ 143 | .ck-content .todo-list li .todo-list { 144 | margin-top: 5px; 145 | } 146 | /* @ckeditor/ckeditor5-list/theme/todolist.css */ 147 | .ck-content .todo-list .todo-list__label > input { 148 | -webkit-appearance: none; 149 | display: inline-block; 150 | position: relative; 151 | width: var(--ck-todo-list-checkmark-size); 152 | height: var(--ck-todo-list-checkmark-size); 153 | vertical-align: middle; 154 | border: 0; 155 | left: -25px; 156 | margin-right: -15px; 157 | right: 0; 158 | margin-left: 0; 159 | } 160 | /* @ckeditor/ckeditor5-list/theme/todolist.css */ 161 | .ck-content[dir=rtl] .todo-list .todo-list__label > input { 162 | left: 0; 163 | margin-right: 0; 164 | right: -25px; 165 | margin-left: -15px; 166 | } 167 | /* @ckeditor/ckeditor5-list/theme/todolist.css */ 168 | .ck-content .todo-list .todo-list__label > input::before { 169 | display: block; 170 | position: absolute; 171 | box-sizing: border-box; 172 | content: ''; 173 | width: 100%; 174 | height: 100%; 175 | border: 1px solid hsl(0, 0%, 20%); 176 | border-radius: 2px; 177 | transition: 250ms ease-in-out box-shadow; 178 | } 179 | /* @ckeditor/ckeditor5-list/theme/todolist.css */ 180 | .ck-content .todo-list .todo-list__label > input::after { 181 | display: block; 182 | position: absolute; 183 | box-sizing: content-box; 184 | pointer-events: none; 185 | content: ''; 186 | left: calc( var(--ck-todo-list-checkmark-size) / 3 ); 187 | top: calc( var(--ck-todo-list-checkmark-size) / 5.3 ); 188 | width: calc( var(--ck-todo-list-checkmark-size) / 5.3 ); 189 | height: calc( var(--ck-todo-list-checkmark-size) / 2.6 ); 190 | border-style: solid; 191 | border-color: transparent; 192 | border-width: 0 calc( var(--ck-todo-list-checkmark-size) / 8 ) calc( var(--ck-todo-list-checkmark-size) / 8 ) 0; 193 | transform: rotate(45deg); 194 | } 195 | /* @ckeditor/ckeditor5-list/theme/todolist.css */ 196 | .ck-content .todo-list .todo-list__label > input[checked]::before { 197 | background: hsl(126, 64%, 41%); 198 | border-color: hsl(126, 64%, 41%); 199 | } 200 | /* @ckeditor/ckeditor5-list/theme/todolist.css */ 201 | .ck-content .todo-list .todo-list__label > input[checked]::after { 202 | border-color: hsl(0, 0%, 100%); 203 | } 204 | /* @ckeditor/ckeditor5-list/theme/todolist.css */ 205 | .ck-content .todo-list .todo-list__label .todo-list__label__description { 206 | vertical-align: middle; 207 | } 208 | /* @ckeditor/ckeditor5-list/theme/todolist.css */ 209 | .ck-content .todo-list .todo-list__label.todo-list__label_without-description input[type=checkbox] { 210 | position: absolute; 211 | } 212 | /* @ckeditor/ckeditor5-list/theme/todolist.css */ 213 | .ck-editor__editable.ck-content .todo-list .todo-list__label > input, 214 | .ck-editor__editable.ck-content .todo-list .todo-list__label > span[contenteditable=false] > input { 215 | cursor: pointer; 216 | } 217 | /* @ckeditor/ckeditor5-list/theme/todolist.css */ 218 | .ck-editor__editable.ck-content .todo-list .todo-list__label > input:hover::before, .ck-editor__editable.ck-content .todo-list .todo-list__label > span[contenteditable=false] > input:hover::before { 219 | box-shadow: 0 0 0 5px hsla(0, 0%, 0%, 0.1); 220 | } 221 | /* @ckeditor/ckeditor5-list/theme/todolist.css */ 222 | .ck-editor__editable.ck-content .todo-list .todo-list__label > span[contenteditable=false] > input { 223 | -webkit-appearance: none; 224 | display: inline-block; 225 | position: relative; 226 | width: var(--ck-todo-list-checkmark-size); 227 | height: var(--ck-todo-list-checkmark-size); 228 | vertical-align: middle; 229 | border: 0; 230 | left: -25px; 231 | margin-right: -15px; 232 | right: 0; 233 | margin-left: 0; 234 | } 235 | /* @ckeditor/ckeditor5-list/theme/todolist.css */ 236 | .ck-editor__editable.ck-content[dir=rtl] .todo-list .todo-list__label > span[contenteditable=false] > input { 237 | left: 0; 238 | margin-right: 0; 239 | right: -25px; 240 | margin-left: -15px; 241 | } 242 | /* @ckeditor/ckeditor5-list/theme/todolist.css */ 243 | .ck-editor__editable.ck-content .todo-list .todo-list__label > span[contenteditable=false] > input::before { 244 | display: block; 245 | position: absolute; 246 | box-sizing: border-box; 247 | content: ''; 248 | width: 100%; 249 | height: 100%; 250 | border: 1px solid hsl(0, 0%, 20%); 251 | border-radius: 2px; 252 | transition: 250ms ease-in-out box-shadow; 253 | } 254 | /* @ckeditor/ckeditor5-list/theme/todolist.css */ 255 | .ck-editor__editable.ck-content .todo-list .todo-list__label > span[contenteditable=false] > input::after { 256 | display: block; 257 | position: absolute; 258 | box-sizing: content-box; 259 | pointer-events: none; 260 | content: ''; 261 | left: calc( var(--ck-todo-list-checkmark-size) / 3 ); 262 | top: calc( var(--ck-todo-list-checkmark-size) / 5.3 ); 263 | width: calc( var(--ck-todo-list-checkmark-size) / 5.3 ); 264 | height: calc( var(--ck-todo-list-checkmark-size) / 2.6 ); 265 | border-style: solid; 266 | border-color: transparent; 267 | border-width: 0 calc( var(--ck-todo-list-checkmark-size) / 8 ) calc( var(--ck-todo-list-checkmark-size) / 8 ) 0; 268 | transform: rotate(45deg); 269 | } 270 | /* @ckeditor/ckeditor5-list/theme/todolist.css */ 271 | .ck-editor__editable.ck-content .todo-list .todo-list__label > span[contenteditable=false] > input[checked]::before { 272 | background: hsl(126, 64%, 41%); 273 | border-color: hsl(126, 64%, 41%); 274 | } 275 | /* @ckeditor/ckeditor5-list/theme/todolist.css */ 276 | .ck-editor__editable.ck-content .todo-list .todo-list__label > span[contenteditable=false] > input[checked]::after { 277 | border-color: hsl(0, 0%, 100%); 278 | } 279 | /* @ckeditor/ckeditor5-list/theme/todolist.css */ 280 | .ck-editor__editable.ck-content .todo-list .todo-list__label.todo-list__label_without-description input[type=checkbox] { 281 | position: absolute; 282 | } 283 | /* @ckeditor/ckeditor5-list/theme/list.css */ 284 | .ck-content ol { 285 | list-style-type: decimal; 286 | } 287 | /* @ckeditor/ckeditor5-list/theme/list.css */ 288 | .ck-content ol ol { 289 | list-style-type: lower-latin; 290 | } 291 | /* @ckeditor/ckeditor5-list/theme/list.css */ 292 | .ck-content ol ol ol { 293 | list-style-type: lower-roman; 294 | } 295 | /* @ckeditor/ckeditor5-list/theme/list.css */ 296 | .ck-content ol ol ol ol { 297 | list-style-type: upper-latin; 298 | } 299 | /* @ckeditor/ckeditor5-list/theme/list.css */ 300 | .ck-content ol ol ol ol ol { 301 | list-style-type: upper-roman; 302 | } 303 | /* @ckeditor/ckeditor5-list/theme/list.css */ 304 | .ck-content ul { 305 | list-style-type: disc; 306 | } 307 | /* @ckeditor/ckeditor5-list/theme/list.css */ 308 | .ck-content ul ul { 309 | list-style-type: circle; 310 | } 311 | /* @ckeditor/ckeditor5-list/theme/list.css */ 312 | .ck-content ul ul ul { 313 | list-style-type: square; 314 | } 315 | /* @ckeditor/ckeditor5-list/theme/list.css */ 316 | .ck-content ul ul ul ul { 317 | list-style-type: square; 318 | } 319 | /* @ckeditor/ckeditor5-image/theme/image.css */ 320 | .ck-content .image { 321 | display: table; 322 | clear: both; 323 | text-align: center; 324 | margin: 0.9em auto; 325 | min-width: 50px; 326 | } 327 | /* @ckeditor/ckeditor5-image/theme/image.css */ 328 | .ck-content .image img { 329 | display: block; 330 | margin: 0 auto; 331 | max-width: 100%; 332 | min-width: 100%; 333 | height: auto; 334 | } 335 | /* @ckeditor/ckeditor5-image/theme/image.css */ 336 | .ck-content .image-inline { 337 | /* 338 | * Normally, the .image-inline would have "display: inline-block" and "img { width: 100% }" (to follow the wrapper while resizing).; 339 | * Unfortunately, together with "srcset", it gets automatically stretched up to the width of the editing root. 340 | * This strange behavior does not happen with inline-flex. 341 | */ 342 | display: inline-flex; 343 | max-width: 100%; 344 | align-items: flex-start; 345 | } 346 | /* @ckeditor/ckeditor5-image/theme/image.css */ 347 | .ck-content .image-inline picture { 348 | display: flex; 349 | } 350 | /* @ckeditor/ckeditor5-image/theme/image.css */ 351 | .ck-content .image-inline picture, 352 | .ck-content .image-inline img { 353 | flex-grow: 1; 354 | flex-shrink: 1; 355 | max-width: 100%; 356 | } 357 | /* @ckeditor/ckeditor5-image/theme/imageresize.css */ 358 | .ck-content img.image_resized { 359 | height: auto; 360 | } 361 | /* @ckeditor/ckeditor5-image/theme/imageresize.css */ 362 | .ck-content .image.image_resized { 363 | max-width: 100%; 364 | display: block; 365 | box-sizing: border-box; 366 | } 367 | /* @ckeditor/ckeditor5-image/theme/imageresize.css */ 368 | .ck-content .image.image_resized img { 369 | width: 100%; 370 | } 371 | /* @ckeditor/ckeditor5-image/theme/imageresize.css */ 372 | .ck-content .image.image_resized > figcaption { 373 | display: block; 374 | } 375 | /* @ckeditor/ckeditor5-image/theme/imagecaption.css */ 376 | .ck-content .image > figcaption { 377 | display: table-caption; 378 | caption-side: bottom; 379 | word-break: break-word; 380 | color: var(--ck-color-image-caption-text); 381 | background-color: var(--ck-color-image-caption-background); 382 | padding: .6em; 383 | font-size: .75em; 384 | outline-offset: -1px; 385 | } 386 | /* @ckeditor/ckeditor5-image/theme/imagestyle.css */ 387 | .ck-content .image-style-block-align-left, 388 | .ck-content .image-style-block-align-right { 389 | max-width: calc(100% - var(--ck-image-style-spacing)); 390 | } 391 | /* @ckeditor/ckeditor5-image/theme/imagestyle.css */ 392 | .ck-content .image-style-align-left, 393 | .ck-content .image-style-align-right { 394 | clear: none; 395 | } 396 | /* @ckeditor/ckeditor5-image/theme/imagestyle.css */ 397 | .ck-content .image-style-side { 398 | float: right; 399 | margin-left: var(--ck-image-style-spacing); 400 | max-width: 50%; 401 | } 402 | /* @ckeditor/ckeditor5-image/theme/imagestyle.css */ 403 | .ck-content .image-style-align-left { 404 | float: left; 405 | margin-right: var(--ck-image-style-spacing); 406 | } 407 | /* @ckeditor/ckeditor5-image/theme/imagestyle.css */ 408 | .ck-content .image-style-align-center { 409 | margin-left: auto; 410 | margin-right: auto; 411 | } 412 | /* @ckeditor/ckeditor5-image/theme/imagestyle.css */ 413 | .ck-content .image-style-align-right { 414 | float: right; 415 | margin-left: var(--ck-image-style-spacing); 416 | } 417 | /* @ckeditor/ckeditor5-image/theme/imagestyle.css */ 418 | .ck-content .image-style-block-align-right { 419 | margin-right: 0; 420 | margin-left: auto; 421 | } 422 | /* @ckeditor/ckeditor5-image/theme/imagestyle.css */ 423 | .ck-content .image-style-block-align-left { 424 | margin-left: 0; 425 | margin-right: auto; 426 | } 427 | /* @ckeditor/ckeditor5-image/theme/imagestyle.css */ 428 | .ck-content p + .image-style-align-left, 429 | .ck-content p + .image-style-align-right, 430 | .ck-content p + .image-style-side { 431 | margin-top: 0; 432 | } 433 | /* @ckeditor/ckeditor5-image/theme/imagestyle.css */ 434 | .ck-content .image-inline.image-style-align-left, 435 | .ck-content .image-inline.image-style-align-right { 436 | margin-top: var(--ck-inline-image-style-spacing); 437 | margin-bottom: var(--ck-inline-image-style-spacing); 438 | } 439 | /* @ckeditor/ckeditor5-image/theme/imagestyle.css */ 440 | .ck-content .image-inline.image-style-align-left { 441 | margin-right: var(--ck-inline-image-style-spacing); 442 | } 443 | /* @ckeditor/ckeditor5-image/theme/imagestyle.css */ 444 | .ck-content .image-inline.image-style-align-right { 445 | margin-left: var(--ck-inline-image-style-spacing); 446 | } 447 | /* @ckeditor/ckeditor5-highlight/theme/highlight.css */ 448 | .ck-content .marker-yellow { 449 | background-color: var(--ck-highlight-marker-yellow); 450 | } 451 | /* @ckeditor/ckeditor5-highlight/theme/highlight.css */ 452 | .ck-content .marker-green { 453 | background-color: var(--ck-highlight-marker-green); 454 | } 455 | /* @ckeditor/ckeditor5-highlight/theme/highlight.css */ 456 | .ck-content .marker-pink { 457 | background-color: var(--ck-highlight-marker-pink); 458 | } 459 | /* @ckeditor/ckeditor5-highlight/theme/highlight.css */ 460 | .ck-content .marker-blue { 461 | background-color: var(--ck-highlight-marker-blue); 462 | } 463 | /* @ckeditor/ckeditor5-highlight/theme/highlight.css */ 464 | .ck-content .pen-red { 465 | color: var(--ck-highlight-pen-red); 466 | background-color: transparent; 467 | } 468 | /* @ckeditor/ckeditor5-highlight/theme/highlight.css */ 469 | .ck-content .pen-green { 470 | color: var(--ck-highlight-pen-green); 471 | background-color: transparent; 472 | } 473 | /* @ckeditor/ckeditor5-block-quote/theme/blockquote.css */ 474 | .ck-content blockquote { 475 | overflow: hidden; 476 | padding-right: 1.5em; 477 | padding-left: 1.5em; 478 | margin-left: 0; 479 | margin-right: 0; 480 | font-style: italic; 481 | border-left: solid 5px hsl(0, 0%, 80%); 482 | } 483 | /* @ckeditor/ckeditor5-block-quote/theme/blockquote.css */ 484 | .ck-content[dir="rtl"] blockquote { 485 | border-left: 0; 486 | border-right: solid 5px hsl(0, 0%, 80%); 487 | } 488 | /* @ckeditor/ckeditor5-basic-styles/theme/code.css */ 489 | .ck-content code { 490 | background-color: hsla(0, 0%, 78%, 0.3); 491 | padding: .15em; 492 | border-radius: 2px; 493 | } 494 | /* @ckeditor/ckeditor5-font/theme/fontsize.css */ 495 | .ck-content .text-tiny { 496 | font-size: .7em; 497 | } 498 | /* @ckeditor/ckeditor5-font/theme/fontsize.css */ 499 | .ck-content .text-small { 500 | font-size: .85em; 501 | } 502 | /* @ckeditor/ckeditor5-font/theme/fontsize.css */ 503 | .ck-content .text-big { 504 | font-size: 1.4em; 505 | } 506 | /* @ckeditor/ckeditor5-font/theme/fontsize.css */ 507 | .ck-content .text-huge { 508 | font-size: 1.8em; 509 | } 510 | /* @ckeditor/ckeditor5-mention/theme/mention.css */ 511 | .ck-content .mention { 512 | background: var(--ck-color-mention-background); 513 | color: var(--ck-color-mention-text); 514 | } 515 | /* @ckeditor/ckeditor5-horizontal-line/theme/horizontalline.css */ 516 | .ck-content hr { 517 | margin: 15px 0; 518 | height: 4px; 519 | background: hsl(0, 0%, 87%); 520 | border: 0; 521 | } 522 | /* @ckeditor/ckeditor5-code-block/theme/codeblock.css */ 523 | .ck-content pre { 524 | padding: 1em; 525 | color: hsl(0, 0%, 20.8%); 526 | background: hsla(0, 0%, 78%, 0.3); 527 | border: 1px solid hsl(0, 0%, 77%); 528 | border-radius: 2px; 529 | text-align: left; 530 | direction: ltr; 531 | tab-size: 4; 532 | white-space: pre-wrap; 533 | font-style: normal; 534 | min-width: 200px; 535 | } 536 | /* @ckeditor/ckeditor5-code-block/theme/codeblock.css */ 537 | .ck-content pre code { 538 | background: unset; 539 | padding: 0; 540 | border-radius: 0; 541 | } 542 | @media print { 543 | /* @ckeditor/ckeditor5-page-break/theme/pagebreak.css */ 544 | .ck-content .page-break { 545 | padding: 0; 546 | } 547 | /* @ckeditor/ckeditor5-page-break/theme/pagebreak.css */ 548 | .ck-content .page-break::after { 549 | display: none; 550 | } 551 | } 552 | -------------------------------------------------------------------------------- /trilium-simple-mind-map/CopyImageReferenceButton.js: -------------------------------------------------------------------------------- 1 | const TPL = ` 2 | `; 9 | 10 | class CopyImageReferenceButton extends api.NoteContextAwareWidget { 11 | static get parentWidget() { 12 | return "note-detail-pane"; 13 | } 14 | isEnabled() { 15 | return super.isEnabled() 16 | && this.note.type === 'code' 17 | && this.note.mime==="application/json" 18 | && this.note.hasLabel(config.NOTE_LABEL) 19 | && this.note.isContentAvailable() 20 | && this.noteContext?.viewScope.viewMode === 'default'; 21 | } 22 | 23 | doRender() { 24 | super.doRender(); 25 | 26 | this.$widget = $(TPL); 27 | this.$hiddenImageCopy = this.$widget.find(".hidden-image-copy"); 28 | this.moveFlag = false; 29 | 30 | this.$widget.on('click', () => { 31 | let searchString = `#${config.NOTE_LABEL_ATTACHMENT} AND note.parents.noteId='${this.note.noteId}' AND note.title=*'${config.IMAGE_NOTE_TITLE}' orderBy note.dateModified desc`; 32 | utils.getImageNote(searchString).then((res) => { 33 | if(!res){ 34 | api.showMessage("复制图像引用失败,请先保存图像附件!"); 35 | return; 36 | } 37 | this.$hiddenImageCopy.empty().append( 38 | $("").attr("src", utils.createImageSrcUrl(res.noteId, res.title)) 39 | ); 40 | 41 | utils.copyImageReferenceToClipboard(this.$hiddenImageCopy); 42 | api.showMessage("记得保存图像附件,以保持图像引用最新!"); 43 | this.$hiddenImageCopy.empty(); 44 | }); 45 | }); 46 | /* 47 | this.$widget.on('click', () => { 48 | utils.getImageAttachment(this.note.noteId, config.IMAGE_NOTE_TITLE).then((res) => { 49 | if(!res){ 50 | api.showMessage("复制图像引用失败,请先保存图像附件!"); 51 | return; 52 | } 53 | this.$hiddenImageCopy.empty().append( 54 | $("").attr("src", utils.createImageAttachmentSrcUrl(res.attachmentId, res.title)) 55 | ); 56 | 57 | utils.copyImageReferenceToClipboard(this.$hiddenImageCopy); 58 | api.showMessage("记得保存图像附件,以保持图像引用最新!"); 59 | this.$hiddenImageCopy.empty(); 60 | }); 61 | }); 62 | */ 63 | this.contentSized(); 64 | } 65 | 66 | async refreshWithNote(note) { 67 | if(!this.moveFlag){ 68 | this.$widget.prependTo(this.$widget.parent().find('.floating-buttons-children')); 69 | this.moveFlag = true; 70 | } 71 | } 72 | } 73 | 74 | module.exports = CopyImageReferenceButton; -------------------------------------------------------------------------------- /trilium-simple-mind-map/CopyImageReferenceButton/config.js: -------------------------------------------------------------------------------- 1 | const NOTE_LABEL = 'simpleMindMap'; 2 | const NOTE_LABEL_ATTACHMENT = 'smmImageAttachment'; 3 | const IMAGE_NOTE_TITLE = 'simple-mind-map-export'; 4 | 5 | module.exports = { 6 | NOTE_LABEL, 7 | NOTE_LABEL_ATTACHMENT, 8 | IMAGE_NOTE_TITLE 9 | } -------------------------------------------------------------------------------- /trilium-simple-mind-map/CopyImageReferenceButton/utils.js: -------------------------------------------------------------------------------- 1 | function copyImageReferenceToClipboard($imageWrapper) { 2 | try { 3 | $imageWrapper.attr('contenteditable', 'true'); 4 | selectImage($imageWrapper.get(0)); 5 | 6 | const success = document.execCommand('copy'); 7 | 8 | if (success) { 9 | api.showMessage("Image copied to the clipboard"); 10 | } else { 11 | api.showMessage("Could not copy the image to clipboard."); 12 | } 13 | } 14 | finally { 15 | window.getSelection().removeAllRanges(); 16 | $imageWrapper.removeAttr('contenteditable'); 17 | } 18 | } 19 | 20 | function selectImage(element) { 21 | const selection = window.getSelection(); 22 | const range = document.createRange(); 23 | range.selectNodeContents(element); 24 | selection.removeAllRanges(); 25 | selection.addRange(range); 26 | } 27 | 28 | function createImageSrcUrl(noteId, title) { 29 | return `api/images/${noteId}/${encodeURIComponent(title)}?timestamp=${Date.now()}`; 30 | } 31 | 32 | function createImageAttachmentSrcUrl(attachmentId, title){ 33 | return `api/attachments/${attachmentId}/image/${encodeURIComponent(title)}?timestamp=${Date.now()}`; 34 | } 35 | 36 | async function getImageNote(searchString) { 37 | return await api.runOnBackend((searchString) => { 38 | let imageNote = api.searchForNote(searchString); 39 | return imageNote; 40 | }, [searchString]); 41 | } 42 | 43 | async function getImageAttachment(parentNodeId, attachmentTitle) { 44 | return await api.runAsyncOnBackendWithManualTransactionHandling(async(parentNodeId, attachmentTitle) => { 45 | let note = await api.getNote(parentNodeId); 46 | let imageAttachment = note.getAttachmentByTitle(attachmentTitle); 47 | return imageAttachment; 48 | }, [parentNodeId, attachmentTitle]); 49 | } 50 | 51 | module.exports = { 52 | copyImageReferenceToClipboard, 53 | createImageSrcUrl, 54 | getImageNote, 55 | createImageAttachmentSrcUrl, 56 | getImageAttachment 57 | }; -------------------------------------------------------------------------------- /trilium-simple-mind-map/NoteTemplate/simple-mind-map.json: -------------------------------------------------------------------------------- 1 | {"layout":"logicalStructure","root":{"data":{"text":"

根节点

","expand":true,"richText":true,"isActive":false,"uid":"b6f00b3a-f107-4dfb-a1a3-f1df34069865"},"children":[{"data":{"text":"

二级节点

","generalization":{"text":"

概要

","richText":true,"expand":true,"isActive":false},"richText":true,"expand":true,"isActive":false,"uid":"6e2641ce-b72f-4b11-be24-ac7bac300ee2"},"children":[{"data":{"text":"

分支主题

","richText":true,"expand":true,"isActive":false,"uid":"015aaa91-27f4-4b35-bb0d-743a4e275f49"},"children":[]},{"data":{"text":"

分支主题

","richText":true,"expand":true,"isActive":false,"uid":"ac360f19-13e7-4976-afe5-4de8ef67dbf1"},"children":[]}]}]},"theme":{"template":"classic4","config":{}},"view":{"transform":{"scaleX":1,"scaleY":1,"shear":0,"rotate":0,"translateX":-7.60003662109375,"translateY":-107.88125610351562,"originX":0,"originY":0,"a":1,"b":0,"c":0,"d":1,"e":-7.60003662109375,"f":-107.88125610351562},"state":{"scale":1,"x":-7.60003662109375,"y":-107.88125610351562,"sx":0,"sy":0}}} -------------------------------------------------------------------------------- /trilium-simple-mind-map/SmmLinkRender.js: -------------------------------------------------------------------------------- 1 | /* 2 | 测试版本 3 | 使用此插件时,请注意备份数据 4 | */ 5 | const MindMap = simpleMindMapcommonjs.default; 6 | const Themes = themescjsminjs.default; 7 | Themes.init(MindMap); 8 | customThemeList.forEach(themeConfig=>{ 9 | MindMap.defineTheme(themeConfig.value, themeConfig.theme); 10 | }); 11 | const themeList = [ 12 | { 13 | name: '默认主题', 14 | value: 'default', 15 | dark: false 16 | }, 17 | ...Themes.lightList, ...Themes.darkList, ...customThemeList]; 18 | 19 | const TPL = `
`; 20 | 21 | class SmmLinkRender extends api.NoteContextAwareWidget { 22 | static get parentWidget() { 23 | return "note-detail-pane"; 24 | } 25 | isEnabled() { 26 | return super.isEnabled(); 27 | } 28 | 29 | doRender() { 30 | super.doRender(); 31 | this.$widget = $(TPL); 32 | $(document).on("mouseenter", "a", mouseEnterHandler); 33 | } 34 | 35 | async refreshWithNote(note) { 36 | } 37 | } 38 | 39 | function mouseEnterHandler() { 40 | setTimeout(async () => { 41 | const $link = $(this); 42 | const url = $link.attr("href") || $link.attr("data-href"); 43 | const linkId = $link.attr("data-link-id") || ""; 44 | if(url===""||linkId === ""){ 45 | return; 46 | } 47 | const noteId = getNoteIdFromUrl(url); 48 | if(noteId === null){ 49 | return; 50 | } 51 | const content = await utils.getData(noteId); 52 | if(content===null){ 53 | return; 54 | } 55 | 56 | const $el = $(document).find(`.${linkId}`); 57 | 58 | $el.find(".rendered-content").empty().append($(`
`)) 59 | 60 | const mind_note_obj = JSON.parse(content); 61 | 62 | let theme = mind_note_obj.theme.template; 63 | let not_find_theme = false; 64 | if(themeList.findIndex(t=>{return t.value==theme}) === -1){ 65 | // 替换主题,让导图能正常加载 66 | mind_note_obj.theme.template = "classic4"; 67 | not_find_theme = true; 68 | } 69 | 70 | const mindMap = new MindMap({ 71 | el: document.getElementById(`mindMapContainer-${linkId}`), 72 | //initRootNodePosition: ['center', 'left'], 73 | readonly: true 74 | }); 75 | mindMap.setFullData(mind_note_obj); 76 | if(not_find_theme){ 77 | // 重新加载主题,修复字体颜色错误 78 | mindMap.setTheme("classic4"); 79 | } 80 | }, 550); 81 | } 82 | function refreshIncludedNote($container, noteId) { 83 | if ($container) { 84 | $container.find(`section[data-note-id="${noteId}"]`).each((_, el) => { 85 | this.loadIncludedNote(noteId, $(el)); 86 | }); 87 | } 88 | } 89 | 90 | function getNoteIdFromUrl(urlOrNotePath) { 91 | if (!urlOrNotePath) { 92 | return null; 93 | } 94 | 95 | const hashIdx = urlOrNotePath.indexOf('#'); 96 | if (hashIdx === -1) { 97 | return null; 98 | } 99 | 100 | const hash = urlOrNotePath.substr(hashIdx + 1); // strip also the initial '#' 101 | const [notePath, paramString] = hash.split("?"); 102 | 103 | if (!notePath.match(/^[_a-z0-9]{4,}(\/[_a-z0-9]{4,})*$/i)) { 104 | return null; 105 | } 106 | 107 | const segments = notePath.split("/"); 108 | 109 | return segments[segments.length - 1]; 110 | } 111 | 112 | module.exports = SmmLinkRender; -------------------------------------------------------------------------------- /trilium-simple-mind-map/SmmLinkRender/customThemeList.clone.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | customThemeList 9 | 10 | 11 | 12 |
13 |

customThemeList

14 | 15 |
16 |

这是一个笔记的克隆, 跳转到它的主目录.

17 |
18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /trilium-simple-mind-map/SmmLinkRender/simpleMindMap.common.js.clone.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | simpleMindMap.common.js 9 | 10 | 11 | 12 |
13 |

simpleMindMap.common.js

14 | 15 |
16 |

这是一个笔记的克隆, 跳转到它的主目录.

17 |
18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /trilium-simple-mind-map/SmmLinkRender/themes.cjs.min.js.clone.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | themes.cjs.min.js 9 | 10 | 11 | 12 |
13 |

themes.cjs.min.js

14 | 15 |
16 |

这是一个笔记的克隆, 跳转到它的主目录.

17 |
18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /trilium-simple-mind-map/SmmLinkRender/utils.js: -------------------------------------------------------------------------------- 1 | async function getData(noteId) { 2 | const data = await api.runOnBackend((noteId) => { 3 | const note = api.searchForNote(`#SimpleMindMap and note.noteId="${noteId}"`); 4 | if(note!==null){ 5 | return note.getContent(); 6 | }else{ 7 | return null; 8 | } 9 | }, [noteId]); 10 | return data; 11 | } 12 | 13 | module.exports = { 14 | getData 15 | } -------------------------------------------------------------------------------- /trilium-simple-mind-map/SmmTextNoteRenderWidget.js: -------------------------------------------------------------------------------- 1 | const TEMPLATE = ` 2 | 3 | `; 14 | 15 | 16 | class SmmTextNoteRenderWidget extends api.NoteContextAwareWidget { 17 | constructor(...args) { 18 | super(...args); 19 | this.isFirstRun = true; 20 | } 21 | 22 | get position() { 23 | return 100; 24 | } 25 | 26 | get parentWidget() { return 'center-pane'; } 27 | 28 | isEnabled() { 29 | return super.isEnabled() 30 | && this.note.type === 'text'; 31 | } 32 | 33 | doRender() { 34 | this.$widget = $(TEMPLATE); 35 | this.$widget.hide(); 36 | 37 | return this.$widget; 38 | } 39 | 40 | async noteSwitchedEvent({noteContext, notePath}) { 41 | super.noteSwitchedEvent({noteContext, notePath}); 42 | } 43 | 44 | async injectLoadIncludedNote(textEditor){ 45 | if(this.isFirstRun){ 46 | // 适配next 47 | if(!this.isReadOnly){ 48 | if(textEditor==null){ 49 | return; 50 | } 51 | } 52 | this.isFirstRun = false; 53 | var getNoteContainer = async ()=> { 54 | if (this.isReadOnly) { 55 | return await this.noteContext.getContentElement(); 56 | } else { 57 | return $(textEditor.editing.view.getDomRoot()); 58 | } 59 | } 60 | const $content = await getNoteContainer(); 61 | const component = glob.getComponentByEl($content); 62 | // component => ReadOnlyTextTypeWidget => AbstractTextTypeWidget 63 | const AbstractTextTypeWidget = Object.getPrototypeOf(Object.getPrototypeOf(component)); 64 | const _loadIncludedNote = AbstractTextTypeWidget.loadIncludedNote; 65 | AbstractTextTypeWidget.loadIncludedNote = async (noteId, $el) => { 66 | const note = await api.getNote(noteId); 67 | const blob = await note.getBlob(); 68 | if(note.getAttributeValue("label", "simpleMindMap")==null){ 69 | await _loadIncludedNote(noteId, $el); 70 | }else{ 71 | const containerElId = Math.random().toString(36).substr(2, 9); 72 | const tpl = `
73 |
74 |
`; 114 | $el.empty().append($(tpl)); 115 | } 116 | } 117 | if(this.isReadOnly){ 118 | $content.find("section").each(async (_, el) => { 119 | const noteId = $(el).attr('data-note-id'); 120 | component.loadIncludedNote(noteId, $(el)); 121 | }); 122 | } 123 | } 124 | } 125 | 126 | async refreshWithNote(note) { 127 | if (this.note.type === 'text') { 128 | const noteContext = this.noteContext; 129 | this.isReadOnly = await noteContext.isReadOnly(); 130 | if(this.isFirstRun){ 131 | $(document).ready(async ()=>{ 132 | setTimeout(async ()=>{ 133 | const editor = await api.getActiveContextTextEditor(); 134 | await this.injectLoadIncludedNote(editor); 135 | }, 100); 136 | // 重载编辑器内容 137 | await api.activateNote(this.note.noteId) 138 | }) 139 | } 140 | } 141 | } 142 | 143 | async entitiesReloadedEvent({loadResults}) { 144 | if (loadResults.isNoteContentReloaded(this.noteId)) { 145 | this.refresh(); 146 | } 147 | } 148 | } 149 | 150 | const widget = new SmmTextNoteRenderWidget() 151 | module.exports = widget; -------------------------------------------------------------------------------- /trilium-simple-mind-map/TriliumSmmWidget.js: -------------------------------------------------------------------------------- 1 | //let TPL = await utils.getData(config.SMM_TPL_NOTE_ID); 2 | //TPL = eval('`'+TPL+'`'); 3 | 4 | let TPL = await utils.renderEjsTemplate(config.SMM_TPL_NOTE_ID,{config}); 5 | 6 | let cssArr = await utils.getNoteConetntList(config.CSS_NOTE_ID_LIST); 7 | let styles = cssArr.join("\n\n"); 8 | 9 | let WIDGET_TPL = `
10 |
11 |
`; 12 | 13 | class SmmWidget extends api.NoteContextAwareWidget { 14 | static get parentWidget() { 15 | return "note-detail-pane"; 16 | } 17 | 18 | isEnabled() { 19 | return super.isEnabled() 20 | && this.note.type === 'code' 21 | && this.note.mime==="application/json" 22 | && this.note.hasLabel('simpleMindMap') 23 | && this.note.isContentAvailable() 24 | && this.noteContext?.viewScope.viewMode === 'default'; 25 | } 26 | 27 | async doRender() { 28 | this.$widget = $(WIDGET_TPL); 29 | this.contentSized(); 30 | this.cssBlock(styles); 31 | this.$render = this.$widget.find('.smm-render'); 32 | this.$render.attr('id', this.componentId); 33 | return this.$widget; 34 | } 35 | 36 | async renderWidget() { 37 | let $template = $(TPL); 38 | this.$render.html($template); 39 | this.renderQuickSearchWidget(); 40 | this.smmRender = new SmmRender(); 41 | await this.smmRender.init(this); 42 | 43 | this.smmRender.register_backdrop([{id:"iconListBackdrop",obj:new SmmIconWidget(this.smmRender)}]); 44 | this.renderRichTextToolbarWidget(); 45 | } 46 | 47 | renderRichTextToolbarWidget() { 48 | let $components = this.$render.find(".smm-components-container"); 49 | this.rrtToolbar = new RichTextToolbarWidget(this.smmRender, config); 50 | $components.append(this.rrtToolbar.doRender()); 51 | } 52 | 53 | renderQuickSearchWidget() { 54 | let $backdrops = this.$render.find(".smm-backdrops-container"); 55 | let $modalBody = $backdrops.find("#urlLinkBackdrop .modal-body"); 56 | this.qsWidget = new QuickSearchWidget((e, noteLink)=>{ 57 | if (!e.target || e.target.nodeName !== 'A') { 58 | $backdrops.find('#urlLinkBackdrop input[name="urlLinkContent"]').val(noteLink.url); 59 | $backdrops.find('#urlLinkBackdrop input[name="urlTextContent"]').val(noteLink.title); 60 | } 61 | }, false); 62 | $modalBody.append(this.qsWidget.doRender()); 63 | } 64 | 65 | async refreshWithNote(note) { 66 | $(document).ready(async()=>{ 67 | await this.refreshWidget(); 68 | }); 69 | } 70 | 71 | async refreshWidget() { 72 | await this.renderWidget(); 73 | } 74 | } 75 | 76 | module.exports = SmmWidget; -------------------------------------------------------------------------------- /trilium-simple-mind-map/TriliumSmmWidget/QuickSearchWidget.js: -------------------------------------------------------------------------------- 1 | const TPL = ` 2 | 27 |
`; 28 | 29 | const MAX_DISPLAYED_NOTES = 15; 30 | 31 | class QuickSearchWidget extends api.BasicWidget{ 32 | constructor(callback, isShowUrl=true) { 33 | super(); 34 | this.callback = callback; 35 | this.isShowUrl = isShowUrl; 36 | } 37 | 38 | doRender() { 39 | this.$widget = $(TPL); 40 | 41 | this.$searchString = this.$widget.find('.search-string'); 42 | this.$dropdownMenu = this.$widget.find('.dropdown-menu'); 43 | this.$dropdownToggle = this.$widget.find('.search-button'); 44 | this.$dropdownToggle.dropdown(); 45 | 46 | this.$widget.find('.input-group-prepend').on('shown.bs.dropdown', () => this.search()); 47 | 48 | this.$searchString.keydown(e =>{ 49 | if(e.which === 13) { 50 | if (this.$dropdownMenu.is(":visible")) { 51 | this.search(); // just update already visible dropdown 52 | } else { 53 | this.$dropdownToggle.dropdown('show'); 54 | } 55 | e.preventDefault(); 56 | e.stopPropagation(); 57 | } 58 | }) 59 | 60 | return this.$widget; 61 | } 62 | 63 | async search() { 64 | const searchString = this.$searchString.val().trim(); 65 | 66 | if (!searchString) { 67 | this.$dropdownToggle.dropdown("hide"); 68 | return; 69 | } 70 | 71 | this.$dropdownMenu.empty(); 72 | this.$dropdownMenu.append(' Searching ...'); 73 | 74 | const searchResultNotes = await api.searchForNotes(searchString); 75 | 76 | const displayedNotes = searchResultNotes.slice(0, Math.min(MAX_DISPLAYED_NOTES, searchResultNotes.length)); 77 | 78 | this.$dropdownMenu.empty(); 79 | 80 | if (displayedNotes.length === 0) { 81 | this.$dropdownMenu.append('No results found'); 82 | } 83 | 84 | for (const note of displayedNotes) { 85 | const $link = await api.createLink(note.noteId, {showNotePath: true,showNoteIcon:true}); 86 | const $a = $link.find("a"); 87 | $link.addClass('dropdown-item'); 88 | $link.attr("tabIndex", "0"); 89 | let urlLink = $a.attr("href"); 90 | let urlTitle = $a.text(); 91 | if(!this.isShowUrl){ 92 | $a.replaceWith($(`${urlTitle}`)) 93 | } 94 | $link.on('click', e => { 95 | this.$dropdownToggle.dropdown("hide"); 96 | 97 | this.callback(e, {url:urlLink, title:urlTitle}); 98 | }); 99 | 100 | this.$dropdownMenu.append($link); 101 | } 102 | 103 | if (searchResultNotes.length > MAX_DISPLAYED_NOTES) { 104 | this.$dropdownMenu.append(`... and ${searchResultNotes.length - MAX_DISPLAYED_NOTES} more results.`); 105 | } 106 | 107 | this.$dropdownToggle.dropdown('update'); 108 | } 109 | } 110 | 111 | module.exports = QuickSearchWidget; -------------------------------------------------------------------------------- /trilium-simple-mind-map/TriliumSmmWidget/RichTextToolbarWidget.js: -------------------------------------------------------------------------------- 1 | let TPL = ` 2 |
3 | 71 | 72 |
73 |
74 | 75 |
76 |
77 | 78 |
79 |
80 | 81 |
82 |
83 | 84 |
85 |
86 | 87 |
88 |
89 |
`; 90 | 91 | class RichTextToolbarWidget extends api.BasicWidget { 92 | constructor(smmRender, config){ 93 | super(); 94 | this.smmRender = smmRender; 95 | this.mindMap = smmRender.mindMap; 96 | this.config = config; 97 | this.showRichTextToolbar = false; 98 | this.style = { 99 | left: 200, 100 | top: 100 101 | } 102 | this.fontColor = ''; 103 | this.fontBackgroundColor = ''; 104 | this.formatInfo = {}; 105 | } 106 | 107 | doRender() { 108 | this.$widget = $(TPL); 109 | this.$richTextToolbar = this.$widget.find('.richTextToolbar'); 110 | this.$richTextToolbar.css(this.style); 111 | 112 | this.$boldBtn = this.$richTextToolbar.find('#smmRichTextBoldBtn'); 113 | this.$italicBtn = this.$richTextToolbar.find('#smmRichTextItalicBtn'); 114 | this.$underlineBtn = this.$richTextToolbar.find('#smmRichTextUnderlineBtn'); 115 | this.$strikeBtn = this.$richTextToolbar.find('#smmRichTextStrikeBtn'); 116 | this.$removeFormatBtn = this.$richTextToolbar.find('#smmRichTextRemoveFormatBtn'); 117 | 118 | this.registerEvent(); 119 | this.toggleShowToolBar(); 120 | return this.$widget; 121 | } 122 | 123 | registerEvent() { 124 | this.onRichTextSelectionChange = (hasRange, rect, formatInfo) => { 125 | if (hasRange) { 126 | this.style.left = rect.left + rect.width / 2 + 'px'; 127 | this.style.top = rect.top - 60 + 'px'; 128 | this.formatInfo = {... (formatInfo || {})} 129 | } 130 | this.showRichTextToolbar = hasRange; 131 | this.toggleShowToolBar(); 132 | this.toggleBtnActive(); 133 | } 134 | 135 | this.toggleBold = () => { 136 | this.setFormatInfo("bold"); 137 | this.mindMap.richText.formatText({ 138 | bold: this.formatInfo.bold 139 | }) 140 | } 141 | 142 | this.toggleItalic = () => { 143 | this.setFormatInfo("italic"); 144 | this.mindMap.richText.formatText({ 145 | italic: this.formatInfo.italic 146 | }) 147 | } 148 | 149 | this.toggleUnderline = () => { 150 | this.setFormatInfo("underline"); 151 | this.mindMap.richText.formatText({ 152 | underline: this.formatInfo.underline 153 | }) 154 | } 155 | 156 | this.toggleStrike = () => { 157 | this.setFormatInfo("strike"); 158 | this.mindMap.richText.formatText({ 159 | strike: this.formatInfo.strike 160 | }) 161 | } 162 | 163 | this.removeFormat = () => { 164 | this.mindMap.richText.removeFormat(); 165 | } 166 | 167 | 168 | this.mindMap.on('rich_text_selection_change', this.onRichTextSelectionChange); 169 | 170 | 171 | this.$boldBtn.on("click", this.toggleBold); 172 | this.$boldBtn.attr("title", this.config.lang.richTextToolbar.bold); 173 | 174 | this.$italicBtn.click(this.toggleItalic); 175 | this.$italicBtn.attr("title", this.config.lang.richTextToolbar.italic); 176 | 177 | this.$underlineBtn.click(this.toggleUnderline); 178 | this.$underlineBtn.attr("title", this.config.lang.richTextToolbar.underline); 179 | 180 | this.$strikeBtn.click(this.toggleStrike); 181 | this.$strikeBtn.attr("title", this.config.lang.richTextToolbar.strike); 182 | 183 | this.$removeFormatBtn.click(this.removeFormat); 184 | this.$removeFormatBtn.attr("title", this.config.lang.richTextToolbar.removeFormat); 185 | } 186 | 187 | toggleShowToolBar() { 188 | if (this.showRichTextToolbar) { 189 | this.$widget.removeClass("hide"); 190 | } else { 191 | this.$widget.addClass("hide"); 192 | } 193 | this.$richTextToolbar.css(this.style); 194 | } 195 | 196 | toggleBtnActive() { 197 | if (this.formatInfo["bold"]) { 198 | this.$boldBtn.addClass("active"); 199 | } else { 200 | this.$boldBtn.removeClass("active"); 201 | } 202 | 203 | if (this.formatInfo["italic"]) { 204 | this.$italicBtn.addClass("active"); 205 | } else { 206 | this.$italicBtn.removeClass("active"); 207 | } 208 | 209 | if (this.formatInfo["underline"]) { 210 | this.$underlineBtn.addClass("active"); 211 | } else { 212 | this.$underlineBtn.removeClass("active"); 213 | } 214 | 215 | if (this.formatInfo["strike"]) { 216 | this.$strikeBtn.addClass("active"); 217 | } else { 218 | this.$strikeBtn.removeClass("active"); 219 | } 220 | } 221 | 222 | setFormatInfo(key){ 223 | if (key in this.formatInfo) { 224 | this.formatInfo[key] = !this.formatInfo[key] 225 | } else { 226 | this.formatInfo[key] = true; 227 | } 228 | this.toggleBtnActive(); 229 | } 230 | } 231 | 232 | module.exports = RichTextToolbarWidget; -------------------------------------------------------------------------------- /trilium-simple-mind-map/TriliumSmmWidget/SmmIconWidget.js: -------------------------------------------------------------------------------- 1 | const TPL = ` 2 |
3 | 50 |
51 |
52 |
53 |
`; 54 | 55 | class SmmIconWidget extends api.BasicWidget { 56 | constructor(smmRender){ 57 | super(); 58 | this.smmRender = smmRender; 59 | this.nodeIconList = smmRender.iconList; 60 | this.activeName = 'icon'; 61 | this.iconList = []; 62 | this.activeNodes = smmRender.activeNodes; 63 | } 64 | 65 | doRender() { 66 | this.$widget = $(TPL); 67 | this.$iconBox = this.$widget.find('.icon-box'); 68 | this.renderIconBoxItem(); 69 | return this.$widget; 70 | } 71 | 72 | renderIconBoxItem() { 73 | this.$iconBox.empty(); 74 | for (const item of this.nodeIconList) { 75 | let $iconBoxItem = $(`
`); 76 | let $iconTitle = $(`
${item.name}
`); 77 | $iconBoxItem.append($iconTitle); 78 | $iconBoxItem.append(this.renderIconList(item)); 79 | this.$iconBox.append($iconBoxItem); 80 | } 81 | } 82 | 83 | renderIconList(item) { 84 | let $iconList = $(`
`); 85 | for (const icon of item.list) { 86 | const $iconHtml = this.renderIcon(item.type, icon); 87 | $iconHtml.click(()=>{ 88 | this.setIcon(item.type, icon.name) 89 | }); 90 | $iconList.append($iconHtml); 91 | } 92 | return $iconList; 93 | } 94 | 95 | renderIcon(type, icon) { 96 | const $svg = $(this.getHtml(icon.icon)); 97 | const iconHtml = `
`; 98 | const $iconHtml = $(iconHtml).append($svg); 99 | return $iconHtml; 100 | } 101 | 102 | // 获取图标渲染方式 103 | getHtml(icon) { 104 | return /^`; 105 | } 106 | 107 | setIcon(type, name) { 108 | this.smmRender.activeNodes.forEach(node => { 109 | const iconList = [...(node.getData('icon') || [])]; 110 | let key = type + '_' + name; 111 | let index = iconList.findIndex(item => { 112 | return item === key; 113 | }) 114 | // 删除icon 115 | if (index !== -1) { 116 | iconList.splice(index, 1); 117 | } else { 118 | let typeIndex = iconList.findIndex(item => { 119 | return item.split('_')[0] === type; 120 | }) 121 | // 替换icon 122 | if (typeIndex !== -1) { 123 | iconList.splice(typeIndex, 1, key); 124 | } else { 125 | // 增加icon 126 | iconList.push(key); 127 | } 128 | } 129 | node.setIcon(iconList); 130 | if (this.smmRender.activeNodes.length === 1) { 131 | this.iconList = iconList; 132 | this.smmRender.set_icon_selected(iconList); 133 | } 134 | }) 135 | } 136 | } 137 | 138 | module.exports = SmmIconWidget; -------------------------------------------------------------------------------- /trilium-simple-mind-map/TriliumSmmWidget/SmmRender.js: -------------------------------------------------------------------------------- 1 | const MindMap = simpleMindMapcommonjs.default; 2 | const Themes = themescjsminjs.default; 3 | Themes.init(MindMap); 4 | 5 | class SmmRender { 6 | constructor() { 7 | this.smmNote = api.getActiveContextNote(); 8 | this.smmContainerId = "smm_container"; 9 | this.MindMap = MindMap; 10 | this.initialized = false; 11 | this.activeNodes = []; 12 | this.init_custom_theme(); 13 | this.themeList = [ 14 | { 15 | name: '默认主题', 16 | value: 'default', 17 | dark: false 18 | }, 19 | ...Themes.lightList, ...Themes.darkList, ...customThemeList].reverse(); 20 | this.iconList = MindMap.iconList; 21 | this.useLeftKeySelectionRightKeyDrag = config.LKSRKD; 22 | this.toolbarBtnsRole = { 23 | "unselected": [ 24 | {id:'smm_delete_node',enabled:false}, 25 | {id:'smm_insert_node',enabled:false}, 26 | {id:'smm_insert_child_node',enabled:false}, 27 | {id:'smm_insert_image',enabled:false}, 28 | {id:'smm_insert_url',enabled:false}, 29 | {id:'smm_insert_icon',enabled:false}, 30 | {id:'smm_insert_remark',enabled:false}, 31 | {id:'smm_insert_ga',enabled:false}, 32 | {id:'smm_insert_relation_line',enabled:false}, 33 | {id:'smm_add_outer_frame',enabled:false}, 34 | ], 35 | "root": [ 36 | {id:'smm_delete_node',enabled:true}, 37 | {id:'smm_insert_node',enabled:false}, 38 | {id:'smm_insert_child_node',enabled:true}, 39 | {id:'smm_insert_image',enabled:true}, 40 | {id:'smm_insert_url',enabled:true}, 41 | {id:'smm_insert_icon',enabled:true}, 42 | {id:'smm_insert_remark',enabled:true}, 43 | {id:'smm_insert_ga',enabled:false}, 44 | {id:'smm_insert_relation_line',enabled:true}, 45 | {id:'smm_add_outer_frame',enabled:true}, 46 | ], 47 | "node": [ 48 | {id:'smm_delete_node',enabled:true}, 49 | {id:'smm_insert_node',enabled:true}, 50 | {id:'smm_insert_child_node',enabled:true}, 51 | {id:'smm_insert_image',enabled:true}, 52 | {id:'smm_insert_url',enabled:true}, 53 | {id:'smm_insert_icon',enabled:true}, 54 | {id:'smm_insert_remark',enabled:true}, 55 | {id:'smm_insert_ga',enabled:true}, 56 | {id:'smm_insert_relation_line',enabled:true}, 57 | {id:'smm_add_outer_frame',enabled:true}, 58 | ], 59 | "generalization": [ 60 | {id:'smm_delete_node',enabled:true}, 61 | {id:'smm_insert_node',enabled:false}, 62 | {id:'smm_insert_child_node',enabled:false}, 63 | {id:'smm_insert_image',enabled:true}, 64 | {id:'smm_insert_url',enabled:true}, 65 | {id:'smm_insert_icon',enabled:true}, 66 | {id:'smm_insert_remark',enabled:true}, 67 | {id:'smm_insert_ga',enabled:false}, 68 | {id:'smm_insert_relation_line',enabled:false}, 69 | {id:'smm_add_outer_frame',enabled:false}, 70 | ], 71 | }; 72 | } 73 | 74 | init_custom_theme() { 75 | customThemeList.forEach(themeConfig=>{ 76 | MindMap.defineTheme(themeConfig.value, themeConfig.theme); 77 | }); 78 | } 79 | 80 | async init(smmWidget) { 81 | this.smmWidget = smmWidget; 82 | this.$widget = this.smmWidget.$widget; 83 | 84 | if(true || config.RENDER_ON === "note-detail"){ 85 | let smmwComponentId = this.$widget.parent().attr("data-component-id"); 86 | if(config.SHOW_SOURCE){ 87 | this.$widget.addClass("smm-show-source"); 88 | this.$widget.removeClass("smm-hide-source"); 89 | }else{ 90 | this.$widget.parent().css("position", "relative"); 91 | this.$widget.addClass("smm-hide-source"); 92 | this.$widget.removeClass("smm-show-source"); 93 | } 94 | 95 | this.smmContainerId = `smm_container_${smmwComponentId}`; 96 | let $smm_container = this.$widget.find('#smm_container'); 97 | $smm_container.attr("id", this.smmContainerId); 98 | this.$widget.insertBefore(this.$widget.parent().find('.mermaid-widget')); 99 | this.$widget.addClass("scrolling-container"); 100 | } 101 | 102 | await this.render_mind_data(); 103 | 104 | this.toolbar_render(); 105 | this.register_toolbar_event(); 106 | this.register_components_event(); 107 | this.register_smmtools(); 108 | } 109 | 110 | register_backdrop(backdropWidgets){ 111 | this.$widget.parent().children('.smm-backdrops-container').remove(); 112 | this.$backdrops = this.$widget.find(".smm-backdrops-container"); 113 | this.$backdrops.insertBefore(this.$widget); 114 | for(const widget of backdropWidgets){ 115 | let $modalBody = this.$backdrops.find(`#${widget.id} .modal-body`); 116 | $modalBody.append(widget.obj.doRender()); 117 | } 118 | } 119 | 120 | async render_mind_data() { 121 | if (this.smmNote.isJson()) { 122 | // 获取源笔记 123 | let mind_note_data = await utils.getData(this.smmNote.noteId); 124 | // 打开笔记数据 125 | if (!this.initialized) { 126 | this.create_mind_map(mind_note_data); 127 | this.initialized = true; 128 | } 129 | 130 | console.log("smm render success"); 131 | } 132 | } 133 | 134 | create_mind_map(mind_note_data) { 135 | this.mindMap = new MindMap({ 136 | el: this.$widget.find(`#${this.smmContainerId}`).get(0), 137 | initRootNodePosition: ['center', 'center'], 138 | layout: 'logicalStructure' 139 | }); 140 | 141 | let mind_note_obj = JSON.parse(mind_note_data); 142 | let theme = mind_note_obj.theme.template; 143 | if(this.themeList.findIndex(t=>{return t.value==theme}) === -1){ 144 | mind_note_obj.theme.template = "classic4"; 145 | // 当前导图笔记的主题不存在,自动更换为默认主题 146 | api.showMessage(config.lang.showMessage.themeNotExist); 147 | } 148 | this.mindMap.setFullData(mind_note_obj); 149 | 150 | // 监听节点激活事件 151 | this.mindMap.on('node_active', (node, nodeList) => { 152 | this.activeNodes = nodeList; 153 | this.toolbar_render(); 154 | }) 155 | 156 | this.mindMap.on('data_change', data => { 157 | this.save_mind_note(); 158 | }) 159 | 160 | this.mindMap.on('node_tree_render_end', data => { 161 | // 笔记超链接设置为当前页打开 162 | this.set_note_link_target(); 163 | }) 164 | 165 | this.isStart = true 166 | this.isEnd = true 167 | this.mindMap.on('back_forward', (index, len) => { 168 | this.isStart = index <= 0 169 | this.isEnd = index >= len - 1 170 | // 改变按钮可用状态 171 | this.toolbar_btn_toggle_status('smm_back', !this.isStart); 172 | this.toolbar_btn_toggle_status('smm_forward', !this.isEnd); 173 | }) 174 | 175 | this.outerFramePositionBtnShow = false; 176 | this.outerFramePosition = { 177 | left: 0, 178 | top: 0 179 | } 180 | 181 | this.$nodeOuterFrameContainer = this.$widget.find('#nodeOuterFrameContainer'); 182 | 183 | // 外框事件监听 184 | this.mindMap.on('outer_frame_active', (el, parentNode, range) => { 185 | // 取范围内第一个节点的外框样式 186 | const firstNode = parentNode.children[range[0]]; 187 | const firstNodeOuterFrame = firstNode.getData('outerFrame'); 188 | /* 189 | Object.keys(firstNodeOuterFrame).forEach(key => { 190 | this.styleConfig[key] = firstNodeOuterFrame[key] 191 | })*/ 192 | // 获取外框的位置大小信息 193 | const { x, y, width } = el.rbox(); 194 | this.outerFramePosition.left = x + width + 'px'; 195 | this.outerFramePosition.top = y + 'px'; 196 | this.outerFramePositionBtnShow = true; 197 | this.$nodeOuterFrameContainer.css(this.outerFramePosition); 198 | this.$nodeOuterFrameContainer.addClass('smm-outer-frame-active'); 199 | }) 200 | 201 | const hide = () => { 202 | this.outerFramePositionBtnShow = false; 203 | this.$nodeOuterFrameContainer.removeClass('smm-outer-frame-active'); 204 | } 205 | 206 | this.mindMap.on('scale', hide); 207 | this.mindMap.on('translate', hide); 208 | this.mindMap.on('svg_mousedown', hide); 209 | this.mindMap.on('expand_btn_click', hide); 210 | this.mindMap.on('outer_frame_delete', hide); 211 | } 212 | 213 | smm_resize() { 214 | this.mindMap.resize(); 215 | } 216 | 217 | set_note_link_target(regex=/^#root/, target='_self'){ 218 | this.$widget.find('.smm-container svg g.smm-node a').each((index, element)=>{ 219 | let $a = $(element); 220 | if(regex.test($a.attr("href"))){ 221 | $a.attr("target", target); 222 | } 223 | }) 224 | } 225 | 226 | toolbar_render() { 227 | if(this.activeNodes.length === 0){ 228 | this.toolbarBtnsRole["unselected"].forEach(toolbarBtn => { 229 | this.toolbar_btn_toggle_status(toolbarBtn.id, toolbarBtn.enabled); 230 | }) 231 | return; 232 | } 233 | if(this.has_generalization()){ 234 | this.toolbarBtnsRole["generalization"].forEach(toolbarBtn => { 235 | this.toolbar_btn_toggle_status(toolbarBtn.id, toolbarBtn.enabled); 236 | }) 237 | return; 238 | } 239 | if(this.has_root()){ 240 | this.toolbarBtnsRole["root"].forEach(toolbarBtn => { 241 | this.toolbar_btn_toggle_status(toolbarBtn.id, toolbarBtn.enabled); 242 | }) 243 | return; 244 | } 245 | this.toolbarBtnsRole["node"].forEach(toolbarBtn => { 246 | this.toolbar_btn_toggle_status(toolbarBtn.id, toolbarBtn.enabled); 247 | }) 248 | } 249 | 250 | has_root() { 251 | return this.activeNodes.findIndex(node => { 252 | return node.isRoot 253 | }) !== -1 254 | } 255 | 256 | has_generalization() { 257 | return this.activeNodes.findIndex(node => { 258 | return node.isGeneralization 259 | }) !== -1 260 | } 261 | 262 | toolbar_btn_toggle_status(btn_id, enabled) { 263 | let $btn = this.$widget.find(`.smm-toolbar-btn#${btn_id}`); 264 | if(enabled){ 265 | $btn.removeClass("disabled"); 266 | }else{ 267 | $btn.addClass("disabled"); 268 | } 269 | } 270 | 271 | save_mind_note() { 272 | let mind_data = this.mindMap.getData(true); 273 | let mind_str = JSON.stringify(mind_data); 274 | utils.setData(this.smmNote.noteId, this.smmNote.title, mind_str); 275 | } 276 | 277 | register_toolbar_event() { 278 | this.$widget.find('.smm-toolbar-btn#smm_back').click(()=>!this.isStart&&this.back()); 279 | this.$widget.find('.smm-toolbar-btn#smm_forward').click(()=>!this.isEnd&&this.forward()); 280 | this.$widget.find('.smm-toolbar-btn#smm_delete_node').click(()=>this.delete_node()); 281 | this.$widget.find('.smm-toolbar-btn#smm_insert_node').click(()=>this.insert_node()); 282 | this.$widget.find('.smm-toolbar-btn#smm_insert_child_node').click(()=>this.insert_child_node()); 283 | this.$widget.find('.smm-toolbar-btn#smm_insert_image').click(()=>this.insert_image()); 284 | this.$widget.find('.smm-toolbar-btn#smm_insert_url').click(()=>this.insert_url()); 285 | this.$widget.find('.smm-toolbar-btn#smm_insert_icon').click(()=>this.insert_icon()); 286 | this.$widget.find('.smm-toolbar-btn#smm_insert_remark').click(()=>this.insert_remark()); 287 | this.$widget.find('.smm-toolbar-btn#smm_insert_ga').click(()=>this.insert_ga()); 288 | this.$widget.find('.smm-toolbar-btn#smm_insert_relation_line').click(()=>this.insert_relation_line()); 289 | this.$widget.find('.smm-toolbar-btn#smm_add_outer_frame').click(()=>this.add_outer_frame()); 290 | } 291 | 292 | register_components_event() { 293 | this.$widget.find('.smm-components-container #nodeOuterFrameContainer #smm_delete_outer_frame').click(()=>this.delete_outer_frame()); 294 | } 295 | 296 | // 回退 297 | back() { 298 | this.mindMap.execCommand('BACK'); 299 | this.save_mind_note(); 300 | } 301 | 302 | // 前进 303 | forward() { 304 | this.mindMap.execCommand('FORWARD'); 305 | this.save_mind_note(); 306 | } 307 | 308 | delete_node() { 309 | this.mindMap.execCommand('REMOVE_NODE'); 310 | } 311 | 312 | // 插入兄弟节点 313 | insert_node() { 314 | this.mindMap.execCommand('INSERT_NODE'); 315 | } 316 | 317 | // 插入子节点 318 | insert_child_node() { 319 | this.mindMap.execCommand('INSERT_CHILD_NODE'); 320 | } 321 | 322 | insert_image() { 323 | let imageUrl = ""; 324 | let imageTitle = ""; 325 | this.activeNodes.forEach(node => { 326 | if(!!node.getData('image')&&node.getData('image')!==""){ 327 | imageUrl = node.getData('image'); 328 | imageTitle = node.getData('imageTitle'); 329 | } 330 | }) 331 | 332 | this.$backdrops.find('#imageBackdrop input[name="imageUrlContent"]').val(imageUrl); 333 | this.$backdrops.find('#imageBackdrop input[name="imageTitleContent"]').val(imageTitle); 334 | this.$backdrops.find('#imageBackdrop').modal('show'); 335 | this.$backdrops.find('#imageSave').click(()=>{ 336 | imageUrl = this.$backdrops.find('#imageBackdrop input[name="imageUrlContent"]').val(); 337 | imageTitle = this.$backdrops.find('#imageBackdrop input[name="imageTitleContent"]').val(); 338 | 339 | let imageWidth = 100; 340 | let imageHeight = 100; 341 | this.activeNodes.forEach(node => { 342 | node.setImage({ 343 | url: imageUrl, 344 | title: imageTitle, 345 | width: imageWidth, 346 | height: imageHeight 347 | }) 348 | }) 349 | this.$backdrops.find('#imageBackdrop').modal('hide'); 350 | }); 351 | } 352 | 353 | insert_url() { 354 | let hyperlink = ""; 355 | let hyperlinkTitle = ""; 356 | this.activeNodes.length==1 && this.activeNodes.forEach(node => { 357 | if(!!node.getData('hyperlink')&&node.getData('hyperlink')!==""){ 358 | hyperlink = node.getData('hyperlink'); 359 | hyperlinkTitle = node.getData('hyperlinkTitle'); 360 | } 361 | }) 362 | 363 | this.$backdrops.find('#urlLinkBackdrop input[name="urlLinkContent"]').val(hyperlink); 364 | this.$backdrops.find('#urlLinkBackdrop input[name="urlTextContent"]').val(hyperlinkTitle); 365 | this.$backdrops.find('#urlLinkBackdrop').modal('show'); 366 | this.$backdrops.find('#urlLinkSave').click(()=>{ 367 | hyperlink = this.$backdrops.find('#urlLinkBackdrop input[name="urlLinkContent"]').val(); 368 | hyperlinkTitle = this.$backdrops.find('#urlLinkBackdrop input[name="urlTextContent"]').val(); 369 | this.activeNodes.forEach(node => { 370 | node.setHyperlink(hyperlink, hyperlinkTitle); 371 | }) 372 | this.$backdrops.find('#urlLinkBackdrop').modal('hide'); 373 | }); 374 | } 375 | 376 | insert_icon() { 377 | let iconList = []; 378 | if (this.activeNodes.length > 0) { 379 | if (this.activeNodes.length === 1) { 380 | let firstNode = this.activeNodes[0] 381 | iconList = firstNode.getData('icon') || []; 382 | } 383 | } 384 | this.set_icon_selected(iconList); 385 | this.$backdrops.find('#iconListBackdrop').modal('show'); 386 | } 387 | 388 | set_icon_selected(iconList) { 389 | this.$backdrops.find(`.icon-box .icon-list .icon`).removeClass("selected"); 390 | for(const name of iconList){ 391 | let $icon = this.$backdrops.find(`.icon-box .icon-list .icon[name="${name}"]`); 392 | $icon.addClass("selected"); 393 | } 394 | } 395 | 396 | // 插入备注 397 | insert_remark() { 398 | let content = ""; 399 | this.activeNodes.forEach(node => { 400 | if(!!node.getData('note')&&node.getData('note')!=="") 401 | content = node.getData('note'); 402 | }) 403 | this.$backdrops.find('#remarkBackdrop textarea[name="remarkContent"]').val(content); 404 | this.$backdrops.find('#remarkBackdrop').modal('show'); 405 | this.$backdrops.find('#remarkSave').click(()=>{ 406 | content = this.$backdrops.find('#remarkBackdrop textarea[name="remarkContent"]').val(); 407 | this.activeNodes.forEach(node => { 408 | node.setNote(content); 409 | }) 410 | this.$backdrops.find('#remarkBackdrop').modal('hide'); 411 | }); 412 | } 413 | 414 | // 插入概要 415 | insert_ga() { 416 | this.mindMap.execCommand('ADD_GENERALIZATION'); 417 | } 418 | 419 | insert_relation_line() { 420 | this.mindMap.associativeLine.createLineFromActiveNode(); 421 | } 422 | 423 | add_outer_frame() { 424 | this.mindMap.execCommand('ADD_OUTER_FRAME', [], {fill: "transparent"}); 425 | } 426 | 427 | delete_outer_frame() { 428 | this.outerFramePositionBtnShow = false; 429 | this.$nodeOuterFrameContainer.removeClass('smm-outer-frame-active'); 430 | this.mindMap.outerFrame.removeActiveOuterFrame(); 431 | } 432 | 433 | /** 434 | * 工具菜单操作 435 | */ 436 | register_smmtools() { 437 | let $smmtools_menu = this.$widget.find('#smmtools_menu'); 438 | let $smmtools_area = this.$widget.find('#smm_tools'); 439 | let $smmtools_save_imagenote = this.$widget.find('#smmtools_save_imagenote'); 440 | 441 | let $smmtools_help = this.$widget.find('#smmtools_help'); 442 | 443 | $smmtools_menu.click(() => { 444 | this.switch_fullscreen_button(); 445 | $smmtools_area.toggleClass('smm-tools-active'); 446 | }); 447 | 448 | this.register_fullscreen_event(); 449 | 450 | this.register_fulltab_event(); 451 | 452 | $(document).click(function (event) { 453 | let target = $(event.target); // 获取点击事件的目标元素 454 | 455 | if (target.closest($smmtools_area).length > 0) { 456 | // 目标元素在指定区域内,不做任何操作 457 | } else { 458 | // 目标元素不在指定区域内,执行关闭操作 459 | $smmtools_area.removeClass('smm-tools-active'); 460 | } 461 | }); 462 | 463 | $smmtools_save_imagenote.click(() => { 464 | let fileType = config.IMAGE_NOTE_TYPE; 465 | this.mindMap.export(fileType, false).then((content)=>{ 466 | if(config.EXPORT_TYPE === 'note'){ 467 | utils.createImageNote(this.smmNote.noteId, `simple-mind-map-export.${fileType}`, fileType, content).then((res) => { 468 | // 图像笔记已经创建成功了! 469 | api.showMessage(config.lang.showMessage.imageNoteCreated); 470 | }); 471 | }else{ 472 | utils.createImageAttachment(this.smmNote.noteId, `simple-mind-map-export.${fileType}`, fileType, content).then((res) => { 473 | // 图像附件已经创建成功了! 474 | api.showMessage(config.lang.showMessage.imageAttachmentCreated); 475 | }); 476 | } 477 | }); 478 | }); 479 | 480 | $smmtools_help.click(() => { 481 | this.open_help_info(); 482 | }); 483 | 484 | this.render_smm_export_select(); 485 | this.render_smm_mouse_select(); 486 | this.render_smm_rainbow_lines_select(); 487 | this.render_smm_theme_select(); 488 | this.render_smm_struct_select(); 489 | } 490 | 491 | switch_fullscreen_button = () => { 492 | if(is_page_fullscreen()){ 493 | this.smmWidget.$render.addClass("full"); 494 | this.$widget.find('#smmtools_enter_fullscreen').addClass('hidden-ext'); 495 | this.$widget.find('#smmtools_exit_fullscreen').removeClass('hidden-ext'); 496 | }else{ 497 | this.smmWidget.$render.removeClass("full"); 498 | this.$widget.find('#smmtools_enter_fullscreen').removeClass('hidden-ext'); 499 | this.$widget.find('#smmtools_exit_fullscreen').addClass('hidden-ext'); 500 | } 501 | } 502 | 503 | register_fullscreen_event() { 504 | this.switch_fullscreen_button(); 505 | 506 | // 全屏点击事件 507 | this.$widget.find('#smmtools_enter_fullscreen').click(() => { 508 | var elem = document.body; 509 | full_screen(elem); 510 | }); 511 | 512 | // 退出全屏点击事件 513 | this.$widget.find('#smmtools_exit_fullscreen').click(() => { 514 | exit_full_screen(); 515 | }); 516 | 517 | window.addEventListener("resize", (event) => { 518 | try{ 519 | this.smm_resize(); 520 | }catch(e){ 521 | // 忽略报错 522 | } 523 | this.switch_fullscreen_button(); 524 | }, true); 525 | } 526 | 527 | register_fulltab_event(){ 528 | let $smmtools_enterfulltab = this.$widget.find('#smmtools_enter_fulltab'); 529 | let $smmtools_exitfulltab = this.$widget.find('#smmtools_exit_fulltab'); 530 | $smmtools_enterfulltab.click(()=>{ 531 | this.$widget.parent().css("position", "relative"); 532 | this.$widget.addClass("smm-hide-source"); 533 | this.$widget.removeClass("smm-show-source"); 534 | $smmtools_enterfulltab.addClass('hidden-ext'); 535 | $smmtools_exitfulltab.removeClass('hidden-ext'); 536 | this.smm_resize(); 537 | }); 538 | $smmtools_exitfulltab.click(()=>{ 539 | this.$widget.parent().css("position", ''); 540 | this.$widget.addClass("smm-show-source"); 541 | this.$widget.removeClass("smm-hide-source"); 542 | $smmtools_enterfulltab.removeClass('hidden-ext'); 543 | $smmtools_exitfulltab.addClass('hidden-ext'); 544 | this.smm_resize(); 545 | }); 546 | if(config.SHOW_SOURCE){ 547 | $smmtools_enterfulltab.removeClass('hidden-ext'); 548 | $smmtools_exitfulltab.addClass('hidden-ext'); 549 | }else{ 550 | $smmtools_enterfulltab.addClass('hidden-ext'); 551 | $smmtools_exitfulltab.removeClass('hidden-ext'); 552 | } 553 | } 554 | 555 | render_smm_export_select() { 556 | let $export_select = this.$widget.find('#smmtools_export select'); 557 | $export_select.val(""); 558 | $export_select.on('change', (e) => { 559 | let exportType = $(e.target).children('option:selected').val(); 560 | this.mindMap.export(exportType, true, this.smmNote.title); 561 | $(e.target).val(""); 562 | }); 563 | } 564 | 565 | render_smm_mouse_select() { 566 | let $mouse_select = this.$widget.find('#smmtools_mouse_select select'); 567 | $mouse_select.val(this.useLeftKeySelectionRightKeyDrag?"1":"0"); 568 | this.mindMap.updateConfig({ 569 | useLeftKeySelectionRightKeyDrag: this.useLeftKeySelectionRightKeyDrag 570 | }); 571 | $mouse_select.on('change', (e) => { 572 | if($(e.target).children('option:selected').val()=="0"){ 573 | this.useLeftKeySelectionRightKeyDrag = false; 574 | }else{ 575 | this.useLeftKeySelectionRightKeyDrag = true; 576 | } 577 | this.mindMap.updateConfig({ 578 | useLeftKeySelectionRightKeyDrag: this.useLeftKeySelectionRightKeyDrag 579 | }); 580 | }); 581 | } 582 | 583 | render_smm_rainbow_lines_select() { 584 | let $rainbow_lines_select = this.$widget.find('#smmtools_rainbow_lines select'); 585 | $rainbow_lines_select.val(this.mindMap.opt.rainbowLinesConfig.open?"1":"0"); 586 | $rainbow_lines_select.on('change', (e) => { 587 | this.mindMap.rainbowLines.updateRainLinesConfig({open:$(e.target).children('option:selected').val()=="1"?true:false}); 588 | }); 589 | } 590 | 591 | render_smm_theme_select() { 592 | let $theme_select = this.$widget.find('#smmtools_theme select'); 593 | for (const theme of this.themeList) { 594 | add_row(theme); 595 | } 596 | function add_row(theme) { 597 | if(config.LANGUAGE==="en_us"){ 598 | $theme_select.append(``); 599 | }else{ 600 | $theme_select.append(``); 601 | } 602 | } 603 | 604 | $theme_select.val(this.mindMap.getTheme()); 605 | $theme_select.on('change', (e) => { 606 | this.mindMap.setTheme($(e.target).children('option:selected').val()); 607 | }); 608 | } 609 | 610 | render_smm_struct_select() { 611 | let $struct_select = this.$widget.find('#smmtools_struct select'); 612 | $struct_select.val(this.mindMap.getLayout()); 613 | $struct_select.on('change', (e) => { 614 | this.mindMap.setLayout($(e.target).children('option:selected').val()); 615 | this.save_mind_note(); 616 | }); 617 | } 618 | 619 | open_help_info() { 620 | let win = window.open(config.HELP_URL, '_blank'); 621 | win.focus(); 622 | } 623 | } 624 | 625 | function is_page_fullscreen() { 626 | return !!(document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement); 627 | } 628 | 629 | function full_screen(dom, FullscreenCallback) { 630 | if (dom.requestFullscreen) { 631 | dom.requestFullscreen() 632 | .then(() => { 633 | FullscreenCallback && FullscreenCallback(); 634 | }); 635 | } else if (dom.mozRequestFullScreen) { 636 | dom.mozRequestFullScreen() 637 | .then(() => { 638 | FullscreenCallback && FullscreenCallback(); 639 | }); 640 | } else if (dom.webkitRequestFullScreen) { 641 | dom.webkitRequestFullScreen() 642 | .then(() => { 643 | FullscreenCallback && FullscreenCallback(); 644 | }); 645 | } 646 | } 647 | 648 | function exit_full_screen() { 649 | if (document.exitFullscreen) { 650 | document.exitFullscreen(); 651 | } else if (document.mozCancelFullScreen) { 652 | document.mozCancelFullScreen(); 653 | } else if (document.webkitExitFullscreen) { 654 | document.webkitExitFullscreen(); 655 | } else if (document.msExitFullscreen) { 656 | document.msExitFullscreen(); 657 | } 658 | } 659 | 660 | 661 | module.exports = SmmRender; -------------------------------------------------------------------------------- /trilium-simple-mind-map/TriliumSmmWidget/SmmRender/config.clone.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | config 9 | 10 | 11 | 12 |
13 |

config

14 | 15 |
16 |

这是一个笔记的克隆, 跳转到它的主目录.

17 |
18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /trilium-simple-mind-map/TriliumSmmWidget/SmmRender/customThemeList.js: -------------------------------------------------------------------------------- 1 | module.exports = [ 2 | { 3 | name: 'vc柠檬', 4 | value: 'vcMelon', 5 | theme: vcMelon, 6 | dark: false 7 | }, 8 | ] -------------------------------------------------------------------------------- /trilium-simple-mind-map/TriliumSmmWidget/SmmRender/customThemeList/vcMelon.js: -------------------------------------------------------------------------------- 1 | // vcMelon 2 | module.exports = { 3 | backgroundColor: 'rgb(124, 213, 200)', 4 | // 连线的颜色 5 | lineColor: 'rgb(51, 51, 51)', 6 | lineWidth: 3, 7 | // 概要连线的粗细 8 | generalizationLineWidth: 3, 9 | // 概要连线的颜色 10 | generalizationLineColor: 'rgb(51, 51, 51)', 11 | // 根节点样式 12 | root: { 13 | fillColor: 'rgb(252, 180, 71)', 14 | color: 'rgb(51, 51, 51)', 15 | borderColor: 'rgb(24, 24, 24)', 16 | borderWidth: 3, 17 | fontSize: 24, 18 | shape: 'roundedRectangle' 19 | }, 20 | // 二级节点样式 21 | second: { 22 | fillColor: 'rgb(254, 225, 38)', 23 | color: 'rgb(51, 51, 51)', 24 | borderColor: 'rgb(24, 24, 24)', 25 | borderWidth: 3, 26 | fontSize: 18, 27 | shape: 'roundedRectangle' 28 | }, 29 | // 三级及以下节点样式 30 | node: { 31 | fillColor: 'rgb(140, 198, 63)', 32 | color: 'rgb(51, 51, 51)', 33 | borderColor: 'rgb(24, 24, 24)', 34 | borderWidth: 2, 35 | fontSize: 14, 36 | shape: 'roundedRectangle' 37 | }, 38 | // 概要节点样式 39 | generalization: { 40 | fontSize: 14, 41 | fillColor: 'rgb(255, 198, 70)', 42 | borderColor: 'rgb(26, 26, 26)', 43 | borderWidth: 1, 44 | color: 'rgb(26, 26, 26)' 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /trilium-simple-mind-map/TriliumSmmWidget/SmmRender/themeList.js: -------------------------------------------------------------------------------- 1 | module.exports = [ 2 | { 3 | name: '默认', 4 | value: 'default', 5 | dark: false 6 | }, 7 | { 8 | name: '暗色2', 9 | value: 'dark2', 10 | dark: true 11 | }, 12 | { 13 | name: '天清绿', 14 | value: 'skyGreen', 15 | dark: false 16 | }, 17 | { 18 | name: '脑图经典2', 19 | value: 'classic2', 20 | dark: false 21 | }, 22 | { 23 | name: '脑图经典3', 24 | value: 'classic3', 25 | dark: false 26 | }, 27 | { 28 | name: '经典绿', 29 | value: 'classicGreen', 30 | dark: false 31 | }, 32 | { 33 | name: '经典蓝', 34 | value: 'classicBlue', 35 | dark: false 36 | }, 37 | { 38 | name: '天空蓝', 39 | value: 'blueSky', 40 | dark: false 41 | }, 42 | { 43 | name: '脑残粉', 44 | value: 'brainImpairedPink', 45 | dark: false 46 | }, 47 | { 48 | name: '暗色', 49 | value: 'dark', 50 | dark: true 51 | }, 52 | { 53 | name: '泥土黄', 54 | value: 'earthYellow', 55 | dark: false 56 | }, 57 | { 58 | name: '清新绿', 59 | value: 'freshGreen', 60 | dark: false 61 | }, 62 | { 63 | name: '清新红', 64 | value: 'freshRed', 65 | dark: false 66 | }, 67 | { 68 | name: '浪漫紫', 69 | value: 'romanticPurple', 70 | dark: false 71 | }, 72 | { 73 | name: '粉红葡萄', 74 | value: 'pinkGrape', 75 | dark: false 76 | }, 77 | { 78 | name: '薄荷', 79 | value: 'mint', 80 | dark: false 81 | }, 82 | { 83 | name: '金色vip', 84 | value: 'gold', 85 | dark: false 86 | }, 87 | { 88 | name: '活力橙', 89 | value: 'vitalityOrange', 90 | dark: false 91 | }, 92 | { 93 | name: '绿叶', 94 | value: 'greenLeaf', 95 | dark: false 96 | }, 97 | { 98 | name: '脑图经典', 99 | value: 'classic', 100 | dark: true 101 | }, 102 | { 103 | name: '脑图经典4', 104 | value: 'classic4', 105 | dark: false 106 | }, 107 | { 108 | name: '小黄人', 109 | value: 'minions', 110 | dark: false 111 | }, 112 | { 113 | name: '简约黑', 114 | value: 'simpleBlack', 115 | dark: false 116 | }, 117 | { 118 | name: '课程绿', 119 | value: 'courseGreen', 120 | dark: false 121 | }, 122 | { 123 | name: '咖啡', 124 | value: 'coffee', 125 | dark: false 126 | }, 127 | { 128 | name: '红色精神', 129 | value: 'redSpirit', 130 | dark: false 131 | }, 132 | { 133 | name: '黑色幽默', 134 | value: 'blackHumour', 135 | dark: true 136 | }, 137 | { 138 | name: '深夜办公室', 139 | value: 'lateNightOffice', 140 | dark: true 141 | }, 142 | { 143 | name: '黑金', 144 | value: 'blackGold', 145 | dark: true 146 | }, 147 | { 148 | name: '牛油果', 149 | value: 'avocado', 150 | dark: false 151 | }, 152 | { 153 | name: '秋天', 154 | value: 'autumn', 155 | dark: false 156 | }, 157 | { 158 | name: '橙汁', 159 | value: 'orangeJuice', 160 | dark: true 161 | } 162 | ] -------------------------------------------------------------------------------- /trilium-simple-mind-map/TriliumSmmWidget/SmmRender/themes.cjs.min.js: -------------------------------------------------------------------------------- 1 | var i=Object.defineProperty;var co=Object.getOwnPropertyDescriptor;var Co=Object.getOwnPropertyNames;var zo=Object.prototype.hasOwnProperty;var ho=(o,r)=>{for(var l in r)i(o,l,{get:r[l],enumerable:!0})},so=(o,r,l,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of Co(r))!zo.call(o,e)&&e!==l&&i(o,e,{get:()=>r[e],enumerable:!(a=co(r,e))||a.enumerable});return o};var mo=o=>so(i({},"__esModule",{value:!0}),o);var So={};ho(So,{default:()=>uo});module.exports=mo(So);var d={backgroundColor:"rgb(17, 17, 84)",lineColor:"rgb(255, 0, 214)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(255, 181, 0)",associativeLineColor:"rgb(255, 255, 255)",associativeLineTextColor:"rgb(255, 255, 255)",root:{fillColor:"rgb(251, 233, 248)",color:"rgb(208, 5, 176)",borderColor:"rgb(255, 0, 214)",borderWidth:3,fontSize:24,shape:"roundedRectangle"},second:{fillColor:"transparent",color:"rgb(248, 177, 237)",borderColor:"",borderWidth:3,fontSize:18},node:{fontSize:14,color:"#fff"},generalization:{fontSize:14,fillColor:"#fff",borderColor:"rgb(255, 181, 0)",borderWidth:2,color:"rgb(17, 17, 84)"}};var f={backgroundColor:"rgb(0, 21, 21)",lineColor:"rgb(0, 139, 146)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgba(2, 167, 240, 0.5)",associativeLineColor:"rgb(255, 255, 255)",associativeLineTextColor:"rgb(255, 255, 255)",root:{fillColor:"rgb(0, 243, 255)",color:"rgb(0, 21, 21)",borderColor:"#fff",borderWidth:3,fontSize:24,shape:"parallelogram"},second:{fillColor:"rgb(0, 21, 21)",color:"#fff",borderColor:"#fff",borderWidth:3,fontSize:18,shape:"diamond"},node:{fontSize:14,color:"#fff"},generalization:{fontSize:14,fillColor:"#fff",borderColor:"rgb(0, 117, 255)",borderWidth:2,color:"rgb(0, 21, 21)"}};var b={backgroundColor:"rgb(0, 0, 0)",lineColor:"rgb(172, 172, 172)",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"rgb(172, 172, 172)",associativeLineColor:"rgb(57, 130, 252)",associativeLineTextColor:"rgb(68, 68, 68)",root:{fillColor:"#fff",color:"rgb(241, 79, 81)",borderColor:"",borderWidth:0,fontSize:24,shape:"roundedRectangle"},second:{fillColor:"rgb(241, 79, 81)",color:"#fff",borderColor:"",borderWidth:0,fontSize:18},node:{fontSize:14,color:"#fff"},generalization:{fontSize:14,fillColor:"#fff",borderColor:"",borderWidth:0,color:"rgb(241, 79, 81)"}};var g={backgroundColor:"rgb(32, 34, 43)",lineColor:"rgb(90, 136, 116)",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"rgb(90, 136, 116)",associativeLineColor:"rgb(57, 130, 252)",associativeLineTextColor:"rgb(68, 68, 68)",root:{fillColor:"rgb(1, 192, 116)",color:"#fff",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"rgb(48, 51, 63)",color:"#fff",borderColor:"",borderWidth:0,fontSize:18},node:{fontSize:14,color:"#fff"},generalization:{fontSize:14,fillColor:"rgb(1, 192, 116)",borderColor:"",borderWidth:0,color:"#fff"}};var c={lineColor:"rgb(75, 81, 78)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(255, 119, 34)",backgroundColor:"rgb(27, 31, 34)",root:{fillColor:"rgb(36, 179, 96)",color:"#fff",borderColor:"",borderWidth:0},second:{fillColor:"rgb(254, 199, 13)",color:"rgb(0, 0, 0)",borderColor:"",borderWidth:0,fontSize:14},node:{fontSize:12,color:"rgb(204, 204, 204)"},generalization:{fillColor:"transparent",borderColor:"rgb(255, 119, 34)",borderWidth:2,color:"rgb(204, 204, 204)"}};var C={lineColor:"rgb(17, 68, 23)",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"#fff",backgroundColor:"rgb(15, 16, 17)",root:{fillColor:"rgb(28, 178, 43)",color:"#fff",fontSize:24,borderRadius:10},second:{fillColor:"rgb(55, 56, 58)",color:"rgb(147,148,149)",fontSize:18,borderRadius:10,borderWidth:0},node:{fontSize:14,color:"rgb(147, 148, 149)"},generalization:{fillColor:"#fff",borderColor:"transparent",color:"#333"}};var z={lineColor:"#fff",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"#fff",backgroundColor:"rgb(58, 65, 68)",backgroundImage:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAIAAAACDbGyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowQzg5QTQ0NDhENzgxMUUzOENGREE4QTg0RDgzRTZDNyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowQzg5QTQ0NThENzgxMUUzOENGREE4QTg0RDgzRTZDNyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkMwOEQ1NDRGOEQ3NzExRTM4Q0ZEQThBODREODNFNkM3IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkMwOEQ1NDUwOEQ3NzExRTM4Q0ZEQThBODREODNFNkM3Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+e9P33AAAACVJREFUeNpisXJ0YUACTAyoAMr/+eM7EGGRZ4FQ7BycEAZAgAEAHbEGtkoQm/wAAAAASUVORK5CYII=",backgroundRepeat:"repeat",backgroundSize:"auto",root:{fillColor:"rgb(233, 223, 152)",color:"#333",fontSize:24,borderRadius:21},second:{fillColor:"rgb(164, 197, 192)",borderColor:"transparent",color:"#333",fontSize:16,borderRadius:10},node:{fontSize:12,color:"#fff",fontWeight:"bold"},generalization:{fillColor:"#fff",borderColor:"transparent",color:"#333"}};var h={backgroundColor:"rgb(27, 31, 34)",lineColor:"rgb(75, 81, 78)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(255, 119, 34)",root:{fillColor:"rgb(36, 179, 96)",color:"#fff",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"rgb(254, 199, 13)",color:"rgb(0, 0, 0)",borderColor:"",borderWidth:0,fontSize:18},node:{fontSize:14,color:"rgb(204, 204, 204)"},generalization:{fontSize:14,fillColor:"rgb(27, 31, 34)",borderColor:"rgb(255, 119, 34)",borderWidth:2,color:"rgb(204, 204, 204)"}};var s={backgroundColor:"rgb(32, 37, 49)",lineColor:"rgb(137, 167, 196)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(255, 119, 34)",root:{fillColor:"rgb(23, 153, 243)",color:"rgb(255, 255, 255)",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"rgb(70, 78, 94)",color:"rgb(209, 210, 210)",borderColor:"",borderWidth:0,fontSize:18},node:{fontSize:14,color:"rgb(204, 204, 204)"},generalization:{fontSize:14,fillColor:"rgb(255, 119, 34)",borderColor:"",borderWidth:2,color:"#fff"}};var m={backgroundColor:"rgb(18, 20, 20)",lineColor:"rgb(205, 186, 156)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(245, 224, 191)",root:{fillColor:"rgb(255, 208, 124)",color:"rgb(111, 61, 6)",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"rgb(66, 57, 46)",color:"rgb(225, 201, 158)",borderColor:"rgb(245, 224, 191)",borderWidth:2,fontSize:18},node:{fontSize:14,color:"rgb(231, 203, 155)"},generalization:{fontSize:14,fillColor:"rgb(56, 45, 34)",borderColor:"rgb(104, 84, 61)",borderWidth:2,color:"rgb(242, 216, 176)"}};var W={backgroundColor:"#070616",lineColor:"#fff",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"#fff",root:{fillColor:"#ff6811",color:"#110501",borderColor:"#ff6811",borderWidth:0,fontSize:24},second:{fillColor:"#070616",color:"#a9a4a9",borderColor:"#ff6811",borderWidth:2,fontSize:18},node:{fontSize:14,color:"#a9a4a9"},generalization:{fontSize:14,fillColor:"",borderColor:"#ff6811",borderWidth:2,color:"#a9a4a9"}};var u={backgroundColor:"#16181d",lineColor:"#7da578",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"#7da578",associativeLineColor:"#7da578",associativeLineTextColor:"#9ce81d",associativeLineActiveColor:"#9ce81d",root:{fillColor:"#9ce81d",color:"#15521b",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"#24272f",color:"#97b65e",borderColor:"#80a97a",borderWidth:2,fontSize:18},node:{fontSize:14,color:"#789e73"},generalization:{fontSize:14,fillColor:"#9ce81d",borderColor:"",borderWidth:0,color:"#13501b"}};var S={backgroundColor:"#051422",lineColor:"#55dff3",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"#55dff3",associativeLineColor:"#55dff3",associativeLineTextColor:"#78b3ff",associativeLineActiveColor:"#78b3ff",root:{fillColor:"#55dff3",color:"#0f4956",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"#0b1632",color:"#fff",borderColor:"#78b3ff",borderWidth:2,fontSize:18},node:{fontSize:14,color:"#78b3ff"},generalization:{fontSize:14,fillColor:"#55dff3",borderColor:"",borderWidth:0,color:"#0f4956"}};var L={backgroundColor:"#192b3b",lineColor:"#4986bc",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"#4986bc",associativeLineColor:"#4986bc",associativeLineTextColor:"#679fba",associativeLineActiveColor:"#679fba",root:{fillColor:"#3462b0",color:"#fff",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"#679fba",color:"#fff",borderColor:"",borderWidth:0,fontSize:18},node:{fontSize:14,color:"#679fba"},generalization:{fontSize:14,fillColor:"#3462b0",borderColor:"",borderWidth:0,color:"#fff"}};var n=[{name:"\u8111\u56FE\u7ECF\u5178",value:"classic",theme:z},{name:"\u9ED1\u8272\u5E7D\u9ED8",value:"blackHumour",theme:h},{name:"\u6DF1\u591C\u529E\u516C\u5BA4",value:"lateNightOffice",theme:s},{name:"\u9ED1\u91D1",value:"blackGold",theme:m},{name:"\u6A59\u6C41",value:"orangeJuice",theme:W},{name:"\u9713\u8679\u706F",value:"neonLamp",theme:d},{name:"\u6697\u591C\u51B0\u5203",value:"darkNightLceBlade",theme:f},{name:"\u6697\u8272",value:"dark",theme:C},{name:"\u6697\u82722",value:"dark2",theme:c},{name:"\u6697\u82723",value:"dark3",theme:b},{name:"\u6697\u82724",value:"dark4",theme:g},{name:"\u6697\u82725",value:"dark5",theme:u},{name:"\u6697\u82726",value:"dark6",theme:S},{name:"\u6697\u82727",value:"dark7",theme:L}].map(o=>({...o,dark:!0}));var p={lineColor:"rgb(51, 51, 51)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(51, 51, 51)",root:{fillColor:"rgb(22, 22, 22)",color:"#fff",borderColor:"rgb(22, 22, 22)",borderWidth:3,fontSize:24},second:{fillColor:"rgb(244, 246, 253)",color:"rgb(0, 0, 0)",borderColor:"",borderWidth:3,fontSize:18,shape:"roundedRectangle"},node:{fontSize:14,color:"rgb(0, 0, 0)"},generalization:{fontSize:14,fillColor:"transparent",borderColor:"rgb(34, 34, 34)",borderWidth:2,color:"rgb(34, 34, 34)"}};var v={backgroundColor:"rgb(187, 241, 250)",lineColor:"rgb(74, 139, 170)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(255, 168, 101)",root:{fillColor:"rgb(51, 149, 255)",color:"#fff",borderColor:"rgb(51, 149, 255)",borderWidth:3,fontSize:24,shape:"roundedRectangle"},second:{fillColor:"rgb(74, 139, 170)",color:"#fff",borderColor:"",borderWidth:3,fontSize:18},node:{fontSize:14,color:"rgb(0, 0, 0)"},generalization:{fontSize:14,fillColor:"#fff",borderColor:"rgb(255, 168, 101)",borderWidth:2,color:"#000"}};var k={backgroundColor:"rgb(236, 254, 255)",lineColor:"rgb(51, 51, 51)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(51, 51, 51)",root:{fillColor:"rgb(39, 222, 232)",color:"rgb(26, 26, 26)",borderColor:"rgb(26, 26, 26)",borderWidth:3,fontSize:24,shape:"roundedRectangle"},second:{fillColor:"rgb(235, 255, 187)",color:"rgb(0, 0, 0)",borderColor:"rgb(51, 51, 51)",borderWidth:3,fontSize:18,shape:"roundedRectangle"},node:{fontSize:14,color:"rgb(0, 0, 0)"},generalization:{fontSize:14,fillColor:"#fff",borderColor:"rgb(26, 26, 26)",borderWidth:2,color:"rgb(26, 26, 26)"}};var x={backgroundColor:"rgb(255, 251, 231)",lineColor:"rgb(110, 165, 79)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(136, 100, 0)",root:{fillColor:"rgb(254, 92, 92)",color:"#fff",borderColor:"rgb(18, 187, 55)",borderWidth:3,fontSize:24,shape:"roundedRectangle"},second:{fillColor:"rgb(209, 237, 176)",color:"rgb(85, 136, 55)",borderColor:"",borderWidth:3,fontSize:18,shape:"roundedRectangle"},node:{fontSize:14,color:"rgb(26, 26, 26)"},generalization:{fontSize:14,fillColor:"#fff",borderColor:"rgb(136, 100, 0)",borderWidth:2,color:"rgb(136, 100, 0)"}};var A={backgroundColor:"rgb(231, 245, 255)",lineColor:"rgb(96, 189, 255)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(0, 155, 255)",root:{fillColor:"rgb(96, 189, 255)",color:"#fff",borderColor:"#fff",borderWidth:3,fontSize:24,shape:"roundedRectangle"},second:{fillColor:"#fff",color:"rgb(0, 149, 255)",borderColor:"",borderWidth:3,fontSize:18,shape:"roundedRectangle"},node:{fontSize:14,color:"rgb(0, 66, 157)"},generalization:{fontSize:14,fillColor:"#fff",borderColor:"rgb(0, 155, 255)",borderWidth:2,color:"rgb(0, 155, 255)"}};var R={backgroundColor:"rgb(252, 245, 241)",lineColor:"rgb(144, 114, 110)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(128, 154, 151)",associativeLineColor:"rgb(166, 124, 106)",associativeLineTextColor:"rgb(166, 124, 106)",root:{fillColor:"rgb(207, 121, 105)",color:"#fff",borderColor:"rgb(207, 121, 105)",borderWidth:3,fontSize:24,shape:"roundedRectangle"},second:{fillColor:"rgb(239, 210, 207)",color:"rgb(144, 79, 68)",borderColor:"rgb(222, 186, 183)",borderWidth:3,fontSize:18,shape:"roundedRectangle"},node:{fontSize:14,color:"rgb(131, 90, 64)"},generalization:{fontSize:14,fillColor:"rgb(172, 202, 199)",borderColor:"rgb(172, 202, 199)",borderWidth:2,color:"rgb(91, 102, 97)"}};var G={backgroundColor:"rgb(233, 245, 241)",lineColor:"rgb(34, 34, 34)",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"rgb(34, 34, 34)",associativeLineColor:"rgb(56, 44, 116)",associativeLineTextColor:"rgb(68, 68, 68)",root:{fillColor:"rgb(56, 44, 116)",color:"#fff",borderColor:"rgb(56, 44, 116)",borderWidth:0,fontSize:24},second:{fillColor:"rgb(161, 213, 188)",color:"rgb(0, 0, 0)",borderColor:"",borderWidth:0,fontSize:18},node:{fontSize:14,color:"rgb(0, 0, 0)"},generalization:{fontSize:14,fillColor:"rgb(56, 44, 116)",borderColor:"",borderWidth:0,color:"#fff"}};var T={backgroundColor:"rgb(255, 255, 255)",lineColor:"rgb(0, 0, 0)",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"rgb(0, 0, 0)",associativeLineColor:"rgb(152, 162, 171)",associativeLineTextColor:"rgb(68, 68, 68)",root:{fillColor:"rgb(237, 182, 72)",color:"rgb(0, 0, 0)",borderColor:"rgb(0, 0, 0)",borderWidth:2,fontSize:24},second:{fillColor:"rgb(114, 158, 28)",color:"#fff",borderColor:"rgb(0, 0, 0)",borderWidth:2,fontSize:18},node:{fontSize:14,color:"rgb(10, 2, 2)"},generalization:{fontSize:14,fillColor:"#fff",borderColor:"",borderWidth:0,color:"rgb(10, 2, 2)"}};var N={backgroundColor:"rgb(255, 255, 255)",lineColor:"rgb(237, 185, 81)",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"rgb(226, 90, 64)",associativeLineColor:"rgb(152, 162, 171)",associativeLineTextColor:"rgb(68, 68, 68)",root:{fillColor:"rgb(226, 90, 64)",color:"#fff",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"rgb(43, 118, 239)",color:"#fff",borderColor:"",borderWidth:0,fontSize:18},node:{fontSize:14,color:"rgb(43, 118, 239)"},generalization:{fontSize:14,fillColor:"#fff",borderColor:"",borderWidth:0,color:"rgb(43, 118, 239)"}};var E={backgroundColor:"rgb(219, 255, 211)",lineColor:"rgb(51, 51, 51)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(255, 127, 71)",associativeLineColor:"rgb(160, 220, 63)",associativeLineTextColor:"rgb(160, 220, 63)",root:{fillColor:"rgb(15, 198, 113)",color:"#fff",borderColor:"",borderWidth:0,fontSize:24,shape:"roundedRectangle"},second:{fillColor:"#fff",color:"rgb(26, 26, 26)",borderColor:"",borderWidth:0,fontSize:18},node:{fontSize:14,color:"rgb(0, 0, 0)"},generalization:{fontSize:14,fillColor:"rgb(255, 127, 71)",borderColor:"",borderWidth:0,color:"#fff"}};var Z={lineColor:"#fff",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"#fff",backgroundColor:"rgb(80, 156, 170)",root:{fillColor:"#fff",borderColor:"",borderWidth:0,color:"rgb(65, 89, 158)"},second:{fillColor:"rgb(251, 227, 188)",color:"rgb(65, 89, 158)",borderColor:"",borderWidth:0,fontSize:14},node:{fontSize:12,color:"rgb(65, 89, 158)"},generalization:{fillColor:"#fff",borderColor:"transparent",color:"rgb(65, 89, 158)"}};var I={lineColor:"rgb(51, 51, 51)",lineWidth:2,generalizationLineWidth:3,generalizationLineColor:"rgb(51, 51, 51)",backgroundColor:"#fff",root:{fillColor:"rgb(18, 187, 55)",color:"#fff",fontSize:24,borderRadius:10},second:{fillColor:"rgb(241, 242, 241)",borderColor:"transparent",color:"#1a1a1a",fontSize:18,borderRadius:10},node:{fontSize:14,color:"#1a1a1a"},generalization:{fillColor:"#fff",borderColor:"rgb(51, 51, 51)",borderWidth:2,color:"#1a1a1a"}};var D={lineColor:"rgb(94, 202, 110)",lineWidth:2,generalizationLineWidth:3,generalizationLineColor:"#1a1a1a",backgroundColor:"rgb(241, 241, 241)",root:{fillColor:"rgb(255, 245, 214)",color:"#1a1a1a",fontSize:24,borderRadius:10,borderColor:"rgb(249, 199, 84)",borderWidth:1},second:{fillColor:"rgb(255, 245, 214)",borderColor:"rgb(249, 199, 84)",borderWidth:1,color:"#1a1a1a",fontSize:18,borderRadius:10},node:{fontSize:14,color:"#1a1a1a"},generalization:{fillColor:"#fff",borderColor:"#1a1a1a",color:"#1a1a1a",borderWidth:2}};var w={lineColor:"rgb(123, 199, 120)",backgroundColor:"rgb(236, 245, 231)",generalizationLineWidth:2,generalizationLineColor:"rgb(123, 199, 120)",root:{fillColor:"rgb(253, 244, 217)",color:"#222"},second:{fillColor:"rgb(253, 244, 217)",color:"#222",borderColor:"rgb(242, 200, 104)",borderWidth:1,fontSize:14},node:{fontSize:12,color:"#333"},generalization:{fillColor:"rgb(123, 199, 120)",borderColor:"transparent",borderWidth:2,color:"#fff"}};var B={lineColor:"rgb(51, 51, 51)",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"rgb(51, 51, 51)",backgroundColor:"rgb(239, 248, 250)",root:{fillColor:"rgb(255, 255, 255)",color:"#222"},second:{fillColor:"rgb(255, 255, 255)",color:"#222",borderColor:"rgb(255, 255, 255)",borderWidth:1,fontSize:14},node:{fontSize:12,color:"#333"},generalization:{fillColor:"#fff",borderColor:"rgb(51, 51, 51)",color:"#333"}};var M={lineColor:"rgb(115, 161, 191)",backgroundColor:"rgb(251, 251, 251)",generalizationLineWidth:1,generalizationLineColor:"#333",root:{fillColor:"rgb(115, 161, 191)"},second:{fillColor:"rgb(238, 243, 246)",color:"#333",borderColor:"rgb(115, 161, 191)",borderWidth:1,fontSize:14},node:{fontSize:12,color:"#333"},generalization:{fillColor:"#fff",borderColor:"#333",color:"#333"}};var Y={lineColor:"rgb(191, 115, 148)",backgroundColor:"rgb(251, 251, 251)",generalizationLineWidth:1,generalizationLineColor:"#333",root:{fillColor:"rgb(191, 115, 148)"},second:{fillColor:"rgb(246, 238, 242)",color:"#333",borderColor:"rgb(191, 115, 148)",borderWidth:1,fontSize:14},node:{fontSize:12,color:"#333"},generalization:{fillColor:"#fff",borderColor:"#333",color:"#333"}};var y={lineColor:"rgb(191, 147, 115)",backgroundColor:"rgb(251, 251, 251)",generalizationLineWidth:1,generalizationLineColor:"#333",root:{fillColor:"rgb(191, 147, 115)"},second:{fillColor:"rgb(246, 242, 238)",color:"#333",borderColor:"rgb(191, 147, 115)",borderWidth:1,fontSize:14},node:{fontSize:12,color:"#333"},generalization:{fillColor:"#fff",borderColor:"#333",color:"#333"}};var J={lineColor:"#333",backgroundColor:"#d1f6ec",generalizationLineWidth:1,generalizationLineColor:"#333",root:{fillColor:"#1fb27d"},second:{fillColor:"#fff",color:"#565656",borderColor:"transparent",borderWidth:0},generalization:{fillColor:"#fff",borderColor:"#333",color:"#333"}};var O={lineColor:"rgb(191, 115, 115)",backgroundColor:"rgb(251, 251, 251)",generalizationLineWidth:1,generalizationLineColor:"#333",root:{fillColor:"rgb(191, 115, 115)"},second:{fillColor:"rgb(246, 238, 238)",color:"#333",borderColor:"rgb(191, 115, 115)",borderWidth:1,fontSize:14},node:{fontSize:12,color:"#333"},generalization:{fillColor:"#fff",borderColor:"#333",color:"#333"}};var Q={lineColor:"rgb(123, 115, 191)",backgroundColor:"rgb(251, 251, 251)",generalizationLineWidth:1,generalizationLineColor:"#333",root:{fillColor:"rgb(123, 115, 191)"},second:{fillColor:"rgb(239, 238, 246)",color:"#333",borderColor:"rgb(123, 115, 191)",borderWidth:1,fontSize:14},node:{fontSize:12,color:"#333"},generalization:{fillColor:"#fff",borderColor:"#333",color:"#333"}};var j={lineColor:"rgb(166, 101, 106)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"#fff",backgroundColor:"rgb(255, 208, 211)",root:{fillColor:"rgb(139, 109, 225)",borderColor:"",borderWidth:0},second:{fillColor:"rgb(243, 104, 138)",color:"#fff",borderColor:"",borderWidth:0,fontSize:14},node:{fontSize:12,color:"#222"},generalization:{fillColor:"#fff",borderColor:"transparent",color:"#222"}};var U={lineColor:"rgb(104, 204, 202)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(90, 206, 241)",backgroundColor:"rgb(239, 255, 255)",root:{fillColor:"rgb(0, 192, 184)",borderColor:"",borderWidth:0},second:{fillColor:"#fff",color:"#222",borderColor:"rgb(184, 235, 233)",borderWidth:2,fontSize:14},node:{fontSize:12,color:"#222"},generalization:{fillColor:"rgb(90, 206, 241)",borderColor:"transparent",color:"#fff"}};var X={lineColor:"rgb(51, 56, 62)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(127, 93, 64)",backgroundColor:"#fff",root:{fillColor:"rgb(51, 56, 62)",color:"rgb(247, 208, 160)",borderColor:"",borderWidth:0},second:{fillColor:"rgb(239, 209, 176)",color:"rgb(81, 58, 42)",borderColor:"",borderWidth:0,fontSize:14},node:{fontSize:12,color:"#222"},generalization:{fillColor:"rgb(127, 93, 64)",borderColor:"transparent",color:"rgb(255, 214, 175)"}};var F={lineColor:"rgb(254, 146, 0)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(255, 222, 69)",backgroundColor:"rgb(255, 246, 243)",root:{fillColor:"rgb(255, 112, 52)",color:"#fff",borderColor:"",borderWidth:0},second:{fillColor:"#fff",color:"rgb(51, 51, 51)",borderColor:"",borderWidth:0,fontSize:14},node:{fontSize:12,color:"#222"},generalization:{fillColor:"rgb(255, 222, 69)",borderColor:"transparent",color:"rgb(51, 51, 51)"}};var V={lineColor:"rgb(40, 193, 84)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(251, 158, 0)",backgroundColor:"rgb(238, 255, 243)",root:{fillColor:"rgb(25, 193, 73)",color:"#fff",borderColor:"",borderWidth:0},second:{fillColor:"#fff",color:"rgb(69, 149, 96)",borderColor:"",borderWidth:0,fontSize:14},node:{fontSize:12,color:"#222"},generalization:{fillColor:"#fff",borderColor:"rgb(251, 158, 0)",borderWidth:2,color:"rgb(51, 51, 51)"}};var P={lineColor:"rgb(30, 53, 86)",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"rgb(56, 123, 233)",backgroundColor:"rgb(241, 241, 241)",root:{fillColor:"rgb(30, 53, 86)",color:"#fff",fontSize:24,borderRadius:10,borderColor:"rgb(189, 197, 201)",borderWidth:2},second:{fillColor:"rgb(169, 218, 218)",borderColor:"rgb(30, 53, 86)",borderWidth:2,color:"#fff",fontSize:18,borderRadius:10},node:{fontSize:14,color:"rgb(30, 53, 86)",borderColor:"rgb(30, 53, 86)",borderWidth:1,marginY:20},generalization:{fillColor:"rgb(56, 123, 233)",borderColor:"rgb(56, 123, 233)",color:"#fff",borderWidth:0}};var H={lineColor:"rgb(51, 51, 51)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"#222",backgroundColor:"rgb(248, 215, 49)",root:{fillColor:"rgb(55, 165, 255)",borderColor:"rgb(51, 51, 51)",borderWidth:3},second:{fillColor:"rgb(255, 160, 36)",color:"#222",borderColor:"rgb(51, 51, 51)",borderWidth:3,fontSize:14},node:{fontSize:12,color:"#222"},generalization:{borderColor:"#222",borderWidth:3,color:"#222"}};var K={lineColor:"rgb(34, 34, 34)",lineWidth:4,generalizationLineWidth:4,generalizationLineColor:"rgb(34, 34, 34)",root:{fillColor:"#fff",color:"rgb(34, 34, 34)",borderColor:"rgb(34, 34, 34)",borderWidth:3,fontSize:24},second:{fillColor:"rgb(241, 246, 248)",color:"rgb(34, 34, 34)",borderColor:"rgb(34, 34, 34)",borderWidth:3,fontSize:18},node:{fontSize:14,color:"rgb(34, 34, 34)"},generalization:{fontSize:14,fillColor:"transparent",borderColor:"rgb(34, 34, 34)",borderWidth:2,color:"rgb(34, 34, 34)"}};var q={lineColor:"rgb(113, 195, 169)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(113, 195, 169)",root:{fillColor:"rgb(16, 160, 121)",color:"#fff",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"rgb(240, 252, 249)",color:"rgb(50, 113, 96)",borderColor:"rgb(113, 195, 169)",borderWidth:2,fontSize:18},node:{fontSize:14,color:"rgb(10, 59, 43)"},generalization:{fontSize:14,fillColor:"rgb(246, 238, 211)",borderColor:"",borderWidth:0,color:"rgb(173, 91, 12)"}};var _={lineColor:"rgb(173, 123, 91)",lineWidth:4,generalizationLineWidth:4,generalizationLineColor:"rgb(173, 123, 91)",root:{fillColor:"rgb(202, 117, 79)",color:"#fff",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"rgb(245, 231, 216)",color:"rgb(125, 86, 42)",borderColor:"",borderWidth:0,fontSize:18},node:{fontSize:14,color:"rgb(96, 71, 47)"},generalization:{fontSize:14,fillColor:"rgb(255, 249, 239)",borderColor:"rgb(173, 123, 91)",borderWidth:2,color:"rgb(122, 83, 44)"}};var $={backgroundColor:"rgb(255, 238, 228)",lineColor:"rgb(230, 138, 131)",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"rgb(222, 101, 85)",root:{fillColor:"rgb(207, 44, 44)",color:"rgb(255, 233, 157)",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"rgb(255, 255, 255)",color:"rgb(211, 58, 21)",borderColor:"rgb(222, 101, 85)",borderWidth:2,fontSize:18},node:{fontSize:14,color:"rgb(144, 71, 43)"},generalization:{fontSize:14,fillColor:"rgb(255, 247, 211)",borderColor:"rgb(255, 202, 162)",borderWidth:2,color:"rgb(187, 101, 69)"}};var oo={backgroundColor:"#e6f1de",lineColor:"#f5ffad",lineWidth:4,generalizationLineWidth:3,generalizationLineColor:"#749336",root:{fillColor:"#94c143",color:"#fff",borderColor:"#94c143",borderWidth:0,fontSize:24},second:{fillColor:"#cee498",color:"#749336",borderColor:"#aec668",borderWidth:2,fontSize:18},node:{fontSize:14,color:"#749336"},generalization:{fontSize:14,fillColor:"#cee498",borderColor:"#aec668",borderWidth:2,color:"#749336"}};var ro={backgroundColor:"#fff2df",lineColor:"#b0bc47",lineWidth:3,generalizationLineWidth:3,generalizationLineColor:"#b0bc47",root:{fillColor:"#e68112",color:"#fff",borderColor:"#e68112",borderWidth:0,fontSize:24},second:{fillColor:"#ffd683",color:"#8c5416",borderColor:"#b0bc47",borderWidth:2,fontSize:18},node:{fontSize:14,color:"#8c5416"},generalization:{fontSize:14,fillColor:"#ffd683",borderColor:"#b0bc47",borderWidth:2,color:"#8c5416"}};var eo={backgroundColor:"#fff",lineColor:"#36aaa9",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"#36aaa9",associativeLineColor:"#3e58ea",associativeLineTextColor:"#679fba",associativeLineActiveColor:"#50a4b4",root:{fillColor:"#3e58ea",color:"#fff",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"#e3fbff",color:"#58aabc",borderColor:"#50a4b4",borderWidth:2,fontSize:18},node:{fontSize:14,color:"#50a4b4"},generalization:{fontSize:14,fillColor:"#3e58ea",borderColor:"",borderWidth:0,color:"#fff"}};var lo={backgroundColor:"#fffcf2",lineColor:"#333333",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"#ffda60",associativeLineColor:"#ffda60",associativeLineTextColor:"#333333",associativeLineActiveColor:"#333333",root:{fillColor:"#ffda60",color:"#3b3a37",borderColor:"#343334",borderWidth:2,fontSize:24},second:{fillColor:"#fff",color:"#131312",borderColor:"",borderWidth:0,fontSize:18},node:{fontSize:14,color:"#131312"},generalization:{fontSize:14,fillColor:"#ffda60",borderColor:"",borderWidth:0,color:"#464339"}};var io={backgroundColor:"#fffef6",lineColor:"#273d62",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"#273d62",associativeLineColor:"#9edeee",associativeLineTextColor:"#395c85",associativeLineActiveColor:"#273d62",root:{fillColor:"#273d62",color:"#fff",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"#9edeee",color:"#406080",borderColor:"#395c85",borderWidth:2,fontSize:18},node:{fontSize:14,color:"#395c85"},generalization:{fontSize:14,fillColor:"#273d62",borderColor:"",borderWidth:0,color:"#fff"}};var no={backgroundColor:"#ffffff",lineColor:"#333333",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"#2176ef",associativeLineColor:"#2176ef",associativeLineTextColor:"#343433",associativeLineActiveColor:"#343433",root:{fillColor:"#2176ef",color:"#fff",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"#fff9e4",color:"#4c4b46",borderColor:"#343433",borderWidth:2,fontSize:18},node:{fontSize:14,color:"#343433"},generalization:{fontSize:14,fillColor:"#2176ef",borderColor:"",borderWidth:0,color:"#fff"}};var to={backgroundColor:"#ffffff",lineColor:"#35b398",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"#21c384",associativeLineColor:"#21c384",associativeLineTextColor:"#4d754b",associativeLineActiveColor:"#f5ffe6",root:{fillColor:"#21c384",color:"#fff",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"#f5ffe6",color:"#386437",borderColor:"#35b398",borderWidth:2,fontSize:18},node:{fontSize:14,color:"#326032"},generalization:{fontSize:14,fillColor:"#21c384",borderColor:"",borderWidth:0,color:"#fff"}};var ao={backgroundColor:"#ffffff",lineColor:"#333333",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"#ffd613",associativeLineColor:"#ffd613",associativeLineTextColor:"#2d2b23",associativeLineActiveColor:"#d1ebf8",root:{fillColor:"#ffd613",color:"#2d2b23",borderColor:"#1f2021",borderWidth:2,fontSize:24},second:{fillColor:"#d1ebf8",color:"#717b80",borderColor:"#333333",borderWidth:2,fontSize:18,borderRadius:5},node:{fontSize:14,color:"#333333"},generalization:{fontSize:14,fillColor:"#ffd613",borderColor:"",borderWidth:0,color:"#2d2b23"}};var fo={backgroundColor:"#ffeed2",lineColor:"#976a43",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"#19807e",associativeLineColor:"#19807e",associativeLineTextColor:"#764014",associativeLineActiveColor:"#976a43",root:{fillColor:"#19807e",color:"#f3f0b8",borderColor:"",borderWidth:0,fontSize:24,shape:"circle"},second:{fillColor:"#eacdb3",color:"#7f4d1f",borderColor:"#764014",borderWidth:2,fontSize:18,shape:"roundedRectangle"},node:{fontSize:14,color:"#764014"},generalization:{fontSize:14,fillColor:"#19807e",borderColor:"",borderWidth:0,color:"#f3f0b8"}};var bo={backgroundColor:"#c8e4ea",lineColor:"#3e416c",lineWidth:2,generalizationLineWidth:2,generalizationLineColor:"#3e416c",associativeLineColor:"#ffdb9c",associativeLineTextColor:"#383b70",associativeLineActiveColor:"#3e416c",root:{fillColor:"#383b70",color:"#fff",borderColor:"",borderWidth:0,fontSize:24},second:{fillColor:"#ffdb9c",color:"#5e5c76",borderColor:"#3e416c",borderWidth:2,fontSize:18},node:{fontSize:14,color:"#3e416c"},generalization:{fontSize:14,fillColor:"#383b70",borderColor:"",borderWidth:0,color:"#fff"}};var t=[{name:"\u5929\u6E05\u7EFF",value:"skyGreen",theme:Z},{name:"\u7ECF\u5178\u7EFF",value:"classicGreen",theme:w},{name:"\u7ECF\u5178\u84DD",value:"classicBlue",theme:B},{name:"\u5929\u7A7A\u84DD",value:"blueSky",theme:M},{name:"\u8111\u6B8B\u7C89",value:"brainImpairedPink",theme:Y},{name:"\u6CE5\u571F\u9EC4",value:"earthYellow",theme:y},{name:"\u6E05\u65B0\u7EFF",value:"freshGreen",theme:J},{name:"\u6E05\u65B0\u7EA2",value:"freshRed",theme:O},{name:"\u6D6A\u6F2B\u7D2B",value:"romanticPurple",theme:Q},{name:"\u7C89\u7EA2\u8461\u8404",value:"pinkGrape",theme:j},{name:"\u8584\u8377",value:"mint",theme:U},{name:"\u91D1\u8272vip",value:"gold",theme:X},{name:"\u6D3B\u529B\u6A59",value:"vitalityOrange",theme:F},{name:"\u7EFF\u53F6",value:"greenLeaf",theme:V},{name:"\u5C0F\u9EC4\u4EBA",value:"minions",theme:H},{name:"\u7B80\u7EA6\u9ED1",value:"simpleBlack",theme:K},{name:"\u8BFE\u7A0B\u7EFF",value:"courseGreen",theme:q},{name:"\u5496\u5561",value:"coffee",theme:_},{name:"\u7EA2\u8272\u7CBE\u795E",value:"redSpirit",theme:$},{name:"\u725B\u6CB9\u679C",value:"avocado",theme:oo},{name:"\u79CB\u5929",value:"autumn",theme:ro},{name:"\u5965\u5229\u5965",value:"oreo",theme:p},{name:"\u6D45\u6D77",value:"shallowSea",theme:v},{name:"\u67E0\u6AAC\u6C14\u6CE1",value:"lemonBubbles",theme:k},{name:"\u73AB\u7470",value:"rose",theme:x},{name:"\u6D77\u84DD\u7EBF",value:"seaBlueLine",theme:A},{name:"\u83AB\u5170\u8FEA",value:"morandi",theme:R},{name:"\u4ED9\u4EBA\u638C",value:"cactus",theme:E},{name:"\u8111\u56FE\u7ECF\u51782",value:"classic2",theme:I},{name:"\u8111\u56FE\u7ECF\u51783",value:"classic3",theme:D},{name:"\u8111\u56FE\u7ECF\u51784",value:"classic4",theme:P},{name:"\u8111\u56FE\u7ECF\u51785",value:"classic5",theme:G},{name:"\u8111\u56FE\u7ECF\u51786",value:"classic6",theme:T},{name:"\u8111\u56FE\u7ECF\u51787",value:"classic7",theme:N},{name:"\u8111\u56FE\u7ECF\u51788",value:"classic8",theme:eo},{name:"\u8111\u56FE\u7ECF\u51789",value:"classic9",theme:lo},{name:"\u8111\u56FE\u7ECF\u517810",value:"classic10",theme:io},{name:"\u8111\u56FE\u7ECF\u517811",value:"classic11",theme:no},{name:"\u8111\u56FE\u7ECF\u517812",value:"classic12",theme:to},{name:"\u8111\u56FE\u7ECF\u517813",value:"classic13",theme:ao},{name:"\u8111\u56FE\u7ECF\u517814",value:"classic14",theme:fo},{name:"\u8111\u56FE\u7ECF\u517815",value:"classic15",theme:bo}].map(o=>({...o,dark:!1}));var go=[...n,...t],Wo={darkList:n,lightList:t,init(o){go.forEach(r=>{o.defineTheme(r.value,r.theme)})},remove(o){go.forEach(r=>{o.removeTheme(r.value)})}},uo=Wo; 2 | -------------------------------------------------------------------------------- /trilium-simple-mind-map/TriliumSmmWidget/SmmRender/utils.clone.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | utils 9 | 10 | 11 | 12 |
13 |

utils

14 | 15 |
16 |

这是一个笔记的克隆, 跳转到它的主目录.

17 |
18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /trilium-simple-mind-map/TriliumSmmWidget/config.js: -------------------------------------------------------------------------------- 1 | // 用于插件版本区分 2 | const SMM_WDIGET_VERSION = "v1.2.1"; 3 | 4 | // 获取template笔记ID 5 | const templateNote = await api.searchForNote(`#smmWidgetTemplate AND note.parents.labels.smmWidgetVersion="${SMM_WDIGET_VERSION}"`); 6 | const SMM_TPL_NOTE_ID = templateNote.noteId; 7 | 8 | // 获取css笔记ID 9 | const cssNotesQuery = await api.searchForNotes(`#smmWidgetCss AND note.parents.labels.smmWidgetVersion="${SMM_WDIGET_VERSION}"`); 10 | 11 | var CSS_NOTE_ID_LIST = []; 12 | 13 | // svg OR png 14 | const IMAGE_NOTE_TYPE = "svg"; 15 | 16 | // attachement OR note 17 | const EXPORT_TYPE = "note"; //!attachement为实验功能,暂时无法适配复制按钮 18 | 19 | // 左键框选,右键拖动 20 | const LKSRKD = false; 21 | 22 | // 是否显示编辑框 23 | const SHOW_SOURCE = false; //!实验功能,可能会出现样式错乱 24 | 25 | //zh_cn,en_us 26 | const LANGUAGE = 'zh_cn'; 27 | 28 | const lang = language[LANGUAGE]; 29 | 30 | const HELP_URL = "https://github.com/waterovo/trilium-simple-mind-map"; 31 | 32 | for ( let i = 0; i < cssNotesQuery.length; i++ ) { 33 | const note = cssNotesQuery[i]; 34 | CSS_NOTE_ID_LIST.push(note.noteId); 35 | } 36 | 37 | module.exports = { 38 | SMM_TPL_NOTE_ID, 39 | CSS_NOTE_ID_LIST, 40 | IMAGE_NOTE_TYPE, 41 | EXPORT_TYPE, 42 | LKSRKD, 43 | SHOW_SOURCE, 44 | HELP_URL, 45 | LANGUAGE, 46 | lang 47 | } -------------------------------------------------------------------------------- /trilium-simple-mind-map/TriliumSmmWidget/config/language.js: -------------------------------------------------------------------------------- 1 | module.exports={ 2 | zh_cn, 3 | en_us 4 | } -------------------------------------------------------------------------------- /trilium-simple-mind-map/TriliumSmmWidget/config/language/en_us.js: -------------------------------------------------------------------------------- 1 | module.exports={ 2 | toolbar: { 3 | undo: 'Undo', 4 | redo: 'Redo', 5 | insertSiblingNode: 'Sibling node', 6 | insertChildNode: 'Child node', 7 | deleteNode: 'Delete node', 8 | image: 'Image', 9 | icon: 'Icon', 10 | link: 'Link', 11 | note: 'Note', 12 | tag: 'Tag', 13 | summary: 'Summary', 14 | associativeLine: 'Associative line', 15 | outerFrame: 'Outer frame', 16 | more: 'more' 17 | }, 18 | tools: { 19 | menu: "Menu", 20 | enterFullScreen: "Enter Full Screen", 21 | exitFullScreen: "Exit Full Screen", 22 | enterFullTab: "Enter Full Tab", 23 | exitFullTab: "Exit Full Tab", 24 | exportFile: "Export File", 25 | selectExportType: "Select Export Type", 26 | saveAttachment: "Save Image Attachment", 27 | selection: "Selection", 28 | mouseRightSelect: "Left click to drag the canvas, right click to box select nodes", 29 | mouseLeftSelect: "Left click to box select nodes, right click to drag the canva", 30 | rainbowLines: "RainbowLines", 31 | open: "open", 32 | close: "close", 33 | structure: "Structure", 34 | logicalStructure: "logicalStructure", 35 | logicalStructureLeft: "logicalStructureLeft", 36 | mindMap: "mindMap", 37 | organizationStructure: "organizationStructure", 38 | catalogOrganization: "catalogOrganization", 39 | timeline: "timeline", 40 | timeline2: "timeline2", 41 | fishbone: "fishbone", 42 | verticalTimeline: "verticalTimeline", 43 | theme: "Theme", 44 | help: "Help" 45 | }, 46 | backdrops: { 47 | imageOnTitle: "Image", 48 | imageUrl: "Image URL", 49 | imageUrlPlaceholder: "Input Image URL", 50 | imageTitle: "Image Title", 51 | linkOnTitle: "Link", 52 | linkUrl: "Link URL", 53 | linkUrlPlaceholder: "Input Link URL", 54 | linkName: "Link Name", 55 | remarkOnTitle: "Remark", 56 | iconOnTitle: "Icon", 57 | close: "Close", 58 | save: "Save" 59 | }, 60 | showMessage: { 61 | themeNotExist: "The theme of the current map note does not exist and is automatically changed to the default one", 62 | imageNoteCreated: "The image note has been created successfully!", 63 | imageAttachmentCreated: "The image attachment has been created!" 64 | }, 65 | richTextToolbar: { 66 | bold: 'Bold', 67 | italic: 'Italic', 68 | underline: 'Underline', 69 | strike: 'Strike', 70 | removeFormat: 'Clear Style' 71 | } 72 | } -------------------------------------------------------------------------------- /trilium-simple-mind-map/TriliumSmmWidget/config/language/zh_cn.js: -------------------------------------------------------------------------------- 1 | module.exports={ 2 | toolbar: { 3 | undo: '回退', 4 | redo: '前进', 5 | insertSiblingNode: '同级节点', 6 | insertChildNode: '子节点', 7 | deleteNode: '删除节点', 8 | image: '图片', 9 | icon: '图标', 10 | link: '超链接', 11 | note: '备注', 12 | tag: '标签', 13 | summary: '概要', 14 | associativeLine: '关联线', 15 | outerFrame: '外框', 16 | more: '更多' 17 | }, 18 | tools: { 19 | menu: "菜单", 20 | enterFullScreen: "全屏", 21 | exitFullScreen: "退出全屏", 22 | enterFullTab: "全标签页", 23 | exitFullTab: "退出全标签页", 24 | exportFile: "导出", 25 | selectExportType: "选择导出类型", 26 | saveAttachment: "保存图片附件", 27 | selection: "鼠标按键", 28 | mouseRightSelect: "左键框选节点,右键拖动画布", 29 | mouseLeftSelect: "左键拖动画布,右键框选节点", 30 | rainbowLines: "彩虹线条", 31 | open: "开启", 32 | close: "关闭", 33 | structure: "结构", 34 | logicalStructure: "逻辑结构图", 35 | logicalStructureLeft: "向左逻辑结构图", 36 | mindMap: "思维导图", 37 | organizationStructure: "组织结构图", 38 | catalogOrganization: "目录组织图", 39 | timeline: "时间轴", 40 | timeline2: "时间轴2", 41 | fishbone: "鱼骨图", 42 | verticalTimeline: "竖向时间轴", 43 | theme: "主题", 44 | help: "帮助" 45 | }, 46 | backdrops: { 47 | imageOnTitle: "图片", 48 | imageUrl: "图片地址", 49 | imageUrlPlaceholder: "输入图片地址", 50 | imageTitle: "图片标题", 51 | linkOnTitle: "超链接", 52 | linkUrl: "链接", 53 | linkUrlPlaceholder: "输入链接地址", 54 | linkName: "名称", 55 | remarkOnTitle: "备注", 56 | iconOnTitle: "图标", 57 | close: "关闭", 58 | save: "保存" 59 | }, 60 | showMessage: { 61 | themeNotExist: "当前导图笔记的主题不存在,自动更换为默认主题", 62 | imageNoteCreated: "图像笔记已经创建成功了!", 63 | imageAttachmentCreated: "图像附件已经创建成功了!" 64 | }, 65 | richTextToolbar: { 66 | bold: '加粗', 67 | italic: '斜体', 68 | underline: '下划线', 69 | strike: '删除线', 70 | removeFormat: '清除样式' 71 | } 72 | } -------------------------------------------------------------------------------- /trilium-simple-mind-map/TriliumSmmWidget/utils.js: -------------------------------------------------------------------------------- 1 | // 获取css笔记内容 2 | async function getNoteConetntList(noteIdList) { 3 | const noteContentArr = JSON.parse(await api.runAsyncOnBackendWithManualTransactionHandling(async (noteIdList) => { 4 | const noteContentArr = []; 5 | for (const noteId of noteIdList) { 6 | const note = await api.getNote(noteId); 7 | noteContentArr.push(note.getContent()); 8 | } 9 | return JSON.stringify(noteContentArr); 10 | }, [noteIdList])); 11 | return noteContentArr; 12 | } 13 | 14 | // 获取笔记内容 15 | async function getData(noteId) { 16 | const data = await api.runOnBackend((noteId) => { 17 | const note = api.getNote(noteId); 18 | return note.getContent(); 19 | }, [noteId]); 20 | return data; 21 | } 22 | 23 | // 获取 24 | function setData(noteId, noteTitle, noteConetnt) { 25 | api.runAsyncOnBackendWithManualTransactionHandling(async (noteId, noteTitle, noteConetnt) => { 26 | const note = await api.getNote(noteId); 27 | note.title = noteTitle; 28 | note.setContent(noteConetnt); 29 | }, [noteId, noteTitle, noteConetnt]); 30 | } 31 | 32 | function setRelation(noteId, name, value) { 33 | api.runAsyncOnBackendWithManualTransactionHandling(async (noteId, name, value) => { 34 | const note = await api.getNote(noteId); 35 | note.setRelation(name, value); 36 | }, [noteId, name, value]); 37 | } 38 | 39 | function setLabel(noteId, name, value) { 40 | api.runAsyncOnBackendWithManualTransactionHandling(async (noteId, name, value) => { 41 | const note = await api.getNote(noteId); 42 | note.setLabel(name, value); 43 | }, [noteId, name, value]); 44 | } 45 | 46 | async function createDataNote(parentNoteId, title, content) { 47 | const noteId = await api.runOnBackend((parentNoteId, title, content) => { 48 | var obj = api.createDataNote(parentNoteId, title, content); 49 | return obj.note.noteId; 50 | }, [parentNoteId, title, content]); 51 | return noteId; 52 | } 53 | 54 | async function createImageNote(parentNoteId, title, fileType, content) { 55 | const noteId = await api.runOnBackend((parentNoteId, title, fileType, content) => { 56 | let imageNote = api.searchForNote(`#smmImageAttachment AND note.parents.noteId='${parentNoteId}' AND note.title='${title}'`); 57 | let imageData = Buffer.from(content.replace(/^data:image\/[a-zA-Z+]+;base64,/, ''), 'base64'); 58 | function getExtensionFromBase64(base64) { 59 | let re = new RegExp('data:image/(?.*?);base64,.*') 60 | let res = re.exec(base64) 61 | if (res) { 62 | return res.groups.ext 63 | } 64 | } 65 | const imageType = getExtensionFromBase64(content); 66 | if (fileType === 'svg') { 67 | imageData = imageData.toString('utf-8'); 68 | } 69 | if (imageNote === null) { 70 | const noteParams = { 71 | parentNoteId: parentNoteId, 72 | title: title, 73 | content: imageData, 74 | type: "image", 75 | } 76 | var obj = api.createNewNote(noteParams); 77 | imageNote = obj.note; 78 | } else { 79 | imageNote.setContent(imageData); 80 | } 81 | 82 | imageNote.mime = `image/${imageType}`; 83 | imageNote.setLabel("smmImageAttachment"); 84 | imageNote.save(); 85 | }, [parentNoteId, title, fileType, content]); 86 | } 87 | 88 | async function createImageAttachment(parentNoteId, title, fileType, content) { 89 | const noteId = await api.runOnBackend((parentNoteId, title, fileType, content) => { 90 | const parentNote = api.getNote(parentNoteId); 91 | let attachment = parentNote.getAttachmentByTitle(title); 92 | let imageData = Buffer.from(content.replace(/^data:image\/[a-zA-Z+]+;base64,/, ''), 'base64'); 93 | function getExtensionFromBase64(base64) { 94 | let re = new RegExp('data:image/(?.*?);base64,.*') 95 | let res = re.exec(base64) 96 | if (res) { 97 | return res.groups.ext 98 | } 99 | } 100 | const imageType = getExtensionFromBase64(content); 101 | 102 | if (fileType === 'svg') { 103 | imageData = imageData.toString('utf-8'); 104 | } 105 | 106 | if(!attachment){ 107 | const attachment = parentNote.saveAttachment({ 108 | role: 'image', 109 | mime: `image/${imageType}`, 110 | title: title, 111 | content: imageData 112 | }); 113 | attachment.utcDateScheduledForErasureSince = null; 114 | attachment.save(); 115 | }else{ 116 | api.log(attachment.attachmentId); 117 | attachment.setContent(imageData); 118 | attachment.utcDateScheduledForErasureSince = null; 119 | attachment.save(); 120 | } 121 | }, [parentNoteId, title, fileType, content]); 122 | } 123 | 124 | async function renderEjsTemplate(templateId, opts) { 125 | return await api.runAsyncOnBackendWithManualTransactionHandling(async (templateId, opts)=>{ 126 | const ejs = await import("ejs"); 127 | // Get the template note and content 128 | const templateNote = api.getNote(templateId); 129 | 130 | // Make sure the note type is correct 131 | if (templateNote.type === 'code' && templateNote.mime === 'application/x-ejs') { 132 | 133 | // EJS caches the result of this so we don't need to pre-cache 134 | const includer = (path) => { 135 | const childNote = templateNote.children.find(n => path === n.title); 136 | if (!childNote) return null; 137 | if (childNote.type !== 'code' || childNote.mime !== 'application/x-ejs') return null; 138 | return { template: childNote.getContent() }; 139 | }; 140 | 141 | // Try to render user's template, w/ fallback to default view 142 | try { 143 | const ejsResult = ejs.render(templateNote.getContent(), opts, {includer}); 144 | return ejsResult; 145 | } 146 | catch (e) { 147 | api.log(`Rendering user provided share template (${templateId}) threw exception ${e.message} with stacktrace: ${e.stack}`); 148 | } 149 | } 150 | return null; 151 | },[templateId, opts]); 152 | } 153 | 154 | module.exports = { 155 | getNoteConetntList, 156 | getData, 157 | setData, 158 | setRelation, 159 | setLabel, 160 | createDataNote, 161 | createImageNote, 162 | createImageAttachment, 163 | renderEjsTemplate 164 | } 165 | -------------------------------------------------------------------------------- /trilium-simple-mind-map/assets/1_share_page.ejs/tree_item.dat: -------------------------------------------------------------------------------- 1 | <% 2 | const isExternalLink = note.hasLabel('shareExternalLink'); 3 | const linkHref = isExternalLink ? note.getLabelValue('shareExternalLink') : `./${note.shareId}`; 4 | const target = isExternalLink ? ` target="_blank" rel="noopener noreferrer"` : ''; 5 | %> 6 |

7 | <% const titleWithPrefix = (branch.prefix ? `${branch.prefix} - ` : '') + note.title; %> 8 | 9 | <% if (activeNote.noteId === note.noteId) { %> 10 | <%= titleWithPrefix %> 11 | <% } else { %> 12 | ><%= titleWithPrefix %> 13 | <% } %> 14 |

15 | 16 | <% if (note.hasChildren()) { %> 17 |
    18 | <% note.getVisibleChildBranches().forEach(function (branch) { %> 19 |
  • 20 | <%- include('tree_item', {branch: branch, note: branch.getNote()}) %> 21 |
  • 22 | <% }) %> 23 |
24 | <% } %> -------------------------------------------------------------------------------- /trilium-simple-mind-map/assets/css.css: -------------------------------------------------------------------------------- 1 | .smm-widget.smm-show-source { 2 | flex-grow: 5; 3 | overflow: auto; 4 | min-height: 200px; 5 | border-bottom: 1px solid var(--main-border-color); 6 | margin-bottom: 10px; 7 | flex-basis: 0; 8 | } 9 | 10 | .smm-widget.smm-hide-source { 11 | position: absolute; 12 | width: 100%; 13 | height: 100%; 14 | top: 0; 15 | left: 0; 16 | margin: auto; 17 | z-index: 200; 18 | } 19 | 20 | .smm-render { 21 | position: relative; 22 | overflow: auto; 23 | height: 100%; 24 | background: var(--main-background-color); 25 | } 26 | 27 | .smm-container { 28 | width: 100%; 29 | height: 100%; 30 | } 31 | 32 | .smm-container { 33 | moz-user-select: -moz-none; 34 | -moz-user-select: none; 35 | -o-user-select: none; 36 | -khtml-user-select: none; 37 | -webkit-user-select: none; 38 | -ms-user-select: none; 39 | user-select: none; 40 | } 41 | 42 | .smm-container * { 43 | margin: 0; 44 | padding: 0; 45 | } 46 | 47 | .smm-toolbar { 48 | position: absolute; 49 | left: 50%; 50 | transform: translateX(-50%); 51 | top: 10px; 52 | width: max-content; 53 | display: flex; 54 | font-size: 12px; 55 | font-weight: 400; 56 | color: rgba(26, 26, 26, 0.8); 57 | z-index: 3; 58 | } 59 | 60 | .smm-toolbar .smm-toolbar-block { 61 | display: flex; 62 | background-color: #fff; 63 | padding: 10px 15px; 64 | border-radius: 6px !important; 65 | box-shadow: 0 2px 16px 0 rgba(0, 0, 0, .06); 66 | border: 1px solid rgba(0, 0, 0, .06); 67 | margin-right: 20px; 68 | flex-shrink: 0; 69 | position: relative; 70 | } 71 | 72 | .smm-toolbar-btn-list { 73 | display: flex; 74 | } 75 | 76 | .smm-toolbar-block .smm-toolbar-btn { 77 | display: flex; 78 | justify-content: center; 79 | flex-direction: column; 80 | cursor: pointer; 81 | margin-right: 20px; 82 | } 83 | 84 | .smm-toolbar-block .smm-toolbar-btn:last-of-type { 85 | margin-right: 0; 86 | } 87 | 88 | .smm-toolbar-block .smm-toolbar-btn.dropdown-toggle::after { 89 | display: none !important; 90 | } 91 | 92 | .smm-toolbar-block .dropdown-menu { 93 | padding:12px; 94 | min-width: 150px !important; 95 | border-radius: 4px !important; 96 | } 97 | 98 | .smm-toolbar-btn-list.v { 99 | width: 120px; 100 | flex-wrap: wrap; 101 | } 102 | 103 | .smm-toolbar-btn-list.v .smm-toolbar-btn { 104 | flex-direction: row; 105 | justify-content: flex-start; 106 | margin-bottom: 10px; 107 | width: 100%; 108 | margin-right: 0; 109 | } 110 | 111 | .smm-toolbar-btn-list.v .smm-toolbar-btn:last-of-type { 112 | margin-bottom: 0; 113 | } 114 | 115 | .smm-toolbar-btn-list.v .smm-toolbar-btn .icon { 116 | margin-right: 10px; 117 | } 118 | 119 | .smm-toolbar-btn-list.v .smm-toolbar-btn .text { 120 | font-size: 14px; 121 | white-space: nowrap; 122 | overflow: hidden; 123 | text-overflow: ellipsis; 124 | } 125 | 126 | .smm-toolbar-block .smm-toolbar-btn.active .icon, 127 | .smm-toolbar-block .smm-toolbar-btn:hover:not(.disabled) .icon { 128 | background: #f5f5f5; 129 | } 130 | 131 | .smm-toolbar-block .smm-toolbar-btn.disabled { 132 | color: #bcbcbc; 133 | cursor: not-allowed; 134 | pointer-events: none; 135 | } 136 | 137 | .smm-toolbar-block .smm-toolbar-btn .icon { 138 | display: flex; 139 | height: 26px; 140 | background: #fff; 141 | border-radius: 4px !important; 142 | border: 1px solid #e9e9e9; 143 | justify-content: center; 144 | flex-direction: column; 145 | text-align: center; 146 | padding: 0 5px; 147 | } 148 | 149 | .iconfont { 150 | font-family: boxicons !important; 151 | font-size: 16px; 152 | font-style: normal; 153 | -webkit-font-smoothing: antialiased; 154 | -moz-osx-font-smoothing: grayscale; 155 | } 156 | 157 | .smm-toolbar-block .smm-toolbar-btn .text { 158 | margin-top: 3px; 159 | } 160 | 161 | .smm-backdrops-container textarea { 162 | background: none !important; 163 | } 164 | 165 | .smm-render .smm-tools { 166 | position: absolute; 167 | z-index: 110; 168 | top: 10px; 169 | left: 10px; 170 | border-radius: 5px !important; 171 | opacity: 0.5; 172 | } 173 | 174 | .smm-render .smm-tools:hover { 175 | opacity: 1; 176 | } 177 | 178 | .smm-render .smm-tools ul { 179 | float: left; 180 | margin: 0 3px; 181 | } 182 | 183 | .smm-render .smm-tools li { 184 | display: none; 185 | } 186 | 187 | .smm-render .smm-tools li.title { 188 | display: list-item; 189 | } 190 | 191 | .smm-render .smm-tools li.title .menu-text { 192 | display: none; 193 | } 194 | 195 | .smm-render .smm-tools-active { 196 | opacity: 1; 197 | border: solid 1px #fff; 198 | border-color: gray; 199 | background-color: #fff; 200 | } 201 | 202 | .smm-render .smm-tools-active li { 203 | display: list-item; 204 | } 205 | 206 | .smm-render .smm-tools-active li.title { 207 | opacity: 1; 208 | } 209 | 210 | .smm-render .smm-tools-active li.title .menu-text { 211 | display: inline-block; 212 | } 213 | 214 | .smm-render .menu { 215 | padding: 6px 8px !important; 216 | list-style: none; 217 | } 218 | 219 | .smm-render .menu li { 220 | height: 28px; 221 | opacity: 0.4; 222 | cursor: default; 223 | user-select: none; 224 | font-family: "Microsoft YaHei", sans-serif, Verdana; 225 | vertical-align: middle; 226 | } 227 | 228 | .smm-render .menu li:hover { 229 | opacity: 1; 230 | } 231 | 232 | .smm-render .menu .menu-icon { 233 | display: inline-block; 234 | font-size: 18px; 235 | height: 28px; 236 | line-height: 28px; 237 | margin-right: 6px; 238 | padding: 0; 239 | vertical-align: middle; 240 | } 241 | 242 | .smm-render .menu .menu-text { 243 | display: inline-block; 244 | font-size: 14px; 245 | height: 28px; 246 | line-height: 28px; 247 | vertical-align: baseline; 248 | } 249 | 250 | .smm-render .menu .menu-divider { 251 | border-bottom: solid 1px gray; 252 | height: 0; 253 | margin: 6px 0; 254 | } 255 | 256 | .smm-render .menu-item { 257 | position: relative; 258 | } 259 | 260 | .smm-render .menu-item .menu { 261 | background-color: #fff; 262 | border: solid 1px gray; 263 | border-radius: 5px; 264 | display: none; 265 | position: absolute; 266 | left: 95%; 267 | top: 0; 268 | z-index: 112; 269 | } 270 | 271 | .smm-render .menu-item:hover .menu { 272 | display: block; 273 | } 274 | 275 | .smm-render.full{ 276 | position:fixed !important; 277 | z-index: 200; 278 | top: 0; 279 | left: 0; 280 | right: 0; 281 | bottom: 0; 282 | width: 100%; 283 | height: 100% !important; 284 | } 285 | 286 | .smm-render .smm-components-container #nodeOuterFrameContainer { 287 | display: none; 288 | position: fixed; 289 | transform: translate(-12px, -12px); 290 | } 291 | 292 | .smm-render .smm-components-container .smm-outer-frame-active { 293 | display: block !important; 294 | } 295 | 296 | .smm-render .smm-components-container #nodeOuterFrameContainer .smm-outer-frame-btn { 297 | width: 24px; 298 | height: 24px; 299 | background-color: #fff; 300 | border-radius: 50%; 301 | display: flex; 302 | align-items: center; 303 | justify-content: center; 304 | cursor: pointer; 305 | box-shadow: 0 2px 16px 0 rgba(0, 0, 0, .06); 306 | border: 1px solid rgba(0, 0, 0, .06); 307 | } -------------------------------------------------------------------------------- /trilium-simple-mind-map/assets/share_page.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <% if (note.hasLabel("shareDescription")) { %> 6 | "> 7 | <% } %> 8 | 9 | 10 | <% if (note.hasRelation("shareFavicon")) { %> 11 | /download"> 12 | <% } else { %> 13 | 14 | <% } %> 15 | 16 | <% if (!note.isLabelTruthy("shareOmitDefaultCss")) { %> 17 | 18 | 19 | <% } %> 20 | <% if (note.type === 'text' || note.type === 'book') { %> 21 | 22 | <% } %> 23 | <% for (const cssRelation of note.getRelations("shareCss")) { %> 24 | 25 | <% } %> 26 | <% for (const jsRelation of note.getRelations("shareJs")) { %> 27 | 28 | <% } %> 29 | 30 | 31 | 32 | <% if (note.isLabelTruthy('shareDisallowRobotIndexing')) { %> 33 | 34 | <% } %> 35 | <%- header %> 36 | <%= note.title %> 37 | 38 | 39 |
40 |
41 | <% if (note.parents[0].noteId !== '_share' && note.parents.length !== 0) { %> 42 | 46 | <% } %> 47 | 48 |

<%= note.title %>

49 | 50 | <% if (note.hasLabel("pageUrl")) { %> 51 |
This note was originally clipped from "><%= note.getLabelValue("pageUrl") %>
52 | <% } %> 53 | 54 | <% if (!isEmpty) { %> 55 | <% if (note.type === 'code' && note.mime === "application/json" && note.hasLabel('simpleMindMap')) { %> 56 | 57 | 67 |
68 | 110 | <% } else { %> 111 |
112 | <%- content %> 113 |
114 | <% } %> 115 | <% } %> 116 | 117 | <% if (note.hasVisibleChildren()) { %> 118 | 138 | <% } else if (isEmpty) { %> 139 |

This note has no content.

140 | <% } %> 141 |
142 | 143 | <% if (subRoot.note.hasVisibleChildren()) { %> 144 | 145 | 146 | 149 | <% } %> 150 |
151 | 152 | -------------------------------------------------------------------------------- /trilium-simple-mind-map/assets/template.ejs: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
<%= config.lang.toolbar.undo %>
6 |
<%= config.lang.toolbar.redo %>
7 |
<%= config.lang.toolbar.insertSiblingNode %>
8 |
<%= config.lang.toolbar.insertChildNode %>
9 |
<%= config.lang.toolbar.deleteNode %>
10 |
<%= config.lang.toolbar.image %>
11 |
<%= config.lang.toolbar.icon %>
12 |
<%= config.lang.toolbar.link %>
13 |
<%= config.lang.toolbar.note %>
14 |
<%= config.lang.toolbar.summary %>
15 |
16 | 17 | 28 |
29 |
30 | 31 |
32 | 116 |
117 | 118 |
119 | 149 | 150 | 180 | 181 | 202 | 203 | 220 |
221 |
222 |
223 |
224 | 225 |
226 |
227 |
-------------------------------------------------------------------------------- /trilium-simple-mind-map/快捷键.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 快捷键 9 | 10 | 11 | 12 |
13 |

快捷键

14 | 15 |
16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 |
快捷键命令
Control+zBACK
Control+yFORWARD
TabINSERT_CHILD_NODE
InsertINSERT_CHILD_NODE
EnterINSERT_NODE
Shift+TabINSERT_PARENT_NODE
Control+gADD_GENERALIZATION
Del或BackspaceREMOVE_NODE
Shift+BackspaceREMOVE_CURRENT_NODE
Control+aSELECT_ALL
Control+lRESET_LAYOUT
Control+UpUP_NODE
Control+DownDOWN_NODE
79 |
80 |
81 |
82 | 83 | 84 | --------------------------------------------------------------------------------