@vmz/plugin-katex 0.3.9 → 0.3.10
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/dist/vmz.plugin.d.ts +7 -2
- package/dist/vmz.plugin.js +52 -46
- package/package.json +2 -2
package/dist/vmz.plugin.d.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
/** Plugin-level defaults; the materialized `<Katex>` component keeps its props. */
|
|
2
|
+
export type KatexPluginOptions = Record<string, never>;
|
|
3
|
+
/**
|
|
4
|
+
* KaTeX plugin factory. `katex()` registers `<Katex>` and `engines.math`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function katex(_options?: KatexPluginOptions): import("@vmz/plugin").VmzPlugin;
|
|
7
|
+
export default katex;
|
package/dist/vmz.plugin.js
CHANGED
|
@@ -1,48 +1,54 @@
|
|
|
1
1
|
import { definePlugin, loadPluginSource } from '@vmz/plugin';
|
|
2
2
|
const source = loadPluginSource(import.meta.url, '../components/Katex.vmz');
|
|
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
|
-
}
|
|
3
|
+
/**
|
|
4
|
+
* KaTeX plugin factory. `katex()` registers `<Katex>` and `engines.math`.
|
|
5
|
+
*/
|
|
6
|
+
export function katex(_options = {}) {
|
|
7
|
+
return definePlugin({
|
|
8
|
+
name: '@vmz/plugin-katex',
|
|
9
|
+
version: '0.1.0',
|
|
10
|
+
protocol: '0.1.0',
|
|
11
|
+
stages: ['workspace_resolve', 'analyzer'],
|
|
12
|
+
deterministic: true,
|
|
13
|
+
async contribute(ctx) {
|
|
14
|
+
if (ctx.stage === 'workspace_resolve') {
|
|
15
|
+
return {
|
|
16
|
+
stage: 'workspace_resolve',
|
|
17
|
+
cacheKey: `@vmz/plugin-katex:Katex.vmz:${source.contentHash.slice(0, 12)}`,
|
|
18
|
+
items: [
|
|
19
|
+
{
|
|
20
|
+
id: 'component-katex',
|
|
21
|
+
kind: 'source',
|
|
22
|
+
path: 'src/components/Katex.vmz',
|
|
23
|
+
content: source.content,
|
|
24
|
+
contentHash: source.contentHash,
|
|
25
|
+
materialize: true,
|
|
26
|
+
engine: 'katex',
|
|
27
|
+
engineKind: 'math',
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
if (ctx.stage === 'analyzer') {
|
|
33
|
+
return {
|
|
34
|
+
stage: 'analyzer',
|
|
35
|
+
cacheKey: '@vmz/plugin-katex:analyzer',
|
|
36
|
+
items: [
|
|
37
|
+
{
|
|
38
|
+
id: 'engine-katex',
|
|
39
|
+
kind: 'analyzer',
|
|
40
|
+
path: 'src/components/Katex.vmz',
|
|
41
|
+
severity: 'advice',
|
|
42
|
+
message: 'math engine katex online',
|
|
43
|
+
code: 'vmz.engine.katex',
|
|
44
|
+
engine: 'katex',
|
|
45
|
+
engineKind: 'math',
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return { stage: ctx.stage, items: [] };
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
export default katex;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
|
-
"@vmz/plugin": "0.3.
|
|
3
|
+
"@vmz/plugin": "0.3.10",
|
|
4
4
|
"katex": "0.18.4"
|
|
5
5
|
},
|
|
6
6
|
"description": "VMZ KaTeX adapter - <Katex> + math engine registration",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
},
|
|
57
57
|
"type": "module",
|
|
58
58
|
"types": "./dist/vmz.plugin.d.ts",
|
|
59
|
-
"version": "0.3.
|
|
59
|
+
"version": "0.3.10"
|
|
60
60
|
}
|