pptx-glimpse 3.0.0 → 3.1.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.d.cts CHANGED
@@ -1,4 +1,5 @@
1
- export { C as ConversionDiagnostic, a as ConvertOptions, D as DEFAULT_FONT_MAPPING, F as FontBuffer, b as FontMapping, L as LogLevel, O as OpentypeSetup, P as PngConversionReport, S as SlideImage, d as SlideSupportCoverage, e as SlideSvg, h as SupportCoverage, i as SupportCoverageCounts, j as SvgConversionReport, U as UsedFonts, W as WarningEntry, k as WarningSummary, l as clearFontCache, m as collectUsedFonts, n as convertPptxToPng, p as convertPptxToSvg, q as createFontMapping, r as createOpentypeSetupFromBuffers, s as createOpentypeTextMeasurerFromBuffers, t as getMappedFont, u as getWarningEntries, v as getWarningSummary } from './font-collector-DYooJP6L.cjs';
1
+ export { C as ConversionDiagnostic, a as ConvertOptions, D as DEFAULT_FONT_MAPPING, F as FontBuffer, b as FontMapping, L as LogLevel, O as OpentypeSetup, P as PngConversionReport, S as SlideImage, c as SlideSupportCoverage, d as SlideSvg, e as SupportCoverage, f as SupportCoverageCounts, g as SvgConversionReport, U as UsedFonts, W as WarningEntry, h as WarningSummary, i as clearFontCache, j as collectUsedFonts, k as convertPptxToPng, l as convertPptxToSvg, n as createFontMapping, o as createOpentypeSetupFromBuffers, p as createOpentypeTextMeasurerFromBuffers, q as getMappedFont, r as getWarningEntries, s as getWarningSummary, t as renderPptxSourceModelToSvg } from './font-collector-BYuaCG-o.cjs';
2
+ export { PptxSourceModel } from '@pptx-glimpse/document';
2
3
 
3
4
  type ResvgWasmInput = ArrayBuffer | Uint8Array | Response;
4
5
 
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- export { C as ConversionDiagnostic, a as ConvertOptions, D as DEFAULT_FONT_MAPPING, F as FontBuffer, b as FontMapping, L as LogLevel, O as OpentypeSetup, P as PngConversionReport, S as SlideImage, d as SlideSupportCoverage, e as SlideSvg, h as SupportCoverage, i as SupportCoverageCounts, j as SvgConversionReport, U as UsedFonts, W as WarningEntry, k as WarningSummary, l as clearFontCache, m as collectUsedFonts, n as convertPptxToPng, p as convertPptxToSvg, q as createFontMapping, r as createOpentypeSetupFromBuffers, s as createOpentypeTextMeasurerFromBuffers, t as getMappedFont, u as getWarningEntries, v as getWarningSummary } from './font-collector-DYooJP6L.js';
1
+ export { C as ConversionDiagnostic, a as ConvertOptions, D as DEFAULT_FONT_MAPPING, F as FontBuffer, b as FontMapping, L as LogLevel, O as OpentypeSetup, P as PngConversionReport, S as SlideImage, c as SlideSupportCoverage, d as SlideSvg, e as SupportCoverage, f as SupportCoverageCounts, g as SvgConversionReport, U as UsedFonts, W as WarningEntry, h as WarningSummary, i as clearFontCache, j as collectUsedFonts, k as convertPptxToPng, l as convertPptxToSvg, n as createFontMapping, o as createOpentypeSetupFromBuffers, p as createOpentypeTextMeasurerFromBuffers, q as getMappedFont, r as getWarningEntries, s as getWarningSummary, t as renderPptxSourceModelToSvg } from './font-collector-BYuaCG-o.js';
2
+ export { PptxSourceModel } from '@pptx-glimpse/document';
2
3
 
3
4
  type ResvgWasmInput = ArrayBuffer | Uint8Array | Response;
4
5
 
package/dist/index.js CHANGED
@@ -1,8 +1,12 @@
1
1
  import {
2
- DEFAULT_OUTPUT_WIDTH,
3
- collectUsedFonts,
4
- convertPptxToSvg
5
- } from "./chunk-KMSN55AE.js";
2
+ collectUsedFonts
3
+ } from "./chunk-5YFLSUKM.js";
4
+ import {
5
+ convertPptxToPng,
6
+ convertPptxToSvg,
7
+ renderPptxSourceModelToSvg
8
+ } from "./chunk-3UFL5U77.js";
9
+ import "./chunk-AQ35JYTB.js";
6
10
  import {
7
11
  DEFAULT_FONT_MAPPING,
8
12
  clearFontCache,
@@ -12,76 +16,7 @@ import {
12
16
  getMappedFont,
13
17
  getWarningEntries,
14
18
  getWarningSummary
15
- } from "./chunk-2AYNMYMC.js";
16
-
17
- // src/converter.ts
18
- async function convertPptxToSvg2(input, options) {
19
- return convertPptxToSvg(input, options, loadSystemFontSetup);
20
- }
21
- async function convertPptxToPng(input, options) {
22
- const svgResult = await convertPptxToSvg2(input, {
23
- ...options,
24
- textOutput: "path"
25
- });
26
- const width = options?.width ?? DEFAULT_OUTPUT_WIDTH;
27
- const height = options?.height;
28
- const fontBuffers = await loadPngFontBuffers(options);
29
- const slides = [];
30
- for (const { slideNumber, svg } of svgResult.slides) {
31
- const pngResult = await convertSvgToPng(svg, { width, height, fontBuffers });
32
- slides.push({
33
- slideNumber,
34
- png: toPlainUint8Array(pngResult.png),
35
- width: pngResult.width,
36
- height: pngResult.height
37
- });
38
- }
39
- return {
40
- slides,
41
- diagnostics: svgResult.diagnostics,
42
- supportCoverage: svgResult.supportCoverage
43
- };
44
- }
45
- var loadSystemFontSetup = async (options) => {
46
- if (!shouldLoadSystemFonts(options)) {
47
- return null;
48
- }
49
- const { createOpentypeSetupFromSystem } = await import(
50
- /* @vite-ignore */
51
- "./node-6KTAWUIB.js"
52
- );
53
- return createOpentypeSetupFromSystem(
54
- options?.fontDirs,
55
- options?.fontMapping,
56
- options?.skipSystemFonts
57
- );
58
- };
59
- async function loadPngFontBuffers(options) {
60
- if (options?.fonts !== void 0) {
61
- return options.fonts.map((font) => toUint8Array(font.data));
62
- }
63
- if (!shouldLoadSystemFonts(options)) {
64
- return [];
65
- }
66
- const { loadFontBuffersFromSystem } = await import(
67
- /* @vite-ignore */
68
- "./node-font-loader-274G445U.js"
69
- );
70
- return loadFontBuffersFromSystem(options?.fontDirs, options?.skipSystemFonts);
71
- }
72
- async function convertSvgToPng(svg, options) {
73
- const { svgToPng } = await import("./png-IONMVVDQ.js");
74
- return svgToPng(svg, options);
75
- }
76
- function shouldLoadSystemFonts(options) {
77
- return options?.skipSystemFonts !== true || (options?.fontDirs?.length ?? 0) > 0;
78
- }
79
- function toUint8Array(data) {
80
- return data instanceof Uint8Array ? data : new Uint8Array(data);
81
- }
82
- function toPlainUint8Array(data) {
83
- return new Uint8Array(data);
84
- }
19
+ } from "./chunk-PGCREQQU.js";
85
20
 
86
21
  // src/index.ts
87
22
  async function initResvgWasm(wasm) {
@@ -93,12 +28,13 @@ export {
93
28
  clearFontCache,
94
29
  collectUsedFonts,
95
30
  convertPptxToPng,
96
- convertPptxToSvg2 as convertPptxToSvg,
31
+ convertPptxToSvg,
97
32
  createFontMapping,
98
33
  createOpentypeSetupFromBuffers,
99
34
  createOpentypeTextMeasurerFromBuffers,
100
35
  getMappedFont,
101
36
  getWarningEntries,
102
37
  getWarningSummary,
103
- initResvgWasm
38
+ initResvgWasm,
39
+ renderPptxSourceModelToSvg
104
40
  };
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  collectFontFilePaths,
3
3
  createOpentypeSetupFromSystem
4
- } from "./chunk-MWMHSSAD.js";
5
- import "./chunk-2AYNMYMC.js";
4
+ } from "./chunk-WAMKNW47.js";
5
+ import "./chunk-PGCREQQU.js";
6
6
  export {
7
7
  collectFontFilePaths,
8
8
  createOpentypeSetupFromSystem
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  collectFontFilePaths
3
- } from "./chunk-MWMHSSAD.js";
4
- import "./chunk-2AYNMYMC.js";
3
+ } from "./chunk-WAMKNW47.js";
4
+ import "./chunk-PGCREQQU.js";
5
5
 
6
6
  // src/node-font-loader.ts
7
7
  import { readFileSync, statSync } from "fs";
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "pptx-glimpse",
3
- "version": "3.0.0",
4
- "description": "A lightweight JavaScript library for rendering PowerPoint (.pptx) files as SVG or PNG in Node.js. No LibreOffice required.",
3
+ "version": "3.1.1",
4
+ "description": "A lightweight JavaScript library for rendering PowerPoint (.pptx) files as SVG or PNG in Node.js and the browser. No LibreOffice required.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.js",
8
8
  "browser": "./dist/browser.js",
9
9
  "types": "./dist/index.d.ts",
10
+ "bin": {
11
+ "pptx-glimpse": "./dist/cli.js"
12
+ },
10
13
  "exports": {
11
14
  ".": {
12
15
  "browser": {
@@ -46,11 +49,11 @@
46
49
  "@resvg/resvg-wasm": "^2.6.2",
47
50
  "fast-xml-parser": "^5.7.3",
48
51
  "fflate": "^0.8.2",
49
- "opentype.js": "1.3.4"
52
+ "opentype.js": "1.3.4",
53
+ "@pptx-glimpse/document": "^0.3.0"
50
54
  },
51
55
  "devDependencies": {
52
- "@pptx-glimpse/document": "0.0.0",
53
- "@pptx-glimpse/editor-core": "0.0.0",
56
+ "@pptx-glimpse/editor-core": "0.0.3",
54
57
  "@pptx-glimpse/renderer": "0.0.0"
55
58
  },
56
59
  "scripts": {