crossnote 0.8.7 → 0.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/out/cjs/index.cjs +179 -213
- package/out/dependencies/README.md +1 -9
- package/out/dependencies/reveal/css/reset.css +30 -0
- package/out/dependencies/reveal/css/reveal.css +3 -3
- package/out/dependencies/reveal/js/reveal.js +3 -3
- package/out/dependencies/reveal/plugin/notes/notes.js +1 -147
- package/out/dependencies/reveal/plugin/notes/plugin.js +261 -0
- package/out/dependencies/reveal/plugin/notes/speaker-view.html +891 -0
- package/out/dependencies/reveal/plugin/search/plugin.js +243 -0
- package/out/dependencies/reveal/plugin/search/search.js +7 -206
- package/out/dependencies/reveal/plugin/zoom/plugin.js +264 -0
- package/out/dependencies/reveal/plugin/zoom/zoom.js +11 -0
- package/out/esm/index.mjs +195 -229
- package/out/styles/preview.css +1 -1
- package/out/styles/preview_theme/github-dark.css +1 -1
- package/out/styles/prism_theme/github-dark.css +1 -0
- package/out/styles/style-template.css +1 -1
- package/out/types/src/markdown-engine/index.d.ts +2 -2
- package/out/types/src/notebook/index.d.ts +10 -8
- package/out/types/src/notebook/note.d.ts +2 -1
- package/out/types/src/notebook/types.d.ts +19 -1
- package/out/types/src/webview/backlinks.d.ts +1 -0
- package/out/types/src/webview/components/Backlinks.d.ts +2 -0
- package/out/types/src/webview/components/ContextMenu.d.ts +3 -0
- package/out/types/src/webview/components/Footer.d.ts +2 -0
- package/out/types/src/webview/components/ImageHelper.d.ts +2 -0
- package/out/types/src/webview/components/LoadingIcon.d.ts +2 -0
- package/out/types/src/webview/components/Preview.d.ts +2 -0
- package/out/types/src/webview/components/RefreshingIcon.d.ts +2 -0
- package/out/types/src/webview/components/SidebarToc.d.ts +2 -0
- package/out/types/src/webview/components/Topbar.d.ts +2 -0
- package/out/types/src/webview/containers/preview.d.ts +37 -0
- package/out/types/src/webview/lib/types.d.ts +19 -0
- package/out/types/src/webview/lib/utility.d.ts +2 -0
- package/out/types/src/webview/preview.d.ts +1 -0
- package/out/types/tsconfig.tsbuildinfo +1 -1
- package/out/webview/backlinks.css +1 -0
- package/out/webview/backlinks.js +43 -0
- package/out/webview/preview.css +1 -0
- package/out/webview/preview.js +84 -0
- package/package.json +26 -2
- package/out/dependencies/jquery/jquery.js +0 -4
- package/out/dependencies/jquery-contextmenu/font/context-menu-icons.eot +0 -0
- package/out/dependencies/jquery-contextmenu/font/context-menu-icons.ttf +0 -0
- package/out/dependencies/jquery-contextmenu/font/context-menu-icons.woff +0 -0
- package/out/dependencies/jquery-contextmenu/font/context-menu-icons.woff2 +0 -0
- package/out/dependencies/jquery-contextmenu/jquery.contextMenu.min.css +0 -16
- package/out/dependencies/jquery-contextmenu/jquery.contextMenu.min.js +0 -2
- package/out/dependencies/jquery-contextmenu/jquery.ui.position.min.js +0 -6
- package/out/dependencies/jquery-modal/jquery.modal.min.css +0 -1
- package/out/dependencies/jquery-modal/jquery.modal.min.js +0 -5
- package/out/dependencies/reveal/plugin/highlight/highlight.js +0 -77
- package/out/dependencies/reveal/plugin/markdown/example.html +0 -136
- package/out/dependencies/reveal/plugin/markdown/example.md +0 -36
- package/out/dependencies/reveal/plugin/markdown/markdown.js +0 -412
- package/out/dependencies/reveal/plugin/markdown/marked.js +0 -6
- package/out/dependencies/reveal/plugin/math/math.js +0 -67
- package/out/styles/loading.css +0 -1
- package/out/types/src/webview/webview.d.ts +0 -1
- package/out/webview/index.js +0 -22
package/out/styles/preview.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.scrollbar-style::-webkit-scrollbar{width:8px}.scrollbar-style::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}.scrollbar-style::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,.66);border:4px solid rgba(150,150,150,.66);background-clip:content-box}.crossnote::-webkit-scrollbar{width:8px}.crossnote::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}.crossnote::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,.66);border:4px solid rgba(150,150,150,.66);background-clip:content-box}.preview-container{width:100%;margin:0;padding:0;box-sizing:border-box}.preview-container .btn{display:inline-block;color:#99aeb8;text-shadow:none;border:1px solid #171e22;background-color:#32424a;background-image:linear-gradient(#364850,#32424a);height:auto;padding:0 .8em;font-size:1em;line-height:2em;margin-bottom:0;font-weight:400;text-align:center;vertical-align:middle;border:none;border-radius:3px;white-space:nowrap;cursor:pointer;z-index:0;user-select:none;box-sizing:border-box}.preview-container .
|
|
1
|
+
body,html{width:100%}.scrollbar-style::-webkit-scrollbar{width:8px}.scrollbar-style::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}.scrollbar-style::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,.66);border:4px solid rgba(150,150,150,.66);background-clip:content-box}.crossnote::-webkit-scrollbar{width:8px}.crossnote::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}.crossnote::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,.66);border:4px solid rgba(150,150,150,.66);background-clip:content-box}.preview-container{width:100%;margin:0;padding:0;box-sizing:border-box}.preview-container .btn{display:inline-block;color:#99aeb8;text-shadow:none;border:1px solid #171e22;background-color:#32424a;background-image:linear-gradient(#364850,#32424a);height:auto;padding:0 .8em;font-size:1em;line-height:2em;margin-bottom:0;font-weight:400;text-align:center;vertical-align:middle;border:none;border-radius:3px;white-space:nowrap;cursor:pointer;z-index:0;user-select:none;box-sizing:border-box}.preview-container .context-menu-item{list-style:none}.preview-container.show-sidebar-toc .md-sidebar-toc{font-family:"Helvetica Neue",Helvetica,"Segoe UI",Arial,freesans,sans-serif;position:fixed;top:0;right:0;width:268px;height:100%;padding:32px 0 12px 0;overflow:auto;background-color:#fff;font-size:14px;box-shadow:-4px 0 12px rgba(150,150,150,.33);box-sizing:border-box}.preview-container.show-sidebar-toc .md-sidebar-toc a{text-decoration:none}.preview-container.show-sidebar-toc .md-sidebar-toc .md-toc{padding:0 16px}.preview-container.show-sidebar-toc .md-sidebar-toc .md-toc .md-toc-link-wrapper .md-toc-link{display:inline;padding:.25rem 0}.preview-container.show-sidebar-toc .md-sidebar-toc .md-toc .md-toc-link-wrapper .md-toc-link div,.preview-container.show-sidebar-toc .md-sidebar-toc .md-toc .md-toc-link-wrapper .md-toc-link p{display:inline}.preview-container.show-sidebar-toc .md-sidebar-toc .md-toc .md-toc-link-wrapper.highlighted .md-toc-link{font-weight:800}.preview-container.show-sidebar-toc .crossnote{width:calc(100% - 268px)}.preview-container .crossnote[data-for=preview]{left:0;top:0;margin:0;padding:2em;overflow:auto;display:block;box-sizing:border-box}.preview-container .crossnote[data-for=preview] .code-chunk{position:relative}.preview-container .crossnote[data-for=preview] .code-chunk pre{cursor:text}.preview-container .crossnote[data-for=preview] .code-chunk .btn-group{position:absolute;right:0;top:0;display:none}.preview-container .crossnote[data-for=preview] .code-chunk .btn-group .run-all-btn,.preview-container .crossnote[data-for=preview] .code-chunk .btn-group .run-btn{float:right;margin-left:4px;border-radius:3px;font-size:.8em;color:#eee;background-color:#528bff;background-image:none;border:none}.preview-container .crossnote[data-for=preview] .code-chunk .btn-group .run-all-btn:hover,.preview-container .crossnote[data-for=preview] .code-chunk .btn-group .run-btn:hover{background-color:#4b7fe8;cursor:pointer}.preview-container .crossnote[data-for=preview] .code-chunk:hover .btn-group{display:block}.preview-container .crossnote[data-for=preview] .code-chunk .status{position:absolute;right:0;top:0;font-size:.85em;color:inherit;padding:2px 6px;background-color:rgba(0,0,0,.04);display:none}.preview-container .crossnote[data-for=preview] .code-chunk.running .btn-group{display:none}.preview-container .crossnote[data-for=preview] .code-chunk.running .status{display:block}body[data-presentation-mode] .crossnote[data-for=preview]{padding:0!important;width:100%;height:100%}body:not([data-presentation-mode]) .crossnote[data-for=preview]{height:auto}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
html body{font-family:"Helvetica Neue",Helvetica,"Segoe UI",Arial,freesans,sans-serif;font-size:16px;line-height:1.6;color:#ccc;background-color:#
|
|
1
|
+
html body{font-family:"Helvetica Neue",Helvetica,"Segoe UI",Arial,freesans,sans-serif;font-size:16px;line-height:1.6;color:#ccc;background-color:#24292e;overflow:initial;box-sizing:border-box;word-wrap:break-word}html body>:first-child{margin-top:0}html body h1,html body h2,html body h3,html body h4,html body h5,html body h6{line-height:1.2;margin-top:1em;margin-bottom:16px;color:#fff}html body h1{font-size:2.25em;font-weight:300;padding-bottom:.3em}html body h2{font-size:1.75em;font-weight:400;padding-bottom:.3em}html body h3{font-size:1.5em;font-weight:500}html body h4{font-size:1.25em;font-weight:600}html body h5{font-size:1.1em;font-weight:600}html body h6{font-size:1em;font-weight:600}html body h1,html body h2,html body h3,html body h4,html body h5{font-weight:600}html body h5{font-size:1em}html body h6{color:#a3a3a3}html body strong{color:#fff}html body del{color:#a3a3a3}html body a:not([href]){color:inherit;text-decoration:none}html body a{color:#08c;text-decoration:none}html body a:hover{color:#00a3f5;text-decoration:none}html body img{max-width:100%}html body>p{margin-top:0;margin-bottom:16px;word-wrap:break-word}html body>ol,html body>ul{margin-bottom:16px}html body ol,html body ul{padding-left:2em}html body ol.no-list,html body ul.no-list{padding:0;list-style-type:none}html body ol ol,html body ol ul,html body ul ol,html body ul ul{margin-top:0;margin-bottom:0}html body li{margin-bottom:0}html body li.task-list-item{list-style:none}html body li>p{margin-top:0;margin-bottom:0}html body .task-list-item-checkbox{margin:0 .2em .25em -1.8em;vertical-align:middle}html body .task-list-item-checkbox:hover{cursor:pointer}html body blockquote{margin:16px 0;font-size:inherit;padding:0 15px;color:#a3a3a3;background-color:#363d45;border-left:4px solid #48525c}html body blockquote>:first-child{margin-top:0}html body blockquote>:last-child{margin-bottom:0}html body hr{height:4px;margin:32px 0;background-color:#48525c;border:0 none}html body table{margin:10px 0 15px 0;border-collapse:collapse;border-spacing:0;display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all}html body table th{font-weight:700;color:#fff}html body table td,html body table th{border:1px solid #48525c;padding:6px 13px}html body dl{padding:0}html body dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:700}html body dl dd{padding:0 16px;margin-bottom:16px}html body code{font-family:Menlo,Monaco,Consolas,'Courier New',monospace;font-size:.85em!important;color:#fff;background-color:#363d45;border-radius:3px;padding:.2em 0}html body code::after,html body code::before{letter-spacing:-.2em;content:"\00a0"}html body pre>code{padding:0;margin:0;font-size:.85em!important;word-break:normal;white-space:pre;background:0 0;border:0}html body .highlight{margin-bottom:16px}html body .highlight pre,html body pre{padding:1em;overflow:auto;font-size:.85em!important;line-height:1.45;border:#48525c;border-radius:3px}html body .highlight pre{margin-bottom:0;word-break:normal}html body pre code,html body pre tt{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}html body pre code:after,html body pre code:before,html body pre tt:after,html body pre tt:before{content:normal}html body blockquote,html body dl,html body ol,html body p,html body pre,html body ul{margin-top:0;margin-bottom:16px}html body kbd{color:#fff;border:1px solid #48525c;border-bottom:2px solid #3a424b;padding:2px 4px;background-color:#363d45;border-radius:3px}@media print{html body{background-color:#24292e}html body h1,html body h2,html body h3,html body h4,html body h5,html body h6{color:#fff;page-break-after:avoid}html body blockquote{color:#a3a3a3}html body pre{page-break-inside:avoid}html body table{display:table}html body img{display:block;max-width:100%;max-height:100%}html body code,html body pre{word-wrap:break-word;white-space:pre}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
code[class*=language-],pre[class*=language-]{color:#c9d1d9;font-size:13px;text-shadow:none;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;direction:ltr;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-]::mozselection,code[class*=language-]::selection,pre[class*=language-]::mozselection,pre[class*=language-]::selection{text-shadow:none;background:#234879}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto;background:#161b22}:not(pre)>code[class*=language-]{padding:.1em .3em;border-radius:.3em;color:#c9d1d9;background:#343942}pre[data-line]{position:relative}pre[class*=language-]>code[class*=language-]{position:relative;z-index:1}.line-highlight{position:absolute;left:0;right:0;padding:inherit 0;margin-top:1em;background:#2f2a1e;box-shadow:inset 5px 0 0 #674c16;z-index:0;pointer-events:none;line-height:inherit;white-space:pre}.namespace{opacity:.7}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#8b949e}.token.punctuation{color:#c9d1d9}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#79c0ff}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#a5d6ff}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#a5d6ff;background:#161b22}.token.atrule,.token.attr-value,.token.keyword{color:#f97583}.token.function{color:#d2a8ff}.token.important,.token.regex,.token.variable{color:#79b8ff}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.markdown-preview{width:100%;height:100%;box-sizing:border-box}.markdown-preview .newpage,.markdown-preview .pagebreak{page-break-before:always}.markdown-preview pre.line-numbers{position:relative;padding-left:3.8em;counter-reset:linenumber}.markdown-preview pre.line-numbers>code{position:relative}.markdown-preview pre.line-numbers .line-numbers-rows{position:absolute;pointer-events:none;top:1em;font-size:100%;left:0;width:3em;letter-spacing:-1px;border-right:1px solid #999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.markdown-preview pre.line-numbers .line-numbers-rows>span{pointer-events:none;display:block;counter-increment:linenumber}.markdown-preview pre.line-numbers .line-numbers-rows>span:before{content:counter(linenumber);color:#999;display:block;padding-right:.8em;text-align:right}.markdown-preview .mathjax-exps .MathJax_Display{text-align:center!important}.markdown-preview:not([for=preview]) .code-chunk .btn-group{display:none}.markdown-preview:not([for=preview]) .code-chunk .status{display:none}.markdown-preview:not([for=preview]) .code-chunk .output-div{margin-bottom:16px}.markdown-preview .md-toc{padding:0}.markdown-preview .md-toc .md-toc-link-wrapper .md-toc-link{display:inline;padding:.25rem 0}.markdown-preview .md-toc .md-toc-link-wrapper .md-toc-link div,.markdown-preview .md-toc .md-toc-link-wrapper .md-toc-link p{display:inline}.markdown-preview .md-toc .md-toc-link-wrapper.highlighted .md-toc-link{font-weight:800}.scrollbar-style::-webkit-scrollbar{width:8px}.scrollbar-style::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}.scrollbar-style::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,.66);border:4px solid rgba(150,150,150,.66);background-clip:content-box}html body[for=html-export]:not([data-presentation-mode]){position:relative;width:100%;height:100%;top:0;left:0;margin:0;padding:0;overflow:auto}html body[for=html-export]:not([data-presentation-mode]) .markdown-preview{position:relative;top:0}@media screen and (min-width:914px){html body[for=html-export]:not([data-presentation-mode]) .markdown-preview{padding:2em calc(50% - 457px + 2em)}}@media screen and (max-width:914px){html body[for=html-export]:not([data-presentation-mode]) .markdown-preview{padding:2em}}@media screen and (max-width:450px){html body[for=html-export]:not([data-presentation-mode]) .markdown-preview{font-size:14px!important;padding:1em}}
|
|
1
|
+
.markdown-preview{width:100%;height:100%;box-sizing:border-box}.markdown-preview .newpage,.markdown-preview .pagebreak{page-break-before:always}.markdown-preview pre.line-numbers{position:relative;padding-left:3.8em;counter-reset:linenumber}.markdown-preview pre.line-numbers>code{position:relative}.markdown-preview pre.line-numbers .line-numbers-rows{position:absolute;pointer-events:none;top:1em;font-size:100%;left:0;width:3em;letter-spacing:-1px;border-right:1px solid #999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.markdown-preview pre.line-numbers .line-numbers-rows>span{pointer-events:none;display:block;counter-increment:linenumber}.markdown-preview pre.line-numbers .line-numbers-rows>span:before{content:counter(linenumber);color:#999;display:block;padding-right:.8em;text-align:right}.markdown-preview .mathjax-exps .MathJax_Display{text-align:center!important}.markdown-preview:not([data-for=preview]) .code-chunk .btn-group{display:none}.markdown-preview:not([data-for=preview]) .code-chunk .status{display:none}.markdown-preview:not([data-for=preview]) .code-chunk .output-div{margin-bottom:16px}.markdown-preview .md-toc{padding:0}.markdown-preview .md-toc .md-toc-link-wrapper .md-toc-link{display:inline;padding:.25rem 0}.markdown-preview .md-toc .md-toc-link-wrapper .md-toc-link div,.markdown-preview .md-toc .md-toc-link-wrapper .md-toc-link p{display:inline}.markdown-preview .md-toc .md-toc-link-wrapper.highlighted .md-toc-link{font-weight:800}.scrollbar-style::-webkit-scrollbar{width:8px}.scrollbar-style::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}.scrollbar-style::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,.66);border:4px solid rgba(150,150,150,.66);background-clip:content-box}html body[for=html-export]:not([data-presentation-mode]){position:relative;width:100%;height:100%;top:0;left:0;margin:0;padding:0;overflow:auto}html body[for=html-export]:not([data-presentation-mode]) .markdown-preview{position:relative;top:0}@media screen and (min-width:914px){html body[for=html-export]:not([data-presentation-mode]) .markdown-preview{padding:2em calc(50% - 457px + 2em)}}@media screen and (max-width:914px){html body[for=html-export]:not([data-presentation-mode]) .markdown-preview{padding:2em}}@media screen and (max-width:450px){html body[for=html-export]:not([data-presentation-mode]) .markdown-preview{font-size:14px!important;padding:1em}}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc{position:fixed;top:0;left:0;width:300px;height:100%;padding:32px 0 48px 0;font-size:14px;box-shadow:0 0 4px rgba(150,150,150,.33);box-sizing:border-box;overflow:auto;background-color:inherit}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar{width:8px}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar-track{border-radius:10px;background-color:transparent}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc::-webkit-scrollbar-thumb{border-radius:5px;background-color:rgba(150,150,150,.66);border:4px solid rgba(150,150,150,.66);background-clip:content-box}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc a{text-decoration:none}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc .md-toc{padding:0 16px}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc .md-toc .md-toc-link-wrapper .md-toc-link{display:inline;padding:.25rem 0}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc .md-toc .md-toc-link-wrapper .md-toc-link div,html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc .md-toc .md-toc-link-wrapper .md-toc-link p{display:inline}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc .md-toc .md-toc-link-wrapper.highlighted .md-toc-link{font-weight:800}html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{left:300px;width:calc(100% - 300px);padding:2em calc(50% - 457px - 300px/2);margin:0;box-sizing:border-box}@media screen and (max-width:1274px){html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{padding:2em}}@media screen and (max-width:450px){html body[for=html-export]:not([data-presentation-mode])[html-show-sidebar-toc] .markdown-preview{width:100%}}html body[for=html-export]:not([data-presentation-mode]):not([html-show-sidebar-toc]) .markdown-preview{left:50%;transform:translateX(-50%)}html body[for=html-export]:not([data-presentation-mode]):not([html-show-sidebar-toc]) .md-sidebar-toc{display:none}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JsonObject } from 'type-fest';
|
|
2
2
|
import * as vscode from 'vscode';
|
|
3
|
-
import { Notebook } from '../notebook';
|
|
3
|
+
import { Notebook, WebviewConfig } from '../notebook';
|
|
4
4
|
interface MarkdownEngineConstructorArgs {
|
|
5
5
|
notebook: Notebook;
|
|
6
6
|
filePath: string;
|
|
@@ -58,7 +58,7 @@ export declare class MarkdownEngine {
|
|
|
58
58
|
scripts?: string;
|
|
59
59
|
styles?: string;
|
|
60
60
|
head?: string;
|
|
61
|
-
config:
|
|
61
|
+
config: WebviewConfig;
|
|
62
62
|
vscodePreviewPanel: vscode.WebviewPanel | null | undefined;
|
|
63
63
|
contentSecurityPolicy?: string;
|
|
64
64
|
isVSCodeWebExtension?: boolean;
|
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
import MarkdownIt from 'markdown-it';
|
|
2
|
+
import { URI } from 'vscode-uri';
|
|
2
3
|
import { MarkdownEngine } from '../markdown-engine';
|
|
3
|
-
import { Note,
|
|
4
|
+
import { Note, Notes } from './note';
|
|
4
5
|
import { Reference, ReferenceMap } from './reference';
|
|
5
|
-
import { FileSystemApi, NotebookConfig } from './types';
|
|
6
|
+
import { Backlink, FileSystemApi, NotebookConfig } from './types';
|
|
6
7
|
export * from './types';
|
|
7
8
|
interface NotebookConstructorArgs {
|
|
8
9
|
notebookPath: string;
|
|
9
10
|
config: Partial<NotebookConfig>;
|
|
10
11
|
fs?: FileSystemApi;
|
|
11
12
|
}
|
|
12
|
-
interface
|
|
13
|
+
interface RefreshNotesIfNotLoaded {
|
|
13
14
|
dir: string;
|
|
14
15
|
includeSubdirectories?: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface RefreshNotesArgs extends RefreshNotesIfNotLoaded {
|
|
15
18
|
refreshRelations?: boolean;
|
|
16
19
|
}
|
|
17
20
|
export declare class Notebook {
|
|
18
|
-
notebookPath:
|
|
21
|
+
notebookPath: URI;
|
|
19
22
|
config: NotebookConfig;
|
|
20
23
|
fs: FileSystemApi;
|
|
21
24
|
notes: Notes;
|
|
@@ -34,15 +37,14 @@ export declare class Notebook {
|
|
|
34
37
|
updateConfig(config: Partial<NotebookConfig>): void;
|
|
35
38
|
private interpolateConfig;
|
|
36
39
|
getBacklinkedNotes(filePath: string): Promise<Notes>;
|
|
40
|
+
getNoteBacklinks(filePath: string): Promise<Backlink[]>;
|
|
37
41
|
getReferences(noteFilePath: string, backlinkedNoteFilePath: string): Promise<Reference[]>;
|
|
38
42
|
processNoteMentionsAndMentionedBy(filePath: string): Promise<void>;
|
|
39
43
|
getNote(filePath: string, refreshNoteRelations?: boolean): Promise<Note | null>;
|
|
40
|
-
refreshNotesIfNotLoaded({ dir, includeSubdirectories, }:
|
|
44
|
+
refreshNotesIfNotLoaded({ dir, includeSubdirectories, }: RefreshNotesIfNotLoaded): Promise<Notes>;
|
|
41
45
|
refreshNotes({ dir, includeSubdirectories, refreshRelations, }: RefreshNotesArgs): Promise<Notes>;
|
|
42
|
-
writeNote(filePath: string, markdown: string, noteConfig: NoteConfig): Promise<Note | null>;
|
|
43
46
|
removeNoteRelations(filePath: string): Promise<void>;
|
|
44
|
-
deleteNote(filePath: string): Promise<void>;
|
|
45
|
-
duplicateNote(filePath: string): Promise<Note | null | undefined>;
|
|
47
|
+
deleteNote(filePath: string, alreadyDeleted?: boolean): Promise<void>;
|
|
46
48
|
private resolveNoteAbsolutePath;
|
|
47
49
|
private resolveNoteRelativePath;
|
|
48
50
|
getNoteMarkdownEngine(filePath: string): MarkdownEngine;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { URI } from 'vscode-uri';
|
|
1
2
|
export type FilePath = string;
|
|
2
3
|
export interface NoteConfigEncryption {
|
|
3
4
|
title: string;
|
|
@@ -12,7 +13,7 @@ export interface NoteConfig {
|
|
|
12
13
|
}
|
|
13
14
|
export type Mentions = Set<FilePath>;
|
|
14
15
|
export interface Note {
|
|
15
|
-
notebookPath:
|
|
16
|
+
notebookPath: URI;
|
|
16
17
|
filePath: FilePath;
|
|
17
18
|
title: string;
|
|
18
19
|
markdown: string;
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
import { KatexOptions } from 'katex';
|
|
3
3
|
import { MermaidConfig } from 'mermaid';
|
|
4
4
|
import { JsonObject } from 'type-fest';
|
|
5
|
+
import { Note } from './note';
|
|
6
|
+
import { Reference } from './reference';
|
|
5
7
|
export declare const IS_NODE: boolean;
|
|
6
8
|
export type FileSystemStats = {
|
|
7
9
|
mtimeMs: number;
|
|
@@ -36,11 +38,12 @@ export interface ParserConfig {
|
|
|
36
38
|
};
|
|
37
39
|
}
|
|
38
40
|
export type PreviewTheme = 'atom-dark.css' | 'atom-light.css' | 'atom-material.css' | 'github-dark.css' | 'github-light.css' | 'gothic.css' | 'medium.css' | 'monokai.css' | 'newsprint.css' | 'night.css' | 'none.css' | 'one-dark.css' | 'one-light.css' | 'solarized-dark.css' | 'solarized-light.css' | 'vue.css';
|
|
39
|
-
export type CodeBlockTheme = 'auto.css' | 'default.css' | 'atom-dark.css' | 'atom-light.css' | 'atom-material.css' | 'coy.css' | 'darcula.css' | 'dark.css' | 'funky.css' | 'github.css' | 'hopscotch.css' | 'monokai.css' | 'okaidia.css' | 'one-dark.css' | 'one-light.css' | 'pen-paper-coffee.css' | 'pojoaque.css' | 'solarized-dark.css' | 'solarized-light.css' | 'twilight.css' | 'vue.css' | 'vs.css' | 'xonokai.css';
|
|
41
|
+
export type CodeBlockTheme = 'auto.css' | 'default.css' | 'atom-dark.css' | 'atom-light.css' | 'atom-material.css' | 'coy.css' | 'darcula.css' | 'dark.css' | 'funky.css' | 'github.css' | 'github-dark.css' | 'hopscotch.css' | 'monokai.css' | 'okaidia.css' | 'one-dark.css' | 'one-light.css' | 'pen-paper-coffee.css' | 'pojoaque.css' | 'solarized-dark.css' | 'solarized-light.css' | 'twilight.css' | 'vue.css' | 'vs.css' | 'xonokai.css';
|
|
40
42
|
export type RevealJsTheme = 'beige.css' | 'black.css' | 'blood.css' | 'league.css' | 'moon.css' | 'night.css' | 'serif.css' | 'simple.css' | 'sky.css' | 'solarized.css' | 'white.css' | 'none.css';
|
|
41
43
|
export type MermaidTheme = 'default' | 'forest' | 'dark' | 'neutral' | 'null';
|
|
42
44
|
export type FrontMatterRenderingOption = 'none' | 'table' | 'code';
|
|
43
45
|
export interface NotebookConfig {
|
|
46
|
+
markdownFileExtensions: string[];
|
|
44
47
|
globalCss: string;
|
|
45
48
|
mermaidConfig: MermaidConfig;
|
|
46
49
|
mathjaxConfig: JsonObject;
|
|
@@ -88,9 +91,24 @@ export interface NotebookConfig {
|
|
|
88
91
|
jsdelivrCdnHost: string;
|
|
89
92
|
krokiServer: string;
|
|
90
93
|
isVSCode: boolean;
|
|
94
|
+
alwaysShowBacklinksInPreview: boolean;
|
|
91
95
|
}
|
|
92
96
|
export declare function getDefaultMermaidConfig(): MermaidConfig;
|
|
93
97
|
export declare function getDefaultMathjaxConfig(): JsonObject;
|
|
94
98
|
export declare function getDefaultKatexConfig(): KatexOptions;
|
|
95
99
|
export declare function getDefaultParserConfig(): ParserConfig;
|
|
96
100
|
export declare function getDefaultNotebookConfig(): NotebookConfig;
|
|
101
|
+
export interface Backlink {
|
|
102
|
+
note: Partial<Note>;
|
|
103
|
+
references: Partial<Reference>[];
|
|
104
|
+
referenceHtmls: string[];
|
|
105
|
+
}
|
|
106
|
+
export interface WebviewConfig extends Partial<NotebookConfig> {
|
|
107
|
+
scrollSync?: boolean;
|
|
108
|
+
zoomLevel?: number;
|
|
109
|
+
sourceUri?: string;
|
|
110
|
+
initialLine?: number;
|
|
111
|
+
cursorLine?: number;
|
|
112
|
+
imageUploader?: ImageUploader;
|
|
113
|
+
}
|
|
114
|
+
export type ImageUploader = 'imgur' | 'sm.ms' | 'qiniu';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.css';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Backlink, WebviewConfig } from '../../notebook';
|
|
3
|
+
declare const PreviewContainer: import("unstated-next").Container<{
|
|
4
|
+
backlinks: Backlink[];
|
|
5
|
+
backlinksElement: import("react").RefObject<HTMLDivElement>;
|
|
6
|
+
bindAnchorElementsClickEvent: () => void;
|
|
7
|
+
clickSidebarTocButton: () => any;
|
|
8
|
+
config: WebviewConfig;
|
|
9
|
+
contextMenuId: string;
|
|
10
|
+
hiddenPreviewElement: import("react").RefObject<HTMLDivElement>;
|
|
11
|
+
isLoadingBacklinks: boolean;
|
|
12
|
+
isLoadingPreview: boolean;
|
|
13
|
+
isMobile: boolean;
|
|
14
|
+
isMouseOverPreview: boolean;
|
|
15
|
+
isPresentationMode: boolean;
|
|
16
|
+
isRefreshingPreview: boolean;
|
|
17
|
+
isVSCode: boolean;
|
|
18
|
+
isVSCodeWebExtension: boolean;
|
|
19
|
+
postMessage: (command: string, args?: unknown[]) => void;
|
|
20
|
+
previewElement: import("react").RefObject<HTMLDivElement>;
|
|
21
|
+
previewSyncSource: () => void;
|
|
22
|
+
refreshBacklinks: (forceRefreshingNotes?: boolean) => void;
|
|
23
|
+
setIsMouseOverPreview: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
24
|
+
setShowBacklinks: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
25
|
+
setShowImageHelper: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
26
|
+
showBacklinks: boolean;
|
|
27
|
+
showContextMenu: (params: Omit<import("react-contexify").ShowContextMenuParams<unknown>, "id"> & Partial<Pick<import("react-contexify").ShowContextMenuParams<unknown>, "id">>) => void;
|
|
28
|
+
showImageHelper: boolean;
|
|
29
|
+
showSidebarToc: boolean;
|
|
30
|
+
sidebarTocElement: import("react").RefObject<HTMLDivElement>;
|
|
31
|
+
sidebarTocHtml: string;
|
|
32
|
+
sourceScheme: import("react").MutableRefObject<string>;
|
|
33
|
+
sourceUri: import("react").MutableRefObject<string | undefined>;
|
|
34
|
+
theme: "dark" | "light";
|
|
35
|
+
zoomLevel: number;
|
|
36
|
+
}, void>;
|
|
37
|
+
export default PreviewContainer;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type WebviewMessageEvent = {
|
|
2
|
+
command: 'updateHtml';
|
|
3
|
+
totalLineCount: number;
|
|
4
|
+
sidebarTOCHTML: string;
|
|
5
|
+
sourceUri: string;
|
|
6
|
+
sourceScheme: string;
|
|
7
|
+
html: string;
|
|
8
|
+
id: string;
|
|
9
|
+
class: string;
|
|
10
|
+
};
|
|
11
|
+
export type WebviewMessageType = WebviewMessageEvent['command'];
|
|
12
|
+
export declare enum BacklinksOrderRecord {
|
|
13
|
+
CreatedAt = "createdAt",
|
|
14
|
+
ModifiedAt = "modifiedAt"
|
|
15
|
+
}
|
|
16
|
+
export declare enum BacklinksOrderDirection {
|
|
17
|
+
Asc = "asc",
|
|
18
|
+
Desc = "desc"
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.css';
|