@arborium/arborium 0.700.0 → 0.900.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/dist/arborium.iife.js +0 -3
- package/dist/arborium.iife.js.map +0 -1
- package/dist/arborium.js +0 -395
- package/dist/arborium.js.map +0 -1
- package/dist/arborium_host.js +0 -482
- package/dist/arborium_host_bg.wasm +0 -0
- package/dist/detect.d.ts +0 -17
- package/dist/iife.d.ts +0 -11
- package/dist/index.d.ts +0 -8
- package/dist/loader.d.ts +0 -24
- package/dist/themes/github-light.css +0 -123
- package/dist/themes/tokyo-night.css +0 -122
- package/dist/types.d.ts +0 -55
- package/dist/wasi-shims.d.ts +0 -130
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tokyo Night theme for Arborium
|
|
3
|
-
* Based on https://github.com/tokyo-night/tokyo-night-vscode-theme
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/* Code block styling */
|
|
7
|
-
pre:has(code[data-highlighted]) {
|
|
8
|
-
background-color: #1a1b26;
|
|
9
|
-
color: #a9b1d6;
|
|
10
|
-
padding: 1em;
|
|
11
|
-
border-radius: 6px;
|
|
12
|
-
overflow-x: auto;
|
|
13
|
-
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
|
|
14
|
-
font-size: 0.9em;
|
|
15
|
-
line-height: 1.5;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
code[data-highlighted] {
|
|
19
|
-
background: transparent;
|
|
20
|
-
font-family: inherit;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/* Keywords: if, else, for, while, fn, let, const, etc. */
|
|
24
|
-
a-k {
|
|
25
|
-
color: #bb9af7;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/* Strings */
|
|
29
|
-
a-s {
|
|
30
|
-
color: #9ece6a;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/* Comments */
|
|
34
|
-
a-c {
|
|
35
|
-
color: #565f89;
|
|
36
|
-
font-style: italic;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/* Functions */
|
|
40
|
-
a-f {
|
|
41
|
-
color: #7aa2f7;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/* Types */
|
|
45
|
-
a-t {
|
|
46
|
-
color: #2ac3de;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/* Variables */
|
|
50
|
-
a-v {
|
|
51
|
-
color: #c0caf5;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/* Built-in variables (self, this, etc.) */
|
|
55
|
-
a-vb {
|
|
56
|
-
color: #f7768e;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/* Numbers */
|
|
60
|
-
a-n {
|
|
61
|
-
color: #ff9e64;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/* Operators */
|
|
65
|
-
a-o {
|
|
66
|
-
color: #89ddff;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/* Punctuation (brackets, delimiters) */
|
|
70
|
-
a-p {
|
|
71
|
-
color: #a9b1d6;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/* Constants */
|
|
75
|
-
a-ct {
|
|
76
|
-
color: #ff9e64;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/* Built-in constants (true, false, null, etc.) */
|
|
80
|
-
a-cb {
|
|
81
|
-
color: #ff9e64;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/* Properties */
|
|
85
|
-
a-pr {
|
|
86
|
-
color: #73daca;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/* Attributes (HTML/XML attributes, decorators) */
|
|
90
|
-
a-at {
|
|
91
|
-
color: #bb9af7;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/* Tags (HTML/XML tags) */
|
|
95
|
-
a-tg {
|
|
96
|
-
color: #f7768e;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/* Namespaces */
|
|
100
|
-
a-ns {
|
|
101
|
-
color: #7dcfff;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/* Labels */
|
|
105
|
-
a-lb {
|
|
106
|
-
color: #e0af68;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/* Escape sequences */
|
|
110
|
-
a-e {
|
|
111
|
-
color: #89ddff;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/* Embedded code */
|
|
115
|
-
a-em {
|
|
116
|
-
color: #c0caf5;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/* Unknown/fallback */
|
|
120
|
-
a-x {
|
|
121
|
-
color: #c0caf5;
|
|
122
|
-
}
|
package/dist/types.d.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/** A span of highlighted text */
|
|
2
|
-
export interface Span {
|
|
3
|
-
start: number;
|
|
4
|
-
end: number;
|
|
5
|
-
/** The capture name (e.g., "keyword", "string", "comment") */
|
|
6
|
-
capture: string;
|
|
7
|
-
}
|
|
8
|
-
/** A language injection (e.g., JS inside HTML) */
|
|
9
|
-
export interface Injection {
|
|
10
|
-
start: number;
|
|
11
|
-
end: number;
|
|
12
|
-
language: string;
|
|
13
|
-
includeChildren: boolean;
|
|
14
|
-
}
|
|
15
|
-
/** Result of parsing source code */
|
|
16
|
-
export interface ParseResult {
|
|
17
|
-
spans: Span[];
|
|
18
|
-
injections: Injection[];
|
|
19
|
-
}
|
|
20
|
-
/** A loaded grammar plugin */
|
|
21
|
-
export interface Grammar {
|
|
22
|
-
/** The language identifier */
|
|
23
|
-
languageId(): string;
|
|
24
|
-
/** Languages this grammar may inject */
|
|
25
|
-
injectionLanguages(): string[];
|
|
26
|
-
/** Highlight source code, returning HTML string */
|
|
27
|
-
highlight(source: string): string | Promise<string>;
|
|
28
|
-
/** Parse source code, returning raw spans */
|
|
29
|
-
parse(source: string): ParseResult;
|
|
30
|
-
/** Dispose of resources */
|
|
31
|
-
dispose(): void;
|
|
32
|
-
}
|
|
33
|
-
/** Configuration for the arborium runtime */
|
|
34
|
-
export interface ArboriumConfig {
|
|
35
|
-
/** Disable auto-highlighting on page load */
|
|
36
|
-
manual?: boolean;
|
|
37
|
-
/** Theme to use: "tokyo-night" | "github-light" | custom */
|
|
38
|
-
theme?: string;
|
|
39
|
-
/** CSS selector for code blocks */
|
|
40
|
-
selector?: string;
|
|
41
|
-
/** CDN to use: "jsdelivr" | "unpkg" | custom base URL */
|
|
42
|
-
cdn?: string;
|
|
43
|
-
/** Package version to load (default: "latest") */
|
|
44
|
-
version?: string;
|
|
45
|
-
/** URL to plugins.json manifest (for local testing) */
|
|
46
|
-
pluginsUrl?: string;
|
|
47
|
-
/** Base URL for the Rust host module (for local testing) */
|
|
48
|
-
hostUrl?: string;
|
|
49
|
-
}
|
|
50
|
-
/** Global config set before script loads */
|
|
51
|
-
declare global {
|
|
52
|
-
interface Window {
|
|
53
|
-
Arborium?: ArboriumConfig;
|
|
54
|
-
}
|
|
55
|
-
}
|
package/dist/wasi-shims.d.ts
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Minimal WASI shims for browser environment.
|
|
3
|
-
* These provide stub implementations for WASI interfaces that
|
|
4
|
-
* the grammar plugins require but don't actually use.
|
|
5
|
-
*/
|
|
6
|
-
declare class WasiError extends Error {
|
|
7
|
-
constructor(message: string);
|
|
8
|
-
}
|
|
9
|
-
declare class OutputStream {
|
|
10
|
-
write(_contents: Uint8Array): bigint;
|
|
11
|
-
blockingWriteAndFlush(_contents: Uint8Array): void;
|
|
12
|
-
blockingFlush(): void;
|
|
13
|
-
checkWrite(): bigint;
|
|
14
|
-
subscribe(): void;
|
|
15
|
-
}
|
|
16
|
-
declare class InputStream {
|
|
17
|
-
read(_len: bigint): Uint8Array;
|
|
18
|
-
blockingRead(_len: bigint): Uint8Array;
|
|
19
|
-
subscribe(): void;
|
|
20
|
-
}
|
|
21
|
-
export declare function createWasiImports(): {
|
|
22
|
-
'wasi:cli/environment': {
|
|
23
|
-
getEnvironment: () => Array<[string, string]>;
|
|
24
|
-
getArguments: () => string[];
|
|
25
|
-
};
|
|
26
|
-
'wasi:cli/exit': {
|
|
27
|
-
exit: (status: {
|
|
28
|
-
tag: string;
|
|
29
|
-
val?: number;
|
|
30
|
-
}) => void;
|
|
31
|
-
};
|
|
32
|
-
'wasi:cli/stdin': {
|
|
33
|
-
getStdin: () => InputStream;
|
|
34
|
-
};
|
|
35
|
-
'wasi:cli/stdout': {
|
|
36
|
-
getStdout: () => OutputStream;
|
|
37
|
-
};
|
|
38
|
-
'wasi:cli/stderr': {
|
|
39
|
-
getStderr: () => OutputStream;
|
|
40
|
-
};
|
|
41
|
-
'wasi:clocks/wall-clock': {
|
|
42
|
-
now: () => {
|
|
43
|
-
seconds: bigint;
|
|
44
|
-
nanoseconds: number;
|
|
45
|
-
};
|
|
46
|
-
resolution: () => {
|
|
47
|
-
seconds: bigint;
|
|
48
|
-
nanoseconds: number;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
'wasi:filesystem/types': {
|
|
52
|
-
Descriptor: {
|
|
53
|
-
new (): {};
|
|
54
|
-
};
|
|
55
|
-
DirectoryEntryStream: {
|
|
56
|
-
new (): {};
|
|
57
|
-
};
|
|
58
|
-
filesystemErrorCode: () => null;
|
|
59
|
-
};
|
|
60
|
-
'wasi:filesystem/preopens': {
|
|
61
|
-
getDirectories: () => Array<[unknown, string]>;
|
|
62
|
-
};
|
|
63
|
-
'wasi:io/error': {
|
|
64
|
-
Error: typeof WasiError;
|
|
65
|
-
};
|
|
66
|
-
'wasi:io/streams': {
|
|
67
|
-
InputStream: typeof InputStream;
|
|
68
|
-
OutputStream: typeof OutputStream;
|
|
69
|
-
};
|
|
70
|
-
'wasi:random/random': {
|
|
71
|
-
getRandomBytes: (len: bigint) => Uint8Array;
|
|
72
|
-
getRandomU64: () => bigint;
|
|
73
|
-
};
|
|
74
|
-
'wasi:cli/environment@0.2.3': {
|
|
75
|
-
getEnvironment: () => Array<[string, string]>;
|
|
76
|
-
getArguments: () => string[];
|
|
77
|
-
};
|
|
78
|
-
'wasi:cli/exit@0.2.3': {
|
|
79
|
-
exit: (status: {
|
|
80
|
-
tag: string;
|
|
81
|
-
val?: number;
|
|
82
|
-
}) => void;
|
|
83
|
-
};
|
|
84
|
-
'wasi:cli/stdin@0.2.3': {
|
|
85
|
-
getStdin: () => InputStream;
|
|
86
|
-
};
|
|
87
|
-
'wasi:cli/stdout@0.2.3': {
|
|
88
|
-
getStdout: () => OutputStream;
|
|
89
|
-
};
|
|
90
|
-
'wasi:cli/stderr@0.2.3': {
|
|
91
|
-
getStderr: () => OutputStream;
|
|
92
|
-
};
|
|
93
|
-
'wasi:clocks/wall-clock@0.2.3': {
|
|
94
|
-
now: () => {
|
|
95
|
-
seconds: bigint;
|
|
96
|
-
nanoseconds: number;
|
|
97
|
-
};
|
|
98
|
-
resolution: () => {
|
|
99
|
-
seconds: bigint;
|
|
100
|
-
nanoseconds: number;
|
|
101
|
-
};
|
|
102
|
-
};
|
|
103
|
-
'wasi:filesystem/types@0.2.3': {
|
|
104
|
-
Descriptor: {
|
|
105
|
-
new (): {};
|
|
106
|
-
};
|
|
107
|
-
DirectoryEntryStream: {
|
|
108
|
-
new (): {};
|
|
109
|
-
};
|
|
110
|
-
filesystemErrorCode: () => null;
|
|
111
|
-
};
|
|
112
|
-
'wasi:filesystem/preopens@0.2.3': {
|
|
113
|
-
getDirectories: () => Array<[unknown, string]>;
|
|
114
|
-
};
|
|
115
|
-
'wasi:io/error@0.2.3': {
|
|
116
|
-
Error: typeof WasiError;
|
|
117
|
-
};
|
|
118
|
-
'wasi:io/streams@0.2.3': {
|
|
119
|
-
InputStream: typeof InputStream;
|
|
120
|
-
OutputStream: typeof OutputStream;
|
|
121
|
-
};
|
|
122
|
-
'wasi:random/random@0.2.3': {
|
|
123
|
-
getRandomBytes: (len: bigint) => Uint8Array;
|
|
124
|
-
getRandomU64: () => bigint;
|
|
125
|
-
};
|
|
126
|
-
};
|
|
127
|
-
export declare const grammarTypesImport: {
|
|
128
|
-
'arborium:grammar/types@0.1.0': {};
|
|
129
|
-
};
|
|
130
|
-
export {};
|