@mlightcad/cad-simple-viewer 1.5.0 → 1.5.1
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/index.js +11070 -34695
- package/dist/index.umd.cjs +39 -52
- package/dist/libredwg-parser-worker.js +3955 -7422
- package/dist/mtext-renderer-worker.js +978 -789
- package/dist/viewer-runtime.iife.js +3879 -0
- package/lib/app/AcApAnnotation.js +4 -4
- package/lib/app/AcApAnnotation.js.map +1 -1
- package/lib/app/AcApDocManager.d.ts +45 -1
- package/lib/app/AcApDocManager.d.ts.map +1 -1
- package/lib/app/AcApDocManager.js +127 -10
- package/lib/app/AcApDocManager.js.map +1 -1
- package/lib/command/AcApZoomCmd.js +3 -3
- package/lib/command/AcApZoomCmd.js.map +1 -1
- package/lib/command/convert/AcApExportHtmlCmd.d.ts +22 -0
- package/lib/command/convert/AcApExportHtmlCmd.d.ts.map +1 -0
- package/lib/command/convert/AcApExportHtmlCmd.js +93 -0
- package/lib/command/convert/AcApExportHtmlCmd.js.map +1 -0
- package/lib/command/convert/AcApHtmlConvertor.d.ts +61 -0
- package/lib/command/convert/AcApHtmlConvertor.d.ts.map +1 -0
- package/lib/command/convert/AcApHtmlConvertor.js +223 -0
- package/lib/command/convert/AcApHtmlConvertor.js.map +1 -0
- package/lib/command/convert/AcApHtmlSnapshotBuilder.d.ts +65 -0
- package/lib/command/convert/AcApHtmlSnapshotBuilder.d.ts.map +1 -0
- package/lib/command/convert/AcApHtmlSnapshotBuilder.js +301 -0
- package/lib/command/convert/AcApHtmlSnapshotBuilder.js.map +1 -0
- package/lib/command/convert/index.d.ts +3 -0
- package/lib/command/convert/index.d.ts.map +1 -1
- package/lib/command/convert/index.js +3 -0
- package/lib/command/convert/index.js.map +1 -1
- package/lib/command/draw/AcApArcCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApArcCmd.js +46 -20
- package/lib/command/draw/AcApArcCmd.js.map +1 -1
- package/lib/command/draw/AcApCircleCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApCircleCmd.js +5 -6
- package/lib/command/draw/AcApCircleCmd.js.map +1 -1
- package/lib/command/draw/AcApEllipseCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApEllipseCmd.js +4 -6
- package/lib/command/draw/AcApEllipseCmd.js.map +1 -1
- package/lib/command/draw/AcApMLineCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApMLineCmd.js +4 -7
- package/lib/command/draw/AcApMLineCmd.js.map +1 -1
- package/lib/command/draw/AcApMTextCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApMTextCmd.js +3 -1
- package/lib/command/draw/AcApMTextCmd.js.map +1 -1
- package/lib/command/draw/AcApPolygonCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApPolygonCmd.js +4 -5
- package/lib/command/draw/AcApPolygonCmd.js.map +1 -1
- package/lib/command/draw/AcApPolylineCmd.d.ts +49 -0
- package/lib/command/draw/AcApPolylineCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApPolylineCmd.js +200 -18
- package/lib/command/draw/AcApPolylineCmd.js.map +1 -1
- package/lib/command/draw/AcApRayCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApRayCmd.js +2 -3
- package/lib/command/draw/AcApRayCmd.js.map +1 -1
- package/lib/command/draw/AcApRectCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApRectCmd.js +9 -10
- package/lib/command/draw/AcApRectCmd.js.map +1 -1
- package/lib/command/draw/AcApSplineCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApSplineCmd.js +3 -6
- package/lib/command/draw/AcApSplineCmd.js.map +1 -1
- package/lib/command/draw/AcApXLineCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApXLineCmd.js +2 -3
- package/lib/command/draw/AcApXLineCmd.js.map +1 -1
- package/lib/command/measure/AcApClearMeasurementsCmd.d.ts +11 -0
- package/lib/command/measure/AcApClearMeasurementsCmd.d.ts.map +1 -1
- package/lib/command/measure/AcApClearMeasurementsCmd.js +15 -4
- package/lib/command/measure/AcApClearMeasurementsCmd.js.map +1 -1
- package/lib/command/measure/AcApMeasureAngleCmd.d.ts.map +1 -1
- package/lib/command/measure/AcApMeasureAngleCmd.js +15 -6
- package/lib/command/measure/AcApMeasureAngleCmd.js.map +1 -1
- package/lib/command/measure/AcApMeasureArcCmd.d.ts.map +1 -1
- package/lib/command/measure/AcApMeasureArcCmd.js +11 -4
- package/lib/command/measure/AcApMeasureArcCmd.js.map +1 -1
- package/lib/command/measure/AcApMeasureAreaCmd.d.ts.map +1 -1
- package/lib/command/measure/AcApMeasureAreaCmd.js +11 -4
- package/lib/command/measure/AcApMeasureAreaCmd.js.map +1 -1
- package/lib/command/measure/AcApMeasureDistanceCmd.d.ts +3 -2
- package/lib/command/measure/AcApMeasureDistanceCmd.d.ts.map +1 -1
- package/lib/command/measure/AcApMeasureDistanceCmd.js +14 -6
- package/lib/command/measure/AcApMeasureDistanceCmd.js.map +1 -1
- package/lib/command/modify/AcApOffsetCmd.d.ts +30 -0
- package/lib/command/modify/AcApOffsetCmd.d.ts.map +1 -0
- package/lib/command/modify/AcApOffsetCmd.js +424 -0
- package/lib/command/modify/AcApOffsetCmd.js.map +1 -0
- package/lib/command/modify/AcApRotateCmd.d.ts.map +1 -1
- package/lib/command/modify/AcApRotateCmd.js +3 -4
- package/lib/command/modify/AcApRotateCmd.js.map +1 -1
- package/lib/command/modify/index.d.ts +1 -0
- package/lib/command/modify/index.d.ts.map +1 -1
- package/lib/command/modify/index.js +1 -0
- package/lib/command/modify/index.js.map +1 -1
- package/lib/command/review/AcApRevCircleCmd.d.ts.map +1 -1
- package/lib/command/review/AcApRevCircleCmd.js +4 -1
- package/lib/command/review/AcApRevCircleCmd.js.map +1 -1
- package/lib/editor/input/AcEdSelectionFilter.js +7 -6
- package/lib/editor/input/AcEdSelectionFilter.js.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptDistanceOptions.d.ts.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptDistanceOptions.js +1 -1
- package/lib/editor/input/prompt/AcEdPromptDistanceOptions.js.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts +9 -0
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInput.js +21 -3
- package/lib/editor/input/ui/AcEdFloatingInput.js.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.d.ts +25 -6
- package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.js +119 -39
- package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
- package/lib/editor/input/ui/AcEdMTextEditor.d.ts +67 -2
- package/lib/editor/input/ui/AcEdMTextEditor.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdMTextEditor.js +210 -19
- package/lib/editor/input/ui/AcEdMTextEditor.js.map +1 -1
- package/lib/editor/input/ui/AcEdRubberBand.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdRubberBand.js +16 -8
- package/lib/editor/input/ui/AcEdRubberBand.js.map +1 -1
- package/lib/i18n/en/command.d.ts +64 -10
- package/lib/i18n/en/command.d.ts.map +1 -1
- package/lib/i18n/en/command.js +67 -13
- package/lib/i18n/en/command.js.map +1 -1
- package/lib/i18n/en/jig.d.ts +8 -0
- package/lib/i18n/en/jig.d.ts.map +1 -1
- package/lib/i18n/en/jig.js +8 -0
- package/lib/i18n/en/jig.js.map +1 -1
- package/lib/i18n/zh/command.d.ts +64 -10
- package/lib/i18n/zh/command.d.ts.map +1 -1
- package/lib/i18n/zh/command.js +67 -13
- package/lib/i18n/zh/command.js.map +1 -1
- package/lib/i18n/zh/jig.d.ts +8 -0
- package/lib/i18n/zh/jig.d.ts.map +1 -1
- package/lib/i18n/zh/jig.js +8 -0
- package/lib/i18n/zh/jig.js.map +1 -1
- 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/util/AcApFontUtil.d.ts +69 -0
- package/lib/util/AcApFontUtil.d.ts.map +1 -0
- package/lib/util/AcApFontUtil.js +161 -0
- package/lib/util/AcApFontUtil.js.map +1 -0
- package/lib/util/index.d.ts +2 -0
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +2 -0
- package/lib/util/index.js.map +1 -1
- package/lib/util/yieldToMain.d.ts +5 -0
- package/lib/util/yieldToMain.d.ts.map +1 -0
- package/lib/util/yieldToMain.js +11 -0
- package/lib/util/yieldToMain.js.map +1 -0
- package/lib/view/AcTrLayoutView.d.ts +12 -0
- package/lib/view/AcTrLayoutView.d.ts.map +1 -1
- package/lib/view/AcTrLayoutView.js +18 -0
- package/lib/view/AcTrLayoutView.js.map +1 -1
- package/lib/view/AcTrScene.d.ts +38 -6
- package/lib/view/AcTrScene.d.ts.map +1 -1
- package/lib/view/AcTrScene.js +57 -30
- package/lib/view/AcTrScene.js.map +1 -1
- package/lib/view/AcTrView2d.d.ts +166 -0
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +586 -53
- package/lib/view/AcTrView2d.js.map +1 -1
- package/package.json +14 -8
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
26
|
+
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);
|
|
27
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
28
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
|
+
function step(op) {
|
|
30
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
32
|
+
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;
|
|
33
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
|
+
switch (op[0]) {
|
|
35
|
+
case 0: case 1: t = op; break;
|
|
36
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
37
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
38
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
39
|
+
default:
|
|
40
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
41
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
42
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
43
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
44
|
+
if (t[2]) _.ops.pop();
|
|
45
|
+
_.trys.pop(); continue;
|
|
46
|
+
}
|
|
47
|
+
op = body.call(thisArg, _);
|
|
48
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
49
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
import { AcEdCommand } from '../../editor';
|
|
53
|
+
import { AcApHtmlConvertor } from './AcApHtmlConvertor';
|
|
54
|
+
/**
|
|
55
|
+
* Editor command that exports the active drawing as a self-contained HTML file.
|
|
56
|
+
*
|
|
57
|
+
* The command delegates to {@link AcApHtmlConvertor}, which serializes the
|
|
58
|
+
* current Three.js scene into an {@link AcExSnapshotV1} HTML snapshot,
|
|
59
|
+
* bundles the offline viewer runtime, and triggers a browser download. No
|
|
60
|
+
* prompts are shown; the output filename is derived from the document name.
|
|
61
|
+
*/
|
|
62
|
+
var AcApExportHtmlCmd = /** @class */ (function (_super) {
|
|
63
|
+
__extends(AcApExportHtmlCmd, _super);
|
|
64
|
+
function AcApExportHtmlCmd() {
|
|
65
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Runs the HTML export workflow for the drawing in `context`.
|
|
69
|
+
*
|
|
70
|
+
* @param context - Active application context; only `context.doc.fileName` is
|
|
71
|
+
* used today to suggest the downloaded file name.
|
|
72
|
+
* @returns Resolves when the HTML file has been generated and the download
|
|
73
|
+
* has been initiated, or rejects if runtime loading or packaging fails.
|
|
74
|
+
*/
|
|
75
|
+
AcApExportHtmlCmd.prototype.execute = function (context) {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
77
|
+
var converter;
|
|
78
|
+
return __generator(this, function (_a) {
|
|
79
|
+
switch (_a.label) {
|
|
80
|
+
case 0:
|
|
81
|
+
converter = new AcApHtmlConvertor();
|
|
82
|
+
return [4 /*yield*/, converter.convert(context.doc.fileName)];
|
|
83
|
+
case 1:
|
|
84
|
+
_a.sent();
|
|
85
|
+
return [2 /*return*/];
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
return AcApExportHtmlCmd;
|
|
91
|
+
}(AcEdCommand));
|
|
92
|
+
export { AcApExportHtmlCmd };
|
|
93
|
+
//# sourceMappingURL=AcApExportHtmlCmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApExportHtmlCmd.js","sourceRoot":"","sources":["../../../src/command/convert/AcApExportHtmlCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAEvD;;;;;;;GAOG;AACH;IAAuC,qCAAW;IAAlD;;IAaA,CAAC;IAZC;;;;;;;OAOG;IACG,mCAAO,GAAb,UAAc,OAAoB;;;;;;wBAC1B,SAAS,GAAG,IAAI,iBAAiB,EAAE,CAAA;wBACzC,qBAAM,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAA;;wBAA7C,SAA6C,CAAA;;;;;KAC9C;IACH,wBAAC;AAAD,CAAC,AAbD,CAAuC,WAAW,GAajD"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type AcExSnapshotV1 } from '@mlightcad/cad-html-exporter';
|
|
2
|
+
/**
|
|
3
|
+
* Orchestrates export of the active drawing to a downloadable HTML file.
|
|
4
|
+
*
|
|
5
|
+
* Workflow:
|
|
6
|
+
* 1. Build a display-only {@link AcExSnapshotV1} from the current scene and database.
|
|
7
|
+
* 2. Fetch the IIFE viewer runtime (inlined into the HTML).
|
|
8
|
+
* 3. Package snapshot + runtime via `packHtml` and trigger a browser download.
|
|
9
|
+
*
|
|
10
|
+
* A busy indicator is shown for the duration of the operation. The UI thread
|
|
11
|
+
* is yielded between heavy steps so the browser can repaint.
|
|
12
|
+
*/
|
|
13
|
+
export declare class AcApHtmlConvertor {
|
|
14
|
+
/** Collects geometry and metadata from the live Three.js scene. */
|
|
15
|
+
private readonly _snapshotBuilder;
|
|
16
|
+
/**
|
|
17
|
+
* Exports the document currently open in {@link AcApDocManager}.
|
|
18
|
+
*
|
|
19
|
+
* @param fileName - Optional base name for the download (without extension).
|
|
20
|
+
* When omitted, the active document's `fileName` is used. A `.html` suffix
|
|
21
|
+
* is always applied; `.dwg` / `.dxf` suffixes on the input are stripped.
|
|
22
|
+
* @returns Resolves when packaging and download complete.
|
|
23
|
+
*/
|
|
24
|
+
convert(fileName?: string): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Packages a pre-built snapshot into HTML and downloads it.
|
|
27
|
+
*
|
|
28
|
+
* Skips scene collection; useful for tests, CLI tooling, or re-exporting a
|
|
29
|
+
* snapshot produced elsewhere.
|
|
30
|
+
*
|
|
31
|
+
* @param snapshot - Complete v1 snapshot to embed in the HTML.
|
|
32
|
+
* @param downloadName - File name passed to the browser download API (should
|
|
33
|
+
* include the `.html` extension).
|
|
34
|
+
* @returns Resolves when packaging and download complete.
|
|
35
|
+
*/
|
|
36
|
+
packSnapshot(snapshot: AcExSnapshotV1, downloadName: string): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Fetches the offline viewer runtime as source text for inlining.
|
|
39
|
+
*
|
|
40
|
+
* @param url - Absolute or relative URL of `viewer-runtime.iife.js`. When
|
|
41
|
+
* omitted, {@link DEFAULT_RUNTIME_URL} is used.
|
|
42
|
+
* @returns The runtime script body as a string.
|
|
43
|
+
* @throws If the HTTP response is not OK (missing build artifact, CORS, etc.).
|
|
44
|
+
*/
|
|
45
|
+
private loadViewerRuntime;
|
|
46
|
+
/**
|
|
47
|
+
* Derives the browser download file name from a drawing file name.
|
|
48
|
+
*
|
|
49
|
+
* @param fileName - Source drawing name (may include `.dwg` or `.dxf`).
|
|
50
|
+
* @returns Base name without drawing extension, plus `.html`.
|
|
51
|
+
*/
|
|
52
|
+
private resolveDownloadName;
|
|
53
|
+
/**
|
|
54
|
+
* Triggers a client-side download of the generated HTML string.
|
|
55
|
+
*
|
|
56
|
+
* @param content - Full HTML document text.
|
|
57
|
+
* @param downloadName - Value for the anchor `download` attribute.
|
|
58
|
+
*/
|
|
59
|
+
private downloadHtml;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=AcApHtmlConvertor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApHtmlConvertor.d.ts","sourceRoot":"","sources":["../../../src/command/convert/AcApHtmlConvertor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAY,MAAM,8BAA8B,CAAA;AAY5E;;;;;;;;;;GAUG;AACH,qBAAa,iBAAiB;IAC5B,mEAAmE;IACnE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAgC;IAEjE;;;;;;;OAOG;IACG,OAAO,CAAC,QAAQ,CAAC,EAAE,MAAM;IA0C/B;;;;;;;;;;OAUG;IACG,YAAY,CAAC,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM;IAqBjE;;;;;;;OAOG;YACW,iBAAiB;IAY/B;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;IAK3B;;;;;OAKG;IACH,OAAO,CAAC,YAAY;CAWrB"}
|
|
@@ -0,0 +1,223 @@
|
|
|
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 { packHtml } from '@mlightcad/cad-html-exporter';
|
|
38
|
+
import { AcApDocManager } from '../../app';
|
|
39
|
+
import { yieldToMain } from '../../util';
|
|
40
|
+
import { AcApHtmlSnapshotBuilder } from './AcApHtmlSnapshotBuilder';
|
|
41
|
+
/**
|
|
42
|
+
* Relative URL of the bundled offline viewer script when no override is
|
|
43
|
+
* configured on {@link AcApDocManager.htmlViewerRuntimeUrl}.
|
|
44
|
+
*/
|
|
45
|
+
var DEFAULT_RUNTIME_URL = './viewer-runtime.iife.js';
|
|
46
|
+
/**
|
|
47
|
+
* Orchestrates export of the active drawing to a downloadable HTML file.
|
|
48
|
+
*
|
|
49
|
+
* Workflow:
|
|
50
|
+
* 1. Build a display-only {@link AcExSnapshotV1} from the current scene and database.
|
|
51
|
+
* 2. Fetch the IIFE viewer runtime (inlined into the HTML).
|
|
52
|
+
* 3. Package snapshot + runtime via `packHtml` and trigger a browser download.
|
|
53
|
+
*
|
|
54
|
+
* A busy indicator is shown for the duration of the operation. The UI thread
|
|
55
|
+
* is yielded between heavy steps so the browser can repaint.
|
|
56
|
+
*/
|
|
57
|
+
var AcApHtmlConvertor = /** @class */ (function () {
|
|
58
|
+
function AcApHtmlConvertor() {
|
|
59
|
+
/** Collects geometry and metadata from the live Three.js scene. */
|
|
60
|
+
this._snapshotBuilder = new AcApHtmlSnapshotBuilder();
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Exports the document currently open in {@link AcApDocManager}.
|
|
64
|
+
*
|
|
65
|
+
* @param fileName - Optional base name for the download (without extension).
|
|
66
|
+
* When omitted, the active document's `fileName` is used. A `.html` suffix
|
|
67
|
+
* is always applied; `.dwg` / `.dxf` suffixes on the input are stripped.
|
|
68
|
+
* @returns Resolves when packaging and download complete.
|
|
69
|
+
*/
|
|
70
|
+
AcApHtmlConvertor.prototype.convert = function (fileName) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
72
|
+
var docManager, document_1, view, snapshot, viewerRuntime, html;
|
|
73
|
+
return __generator(this, function (_a) {
|
|
74
|
+
switch (_a.label) {
|
|
75
|
+
case 0:
|
|
76
|
+
docManager = AcApDocManager.instance;
|
|
77
|
+
docManager.showBusyIndicator();
|
|
78
|
+
_a.label = 1;
|
|
79
|
+
case 1:
|
|
80
|
+
_a.trys.push([1, , 8, 9]);
|
|
81
|
+
return [4 /*yield*/, yieldToMain()];
|
|
82
|
+
case 2:
|
|
83
|
+
_a.sent();
|
|
84
|
+
document_1 = docManager.curDocument;
|
|
85
|
+
view = docManager.curView;
|
|
86
|
+
return [4 /*yield*/, this._snapshotBuilder.buildAsync(view.cadScene, document_1.database, {
|
|
87
|
+
title: fileName !== null && fileName !== void 0 ? fileName : document_1.fileName,
|
|
88
|
+
background: view.backgroundColor
|
|
89
|
+
})];
|
|
90
|
+
case 3:
|
|
91
|
+
snapshot = _a.sent();
|
|
92
|
+
return [4 /*yield*/, yieldToMain()];
|
|
93
|
+
case 4:
|
|
94
|
+
_a.sent();
|
|
95
|
+
return [4 /*yield*/, this.loadViewerRuntime(docManager.htmlViewerRuntimeUrl)];
|
|
96
|
+
case 5:
|
|
97
|
+
viewerRuntime = _a.sent();
|
|
98
|
+
return [4 /*yield*/, yieldToMain()];
|
|
99
|
+
case 6:
|
|
100
|
+
_a.sent();
|
|
101
|
+
html = packHtml(snapshot, {
|
|
102
|
+
title: snapshot.meta.title,
|
|
103
|
+
viewerRuntime: viewerRuntime
|
|
104
|
+
});
|
|
105
|
+
return [4 /*yield*/, yieldToMain()];
|
|
106
|
+
case 7:
|
|
107
|
+
_a.sent();
|
|
108
|
+
this.downloadHtml(html, this.resolveDownloadName(fileName !== null && fileName !== void 0 ? fileName : document_1.fileName));
|
|
109
|
+
return [3 /*break*/, 9];
|
|
110
|
+
case 8:
|
|
111
|
+
docManager.hideBusyIndicator();
|
|
112
|
+
return [7 /*endfinally*/];
|
|
113
|
+
case 9: return [2 /*return*/];
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Packages a pre-built snapshot into HTML and downloads it.
|
|
120
|
+
*
|
|
121
|
+
* Skips scene collection; useful for tests, CLI tooling, or re-exporting a
|
|
122
|
+
* snapshot produced elsewhere.
|
|
123
|
+
*
|
|
124
|
+
* @param snapshot - Complete v1 snapshot to embed in the HTML.
|
|
125
|
+
* @param downloadName - File name passed to the browser download API (should
|
|
126
|
+
* include the `.html` extension).
|
|
127
|
+
* @returns Resolves when packaging and download complete.
|
|
128
|
+
*/
|
|
129
|
+
AcApHtmlConvertor.prototype.packSnapshot = function (snapshot, downloadName) {
|
|
130
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
131
|
+
var docManager, viewerRuntime, html;
|
|
132
|
+
return __generator(this, function (_a) {
|
|
133
|
+
switch (_a.label) {
|
|
134
|
+
case 0:
|
|
135
|
+
docManager = AcApDocManager.instance;
|
|
136
|
+
docManager.showBusyIndicator();
|
|
137
|
+
_a.label = 1;
|
|
138
|
+
case 1:
|
|
139
|
+
_a.trys.push([1, , 6, 7]);
|
|
140
|
+
return [4 /*yield*/, yieldToMain()];
|
|
141
|
+
case 2:
|
|
142
|
+
_a.sent();
|
|
143
|
+
return [4 /*yield*/, this.loadViewerRuntime(docManager.htmlViewerRuntimeUrl)];
|
|
144
|
+
case 3:
|
|
145
|
+
viewerRuntime = _a.sent();
|
|
146
|
+
return [4 /*yield*/, yieldToMain()];
|
|
147
|
+
case 4:
|
|
148
|
+
_a.sent();
|
|
149
|
+
html = packHtml(snapshot, {
|
|
150
|
+
title: snapshot.meta.title,
|
|
151
|
+
viewerRuntime: viewerRuntime
|
|
152
|
+
});
|
|
153
|
+
return [4 /*yield*/, yieldToMain()];
|
|
154
|
+
case 5:
|
|
155
|
+
_a.sent();
|
|
156
|
+
this.downloadHtml(html, downloadName);
|
|
157
|
+
return [3 /*break*/, 7];
|
|
158
|
+
case 6:
|
|
159
|
+
docManager.hideBusyIndicator();
|
|
160
|
+
return [7 /*endfinally*/];
|
|
161
|
+
case 7: return [2 /*return*/];
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* Fetches the offline viewer runtime as source text for inlining.
|
|
168
|
+
*
|
|
169
|
+
* @param url - Absolute or relative URL of `viewer-runtime.iife.js`. When
|
|
170
|
+
* omitted, {@link DEFAULT_RUNTIME_URL} is used.
|
|
171
|
+
* @returns The runtime script body as a string.
|
|
172
|
+
* @throws If the HTTP response is not OK (missing build artifact, CORS, etc.).
|
|
173
|
+
*/
|
|
174
|
+
AcApHtmlConvertor.prototype.loadViewerRuntime = function (url) {
|
|
175
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
176
|
+
var runtimeUrl, response;
|
|
177
|
+
return __generator(this, function (_a) {
|
|
178
|
+
switch (_a.label) {
|
|
179
|
+
case 0:
|
|
180
|
+
runtimeUrl = url != null ? String(url) : DEFAULT_RUNTIME_URL;
|
|
181
|
+
return [4 /*yield*/, fetch(runtimeUrl)];
|
|
182
|
+
case 1:
|
|
183
|
+
response = _a.sent();
|
|
184
|
+
if (!response.ok) {
|
|
185
|
+
throw new Error("Failed to load HTML viewer runtime from \"".concat(runtimeUrl, "\" (").concat(response.status, "). ") +
|
|
186
|
+
'Build @mlightcad/cad-html-exporter and copy viewer-runtime.iife.js to your app assets.');
|
|
187
|
+
}
|
|
188
|
+
return [2 /*return*/, response.text()];
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* Derives the browser download file name from a drawing file name.
|
|
195
|
+
*
|
|
196
|
+
* @param fileName - Source drawing name (may include `.dwg` or `.dxf`).
|
|
197
|
+
* @returns Base name without drawing extension, plus `.html`.
|
|
198
|
+
*/
|
|
199
|
+
AcApHtmlConvertor.prototype.resolveDownloadName = function (fileName) {
|
|
200
|
+
var base = fileName.replace(/\.(dwg|dxf)$/i, '') || 'drawing';
|
|
201
|
+
return "".concat(base, ".html");
|
|
202
|
+
};
|
|
203
|
+
/**
|
|
204
|
+
* Triggers a client-side download of the generated HTML string.
|
|
205
|
+
*
|
|
206
|
+
* @param content - Full HTML document text.
|
|
207
|
+
* @param downloadName - Value for the anchor `download` attribute.
|
|
208
|
+
*/
|
|
209
|
+
AcApHtmlConvertor.prototype.downloadHtml = function (content, downloadName) {
|
|
210
|
+
var blob = new Blob([content], { type: 'text/html;charset=utf-8' });
|
|
211
|
+
var url = URL.createObjectURL(blob);
|
|
212
|
+
var link = document.createElement('a');
|
|
213
|
+
link.href = url;
|
|
214
|
+
link.download = downloadName;
|
|
215
|
+
document.body.appendChild(link);
|
|
216
|
+
link.click();
|
|
217
|
+
document.body.removeChild(link);
|
|
218
|
+
URL.revokeObjectURL(url);
|
|
219
|
+
};
|
|
220
|
+
return AcApHtmlConvertor;
|
|
221
|
+
}());
|
|
222
|
+
export { AcApHtmlConvertor };
|
|
223
|
+
//# sourceMappingURL=AcApHtmlConvertor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApHtmlConvertor.js","sourceRoot":"","sources":["../../../src/command/convert/AcApHtmlConvertor.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { type AcExSnapshotV1 } from '@mlightcad/cad-html-exporter';
|
|
2
|
+
import type { AcDbDatabase } from '@mlightcad/data-model';
|
|
3
|
+
import type { AcTrScene } from '../../view/AcTrScene';
|
|
4
|
+
/**
|
|
5
|
+
* Optional overrides applied when constructing an HTML export snapshot.
|
|
6
|
+
*/
|
|
7
|
+
export interface AcApHtmlSnapshotBuilderOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Human-readable drawing title stored in snapshot metadata and used as the
|
|
10
|
+
* HTML document title when not overridden by the packager.
|
|
11
|
+
*/
|
|
12
|
+
title?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Canvas background color as a 24-bit RGB integer (e.g. `0x000000`).
|
|
15
|
+
* Defaults to the value from {@link buildViewerMetadata} when omitted.
|
|
16
|
+
*/
|
|
17
|
+
background?: number;
|
|
18
|
+
/**
|
|
19
|
+
* UI locale embedded in the exported HTML for i18n (`en`, `zh`, etc.).
|
|
20
|
+
* Defaults to {@link AcApI18n.currentLocale} when omitted.
|
|
21
|
+
*/
|
|
22
|
+
locale?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Serializes the live Three.js scene into a versioned {@link AcExSnapshotV1}.
|
|
26
|
+
*
|
|
27
|
+
* The snapshot contains layer visibility, per-layout line/mesh batches, and
|
|
28
|
+
* viewer metadata (extents, units, background). It is display-only: no DXF/DWG
|
|
29
|
+
* entities or edit capability are preserved.
|
|
30
|
+
*/
|
|
31
|
+
export declare class AcApHtmlSnapshotBuilder {
|
|
32
|
+
/**
|
|
33
|
+
* Builds a snapshot synchronously in one pass.
|
|
34
|
+
*
|
|
35
|
+
* Prefer {@link buildAsync} for interactive export so the UI can stay responsive.
|
|
36
|
+
*
|
|
37
|
+
* @param scene - Current renderer scene (layouts, layers, active layout).
|
|
38
|
+
* @param database - Open drawing database used for layout names and metadata.
|
|
39
|
+
* @param options - Optional title, background, and locale overrides.
|
|
40
|
+
* @returns A complete v1 snapshot ready for `packHtml`.
|
|
41
|
+
*/
|
|
42
|
+
build(scene: AcTrScene, database: AcDbDatabase, options?: AcApHtmlSnapshotBuilderOptions): AcExSnapshotV1;
|
|
43
|
+
/**
|
|
44
|
+
* Builds a snapshot incrementally, yielding to the main thread between layouts.
|
|
45
|
+
*
|
|
46
|
+
* Geometry is collected per layout layer so a busy indicator can repaint
|
|
47
|
+
* during large drawings.
|
|
48
|
+
*
|
|
49
|
+
* @param scene - Current renderer scene (layouts, layers, active layout).
|
|
50
|
+
* @param database - Open drawing database used for layout names and metadata.
|
|
51
|
+
* @param options - Optional title, background, and locale overrides.
|
|
52
|
+
* @returns A complete v1 snapshot ready for `packHtml`.
|
|
53
|
+
*/
|
|
54
|
+
buildAsync(scene: AcTrScene, database: AcDbDatabase, options?: AcApHtmlSnapshotBuilderOptions): Promise<AcExSnapshotV1>;
|
|
55
|
+
/**
|
|
56
|
+
* Synchronous implementation shared by {@link build} and {@link buildAsync}.
|
|
57
|
+
*
|
|
58
|
+
* @param scene - Current renderer scene.
|
|
59
|
+
* @param database - Open drawing database.
|
|
60
|
+
* @param options - Snapshot overrides.
|
|
61
|
+
* @returns A complete v1 snapshot.
|
|
62
|
+
*/
|
|
63
|
+
private buildSync;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=AcApHtmlSnapshotBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApHtmlSnapshotBuilder.d.ts","sourceRoot":"","sources":["../../../src/command/convert/AcApHtmlSnapshotBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,cAAc,EAIpB,MAAM,8BAA8B,CAAA;AACrC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAIzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAErD;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;GAMG;AACH,qBAAa,uBAAuB;IAClC;;;;;;;;;OASG;IACH,KAAK,CACH,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,YAAY,EACtB,OAAO,GAAE,8BAAmC,GAC3C,cAAc;IAIjB;;;;;;;;;;OAUG;IACG,UAAU,CACd,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,YAAY,EACtB,OAAO,GAAE,8BAAmC,GAC3C,OAAO,CAAC,cAAc,CAAC;IA+C1B;;;;;;;OAOG;IACH,OAAO,CAAC,SAAS;CA0ClB"}
|