@mlightcad/cad-simple-viewer 1.4.8 → 1.4.9
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/LICENSE +21 -21
- package/README.md +88 -88
- package/dist/index.js +3156 -3103
- package/dist/index.umd.cjs +19 -19
- package/lib/app/AcApDocManager.js +1 -1
- package/lib/app/AcApDocManager.js.map +1 -1
- package/lib/app/AcApProgress.d.ts +8 -2
- package/lib/app/AcApProgress.d.ts.map +1 -1
- package/lib/app/AcApProgress.js +13 -7
- package/lib/app/AcApProgress.js.map +1 -1
- package/lib/command/AcApSwitchBgCmd.d.ts +0 -1
- package/lib/command/AcApSwitchBgCmd.d.ts.map +1 -1
- package/lib/command/AcApSwitchBgCmd.js +2 -4
- package/lib/command/AcApSwitchBgCmd.js.map +1 -1
- package/lib/editor/input/marker/AcEdMarker.d.ts +4 -1
- package/lib/editor/input/marker/AcEdMarker.d.ts.map +1 -1
- package/lib/editor/input/marker/AcEdMarker.js +11 -3
- package/lib/editor/input/marker/AcEdMarker.js.map +1 -1
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.d.ts.map +1 -1
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.js +6 -3
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.js.map +1 -1
- package/lib/editor/input/ui/AcEdCommandLine.d.ts +2 -0
- package/lib/editor/input/ui/AcEdCommandLine.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdCommandLine.js +20 -3
- package/lib/editor/input/ui/AcEdCommandLine.js.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts +2 -1
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingMessage.d.ts +6 -4
- package/lib/editor/input/ui/AcEdFloatingMessage.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingMessage.js +19 -13
- package/lib/editor/input/ui/AcEdFloatingMessage.js.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.js +14 -7
- package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
- package/lib/editor/view/AcEdBaseView.d.ts +30 -2
- package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
- package/lib/editor/view/AcEdBaseView.js +42 -6
- package/lib/editor/view/AcEdBaseView.js.map +1 -1
- package/package.json +3 -3
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 mlight-lee
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 mlight-lee
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
# CAD Simple Viewer
|
|
2
|
-
|
|
3
|
-
This package provides the **high-performance** core components of a CAD viewer such as document management, command handling, and collaboration between the UI and rendering engines. It's designed for optimal performance when handling large CAD files.
|
|
4
|
-
|
|
5
|
-
This module doesn't depend on any UI framework and doesn't provide any UI except canvas. If you want to integrate a high-performance CAD viewer into a web application with your own UI, this module is the correct choice.
|
|
6
|
-
|
|
7
|
-
## Key Features
|
|
8
|
-
- Document management optimized for large files
|
|
9
|
-
- Efficient command stack and undo/redo operations
|
|
10
|
-
- Optimized integration with rendering engines
|
|
11
|
-
- Performance-focused settings and context management
|
|
12
|
-
- Framework-agnostic design for maximum flexibility
|
|
13
|
-
|
|
14
|
-
## When Should You Choose cad-simple-viewer?
|
|
15
|
-
|
|
16
|
-
Use `cad-simple-viewer` if you need **core CAD logic only** (document management, command stack, rendering engine integration) without any UI framework dependencies. This package is ideal if:
|
|
17
|
-
|
|
18
|
-
- You want to build your **own custom UI** or integrate CAD functionality into a non-Vue or non-web environment.
|
|
19
|
-
- You require maximum flexibility and performance for handling large CAD files, and plan to connect the logic to your own rendering or UI layer.
|
|
20
|
-
- You want a framework-agnostic solution that provides only the essential CAD operations and canvas rendering.
|
|
21
|
-
|
|
22
|
-
**Recommended for:** Custom integrations, headless CAD processing, or advanced users building highly tailored CAD solutions.
|
|
23
|
-
|
|
24
|
-
## Directory Structure (partial)
|
|
25
|
-
- `src/app/` – Document/context management, settings
|
|
26
|
-
- `src/command/` – Command implementations (open, zoom, select, etc.)
|
|
27
|
-
- `src/editor/` – Command stack, input handling, global functions
|
|
28
|
-
- `src/view/` – Layout and scene management
|
|
29
|
-
- `src/util/` – Utilities
|
|
30
|
-
|
|
31
|
-
## Installation
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
npm install @mlightcad/cad-simple-viewer
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## Usage
|
|
38
|
-
|
|
39
|
-
Please refer to [cad-simple-viewer-example](https://github.com/mlight-lee/cad-simple-viewer-example) on basic usage and advanced usage.
|
|
40
|
-
|
|
41
|
-
While `cad-simple-viewer` doesn't support saving drawings to DWG/DXF files, it provides comprehensive support for **modifying drawings in real-time**. You can add, edit, and delete entities within the drawing, and the viewer will automatically update to reflect these changes.
|
|
42
|
-
|
|
43
|
-
When you modify entities, you're working directly with the underlying drawing database. The viewer automatically detects these changes and updates the display accordingly. This real-time synchronization ensures that:
|
|
44
|
-
|
|
45
|
-
- All modifications are immediately visible
|
|
46
|
-
- The command stack properly tracks changes for undo/redo operations. This will be implemented soon.
|
|
47
|
-
|
|
48
|
-
This capability makes `cad-simple-viewer` suitable for applications that need to not only display CAD files but also allow users to interact with and modify the drawing content.
|
|
49
|
-
|
|
50
|
-
**Important Note**: The usage patterns in `cad-simple-viewer` are **very similar to AutoCAD RealDWG**. If you're familiar with AutoCAD RealDWG development, you'll find the API structure and workflow nearly identical. The main difference is that we use the [**realdwg-web API**](https://mlight-lee.github.io/realdwg-web/) instead of the native RealDWG libraries.
|
|
51
|
-
|
|
52
|
-
In [cad-simple-viewer-example](https://github.com/mlight-lee/cad-simple-viewer-example) it demonstrates how to create one drawing with [**realdwg-web API**](https://mlight-lee.github.io/realdwg-web/).
|
|
53
|
-
|
|
54
|
-
## Available Exports
|
|
55
|
-
|
|
56
|
-
### Core Classes
|
|
57
|
-
|
|
58
|
-
- `AcApContext` - Main application context
|
|
59
|
-
- `AcApDocManager` - Document management
|
|
60
|
-
- `AcApDocument` - Individual document handling
|
|
61
|
-
- `AcApSettingManager` - Settings management
|
|
62
|
-
|
|
63
|
-
### Commands
|
|
64
|
-
|
|
65
|
-
- `AcApOpenCmd` - Open file command
|
|
66
|
-
- `AcApZoomCmd` - Zoom command
|
|
67
|
-
- `AcApPanCmd` - Pan command
|
|
68
|
-
- `AcApSelectCmd` - Selection command
|
|
69
|
-
- `AcApConvertToSvgCmd` - SVG conversion command
|
|
70
|
-
|
|
71
|
-
### Editor Components
|
|
72
|
-
|
|
73
|
-
- `AcEditor` - Main editor class
|
|
74
|
-
- `AcEdCommandStack` - Command stack management
|
|
75
|
-
- `AcEdSelectionSet` - Selection handling
|
|
76
|
-
- `AcEdInputPoint` - Input point management
|
|
77
|
-
|
|
78
|
-
### View Components
|
|
79
|
-
|
|
80
|
-
- `AcTrScene` - Scene management
|
|
81
|
-
- `AcTrLayoutView` - Layout view handling
|
|
82
|
-
- `AcTrView2d` - 2D view management
|
|
83
|
-
|
|
84
|
-
## Role in MLightCAD
|
|
85
|
-
This package acts as the core logic layer, connecting the frontend UI with the rendering engines and managing all document-related operations.
|
|
86
|
-
|
|
87
|
-
## License
|
|
88
|
-
|
|
1
|
+
# CAD Simple Viewer
|
|
2
|
+
|
|
3
|
+
This package provides the **high-performance** core components of a CAD viewer such as document management, command handling, and collaboration between the UI and rendering engines. It's designed for optimal performance when handling large CAD files.
|
|
4
|
+
|
|
5
|
+
This module doesn't depend on any UI framework and doesn't provide any UI except canvas. If you want to integrate a high-performance CAD viewer into a web application with your own UI, this module is the correct choice.
|
|
6
|
+
|
|
7
|
+
## Key Features
|
|
8
|
+
- Document management optimized for large files
|
|
9
|
+
- Efficient command stack and undo/redo operations
|
|
10
|
+
- Optimized integration with rendering engines
|
|
11
|
+
- Performance-focused settings and context management
|
|
12
|
+
- Framework-agnostic design for maximum flexibility
|
|
13
|
+
|
|
14
|
+
## When Should You Choose cad-simple-viewer?
|
|
15
|
+
|
|
16
|
+
Use `cad-simple-viewer` if you need **core CAD logic only** (document management, command stack, rendering engine integration) without any UI framework dependencies. This package is ideal if:
|
|
17
|
+
|
|
18
|
+
- You want to build your **own custom UI** or integrate CAD functionality into a non-Vue or non-web environment.
|
|
19
|
+
- You require maximum flexibility and performance for handling large CAD files, and plan to connect the logic to your own rendering or UI layer.
|
|
20
|
+
- You want a framework-agnostic solution that provides only the essential CAD operations and canvas rendering.
|
|
21
|
+
|
|
22
|
+
**Recommended for:** Custom integrations, headless CAD processing, or advanced users building highly tailored CAD solutions.
|
|
23
|
+
|
|
24
|
+
## Directory Structure (partial)
|
|
25
|
+
- `src/app/` – Document/context management, settings
|
|
26
|
+
- `src/command/` – Command implementations (open, zoom, select, etc.)
|
|
27
|
+
- `src/editor/` – Command stack, input handling, global functions
|
|
28
|
+
- `src/view/` – Layout and scene management
|
|
29
|
+
- `src/util/` – Utilities
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install @mlightcad/cad-simple-viewer
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
Please refer to [cad-simple-viewer-example](https://github.com/mlight-lee/cad-simple-viewer-example) on basic usage and advanced usage.
|
|
40
|
+
|
|
41
|
+
While `cad-simple-viewer` doesn't support saving drawings to DWG/DXF files, it provides comprehensive support for **modifying drawings in real-time**. You can add, edit, and delete entities within the drawing, and the viewer will automatically update to reflect these changes.
|
|
42
|
+
|
|
43
|
+
When you modify entities, you're working directly with the underlying drawing database. The viewer automatically detects these changes and updates the display accordingly. This real-time synchronization ensures that:
|
|
44
|
+
|
|
45
|
+
- All modifications are immediately visible
|
|
46
|
+
- The command stack properly tracks changes for undo/redo operations. This will be implemented soon.
|
|
47
|
+
|
|
48
|
+
This capability makes `cad-simple-viewer` suitable for applications that need to not only display CAD files but also allow users to interact with and modify the drawing content.
|
|
49
|
+
|
|
50
|
+
**Important Note**: The usage patterns in `cad-simple-viewer` are **very similar to AutoCAD RealDWG**. If you're familiar with AutoCAD RealDWG development, you'll find the API structure and workflow nearly identical. The main difference is that we use the [**realdwg-web API**](https://mlight-lee.github.io/realdwg-web/) instead of the native RealDWG libraries.
|
|
51
|
+
|
|
52
|
+
In [cad-simple-viewer-example](https://github.com/mlight-lee/cad-simple-viewer-example) it demonstrates how to create one drawing with [**realdwg-web API**](https://mlight-lee.github.io/realdwg-web/).
|
|
53
|
+
|
|
54
|
+
## Available Exports
|
|
55
|
+
|
|
56
|
+
### Core Classes
|
|
57
|
+
|
|
58
|
+
- `AcApContext` - Main application context
|
|
59
|
+
- `AcApDocManager` - Document management
|
|
60
|
+
- `AcApDocument` - Individual document handling
|
|
61
|
+
- `AcApSettingManager` - Settings management
|
|
62
|
+
|
|
63
|
+
### Commands
|
|
64
|
+
|
|
65
|
+
- `AcApOpenCmd` - Open file command
|
|
66
|
+
- `AcApZoomCmd` - Zoom command
|
|
67
|
+
- `AcApPanCmd` - Pan command
|
|
68
|
+
- `AcApSelectCmd` - Selection command
|
|
69
|
+
- `AcApConvertToSvgCmd` - SVG conversion command
|
|
70
|
+
|
|
71
|
+
### Editor Components
|
|
72
|
+
|
|
73
|
+
- `AcEditor` - Main editor class
|
|
74
|
+
- `AcEdCommandStack` - Command stack management
|
|
75
|
+
- `AcEdSelectionSet` - Selection handling
|
|
76
|
+
- `AcEdInputPoint` - Input point management
|
|
77
|
+
|
|
78
|
+
### View Components
|
|
79
|
+
|
|
80
|
+
- `AcTrScene` - Scene management
|
|
81
|
+
- `AcTrLayoutView` - Layout view handling
|
|
82
|
+
- `AcTrView2d` - 2D view management
|
|
83
|
+
|
|
84
|
+
## Role in MLightCAD
|
|
85
|
+
This package acts as the core logic layer, connecting the frontend UI with the rendering engines and managing all document-related operations.
|
|
86
|
+
|
|
87
|
+
## License
|
|
88
|
+
|
|
89
89
|
MIT
|