ooxml-core 0.5.0 → 0.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.
Files changed (95) hide show
  1. package/README.md +1 -0
  2. package/dist/digest/algorithm-names.d.ts +20 -0
  3. package/dist/digest/algorithm-names.d.ts.map +1 -0
  4. package/dist/digest/base64.d.ts +8 -0
  5. package/dist/digest/base64.d.ts.map +1 -0
  6. package/dist/digest/digest.d.ts +13 -0
  7. package/dist/digest/digest.d.ts.map +1 -0
  8. package/dist/digest/index.cjs +594 -0
  9. package/dist/digest/index.d.ts +8 -0
  10. package/dist/digest/index.d.ts.map +1 -0
  11. package/dist/digest/index.mjs +581 -0
  12. package/dist/digest/password-hash.d.ts +30 -0
  13. package/dist/digest/password-hash.d.ts.map +1 -0
  14. package/dist/digest/sha1.d.ts +3 -0
  15. package/dist/digest/sha1.d.ts.map +1 -0
  16. package/dist/digest/sha256.d.ts +10 -0
  17. package/dist/digest/sha256.d.ts.map +1 -0
  18. package/dist/digest/sha512.d.ts +5 -0
  19. package/dist/digest/sha512.d.ts.map +1 -0
  20. package/dist/docx/block-parser.d.ts.map +1 -1
  21. package/dist/docx/embedded.cjs +131 -54
  22. package/dist/docx/embedded.mjs +131 -54
  23. package/dist/docx/equation.d.ts +8 -0
  24. package/dist/docx/equation.d.ts.map +1 -0
  25. package/dist/docx/index.cjs +131 -54
  26. package/dist/docx/index.mjs +131 -54
  27. package/dist/docx/layout/adapter.d.ts.map +1 -1
  28. package/dist/docx/layout/index.cjs +3 -1
  29. package/dist/docx/layout/index.mjs +3 -1
  30. package/dist/docx/load/index.cjs +133 -56
  31. package/dist/docx/load/index.mjs +133 -56
  32. package/dist/docx/model-run.d.ts +5 -0
  33. package/dist/docx/model-run.d.ts.map +1 -1
  34. package/dist/docx/parse-revisions.d.ts.map +1 -1
  35. package/dist/docx/parse-table.d.ts.map +1 -1
  36. package/dist/docx/write-inline.d.ts.map +1 -1
  37. package/dist/docx/write-table-margins.d.ts +5 -0
  38. package/dist/docx/write-table-margins.d.ts.map +1 -0
  39. package/dist/docx/write-table-properties.d.ts +3 -1
  40. package/dist/docx/write-table-properties.d.ts.map +1 -1
  41. package/dist/docx/write-table.d.ts.map +1 -1
  42. package/dist/index.cjs +598 -0
  43. package/dist/index.d.ts +1 -0
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.mjs +598 -1
  46. package/dist/visio/cell-formula.d.ts +9 -0
  47. package/dist/visio/cell-formula.d.ts.map +1 -0
  48. package/dist/visio/edit-commands.d.ts +33 -0
  49. package/dist/visio/edit-commands.d.ts.map +1 -0
  50. package/dist/visio/edit-geometry-admission.d.ts +10 -0
  51. package/dist/visio/edit-geometry-admission.d.ts.map +1 -0
  52. package/dist/visio/edit-geometry.d.ts +3 -0
  53. package/dist/visio/edit-geometry.d.ts.map +1 -0
  54. package/dist/visio/edit-recalculate-index.d.ts +25 -0
  55. package/dist/visio/edit-recalculate-index.d.ts.map +1 -0
  56. package/dist/visio/edit-recalculate.d.ts +11 -0
  57. package/dist/visio/edit-recalculate.d.ts.map +1 -0
  58. package/dist/visio/edit-scope.d.ts +5 -0
  59. package/dist/visio/edit-scope.d.ts.map +1 -0
  60. package/dist/visio/edit.d.ts +4 -8
  61. package/dist/visio/edit.d.ts.map +1 -1
  62. package/dist/visio/formula-evaluate.d.ts +10 -0
  63. package/dist/visio/formula-evaluate.d.ts.map +1 -0
  64. package/dist/visio/formula-theme.d.ts +2 -0
  65. package/dist/visio/formula-theme.d.ts.map +1 -0
  66. package/dist/visio/formula.d.ts +52 -0
  67. package/dist/visio/formula.d.ts.map +1 -0
  68. package/dist/visio/index.cjs +1605 -232
  69. package/dist/visio/index.d.ts +2 -1
  70. package/dist/visio/index.d.ts.map +1 -1
  71. package/dist/visio/index.mjs +1601 -233
  72. package/dist/xlsx/edit/history.d.ts +1 -1
  73. package/dist/xlsx/edit/history.d.ts.map +1 -1
  74. package/dist/xlsx/edit/index.d.ts +1 -1
  75. package/dist/xlsx/edit/index.d.ts.map +1 -1
  76. package/dist/xlsx/edit/protection.d.ts +18 -6
  77. package/dist/xlsx/edit/protection.d.ts.map +1 -1
  78. package/dist/xlsx/edit/types.d.ts +2 -2
  79. package/dist/xlsx/index.cjs +671 -28
  80. package/dist/xlsx/index.mjs +670 -29
  81. package/dist/xlsx/load/index.cjs +56 -19
  82. package/dist/xlsx/load/index.mjs +56 -19
  83. package/dist/xlsx/model.d.ts +21 -0
  84. package/dist/xlsx/model.d.ts.map +1 -1
  85. package/dist/xlsx/read/load.d.ts.map +1 -1
  86. package/dist/xlsx/read/password-hash.d.ts +15 -0
  87. package/dist/xlsx/read/password-hash.d.ts.map +1 -0
  88. package/dist/xlsx/read/sheet-props.d.ts.map +1 -1
  89. package/dist/xlsx/read/workbook-part.d.ts +3 -1
  90. package/dist/xlsx/read/workbook-part.d.ts.map +1 -1
  91. package/dist/xlsx/write/password-hash.d.ts +8 -0
  92. package/dist/xlsx/write/password-hash.d.ts.map +1 -0
  93. package/dist/xlsx/write/sheet-props.d.ts.map +1 -1
  94. package/dist/xlsx/write/workbook-part.d.ts.map +1 -1
  95. package/package.json +6 -1
@@ -38,7 +38,7 @@ type Snapshot = {
38
38
  settings?: BookSettings;
39
39
  };
40
40
  /** Workbook-level settings `meta` and `workbook` snapshots also record. */
41
- type BookSettings = Pick<Workbook, 'structureLocked' | 'workbookPasswordHash' | 'calcMode'>;
41
+ type BookSettings = Pick<Workbook, 'structureLocked' | 'workbookPasswordHash' | 'workbookModernHash' | 'calcMode'>;
42
42
  export interface HistoryEntry {
43
43
  before: Snapshot;
44
44
  after: Snapshot;
@@ -1 +1 @@
1
- {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../src/xlsx/edit/history.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,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CACpB;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,GAAG,QAAQ,CA8B3E;AAED,iGAAiG;AACjG,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CA+B5E;AAED,yEAAyE;AACzE,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,CAc7F;AAED,8CAA8C;AAC9C,qBAAa,OAAO;IAIP,OAAO,CAAC,QAAQ,CAAC,KAAK;IAHlC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAqB;IAC1C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqB;gBAEf,KAAK,EAAE,MAAM;IAE1C,IAAI,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAM7B,IAAI,CAAC,QAAQ,EAAE,QAAQ,GAAG,WAAW,GAAG,SAAS;IAWjD,IAAI,CAAC,QAAQ,EAAE,QAAQ,GAAG,WAAW,GAAG,SAAS;IAQjD,OAAO,QAAO,OAAO,CAAyB;IAC9C,OAAO,QAAO,OAAO,CAA2B;IAChD,SAAS,QAAO,MAAM,GAAG,SAAS,CAA4B;IAC9D,SAAS,QAAO,MAAM,GAAG,SAAS,CAA8B;CAChE"}
@@ -14,7 +14,7 @@ export { uniqueHeaders } from './tables.js';
14
14
  export { IMAGE_EXTENSIONS, newMediaPart, type ChartPatch } from './charts.js';
15
15
  export { validateTableName, type TablePatch, type TableRef } from './table-edits.js';
16
16
  export { autoGrowRows, rowsToRefit } from './row-autofit.js';
17
- export { legacyPasswordHash, verifySheetPassword, verifyWorkbookPassword } from './protection.js';
17
+ export { legacyPasswordHash, modernPasswordHash, verifySheetPassword, verifySheetPasswordAsync, verifyWorkbookPassword, } from './protection.js';
18
18
  export { MAX_OUTLINE_LEVEL } from './outline.js';
19
19
  export type { RemoveDuplicatesResult } from './duplicates.js';
20
20
  export { calcModeOf, type CalcMode } from './calc-mode.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/xlsx/edit/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EACN,0BAA0B,EAC1B,qBAAqB,EACrB,iBAAiB,EACjB,YAAY,EACZ,KAAK,iBAAiB,GACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,KAAK,eAAe,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,KAAK,UAAU,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,kBAAk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AY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,KAAK,UAAU,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EACN,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,sBAAsB,GACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,YAAY,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAClG,YAAY,EACX,YAAY,EACZ,SAAS,EACT,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,kBAAkB,GAClB,MAAM,YAAY,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { SheetProtection, Workbook, Worksheet } from '../model.js';
1
+ import type { ModernPasswordHash, SheetProtection, Workbook, Worksheet } from '../model.js';
2
2
  import { type EditContext } from './context.js';
3
3
  /**
4
4
  * Excel's legacy 16-bit password verifier (ECMA-376 Part 4, 14.7.1), upper-case hex as the
@@ -7,20 +7,32 @@ import { type EditContext } from './context.js';
7
7
  export declare function legacyPasswordHash(password: string): string;
8
8
  /**
9
9
  * Whether `password` unlocks a sheet's protection (true when it is not protected or has no
10
- * legacy password). Only the legacy hash is checked: a sheet protected with just Excel's modern
11
- * SHA-512 hash reports false for every non-empty password.
10
+ * password). Excel's modern hash is checked synchronously for SHA-1, SHA-256, SHA-384 and SHA-512;
11
+ * a modern hash with any other digest falls back to the legacy hash and, without one, never
12
+ * unlocks, so a sheet is never unprotected by mistake. Malformed hashes fail rather than throw.
12
13
  */
13
14
  export declare function verifySheetPassword(sheet: Worksheet | SheetProtection | undefined, password: string): boolean;
14
- /** Whether `password` unlocks the workbook structure protection. */
15
+ /** {@link verifySheetPassword} as a promise, kept for callers written against the async API. */
16
+ export declare function verifySheetPasswordAsync(sheet: Worksheet | SheetProtection | undefined, password: string): Promise<boolean>;
17
+ /**
18
+ * The base64 ECMA-376 agile hash of `password` for the salt and iteration count in `hash`, as a
19
+ * promise for callers written against the async API; `hashPassword` in `ooxml-core/digest` is the
20
+ * synchronous form. Rejects for a digest other than SHA-1/256/384/512 or unusable parameters.
21
+ */
22
+ export declare function modernPasswordHash(password: string, hash: Pick<ModernPasswordHash, 'saltValue' | 'spinCount'>, digest?: string): Promise<string>;
23
+ /** Whether `password` unlocks the workbook structure protection (modern or legacy hash). */
15
24
  export declare function verifyWorkbookPassword(workbook: Workbook, password: string): boolean;
16
25
  /**
17
26
  * Protects (or with `undefined`, unprotects) a sheet. A non-empty `password` sets the legacy
18
- * hash; `''` removes it. Unprotecting with a password checks it first and throws when wrong.
27
+ * hash and drops the modern one (it would no longer match); `''` removes both hashes, and
28
+ * `undefined` keeps whatever `protection` carries. Unprotecting with a password checks it first
29
+ * (against the modern or legacy hash) and throws when it is wrong.
19
30
  */
20
31
  export declare function setSheetProtection(ctx: EditContext, s: number, protection: SheetProtection | undefined, password?: string): void;
21
32
  /**
22
33
  * Locks or unlocks the workbook structure. Locking with a non-empty password stores its legacy
23
- * hash; unlocking with a password checks it first and throws when wrong.
34
+ * hash and drops the modern one; `''` removes both, `undefined` keeps them. Unlocking with a
35
+ * password checks it first (against the modern or legacy hash) and throws when it is wrong.
24
36
  */
25
37
  export declare function setWorkbookProtection(ctx: EditContext, locked: boolean, password?: string): void;
26
38
  //# sourceMappingURL=protection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"protection.d.ts","sourceRoot":"","sources":["../../../src/xlsx/edit/protection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,KAAK,WAAW,EAAW,MAAM,cAAc,CAAC;AAEzD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAS3D;AAKD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAClC,KAAK,EAAE,SAAS,GAAG,eAAe,GAAG,SAAS,EAC9C,QAAQ,EAAE,MAAM,GACd,OAAO,CAIT;AAED,oEAAoE;AACpE,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGpF;AAID;;;GAGG;AACH,wBAAgB,kBAAkB,CACjC,GAAG,EAAE,WAAW,EAChB,CAAC,EAAE,MAAM,EACT,UAAU,EAAE,eAAe,GAAG,SAAS,EACvC,QAAQ,CAAC,EAAE,MAAM,GACf,IAAI,CAoBN;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAchG"}
1
+ {"version":3,"file":"protection.d.ts","sourceRoot":"","sources":["../../../src/xlsx/edit/protection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC5F,OAAO,EAAE,KAAK,WAAW,EAAW,MAAM,cAAc,CAAC;AAGzD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAS3D;AAwBD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAClC,KAAK,EAAE,SAAS,GAAG,eAAe,GAAG,SAAS,EAC9C,QAAQ,EAAE,MAAM,GACd,OAAO,CAIT;AAED,gGAAgG;AAChG,wBAAsB,wBAAwB,CAC7C,KAAK,EAAE,SAAS,GAAG,eAAe,GAAG,SAAS,EAC9C,QAAQ,EAAE,MAAM,GACd,OAAO,CAAC,OAAO,CAAC,CAElB;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CACvC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,IAAI,CAAC,kBAAkB,EAAE,WAAW,GAAG,WAAW,CAAC,EACzD,MAAM,SAAY,GAChB,OAAO,CAAC,MAAM,CAAC,CAIjB;AAED,4FAA4F;AAC5F,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGpF;AAID;;;;;GAKG;AACH,wBAAgB,kBAAkB,CACjC,GAAG,EAAE,WAAW,EAChB,CAAC,EAAE,MAAM,EACT,UAAU,EAAE,eAAe,GAAG,SAAS,EACvC,QAAQ,CAAC,EAAE,MAAM,GACf,IAAI,CA0BN;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAgBhG"}
@@ -139,8 +139,8 @@ export interface EditSession {
139
139
  /** Patches the print options (gridlines, headings, centring); false clears one. */
140
140
  setPrintOptions(sheet: number, patch: Partial<PrintOptions>): void;
141
141
  /**
142
- * Protects a sheet (`undefined` unprotects). A non-empty `password` stores its legacy hash,
143
- * `''` removes it; unprotecting with a wrong password throws.
142
+ * Protects a sheet (`undefined` unprotects). A non-empty `password` stores its legacy hash and
143
+ * drops the modern one, `''` removes both; unprotecting with a wrong password throws.
144
144
  */
145
145
  setSheetProtection(sheet: number, protection: SheetProtection | undefined, password?: string): void;
146
146
  /** Locks or unlocks the workbook structure, optionally with a password (checked on unlock). */