docgen-utils 1.0.14 → 1.0.16

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.
@@ -0,0 +1,2 @@
1
+ export declare function fetchWithProxy(url: string): Promise<Response>;
2
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../packages/cli/commands/common.ts"],"names":[],"mappings":"AAEA,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAqBnE"}
@@ -0,0 +1,22 @@
1
+ const userAgent = 'Mozilla/5.0 (compatible; Copilot/1.0)';
2
+ export async function fetchWithProxy(url) {
3
+ const proxyUrl = process.env.HTTPS_PROXY || process.env.HTTP_PROXY ||
4
+ process.env.https_proxy || process.env.http_proxy;
5
+ if (proxyUrl) {
6
+ const undici = await import('undici');
7
+ const agent = new undici.ProxyAgent(proxyUrl);
8
+ const response = await undici.fetch(url, {
9
+ dispatcher: agent,
10
+ headers: {
11
+ 'User-Agent': userAgent,
12
+ },
13
+ });
14
+ return response;
15
+ }
16
+ return fetch(url, {
17
+ headers: {
18
+ 'User-Agent': userAgent,
19
+ },
20
+ });
21
+ }
22
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../packages/cli/commands/common.ts"],"names":[],"mappings":"AAAA,MAAM,SAAS,GAAG,uCAAuC,CAAC;AAE1D,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,GAAW;IAC9C,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU;QACjD,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;IAEnE,IAAI,QAAQ,EAAE,CAAC;QACb,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;QACtC,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC9C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE;YACvC,UAAU,EAAE,KAAK;YACjB,OAAO,EAAE;gBACP,YAAY,EAAE,SAAS;aACxB;SACF,CAAC,CAAC;QACH,OAAO,QAA+B,CAAC;IACzC,CAAC;IAED,OAAO,KAAK,CAAC,GAAG,EAAE;QAChB,OAAO,EAAE;YACP,YAAY,EAAE,SAAS;SACxB;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -1,10 +1,9 @@
1
1
  /**
2
2
  * Export docs command - converts HTML to DOCX
3
3
  *
4
- * Handles images in a general way:
5
- * - External <img> tags: fetched via HTTP and embedded
6
- * - SVG charts: rendered to PNG using Playwright's browser canvas
7
- * - Data URLs: passed through directly
4
+ * Uses Playwright to:
5
+ * - Fetch external images via browser canvas (accurate naturalWidth/naturalHeight)
6
+ * - Render SVG charts by screenshotting live DOM elements (preserves CSS context)
8
7
  */
9
8
  export interface ExportDocsOptions {
10
9
  name?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"export-docs.d.ts","sourceRoot":"","sources":["../../../../packages/cli/commands/export-docs.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAmZH,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAuCjH"}
1
+ {"version":3,"file":"export-docs.d.ts","sourceRoot":"","sources":["../../../../packages/cli/commands/export-docs.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAuTH,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAuDjH"}