@mlightcad/cad-pdf-plugin 1.5.5 → 1.5.6
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 +1 -1
- package/README.md +11 -4
- package/dist/cad-pdf-plugin-register.js +16 -0
- package/dist/cad-pdf-plugin-register.umd.cjs +1 -0
- package/dist/cad-pdf-plugin.js +42180 -0
- package/dist/cad-pdf-plugin.umd.cjs +312 -0
- package/lib/createPdfPlugin.d.ts +8 -0
- package/lib/createPdfPlugin.d.ts.map +1 -0
- package/lib/createPdfPlugin.js +50 -0
- package/lib/createPdfPlugin.js.map +1 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/{registerLazyPdfPlugin.d.ts → register.d.ts} +3 -8
- package/lib/register.d.ts.map +1 -0
- package/lib/{registerLazyPdfPlugin.js → register.js} +15 -21
- package/lib/register.js.map +1 -0
- package/package.json +24 -11
- package/dist/AcApPdfPlugin-CXWCd8bg.js +0 -34
- package/dist/html2canvas.esm-d2sM-0Wm.js +0 -4870
- package/dist/index-DNe5YnrC.js +0 -30983
- package/dist/index.es-DxTvd7sT.js +0 -5645
- package/dist/index.js +0 -11
- package/dist/index.umd.cjs +0 -312
- package/dist/purify.es-CxNDhYDZ.js +0 -663
- package/lib/registerLazyPdfPlugin.d.ts.map +0 -1
- package/lib/registerLazyPdfPlugin.js.map +0 -1
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# @mlightcad/cad-pdf-plugin
|
|
2
2
|
|
|
3
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
|
+
[](https://www.npmjs.com/package/@mlightcad/cad-pdf-plugin)
|
|
5
|
+
|
|
3
6
|
PDF **export** and **import** plugin for [`@mlightcad/cad-simple-viewer`](../cad-simple-viewer). Registers two system commands:
|
|
4
7
|
|
|
5
8
|
| Command | Description |
|
|
@@ -36,6 +39,8 @@ Runtime dependencies (bundled with this package):
|
|
|
36
39
|
|
|
37
40
|
## Build
|
|
38
41
|
|
|
42
|
+
Produces `dist/index.js` (main library) and `dist/register.js` (lazy-registration entry).
|
|
43
|
+
|
|
39
44
|
```bash
|
|
40
45
|
pnpm --filter @mlightcad/cad-pdf-plugin build
|
|
41
46
|
```
|
|
@@ -44,15 +49,17 @@ pnpm --filter @mlightcad/cad-pdf-plugin build
|
|
|
44
49
|
|
|
45
50
|
### Lazy registration (recommended)
|
|
46
51
|
|
|
47
|
-
Register the plugin with the document manager's plugin manager.
|
|
52
|
+
Register the plugin with the document manager's plugin manager. Import from the `/register` subpath so only the registration stub enters your initial bundle; the main plugin chunk loads on first use of `cpdf` or `ipdf`:
|
|
48
53
|
|
|
49
54
|
```typescript
|
|
50
55
|
import { AcApDocManager } from '@mlightcad/cad-simple-viewer'
|
|
51
|
-
import { registerLazyPdfPlugin } from '@mlightcad/cad-pdf-plugin'
|
|
56
|
+
import { registerLazyPdfPlugin } from '@mlightcad/cad-pdf-plugin/register'
|
|
52
57
|
|
|
53
58
|
registerLazyPdfPlugin(AcApDocManager.instance.pluginManager)
|
|
54
59
|
```
|
|
55
60
|
|
|
61
|
+
Do **not** import `registerLazyPdfPlugin` from the package root in application code — that resolves to the full library build and defeats lazy loading.
|
|
62
|
+
|
|
56
63
|
Equivalent manual registration:
|
|
57
64
|
|
|
58
65
|
```typescript
|
|
@@ -128,9 +135,9 @@ Import is **vector-only**; raster/scanned PDF pages produce no entities. Only th
|
|
|
128
135
|
|
|
129
136
|
| Export | Role |
|
|
130
137
|
|--------|------|
|
|
131
|
-
| `registerLazyPdfPlugin` | One-line lazy registration helper |
|
|
132
138
|
| `createPdfPlugin` | Async factory used by lazy loader |
|
|
133
139
|
| `PDF_PLUGIN_NAME`, `PDF_PLUGIN_TRIGGERS` | Plugin id and command triggers |
|
|
140
|
+
| `@mlightcad/cad-pdf-plugin/register` | `registerLazyPdfPlugin` and registration constants |
|
|
134
141
|
| `AcApPdfPlugin` | `AcApPlugin` implementation |
|
|
135
142
|
| `AcApConvertToPdfCmd` | `cpdf` command class |
|
|
136
143
|
| `AcApImportPdfCmd` | `ipdf` command class |
|
|
@@ -141,7 +148,7 @@ Import is **vector-only**; raster/scanned PDF pages produce no entities. Only th
|
|
|
141
148
|
|
|
142
149
|
| Path | Role |
|
|
143
150
|
|------|------|
|
|
144
|
-
| `src/
|
|
151
|
+
| `src/register.ts` | Lazy plugin registration (`/register` entry) and `createPdfPlugin` |
|
|
145
152
|
| `src/AcApPdfPlugin.ts` | Plugin lifecycle (`onLoad` / `onUnload`) |
|
|
146
153
|
| `src/AcApConvertToPdfCmd.ts` | `cpdf` command |
|
|
147
154
|
| `src/AcApImportPdfCmd.ts` | `ipdf` command |
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const t = "PdfPlugin", e = ["cpdf", "ipdf"];
|
|
2
|
+
function i(n) {
|
|
3
|
+
n.registerLazyPlugin({
|
|
4
|
+
name: t,
|
|
5
|
+
triggers: [...e],
|
|
6
|
+
loader: async () => {
|
|
7
|
+
const { createPdfPlugin: r } = await import("@mlightcad/cad-pdf-plugin");
|
|
8
|
+
return r();
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
t as PDF_PLUGIN_NAME,
|
|
14
|
+
e as PDF_PLUGIN_TRIGGERS,
|
|
15
|
+
i as registerLazyPdfPlugin
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var o=Object.create;var n=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var c=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty;var l=(e,t,P,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of u(t))!d.call(e,r)&&r!==P&&n(e,r,{get:()=>t[r],enumerable:!(i=s(t,r))||i.enumerable});return e};var f=(e,t,P)=>(P=e!=null?o(c(e)):{},l(t||!e||!e.__esModule?n(P,"default",{value:e,enumerable:!0}):P,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g="PdfPlugin",a=["cpdf","ipdf"];function G(e){e.registerLazyPlugin({name:g,triggers:[...a],loader:async()=>{const{createPdfPlugin:t}=await import("@mlightcad/cad-pdf-plugin");return t()}})}exports.PDF_PLUGIN_NAME=g;exports.PDF_PLUGIN_TRIGGERS=a;exports.registerLazyPdfPlugin=G;
|