@zenuml/core 4.2.1 → 4.3.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/dist/cli/zenuml.mjs +594 -485
- package/dist/parser/index.cjs +2 -2
- package/dist/parser/index.mjs +1181 -1255
- package/dist/zenuml.esm.mjs +17916 -20381
- package/dist/zenuml.js +628 -756
- package/package.json +1 -13
- package/types/index.d.ts +24 -5
- package/types/svg.d.ts +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenuml/core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -35,18 +35,12 @@
|
|
|
35
35
|
"parity:dualrun": "bun scripts/parity/dualrun-diff.mjs",
|
|
36
36
|
"pw": "playwright test --reporter=list",
|
|
37
37
|
"pw:ci": "playwright test",
|
|
38
|
-
"measure:layout": "COLLECT_LAYOUT_METRICS=1 playwright test tests/layout-metrics.spec.ts --reporter=line --project=chromium",
|
|
39
|
-
"snapshots:dual": "node scripts/snapshot-dual.js",
|
|
40
38
|
"pw:update": "playwright test --update-snapshots --reporter=list",
|
|
41
39
|
"pw:update-ci": "playwright test --update-snapshots --reporter=github",
|
|
42
40
|
"pw:ui": "playwright test --ui",
|
|
43
41
|
"pw:smoke": "playwright test smoke",
|
|
44
42
|
"analyze:compare-case": "node scripts/analyze-compare-case.mjs",
|
|
45
43
|
"pw:install": "playwright install-deps && playwright install chromium",
|
|
46
|
-
"antlr:setup": "python3 -m pip install antlr4-tools",
|
|
47
|
-
"antlr:generate": "pwd && cd ./src/g4-units/hello-world && antlr4 Hello.g4",
|
|
48
|
-
"antlr:javac": "pwd && cd ./src/g4-units/hello-world && CLASSPATH=\"../../../antlr/antlr-4.11.1-complete.jar:$CLASSPATH\" javac *.java",
|
|
49
|
-
"antlr:grun": "pwd && cd ./src/g4-units/hello-world && grun Hello r -tokens",
|
|
50
44
|
"antlr": "bun run antlr:lexer && bun run antlr:parser",
|
|
51
45
|
"antlr:clear": "rm -rf src/generated-parser/*",
|
|
52
46
|
"langium:generate": "langium generate",
|
|
@@ -54,11 +48,6 @@
|
|
|
54
48
|
"antlr:parser": "java -Duser.dir=$(pwd)/src/g4 -cp $(pwd)/antlr/antlr-4.11.1-complete.jar org.antlr.v4.Tool -o ./src/generated-parser -Dlanguage=JavaScript sequenceParser.g4",
|
|
55
49
|
"eslint": "eslint --fix --ext .js,.ts,.tsx,.jsx src",
|
|
56
50
|
"prettier": "bun run --bun prettier --write --ignore-unknown \"src/**/*.{js,ts,json,htm,html}\"",
|
|
57
|
-
"git:branch:clean:gone": "git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -d",
|
|
58
|
-
"git:branch:clean:merged": "git branch --merged|egrep -v \"(\\*|master|main|dev|skip_branch_name)\" | xargs git branch -d",
|
|
59
|
-
"git:branch:safe-delete": "echo '> git log --graph --left-right --cherry --oneline another-branch...main'",
|
|
60
|
-
"git:forget": "git rm -r --cached . && git add . && git commit -m \"Forget all ignored files\"",
|
|
61
|
-
"test:specs": "echo \"Error: test:specs is not supported\"",
|
|
62
51
|
"storybook": "storybook dev -p 6006",
|
|
63
52
|
"build-storybook": "bun run --bun storybook build",
|
|
64
53
|
"worker:dev": "bun run build:site && bun run --bun wrangler dev",
|
|
@@ -109,7 +98,6 @@
|
|
|
109
98
|
"@headlessui/react": "^2.2.9",
|
|
110
99
|
"@headlessui/tailwindcss": "^0.2.2",
|
|
111
100
|
"antlr4": "~4.11.0",
|
|
112
|
-
"class-variance-authority": "^0.7.1",
|
|
113
101
|
"clsx": "^2.1.1",
|
|
114
102
|
"color-string": "^2.1.4",
|
|
115
103
|
"dompurify": "^3.3.1",
|
package/types/index.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
export type SvgTheme =
|
|
2
|
+
| "theme-default"
|
|
3
|
+
| "theme-mermaid"
|
|
4
|
+
| "theme-clean-light"
|
|
5
|
+
| "theme-clean-dark"
|
|
6
|
+
| "theme-neon";
|
|
7
|
+
|
|
1
8
|
export interface RenderOptions {
|
|
2
|
-
|
|
9
|
+
/** Theme name. Unknown names fall back to 'theme-default'. */
|
|
10
|
+
theme?: SvgTheme;
|
|
3
11
|
}
|
|
4
12
|
|
|
5
13
|
export interface RenderResult {
|
|
@@ -11,7 +19,10 @@ export interface RenderResult {
|
|
|
11
19
|
viewBox: string;
|
|
12
20
|
}
|
|
13
21
|
|
|
14
|
-
export declare function renderToSvg(
|
|
22
|
+
export declare function renderToSvg(
|
|
23
|
+
code: string,
|
|
24
|
+
options?: RenderOptions,
|
|
25
|
+
): RenderResult;
|
|
15
26
|
|
|
16
27
|
export interface ParseResult {
|
|
17
28
|
pass: boolean;
|
|
@@ -24,11 +35,13 @@ export interface ErrorDetail {
|
|
|
24
35
|
msg: string;
|
|
25
36
|
}
|
|
26
37
|
|
|
27
|
-
interface Config {
|
|
38
|
+
export interface Config {
|
|
28
39
|
theme?: string;
|
|
29
40
|
enableScopedTheming?: boolean;
|
|
30
41
|
onThemeChange?: (data: { theme: string; scoped?: boolean }) => void;
|
|
31
42
|
enableMultiTheme?: boolean;
|
|
43
|
+
/** Show hierarchical message numbering. Omission preserves stored state (initially true). */
|
|
44
|
+
enableNumbering?: boolean;
|
|
32
45
|
stickyOffset?: number | false;
|
|
33
46
|
onContentChange?: (code: string) => void;
|
|
34
47
|
mode?: string;
|
|
@@ -38,7 +51,10 @@ interface IZenUml {
|
|
|
38
51
|
get code(): string | undefined;
|
|
39
52
|
get theme(): string | undefined;
|
|
40
53
|
parse(text: string): Promise<ParseResult>;
|
|
41
|
-
render(
|
|
54
|
+
render(
|
|
55
|
+
code: string | undefined,
|
|
56
|
+
config: Config | undefined,
|
|
57
|
+
): Promise<IZenUml>;
|
|
42
58
|
}
|
|
43
59
|
|
|
44
60
|
declare class ZenUml implements IZenUml {
|
|
@@ -48,7 +64,10 @@ declare class ZenUml implements IZenUml {
|
|
|
48
64
|
get code(): string | undefined;
|
|
49
65
|
get theme(): string | undefined;
|
|
50
66
|
parse(text: string): Promise<ParseResult>;
|
|
51
|
-
render(
|
|
67
|
+
render(
|
|
68
|
+
code: string | undefined,
|
|
69
|
+
config: Config | undefined,
|
|
70
|
+
): Promise<IZenUml>;
|
|
52
71
|
getPng(): Promise<string>;
|
|
53
72
|
getSvg(): Promise<string>;
|
|
54
73
|
}
|
package/types/svg.d.ts
DELETED