@mlightcad/cad-pdf-plugin 1.5.4 → 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
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AcApPdfPlugin } from './AcApPdfPlugin';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a PDF plugin instance.
|
|
4
|
+
*
|
|
5
|
+
* @returns A loaded {@link AcApPdfPlugin} instance
|
|
6
|
+
*/
|
|
7
|
+
export declare function createPdfPlugin(): Promise<AcApPdfPlugin>;
|
|
8
|
+
//# sourceMappingURL=createPdfPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createPdfPlugin.d.ts","sourceRoot":"","sources":["../src/createPdfPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C;;;;GAIG;AACH,wBAAsB,eAAe,2BAEpC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { AcApPdfPlugin } from './AcApPdfPlugin';
|
|
38
|
+
/**
|
|
39
|
+
* Creates a PDF plugin instance.
|
|
40
|
+
*
|
|
41
|
+
* @returns A loaded {@link AcApPdfPlugin} instance
|
|
42
|
+
*/
|
|
43
|
+
export function createPdfPlugin() {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
45
|
+
return __generator(this, function (_a) {
|
|
46
|
+
return [2 /*return*/, new AcApPdfPlugin()];
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=createPdfPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createPdfPlugin.js","sourceRoot":"","sources":["../src/createPdfPlugin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C;;;;GAIG;AACH,MAAM,UAAgB,eAAe;;;YACnC,sBAAO,IAAI,aAAa,EAAE,EAAA;;;CAC3B"}
|
package/lib/index.d.ts
CHANGED
|
@@ -7,5 +7,6 @@ export { AcApConvertToPdfCmd } from './AcApConvertToPdfCmd';
|
|
|
7
7
|
export { AcApImportPdfCmd } from './AcApImportPdfCmd';
|
|
8
8
|
export { AcApPdfConvertor } from './AcApPdfConvertor';
|
|
9
9
|
export { AcApPdfImportConvertor } from './AcApPdfImportConvertor';
|
|
10
|
-
export { createPdfPlugin
|
|
10
|
+
export { createPdfPlugin } from './createPdfPlugin';
|
|
11
|
+
export { PDF_PLUGIN_NAME, PDF_PLUGIN_TRIGGERS } from './register';
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA"}
|
package/lib/index.js
CHANGED
|
@@ -7,5 +7,6 @@ export { AcApConvertToPdfCmd } from './AcApConvertToPdfCmd';
|
|
|
7
7
|
export { AcApImportPdfCmd } from './AcApImportPdfCmd';
|
|
8
8
|
export { AcApPdfConvertor } from './AcApPdfConvertor';
|
|
9
9
|
export { AcApPdfImportConvertor } from './AcApPdfImportConvertor';
|
|
10
|
-
export { createPdfPlugin
|
|
10
|
+
export { createPdfPlugin } from './createPdfPlugin';
|
|
11
|
+
export { PDF_PLUGIN_NAME, PDF_PLUGIN_TRIGGERS } from './register';
|
|
11
12
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -8,18 +8,13 @@ export declare const PDF_PLUGIN_NAME = "PdfPlugin";
|
|
|
8
8
|
* - `ipdf` — import vector geometry from PDF
|
|
9
9
|
*/
|
|
10
10
|
export declare const PDF_PLUGIN_TRIGGERS: readonly ["cpdf", "ipdf"];
|
|
11
|
-
/**
|
|
12
|
-
* Creates a PDF plugin instance after loading the plugin module chunk.
|
|
13
|
-
*
|
|
14
|
-
* @returns A loaded {@link AcApPdfPlugin} instance
|
|
15
|
-
*/
|
|
16
|
-
export declare function createPdfPlugin(): Promise<import("./AcApPdfPlugin").AcApPdfPlugin>;
|
|
17
11
|
/**
|
|
18
12
|
* Registers the PDF plugin for lazy loading.
|
|
19
13
|
*
|
|
20
|
-
*
|
|
14
|
+
* Import from `@mlightcad/cad-pdf-plugin/register` so the main plugin bundle
|
|
15
|
+
* is not pulled into the application entry chunk.
|
|
21
16
|
*
|
|
22
17
|
* @param pluginManager - Plugin manager that receives the lazy registration
|
|
23
18
|
*/
|
|
24
19
|
export declare function registerLazyPdfPlugin(pluginManager: AcApPluginManager): void;
|
|
25
|
-
//# sourceMappingURL=
|
|
20
|
+
//# sourceMappingURL=register.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAErE,8CAA8C;AAC9C,eAAO,MAAM,eAAe,cAAc,CAAA;AAE1C;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,2BAA4B,CAAA;AAE5D;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,iBAAiB,GAAG,IAAI,CAS5E"}
|
|
@@ -68,36 +68,30 @@ export var PDF_PLUGIN_NAME = 'PdfPlugin';
|
|
|
68
68
|
* - `ipdf` — import vector geometry from PDF
|
|
69
69
|
*/
|
|
70
70
|
export var PDF_PLUGIN_TRIGGERS = ['cpdf', 'ipdf'];
|
|
71
|
-
/**
|
|
72
|
-
* Creates a PDF plugin instance after loading the plugin module chunk.
|
|
73
|
-
*
|
|
74
|
-
* @returns A loaded {@link AcApPdfPlugin} instance
|
|
75
|
-
*/
|
|
76
|
-
export function createPdfPlugin() {
|
|
77
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
78
|
-
var AcApPdfPlugin;
|
|
79
|
-
return __generator(this, function (_a) {
|
|
80
|
-
switch (_a.label) {
|
|
81
|
-
case 0: return [4 /*yield*/, import('./AcApPdfPlugin')];
|
|
82
|
-
case 1:
|
|
83
|
-
AcApPdfPlugin = (_a.sent()).AcApPdfPlugin;
|
|
84
|
-
return [2 /*return*/, new AcApPdfPlugin()];
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
71
|
/**
|
|
90
72
|
* Registers the PDF plugin for lazy loading.
|
|
91
73
|
*
|
|
92
|
-
*
|
|
74
|
+
* Import from `@mlightcad/cad-pdf-plugin/register` so the main plugin bundle
|
|
75
|
+
* is not pulled into the application entry chunk.
|
|
93
76
|
*
|
|
94
77
|
* @param pluginManager - Plugin manager that receives the lazy registration
|
|
95
78
|
*/
|
|
96
79
|
export function registerLazyPdfPlugin(pluginManager) {
|
|
80
|
+
var _this = this;
|
|
97
81
|
pluginManager.registerLazyPlugin({
|
|
98
82
|
name: PDF_PLUGIN_NAME,
|
|
99
83
|
triggers: __spreadArray([], __read(PDF_PLUGIN_TRIGGERS), false),
|
|
100
|
-
loader:
|
|
84
|
+
loader: function () { return __awaiter(_this, void 0, void 0, function () {
|
|
85
|
+
var createPdfPlugin;
|
|
86
|
+
return __generator(this, function (_a) {
|
|
87
|
+
switch (_a.label) {
|
|
88
|
+
case 0: return [4 /*yield*/, import('@mlightcad/cad-pdf-plugin')];
|
|
89
|
+
case 1:
|
|
90
|
+
createPdfPlugin = (_a.sent()).createPdfPlugin;
|
|
91
|
+
return [2 /*return*/, createPdfPlugin()];
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}); }
|
|
101
95
|
});
|
|
102
96
|
}
|
|
103
|
-
//# sourceMappingURL=
|
|
97
|
+
//# sourceMappingURL=register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,8CAA8C;AAC9C,MAAM,CAAC,IAAM,eAAe,GAAG,WAAW,CAAA;AAE1C;;;;;GAKG;AACH,MAAM,CAAC,IAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU,CAAA;AAE5D;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CAAC,aAAgC;IAAtE,iBASC;IARC,aAAa,CAAC,kBAAkB,CAAC;QAC/B,IAAI,EAAE,eAAe;QACrB,QAAQ,2BAAM,mBAAmB,SAAC;QAClC,MAAM,EAAE;;;;4BACsB,qBAAM,MAAM,CAAC,2BAA2B,CAAC,EAAA;;wBAA7D,eAAe,GAAK,CAAA,SAAyC,CAAA,gBAA9C;wBACvB,sBAAO,eAAe,EAAE,EAAA;;;aACzB;KACF,CAAC,CAAA;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mlightcad/cad-pdf-plugin",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -13,28 +13,41 @@
|
|
|
13
13
|
"README.md",
|
|
14
14
|
"package.json"
|
|
15
15
|
],
|
|
16
|
-
"main": "./dist/
|
|
17
|
-
"module": "./dist/
|
|
16
|
+
"main": "./dist/cad-pdf-plugin.umd.cjs",
|
|
17
|
+
"module": "./dist/cad-pdf-plugin.js",
|
|
18
|
+
"sideEffects": false,
|
|
18
19
|
"types": "./lib/index.d.ts",
|
|
20
|
+
"typesVersions": {
|
|
21
|
+
"*": {
|
|
22
|
+
"register": [
|
|
23
|
+
"lib/register.d.ts"
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
},
|
|
19
27
|
"exports": {
|
|
20
28
|
".": {
|
|
21
29
|
"types": "./lib/index.d.ts",
|
|
22
|
-
"import": "./dist/
|
|
23
|
-
"require": "./dist/
|
|
30
|
+
"import": "./dist/cad-pdf-plugin.js",
|
|
31
|
+
"require": "./dist/cad-pdf-plugin.umd.cjs"
|
|
32
|
+
},
|
|
33
|
+
"./register": {
|
|
34
|
+
"types": "./lib/register.d.ts",
|
|
35
|
+
"import": "./dist/cad-pdf-plugin-register.js",
|
|
36
|
+
"require": "./dist/cad-pdf-plugin-register.umd.cjs"
|
|
24
37
|
}
|
|
25
38
|
},
|
|
26
39
|
"devDependencies": {
|
|
27
|
-
"@mlightcad/data-model": "^1.
|
|
40
|
+
"@mlightcad/data-model": "^1.9.11",
|
|
28
41
|
"jspdf": "^4.2.1",
|
|
29
42
|
"pdfjs-dist": "^5.6.205",
|
|
30
43
|
"svg2pdf.js": "^2.7.0",
|
|
31
|
-
"@mlightcad/cad-simple-viewer": "1.5.
|
|
32
|
-
"@mlightcad/cad-svg-plugin": "1.5.
|
|
44
|
+
"@mlightcad/cad-simple-viewer": "1.5.6",
|
|
45
|
+
"@mlightcad/cad-svg-plugin": "1.5.6"
|
|
33
46
|
},
|
|
34
47
|
"peerDependencies": {
|
|
35
|
-
"@mlightcad/data-model": "^1.
|
|
36
|
-
"@mlightcad/cad-simple-viewer": "1.5.
|
|
37
|
-
"@mlightcad/cad-svg-plugin": "1.5.
|
|
48
|
+
"@mlightcad/data-model": "^1.9.11",
|
|
49
|
+
"@mlightcad/cad-simple-viewer": "1.5.6",
|
|
50
|
+
"@mlightcad/cad-svg-plugin": "1.5.6"
|
|
38
51
|
},
|
|
39
52
|
"scripts": {
|
|
40
53
|
"clean": "rimraf dist lib tsconfig.tsbuildinfo",
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { AcEdCommandStack as t } from "@mlightcad/cad-simple-viewer";
|
|
2
|
-
import { A as e, a as n } from "./index-DNe5YnrC.js";
|
|
3
|
-
class p {
|
|
4
|
-
constructor() {
|
|
5
|
-
this.name = "PdfPlugin", this.version = "1.0.0", this.description = "PDF export (cpdf) and import (ipdf) commands", this.registeredCommands = [];
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Registers `cpdf` and `ipdf` system commands.
|
|
9
|
-
*
|
|
10
|
-
* @param _context - Application context (unused)
|
|
11
|
-
* @param commandManager - Command stack used to register PDF commands
|
|
12
|
-
*/
|
|
13
|
-
onLoad(m, o) {
|
|
14
|
-
const d = t.SYSTEMT_COMMAND_GROUP_NAME;
|
|
15
|
-
o.addCommand(d, "cpdf", "cpdf", new e()), o.addCommand(d, "ipdf", "ipdf", new n()), this.registeredCommands.push(
|
|
16
|
-
{ group: d, name: "cpdf" },
|
|
17
|
-
{ group: d, name: "ipdf" }
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Removes commands registered in {@link onLoad}.
|
|
22
|
-
*
|
|
23
|
-
* @param _context - Application context (unused)
|
|
24
|
-
* @param commandManager - Command stack used to unregister PDF commands
|
|
25
|
-
*/
|
|
26
|
-
onUnload(m, o) {
|
|
27
|
-
for (const d of this.registeredCommands)
|
|
28
|
-
o.removeCmd(d.group, d.name);
|
|
29
|
-
this.registeredCommands = [];
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
export {
|
|
33
|
-
p as AcApPdfPlugin
|
|
34
|
-
};
|