@cj-tech-master/excelts 5.0.1-canary.20260123024428.98c7ee0 → 5.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/dist/browser/modules/excel/xlsx/xlsx.browser.d.ts +1 -9
- package/dist/browser/modules/excel/xlsx/xlsx.browser.js +10 -17
- package/dist/cjs/modules/excel/xlsx/xlsx.browser.js +10 -17
- package/dist/esm/modules/excel/xlsx/xlsx.browser.js +10 -17
- package/dist/iife/excelts.iife.js +7 -14
- package/dist/iife/excelts.iife.js.map +1 -1
- package/dist/iife/excelts.iife.min.js +2 -2
- package/dist/types/modules/excel/xlsx/xlsx.browser.d.ts +1 -9
- package/package.json +1 -1
|
@@ -201,15 +201,7 @@ declare class XLSX {
|
|
|
201
201
|
_processTableEntry(stream: IParseStream, model: any, name: string): Promise<void>;
|
|
202
202
|
_processWorksheetRelsEntry(stream: IParseStream, model: any, sheetNo: number): Promise<void>;
|
|
203
203
|
_processMediaEntry(stream: IParseStream, model: any, filename: string): Promise<void>;
|
|
204
|
-
|
|
205
|
-
* Process a drawing XML entry.
|
|
206
|
-
*
|
|
207
|
-
* @param stream - Stream to read from (used in loadFromZipEntries path)
|
|
208
|
-
* @param model - Model to populate
|
|
209
|
-
* @param name - Drawing name (e.g., "drawing1")
|
|
210
|
-
* @param rawData - Pre-read raw data (used in loadFromFiles path to avoid re-reading stream)
|
|
211
|
-
*/
|
|
212
|
-
_processDrawingEntry(stream: IParseStream, model: any, name: string, rawData?: Uint8Array): Promise<void>;
|
|
204
|
+
_processDrawingEntry(entry: any, model: any, name: string): Promise<void>;
|
|
213
205
|
_processDrawingRelsEntry(entry: any, model: any, name: string): Promise<void>;
|
|
214
206
|
_processVmlDrawingEntry(entry: any, model: any, name: string): Promise<void>;
|
|
215
207
|
_processThemeEntry(stream: IParseStream, model: any, name: string): Promise<void>;
|
|
@@ -761,26 +761,16 @@ class XLSX {
|
|
|
761
761
|
});
|
|
762
762
|
}
|
|
763
763
|
}
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
* @param stream - Stream to read from (used in loadFromZipEntries path)
|
|
768
|
-
* @param model - Model to populate
|
|
769
|
-
* @param name - Drawing name (e.g., "drawing1")
|
|
770
|
-
* @param rawData - Pre-read raw data (used in loadFromFiles path to avoid re-reading stream)
|
|
771
|
-
*/
|
|
772
|
-
async _processDrawingEntry(stream, model, name, rawData) {
|
|
773
|
-
// Use provided rawData if available (loadFromFiles path), otherwise collect from stream.
|
|
774
|
-
// In loadFromFiles, the stream is created from already-decoded text, and collecting from
|
|
775
|
-
// it may not work correctly due to PassThrough stream timing issues.
|
|
776
|
-
const data = rawData ?? (await this.collectStreamData(stream));
|
|
764
|
+
async _processDrawingEntry(entry, model, name) {
|
|
765
|
+
// Collect raw data first so we can preserve drawings that reference charts.
|
|
766
|
+
const rawData = await this.collectStreamData(entry);
|
|
777
767
|
// Parse the drawing for normal processing (images, etc.)
|
|
778
768
|
const xform = new DrawingXform();
|
|
779
|
-
const xmlString = this.bufferToString(
|
|
769
|
+
const xmlString = this.bufferToString(rawData);
|
|
780
770
|
const drawing = await xform.parseStream(this.createTextStream(xmlString));
|
|
781
771
|
model.drawings[name] = drawing;
|
|
782
772
|
// Store raw data; reconcile() may later drop it if charts are not referenced.
|
|
783
|
-
model.rawDrawings[name] =
|
|
773
|
+
model.rawDrawings[name] = rawData;
|
|
784
774
|
}
|
|
785
775
|
async _processDrawingRelsEntry(entry, model, name) {
|
|
786
776
|
const xform = new RelationshipsXform();
|
|
@@ -897,8 +887,11 @@ class XLSX {
|
|
|
897
887
|
}
|
|
898
888
|
const drawingName = getDrawingNameFromPath(entryName);
|
|
899
889
|
if (drawingName) {
|
|
900
|
-
await this._processDrawingEntry(stream, model, drawingName
|
|
901
|
-
//
|
|
890
|
+
await this._processDrawingEntry(stream, model, drawingName);
|
|
891
|
+
// For loadFromFiles path, store raw data for passthrough (drawings with charts)
|
|
892
|
+
if (rawData) {
|
|
893
|
+
model.rawDrawings[drawingName] = rawData;
|
|
894
|
+
}
|
|
902
895
|
return true;
|
|
903
896
|
}
|
|
904
897
|
const drawingRelsName = getDrawingNameFromRelsPath(entryName);
|
|
@@ -764,26 +764,16 @@ class XLSX {
|
|
|
764
764
|
});
|
|
765
765
|
}
|
|
766
766
|
}
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
* @param stream - Stream to read from (used in loadFromZipEntries path)
|
|
771
|
-
* @param model - Model to populate
|
|
772
|
-
* @param name - Drawing name (e.g., "drawing1")
|
|
773
|
-
* @param rawData - Pre-read raw data (used in loadFromFiles path to avoid re-reading stream)
|
|
774
|
-
*/
|
|
775
|
-
async _processDrawingEntry(stream, model, name, rawData) {
|
|
776
|
-
// Use provided rawData if available (loadFromFiles path), otherwise collect from stream.
|
|
777
|
-
// In loadFromFiles, the stream is created from already-decoded text, and collecting from
|
|
778
|
-
// it may not work correctly due to PassThrough stream timing issues.
|
|
779
|
-
const data = rawData ?? (await this.collectStreamData(stream));
|
|
767
|
+
async _processDrawingEntry(entry, model, name) {
|
|
768
|
+
// Collect raw data first so we can preserve drawings that reference charts.
|
|
769
|
+
const rawData = await this.collectStreamData(entry);
|
|
780
770
|
// Parse the drawing for normal processing (images, etc.)
|
|
781
771
|
const xform = new drawing_xform_1.DrawingXform();
|
|
782
|
-
const xmlString = this.bufferToString(
|
|
772
|
+
const xmlString = this.bufferToString(rawData);
|
|
783
773
|
const drawing = await xform.parseStream(this.createTextStream(xmlString));
|
|
784
774
|
model.drawings[name] = drawing;
|
|
785
775
|
// Store raw data; reconcile() may later drop it if charts are not referenced.
|
|
786
|
-
model.rawDrawings[name] =
|
|
776
|
+
model.rawDrawings[name] = rawData;
|
|
787
777
|
}
|
|
788
778
|
async _processDrawingRelsEntry(entry, model, name) {
|
|
789
779
|
const xform = new relationships_xform_1.RelationshipsXform();
|
|
@@ -900,8 +890,11 @@ class XLSX {
|
|
|
900
890
|
}
|
|
901
891
|
const drawingName = (0, ooxml_paths_1.getDrawingNameFromPath)(entryName);
|
|
902
892
|
if (drawingName) {
|
|
903
|
-
await this._processDrawingEntry(stream, model, drawingName
|
|
904
|
-
//
|
|
893
|
+
await this._processDrawingEntry(stream, model, drawingName);
|
|
894
|
+
// For loadFromFiles path, store raw data for passthrough (drawings with charts)
|
|
895
|
+
if (rawData) {
|
|
896
|
+
model.rawDrawings[drawingName] = rawData;
|
|
897
|
+
}
|
|
905
898
|
return true;
|
|
906
899
|
}
|
|
907
900
|
const drawingRelsName = (0, ooxml_paths_1.getDrawingNameFromRelsPath)(entryName);
|
|
@@ -761,26 +761,16 @@ class XLSX {
|
|
|
761
761
|
});
|
|
762
762
|
}
|
|
763
763
|
}
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
* @param stream - Stream to read from (used in loadFromZipEntries path)
|
|
768
|
-
* @param model - Model to populate
|
|
769
|
-
* @param name - Drawing name (e.g., "drawing1")
|
|
770
|
-
* @param rawData - Pre-read raw data (used in loadFromFiles path to avoid re-reading stream)
|
|
771
|
-
*/
|
|
772
|
-
async _processDrawingEntry(stream, model, name, rawData) {
|
|
773
|
-
// Use provided rawData if available (loadFromFiles path), otherwise collect from stream.
|
|
774
|
-
// In loadFromFiles, the stream is created from already-decoded text, and collecting from
|
|
775
|
-
// it may not work correctly due to PassThrough stream timing issues.
|
|
776
|
-
const data = rawData ?? (await this.collectStreamData(stream));
|
|
764
|
+
async _processDrawingEntry(entry, model, name) {
|
|
765
|
+
// Collect raw data first so we can preserve drawings that reference charts.
|
|
766
|
+
const rawData = await this.collectStreamData(entry);
|
|
777
767
|
// Parse the drawing for normal processing (images, etc.)
|
|
778
768
|
const xform = new DrawingXform();
|
|
779
|
-
const xmlString = this.bufferToString(
|
|
769
|
+
const xmlString = this.bufferToString(rawData);
|
|
780
770
|
const drawing = await xform.parseStream(this.createTextStream(xmlString));
|
|
781
771
|
model.drawings[name] = drawing;
|
|
782
772
|
// Store raw data; reconcile() may later drop it if charts are not referenced.
|
|
783
|
-
model.rawDrawings[name] =
|
|
773
|
+
model.rawDrawings[name] = rawData;
|
|
784
774
|
}
|
|
785
775
|
async _processDrawingRelsEntry(entry, model, name) {
|
|
786
776
|
const xform = new RelationshipsXform();
|
|
@@ -897,8 +887,11 @@ class XLSX {
|
|
|
897
887
|
}
|
|
898
888
|
const drawingName = getDrawingNameFromPath(entryName);
|
|
899
889
|
if (drawingName) {
|
|
900
|
-
await this._processDrawingEntry(stream, model, drawingName
|
|
901
|
-
//
|
|
890
|
+
await this._processDrawingEntry(stream, model, drawingName);
|
|
891
|
+
// For loadFromFiles path, store raw data for passthrough (drawings with charts)
|
|
892
|
+
if (rawData) {
|
|
893
|
+
model.rawDrawings[drawingName] = rawData;
|
|
894
|
+
}
|
|
902
895
|
return true;
|
|
903
896
|
}
|
|
904
897
|
const drawingRelsName = getDrawingNameFromRelsPath(entryName);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @cj-tech-master/excelts v5.0.1
|
|
2
|
+
* @cj-tech-master/excelts v5.0.1
|
|
3
3
|
* TypeScript Excel Workbook Manager - Read and Write xlsx and csv Files.
|
|
4
4
|
* (c) 2026 cjnoname
|
|
5
5
|
* Released under the MIT License
|
|
@@ -21124,21 +21124,13 @@ var ExcelTS = (function(exports) {
|
|
|
21124
21124
|
});
|
|
21125
21125
|
}
|
|
21126
21126
|
}
|
|
21127
|
-
|
|
21128
|
-
|
|
21129
|
-
*
|
|
21130
|
-
* @param stream - Stream to read from (used in loadFromZipEntries path)
|
|
21131
|
-
* @param model - Model to populate
|
|
21132
|
-
* @param name - Drawing name (e.g., "drawing1")
|
|
21133
|
-
* @param rawData - Pre-read raw data (used in loadFromFiles path to avoid re-reading stream)
|
|
21134
|
-
*/
|
|
21135
|
-
async _processDrawingEntry(stream, model, name, rawData) {
|
|
21136
|
-
const data = rawData ?? await this.collectStreamData(stream);
|
|
21127
|
+
async _processDrawingEntry(entry, model, name) {
|
|
21128
|
+
const rawData = await this.collectStreamData(entry);
|
|
21137
21129
|
const xform = new DrawingXform();
|
|
21138
|
-
const xmlString = this.bufferToString(
|
|
21130
|
+
const xmlString = this.bufferToString(rawData);
|
|
21139
21131
|
const drawing = await xform.parseStream(this.createTextStream(xmlString));
|
|
21140
21132
|
model.drawings[name] = drawing;
|
|
21141
|
-
model.rawDrawings[name] =
|
|
21133
|
+
model.rawDrawings[name] = rawData;
|
|
21142
21134
|
}
|
|
21143
21135
|
async _processDrawingRelsEntry(entry, model, name) {
|
|
21144
21136
|
const relationships = await new RelationshipsXform().parseStream(entry);
|
|
@@ -21225,7 +21217,8 @@ var ExcelTS = (function(exports) {
|
|
|
21225
21217
|
}
|
|
21226
21218
|
const drawingName = getDrawingNameFromPath(entryName);
|
|
21227
21219
|
if (drawingName) {
|
|
21228
|
-
await this._processDrawingEntry(stream, model, drawingName
|
|
21220
|
+
await this._processDrawingEntry(stream, model, drawingName);
|
|
21221
|
+
if (rawData) model.rawDrawings[drawingName] = rawData;
|
|
21229
21222
|
return true;
|
|
21230
21223
|
}
|
|
21231
21224
|
const drawingRelsName = getDrawingNameFromRelsPath(entryName);
|