@ai-matrx/alchemy 0.8.4 → 0.8.5

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/core.js CHANGED
@@ -1340,50 +1340,6 @@ var init_document = __esm({
1340
1340
  }
1341
1341
  });
1342
1342
 
1343
- // src/operate/formats/xlsx.ts
1344
- var xlsx_exports = {};
1345
- __export(xlsx_exports, {
1346
- xlsxEngine: () => xlsxEngine
1347
- });
1348
- var cell, xlsxEngine;
1349
- var init_xlsx = __esm({
1350
- "src/operate/formats/xlsx.ts"() {
1351
- "use strict";
1352
- init_core();
1353
- cell = (value) => value === void 0 || value === null ? null : typeof value === "string" || typeof value === "number" || typeof value === "boolean" ? value : JSON.stringify(value);
1354
- xlsxEngine = {
1355
- async build(draft, options, signal) {
1356
- if (signal.aborted) throw new DOMException("Cancelled", "AbortError");
1357
- const p = draft.payload;
1358
- if (p.kind !== "rows") throw new ContentTransferError("unsupported-format", "An Excel workbook needs table rows. Download it as CSV or JSON instead.");
1359
- const columns = p.columns.filter(
1360
- (c) => c.visible && c.exportable !== false && c.classification !== "secret" && c.classification !== "credential"
1361
- );
1362
- const XLSX = await import("xlsx");
1363
- if (signal.aborted) throw new DOMException("Cancelled", "AbortError");
1364
- const sheet = XLSX.utils.aoa_to_sheet([columns.map((c) => c.label), ...p.rows.map((row) => columns.map((c) => cell(readTransferCell(row, c))))]);
1365
- const book = XLSX.utils.book_new();
1366
- const filename = options.filename ?? "export.xlsx";
1367
- const sheetName = filename.replace(/\.xlsx$/i, "").replace(/[\\/?*[\]:]/g, " ").trim().slice(0, 31) || "Data";
1368
- XLSX.utils.book_append_sheet(book, sheet, sheetName);
1369
- const written = XLSX.write(book, { type: "array", bookType: "xlsx", compression: true });
1370
- return sealTransferArtifact({
1371
- snapshotId: draft.snapshotId,
1372
- draftRevision: draft.revision,
1373
- format: "xlsx",
1374
- plainText: serialize(draft, "tsv", { spreadsheetSafe: true }).plainText,
1375
- file: {
1376
- filename,
1377
- mime: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
1378
- bytes: written instanceof Uint8Array ? written : new Uint8Array(written)
1379
- },
1380
- omissions: draft.omissions.map((o) => ({ ...o }))
1381
- });
1382
- }
1383
- };
1384
- }
1385
- });
1386
-
1387
1343
  // src/operate.ts
1388
1344
  init_core();
1389
1345
 
@@ -1520,7 +1476,7 @@ var FORMAT_ADAPTERS = Object.freeze([
1520
1476
  modes: ["download"],
1521
1477
  runsOn: "client",
1522
1478
  supports: isRows,
1523
- load: lazy(async () => (await Promise.resolve().then(() => (init_xlsx(), xlsx_exports))).xlsxEngine)
1479
+ load: lazy(async () => (await import("@ai-matrx/alchemy/operate/formats/xlsx")).xlsxEngine)
1524
1480
  },
1525
1481
  {
1526
1482
  id: "pdf",