@mlightcad/cad-simple-viewer-cli 1.7.3 → 1.7.5

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.
Files changed (31) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +159 -159
  3. package/dist/runHeadless.js +237 -134
  4. package/dist/runHeadless.js.map +1 -1
  5. package/dist-runner/assets/cad-html-plugin-DQwlPjG4.js +1564 -0
  6. package/dist-runner/assets/cad-pdf-plugin-Ch3nwhN6.js +212 -0
  7. package/dist-runner/assets/cad-svg-plugin-C84nxL1t.js +16 -0
  8. package/dist-runner/assets/index-DXwRjL3l.js +7339 -0
  9. package/dist-runner/index.html +12 -12
  10. package/dist-runner/viewer-runtime.iife.js +213 -213
  11. package/dist-runner/workers/libredwg-parser-worker.js +1 -1
  12. package/dist-runner/workers/mtext-renderer-worker.js +2191 -2124
  13. package/examples/batch-export-html-multi-preview.mjs +306 -236
  14. package/examples/batch-export-html.mjs +105 -105
  15. package/examples/batch-export-png.mjs +103 -103
  16. package/examples/create-drawing-dxf.scr +15 -15
  17. package/examples/create-drawing-png.scr +19 -19
  18. package/examples/create-shapes-dxf.scr +17 -17
  19. package/examples/export-dxf.scr +5 -5
  20. package/examples/export-html-multi-preview.scr +18 -18
  21. package/examples/export-html-multi.scr +13 -13
  22. package/examples/export-html.scr +12 -12
  23. package/examples/export-pdf.scr +9 -9
  24. package/examples/export-png.scr +9 -9
  25. package/examples/freeze-layer-png.scr +15 -15
  26. package/examples/index.json +114 -114
  27. package/package.json +9 -9
  28. package/dist-runner/assets/cad-html-plugin-DeHxlaul.js +0 -1547
  29. package/dist-runner/assets/cad-pdf-plugin-2fqpe-xS.js +0 -212
  30. package/dist-runner/assets/cad-svg-plugin-BWNwucA7.js +0 -16
  31. package/dist-runner/assets/index-B3SgHAxA.js +0 -7313
@@ -1,15 +1,15 @@
1
- ; Turn off a layer via -LAYER, then export PNG.
2
- ; Requires --mode write (layer edits need Write open mode).
3
- ; Replace LAYER_NAME below with a real layer in your drawing.
4
- ; Usage:
5
- ; cad-simple-viewer-cli -i drawing.dwg -s examples/freeze-layer-png.scr -o ./out --mode write
6
- -layer
7
- Off
8
- LAYER_NAME
9
-
10
- zoom
11
- e
12
- pngout
13
-
14
- 2048
15
- quit
1
+ ; Turn off a layer via -LAYER, then export PNG.
2
+ ; Requires --mode write (layer edits need Write open mode).
3
+ ; Replace LAYER_NAME below with a real layer in your drawing.
4
+ ; Usage:
5
+ ; cad-simple-viewer-cli -i drawing.dwg -s examples/freeze-layer-png.scr -o ./out --mode write
6
+ -layer
7
+ Off
8
+ LAYER_NAME
9
+
10
+ zoom
11
+ e
12
+ pngout
13
+
14
+ 2048
15
+ quit
@@ -1,114 +1,114 @@
1
- {
2
- "fixtureDrawing": "https://cdn.jsdelivr.net/gh/mlightcad/cad-data@main/data/canteen.dwg",
3
- "defaultOutputDir": "tmp/examples-gallery",
4
- "examples": [
5
- {
6
- "id": "create-drawing-dxf",
7
- "title": "Create drawing -> DXF",
8
- "description": "qnew, draw a closed rectangle with LINE, export DXF. No input file.",
9
- "script": "create-drawing-dxf.scr",
10
- "mode": "write",
11
- "inputKind": "none",
12
- "runnable": true
13
- },
14
- {
15
- "id": "create-shapes-dxf",
16
- "title": "Create shapes -> DXF",
17
- "description": "qnew, draw a rectangle and a circle, export DXF.",
18
- "script": "create-shapes-dxf.scr",
19
- "mode": "write",
20
- "inputKind": "none",
21
- "runnable": true
22
- },
23
- {
24
- "id": "create-drawing-png",
25
- "title": "Create drawing -> PNG",
26
- "description": "qnew, draw geometry, zoom extents, export PNG.",
27
- "script": "create-drawing-png.scr",
28
- "mode": "write",
29
- "inputKind": "none",
30
- "runnable": true
31
- },
32
- {
33
- "id": "export-png",
34
- "title": "Export PNG",
35
- "description": "Zoom extents and export the drawing as PNG (long side 2048).",
36
- "script": "export-png.scr",
37
- "mode": "read",
38
- "inputKind": "file",
39
- "runnable": true
40
- },
41
- {
42
- "id": "export-html",
43
- "title": "Export HTML",
44
- "description": "Export a self-contained offline HTML viewer (-chtml).",
45
- "script": "export-html.scr",
46
- "mode": "read",
47
- "inputKind": "file",
48
- "runnable": true
49
- },
50
- {
51
- "id": "export-html-multi",
52
- "title": "Export HTML (multi-file)",
53
- "description": "Export a multi-file ACEX package zip for progressive loading (-chtml Multi).",
54
- "script": "export-html-multi.scr",
55
- "mode": "read",
56
- "inputKind": "file",
57
- "runnable": true
58
- },
59
- {
60
- "id": "export-html-multi-preview",
61
- "title": "Export HTML multi + preview",
62
- "description": "Zoom extents, export multi-file ACEX zip (-chtml Multi), then JPEG preview.",
63
- "script": "export-html-multi-preview.scr",
64
- "mode": "read",
65
- "inputKind": "file",
66
- "runnable": true
67
- },
68
- {
69
- "id": "export-dxf",
70
- "title": "Export DXF",
71
- "description": "Convert the open drawing to DXF (cdxf).",
72
- "script": "export-dxf.scr",
73
- "mode": "read",
74
- "inputKind": "file",
75
- "runnable": true
76
- },
77
- {
78
- "id": "freeze-layer-png",
79
- "title": "Layer off -> PNG",
80
- "description": "Turn off a layer with -LAYER, then export PNG. Edit LAYER_NAME in the script first.",
81
- "script": "freeze-layer-png.scr",
82
- "mode": "write",
83
- "inputKind": "file",
84
- "runnable": true
85
- },
86
- {
87
- "id": "batch-export-png",
88
- "title": "Batch export PNG",
89
- "description": "Scan a folder of DWG/DXF files and export each to PNG.",
90
- "script": "batch-export-png.mjs",
91
- "kind": "batch",
92
- "inputKind": "directory",
93
- "runnable": true
94
- },
95
- {
96
- "id": "batch-export-html",
97
- "title": "Batch export HTML",
98
- "description": "Scan a folder and export each drawing to HTML.",
99
- "script": "batch-export-html.mjs",
100
- "kind": "batch",
101
- "inputKind": "directory",
102
- "runnable": true
103
- },
104
- {
105
- "id": "batch-export-html-multi-preview",
106
- "title": "Batch export HTML multi + preview",
107
- "description": "Scan a folder, export multi ACEX zip + extents preview, package like demo-drawings.",
108
- "script": "batch-export-html-multi-preview.mjs",
109
- "kind": "batch",
110
- "inputKind": "directory",
111
- "runnable": true
112
- }
113
- ]
114
- }
1
+ {
2
+ "fixtureDrawing": "https://cdn.jsdelivr.net/gh/mlightcad/cad-data@main/data/canteen.dwg",
3
+ "defaultOutputDir": "tmp/examples-gallery",
4
+ "examples": [
5
+ {
6
+ "id": "create-drawing-dxf",
7
+ "title": "Create drawing -> DXF",
8
+ "description": "qnew, draw a closed rectangle with LINE, export DXF. No input file.",
9
+ "script": "create-drawing-dxf.scr",
10
+ "mode": "write",
11
+ "inputKind": "none",
12
+ "runnable": true
13
+ },
14
+ {
15
+ "id": "create-shapes-dxf",
16
+ "title": "Create shapes -> DXF",
17
+ "description": "qnew, draw a rectangle and a circle, export DXF.",
18
+ "script": "create-shapes-dxf.scr",
19
+ "mode": "write",
20
+ "inputKind": "none",
21
+ "runnable": true
22
+ },
23
+ {
24
+ "id": "create-drawing-png",
25
+ "title": "Create drawing -> PNG",
26
+ "description": "qnew, draw geometry, zoom extents, export PNG.",
27
+ "script": "create-drawing-png.scr",
28
+ "mode": "write",
29
+ "inputKind": "none",
30
+ "runnable": true
31
+ },
32
+ {
33
+ "id": "export-png",
34
+ "title": "Export PNG",
35
+ "description": "Zoom extents and export the drawing as PNG (long side 2048).",
36
+ "script": "export-png.scr",
37
+ "mode": "read",
38
+ "inputKind": "file",
39
+ "runnable": true
40
+ },
41
+ {
42
+ "id": "export-html",
43
+ "title": "Export HTML",
44
+ "description": "Export a self-contained offline HTML viewer (-chtml).",
45
+ "script": "export-html.scr",
46
+ "mode": "read",
47
+ "inputKind": "file",
48
+ "runnable": true
49
+ },
50
+ {
51
+ "id": "export-html-multi",
52
+ "title": "Export HTML (multi-file)",
53
+ "description": "Export a multi-file ACEX package zip for progressive loading (-chtml Multi).",
54
+ "script": "export-html-multi.scr",
55
+ "mode": "read",
56
+ "inputKind": "file",
57
+ "runnable": true
58
+ },
59
+ {
60
+ "id": "export-html-multi-preview",
61
+ "title": "Export HTML multi + preview",
62
+ "description": "Zoom extents, export multi-file ACEX zip (-chtml Multi), then JPEG preview.",
63
+ "script": "export-html-multi-preview.scr",
64
+ "mode": "read",
65
+ "inputKind": "file",
66
+ "runnable": true
67
+ },
68
+ {
69
+ "id": "export-dxf",
70
+ "title": "Export DXF",
71
+ "description": "Convert the open drawing to DXF (cdxf).",
72
+ "script": "export-dxf.scr",
73
+ "mode": "read",
74
+ "inputKind": "file",
75
+ "runnable": true
76
+ },
77
+ {
78
+ "id": "freeze-layer-png",
79
+ "title": "Layer off -> PNG",
80
+ "description": "Turn off a layer with -LAYER, then export PNG. Edit LAYER_NAME in the script first.",
81
+ "script": "freeze-layer-png.scr",
82
+ "mode": "write",
83
+ "inputKind": "file",
84
+ "runnable": true
85
+ },
86
+ {
87
+ "id": "batch-export-png",
88
+ "title": "Batch export PNG",
89
+ "description": "Scan a folder of DWG/DXF files and export each to PNG.",
90
+ "script": "batch-export-png.mjs",
91
+ "kind": "batch",
92
+ "inputKind": "directory",
93
+ "runnable": true
94
+ },
95
+ {
96
+ "id": "batch-export-html",
97
+ "title": "Batch export HTML",
98
+ "description": "Scan a folder and export each drawing to HTML.",
99
+ "script": "batch-export-html.mjs",
100
+ "kind": "batch",
101
+ "inputKind": "directory",
102
+ "runnable": true
103
+ },
104
+ {
105
+ "id": "batch-export-html-multi-preview",
106
+ "title": "Batch export HTML multi + preview",
107
+ "description": "Scan a folder, export multi ACEX zip + extents preview, package like demo-drawings.",
108
+ "script": "batch-export-html-multi-preview.mjs",
109
+ "kind": "batch",
110
+ "inputKind": "directory",
111
+ "runnable": true
112
+ }
113
+ ]
114
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mlightcad/cad-simple-viewer-cli",
3
- "version": "1.7.3",
3
+ "version": "1.7.5",
4
4
  "description": "AcCoreConsole-style headless CLI: run .scr command scripts against DXF/DWG drawings",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -42,17 +42,17 @@
42
42
  "script"
43
43
  ],
44
44
  "dependencies": {
45
- "@mlightcad/data-model": "^1.15.0",
46
- "@mlightcad/libredwg-converter": "^3.15.0",
45
+ "@mlightcad/data-model": "^1.15.3",
46
+ "@mlightcad/libredwg-converter": "^3.15.3",
47
47
  "@mlightcad/mtext-parser": "^1.5.3",
48
- "@mlightcad/mtext-renderer": "^0.13.1",
48
+ "@mlightcad/mtext-renderer": "^0.13.3",
49
49
  "commander": "^12.1.0",
50
50
  "playwright": "^1.49.1",
51
- "@mlightcad/cad-pdf-plugin": "1.7.3",
52
- "@mlightcad/cad-svg-plugin": "1.7.3",
53
- "@mlightcad/cad-simple-viewer": "1.7.3",
54
- "@mlightcad/pdf-renderer": "1.7.3",
55
- "@mlightcad/cad-html-plugin": "1.7.3"
51
+ "@mlightcad/cad-pdf-plugin": "1.7.5",
52
+ "@mlightcad/pdf-renderer": "1.7.5",
53
+ "@mlightcad/cad-html-plugin": "1.7.5",
54
+ "@mlightcad/cad-svg-plugin": "1.7.5",
55
+ "@mlightcad/cad-simple-viewer": "1.7.5"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@types/node": "^20.14.9",