ppt-codec 1.5.0 → 1.7.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/README.md +91 -75
- package/dist/base64.cjs +48 -0
- package/dist/base64.d.cts +5 -0
- package/dist/base64.d.ts +5 -0
- package/dist/base64.js +46 -0
- package/dist/diagnostics-CqxAnubw.d.cts +16 -0
- package/dist/diagnostics-CqxAnubw.d.ts +16 -0
- package/dist/diagnostics.cjs +11 -0
- package/dist/diagnostics.d.cts +2 -0
- package/dist/diagnostics.d.ts +2 -0
- package/dist/diagnostics.js +9 -0
- package/dist/document/color-scheme.cjs +4 -0
- package/dist/document/color-scheme.d.cts +2 -1
- package/dist/document/color-scheme.d.ts +2 -1
- package/dist/document/color-scheme.js +4 -1
- package/dist/document/master-write.cjs +21 -16
- package/dist/document/master-write.d.cts +2 -1
- package/dist/document/master-write.d.ts +2 -1
- package/dist/document/master-write.js +21 -16
- package/dist/document/notes-write.cjs +15 -7
- package/dist/document/notes-write.d.cts +2 -1
- package/dist/document/notes-write.d.ts +2 -1
- package/dist/document/notes-write.js +15 -7
- package/dist/document/notes.cjs +4 -3
- package/dist/document/notes.js +4 -3
- package/dist/drawing/blips.cjs +81 -0
- package/dist/drawing/blips.d.cts +16 -0
- package/dist/drawing/blips.d.ts +16 -0
- package/dist/drawing/blips.js +77 -0
- package/dist/drawing/properties.cjs +102 -0
- package/dist/drawing/properties.d.cts +29 -0
- package/dist/drawing/properties.d.ts +29 -0
- package/dist/drawing/properties.js +87 -0
- package/dist/drawing/shapes-write.cjs +234 -17
- package/dist/drawing/shapes-write.d.cts +16 -4
- package/dist/drawing/shapes-write.d.ts +16 -4
- package/dist/drawing/shapes-write.js +237 -19
- package/dist/drawing/shapes.cjs +34 -4
- package/dist/drawing/shapes.d.cts +11 -2
- package/dist/drawing/shapes.d.ts +11 -2
- package/dist/drawing/shapes.js +35 -5
- package/dist/index.cjs +48 -3
- package/dist/index.d.cts +12 -8
- package/dist/index.d.ts +12 -8
- package/dist/index.js +11 -7
- package/dist/ole/embedded-write.cjs +66 -0
- package/dist/ole/embedded-write.d.cts +12 -0
- package/dist/ole/embedded-write.d.ts +12 -0
- package/dist/ole/embedded-write.js +63 -0
- package/dist/ole/embedded.cjs +66 -0
- package/dist/ole/embedded.d.cts +12 -0
- package/dist/ole/embedded.d.ts +12 -0
- package/dist/ole/embedded.js +63 -0
- package/dist/read.cjs +145 -22
- package/dist/read.d.cts +13 -5
- package/dist/read.d.ts +13 -5
- package/dist/read.js +148 -26
- package/dist/record/types.cjs +28 -0
- package/dist/record/types.d.cts +15 -1
- package/dist/record/types.d.ts +15 -1
- package/dist/record/types.js +15 -1
- package/dist/stream/current-user.cjs +1 -0
- package/dist/stream/current-user.d.cts +2 -1
- package/dist/stream/current-user.d.ts +2 -1
- package/dist/stream/current-user.js +1 -1
- package/dist/units.cjs +10 -0
- package/dist/units.d.cts +4 -1
- package/dist/units.d.ts +4 -1
- package/dist/units.js +8 -1
- package/dist/write.cjs +137 -38
- package/dist/write.d.cts +14 -5
- package/dist/write.d.ts +14 -5
- package/dist/write.js +137 -38
- package/package.json +2 -1
package/dist/record/types.cjs
CHANGED
|
@@ -10,11 +10,13 @@ const RT_Environment = 1010;
|
|
|
10
10
|
const RT_SlidePersistAtom = 1011;
|
|
11
11
|
const RT_MainMaster = 1016;
|
|
12
12
|
const RT_ExternalObjectList = 1033;
|
|
13
|
+
const RT_ExternalObjectListAtom = 1034;
|
|
13
14
|
const RT_DrawingGroup = 1035;
|
|
14
15
|
const RT_Drawing = 1036;
|
|
15
16
|
const RT_List = 2e3;
|
|
16
17
|
const RT_FontCollection = 2005;
|
|
17
18
|
const RT_ColorSchemeAtom = 2032;
|
|
19
|
+
const RT_ExternalObjectRefAtom = 3009;
|
|
18
20
|
const RT_PlaceholderAtom = 3011;
|
|
19
21
|
const RT_OutlineTextRefAtom = 3998;
|
|
20
22
|
const RT_TextHeaderAtom = 3999;
|
|
@@ -28,17 +30,25 @@ const RT_TextSpecialInfoDefaultAtom = 4009;
|
|
|
28
30
|
const RT_TextSpecialInfoAtom = 4010;
|
|
29
31
|
const RT_FontEntityAtom = 4023;
|
|
30
32
|
const RT_CString = 4026;
|
|
33
|
+
const RT_ExternalOleObjectAtom = 4035;
|
|
34
|
+
const RT_ExternalOleEmbed = 4044;
|
|
35
|
+
const RT_ExternalOleEmbedAtom = 4045;
|
|
31
36
|
const RT_SlideListWithText = 4080;
|
|
32
37
|
const RT_UserEditAtom = 4085;
|
|
33
38
|
const RT_CurrentUserAtom = 4086;
|
|
39
|
+
const RT_ExternalOleObjectStg = 4113;
|
|
34
40
|
const RT_PersistDirectoryAtom = 6002;
|
|
35
41
|
const RT_CryptSession10Container = 12052;
|
|
36
42
|
const SLIDE_LIST_INSTANCE_SLIDES = 0;
|
|
37
43
|
const SLIDE_LIST_INSTANCE_MASTERS = 1;
|
|
38
44
|
const SLIDE_LIST_INSTANCE_NOTES = 2;
|
|
45
|
+
const OfficeArtDggContainer = 61440;
|
|
46
|
+
const OfficeArtBStoreContainer = 61441;
|
|
39
47
|
const OfficeArtDgContainer = 61442;
|
|
40
48
|
const OfficeArtSpgrContainer = 61443;
|
|
41
49
|
const OfficeArtSpContainer = 61444;
|
|
50
|
+
const OfficeArtFDGGBlock = 61446;
|
|
51
|
+
const OfficeArtFBSE = 61447;
|
|
42
52
|
const OfficeArtFSPGR = 61449;
|
|
43
53
|
const OfficeArtFSP = 61450;
|
|
44
54
|
const OfficeArtFOPT = 61451;
|
|
@@ -46,17 +56,29 @@ const OfficeArtClientTextbox = 61453;
|
|
|
46
56
|
const OfficeArtChildAnchor = 61455;
|
|
47
57
|
const OfficeArtClientAnchor = 61456;
|
|
48
58
|
const OfficeArtClientData = 61457;
|
|
59
|
+
const OfficeArtSecondaryFOPT = 61729;
|
|
60
|
+
const OfficeArtTertiaryFOPT = 61730;
|
|
61
|
+
const OfficeArtBlipJPEG = 61469;
|
|
62
|
+
const OfficeArtBlipPNG = 61470;
|
|
49
63
|
//#endregion
|
|
64
|
+
exports.OfficeArtBStoreContainer = OfficeArtBStoreContainer;
|
|
65
|
+
exports.OfficeArtBlipJPEG = OfficeArtBlipJPEG;
|
|
66
|
+
exports.OfficeArtBlipPNG = OfficeArtBlipPNG;
|
|
50
67
|
exports.OfficeArtChildAnchor = OfficeArtChildAnchor;
|
|
51
68
|
exports.OfficeArtClientAnchor = OfficeArtClientAnchor;
|
|
52
69
|
exports.OfficeArtClientData = OfficeArtClientData;
|
|
53
70
|
exports.OfficeArtClientTextbox = OfficeArtClientTextbox;
|
|
54
71
|
exports.OfficeArtDgContainer = OfficeArtDgContainer;
|
|
72
|
+
exports.OfficeArtDggContainer = OfficeArtDggContainer;
|
|
73
|
+
exports.OfficeArtFBSE = OfficeArtFBSE;
|
|
74
|
+
exports.OfficeArtFDGGBlock = OfficeArtFDGGBlock;
|
|
55
75
|
exports.OfficeArtFOPT = OfficeArtFOPT;
|
|
56
76
|
exports.OfficeArtFSP = OfficeArtFSP;
|
|
57
77
|
exports.OfficeArtFSPGR = OfficeArtFSPGR;
|
|
78
|
+
exports.OfficeArtSecondaryFOPT = OfficeArtSecondaryFOPT;
|
|
58
79
|
exports.OfficeArtSpContainer = OfficeArtSpContainer;
|
|
59
80
|
exports.OfficeArtSpgrContainer = OfficeArtSpgrContainer;
|
|
81
|
+
exports.OfficeArtTertiaryFOPT = OfficeArtTertiaryFOPT;
|
|
60
82
|
exports.RT_CString = RT_CString;
|
|
61
83
|
exports.RT_ColorSchemeAtom = RT_ColorSchemeAtom;
|
|
62
84
|
exports.RT_CryptSession10Container = RT_CryptSession10Container;
|
|
@@ -67,6 +89,12 @@ exports.RT_Drawing = RT_Drawing;
|
|
|
67
89
|
exports.RT_DrawingGroup = RT_DrawingGroup;
|
|
68
90
|
exports.RT_Environment = RT_Environment;
|
|
69
91
|
exports.RT_ExternalObjectList = RT_ExternalObjectList;
|
|
92
|
+
exports.RT_ExternalObjectListAtom = RT_ExternalObjectListAtom;
|
|
93
|
+
exports.RT_ExternalObjectRefAtom = RT_ExternalObjectRefAtom;
|
|
94
|
+
exports.RT_ExternalOleEmbed = RT_ExternalOleEmbed;
|
|
95
|
+
exports.RT_ExternalOleEmbedAtom = RT_ExternalOleEmbedAtom;
|
|
96
|
+
exports.RT_ExternalOleObjectAtom = RT_ExternalOleObjectAtom;
|
|
97
|
+
exports.RT_ExternalOleObjectStg = RT_ExternalOleObjectStg;
|
|
70
98
|
exports.RT_FontCollection = RT_FontCollection;
|
|
71
99
|
exports.RT_FontEntityAtom = RT_FontEntityAtom;
|
|
72
100
|
exports.RT_List = RT_List;
|
package/dist/record/types.d.cts
CHANGED
|
@@ -9,11 +9,13 @@ declare const RT_Environment = 1010;
|
|
|
9
9
|
declare const RT_SlidePersistAtom = 1011;
|
|
10
10
|
declare const RT_MainMaster = 1016;
|
|
11
11
|
declare const RT_ExternalObjectList = 1033;
|
|
12
|
+
declare const RT_ExternalObjectListAtom = 1034;
|
|
12
13
|
declare const RT_DrawingGroup = 1035;
|
|
13
14
|
declare const RT_Drawing = 1036;
|
|
14
15
|
declare const RT_List = 2000;
|
|
15
16
|
declare const RT_FontCollection = 2005;
|
|
16
17
|
declare const RT_ColorSchemeAtom = 2032;
|
|
18
|
+
declare const RT_ExternalObjectRefAtom = 3009;
|
|
17
19
|
declare const RT_PlaceholderAtom = 3011;
|
|
18
20
|
declare const RT_OutlineTextRefAtom = 3998;
|
|
19
21
|
declare const RT_TextHeaderAtom = 3999;
|
|
@@ -27,17 +29,25 @@ declare const RT_TextSpecialInfoDefaultAtom = 4009;
|
|
|
27
29
|
declare const RT_TextSpecialInfoAtom = 4010;
|
|
28
30
|
declare const RT_FontEntityAtom = 4023;
|
|
29
31
|
declare const RT_CString = 4026;
|
|
32
|
+
declare const RT_ExternalOleObjectAtom = 4035;
|
|
33
|
+
declare const RT_ExternalOleEmbed = 4044;
|
|
34
|
+
declare const RT_ExternalOleEmbedAtom = 4045;
|
|
30
35
|
declare const RT_SlideListWithText = 4080;
|
|
31
36
|
declare const RT_UserEditAtom = 4085;
|
|
32
37
|
declare const RT_CurrentUserAtom = 4086;
|
|
38
|
+
declare const RT_ExternalOleObjectStg = 4113;
|
|
33
39
|
declare const RT_PersistDirectoryAtom = 6002;
|
|
34
40
|
declare const RT_CryptSession10Container = 12052;
|
|
35
41
|
declare const SLIDE_LIST_INSTANCE_SLIDES = 0;
|
|
36
42
|
declare const SLIDE_LIST_INSTANCE_MASTERS = 1;
|
|
37
43
|
declare const SLIDE_LIST_INSTANCE_NOTES = 2;
|
|
44
|
+
declare const OfficeArtDggContainer = 61440;
|
|
45
|
+
declare const OfficeArtBStoreContainer = 61441;
|
|
38
46
|
declare const OfficeArtDgContainer = 61442;
|
|
39
47
|
declare const OfficeArtSpgrContainer = 61443;
|
|
40
48
|
declare const OfficeArtSpContainer = 61444;
|
|
49
|
+
declare const OfficeArtFDGGBlock = 61446;
|
|
50
|
+
declare const OfficeArtFBSE = 61447;
|
|
41
51
|
declare const OfficeArtFSPGR = 61449;
|
|
42
52
|
declare const OfficeArtFSP = 61450;
|
|
43
53
|
declare const OfficeArtFOPT = 61451;
|
|
@@ -45,5 +55,9 @@ declare const OfficeArtClientTextbox = 61453;
|
|
|
45
55
|
declare const OfficeArtChildAnchor = 61455;
|
|
46
56
|
declare const OfficeArtClientAnchor = 61456;
|
|
47
57
|
declare const OfficeArtClientData = 61457;
|
|
58
|
+
declare const OfficeArtSecondaryFOPT = 61729;
|
|
59
|
+
declare const OfficeArtTertiaryFOPT = 61730;
|
|
60
|
+
declare const OfficeArtBlipJPEG = 61469;
|
|
61
|
+
declare const OfficeArtBlipPNG = 61470;
|
|
48
62
|
//#endregion
|
|
49
|
-
export { OfficeArtChildAnchor, OfficeArtClientAnchor, OfficeArtClientData, OfficeArtClientTextbox, OfficeArtDgContainer, OfficeArtFOPT, OfficeArtFSP, OfficeArtFSPGR, OfficeArtSpContainer, OfficeArtSpgrContainer, RT_CString, RT_ColorSchemeAtom, RT_CryptSession10Container, RT_CurrentUserAtom, RT_Document, RT_DocumentAtom, RT_Drawing, RT_DrawingGroup, RT_Environment, RT_ExternalObjectList, RT_FontCollection, RT_FontEntityAtom, RT_List, RT_MainMaster, RT_MasterTextPropAtom, RT_Notes, RT_NotesAtom, RT_OutlineTextRefAtom, RT_PersistDirectoryAtom, RT_PlaceholderAtom, RT_Slide, RT_SlideAtom, RT_SlideListWithText, RT_SlidePersistAtom, RT_StyleTextPropAtom, RT_TextBytesAtom, RT_TextCharsAtom, RT_TextHeaderAtom, RT_TextMasterStyleAtom, RT_TextRulerAtom, RT_TextSpecialInfoAtom, RT_TextSpecialInfoDefaultAtom, RT_UserEditAtom, SLIDE_LIST_INSTANCE_MASTERS, SLIDE_LIST_INSTANCE_NOTES, SLIDE_LIST_INSTANCE_SLIDES };
|
|
63
|
+
export { OfficeArtBStoreContainer, OfficeArtBlipJPEG, OfficeArtBlipPNG, OfficeArtChildAnchor, OfficeArtClientAnchor, OfficeArtClientData, OfficeArtClientTextbox, OfficeArtDgContainer, OfficeArtDggContainer, OfficeArtFBSE, OfficeArtFDGGBlock, OfficeArtFOPT, OfficeArtFSP, OfficeArtFSPGR, OfficeArtSecondaryFOPT, OfficeArtSpContainer, OfficeArtSpgrContainer, OfficeArtTertiaryFOPT, RT_CString, RT_ColorSchemeAtom, RT_CryptSession10Container, RT_CurrentUserAtom, RT_Document, RT_DocumentAtom, RT_Drawing, RT_DrawingGroup, RT_Environment, RT_ExternalObjectList, RT_ExternalObjectListAtom, RT_ExternalObjectRefAtom, RT_ExternalOleEmbed, RT_ExternalOleEmbedAtom, RT_ExternalOleObjectAtom, RT_ExternalOleObjectStg, RT_FontCollection, RT_FontEntityAtom, RT_List, RT_MainMaster, RT_MasterTextPropAtom, RT_Notes, RT_NotesAtom, RT_OutlineTextRefAtom, RT_PersistDirectoryAtom, RT_PlaceholderAtom, RT_Slide, RT_SlideAtom, RT_SlideListWithText, RT_SlidePersistAtom, RT_StyleTextPropAtom, RT_TextBytesAtom, RT_TextCharsAtom, RT_TextHeaderAtom, RT_TextMasterStyleAtom, RT_TextRulerAtom, RT_TextSpecialInfoAtom, RT_TextSpecialInfoDefaultAtom, RT_UserEditAtom, SLIDE_LIST_INSTANCE_MASTERS, SLIDE_LIST_INSTANCE_NOTES, SLIDE_LIST_INSTANCE_SLIDES };
|
package/dist/record/types.d.ts
CHANGED
|
@@ -9,11 +9,13 @@ declare const RT_Environment = 1010;
|
|
|
9
9
|
declare const RT_SlidePersistAtom = 1011;
|
|
10
10
|
declare const RT_MainMaster = 1016;
|
|
11
11
|
declare const RT_ExternalObjectList = 1033;
|
|
12
|
+
declare const RT_ExternalObjectListAtom = 1034;
|
|
12
13
|
declare const RT_DrawingGroup = 1035;
|
|
13
14
|
declare const RT_Drawing = 1036;
|
|
14
15
|
declare const RT_List = 2000;
|
|
15
16
|
declare const RT_FontCollection = 2005;
|
|
16
17
|
declare const RT_ColorSchemeAtom = 2032;
|
|
18
|
+
declare const RT_ExternalObjectRefAtom = 3009;
|
|
17
19
|
declare const RT_PlaceholderAtom = 3011;
|
|
18
20
|
declare const RT_OutlineTextRefAtom = 3998;
|
|
19
21
|
declare const RT_TextHeaderAtom = 3999;
|
|
@@ -27,17 +29,25 @@ declare const RT_TextSpecialInfoDefaultAtom = 4009;
|
|
|
27
29
|
declare const RT_TextSpecialInfoAtom = 4010;
|
|
28
30
|
declare const RT_FontEntityAtom = 4023;
|
|
29
31
|
declare const RT_CString = 4026;
|
|
32
|
+
declare const RT_ExternalOleObjectAtom = 4035;
|
|
33
|
+
declare const RT_ExternalOleEmbed = 4044;
|
|
34
|
+
declare const RT_ExternalOleEmbedAtom = 4045;
|
|
30
35
|
declare const RT_SlideListWithText = 4080;
|
|
31
36
|
declare const RT_UserEditAtom = 4085;
|
|
32
37
|
declare const RT_CurrentUserAtom = 4086;
|
|
38
|
+
declare const RT_ExternalOleObjectStg = 4113;
|
|
33
39
|
declare const RT_PersistDirectoryAtom = 6002;
|
|
34
40
|
declare const RT_CryptSession10Container = 12052;
|
|
35
41
|
declare const SLIDE_LIST_INSTANCE_SLIDES = 0;
|
|
36
42
|
declare const SLIDE_LIST_INSTANCE_MASTERS = 1;
|
|
37
43
|
declare const SLIDE_LIST_INSTANCE_NOTES = 2;
|
|
44
|
+
declare const OfficeArtDggContainer = 61440;
|
|
45
|
+
declare const OfficeArtBStoreContainer = 61441;
|
|
38
46
|
declare const OfficeArtDgContainer = 61442;
|
|
39
47
|
declare const OfficeArtSpgrContainer = 61443;
|
|
40
48
|
declare const OfficeArtSpContainer = 61444;
|
|
49
|
+
declare const OfficeArtFDGGBlock = 61446;
|
|
50
|
+
declare const OfficeArtFBSE = 61447;
|
|
41
51
|
declare const OfficeArtFSPGR = 61449;
|
|
42
52
|
declare const OfficeArtFSP = 61450;
|
|
43
53
|
declare const OfficeArtFOPT = 61451;
|
|
@@ -45,5 +55,9 @@ declare const OfficeArtClientTextbox = 61453;
|
|
|
45
55
|
declare const OfficeArtChildAnchor = 61455;
|
|
46
56
|
declare const OfficeArtClientAnchor = 61456;
|
|
47
57
|
declare const OfficeArtClientData = 61457;
|
|
58
|
+
declare const OfficeArtSecondaryFOPT = 61729;
|
|
59
|
+
declare const OfficeArtTertiaryFOPT = 61730;
|
|
60
|
+
declare const OfficeArtBlipJPEG = 61469;
|
|
61
|
+
declare const OfficeArtBlipPNG = 61470;
|
|
48
62
|
//#endregion
|
|
49
|
-
export { OfficeArtChildAnchor, OfficeArtClientAnchor, OfficeArtClientData, OfficeArtClientTextbox, OfficeArtDgContainer, OfficeArtFOPT, OfficeArtFSP, OfficeArtFSPGR, OfficeArtSpContainer, OfficeArtSpgrContainer, RT_CString, RT_ColorSchemeAtom, RT_CryptSession10Container, RT_CurrentUserAtom, RT_Document, RT_DocumentAtom, RT_Drawing, RT_DrawingGroup, RT_Environment, RT_ExternalObjectList, RT_FontCollection, RT_FontEntityAtom, RT_List, RT_MainMaster, RT_MasterTextPropAtom, RT_Notes, RT_NotesAtom, RT_OutlineTextRefAtom, RT_PersistDirectoryAtom, RT_PlaceholderAtom, RT_Slide, RT_SlideAtom, RT_SlideListWithText, RT_SlidePersistAtom, RT_StyleTextPropAtom, RT_TextBytesAtom, RT_TextCharsAtom, RT_TextHeaderAtom, RT_TextMasterStyleAtom, RT_TextRulerAtom, RT_TextSpecialInfoAtom, RT_TextSpecialInfoDefaultAtom, RT_UserEditAtom, SLIDE_LIST_INSTANCE_MASTERS, SLIDE_LIST_INSTANCE_NOTES, SLIDE_LIST_INSTANCE_SLIDES };
|
|
63
|
+
export { OfficeArtBStoreContainer, OfficeArtBlipJPEG, OfficeArtBlipPNG, OfficeArtChildAnchor, OfficeArtClientAnchor, OfficeArtClientData, OfficeArtClientTextbox, OfficeArtDgContainer, OfficeArtDggContainer, OfficeArtFBSE, OfficeArtFDGGBlock, OfficeArtFOPT, OfficeArtFSP, OfficeArtFSPGR, OfficeArtSecondaryFOPT, OfficeArtSpContainer, OfficeArtSpgrContainer, OfficeArtTertiaryFOPT, RT_CString, RT_ColorSchemeAtom, RT_CryptSession10Container, RT_CurrentUserAtom, RT_Document, RT_DocumentAtom, RT_Drawing, RT_DrawingGroup, RT_Environment, RT_ExternalObjectList, RT_ExternalObjectListAtom, RT_ExternalObjectRefAtom, RT_ExternalOleEmbed, RT_ExternalOleEmbedAtom, RT_ExternalOleObjectAtom, RT_ExternalOleObjectStg, RT_FontCollection, RT_FontEntityAtom, RT_List, RT_MainMaster, RT_MasterTextPropAtom, RT_Notes, RT_NotesAtom, RT_OutlineTextRefAtom, RT_PersistDirectoryAtom, RT_PlaceholderAtom, RT_Slide, RT_SlideAtom, RT_SlideListWithText, RT_SlidePersistAtom, RT_StyleTextPropAtom, RT_TextBytesAtom, RT_TextCharsAtom, RT_TextHeaderAtom, RT_TextMasterStyleAtom, RT_TextRulerAtom, RT_TextSpecialInfoAtom, RT_TextSpecialInfoDefaultAtom, RT_UserEditAtom, SLIDE_LIST_INSTANCE_MASTERS, SLIDE_LIST_INSTANCE_NOTES, SLIDE_LIST_INSTANCE_SLIDES };
|
package/dist/record/types.js
CHANGED
|
@@ -9,11 +9,13 @@ const RT_Environment = 1010;
|
|
|
9
9
|
const RT_SlidePersistAtom = 1011;
|
|
10
10
|
const RT_MainMaster = 1016;
|
|
11
11
|
const RT_ExternalObjectList = 1033;
|
|
12
|
+
const RT_ExternalObjectListAtom = 1034;
|
|
12
13
|
const RT_DrawingGroup = 1035;
|
|
13
14
|
const RT_Drawing = 1036;
|
|
14
15
|
const RT_List = 2e3;
|
|
15
16
|
const RT_FontCollection = 2005;
|
|
16
17
|
const RT_ColorSchemeAtom = 2032;
|
|
18
|
+
const RT_ExternalObjectRefAtom = 3009;
|
|
17
19
|
const RT_PlaceholderAtom = 3011;
|
|
18
20
|
const RT_OutlineTextRefAtom = 3998;
|
|
19
21
|
const RT_TextHeaderAtom = 3999;
|
|
@@ -27,17 +29,25 @@ const RT_TextSpecialInfoDefaultAtom = 4009;
|
|
|
27
29
|
const RT_TextSpecialInfoAtom = 4010;
|
|
28
30
|
const RT_FontEntityAtom = 4023;
|
|
29
31
|
const RT_CString = 4026;
|
|
32
|
+
const RT_ExternalOleObjectAtom = 4035;
|
|
33
|
+
const RT_ExternalOleEmbed = 4044;
|
|
34
|
+
const RT_ExternalOleEmbedAtom = 4045;
|
|
30
35
|
const RT_SlideListWithText = 4080;
|
|
31
36
|
const RT_UserEditAtom = 4085;
|
|
32
37
|
const RT_CurrentUserAtom = 4086;
|
|
38
|
+
const RT_ExternalOleObjectStg = 4113;
|
|
33
39
|
const RT_PersistDirectoryAtom = 6002;
|
|
34
40
|
const RT_CryptSession10Container = 12052;
|
|
35
41
|
const SLIDE_LIST_INSTANCE_SLIDES = 0;
|
|
36
42
|
const SLIDE_LIST_INSTANCE_MASTERS = 1;
|
|
37
43
|
const SLIDE_LIST_INSTANCE_NOTES = 2;
|
|
44
|
+
const OfficeArtDggContainer = 61440;
|
|
45
|
+
const OfficeArtBStoreContainer = 61441;
|
|
38
46
|
const OfficeArtDgContainer = 61442;
|
|
39
47
|
const OfficeArtSpgrContainer = 61443;
|
|
40
48
|
const OfficeArtSpContainer = 61444;
|
|
49
|
+
const OfficeArtFDGGBlock = 61446;
|
|
50
|
+
const OfficeArtFBSE = 61447;
|
|
41
51
|
const OfficeArtFSPGR = 61449;
|
|
42
52
|
const OfficeArtFSP = 61450;
|
|
43
53
|
const OfficeArtFOPT = 61451;
|
|
@@ -45,5 +55,9 @@ const OfficeArtClientTextbox = 61453;
|
|
|
45
55
|
const OfficeArtChildAnchor = 61455;
|
|
46
56
|
const OfficeArtClientAnchor = 61456;
|
|
47
57
|
const OfficeArtClientData = 61457;
|
|
58
|
+
const OfficeArtSecondaryFOPT = 61729;
|
|
59
|
+
const OfficeArtTertiaryFOPT = 61730;
|
|
60
|
+
const OfficeArtBlipJPEG = 61469;
|
|
61
|
+
const OfficeArtBlipPNG = 61470;
|
|
48
62
|
//#endregion
|
|
49
|
-
export { OfficeArtChildAnchor, OfficeArtClientAnchor, OfficeArtClientData, OfficeArtClientTextbox, OfficeArtDgContainer, OfficeArtFOPT, OfficeArtFSP, OfficeArtFSPGR, OfficeArtSpContainer, OfficeArtSpgrContainer, RT_CString, RT_ColorSchemeAtom, RT_CryptSession10Container, RT_CurrentUserAtom, RT_Document, RT_DocumentAtom, RT_Drawing, RT_DrawingGroup, RT_Environment, RT_ExternalObjectList, RT_FontCollection, RT_FontEntityAtom, RT_List, RT_MainMaster, RT_MasterTextPropAtom, RT_Notes, RT_NotesAtom, RT_OutlineTextRefAtom, RT_PersistDirectoryAtom, RT_PlaceholderAtom, RT_Slide, RT_SlideAtom, RT_SlideListWithText, RT_SlidePersistAtom, RT_StyleTextPropAtom, RT_TextBytesAtom, RT_TextCharsAtom, RT_TextHeaderAtom, RT_TextMasterStyleAtom, RT_TextRulerAtom, RT_TextSpecialInfoAtom, RT_TextSpecialInfoDefaultAtom, RT_UserEditAtom, SLIDE_LIST_INSTANCE_MASTERS, SLIDE_LIST_INSTANCE_NOTES, SLIDE_LIST_INSTANCE_SLIDES };
|
|
63
|
+
export { OfficeArtBStoreContainer, OfficeArtBlipJPEG, OfficeArtBlipPNG, OfficeArtChildAnchor, OfficeArtClientAnchor, OfficeArtClientData, OfficeArtClientTextbox, OfficeArtDgContainer, OfficeArtDggContainer, OfficeArtFBSE, OfficeArtFDGGBlock, OfficeArtFOPT, OfficeArtFSP, OfficeArtFSPGR, OfficeArtSecondaryFOPT, OfficeArtSpContainer, OfficeArtSpgrContainer, OfficeArtTertiaryFOPT, RT_CString, RT_ColorSchemeAtom, RT_CryptSession10Container, RT_CurrentUserAtom, RT_Document, RT_DocumentAtom, RT_Drawing, RT_DrawingGroup, RT_Environment, RT_ExternalObjectList, RT_ExternalObjectListAtom, RT_ExternalObjectRefAtom, RT_ExternalOleEmbed, RT_ExternalOleEmbedAtom, RT_ExternalOleObjectAtom, RT_ExternalOleObjectStg, RT_FontCollection, RT_FontEntityAtom, RT_List, RT_MainMaster, RT_MasterTextPropAtom, RT_Notes, RT_NotesAtom, RT_OutlineTextRefAtom, RT_PersistDirectoryAtom, RT_PlaceholderAtom, RT_Slide, RT_SlideAtom, RT_SlideListWithText, RT_SlidePersistAtom, RT_StyleTextPropAtom, RT_TextBytesAtom, RT_TextCharsAtom, RT_TextHeaderAtom, RT_TextMasterStyleAtom, RT_TextRulerAtom, RT_TextSpecialInfoAtom, RT_TextSpecialInfoDefaultAtom, RT_UserEditAtom, SLIDE_LIST_INSTANCE_MASTERS, SLIDE_LIST_INSTANCE_NOTES, SLIDE_LIST_INSTANCE_SLIDES };
|
|
@@ -48,4 +48,5 @@ exports.CURRENT_USER_DOC_FILE_VERSION = CURRENT_USER_DOC_FILE_VERSION;
|
|
|
48
48
|
exports.CURRENT_USER_FIXED_SIZE = CURRENT_USER_FIXED_SIZE;
|
|
49
49
|
exports.CURRENT_USER_HEADER_TOKEN_ENCRYPTED = CURRENT_USER_HEADER_TOKEN_ENCRYPTED;
|
|
50
50
|
exports.CURRENT_USER_HEADER_TOKEN_PLAIN = CURRENT_USER_HEADER_TOKEN_PLAIN;
|
|
51
|
+
exports.decodeUtf16Le = decodeUtf16Le;
|
|
51
52
|
exports.readCurrentUserAtom = readCurrentUserAtom;
|
|
@@ -8,6 +8,7 @@ interface CurrentUser {
|
|
|
8
8
|
readonly encrypted: boolean;
|
|
9
9
|
readonly userName: string;
|
|
10
10
|
}
|
|
11
|
+
declare function decodeUtf16Le(bytes: Uint8Array<ArrayBuffer>): string;
|
|
11
12
|
declare function readCurrentUserAtom(streamBytes: Uint8Array<ArrayBuffer>): CurrentUser;
|
|
12
13
|
//#endregion
|
|
13
|
-
export { CURRENT_USER_DOC_FILE_VERSION, CURRENT_USER_FIXED_SIZE, CURRENT_USER_HEADER_TOKEN_ENCRYPTED, CURRENT_USER_HEADER_TOKEN_PLAIN, CurrentUser, readCurrentUserAtom };
|
|
14
|
+
export { CURRENT_USER_DOC_FILE_VERSION, CURRENT_USER_FIXED_SIZE, CURRENT_USER_HEADER_TOKEN_ENCRYPTED, CURRENT_USER_HEADER_TOKEN_PLAIN, CurrentUser, decodeUtf16Le, readCurrentUserAtom };
|
|
@@ -8,6 +8,7 @@ interface CurrentUser {
|
|
|
8
8
|
readonly encrypted: boolean;
|
|
9
9
|
readonly userName: string;
|
|
10
10
|
}
|
|
11
|
+
declare function decodeUtf16Le(bytes: Uint8Array<ArrayBuffer>): string;
|
|
11
12
|
declare function readCurrentUserAtom(streamBytes: Uint8Array<ArrayBuffer>): CurrentUser;
|
|
12
13
|
//#endregion
|
|
13
|
-
export { CURRENT_USER_DOC_FILE_VERSION, CURRENT_USER_FIXED_SIZE, CURRENT_USER_HEADER_TOKEN_ENCRYPTED, CURRENT_USER_HEADER_TOKEN_PLAIN, CurrentUser, readCurrentUserAtom };
|
|
14
|
+
export { CURRENT_USER_DOC_FILE_VERSION, CURRENT_USER_FIXED_SIZE, CURRENT_USER_HEADER_TOKEN_ENCRYPTED, CURRENT_USER_HEADER_TOKEN_PLAIN, CurrentUser, decodeUtf16Le, readCurrentUserAtom };
|
|
@@ -43,4 +43,4 @@ function readCurrentUserAtom(streamBytes) {
|
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
//#endregion
|
|
46
|
-
export { CURRENT_USER_DOC_FILE_VERSION, CURRENT_USER_FIXED_SIZE, CURRENT_USER_HEADER_TOKEN_ENCRYPTED, CURRENT_USER_HEADER_TOKEN_PLAIN, readCurrentUserAtom };
|
|
46
|
+
export { CURRENT_USER_DOC_FILE_VERSION, CURRENT_USER_FIXED_SIZE, CURRENT_USER_HEADER_TOKEN_ENCRYPTED, CURRENT_USER_HEADER_TOKEN_PLAIN, decodeUtf16Le, readCurrentUserAtom };
|
package/dist/units.cjs
CHANGED
|
@@ -9,8 +9,18 @@ function masterUnitsToPoints(masterUnits) {
|
|
|
9
9
|
function pointsToMasterUnits(points) {
|
|
10
10
|
return Math.round(points * 8);
|
|
11
11
|
}
|
|
12
|
+
const EMU_PER_POINT = 12700;
|
|
13
|
+
function emuToPoints(emu) {
|
|
14
|
+
return emu / EMU_PER_POINT;
|
|
15
|
+
}
|
|
16
|
+
function pointsToEmu(points) {
|
|
17
|
+
return Math.round(points * EMU_PER_POINT);
|
|
18
|
+
}
|
|
12
19
|
//#endregion
|
|
20
|
+
exports.EMU_PER_POINT = EMU_PER_POINT;
|
|
13
21
|
exports.MASTER_UNITS_PER_POINT = MASTER_UNITS_PER_POINT;
|
|
14
22
|
exports.POINTS_PER_INCH = POINTS_PER_INCH;
|
|
23
|
+
exports.emuToPoints = emuToPoints;
|
|
15
24
|
exports.masterUnitsToPoints = masterUnitsToPoints;
|
|
25
|
+
exports.pointsToEmu = pointsToEmu;
|
|
16
26
|
exports.pointsToMasterUnits = pointsToMasterUnits;
|
package/dist/units.d.cts
CHANGED
|
@@ -3,5 +3,8 @@ declare const POINTS_PER_INCH = 72;
|
|
|
3
3
|
declare const MASTER_UNITS_PER_POINT: number;
|
|
4
4
|
declare function masterUnitsToPoints(masterUnits: number): number;
|
|
5
5
|
declare function pointsToMasterUnits(points: number): number;
|
|
6
|
+
declare const EMU_PER_POINT: number;
|
|
7
|
+
declare function emuToPoints(emu: number): number;
|
|
8
|
+
declare function pointsToEmu(points: number): number;
|
|
6
9
|
//#endregion
|
|
7
|
-
export { MASTER_UNITS_PER_POINT, POINTS_PER_INCH, masterUnitsToPoints, pointsToMasterUnits };
|
|
10
|
+
export { EMU_PER_POINT, MASTER_UNITS_PER_POINT, POINTS_PER_INCH, emuToPoints, masterUnitsToPoints, pointsToEmu, pointsToMasterUnits };
|
package/dist/units.d.ts
CHANGED
|
@@ -3,5 +3,8 @@ declare const POINTS_PER_INCH = 72;
|
|
|
3
3
|
declare const MASTER_UNITS_PER_POINT: number;
|
|
4
4
|
declare function masterUnitsToPoints(masterUnits: number): number;
|
|
5
5
|
declare function pointsToMasterUnits(points: number): number;
|
|
6
|
+
declare const EMU_PER_POINT: number;
|
|
7
|
+
declare function emuToPoints(emu: number): number;
|
|
8
|
+
declare function pointsToEmu(points: number): number;
|
|
6
9
|
//#endregion
|
|
7
|
-
export { MASTER_UNITS_PER_POINT, POINTS_PER_INCH, masterUnitsToPoints, pointsToMasterUnits };
|
|
10
|
+
export { EMU_PER_POINT, MASTER_UNITS_PER_POINT, POINTS_PER_INCH, emuToPoints, masterUnitsToPoints, pointsToEmu, pointsToMasterUnits };
|
package/dist/units.js
CHANGED
|
@@ -8,5 +8,12 @@ function masterUnitsToPoints(masterUnits) {
|
|
|
8
8
|
function pointsToMasterUnits(points) {
|
|
9
9
|
return Math.round(points * 8);
|
|
10
10
|
}
|
|
11
|
+
const EMU_PER_POINT = 12700;
|
|
12
|
+
function emuToPoints(emu) {
|
|
13
|
+
return emu / EMU_PER_POINT;
|
|
14
|
+
}
|
|
15
|
+
function pointsToEmu(points) {
|
|
16
|
+
return Math.round(points * EMU_PER_POINT);
|
|
17
|
+
}
|
|
11
18
|
//#endregion
|
|
12
|
-
export { MASTER_UNITS_PER_POINT, POINTS_PER_INCH, masterUnitsToPoints, pointsToMasterUnits };
|
|
19
|
+
export { EMU_PER_POINT, MASTER_UNITS_PER_POINT, POINTS_PER_INCH, emuToPoints, masterUnitsToPoints, pointsToEmu, pointsToMasterUnits };
|
package/dist/write.cjs
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_base64 = require("./base64.cjs");
|
|
2
3
|
const require_errors = require("./errors.cjs");
|
|
3
4
|
const require_record_types = require("./record/types.cjs");
|
|
4
5
|
const require_content_write = require("./content-write.cjs");
|
|
6
|
+
const require_diagnostics = require("./diagnostics.cjs");
|
|
5
7
|
const require_record_write = require("./record/write.cjs");
|
|
6
8
|
const require_document_document_atom_write = require("./document/document-atom-write.cjs");
|
|
7
9
|
const require_document_fonts_write = require("./document/fonts-write.cjs");
|
|
8
|
-
const
|
|
10
|
+
const require_drawing_blips = require("./drawing/blips.cjs");
|
|
9
11
|
const require_read = require("./read.cjs");
|
|
12
|
+
const require_drawing_shapes_write = require("./drawing/shapes-write.cjs");
|
|
10
13
|
const require_document_master_write = require("./document/master-write.cjs");
|
|
11
14
|
const require_document_notes_list_write = require("./document/notes-list-write.cjs");
|
|
12
15
|
const require_document_notes_write = require("./document/notes-write.cjs");
|
|
@@ -14,6 +17,7 @@ const require_document_slide_list_write = require("./document/slide-list-write.c
|
|
|
14
17
|
const require_metadata = require("./metadata.cjs");
|
|
15
18
|
const require_stream_current_user_write = require("./stream/current-user-write.cjs");
|
|
16
19
|
const require_stream_persist_write = require("./stream/persist-write.cjs");
|
|
20
|
+
const require_ole_embedded_write = require("./ole/embedded-write.cjs");
|
|
17
21
|
let archive_codec = require("archive-codec");
|
|
18
22
|
let document_schema_js = require("document-schema.js");
|
|
19
23
|
//#region src/write.ts
|
|
@@ -32,65 +36,160 @@ function requireOneSlideSize(slides) {
|
|
|
32
36
|
for (const slide of slides) if (slide.size.widthPt !== first.widthPt || slide.size.heightPt !== first.heightPt) throw new require_errors.PptUnsupportedContentError(`ppt-codec's writer cannot express per-slide sizes: slide sizes ${JSON.stringify(first)} and ${JSON.stringify(slide.size)} both appear, but [MS-PPT]'s DocumentAtom states exactly one slide size for the whole presentation`);
|
|
33
37
|
return first;
|
|
34
38
|
}
|
|
35
|
-
function writeSlideContainer(shapes, notesIdRef,
|
|
36
|
-
|
|
39
|
+
function writeSlideContainer(shapes, notesIdRef, context, clientDataFor) {
|
|
40
|
+
const drawing = require_drawing_shapes_write.writeSlideDrawing(shapes.map((shape) => ({
|
|
41
|
+
shape,
|
|
42
|
+
clientData: clientDataFor(shape)
|
|
43
|
+
})), context);
|
|
44
|
+
return {
|
|
45
|
+
bytes: require_record_write.writeContainer(require_record_types.RT_Slide, [require_document_master_write.writeSlideAtomForSlide(notesIdRef), drawing.bytes]),
|
|
46
|
+
shapeCount: drawing.shapeCount,
|
|
47
|
+
maxSpid: drawing.maxSpid
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function planOleEmbeds(slides, serialise, firstPersistId) {
|
|
51
|
+
const embeds = [];
|
|
52
|
+
const persistObjects = [];
|
|
53
|
+
const clientDataByShape = /* @__PURE__ */ new Map();
|
|
54
|
+
if (serialise !== void 0) for (const slide of slides) for (const shape of slide.shapes) {
|
|
55
|
+
const embedBlock = shape.blocks.find((block) => block.kind === "embeddedObject");
|
|
56
|
+
if (embedBlock === void 0) continue;
|
|
57
|
+
const storageBytes = serialise(embedBlock.document);
|
|
58
|
+
if (storageBytes === void 0) continue;
|
|
59
|
+
const exObjId = embeds.length + 1;
|
|
60
|
+
const persistId = firstPersistId + persistObjects.length;
|
|
61
|
+
embeds.push({
|
|
62
|
+
exObjId,
|
|
63
|
+
persistIdRef: persistId,
|
|
64
|
+
objectKind: embedBlock.objectKind
|
|
65
|
+
});
|
|
66
|
+
persistObjects.push({
|
|
67
|
+
persistId,
|
|
68
|
+
bytes: require_ole_embedded_write.writeExOleObjStg(storageBytes)
|
|
69
|
+
});
|
|
70
|
+
clientDataByShape.set(shape, require_ole_embedded_write.writeOleClientData(exObjId));
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
embeds,
|
|
74
|
+
persistObjects,
|
|
75
|
+
clientDataFor: (shape) => clientDataByShape.get(shape)
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function planBlipStore(slides) {
|
|
79
|
+
const blips = [];
|
|
80
|
+
const pibByKey = /* @__PURE__ */ new Map();
|
|
81
|
+
for (const slide of slides) for (const shape of slide.shapes) for (const block of shape.blocks) {
|
|
82
|
+
if (block.kind !== "image" || !require_drawing_blips.isBlipFormat(block.format)) continue;
|
|
83
|
+
const key = `${block.format}:${block.base64}`;
|
|
84
|
+
if (!pibByKey.has(key)) {
|
|
85
|
+
pibByKey.set(key, blips.length + 1);
|
|
86
|
+
blips.push({
|
|
87
|
+
format: block.format,
|
|
88
|
+
bytes: require_base64.base64ToBytes(block.base64)
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
blips,
|
|
94
|
+
pibOf: (image) => {
|
|
95
|
+
const pib = pibByKey.get(`${image.format}:${image.base64}`);
|
|
96
|
+
if (pib === void 0) throw new require_errors.PptUnsupportedContentError("internal error: an image block reached the drawing writer without first being collected into the document's blip store");
|
|
97
|
+
return pib;
|
|
98
|
+
}
|
|
99
|
+
};
|
|
37
100
|
}
|
|
38
|
-
function writePptStreams(document) {
|
|
101
|
+
function writePptStreams(document, options = {}) {
|
|
102
|
+
options.signal?.throwIfAborted();
|
|
39
103
|
const { slides } = document;
|
|
40
104
|
const size = requireOneSlideSize(slides);
|
|
105
|
+
const sink = options.sink ?? require_diagnostics.NOOP_PPT_DIAGNOSTIC_SINK;
|
|
41
106
|
const fontNames = require_content_write.collectFontFamilies(slides.map((slide) => slide.shapes.flatMap((shape) => shape.blocks)));
|
|
42
107
|
const fontIndexOf = (family) => {
|
|
43
108
|
const index = fontNames.indexOf(family);
|
|
44
109
|
if (index === -1) throw new require_errors.PptUnsupportedContentError(`font family '${family}' was not collected into the document's font table before writing`);
|
|
45
110
|
return index;
|
|
46
111
|
};
|
|
112
|
+
const store = planBlipStore(slides);
|
|
113
|
+
const strict = options.onUnwritableBlock === "throw";
|
|
114
|
+
const contextFor = (location) => ({
|
|
115
|
+
fontIndexOf,
|
|
116
|
+
blipIndexOf: store.pibOf,
|
|
117
|
+
sink,
|
|
118
|
+
strict,
|
|
119
|
+
location
|
|
120
|
+
});
|
|
47
121
|
const slidePersistRefs = slides.map((_slide, index) => ({
|
|
48
122
|
persistIdRef: FIRST_SLIDE_PERSIST_ID + index,
|
|
49
123
|
slideId: FIRST_SLIDE_ID + index
|
|
50
124
|
}));
|
|
125
|
+
const notesIdRefs = slides.map((slide, index) => slide.notes.length === 0 ? NO_NOTES_ID_REF : FIRST_NOTES_ID + slides.slice(0, index).filter((earlier) => earlier.notes.length > 0).length);
|
|
126
|
+
const notesCount = notesIdRefs.filter((id) => id !== NO_NOTES_ID_REF).length;
|
|
127
|
+
const oleEmbeds = planOleEmbeds(slides, options.serialiseEmbeddedObject, FIRST_SLIDE_PERSIST_ID + slides.length + notesCount);
|
|
128
|
+
let shapeCount = 0;
|
|
129
|
+
let maxSpid = 0;
|
|
130
|
+
let drawingCount = 0;
|
|
131
|
+
const account = (drawing) => {
|
|
132
|
+
shapeCount += drawing.shapeCount;
|
|
133
|
+
maxSpid = Math.max(maxSpid, drawing.maxSpid);
|
|
134
|
+
drawingCount += 1;
|
|
135
|
+
};
|
|
136
|
+
const mainMaster = require_document_master_write.writeMainMaster(size, contextFor("the main master"));
|
|
137
|
+
account(mainMaster);
|
|
138
|
+
const slideContainers = slides.map((slide, index) => {
|
|
139
|
+
const ref = slidePersistRefs[index];
|
|
140
|
+
const notesIdRef = notesIdRefs[index];
|
|
141
|
+
if (ref === void 0 || notesIdRef === void 0) throw new require_errors.PptUnsupportedContentError("internal error: slide persist reference missing for a slide being written");
|
|
142
|
+
const container = writeSlideContainer(slide.shapes, notesIdRef, contextFor(`slide ${index + 1}`), oleEmbeds.clientDataFor);
|
|
143
|
+
account(container);
|
|
144
|
+
return {
|
|
145
|
+
persistId: ref.persistIdRef,
|
|
146
|
+
bytes: container.bytes
|
|
147
|
+
};
|
|
148
|
+
});
|
|
51
149
|
const notesPersists = [];
|
|
52
150
|
const notesContainers = [];
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
151
|
+
slides.forEach((slide, index) => {
|
|
152
|
+
const notesId = notesIdRefs[index];
|
|
153
|
+
if (notesId === void 0 || notesId === NO_NOTES_ID_REF) return;
|
|
154
|
+
const persistIdRef = FIRST_SLIDE_PERSIST_ID + slides.length + notesPersists.length;
|
|
56
155
|
notesPersists.push({
|
|
57
|
-
persistIdRef
|
|
156
|
+
persistIdRef,
|
|
58
157
|
notesId
|
|
59
158
|
});
|
|
60
|
-
|
|
61
|
-
|
|
159
|
+
const container = require_document_notes_write.writeNotesContainer(FIRST_SLIDE_ID + index, slide.notes, size, contextFor(`slide ${index + 1}'s speaker notes`));
|
|
160
|
+
account(container);
|
|
161
|
+
notesContainers.push({
|
|
162
|
+
persistId: persistIdRef,
|
|
163
|
+
bytes: container.bytes
|
|
164
|
+
});
|
|
62
165
|
});
|
|
63
166
|
const environment = require_document_fonts_write.writeEnvironment(fontNames);
|
|
64
167
|
const documentChildren = [require_document_document_atom_write.writeDocumentAtom(size)];
|
|
168
|
+
const exObjList = require_ole_embedded_write.writeExObjListContainer(oleEmbeds.embeds);
|
|
169
|
+
if (exObjList !== void 0) documentChildren.push(exObjList);
|
|
65
170
|
if (environment !== void 0) documentChildren.push(environment);
|
|
171
|
+
documentChildren.push(require_drawing_blips.writeDrawingGroupContainer(store.blips, {
|
|
172
|
+
spidMax: maxSpid,
|
|
173
|
+
shapeCount,
|
|
174
|
+
drawingCount
|
|
175
|
+
}));
|
|
66
176
|
documentChildren.push(require_document_master_write.writeMasterListWithText(MASTER_PERSIST_ID));
|
|
67
177
|
documentChildren.push(require_document_slide_list_write.writeSlideListWithText(slidePersistRefs));
|
|
68
178
|
if (notesPersists.length > 0) documentChildren.push(require_document_notes_list_write.writeNotesListWithText(notesPersists));
|
|
69
179
|
const documentContainer = require_record_write.writeContainer(require_record_types.RT_Document, documentChildren);
|
|
70
|
-
const persistObjects = [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
persistObjects
|
|
82
|
-
|
|
83
|
-
bytes: writeSlideContainer(slide.shapes, notesIdRef, fontIndexOf)
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
notesPersists.forEach((persist, index) => {
|
|
87
|
-
const bytes = notesContainers[index];
|
|
88
|
-
if (bytes === void 0) throw new require_errors.PptUnsupportedContentError("internal error: notes container missing for a notes persist reference");
|
|
89
|
-
persistObjects.push({
|
|
90
|
-
persistId: persist.persistIdRef,
|
|
91
|
-
bytes
|
|
92
|
-
});
|
|
93
|
-
});
|
|
180
|
+
const persistObjects = [
|
|
181
|
+
{
|
|
182
|
+
persistId: DOCUMENT_PERSIST_ID,
|
|
183
|
+
bytes: documentContainer
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
persistId: MASTER_PERSIST_ID,
|
|
187
|
+
bytes: mainMaster.bytes
|
|
188
|
+
},
|
|
189
|
+
...slideContainers,
|
|
190
|
+
...notesContainers,
|
|
191
|
+
...oleEmbeds.persistObjects
|
|
192
|
+
];
|
|
94
193
|
const persistEntries = [];
|
|
95
194
|
let offset = 0;
|
|
96
195
|
for (const object of persistObjects) {
|
|
@@ -116,8 +215,8 @@ function writePptStreams(document) {
|
|
|
116
215
|
powerPointDocumentStream: require_record_write.concatBytes(...persistObjects.map((object) => object.bytes), persistDirectory, userEdit)
|
|
117
216
|
};
|
|
118
217
|
}
|
|
119
|
-
function writePptContent(document) {
|
|
120
|
-
const { currentUserStream, powerPointDocumentStream } = writePptStreams(document);
|
|
218
|
+
function writePptContent(document, options = {}) {
|
|
219
|
+
const { currentUserStream, powerPointDocumentStream } = writePptStreams(document, options);
|
|
121
220
|
const streams = [{
|
|
122
221
|
path: require_read.CURRENT_USER_STREAM,
|
|
123
222
|
bytes: currentUserStream
|
|
@@ -131,13 +230,13 @@ function writePptContent(document) {
|
|
|
131
230
|
});
|
|
132
231
|
return (0, archive_codec.writeCompoundFile)(streams);
|
|
133
232
|
}
|
|
134
|
-
function writePpt(tree) {
|
|
233
|
+
function writePpt(tree, options = {}) {
|
|
135
234
|
const content = (0, document_schema_js.flattenTree)(tree);
|
|
136
235
|
if (content.kind !== "presentation") throw new require_errors.PptUnsupportedContentError(`ppt-codec's writer only writes presentation documents; got a '${content.kind}' document`);
|
|
137
236
|
return writePptContent({
|
|
138
237
|
metadata: content.metadata,
|
|
139
238
|
slides: content.slides
|
|
140
|
-
});
|
|
239
|
+
}, options);
|
|
141
240
|
}
|
|
142
241
|
//#endregion
|
|
143
242
|
exports.writePpt = writePpt;
|
package/dist/write.d.cts
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
|
+
import { a as PptDiagnosticSink } from "./diagnostics-CqxAnubw.cjs";
|
|
1
2
|
import { PptDocument } from "./read.cjs";
|
|
2
|
-
import { DocumentTree } from "document-schema.js";
|
|
3
|
+
import { ContentDocument, DocumentTree } from "document-schema.js";
|
|
3
4
|
//#region src/write.d.ts
|
|
4
|
-
|
|
5
|
+
type EmbeddedObjectSerialiser = (document: ContentDocument) => Uint8Array<ArrayBuffer> | undefined;
|
|
6
|
+
type PptUnwritableBlockPolicy = "drop" | "throw";
|
|
7
|
+
interface WritePptOptions {
|
|
8
|
+
readonly signal?: AbortSignal;
|
|
9
|
+
readonly sink?: PptDiagnosticSink;
|
|
10
|
+
readonly serialiseEmbeddedObject?: EmbeddedObjectSerialiser;
|
|
11
|
+
readonly onUnwritableBlock?: PptUnwritableBlockPolicy;
|
|
12
|
+
}
|
|
13
|
+
declare function writePptStreams(document: PptDocument, options?: WritePptOptions): {
|
|
5
14
|
readonly currentUserStream: Uint8Array<ArrayBuffer>;
|
|
6
15
|
readonly powerPointDocumentStream: Uint8Array<ArrayBuffer>;
|
|
7
16
|
};
|
|
8
|
-
declare function writePptContent(document: PptDocument): Uint8Array<ArrayBuffer>;
|
|
9
|
-
declare function writePpt(tree: DocumentTree): Uint8Array<ArrayBuffer>;
|
|
17
|
+
declare function writePptContent(document: PptDocument, options?: WritePptOptions): Uint8Array<ArrayBuffer>;
|
|
18
|
+
declare function writePpt(tree: DocumentTree, options?: WritePptOptions): Uint8Array<ArrayBuffer>;
|
|
10
19
|
//#endregion
|
|
11
|
-
export { writePpt, writePptContent, writePptStreams };
|
|
20
|
+
export { EmbeddedObjectSerialiser, PptUnwritableBlockPolicy, WritePptOptions, writePpt, writePptContent, writePptStreams };
|
package/dist/write.d.ts
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
|
+
import { a as PptDiagnosticSink } from "./diagnostics-CqxAnubw.js";
|
|
1
2
|
import { PptDocument } from "./read.js";
|
|
2
|
-
import { DocumentTree } from "document-schema.js";
|
|
3
|
+
import { ContentDocument, DocumentTree } from "document-schema.js";
|
|
3
4
|
//#region src/write.d.ts
|
|
4
|
-
|
|
5
|
+
type EmbeddedObjectSerialiser = (document: ContentDocument) => Uint8Array<ArrayBuffer> | undefined;
|
|
6
|
+
type PptUnwritableBlockPolicy = "drop" | "throw";
|
|
7
|
+
interface WritePptOptions {
|
|
8
|
+
readonly signal?: AbortSignal;
|
|
9
|
+
readonly sink?: PptDiagnosticSink;
|
|
10
|
+
readonly serialiseEmbeddedObject?: EmbeddedObjectSerialiser;
|
|
11
|
+
readonly onUnwritableBlock?: PptUnwritableBlockPolicy;
|
|
12
|
+
}
|
|
13
|
+
declare function writePptStreams(document: PptDocument, options?: WritePptOptions): {
|
|
5
14
|
readonly currentUserStream: Uint8Array<ArrayBuffer>;
|
|
6
15
|
readonly powerPointDocumentStream: Uint8Array<ArrayBuffer>;
|
|
7
16
|
};
|
|
8
|
-
declare function writePptContent(document: PptDocument): Uint8Array<ArrayBuffer>;
|
|
9
|
-
declare function writePpt(tree: DocumentTree): Uint8Array<ArrayBuffer>;
|
|
17
|
+
declare function writePptContent(document: PptDocument, options?: WritePptOptions): Uint8Array<ArrayBuffer>;
|
|
18
|
+
declare function writePpt(tree: DocumentTree, options?: WritePptOptions): Uint8Array<ArrayBuffer>;
|
|
10
19
|
//#endregion
|
|
11
|
-
export { writePpt, writePptContent, writePptStreams };
|
|
20
|
+
export { EmbeddedObjectSerialiser, PptUnwritableBlockPolicy, WritePptOptions, writePpt, writePptContent, writePptStreams };
|