@cj-tech-master/excelts 9.5.5 → 9.5.6

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.
Files changed (60) hide show
  1. package/dist/browser/modules/excel/worksheet.d.ts +11 -0
  2. package/dist/browser/modules/excel/worksheet.js +13 -0
  3. package/dist/browser/modules/formula/integration/apply-writeback-plan.js +17 -3
  4. package/dist/browser/modules/formula/integration/workbook-adapter.js +20 -1
  5. package/dist/browser/modules/formula/integration/workbook-snapshot.d.ts +12 -0
  6. package/dist/browser/modules/formula/materialize/build-writeback-plan.js +47 -0
  7. package/dist/browser/modules/formula/materialize/types.d.ts +19 -3
  8. package/dist/browser/modules/formula/materialize/types.js +13 -3
  9. package/dist/browser/modules/pdf/builder/document-builder.js +2 -2
  10. package/dist/browser/modules/pdf/font/system-fonts.d.ts +24 -4
  11. package/dist/browser/modules/pdf/font/system-fonts.js +76 -32
  12. package/dist/browser/modules/pdf/render/pdf-exporter.js +6 -3
  13. package/dist/browser/modules/word/advanced/field-engine.js +151 -23
  14. package/dist/browser/modules/word/advanced/math-convert.js +2 -1
  15. package/dist/browser/modules/word/advanced/style-map.js +44 -6
  16. package/dist/browser/modules/word/convert/html/html-import.js +434 -71
  17. package/dist/browser/modules/word/convert/markdown/markdown-renderer.js +11 -3
  18. package/dist/browser/modules/word/layout/layout-full.js +4 -1
  19. package/dist/browser/modules/word/security/digital-signatures.js +160 -33
  20. package/dist/browser/modules/word/security/encryption.js +109 -9
  21. package/dist/cjs/modules/excel/worksheet.js +13 -0
  22. package/dist/cjs/modules/formula/integration/apply-writeback-plan.js +17 -3
  23. package/dist/cjs/modules/formula/integration/workbook-adapter.js +20 -1
  24. package/dist/cjs/modules/formula/materialize/build-writeback-plan.js +47 -0
  25. package/dist/cjs/modules/formula/materialize/types.js +13 -3
  26. package/dist/cjs/modules/pdf/builder/document-builder.js +1 -1
  27. package/dist/cjs/modules/pdf/font/system-fonts.js +77 -32
  28. package/dist/cjs/modules/pdf/render/pdf-exporter.js +5 -2
  29. package/dist/cjs/modules/word/advanced/field-engine.js +151 -23
  30. package/dist/cjs/modules/word/advanced/math-convert.js +2 -1
  31. package/dist/cjs/modules/word/advanced/style-map.js +44 -6
  32. package/dist/cjs/modules/word/convert/html/html-import.js +434 -71
  33. package/dist/cjs/modules/word/convert/markdown/markdown-renderer.js +11 -3
  34. package/dist/cjs/modules/word/layout/layout-full.js +4 -1
  35. package/dist/cjs/modules/word/security/digital-signatures.js +160 -33
  36. package/dist/cjs/modules/word/security/encryption.js +109 -9
  37. package/dist/esm/modules/excel/worksheet.js +13 -0
  38. package/dist/esm/modules/formula/integration/apply-writeback-plan.js +17 -3
  39. package/dist/esm/modules/formula/integration/workbook-adapter.js +20 -1
  40. package/dist/esm/modules/formula/materialize/build-writeback-plan.js +47 -0
  41. package/dist/esm/modules/formula/materialize/types.js +13 -3
  42. package/dist/esm/modules/pdf/builder/document-builder.js +2 -2
  43. package/dist/esm/modules/pdf/font/system-fonts.js +76 -32
  44. package/dist/esm/modules/pdf/render/pdf-exporter.js +6 -3
  45. package/dist/esm/modules/word/advanced/field-engine.js +151 -23
  46. package/dist/esm/modules/word/advanced/math-convert.js +2 -1
  47. package/dist/esm/modules/word/advanced/style-map.js +44 -6
  48. package/dist/esm/modules/word/convert/html/html-import.js +434 -71
  49. package/dist/esm/modules/word/convert/markdown/markdown-renderer.js +11 -3
  50. package/dist/esm/modules/word/layout/layout-full.js +4 -1
  51. package/dist/esm/modules/word/security/digital-signatures.js +160 -33
  52. package/dist/esm/modules/word/security/encryption.js +109 -9
  53. package/dist/iife/excelts.iife.js +40 -26
  54. package/dist/iife/excelts.iife.js.map +1 -1
  55. package/dist/iife/excelts.iife.min.js +3 -3
  56. package/dist/types/modules/excel/worksheet.d.ts +11 -0
  57. package/dist/types/modules/formula/integration/workbook-snapshot.d.ts +12 -0
  58. package/dist/types/modules/formula/materialize/types.d.ts +19 -3
  59. package/dist/types/modules/pdf/font/system-fonts.d.ts +24 -4
  60. package/package.json +1 -1
@@ -339,6 +339,17 @@ declare class Worksheet {
339
339
  */
340
340
  private _spliceMerges;
341
341
  get hasMerges(): boolean;
342
+ /**
343
+ * Read-only enumeration of every merged region on this sheet
344
+ * (1-based, inclusive). Consumed by the formula engine's snapshot
345
+ * builder to detect `#SPILL!` conflicts. See issue #162 follow-up.
346
+ */
347
+ get mergedRegions(): ReadonlyArray<{
348
+ readonly top: number;
349
+ readonly left: number;
350
+ readonly bottom: number;
351
+ readonly right: number;
352
+ }>;
342
353
  /**
343
354
  * Scan the range and if any cell is part of a merge, un-merge the group.
344
355
  * Note this function can affect multiple merges and merge-blocks are
@@ -121,6 +121,18 @@ export interface WorksheetSnapshot {
121
121
  readonly hiddenRows: ReadonlySet<number>;
122
122
  /** Tables defined in this worksheet. */
123
123
  readonly tables: readonly TableSnapshot[];
124
+ /**
125
+ * Merged regions on this worksheet, as 1-based inclusive rectangles.
126
+ * Consulted by the writeback planner to reject `#SPILL!` conflicts;
127
+ * the evaluator does not need this since merge slaves are already
128
+ * filtered out of `cells`.
129
+ */
130
+ readonly mergedRegions: readonly {
131
+ readonly top: number;
132
+ readonly left: number;
133
+ readonly bottom: number;
134
+ readonly right: number;
135
+ }[];
124
136
  }
125
137
  /**
126
138
  * Column definition within a table.
@@ -23,18 +23,28 @@ export interface CellErrorValueLike {
23
23
  */
24
24
  export type FormulaResultLike = number | string | boolean | Date | CellErrorValueLike | undefined;
25
25
  /**
26
- * Numeric cell-type tag exposed by host cells. The engine only compares
27
- * against `Null` and `Formula`; any other value is treated as a scalar
28
- * literal.
26
+ * Numeric cell-type tag exposed by host cells. The engine compares
27
+ * against `Null`, `Merge`, and `Formula`; any other value is treated as
28
+ * a scalar literal.
29
+ *
30
+ * `Merge` identifies a non-master cell inside a merged region. The
31
+ * host's in-memory model may proxy `cell.value` from slaves to the
32
+ * master (see `MergeValue` in `@excel/cell`), so the snapshot builder
33
+ * must filter merge slaves out — otherwise range aggregates count the
34
+ * master's value once per slave. See issue #162.
29
35
  *
30
36
  * Kept as inline numeric literals (not an enum) so this file stays free
31
37
  * of runtime dependencies. The `const` object and `type` alias share a
32
38
  * name via TypeScript's declaration merging — the value form
33
39
  * (`CellValueTypeLike.Null`, `CellValueTypeLike.Formula`) is used at
34
40
  * comparison sites, the type form annotates `CellLike.type`.
41
+ *
42
+ * The numeric values must stay in sync with `ValueType` in
43
+ * `@excel/enums`, which is what `@excel/cell` writes into `cell.type`.
35
44
  */
36
45
  export declare const CellValueTypeLike: {
37
46
  readonly Null: 0;
47
+ readonly Merge: 1;
38
48
  readonly Formula: 6;
39
49
  };
40
50
  export type CellValueTypeLike = number;
@@ -118,6 +128,12 @@ export interface WorksheetLike {
118
128
  findCell(row: number, col: number): CellLike | undefined;
119
129
  getCell(row: number, col: number): CellLike;
120
130
  getTables?(): TableRefLike[];
131
+ /**
132
+ * Read-only enumeration of the worksheet's merged regions (1-based,
133
+ * inclusive). Optional for hosts that don't model merge state — the
134
+ * snapshot builder treats absence as "no merges".
135
+ */
136
+ readonly mergedRegions?: readonly DimensionsLike[];
121
137
  }
122
138
  /**
123
139
  * A complete defined name entry with all details.
@@ -11,23 +11,43 @@
11
11
  * .ttc (TrueType Collection) files are supported — parseTtf() extracts
12
12
  * the first font from the collection automatically.
13
13
  *
14
- * Results are cached: the filesystem search runs only once per process.
14
+ * Discovery is exposed both as a generator
15
+ * ({@link iterateSystemFontCandidates}) for early-exit callers and as
16
+ * an array snapshot ({@link discoverSystemFontCandidates}) for tests
17
+ * and full enumeration. Once the full snapshot has been produced it is
18
+ * cached and replayed on subsequent calls; partial iterations rely on
19
+ * the OS page cache to make repeat reads of the same font files cheap.
15
20
  */
21
+ /**
22
+ * Lazily yield discoverable system font candidates, in preference order.
23
+ *
24
+ * Each entry is the raw font file bytes of a `.ttf` or `.ttc` file.
25
+ * The caller decides which candidate to use (e.g. by checking cmap coverage).
26
+ *
27
+ * Iterating one candidate at a time lets callers `break` as soon as
28
+ * they find a match, avoiding the cost of recursively reading every
29
+ * font in every system font directory just to discard them.
30
+ */
31
+ export declare function iterateSystemFontCandidates(): Generator<Uint8Array, void, void>;
16
32
  /**
17
33
  * Return all discoverable system font candidates, ordered by preference.
18
34
  *
19
35
  * Each entry is the raw font file bytes of a `.ttf` or `.ttc` file.
20
36
  * The caller decides which candidate to use (e.g. by checking cmap coverage).
21
37
  *
22
- * Results are cached the filesystem scan runs only once per process.
38
+ * The full snapshot is cached: once produced, repeated calls return the
39
+ * same array without touching the filesystem.
40
+ *
41
+ * Prefer {@link iterateSystemFontCandidates} when you only need the
42
+ * first candidate that satisfies a predicate: it avoids reading every
43
+ * font in every system directory just to discard them.
23
44
  */
24
45
  export declare function discoverSystemFontCandidates(): Uint8Array[];
25
46
  /**
26
47
  * Search for a system font suitable for Unicode rendering.
27
48
  *
28
49
  * Returns the raw font file bytes of the highest-priority candidate,
29
- * or `null` if no font was found. This is a convenience wrapper around
30
- * {@link discoverSystemFontCandidates}.
50
+ * or `null` if no font was found.
31
51
  */
32
52
  export declare function discoverSystemFont(): Uint8Array | null;
33
53
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cj-tech-master/excelts",
3
- "version": "9.5.5",
3
+ "version": "9.5.6",
4
4
  "description": "Zero-dependency TypeScript toolkit — Excel (XLSX), PDF, CSV, Markdown, XML, ZIP/TAR, and streaming.",
5
5
  "keywords": [
6
6
  "archive",