crossnote 0.9.37 → 0.9.39
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 +13 -5
- package/out/cjs/index.cjs +283 -283
- package/out/cli/index.cjs +595 -25
- package/out/esm/index.mjs +287 -287
- package/out/server-app/server-app.css +1 -1
- package/out/server-app/server-app.js +116 -7
- package/out/types/src/markdown-engine/index.d.ts +32 -2
- package/out/types/src/serve/graph-host-shim.d.ts +6 -0
- package/out/types/src/serve/markdown-files.d.ts +1 -0
- package/out/types/src/server-app/components/LayoutView.d.ts +3 -0
- package/out/types/src/server-app/components/TabStrip.d.ts +3 -1
- package/out/types/src/server-app/components/TitleBar.d.ts +3 -1
- package/out/types/src/server-app/components/Welcome.d.ts +2 -1
- package/out/types/src/server-app/lib/api.d.ts +44 -0
- package/out/types/src/server-app/lib/preview-theme.d.ts +1 -0
- package/out/types/src/server-app/lib/wiki.d.ts +13 -1
- package/out/types/src/server-app/types.d.ts +4 -0
- package/out/types/src/wiki/index.d.ts +36 -0
- package/out/types/test/serve/config-writer.test.d.ts +1 -0
- package/out/types/test/serve/markdown-files.test.d.ts +1 -0
- package/out/types/test/server-app/preview-theme.test.d.ts +1 -0
- package/out/types/test/server-app/types.test.d.ts +1 -0
- package/out/types/tsconfig.tsbuildinfo +1 -1
- package/out/webview/backlinks.css +1 -1
- package/out/webview/backlinks.js +4 -4
- package/out/webview/graph-view.css +1 -1
- package/out/webview/graph-view.js +5 -5
- package/out/webview/preview.css +1 -1
- package/out/webview/preview.js +152 -152
- package/package.json +1 -1
|
@@ -48,8 +48,38 @@ export declare class MarkdownEngine {
|
|
|
48
48
|
private get protocolsWhiteListRegExp();
|
|
49
49
|
cacheCodeChunkResult(id: string, result: string): void;
|
|
50
50
|
private generateScriptsForPreview;
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
static AutoPrismThemeMap: {
|
|
52
|
+
'atom-dark.css': string;
|
|
53
|
+
'atom-light.css': string;
|
|
54
|
+
'atom-material.css': string;
|
|
55
|
+
'github-dark.css': string;
|
|
56
|
+
'github-light.css': string;
|
|
57
|
+
'gothic.css': string;
|
|
58
|
+
'medium.css': string;
|
|
59
|
+
'monokai.css': string;
|
|
60
|
+
'newsprint.css': string;
|
|
61
|
+
'night.css': string;
|
|
62
|
+
'one-dark.css': string;
|
|
63
|
+
'one-light.css': string;
|
|
64
|
+
'solarized-light.css': string;
|
|
65
|
+
'solarized-dark.css': string;
|
|
66
|
+
'vue.css': string;
|
|
67
|
+
'vscode.css': string;
|
|
68
|
+
};
|
|
69
|
+
static AutoPrismThemeMapForPresentation: {
|
|
70
|
+
'beige.css': string;
|
|
71
|
+
'black.css': string;
|
|
72
|
+
'blood.css': string;
|
|
73
|
+
'league.css': string;
|
|
74
|
+
'moon.css': string;
|
|
75
|
+
'night.css': string;
|
|
76
|
+
'serif.css': string;
|
|
77
|
+
'simple.css': string;
|
|
78
|
+
'sky.css': string;
|
|
79
|
+
'solarized.css': string;
|
|
80
|
+
'white.css': string;
|
|
81
|
+
'vscode.css': string;
|
|
82
|
+
};
|
|
53
83
|
private static resolveThemeForExport;
|
|
54
84
|
private static PreviewThemeColorCounterparts;
|
|
55
85
|
private static PrismThemeColorCounterparts;
|
|
@@ -2,6 +2,7 @@ export declare const MARKDOWN_EXTENSIONS: string[];
|
|
|
2
2
|
export declare function isMarkdownFile(filePath: string): boolean;
|
|
3
3
|
export declare function encodePathSegments(relativePath: string): string;
|
|
4
4
|
export declare function isPathWithinRoot(root: string, candidate: string): boolean;
|
|
5
|
+
export declare function isPathWithinRootOn(platform: NodeJS.Platform, root: string, candidate: string): boolean;
|
|
5
6
|
export interface MarkdownFileInfo {
|
|
6
7
|
relativePath: string;
|
|
7
8
|
absolutePath: string;
|
|
@@ -6,10 +6,13 @@ export interface LayoutActions {
|
|
|
6
6
|
rootDirectories: string[];
|
|
7
7
|
vscode: boolean;
|
|
8
8
|
recents: string[];
|
|
9
|
+
wikiNoteCount?: number;
|
|
9
10
|
dragActive: boolean;
|
|
10
11
|
onFocusPane: (paneId: string) => void;
|
|
11
12
|
onActivateTab: (paneId: string, tabId: string) => void;
|
|
12
13
|
onCloseTab: (paneId: string, tabId: string) => void;
|
|
14
|
+
canClosePane: (paneId: string) => boolean;
|
|
15
|
+
onClosePane: (paneId: string) => void;
|
|
13
16
|
onOpenPicker: (paneId: string) => void;
|
|
14
17
|
onOpenFile: (paneId: string, file: string) => void;
|
|
15
18
|
onSplitPane: (paneId: string, direction: 'horizontal' | 'vertical') => void;
|
|
@@ -3,12 +3,14 @@ import { Tab } from '../types';
|
|
|
3
3
|
export interface TabStripProps {
|
|
4
4
|
tabs: Tab[];
|
|
5
5
|
activeTabId: string | null;
|
|
6
|
+
canClose?: boolean;
|
|
6
7
|
onActivate: (tabId: string) => void;
|
|
7
8
|
onClose: (tabId: string) => void;
|
|
9
|
+
onClosePane: () => void;
|
|
8
10
|
onOpenPicker: () => void;
|
|
9
11
|
onSplit: (direction: 'horizontal' | 'vertical') => void;
|
|
10
12
|
onTabDragStart: (tabId: string) => void;
|
|
11
13
|
onTabDragEnd: () => void;
|
|
12
14
|
onTabDrop: (insertionIndex: number) => void;
|
|
13
15
|
}
|
|
14
|
-
export default function TabStrip({ tabs, activeTabId, onActivate, onClose, onOpenPicker, onSplit, onTabDragStart, onTabDragEnd, onTabDrop, }: TabStripProps): React.JSX.Element;
|
|
16
|
+
export default function TabStrip({ tabs, activeTabId, canClose, onActivate, onClose, onClosePane, onOpenPicker, onSplit, onTabDragStart, onTabDragEnd, onTabDrop, }: TabStripProps): React.JSX.Element;
|
|
@@ -2,6 +2,8 @@ import React from 'react';
|
|
|
2
2
|
export interface TitleBarProps {
|
|
3
3
|
rootDirectories: string[];
|
|
4
4
|
vscode: boolean;
|
|
5
|
+
shellTheme: 'light' | 'dark';
|
|
6
|
+
onToggleShellTheme: () => void;
|
|
5
7
|
onOpenPicker: () => void;
|
|
6
8
|
}
|
|
7
|
-
export default function TitleBar({ rootDirectories, vscode, onOpenPicker, }: TitleBarProps): React.JSX.Element;
|
|
9
|
+
export default function TitleBar({ rootDirectories, vscode, shellTheme, onToggleShellTheme, onOpenPicker, }: TitleBarProps): React.JSX.Element;
|
|
@@ -3,7 +3,8 @@ export interface WelcomeProps {
|
|
|
3
3
|
rootDirectories: string[];
|
|
4
4
|
vscode: boolean;
|
|
5
5
|
recents: string[];
|
|
6
|
+
wikiNoteCount?: number;
|
|
6
7
|
onOpenFile: (file: string) => void;
|
|
7
8
|
onOpenPicker: () => void;
|
|
8
9
|
}
|
|
9
|
-
export default function Welcome({ rootDirectories, vscode, recents, onOpenFile, onOpenPicker, }: WelcomeProps): React.JSX.Element;
|
|
10
|
+
export default function Welcome({ rootDirectories, vscode, recents, wikiNoteCount, onOpenFile, onOpenPicker, }: WelcomeProps): React.JSX.Element;
|
|
@@ -28,9 +28,48 @@ export interface WikiFileMeta {
|
|
|
28
28
|
html: string;
|
|
29
29
|
update: WikiNoteUpdate;
|
|
30
30
|
}
|
|
31
|
+
export interface WikiThemesPayload {
|
|
32
|
+
preview: Record<string, string>;
|
|
33
|
+
codeBlock: Record<string, string>;
|
|
34
|
+
reveal: Record<string, string>;
|
|
35
|
+
codeBlockAuto: Record<string, string>;
|
|
36
|
+
build: {
|
|
37
|
+
preview: string;
|
|
38
|
+
codeBlock: string;
|
|
39
|
+
reveal: string;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export interface WikiGraphData {
|
|
43
|
+
hash: string;
|
|
44
|
+
nodes: Array<{
|
|
45
|
+
id: string;
|
|
46
|
+
label: string;
|
|
47
|
+
}>;
|
|
48
|
+
links: Array<{
|
|
49
|
+
source: string;
|
|
50
|
+
target: string;
|
|
51
|
+
}>;
|
|
52
|
+
}
|
|
53
|
+
export interface WikiBacklink {
|
|
54
|
+
note: {
|
|
55
|
+
notebookPath: {
|
|
56
|
+
scheme: string;
|
|
57
|
+
path: string;
|
|
58
|
+
};
|
|
59
|
+
filePath: string;
|
|
60
|
+
title: string;
|
|
61
|
+
config?: Record<string, unknown>;
|
|
62
|
+
};
|
|
63
|
+
references: Array<Record<string, unknown>>;
|
|
64
|
+
referenceHtmls: string[];
|
|
65
|
+
}
|
|
31
66
|
export interface WikiData {
|
|
32
67
|
rootDirectories: string[];
|
|
33
68
|
assets: Record<string, string>;
|
|
69
|
+
themes: WikiThemesPayload;
|
|
70
|
+
zenEnabled?: boolean;
|
|
71
|
+
graph: Record<string, WikiGraphData>;
|
|
72
|
+
backlinks: Record<string, WikiBacklink[]>;
|
|
34
73
|
files: WikiFileMeta[];
|
|
35
74
|
}
|
|
36
75
|
declare global {
|
|
@@ -48,11 +87,16 @@ export declare function basename(filePath: string): string;
|
|
|
48
87
|
export declare function dirname(filePath: string): string;
|
|
49
88
|
export declare function resolveHref(rootDirectories: string[], sourceFile: string, href: string): string;
|
|
50
89
|
export declare function isMarkdownPath(filePath: string): boolean;
|
|
90
|
+
export declare function sameServeFile(a: string, b: string): boolean;
|
|
51
91
|
export declare function filePathToFilesUrl(rootDirectories: string[], absolutePath: string): string | null;
|
|
52
92
|
export interface WebviewCommandMessage {
|
|
53
93
|
command: string;
|
|
54
94
|
args?: unknown[];
|
|
55
95
|
}
|
|
96
|
+
export declare const GRAPH_VIEW_TAB_PREFIX = "__crossnote-graph-view__:";
|
|
97
|
+
export declare function graphTabFile(anchorFile: string): string;
|
|
98
|
+
export declare function isGraphTab(file: string): boolean;
|
|
99
|
+
export declare function graphAnchorFile(file: string): string;
|
|
56
100
|
export interface WebviewFinishLoadingArgs {
|
|
57
101
|
uri: string;
|
|
58
102
|
systemColorScheme: 'light' | 'dark';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function previewThemeMode(theme: string | undefined): 'light' | 'dark' | null;
|
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
import { WikiData, WikiFileMeta } from './api';
|
|
2
|
-
export
|
|
2
|
+
export interface WikiThemeSelection {
|
|
3
|
+
preview: string;
|
|
4
|
+
codeBlock: string;
|
|
5
|
+
reveal: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function assembleWikiDocument(data: WikiData, file: WikiFileMeta, themes?: WikiThemeSelection, zenEnabled?: boolean): string;
|
|
8
|
+
export declare function readWikiThemeSelection(data: WikiData, storage: Pick<Storage, 'getItem'>): WikiThemeSelection | null;
|
|
9
|
+
export declare function writeWikiThemeSelection(data: WikiData, storage: Pick<Storage, 'setItem'>, selection: WikiThemeSelection): void;
|
|
10
|
+
export declare function readWikiZenOverride(data: WikiData, storage: Pick<Storage, 'getItem'>): boolean | null;
|
|
11
|
+
export declare function writeWikiZenOverride(data: WikiData, storage: Pick<Storage, 'setItem'>, enabled: boolean): void;
|
|
3
12
|
export declare function wikiKeyOf(filePath: string): string;
|
|
4
13
|
export declare function createWikiIndex(data: WikiData): Map<string, WikiFileMeta>;
|
|
14
|
+
export declare function resolveWikiHref(data: WikiData, sourceKey: string, href: string): string;
|
|
5
15
|
export declare function wikiFileList(data: WikiData): Array<{
|
|
6
16
|
absolutePath: string;
|
|
7
17
|
relativePath: string;
|
|
8
18
|
mtimeMs: number;
|
|
9
19
|
rootPath: string;
|
|
10
20
|
}>;
|
|
21
|
+
export declare const WIKI_GRAPH_VIEW_ASSETS: readonly ["graph-view.js", "graph-view.css"];
|
|
22
|
+
export declare function assembleWikiGraphDocument(data: WikiData, anchorKey: string): string;
|
|
@@ -33,5 +33,9 @@ export declare function splitPane(node: LayoutNode, paneId: string, direction: '
|
|
|
33
33
|
layout: LayoutNode;
|
|
34
34
|
newPaneId: string;
|
|
35
35
|
};
|
|
36
|
+
export declare function removePane(node: LayoutNode, paneId: string): {
|
|
37
|
+
layout: LayoutNode;
|
|
38
|
+
removed: boolean;
|
|
39
|
+
};
|
|
36
40
|
export declare function moveTab(node: LayoutNode, sourcePaneId: string, tabId: string, targetPaneId: string, targetIndex: number | null): LayoutNode;
|
|
37
41
|
export declare function resizeSplit(node: LayoutNode, splitId: string, childIndex: number, ratio: number): LayoutNode;
|
|
@@ -38,3 +38,39 @@ export interface BuildWikiResult {
|
|
|
38
38
|
}>;
|
|
39
39
|
}
|
|
40
40
|
export declare function buildWiki(options: BuildWikiOptions): Promise<BuildWikiResult>;
|
|
41
|
+
export interface WikiGraphPayload {
|
|
42
|
+
hash: string;
|
|
43
|
+
nodes: Array<{
|
|
44
|
+
id: string;
|
|
45
|
+
label: string;
|
|
46
|
+
}>;
|
|
47
|
+
links: Array<{
|
|
48
|
+
source: string;
|
|
49
|
+
target: string;
|
|
50
|
+
}>;
|
|
51
|
+
}
|
|
52
|
+
export interface WikiBacklinkPayload {
|
|
53
|
+
note: {
|
|
54
|
+
notebookPath: {
|
|
55
|
+
scheme: string;
|
|
56
|
+
path: string;
|
|
57
|
+
};
|
|
58
|
+
filePath: string;
|
|
59
|
+
title: string;
|
|
60
|
+
config?: Record<string, unknown>;
|
|
61
|
+
};
|
|
62
|
+
references: Array<Record<string, unknown>>;
|
|
63
|
+
referenceHtmls: string[];
|
|
64
|
+
}
|
|
65
|
+
export interface WikiThemesPayload {
|
|
66
|
+
preview: Record<string, string>;
|
|
67
|
+
codeBlock: Record<string, string>;
|
|
68
|
+
reveal: Record<string, string>;
|
|
69
|
+
codeBlockAuto: Record<string, string>;
|
|
70
|
+
build: {
|
|
71
|
+
preview: string;
|
|
72
|
+
codeBlock: string;
|
|
73
|
+
reveal: string;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
export declare function embedRemoteImages(html: string, cache: Map<string, string | null>): Promise<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|