ppt-codec 0.0.0 → 1.0.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/LICENSE +21 -0
- package/README.md +174 -0
- package/dist/content.cjs +72 -0
- package/dist/content.d.cts +6 -0
- package/dist/content.d.ts +6 -0
- package/dist/content.js +71 -0
- package/dist/document/document-atom.cjs +27 -0
- package/dist/document/document-atom.d.cts +17 -0
- package/dist/document/document-atom.d.ts +17 -0
- package/dist/document/document-atom.js +26 -0
- package/dist/document/fonts.cjs +29 -0
- package/dist/document/fonts.d.cts +5 -0
- package/dist/document/fonts.d.ts +5 -0
- package/dist/document/fonts.js +28 -0
- package/dist/document/slide-list.cjs +40 -0
- package/dist/document/slide-list.d.cts +14 -0
- package/dist/document/slide-list.d.ts +14 -0
- package/dist/document/slide-list.js +39 -0
- package/dist/drawing/shapes.cjs +109 -0
- package/dist/drawing/shapes.d.cts +16 -0
- package/dist/drawing/shapes.d.ts +16 -0
- package/dist/drawing/shapes.js +108 -0
- package/dist/errors.cjs +17 -0
- package/dist/errors.d.cts +9 -0
- package/dist/errors.d.ts +9 -0
- package/dist/errors.js +15 -0
- package/dist/header-C5eAd16_.d.cts +13 -0
- package/dist/header-C5eAd16_.d.ts +13 -0
- package/dist/index.cjs +112 -0
- package/dist/index.d.cts +16 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +16 -0
- package/dist/read.cjs +119 -0
- package/dist/read.d.cts +13 -0
- package/dist/read.d.ts +13 -0
- package/dist/read.js +114 -0
- package/dist/record/header.cjs +25 -0
- package/dist/record/header.d.cts +2 -0
- package/dist/record/header.d.ts +2 -0
- package/dist/record/header.js +21 -0
- package/dist/record/tree.cjs +55 -0
- package/dist/record/tree.d.cts +2 -0
- package/dist/record/tree.d.ts +2 -0
- package/dist/record/tree.js +49 -0
- package/dist/record/types.cjs +87 -0
- package/dist/record/types.d.cts +45 -0
- package/dist/record/types.d.ts +45 -0
- package/dist/record/types.js +45 -0
- package/dist/stream/current-user.cjs +49 -0
- package/dist/stream/current-user.d.cts +11 -0
- package/dist/stream/current-user.d.ts +11 -0
- package/dist/stream/current-user.js +46 -0
- package/dist/stream/persist.cjs +71 -0
- package/dist/stream/persist.d.cts +20 -0
- package/dist/stream/persist.d.ts +20 -0
- package/dist/stream/persist.js +67 -0
- package/dist/text/atoms.cjs +70 -0
- package/dist/text/atoms.d.cts +22 -0
- package/dist/text/atoms.d.ts +22 -0
- package/dist/text/atoms.js +56 -0
- package/dist/text/style.cjs +173 -0
- package/dist/text/style.d.cts +39 -0
- package/dist/text/style.d.ts +39 -0
- package/dist/text/style.js +165 -0
- package/dist/tree-Du_LXAF0.d.cts +17 -0
- package/dist/tree-PMcPNgd-.d.ts +17 -0
- package/dist/units.cjs +12 -0
- package/dist/units.d.cts +6 -0
- package/dist/units.d.ts +6 -0
- package/dist/units.js +9 -0
- package/package.json +93 -2
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { t as PptRecord } from "../tree-Du_LXAF0.cjs";
|
|
2
|
+
//#region src/text/style.d.ts
|
|
3
|
+
declare const ALIGN_LEFT = 0;
|
|
4
|
+
declare const ALIGN_CENTER = 1;
|
|
5
|
+
declare const ALIGN_RIGHT = 2;
|
|
6
|
+
declare const ALIGN_JUSTIFY = 3;
|
|
7
|
+
declare const ALIGN_DISTRIBUTED = 4;
|
|
8
|
+
declare const ALIGN_THAI_DISTRIBUTED = 5;
|
|
9
|
+
declare const ALIGN_JUSTIFY_LOW = 6;
|
|
10
|
+
interface RgbColor {
|
|
11
|
+
readonly red: number;
|
|
12
|
+
readonly green: number;
|
|
13
|
+
readonly blue: number;
|
|
14
|
+
}
|
|
15
|
+
interface ParagraphProperties {
|
|
16
|
+
readonly indentLevel: number;
|
|
17
|
+
readonly alignment: number | undefined;
|
|
18
|
+
}
|
|
19
|
+
interface CharacterProperties {
|
|
20
|
+
readonly bold: boolean | undefined;
|
|
21
|
+
readonly italic: boolean | undefined;
|
|
22
|
+
readonly underline: boolean | undefined;
|
|
23
|
+
readonly shadow: boolean | undefined;
|
|
24
|
+
readonly emboss: boolean | undefined;
|
|
25
|
+
readonly fontRef: number | undefined;
|
|
26
|
+
readonly sizePt: number | undefined;
|
|
27
|
+
readonly color: RgbColor | undefined;
|
|
28
|
+
}
|
|
29
|
+
interface StyleRun<T> {
|
|
30
|
+
readonly count: number;
|
|
31
|
+
readonly properties: T;
|
|
32
|
+
}
|
|
33
|
+
interface StyleTextProps {
|
|
34
|
+
readonly paragraphRuns: readonly StyleRun<ParagraphProperties>[];
|
|
35
|
+
readonly characterRuns: readonly StyleRun<CharacterProperties>[];
|
|
36
|
+
}
|
|
37
|
+
declare function readStyleTextPropAtom(record: PptRecord, characterCount: number): StyleTextProps;
|
|
38
|
+
//#endregion
|
|
39
|
+
export { ALIGN_CENTER, ALIGN_DISTRIBUTED, ALIGN_JUSTIFY, ALIGN_JUSTIFY_LOW, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_THAI_DISTRIBUTED, CharacterProperties, ParagraphProperties, RgbColor, StyleRun, StyleTextProps, readStyleTextPropAtom };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { t as PptRecord } from "../tree-PMcPNgd-.js";
|
|
2
|
+
//#region src/text/style.d.ts
|
|
3
|
+
declare const ALIGN_LEFT = 0;
|
|
4
|
+
declare const ALIGN_CENTER = 1;
|
|
5
|
+
declare const ALIGN_RIGHT = 2;
|
|
6
|
+
declare const ALIGN_JUSTIFY = 3;
|
|
7
|
+
declare const ALIGN_DISTRIBUTED = 4;
|
|
8
|
+
declare const ALIGN_THAI_DISTRIBUTED = 5;
|
|
9
|
+
declare const ALIGN_JUSTIFY_LOW = 6;
|
|
10
|
+
interface RgbColor {
|
|
11
|
+
readonly red: number;
|
|
12
|
+
readonly green: number;
|
|
13
|
+
readonly blue: number;
|
|
14
|
+
}
|
|
15
|
+
interface ParagraphProperties {
|
|
16
|
+
readonly indentLevel: number;
|
|
17
|
+
readonly alignment: number | undefined;
|
|
18
|
+
}
|
|
19
|
+
interface CharacterProperties {
|
|
20
|
+
readonly bold: boolean | undefined;
|
|
21
|
+
readonly italic: boolean | undefined;
|
|
22
|
+
readonly underline: boolean | undefined;
|
|
23
|
+
readonly shadow: boolean | undefined;
|
|
24
|
+
readonly emboss: boolean | undefined;
|
|
25
|
+
readonly fontRef: number | undefined;
|
|
26
|
+
readonly sizePt: number | undefined;
|
|
27
|
+
readonly color: RgbColor | undefined;
|
|
28
|
+
}
|
|
29
|
+
interface StyleRun<T> {
|
|
30
|
+
readonly count: number;
|
|
31
|
+
readonly properties: T;
|
|
32
|
+
}
|
|
33
|
+
interface StyleTextProps {
|
|
34
|
+
readonly paragraphRuns: readonly StyleRun<ParagraphProperties>[];
|
|
35
|
+
readonly characterRuns: readonly StyleRun<CharacterProperties>[];
|
|
36
|
+
}
|
|
37
|
+
declare function readStyleTextPropAtom(record: PptRecord, characterCount: number): StyleTextProps;
|
|
38
|
+
//#endregion
|
|
39
|
+
export { ALIGN_CENTER, ALIGN_DISTRIBUTED, ALIGN_JUSTIFY, ALIGN_JUSTIFY_LOW, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_THAI_DISTRIBUTED, CharacterProperties, ParagraphProperties, RgbColor, StyleRun, StyleTextProps, readStyleTextPropAtom };
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { PptFormatError } from "../errors.js";
|
|
2
|
+
import { RT_StyleTextPropAtom } from "../record/types.js";
|
|
3
|
+
//#region src/text/style.ts
|
|
4
|
+
const ALIGN_LEFT = 0;
|
|
5
|
+
const ALIGN_CENTER = 1;
|
|
6
|
+
const ALIGN_RIGHT = 2;
|
|
7
|
+
const ALIGN_JUSTIFY = 3;
|
|
8
|
+
const ALIGN_DISTRIBUTED = 4;
|
|
9
|
+
const ALIGN_THAI_DISTRIBUTED = 5;
|
|
10
|
+
const ALIGN_JUSTIFY_LOW = 6;
|
|
11
|
+
const PF_BULLET_FONT = 16;
|
|
12
|
+
const PF_BULLET_COLOR = 32;
|
|
13
|
+
const PF_BULLET_SIZE = 64;
|
|
14
|
+
const PF_BULLET_CHAR = 128;
|
|
15
|
+
const PF_LEFT_MARGIN = 256;
|
|
16
|
+
const PF_INDENT = 1024;
|
|
17
|
+
const PF_ALIGN = 2048;
|
|
18
|
+
const PF_LINE_SPACING = 4096;
|
|
19
|
+
const PF_SPACE_BEFORE = 8192;
|
|
20
|
+
const PF_SPACE_AFTER = 16384;
|
|
21
|
+
const PF_DEFAULT_TAB_SIZE = 32768;
|
|
22
|
+
const PF_FONT_ALIGN = 65536;
|
|
23
|
+
const PF_TAB_STOPS = 1 << 20;
|
|
24
|
+
const PF_TEXT_DIRECTION = 1 << 21;
|
|
25
|
+
const CF_BOLD = 1;
|
|
26
|
+
const CF_ITALIC = 2;
|
|
27
|
+
const CF_UNDERLINE = 4;
|
|
28
|
+
const CF_SHADOW = 16;
|
|
29
|
+
const CF_EMBOSS = 512;
|
|
30
|
+
const CF_TYPEFACE = 65536;
|
|
31
|
+
const CF_SIZE = 1 << 17;
|
|
32
|
+
const CF_COLOR = 1 << 18;
|
|
33
|
+
const CF_POSITION = 1 << 19;
|
|
34
|
+
const CF_OLD_EA_TYPEFACE = 1 << 21;
|
|
35
|
+
const CF_ANSI_TYPEFACE = 1 << 22;
|
|
36
|
+
const CF_SYMBOL_TYPEFACE = 1 << 23;
|
|
37
|
+
const STYLE_BOLD = 1;
|
|
38
|
+
const STYLE_ITALIC = 2;
|
|
39
|
+
const STYLE_UNDERLINE = 4;
|
|
40
|
+
const STYLE_SHADOW = 16;
|
|
41
|
+
const STYLE_EMBOSS = 512;
|
|
42
|
+
const COLOR_INDEX_SRGB = 254;
|
|
43
|
+
var FieldCursor = class {
|
|
44
|
+
data;
|
|
45
|
+
describe;
|
|
46
|
+
at;
|
|
47
|
+
view;
|
|
48
|
+
constructor(data, start, describe) {
|
|
49
|
+
this.data = data;
|
|
50
|
+
this.describe = describe;
|
|
51
|
+
this.at = start;
|
|
52
|
+
this.view = new DataView(data.buffer, data.byteOffset, data.byteLength);
|
|
53
|
+
}
|
|
54
|
+
get offset() {
|
|
55
|
+
return this.at;
|
|
56
|
+
}
|
|
57
|
+
require(size) {
|
|
58
|
+
if (this.at + size > this.data.length) throw new PptFormatError(`${this.describe} needs ${size} more bytes at offset ${this.at} but the atom holds only ${this.data.length}`);
|
|
59
|
+
const at = this.at;
|
|
60
|
+
this.at += size;
|
|
61
|
+
return at;
|
|
62
|
+
}
|
|
63
|
+
u16() {
|
|
64
|
+
return this.view.getUint16(this.require(2), true);
|
|
65
|
+
}
|
|
66
|
+
i16() {
|
|
67
|
+
return this.view.getInt16(this.require(2), true);
|
|
68
|
+
}
|
|
69
|
+
u32() {
|
|
70
|
+
return this.view.getUint32(this.require(4), true);
|
|
71
|
+
}
|
|
72
|
+
bytes(size) {
|
|
73
|
+
const at = this.require(size);
|
|
74
|
+
return this.data.subarray(at, at + size);
|
|
75
|
+
}
|
|
76
|
+
skip(size) {
|
|
77
|
+
this.require(size);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
function readColorIndexStruct(cursor) {
|
|
81
|
+
const [red, green, blue, index] = cursor.bytes(4);
|
|
82
|
+
if (red === void 0 || green === void 0 || blue === void 0 || index === void 0) throw new PptFormatError("ColorIndexStruct read returned fewer than its four bytes");
|
|
83
|
+
return index === COLOR_INDEX_SRGB ? {
|
|
84
|
+
red,
|
|
85
|
+
green,
|
|
86
|
+
blue
|
|
87
|
+
} : void 0;
|
|
88
|
+
}
|
|
89
|
+
function readTextPFException(cursor, indentLevel) {
|
|
90
|
+
const masks = cursor.u32();
|
|
91
|
+
if ((masks & 15) !== 0) cursor.skip(2);
|
|
92
|
+
if ((masks & PF_BULLET_CHAR) !== 0) cursor.skip(2);
|
|
93
|
+
if ((masks & PF_BULLET_FONT) !== 0) cursor.skip(2);
|
|
94
|
+
if ((masks & PF_BULLET_SIZE) !== 0) cursor.skip(2);
|
|
95
|
+
if ((masks & PF_BULLET_COLOR) !== 0) cursor.skip(4);
|
|
96
|
+
const alignment = (masks & PF_ALIGN) !== 0 ? cursor.u16() : void 0;
|
|
97
|
+
for (const mask of [
|
|
98
|
+
PF_LINE_SPACING,
|
|
99
|
+
PF_SPACE_BEFORE,
|
|
100
|
+
PF_SPACE_AFTER,
|
|
101
|
+
PF_LEFT_MARGIN,
|
|
102
|
+
PF_INDENT,
|
|
103
|
+
PF_DEFAULT_TAB_SIZE
|
|
104
|
+
]) if ((masks & mask) !== 0) cursor.skip(2);
|
|
105
|
+
if ((masks & PF_TAB_STOPS) !== 0) cursor.skip(cursor.u16() * 4);
|
|
106
|
+
if ((masks & PF_FONT_ALIGN) !== 0) cursor.skip(2);
|
|
107
|
+
if ((masks & 917504) !== 0) cursor.skip(2);
|
|
108
|
+
if ((masks & PF_TEXT_DIRECTION) !== 0) cursor.skip(2);
|
|
109
|
+
return {
|
|
110
|
+
indentLevel,
|
|
111
|
+
alignment
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
function styleFlag(masks, maskBit, fontStyle, styleBit) {
|
|
115
|
+
if ((masks & maskBit) === 0 || fontStyle === void 0) return;
|
|
116
|
+
return (fontStyle & styleBit) !== 0;
|
|
117
|
+
}
|
|
118
|
+
function readTextCFException(cursor) {
|
|
119
|
+
const masks = cursor.u32();
|
|
120
|
+
const fontStyle = (masks & 16055) !== 0 ? cursor.u16() : void 0;
|
|
121
|
+
const fontRef = (masks & CF_TYPEFACE) !== 0 ? cursor.u16() : void 0;
|
|
122
|
+
if ((masks & CF_OLD_EA_TYPEFACE) !== 0) cursor.skip(2);
|
|
123
|
+
if ((masks & CF_ANSI_TYPEFACE) !== 0) cursor.skip(2);
|
|
124
|
+
if ((masks & CF_SYMBOL_TYPEFACE) !== 0) cursor.skip(2);
|
|
125
|
+
const sizePt = (masks & CF_SIZE) !== 0 ? cursor.i16() : void 0;
|
|
126
|
+
const color = (masks & CF_COLOR) !== 0 ? readColorIndexStruct(cursor) : void 0;
|
|
127
|
+
if ((masks & CF_POSITION) !== 0) cursor.skip(2);
|
|
128
|
+
return {
|
|
129
|
+
bold: styleFlag(masks, CF_BOLD, fontStyle, STYLE_BOLD),
|
|
130
|
+
italic: styleFlag(masks, CF_ITALIC, fontStyle, STYLE_ITALIC),
|
|
131
|
+
underline: styleFlag(masks, CF_UNDERLINE, fontStyle, STYLE_UNDERLINE),
|
|
132
|
+
shadow: styleFlag(masks, CF_SHADOW, fontStyle, STYLE_SHADOW),
|
|
133
|
+
emboss: styleFlag(masks, CF_EMBOSS, fontStyle, STYLE_EMBOSS),
|
|
134
|
+
fontRef,
|
|
135
|
+
sizePt,
|
|
136
|
+
color
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function readRuns(cursor, characterCount, describe, readProperties) {
|
|
140
|
+
const runs = [];
|
|
141
|
+
let covered = 0;
|
|
142
|
+
while (covered < characterCount) {
|
|
143
|
+
const count = cursor.u32();
|
|
144
|
+
const properties = readProperties(cursor);
|
|
145
|
+
covered += count;
|
|
146
|
+
if (covered > characterCount) throw new PptFormatError(`${describe} cover ${covered} characters, more than the ${characterCount} in the corresponding text body`);
|
|
147
|
+
runs.push({
|
|
148
|
+
count,
|
|
149
|
+
properties
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
return runs;
|
|
153
|
+
}
|
|
154
|
+
function readStyleTextPropAtom(record, characterCount) {
|
|
155
|
+
if (record.header.recType !== 4001) throw new PptFormatError(`expected RT_StyleTextPropAtom (0x${RT_StyleTextPropAtom.toString(16)}), found record type 0x${record.header.recType.toString(16)}`);
|
|
156
|
+
const cursor = new FieldCursor(record.data, 0, "StyleTextPropAtom");
|
|
157
|
+
return {
|
|
158
|
+
paragraphRuns: readRuns(cursor, characterCount, "StyleTextPropAtom paragraph runs", (at) => {
|
|
159
|
+
return readTextPFException(at, at.u16());
|
|
160
|
+
}),
|
|
161
|
+
characterRuns: readRuns(cursor, characterCount, "StyleTextPropAtom character runs", readTextCFException)
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
//#endregion
|
|
165
|
+
export { ALIGN_CENTER, ALIGN_DISTRIBUTED, ALIGN_JUSTIFY, ALIGN_JUSTIFY_LOW, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_THAI_DISTRIBUTED, readStyleTextPropAtom };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { r as RecordHeader } from "./header-C5eAd16_.cjs";
|
|
2
|
+
//#region src/record/tree.d.ts
|
|
3
|
+
interface PptRecord {
|
|
4
|
+
readonly header: RecordHeader;
|
|
5
|
+
readonly offset: number;
|
|
6
|
+
readonly dataOffset: number;
|
|
7
|
+
readonly data: Uint8Array<ArrayBuffer>;
|
|
8
|
+
readonly stream: Uint8Array<ArrayBuffer>;
|
|
9
|
+
}
|
|
10
|
+
declare function readRecordAt(bytes: Uint8Array<ArrayBuffer>, offset: number): PptRecord;
|
|
11
|
+
declare function readRecordSequence(bytes: Uint8Array<ArrayBuffer>, start: number, end: number): PptRecord[];
|
|
12
|
+
declare function childRecords(record: PptRecord): PptRecord[];
|
|
13
|
+
declare function findChild(records: readonly PptRecord[], recType: number): PptRecord | undefined;
|
|
14
|
+
declare function findChildren(records: readonly PptRecord[], recType: number): PptRecord[];
|
|
15
|
+
declare function findDescendants(root: PptRecord, recType: number): PptRecord[];
|
|
16
|
+
//#endregion
|
|
17
|
+
export { findDescendants as a, findChildren as i, childRecords as n, readRecordAt as o, findChild as r, readRecordSequence as s, PptRecord as t };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { r as RecordHeader } from "./header-C5eAd16_.js";
|
|
2
|
+
//#region src/record/tree.d.ts
|
|
3
|
+
interface PptRecord {
|
|
4
|
+
readonly header: RecordHeader;
|
|
5
|
+
readonly offset: number;
|
|
6
|
+
readonly dataOffset: number;
|
|
7
|
+
readonly data: Uint8Array<ArrayBuffer>;
|
|
8
|
+
readonly stream: Uint8Array<ArrayBuffer>;
|
|
9
|
+
}
|
|
10
|
+
declare function readRecordAt(bytes: Uint8Array<ArrayBuffer>, offset: number): PptRecord;
|
|
11
|
+
declare function readRecordSequence(bytes: Uint8Array<ArrayBuffer>, start: number, end: number): PptRecord[];
|
|
12
|
+
declare function childRecords(record: PptRecord): PptRecord[];
|
|
13
|
+
declare function findChild(records: readonly PptRecord[], recType: number): PptRecord | undefined;
|
|
14
|
+
declare function findChildren(records: readonly PptRecord[], recType: number): PptRecord[];
|
|
15
|
+
declare function findDescendants(root: PptRecord, recType: number): PptRecord[];
|
|
16
|
+
//#endregion
|
|
17
|
+
export { findDescendants as a, findChildren as i, childRecords as n, readRecordAt as o, findChild as r, readRecordSequence as s, PptRecord as t };
|
package/dist/units.cjs
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/units.ts
|
|
3
|
+
const MASTER_UNITS_PER_INCH = 576;
|
|
4
|
+
const POINTS_PER_INCH = 72;
|
|
5
|
+
const MASTER_UNITS_PER_POINT = MASTER_UNITS_PER_INCH / 72;
|
|
6
|
+
function masterUnitsToPoints(masterUnits) {
|
|
7
|
+
return masterUnits / 8;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
exports.MASTER_UNITS_PER_POINT = MASTER_UNITS_PER_POINT;
|
|
11
|
+
exports.POINTS_PER_INCH = POINTS_PER_INCH;
|
|
12
|
+
exports.masterUnitsToPoints = masterUnitsToPoints;
|
package/dist/units.d.cts
ADDED
package/dist/units.d.ts
ADDED
package/dist/units.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/units.ts
|
|
2
|
+
const MASTER_UNITS_PER_INCH = 576;
|
|
3
|
+
const POINTS_PER_INCH = 72;
|
|
4
|
+
const MASTER_UNITS_PER_POINT = MASTER_UNITS_PER_INCH / 72;
|
|
5
|
+
function masterUnitsToPoints(masterUnits) {
|
|
6
|
+
return masterUnits / 8;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { MASTER_UNITS_PER_POINT, POINTS_PER_INCH, masterUnitsToPoints };
|
package/package.json
CHANGED
|
@@ -1,5 +1,96 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ppt-codec",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Hand-written PowerPoint 97-2003 binary (.ppt, [MS-PPT]) reader against the shared document-schema.js content pivot.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/ExaDev/documents.js.git",
|
|
9
|
+
"directory": "packages/ppt-codec"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/ExaDev/documents.js/tree/main/packages/ppt-codec",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/ExaDev/documents.js/issues"
|
|
14
|
+
},
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": {
|
|
18
|
+
"import": "./dist/index.d.ts",
|
|
19
|
+
"require": "./dist/index.d.cts"
|
|
20
|
+
},
|
|
21
|
+
"import": "./dist/index.js",
|
|
22
|
+
"require": "./dist/index.cjs"
|
|
23
|
+
},
|
|
24
|
+
"./*": {
|
|
25
|
+
"types": {
|
|
26
|
+
"import": "./dist/*.d.ts",
|
|
27
|
+
"require": "./dist/*.d.cts"
|
|
28
|
+
},
|
|
29
|
+
"import": "./dist/*.js",
|
|
30
|
+
"require": "./dist/*.cjs"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"main": "./dist/index.cjs",
|
|
34
|
+
"module": "./dist/index.js",
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"files": [
|
|
37
|
+
"dist"
|
|
38
|
+
],
|
|
39
|
+
"publishConfig": {
|
|
40
|
+
"access": "public",
|
|
41
|
+
"provenance": true,
|
|
42
|
+
"registry": "https://registry.npmjs.org/"
|
|
43
|
+
},
|
|
44
|
+
"sideEffects": false,
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=20"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"build": "turbo run _build",
|
|
50
|
+
"_build": "tsdown",
|
|
51
|
+
"prepublishOnly": "pnpm run lint && pnpm run typecheck && tsdown && publint && attw --pack",
|
|
52
|
+
"lint": "turbo run _lint",
|
|
53
|
+
"_lint": "eslint . --fix --cache --max-warnings 0",
|
|
54
|
+
"lint:check": "eslint . --max-warnings 0",
|
|
55
|
+
"typecheck": "turbo run _typecheck _typecheck:attw",
|
|
56
|
+
"_typecheck": "tsc -p tsconfig.json && tsc -p tsconfig.node.json",
|
|
57
|
+
"_typecheck:attw": "attw --pack",
|
|
58
|
+
"test": "turbo run _test",
|
|
59
|
+
"_test": "vitest run --project unit",
|
|
60
|
+
"test:watch": "vitest --project unit",
|
|
61
|
+
"test:workers": "turbo run _test:workers",
|
|
62
|
+
"_test:workers": "vitest run --config vitest.workers.config.ts",
|
|
63
|
+
"test:smoke": "turbo run _test:smoke",
|
|
64
|
+
"_test:smoke": "vitest run --project smoke",
|
|
65
|
+
"prepare": "husky"
|
|
66
|
+
},
|
|
67
|
+
"keywords": [
|
|
68
|
+
"ppt",
|
|
69
|
+
"powerpoint",
|
|
70
|
+
"ms-ppt",
|
|
71
|
+
"binary",
|
|
72
|
+
"codec",
|
|
73
|
+
"presentation"
|
|
74
|
+
],
|
|
75
|
+
"license": "MIT",
|
|
76
|
+
"packageManager": "pnpm@11.6.0",
|
|
77
|
+
"dependencies": {
|
|
78
|
+
"archive-codec": "^1.3.0",
|
|
79
|
+
"document-schema.js": "^5.4.0"
|
|
80
|
+
},
|
|
81
|
+
"devDependencies": {
|
|
82
|
+
"@arethetypeswrong/cli": "^0.18.5",
|
|
83
|
+
"@cloudflare/vitest-pool-workers": "^0.20.1",
|
|
84
|
+
"@types/node": "^26.1.2",
|
|
85
|
+
"eslint": "^10.8.0",
|
|
86
|
+
"husky": "^9.1.7",
|
|
87
|
+
"publint": "^0.3.21",
|
|
88
|
+
"tsdown": "^0.22.13",
|
|
89
|
+
"turbo": "^2.10.8",
|
|
90
|
+
"typescript": "^6.0.3",
|
|
91
|
+
"vitest": "^4.1.10"
|
|
92
|
+
},
|
|
93
|
+
"lint-staged": {
|
|
94
|
+
"*.ts": "eslint --fix"
|
|
95
|
+
}
|
|
5
96
|
}
|