@mlightcad/cad-pdf-core 0.0.0-stage → 1.8.0-preview.0

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 mlightcad
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,3 +1,57 @@
1
- # Temporary Holding Version
1
+ # @mlightcad/cad-pdf-core
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Shared PDF export logic for MLightCAD: the export option model, the
4
+ MTEXT/SHAPE glyph provider, and the drawing database → PDF pipeline built on
5
+ `@mlightcad/pdf-renderer`.
6
+
7
+ > **1.8.0:** This package is new. PDF export was split out of the browser plugin
8
+ > so the same pipeline can run in the browser (`cad-pdf-plugin`) and in Node
9
+ > without a browser (`cad-pdf-exporter`). See the
10
+ > [upgrade guide](../../docs/development/upgrade-guide.md).
11
+
12
+ This package has **no** dependency on `@mlightcad/cad-simple-viewer` or the
13
+ DOM. Both consumers build on it:
14
+
15
+ - `@mlightcad/cad-pdf-plugin` — browser `cpdf` / `-cpdf` commands
16
+ - `@mlightcad/cad-pdf-exporter` — headless Node export, no browser
17
+
18
+ ## Options
19
+
20
+ | Option | Values | Default |
21
+ | --------------- | ------------------------- | ---------- |
22
+ | `modelSpaceFit` | `extents` / `display` | `extents` |
23
+ | `exportLayouts` | `true` / `false` | `true` |
24
+ | `textMode` | `text` / `vector` | `text` |
25
+ | `colorMode` | `color` / `monochrome` | `color` |
26
+
27
+ `colorMode: 'monochrome'` writes white paper with lines, hatch patterns,
28
+ points and text in black. Solid and gradient fill areas become grey by
29
+ luminance, so light fills stay light and linework drawn over them stays
30
+ readable (pure black fills would hide it). Wipeouts still mask in white;
31
+ raster images keep their pixels.
32
+
33
+ ## API
34
+
35
+ ```ts
36
+ import {
37
+ acexPdfExportDatabase,
38
+ acexPdfResolveExportOptions
39
+ } from '@mlightcad/cad-pdf-core'
40
+
41
+ const bytes = await acexPdfExportDatabase(database, {
42
+ ...acexPdfResolveExportOptions({ colorMode: 'monochrome' }),
43
+ title: 'drawing',
44
+ // Optional host services:
45
+ // displayBox, fontMapping, glyphProvider, textFontResolver
46
+ })
47
+ ```
48
+
49
+ The default glyph provider uses the `AcTrMTextRenderer` singleton from
50
+ `@mlightcad/three-renderer`. The host must initialize it before export.
51
+
52
+ ## Peers
53
+
54
+ - `@mlightcad/data-model`
55
+ - `@mlightcad/mtext-parser`
56
+ - `@mlightcad/pdf-renderer`
57
+ - `@mlightcad/three-renderer`
@@ -0,0 +1,229 @@
1
+ import { exportDatabaseToPdf as W } from "@mlightcad/pdf-renderer";
2
+ import { MTextColor as X } from "@mlightcad/mtext-parser";
3
+ import { AcTrMTextRenderer as R } from "@mlightcad/three-renderer";
4
+ const Y = Object.freeze({
5
+ modelSpaceFit: "extents",
6
+ exportLayouts: !0,
7
+ textMode: "text",
8
+ colorMode: "color"
9
+ });
10
+ function j(e = {}) {
11
+ return {
12
+ modelSpaceFit: e.modelSpaceFit === "display" ? "display" : "extents",
13
+ exportLayouts: e.exportLayouts !== !1,
14
+ textMode: e.textMode === "vector" ? "vector" : "text",
15
+ colorMode: e.colorMode === "monochrome" ? "monochrome" : "color"
16
+ };
17
+ }
18
+ function D() {
19
+ const e = {
20
+ triangles: new Float32Array(0),
21
+ polylines: new Float32Array(0)
22
+ }, n = { min: { x: 0, y: 0 }, max: { x: 0, y: 0 } };
23
+ return {
24
+ async renderMText(r, a, c) {
25
+ var p, d;
26
+ try {
27
+ const m = await R.getInstance().asyncRenderMText(
28
+ // AcGi and mtext-renderer attachment enums are structurally compatible
29
+ // at runtime but diverge in the TypeScript type graph.
30
+ { ...r, meshGlyphOutputMode: "merge" },
31
+ a,
32
+ _(c)
33
+ ), h = r.contents || r.text || "", { primitives: b, colorGroups: F, box: O } = k(
34
+ m,
35
+ ((p = r.position) == null ? void 0 : p.x) ?? 0,
36
+ ((d = r.position) == null ? void 0 : d.y) ?? 0
37
+ );
38
+ return { primitives: b, colorGroups: F, actualText: h, box: O };
39
+ } catch (x) {
40
+ const m = r.contents || r.text || "";
41
+ return console.warn(
42
+ "[cad-pdf-core] MTEXT glyph render failed; vector geometry omitted",
43
+ x instanceof Error ? x.message : x
44
+ ), { primitives: e, actualText: m, box: n };
45
+ }
46
+ },
47
+ async renderShape(r, a) {
48
+ var c, p;
49
+ try {
50
+ const x = await R.getInstance().asyncRenderShape(
51
+ r,
52
+ a ?? {}
53
+ ), { primitives: m, box: h } = k(
54
+ x,
55
+ ((c = r.position) == null ? void 0 : c.x) ?? 0,
56
+ ((p = r.position) == null ? void 0 : p.y) ?? 0
57
+ );
58
+ return { primitives: m, box: h };
59
+ } catch (d) {
60
+ return console.warn(
61
+ "[cad-pdf-core] SHAPE glyph render failed; vector geometry omitted",
62
+ d instanceof Error ? d.message : d
63
+ ), { primitives: e, box: n };
64
+ }
65
+ }
66
+ };
67
+ }
68
+ function _(e) {
69
+ if (!e)
70
+ return;
71
+ const n = new X();
72
+ return e.entityIsByLayer ? n.aci = 256 : e.entityIsByBlock ? n.aci = 0 : e.entityIsForeground ? n.aci = 7 : typeof e.entityAci == "number" ? n.aci = e.entityAci : typeof e.entityRgb == "number" ? n.rgbValue = e.entityRgb : n.aci = 7, {
73
+ color: n,
74
+ byLayerColor: e.byLayerColor,
75
+ byBlockColor: e.byBlockColor,
76
+ layer: e.layer
77
+ };
78
+ }
79
+ function k(e, n, r) {
80
+ var B;
81
+ (B = e.updateMatrixWorld) == null || B.call(e, !0);
82
+ const a = [], c = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
83
+ e.traverse((t) => {
84
+ var v, y;
85
+ const o = t.geometry;
86
+ if (!o)
87
+ return;
88
+ const s = o.getAttribute("position");
89
+ if (!s || s.count < 1)
90
+ return;
91
+ const f = z(t) ?? 16777215;
92
+ if (t.isMesh) {
93
+ const i = o.getIndex(), l = i ? i.count / 3 : Math.floor(s.count / 3);
94
+ if (l < 1)
95
+ return;
96
+ a.push({
97
+ elements: (v = t.matrixWorld) == null ? void 0 : v.elements,
98
+ pos: s,
99
+ index: i,
100
+ isMesh: !0,
101
+ isSegments: !1,
102
+ rgb: f
103
+ }), c.set(
104
+ f,
105
+ (c.get(f) ?? 0) + l * 6
106
+ );
107
+ return;
108
+ }
109
+ if (t.isLine) {
110
+ const i = !!t.isLineSegments;
111
+ a.push({
112
+ elements: (y = t.matrixWorld) == null ? void 0 : y.elements,
113
+ pos: s,
114
+ index: null,
115
+ isMesh: !1,
116
+ isSegments: i,
117
+ rgb: f
118
+ });
119
+ const l = i ? Math.floor(s.count / 2) * 5 : s.count * 2 + 1;
120
+ p.set(f, (p.get(f) ?? 0) + l);
121
+ }
122
+ });
123
+ const d = [
124
+ .../* @__PURE__ */ new Set([...c.keys(), ...p.keys()])
125
+ ], x = /* @__PURE__ */ new Map();
126
+ for (const t of d)
127
+ x.set(t, {
128
+ triangles: new Float32Array(c.get(t) ?? 0),
129
+ polylines: new Float32Array(p.get(t) ?? 0),
130
+ triOffset: 0,
131
+ lineOffset: 0
132
+ });
133
+ let m = 1 / 0, h = 1 / 0, b = -1 / 0, F = -1 / 0;
134
+ const O = (t, o) => {
135
+ t < m && (m = t), o < h && (h = o), t > b && (b = t), o > F && (F = o);
136
+ };
137
+ for (const t of a) {
138
+ const o = x.get(t.rgb);
139
+ if (!o) continue;
140
+ const s = t.elements, f = t.pos, v = (y) => {
141
+ const i = f.getX(y), l = f.getY(y);
142
+ if (!s)
143
+ return { x: i, y: l };
144
+ const u = f.getZ(y), g = s[3] * i + s[7] * l + s[11] * u + s[15], M = g === 0 ? 1 : 1 / g;
145
+ return {
146
+ x: (s[0] * i + s[4] * l + s[8] * u + s[12]) * M,
147
+ y: (s[1] * i + s[5] * l + s[9] * u + s[13]) * M
148
+ };
149
+ };
150
+ if (t.isMesh) {
151
+ const y = t.index ? t.index.count / 3 : Math.floor(f.count / 3);
152
+ for (let i = 0; i < y; i++)
153
+ for (let l = 0; l < 3; l++) {
154
+ const u = t.index ? t.index.getX(i * 3 + l) : i * 3 + l, g = v(u), M = g.x - n, C = g.y - r;
155
+ o.triangles[o.triOffset++] = M, o.triangles[o.triOffset++] = C, O(M, C);
156
+ }
157
+ } else if (t.isSegments) {
158
+ const y = Math.floor(f.count / 2);
159
+ for (let i = 0; i < y; i++) {
160
+ o.polylines[o.lineOffset++] = 2;
161
+ for (let l = 0; l < 2; l++) {
162
+ const u = v(i * 2 + l), g = u.x - n, M = u.y - r;
163
+ o.polylines[o.lineOffset++] = g, o.polylines[o.lineOffset++] = M, O(g, M);
164
+ }
165
+ }
166
+ } else {
167
+ o.polylines[o.lineOffset++] = f.count;
168
+ for (let y = 0; y < f.count; y++) {
169
+ const i = v(y), l = i.x - n, u = i.y - r;
170
+ o.polylines[o.lineOffset++] = l, o.polylines[o.lineOffset++] = u, O(l, u);
171
+ }
172
+ }
173
+ }
174
+ const w = [];
175
+ let S = 0, T = 0;
176
+ for (const [t, o] of x) {
177
+ const s = {
178
+ triangles: o.triangles,
179
+ polylines: o.polylines
180
+ };
181
+ (s.triangles.length >= 6 || s.polylines.length >= 2) && w.push({ rgb: t, primitives: s }), S += o.triangles.length, T += o.polylines.length;
182
+ }
183
+ const A = new Float32Array(S), I = new Float32Array(T);
184
+ let L = 0, P = 0;
185
+ for (const t of w)
186
+ A.set(t.primitives.triangles, L), L += t.primitives.triangles.length, I.set(t.primitives.polylines, P), P += t.primitives.polylines.length;
187
+ const E = { triangles: A, polylines: I }, G = Number.isFinite(m) ? { min: { x: m, y: h }, max: { x: b, y: F } } : { min: { x: 0, y: 0 }, max: { x: 0, y: 0 } };
188
+ return {
189
+ primitives: E,
190
+ // Always surface groups when present so a lone `\C256` green run is not
191
+ // painted with the entity fill (often ACI 7 white).
192
+ colorGroups: w.length > 0 ? w : void 0,
193
+ box: G
194
+ };
195
+ }
196
+ function z(e) {
197
+ var c, p;
198
+ const n = e.material;
199
+ if (!n)
200
+ return;
201
+ const r = Array.isArray(n) ? n[0] : n, a = (p = (c = r == null ? void 0 : r.color) == null ? void 0 : c.getHex) == null ? void 0 : p.call(c);
202
+ return typeof a == "number" ? a : void 0;
203
+ }
204
+ function H(e, n = {}) {
205
+ const r = j(n), a = {
206
+ title: n.title,
207
+ ltscale: e.ltscale,
208
+ celtscale: e.celtscale,
209
+ showLineWeight: !!e.lwdisplay,
210
+ fontMapping: n.fontMapping,
211
+ background: "none",
212
+ fit: r.modelSpaceFit === "display" ? "current" : "extents",
213
+ layouts: r.exportLayouts ? "all" : "current",
214
+ glyphProvider: n.glyphProvider ?? D(),
215
+ textMode: r.textMode,
216
+ colorMode: r.colorMode
217
+ };
218
+ return r.textMode === "text" && n.textFontResolver && (a.textFontResolver = n.textFontResolver), r.modelSpaceFit === "display" && n.displayBox && (e.currentSpaceId === e.tables.blockTable.modelSpace.objectId || !r.exportLayouts) && (a.fitBox = n.displayBox), a;
219
+ }
220
+ async function Z(e, n = {}) {
221
+ return W(e, H(e, n));
222
+ }
223
+ export {
224
+ Y as ACEXPDF_DEFAULT_EXPORT_OPTIONS,
225
+ H as acexPdfBuildRendererOptions,
226
+ D as acexPdfCreateGlyphProvider,
227
+ Z as acexPdfExportDatabase,
228
+ j as acexPdfResolveExportOptions
229
+ };
@@ -0,0 +1 @@
1
+ (function(y,O){typeof exports=="object"&&typeof module<"u"?O(exports,require("@mlightcad/pdf-renderer"),require("@mlightcad/mtext-parser"),require("@mlightcad/three-renderer")):typeof define=="function"&&define.amd?define(["exports","@mlightcad/pdf-renderer","@mlightcad/mtext-parser","@mlightcad/three-renderer"],O):(y=typeof globalThis<"u"?globalThis:y||self,O(y["cad-pdf-core"]={},y.pdfRenderer,y.mtextParser,y.threeRenderer))})(this,(function(y,O,_,w){"use strict";const W=Object.freeze({modelSpaceFit:"extents",exportLayouts:!0,textMode:"text",colorMode:"color"});function A(e={}){return{modelSpaceFit:e.modelSpaceFit==="display"?"display":"extents",exportLayouts:e.exportLayouts!==!1,textMode:e.textMode==="vector"?"vector":"text",colorMode:e.colorMode==="monochrome"?"monochrome":"color"}}function R(){const e={triangles:new Float32Array(0),polylines:new Float32Array(0)},n={min:{x:0,y:0},max:{x:0,y:0}};return{async renderMText(r,a,c){var d,g;try{const m=await w.AcTrMTextRenderer.getInstance().asyncRenderMText({...r,meshGlyphOutputMode:"merge"},a,q(c)),v=r.contents||r.text||"",{primitives:T,colorGroups:P,box:F}=C(m,((d=r.position)==null?void 0:d.x)??0,((g=r.position)==null?void 0:g.y)??0);return{primitives:T,colorGroups:P,actualText:v,box:F}}catch(x){const m=r.contents||r.text||"";return console.warn("[cad-pdf-core] MTEXT glyph render failed; vector geometry omitted",x instanceof Error?x.message:x),{primitives:e,actualText:m,box:n}}},async renderShape(r,a){var c,d;try{const x=await w.AcTrMTextRenderer.getInstance().asyncRenderShape(r,a??{}),{primitives:m,box:v}=C(x,((c=r.position)==null?void 0:c.x)??0,((d=r.position)==null?void 0:d.y)??0);return{primitives:m,box:v}}catch(g){return console.warn("[cad-pdf-core] SHAPE glyph render failed; vector geometry omitted",g instanceof Error?g.message:g),{primitives:e,box:n}}}}}function q(e){if(!e)return;const n=new _.MTextColor;return e.entityIsByLayer?n.aci=256:e.entityIsByBlock?n.aci=0:e.entityIsForeground?n.aci=7:typeof e.entityAci=="number"?n.aci=e.entityAci:typeof e.entityRgb=="number"?n.rgbValue=e.entityRgb:n.aci=7,{color:n,byLayerColor:e.byLayerColor,byBlockColor:e.byBlockColor,layer:e.layer}}function C(e,n,r){var X;(X=e.updateMatrixWorld)==null||X.call(e,!0);const a=[],c=new Map,d=new Map;e.traverse(t=>{var b,p;const o=t.geometry;if(!o)return;const i=o.getAttribute("position");if(!i||i.count<1)return;const f=N(t)??16777215;if(t.isMesh){const s=o.getIndex(),l=s?s.count/3:Math.floor(i.count/3);if(l<1)return;a.push({elements:(b=t.matrixWorld)==null?void 0:b.elements,pos:i,index:s,isMesh:!0,isSegments:!1,rgb:f}),c.set(f,(c.get(f)??0)+l*6);return}if(t.isLine){const s=!!t.isLineSegments;a.push({elements:(p=t.matrixWorld)==null?void 0:p.elements,pos:i,index:null,isMesh:!1,isSegments:s,rgb:f});const l=s?Math.floor(i.count/2)*5:i.count*2+1;d.set(f,(d.get(f)??0)+l)}});const g=[...new Set([...c.keys(),...d.keys()])],x=new Map;for(const t of g)x.set(t,{triangles:new Float32Array(c.get(t)??0),polylines:new Float32Array(d.get(t)??0),triOffset:0,lineOffset:0});let m=1/0,v=1/0,T=-1/0,P=-1/0;const F=(t,o)=>{t<m&&(m=t),o<v&&(v=o),t>T&&(T=t),o>P&&(P=o)};for(const t of a){const o=x.get(t.rgb);if(!o)continue;const i=t.elements,f=t.pos,b=p=>{const s=f.getX(p),l=f.getY(p);if(!i)return{x:s,y:l};const u=f.getZ(p),h=i[3]*s+i[7]*l+i[11]*u+i[15],M=h===0?1:1/h;return{x:(i[0]*s+i[4]*l+i[8]*u+i[12])*M,y:(i[1]*s+i[5]*l+i[9]*u+i[13])*M}};if(t.isMesh){const p=t.index?t.index.count/3:Math.floor(f.count/3);for(let s=0;s<p;s++)for(let l=0;l<3;l++){const u=t.index?t.index.getX(s*3+l):s*3+l,h=b(u),M=h.x-n,j=h.y-r;o.triangles[o.triOffset++]=M,o.triangles[o.triOffset++]=j,F(M,j)}}else if(t.isSegments){const p=Math.floor(f.count/2);for(let s=0;s<p;s++){o.polylines[o.lineOffset++]=2;for(let l=0;l<2;l++){const u=b(s*2+l),h=u.x-n,M=u.y-r;o.polylines[o.lineOffset++]=h,o.polylines[o.lineOffset++]=M,F(h,M)}}}else{o.polylines[o.lineOffset++]=f.count;for(let p=0;p<f.count;p++){const s=b(p),l=s.x-n,u=s.y-r;o.polylines[o.lineOffset++]=l,o.polylines[o.lineOffset++]=u,F(l,u)}}}const S=[];let I=0,L=0;for(const[t,o]of x){const i={triangles:o.triangles,polylines:o.polylines};(i.triangles.length>=6||i.polylines.length>=2)&&S.push({rgb:t,primitives:i}),I+=o.triangles.length,L+=o.polylines.length}const B=new Float32Array(I),k=new Float32Array(L);let D=0,G=0;for(const t of S)B.set(t.primitives.triangles,D),D+=t.primitives.triangles.length,k.set(t.primitives.polylines,G),G+=t.primitives.polylines.length;const H={triangles:B,polylines:k},U=Number.isFinite(m)?{min:{x:m,y:v},max:{x:T,y:P}}:{min:{x:0,y:0},max:{x:0,y:0}};return{primitives:H,colorGroups:S.length>0?S:void 0,box:U}}function N(e){var c,d;const n=e.material;if(!n)return;const r=Array.isArray(n)?n[0]:n,a=(d=(c=r==null?void 0:r.color)==null?void 0:c.getHex)==null?void 0:d.call(c);return typeof a=="number"?a:void 0}function E(e,n={}){const r=A(n),a={title:n.title,ltscale:e.ltscale,celtscale:e.celtscale,showLineWeight:!!e.lwdisplay,fontMapping:n.fontMapping,background:"none",fit:r.modelSpaceFit==="display"?"current":"extents",layouts:r.exportLayouts?"all":"current",glyphProvider:n.glyphProvider??R(),textMode:r.textMode,colorMode:r.colorMode};return r.textMode==="text"&&n.textFontResolver&&(a.textFontResolver=n.textFontResolver),r.modelSpaceFit==="display"&&n.displayBox&&(e.currentSpaceId===e.tables.blockTable.modelSpace.objectId||!r.exportLayouts)&&(a.fitBox=n.displayBox),a}async function z(e,n={}){return O.exportDatabaseToPdf(e,E(e,n))}y.ACEXPDF_DEFAULT_EXPORT_OPTIONS=W,y.acexPdfBuildRendererOptions=E,y.acexPdfCreateGlyphProvider=R,y.acexPdfExportDatabase=z,y.acexPdfResolveExportOptions=A,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"})}));
@@ -0,0 +1,66 @@
1
+ import type { AcDbDatabase, AcGiFontMapping } from '@mlightcad/data-model';
2
+ import { type AcPdfExportOptions, type AcPdfGlyphProvider, type AcPdfTextFontResolver } from '@mlightcad/pdf-renderer';
3
+ import { type AcExPdfExportOptions } from './AcExPdfExportOptions';
4
+ /** Axis-aligned WCS box used to frame a model-space page. */
5
+ export interface AcExPdfFitBox {
6
+ min: {
7
+ x: number;
8
+ y: number;
9
+ };
10
+ max: {
11
+ x: number;
12
+ y: number;
13
+ };
14
+ }
15
+ /**
16
+ * Inputs for {@link acexPdfExportDatabase}: the user options plus the
17
+ * host-provided services that differ between the browser and Node.
18
+ */
19
+ export interface AcExPdfDatabaseExportOptions extends AcExPdfExportOptions {
20
+ /** PDF document title. */
21
+ title?: string;
22
+ /** Font name substitutions passed to the glyph engine. */
23
+ fontMapping?: AcGiFontMapping;
24
+ /**
25
+ * Visible WCS box for {@link AcExPdfExportOptions.modelSpaceFit} `'display'`.
26
+ * Ignored for `'extents'`. When omitted, `'display'` behaves like
27
+ * `'extents'` (headless hosts have no live view).
28
+ */
29
+ displayBox?: AcExPdfFitBox;
30
+ /**
31
+ * MTEXT/SHAPE glyph engine. Defaults to {@link acexPdfCreateGlyphProvider},
32
+ * which requires an initialized `AcTrMTextRenderer`.
33
+ */
34
+ glyphProvider?: AcPdfGlyphProvider;
35
+ /**
36
+ * Resolves embeddable font programs for {@link AcExPdfExportOptions.textMode}
37
+ * `'text'`. Without it, every text paints as vector glyphs.
38
+ */
39
+ textFontResolver?: AcPdfTextFontResolver;
40
+ }
41
+ /**
42
+ * Builds the low-level `pdf-renderer` options for a drawing.
43
+ *
44
+ * Stroke widths follow the drawing `LWDISPLAY` flag: on uses object
45
+ * lineweights, off emits true PDF hairlines. Linetype scales come from the
46
+ * database.
47
+ *
48
+ * @param db - Drawing to export
49
+ * @param options - User options and host services
50
+ * @returns Options for `exportDatabaseToPdf`
51
+ */
52
+ export declare function acexPdfBuildRendererOptions(db: AcDbDatabase, options?: AcExPdfDatabaseExportOptions): AcPdfExportOptions;
53
+ /**
54
+ * Renders a drawing database to vector PDF bytes.
55
+ *
56
+ * Shared by the browser plugin (`cpdf` / `-cpdf`) and the headless
57
+ * `cad-pdf-exporter`. Framing matches HTML export: `'extents'` fits drawable
58
+ * geometry; `'display'` uses {@link AcExPdfDatabaseExportOptions.displayBox}.
59
+ * Paper-space pages ignore model-space fit and use their own extents.
60
+ *
61
+ * @param db - Drawing to export
62
+ * @param options - User options and host services
63
+ * @returns PDF file bytes
64
+ */
65
+ export declare function acexPdfExportDatabase(db: AcDbDatabase, options?: AcExPdfDatabaseExportOptions): Promise<Uint8Array>;
66
+ //# sourceMappingURL=AcExPdfDatabaseExport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcExPdfDatabaseExport.d.ts","sourceRoot":"","sources":["../src/AcExPdfDatabaseExport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC1E,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAE3B,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,wBAAwB,CAAA;AAG/B,6DAA6D;AAC7D,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAC7B,GAAG,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,4BAA6B,SAAQ,oBAAoB;IACxE,0BAA0B;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,0DAA0D;IAC1D,WAAW,CAAC,EAAE,eAAe,CAAA;IAC7B;;;;OAIG;IACH,UAAU,CAAC,EAAE,aAAa,CAAA;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,kBAAkB,CAAA;IAClC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,qBAAqB,CAAA;CACzC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CACzC,EAAE,EAAE,YAAY,EAChB,OAAO,GAAE,4BAAiC,GACzC,kBAAkB,CAgCpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,qBAAqB,CACzC,EAAE,EAAE,YAAY,EAChB,OAAO,GAAE,4BAAiC,GACzC,OAAO,CAAC,UAAU,CAAC,CAErB"}
@@ -0,0 +1,104 @@
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 { exportDatabaseToPdf } from '@mlightcad/pdf-renderer';
38
+ import { acexPdfResolveExportOptions } from './AcExPdfExportOptions';
39
+ import { acexPdfCreateGlyphProvider } from './AcExPdfGlyphProvider';
40
+ /**
41
+ * Builds the low-level `pdf-renderer` options for a drawing.
42
+ *
43
+ * Stroke widths follow the drawing `LWDISPLAY` flag: on uses object
44
+ * lineweights, off emits true PDF hairlines. Linetype scales come from the
45
+ * database.
46
+ *
47
+ * @param db - Drawing to export
48
+ * @param options - User options and host services
49
+ * @returns Options for `exportDatabaseToPdf`
50
+ */
51
+ export function acexPdfBuildRendererOptions(db, options) {
52
+ var _a;
53
+ if (options === void 0) { options = {}; }
54
+ var resolved = acexPdfResolveExportOptions(options);
55
+ var pdfOptions = {
56
+ title: options.title,
57
+ ltscale: db.ltscale,
58
+ celtscale: db.celtscale,
59
+ showLineWeight: !!db.lwdisplay,
60
+ fontMapping: options.fontMapping,
61
+ background: 'none',
62
+ fit: resolved.modelSpaceFit === 'display' ? 'current' : 'extents',
63
+ layouts: resolved.exportLayouts ? 'all' : 'current',
64
+ glyphProvider: (_a = options.glyphProvider) !== null && _a !== void 0 ? _a : acexPdfCreateGlyphProvider(),
65
+ textMode: resolved.textMode,
66
+ colorMode: resolved.colorMode
67
+ };
68
+ if (resolved.textMode === 'text' && options.textFontResolver) {
69
+ pdfOptions.textFontResolver = options.textFontResolver;
70
+ }
71
+ if (resolved.modelSpaceFit === 'display' && options.displayBox) {
72
+ // Display framing must use coordinates from the space being framed.
73
+ // When exporting all layouts from paper space, the active camera is in
74
+ // paper WCS — applying that box to the model-space page would be wrong.
75
+ // In that case omit fitBox so the model page falls back to extents;
76
+ // paper pages already ignore model-space fitBox in exportAllLayouts.
77
+ var inModelSpace = db.currentSpaceId === db.tables.blockTable.modelSpace.objectId;
78
+ if (inModelSpace || !resolved.exportLayouts) {
79
+ pdfOptions.fitBox = options.displayBox;
80
+ }
81
+ }
82
+ return pdfOptions;
83
+ }
84
+ /**
85
+ * Renders a drawing database to vector PDF bytes.
86
+ *
87
+ * Shared by the browser plugin (`cpdf` / `-cpdf`) and the headless
88
+ * `cad-pdf-exporter`. Framing matches HTML export: `'extents'` fits drawable
89
+ * geometry; `'display'` uses {@link AcExPdfDatabaseExportOptions.displayBox}.
90
+ * Paper-space pages ignore model-space fit and use their own extents.
91
+ *
92
+ * @param db - Drawing to export
93
+ * @param options - User options and host services
94
+ * @returns PDF file bytes
95
+ */
96
+ export function acexPdfExportDatabase(db_1) {
97
+ return __awaiter(this, arguments, void 0, function (db, options) {
98
+ if (options === void 0) { options = {}; }
99
+ return __generator(this, function (_a) {
100
+ return [2 /*return*/, exportDatabaseToPdf(db, acexPdfBuildRendererOptions(db, options))];
101
+ });
102
+ });
103
+ }
104
+ //# sourceMappingURL=AcExPdfDatabaseExport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcExPdfDatabaseExport.js","sourceRoot":"","sources":["../src/AcExPdfDatabaseExport.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAIL,mBAAmB,EACpB,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAEL,2BAA2B,EAC5B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAA;AAmCnE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,2BAA2B,CACzC,EAAgB,EAChB,OAA0C;;IAA1C,wBAAA,EAAA,YAA0C;IAE1C,IAAM,QAAQ,GAAG,2BAA2B,CAAC,OAAO,CAAC,CAAA;IACrD,IAAM,UAAU,GAAuB;QACrC,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,OAAO,EAAE,EAAE,CAAC,OAAO;QACnB,SAAS,EAAE,EAAE,CAAC,SAAS;QACvB,cAAc,EAAE,CAAC,CAAC,EAAE,CAAC,SAAS;QAC9B,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,UAAU,EAAE,MAAM;QAClB,GAAG,EAAE,QAAQ,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;QACjE,OAAO,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;QACnD,aAAa,EAAE,MAAA,OAAO,CAAC,aAAa,mCAAI,0BAA0B,EAAE;QACpE,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,SAAS,EAAE,QAAQ,CAAC,SAAS;KAC9B,CAAA;IACD,IAAI,QAAQ,CAAC,QAAQ,KAAK,MAAM,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;QAC7D,UAAU,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAA;IACxD,CAAC;IAED,IAAI,QAAQ,CAAC,aAAa,KAAK,SAAS,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;QAC/D,oEAAoE;QACpE,uEAAuE;QACvE,wEAAwE;QACxE,oEAAoE;QACpE,qEAAqE;QACrE,IAAM,YAAY,GAChB,EAAE,CAAC,cAAc,KAAK,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAA;QAChE,IAAI,YAAY,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC;YAC5C,UAAU,CAAC,MAAM,GAAG,OAAO,CAAC,UAAU,CAAA;QACxC,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAA;AACnB,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAgB,qBAAqB;wDACzC,EAAgB,EAChB,OAA0C;QAA1C,wBAAA,EAAA,YAA0C;;YAE1C,sBAAO,mBAAmB,CAAC,EAAE,EAAE,2BAA2B,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,EAAA;;;CACzE"}
@@ -0,0 +1,60 @@
1
+ import type { AcPdfColorMode } from '@mlightcad/pdf-renderer';
2
+ /**
3
+ * Model-space page framing for PDF export.
4
+ *
5
+ * - `display` — fit the live viewport (on-screen view). Needs a host view;
6
+ * headless exporters fall back to `extents`.
7
+ * - `extents` — fit drawable geometry in the current space.
8
+ */
9
+ export type AcExPdfModelSpaceFit = 'display' | 'extents';
10
+ /**
11
+ * How MTEXT/TEXT are painted in the PDF.
12
+ *
13
+ * - `'text'`: real PDF text through embedded (subset) fonts — selectable,
14
+ * searchable and small. SHX or non-embeddable fonts fall back to vectors.
15
+ * - `'vector'`: glyphs tessellated into line/fill geometry.
16
+ */
17
+ export type AcExPdfTextMode = 'vector' | 'text';
18
+ /**
19
+ * Colour treatment of the exported PDF.
20
+ *
21
+ * - `'color'`: keep entity colours (current behaviour).
22
+ * - `'monochrome'`: white paper; linework and text in black, solid fill
23
+ * areas in grey by luminance.
24
+ */
25
+ export type AcExPdfColorMode = AcPdfColorMode;
26
+ /**
27
+ * User-configurable PDF export options shared by the `cpdf` dialog, the
28
+ * `-cpdf` command, the headless exporter and the API.
29
+ */
30
+ export interface AcExPdfExportOptions {
31
+ /**
32
+ * How to frame model-space pages. Defaults to `'extents'`.
33
+ * Paper-space pages always use their own drawable extents / paper size.
34
+ */
35
+ modelSpaceFit?: AcExPdfModelSpaceFit;
36
+ /**
37
+ * When `true`, every layout (model + paper space) becomes a PDF page.
38
+ * When `false`, only the current space is exported. Defaults to `true`.
39
+ */
40
+ exportLayouts?: boolean;
41
+ /** How MTEXT/TEXT are painted. Defaults to `'text'`. */
42
+ textMode?: AcExPdfTextMode;
43
+ /**
44
+ * Colour treatment. `'color'` (default) keeps entity colours;
45
+ * `'monochrome'` exports black linework and text (grey fills) on white
46
+ * paper.
47
+ */
48
+ colorMode?: AcExPdfColorMode;
49
+ }
50
+ /** Default PDF export options. */
51
+ export declare const ACEXPDF_DEFAULT_EXPORT_OPTIONS: Readonly<Required<AcExPdfExportOptions>>;
52
+ /**
53
+ * Resolves PDF export options with package defaults. Unknown values fall back
54
+ * to the defaults so callers can pass loosely typed input (CLI flags, JSON).
55
+ *
56
+ * @param options - Partial options
57
+ * @returns Fully populated options
58
+ */
59
+ export declare function acexPdfResolveExportOptions(options?: AcExPdfExportOptions): Required<AcExPdfExportOptions>;
60
+ //# sourceMappingURL=AcExPdfExportOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcExPdfExportOptions.d.ts","sourceRoot":"","sources":["../src/AcExPdfExportOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAE7D;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,SAAS,CAAA;AAExD;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,MAAM,CAAA;AAE/C;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAA;AAE7C;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,aAAa,CAAC,EAAE,oBAAoB,CAAA;IACpC;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,eAAe,CAAA;IAC1B;;;;OAIG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAA;CAC7B;AAED,kCAAkC;AAClC,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CACnD,QAAQ,CAAC,oBAAoB,CAAC,CAM9B,CAAA;AAEF;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,GAAE,oBAAyB,GACjC,QAAQ,CAAC,oBAAoB,CAAC,CAOhC"}
@@ -0,0 +1,24 @@
1
+ /** Default PDF export options. */
2
+ export var ACEXPDF_DEFAULT_EXPORT_OPTIONS = Object.freeze({
3
+ modelSpaceFit: 'extents',
4
+ exportLayouts: true,
5
+ textMode: 'text',
6
+ colorMode: 'color'
7
+ });
8
+ /**
9
+ * Resolves PDF export options with package defaults. Unknown values fall back
10
+ * to the defaults so callers can pass loosely typed input (CLI flags, JSON).
11
+ *
12
+ * @param options - Partial options
13
+ * @returns Fully populated options
14
+ */
15
+ export function acexPdfResolveExportOptions(options) {
16
+ if (options === void 0) { options = {}; }
17
+ return {
18
+ modelSpaceFit: options.modelSpaceFit === 'display' ? 'display' : 'extents',
19
+ exportLayouts: options.exportLayouts !== false,
20
+ textMode: options.textMode === 'vector' ? 'vector' : 'text',
21
+ colorMode: options.colorMode === 'monochrome' ? 'monochrome' : 'color'
22
+ };
23
+ }
24
+ //# sourceMappingURL=AcExPdfExportOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcExPdfExportOptions.js","sourceRoot":"","sources":["../src/AcExPdfExportOptions.ts"],"names":[],"mappings":"AAsDA,kCAAkC;AAClC,MAAM,CAAC,IAAM,8BAA8B,GAEvC,MAAM,CAAC,MAAM,CAAC;IAChB,aAAa,EAAE,SAAS;IACxB,aAAa,EAAE,IAAI;IACnB,QAAQ,EAAE,MAAM;IAChB,SAAS,EAAE,OAAO;CACnB,CAAC,CAAA;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,2BAA2B,CACzC,OAAkC;IAAlC,wBAAA,EAAA,YAAkC;IAElC,OAAO;QACL,aAAa,EAAE,OAAO,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;QAC1E,aAAa,EAAE,OAAO,CAAC,aAAa,KAAK,KAAK;QAC9C,QAAQ,EAAE,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM;QAC3D,SAAS,EAAE,OAAO,CAAC,SAAS,KAAK,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO;KACvE,CAAA;AACH,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { AcPdfGlyphProvider } from '@mlightcad/pdf-renderer';
2
+ /**
3
+ * Turns the already-initialized {@link AcTrMTextRenderer} singleton into PDF
4
+ * glyph geometry so TEXT/MTEXT are not dropped during export.
5
+ *
6
+ * The host owns renderer setup: the browser viewer initializes it at startup,
7
+ * and headless exporters run it in `'main'` mode with a Node font loader.
8
+ *
9
+ * Geometry is emitted as flat float32 buffers relative to the text's own
10
+ * insertion point. Large drawings carry tens of thousands of MTEXT instances;
11
+ * the previous per-triangle object graphs (`{x, y}` points inside
12
+ * per-primitive arrays) retained ~25 objects per triangle in the renderer's
13
+ * glyph cache and exhausted the tab's heap. Buffers are shared by reference
14
+ * across identical texts, so a drawing's unique text content costs ~24 bytes
15
+ * per triangle.
16
+ */
17
+ export declare function acexPdfCreateGlyphProvider(): AcPdfGlyphProvider;
18
+ //# sourceMappingURL=AcExPdfGlyphProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcExPdfGlyphProvider.d.ts","sourceRoot":"","sources":["../src/AcExPdfGlyphProvider.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAKV,kBAAkB,EACnB,MAAM,yBAAyB,CAAA;AA+BhC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,0BAA0B,IAAI,kBAAkB,CAqE/D"}
@@ -0,0 +1,428 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ var __generator = (this && this.__generator) || function (thisArg, body) {
22
+ 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);
23
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
+ function verb(n) { return function (v) { return step([n, v]); }; }
25
+ function step(op) {
26
+ if (f) throw new TypeError("Generator is already executing.");
27
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
+ 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;
29
+ if (y = 0, t) op = [op[0] & 2, t.value];
30
+ switch (op[0]) {
31
+ case 0: case 1: t = op; break;
32
+ case 4: _.label++; return { value: op[1], done: false };
33
+ case 5: _.label++; y = op[1]; op = [0]; continue;
34
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
+ default:
36
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
+ if (t[2]) _.ops.pop();
41
+ _.trys.pop(); continue;
42
+ }
43
+ op = body.call(thisArg, _);
44
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
+ }
47
+ };
48
+ var __read = (this && this.__read) || function (o, n) {
49
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
50
+ if (!m) return o;
51
+ var i = m.call(o), r, ar = [], e;
52
+ try {
53
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
54
+ }
55
+ catch (error) { e = { error: error }; }
56
+ finally {
57
+ try {
58
+ if (r && !r.done && (m = i["return"])) m.call(i);
59
+ }
60
+ finally { if (e) throw e.error; }
61
+ }
62
+ return ar;
63
+ };
64
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
65
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
66
+ if (ar || !(i in from)) {
67
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
68
+ ar[i] = from[i];
69
+ }
70
+ }
71
+ return to.concat(ar || Array.prototype.slice.call(from));
72
+ };
73
+ var __values = (this && this.__values) || function(o) {
74
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
75
+ if (m) return m.call(o);
76
+ if (o && typeof o.length === "number") return {
77
+ next: function () {
78
+ if (o && i >= o.length) o = void 0;
79
+ return { value: o && o[i++], done: !o };
80
+ }
81
+ };
82
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
83
+ };
84
+ import { MTextColor } from '@mlightcad/mtext-parser';
85
+ import { AcTrMTextRenderer } from '@mlightcad/three-renderer';
86
+ /**
87
+ * Turns the already-initialized {@link AcTrMTextRenderer} singleton into PDF
88
+ * glyph geometry so TEXT/MTEXT are not dropped during export.
89
+ *
90
+ * The host owns renderer setup: the browser viewer initializes it at startup,
91
+ * and headless exporters run it in `'main'` mode with a Node font loader.
92
+ *
93
+ * Geometry is emitted as flat float32 buffers relative to the text's own
94
+ * insertion point. Large drawings carry tens of thousands of MTEXT instances;
95
+ * the previous per-triangle object graphs (`{x, y}` points inside
96
+ * per-primitive arrays) retained ~25 objects per triangle in the renderer's
97
+ * glyph cache and exhausted the tab's heap. Buffers are shared by reference
98
+ * across identical texts, so a drawing's unique text content costs ~24 bytes
99
+ * per triangle.
100
+ */
101
+ export function acexPdfCreateGlyphProvider() {
102
+ var empty = {
103
+ triangles: new Float32Array(0),
104
+ polylines: new Float32Array(0)
105
+ };
106
+ var emptyBox = { min: { x: 0, y: 0 }, max: { x: 0, y: 0 } };
107
+ return {
108
+ renderMText: function (data, style, colorSettings) {
109
+ return __awaiter(this, void 0, void 0, function () {
110
+ var renderer, object, contents, _a, primitives, colorGroups, box, error_1, contents;
111
+ var _b, _c, _d, _e;
112
+ return __generator(this, function (_f) {
113
+ switch (_f.label) {
114
+ case 0:
115
+ _f.trys.push([0, 2, , 3]);
116
+ renderer = AcTrMTextRenderer.getInstance();
117
+ return [4 /*yield*/, renderer.asyncRenderMText(
118
+ // AcGi and mtext-renderer attachment enums are structurally compatible
119
+ // at runtime but diverge in the TypeScript type graph.
120
+ __assign(__assign({}, data), { meshGlyphOutputMode: 'merge' }), style, toMTextColorSettings(colorSettings))];
121
+ case 1:
122
+ object = (_f.sent());
123
+ contents = data.contents ||
124
+ data.text ||
125
+ '';
126
+ _a = extractGlyphPrimitives(object, (_c = (_b = data.position) === null || _b === void 0 ? void 0 : _b.x) !== null && _c !== void 0 ? _c : 0, (_e = (_d = data.position) === null || _d === void 0 ? void 0 : _d.y) !== null && _e !== void 0 ? _e : 0), primitives = _a.primitives, colorGroups = _a.colorGroups, box = _a.box;
127
+ return [2 /*return*/, { primitives: primitives, colorGroups: colorGroups, actualText: contents, box: box }];
128
+ case 2:
129
+ error_1 = _f.sent();
130
+ contents = data.contents ||
131
+ data.text ||
132
+ '';
133
+ console.warn('[cad-pdf-core] MTEXT glyph render failed; vector geometry omitted', error_1 instanceof Error ? error_1.message : error_1);
134
+ return [2 /*return*/, { primitives: empty, actualText: contents, box: emptyBox }];
135
+ case 3: return [2 /*return*/];
136
+ }
137
+ });
138
+ });
139
+ },
140
+ renderShape: function (shape, style) {
141
+ return __awaiter(this, void 0, void 0, function () {
142
+ var renderer, object, _a, primitives, box, error_2;
143
+ var _b, _c, _d, _e;
144
+ return __generator(this, function (_f) {
145
+ switch (_f.label) {
146
+ case 0:
147
+ _f.trys.push([0, 2, , 3]);
148
+ renderer = AcTrMTextRenderer.getInstance();
149
+ return [4 /*yield*/, renderer.asyncRenderShape(shape, (style !== null && style !== void 0 ? style : {}))];
150
+ case 1:
151
+ object = (_f.sent());
152
+ _a = extractGlyphPrimitives(object, (_c = (_b = shape.position) === null || _b === void 0 ? void 0 : _b.x) !== null && _c !== void 0 ? _c : 0, (_e = (_d = shape.position) === null || _d === void 0 ? void 0 : _d.y) !== null && _e !== void 0 ? _e : 0), primitives = _a.primitives, box = _a.box;
153
+ return [2 /*return*/, { primitives: primitives, box: box }];
154
+ case 2:
155
+ error_2 = _f.sent();
156
+ console.warn('[cad-pdf-core] SHAPE glyph render failed; vector geometry omitted', error_2 instanceof Error ? error_2.message : error_2);
157
+ return [2 /*return*/, { primitives: empty, box: emptyBox }];
158
+ case 3: return [2 /*return*/];
159
+ }
160
+ });
161
+ });
162
+ }
163
+ };
164
+ }
165
+ function toMTextColorSettings(settings) {
166
+ if (!settings) {
167
+ return undefined;
168
+ }
169
+ var color = new MTextColor();
170
+ if (settings.entityIsByLayer) {
171
+ color.aci = 256;
172
+ }
173
+ else if (settings.entityIsByBlock) {
174
+ color.aci = 0;
175
+ }
176
+ else if (settings.entityIsForeground) {
177
+ color.aci = 7;
178
+ }
179
+ else if (typeof settings.entityAci === 'number') {
180
+ color.aci = settings.entityAci;
181
+ }
182
+ else if (typeof settings.entityRgb === 'number') {
183
+ color.rgbValue = settings.entityRgb;
184
+ }
185
+ else {
186
+ color.aci = 7;
187
+ }
188
+ return {
189
+ color: color,
190
+ byLayerColor: settings.byLayerColor,
191
+ byBlockColor: settings.byBlockColor,
192
+ layer: settings.layer
193
+ };
194
+ }
195
+ /**
196
+ * Builds flat triangle/polyline buffers from the rendered scene graph,
197
+ * baking each node's world matrix and translating the result so (0,0) is the
198
+ * text's insertion point. Geometry is also grouped by material colour so
199
+ * inline `\C` overrides survive vector PDF export.
200
+ */
201
+ function extractGlyphPrimitives(root, originX, originY) {
202
+ var e_1, _a, e_2, _b, e_3, _c, e_4, _d;
203
+ var _e, _f, _g;
204
+ (_e = root.updateMatrixWorld) === null || _e === void 0 ? void 0 : _e.call(root, true);
205
+ var sources = [];
206
+ var triangleFloatsByColor = new Map();
207
+ var lineFloatsByColor = new Map();
208
+ root.traverse(function (node) {
209
+ var _a, _b, _c, _d, _e;
210
+ var geom = node.geometry;
211
+ if (!geom) {
212
+ return;
213
+ }
214
+ var pos = geom.getAttribute('position');
215
+ if (!pos || pos.count < 1) {
216
+ return;
217
+ }
218
+ var rgb = (_a = readMaterialRgb(node)) !== null && _a !== void 0 ? _a : 0xffffff;
219
+ if (node.isMesh) {
220
+ var index = geom.getIndex();
221
+ var triCount = index ? index.count / 3 : Math.floor(pos.count / 3);
222
+ if (triCount < 1) {
223
+ return;
224
+ }
225
+ sources.push({
226
+ elements: (_b = node.matrixWorld) === null || _b === void 0 ? void 0 : _b.elements,
227
+ pos: pos,
228
+ index: index,
229
+ isMesh: true,
230
+ isSegments: false,
231
+ rgb: rgb
232
+ });
233
+ triangleFloatsByColor.set(rgb, ((_c = triangleFloatsByColor.get(rgb)) !== null && _c !== void 0 ? _c : 0) + triCount * 6);
234
+ return;
235
+ }
236
+ if (node.isLine) {
237
+ var segments = !!node.isLineSegments;
238
+ sources.push({
239
+ elements: (_d = node.matrixWorld) === null || _d === void 0 ? void 0 : _d.elements,
240
+ pos: pos,
241
+ index: null,
242
+ isMesh: false,
243
+ isSegments: segments,
244
+ rgb: rgb
245
+ });
246
+ var floats = segments
247
+ ? Math.floor(pos.count / 2) * 5
248
+ : pos.count * 2 + 1;
249
+ lineFloatsByColor.set(rgb, ((_e = lineFloatsByColor.get(rgb)) !== null && _e !== void 0 ? _e : 0) + floats);
250
+ }
251
+ });
252
+ var colors = __spreadArray([], __read(new Set(__spreadArray(__spreadArray([], __read(triangleFloatsByColor.keys()), false), __read(lineFloatsByColor.keys()), false))), false);
253
+ var groups = new Map();
254
+ try {
255
+ for (var colors_1 = __values(colors), colors_1_1 = colors_1.next(); !colors_1_1.done; colors_1_1 = colors_1.next()) {
256
+ var rgb = colors_1_1.value;
257
+ groups.set(rgb, {
258
+ triangles: new Float32Array((_f = triangleFloatsByColor.get(rgb)) !== null && _f !== void 0 ? _f : 0),
259
+ polylines: new Float32Array((_g = lineFloatsByColor.get(rgb)) !== null && _g !== void 0 ? _g : 0),
260
+ triOffset: 0,
261
+ lineOffset: 0
262
+ });
263
+ }
264
+ }
265
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
266
+ finally {
267
+ try {
268
+ if (colors_1_1 && !colors_1_1.done && (_a = colors_1.return)) _a.call(colors_1);
269
+ }
270
+ finally { if (e_1) throw e_1.error; }
271
+ }
272
+ var minX = Infinity;
273
+ var minY = Infinity;
274
+ var maxX = -Infinity;
275
+ var maxY = -Infinity;
276
+ var expand = function (x, y) {
277
+ if (x < minX)
278
+ minX = x;
279
+ if (y < minY)
280
+ minY = y;
281
+ if (x > maxX)
282
+ maxX = x;
283
+ if (y > maxY)
284
+ maxY = y;
285
+ };
286
+ var _loop_1 = function (source) {
287
+ var group = groups.get(source.rgb);
288
+ if (!group)
289
+ return "continue";
290
+ var el = source.elements;
291
+ var pos = source.pos;
292
+ var world = function (i) {
293
+ var x = pos.getX(i);
294
+ var y = pos.getY(i);
295
+ if (!el) {
296
+ return { x: x, y: y };
297
+ }
298
+ var z = pos.getZ(i);
299
+ var w = el[3] * x + el[7] * y + el[11] * z + el[15];
300
+ var invW = w === 0 ? 1 : 1 / w;
301
+ return {
302
+ x: (el[0] * x + el[4] * y + el[8] * z + el[12]) * invW,
303
+ y: (el[1] * x + el[5] * y + el[9] * z + el[13]) * invW
304
+ };
305
+ };
306
+ if (source.isMesh) {
307
+ var count = source.index
308
+ ? source.index.count / 3
309
+ : Math.floor(pos.count / 3);
310
+ for (var t = 0; t < count; t++) {
311
+ for (var k = 0; k < 3; k++) {
312
+ var vi = source.index ? source.index.getX(t * 3 + k) : t * 3 + k;
313
+ var p = world(vi);
314
+ var x = p.x - originX;
315
+ var y = p.y - originY;
316
+ group.triangles[group.triOffset++] = x;
317
+ group.triangles[group.triOffset++] = y;
318
+ expand(x, y);
319
+ }
320
+ }
321
+ }
322
+ else if (source.isSegments) {
323
+ var pairCount = Math.floor(pos.count / 2);
324
+ for (var s = 0; s < pairCount; s++) {
325
+ group.polylines[group.lineOffset++] = 2;
326
+ for (var k = 0; k < 2; k++) {
327
+ var p = world(s * 2 + k);
328
+ var x = p.x - originX;
329
+ var y = p.y - originY;
330
+ group.polylines[group.lineOffset++] = x;
331
+ group.polylines[group.lineOffset++] = y;
332
+ expand(x, y);
333
+ }
334
+ }
335
+ }
336
+ else {
337
+ group.polylines[group.lineOffset++] = pos.count;
338
+ for (var i = 0; i < pos.count; i++) {
339
+ var p = world(i);
340
+ var x = p.x - originX;
341
+ var y = p.y - originY;
342
+ group.polylines[group.lineOffset++] = x;
343
+ group.polylines[group.lineOffset++] = y;
344
+ expand(x, y);
345
+ }
346
+ }
347
+ };
348
+ try {
349
+ for (var sources_1 = __values(sources), sources_1_1 = sources_1.next(); !sources_1_1.done; sources_1_1 = sources_1.next()) {
350
+ var source = sources_1_1.value;
351
+ _loop_1(source);
352
+ }
353
+ }
354
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
355
+ finally {
356
+ try {
357
+ if (sources_1_1 && !sources_1_1.done && (_b = sources_1.return)) _b.call(sources_1);
358
+ }
359
+ finally { if (e_2) throw e_2.error; }
360
+ }
361
+ var colorGroups = [];
362
+ var totalTri = 0;
363
+ var totalLine = 0;
364
+ try {
365
+ for (var groups_1 = __values(groups), groups_1_1 = groups_1.next(); !groups_1_1.done; groups_1_1 = groups_1.next()) {
366
+ var _h = __read(groups_1_1.value, 2), rgb = _h[0], group = _h[1];
367
+ var primitives_1 = {
368
+ triangles: group.triangles,
369
+ polylines: group.polylines
370
+ };
371
+ if (primitives_1.triangles.length >= 6 || primitives_1.polylines.length >= 2) {
372
+ colorGroups.push({ rgb: rgb, primitives: primitives_1 });
373
+ }
374
+ totalTri += group.triangles.length;
375
+ totalLine += group.polylines.length;
376
+ }
377
+ }
378
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
379
+ finally {
380
+ try {
381
+ if (groups_1_1 && !groups_1_1.done && (_c = groups_1.return)) _c.call(groups_1);
382
+ }
383
+ finally { if (e_3) throw e_3.error; }
384
+ }
385
+ // Combined buffers keep callers that ignore colorGroups working.
386
+ var triangles = new Float32Array(totalTri);
387
+ var polylines = new Float32Array(totalLine);
388
+ var triOffset = 0;
389
+ var lineOffset = 0;
390
+ try {
391
+ for (var colorGroups_1 = __values(colorGroups), colorGroups_1_1 = colorGroups_1.next(); !colorGroups_1_1.done; colorGroups_1_1 = colorGroups_1.next()) {
392
+ var group = colorGroups_1_1.value;
393
+ triangles.set(group.primitives.triangles, triOffset);
394
+ triOffset += group.primitives.triangles.length;
395
+ polylines.set(group.primitives.polylines, lineOffset);
396
+ lineOffset += group.primitives.polylines.length;
397
+ }
398
+ }
399
+ catch (e_4_1) { e_4 = { error: e_4_1 }; }
400
+ finally {
401
+ try {
402
+ if (colorGroups_1_1 && !colorGroups_1_1.done && (_d = colorGroups_1.return)) _d.call(colorGroups_1);
403
+ }
404
+ finally { if (e_4) throw e_4.error; }
405
+ }
406
+ var primitives = { triangles: triangles, polylines: polylines };
407
+ var box = Number.isFinite(minX)
408
+ ? { min: { x: minX, y: minY }, max: { x: maxX, y: maxY } }
409
+ : { min: { x: 0, y: 0 }, max: { x: 0, y: 0 } };
410
+ return {
411
+ primitives: primitives,
412
+ // Always surface groups when present so a lone `\C256` green run is not
413
+ // painted with the entity fill (often ACI 7 white).
414
+ colorGroups: colorGroups.length > 0 ? colorGroups : undefined,
415
+ box: box
416
+ };
417
+ }
418
+ function readMaterialRgb(node) {
419
+ var _a, _b;
420
+ var material = node.material;
421
+ if (!material) {
422
+ return undefined;
423
+ }
424
+ var first = Array.isArray(material) ? material[0] : material;
425
+ var hex = (_b = (_a = first === null || first === void 0 ? void 0 : first.color) === null || _a === void 0 ? void 0 : _a.getHex) === null || _b === void 0 ? void 0 : _b.call(_a);
426
+ return typeof hex === 'number' ? hex : undefined;
427
+ }
428
+ //# sourceMappingURL=AcExPdfGlyphProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcExPdfGlyphProvider.js","sourceRoot":"","sources":["../src/AcExPdfGlyphProvider.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C;AAED,SAAS,eAAe,CAAC,IAAe;;IACtC,IAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;IAC9B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,IAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAA;IAC9D,IAAM,GAAG,GAAG,MAAA,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,0CAAE,MAAM,kDAAI,CAAA;IACpC,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAA;AAClD,CAAC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Shared PDF export logic for MLightCAD: option model, glyph provider and the
3
+ * database → PDF pipeline. No dependency on `@mlightcad/cad-simple-viewer` or
4
+ * the DOM, so both the browser plugin and the Node exporter consume it.
5
+ *
6
+ * @packageDocumentation
7
+ */
8
+ export { acexPdfBuildRendererOptions, type AcExPdfDatabaseExportOptions, acexPdfExportDatabase, type AcExPdfFitBox } from './AcExPdfDatabaseExport';
9
+ export { type AcExPdfColorMode, ACEXPDF_DEFAULT_EXPORT_OPTIONS, type AcExPdfExportOptions, type AcExPdfModelSpaceFit, acexPdfResolveExportOptions, type AcExPdfTextMode } from './AcExPdfExportOptions';
10
+ export { acexPdfCreateGlyphProvider } from './AcExPdfGlyphProvider';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,2BAA2B,EAC3B,KAAK,4BAA4B,EACjC,qBAAqB,EACrB,KAAK,aAAa,EACnB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,KAAK,gBAAgB,EACrB,8BAA8B,EAC9B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,2BAA2B,EAC3B,KAAK,eAAe,EACrB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAA"}
package/lib/index.js ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Shared PDF export logic for MLightCAD: option model, glyph provider and the
3
+ * database → PDF pipeline. No dependency on `@mlightcad/cad-simple-viewer` or
4
+ * the DOM, so both the browser plugin and the Node exporter consume it.
5
+ *
6
+ * @packageDocumentation
7
+ */
8
+ export { acexPdfBuildRendererOptions, acexPdfExportDatabase } from './AcExPdfDatabaseExport';
9
+ export { ACEXPDF_DEFAULT_EXPORT_OPTIONS, acexPdfResolveExportOptions } from './AcExPdfExportOptions';
10
+ export { acexPdfCreateGlyphProvider } from './AcExPdfGlyphProvider';
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,2BAA2B,EAE3B,qBAAqB,EAEtB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAEL,8BAA8B,EAG9B,2BAA2B,EAE5B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,45 @@
1
1
  {
2
2
  "name": "@mlightcad/cad-pdf-core",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "1.8.0-preview.0",
4
+ "license": "MIT",
5
+ "type": "module",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/mlightcad/cad-viewer.git"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "lib",
13
+ "README.md",
14
+ "package.json"
15
+ ],
16
+ "main": "./dist/cad-pdf-core.umd.cjs",
17
+ "module": "./dist/cad-pdf-core.js",
18
+ "types": "./lib/index.d.ts",
19
+ "sideEffects": false,
20
+ "exports": {
21
+ ".": {
22
+ "types": "./lib/index.d.ts",
23
+ "import": "./dist/cad-pdf-core.js",
24
+ "require": "./dist/cad-pdf-core.umd.cjs"
25
+ }
26
+ },
27
+ "devDependencies": {
28
+ "@mlightcad/data-model": "1.15.22",
29
+ "@mlightcad/mtext-parser": "1.5.7",
30
+ "@mlightcad/pdf-renderer": "1.8.0-preview.0",
31
+ "@mlightcad/three-renderer": "1.8.0-preview.0"
32
+ },
33
+ "peerDependencies": {
34
+ "@mlightcad/data-model": "1.15.22",
35
+ "@mlightcad/mtext-parser": "1.5.7",
36
+ "@mlightcad/pdf-renderer": "^1.8.0-preview.0",
37
+ "@mlightcad/three-renderer": "^1.8.0-preview.0"
38
+ },
39
+ "scripts": {
40
+ "clean": "rimraf dist lib tsconfig.tsbuildinfo",
41
+ "build": "tsc && vite build",
42
+ "lint": "eslint src/",
43
+ "lint:fix": "eslint --fix --quiet src/"
44
+ }
6
45
  }