@ricsam/formula-engine 0.2.2 → 0.2.4

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 (337) hide show
  1. package/dist/cjs/core/ast-traverser.cjs +19 -9
  2. package/dist/cjs/core/ast-traverser.cjs.map +2 -2
  3. package/dist/cjs/core/autofill-utils.cjs +19 -9
  4. package/dist/cjs/core/autofill-utils.cjs.map +2 -2
  5. package/dist/cjs/core/cell-mover.cjs +19 -9
  6. package/dist/cjs/core/cell-mover.cjs.map +2 -2
  7. package/dist/cjs/core/commands/command-executor.cjs +24 -13
  8. package/dist/cjs/core/commands/command-executor.cjs.map +3 -3
  9. package/dist/cjs/core/commands/content-commands.cjs +292 -9
  10. package/dist/cjs/core/commands/content-commands.cjs.map +3 -3
  11. package/dist/cjs/core/commands/metadata-commands.cjs +19 -9
  12. package/dist/cjs/core/commands/metadata-commands.cjs.map +2 -2
  13. package/dist/cjs/core/commands/named-expression-commands.cjs +138 -13
  14. package/dist/cjs/core/commands/named-expression-commands.cjs.map +3 -3
  15. package/dist/cjs/core/commands/structure-commands.cjs +216 -15
  16. package/dist/cjs/core/commands/structure-commands.cjs.map +3 -3
  17. package/dist/cjs/core/commands/style-commands.cjs +19 -9
  18. package/dist/cjs/core/commands/style-commands.cjs.map +2 -2
  19. package/dist/cjs/core/commands/table-commands.cjs +134 -13
  20. package/dist/cjs/core/commands/table-commands.cjs.map +3 -3
  21. package/dist/cjs/core/commands/types.cjs +36 -9
  22. package/dist/cjs/core/commands/types.cjs.map +3 -3
  23. package/dist/cjs/core/engine-snapshot.cjs +51 -0
  24. package/dist/cjs/core/engine-snapshot.cjs.map +10 -0
  25. package/dist/cjs/core/engine.cjs +51 -34
  26. package/dist/cjs/core/engine.cjs.map +3 -3
  27. package/dist/cjs/core/managers/cache-manager.cjs +123 -9
  28. package/dist/cjs/core/managers/cache-manager.cjs.map +3 -3
  29. package/dist/cjs/core/managers/copy-manager.cjs +19 -9
  30. package/dist/cjs/core/managers/copy-manager.cjs.map +2 -2
  31. package/dist/cjs/core/managers/dependency-manager.cjs +697 -9
  32. package/dist/cjs/core/managers/dependency-manager.cjs.map +3 -3
  33. package/dist/cjs/core/managers/dependency-node.cjs +14 -8
  34. package/dist/cjs/core/managers/dependency-node.cjs.map +1 -1
  35. package/dist/cjs/core/managers/evaluation-manager.cjs +296 -11
  36. package/dist/cjs/core/managers/evaluation-manager.cjs.map +3 -3
  37. package/dist/cjs/core/managers/event-manager.cjs +19 -9
  38. package/dist/cjs/core/managers/event-manager.cjs.map +2 -2
  39. package/dist/cjs/core/managers/frontier-dependency-manager.cjs +65 -12
  40. package/dist/cjs/core/managers/frontier-dependency-manager.cjs.map +3 -3
  41. package/dist/cjs/core/managers/isDependencyNode.cjs +19 -9
  42. package/dist/cjs/core/managers/isDependencyNode.cjs.map +2 -2
  43. package/dist/cjs/core/managers/named-expression-manager.cjs +121 -29
  44. package/dist/cjs/core/managers/named-expression-manager.cjs.map +3 -3
  45. package/dist/cjs/core/managers/range-eval-order-builder.cjs +19 -9
  46. package/dist/cjs/core/managers/range-eval-order-builder.cjs.map +2 -2
  47. package/dist/cjs/core/managers/reference-manager.cjs +25 -9
  48. package/dist/cjs/core/managers/reference-manager.cjs.map +3 -3
  49. package/dist/cjs/core/managers/schema-manager.cjs +19 -9
  50. package/dist/cjs/core/managers/schema-manager.cjs.map +2 -2
  51. package/dist/cjs/core/managers/style-manager.cjs +28 -9
  52. package/dist/cjs/core/managers/style-manager.cjs.map +3 -3
  53. package/dist/cjs/core/managers/table-manager.cjs +27 -11
  54. package/dist/cjs/core/managers/table-manager.cjs.map +3 -3
  55. package/dist/cjs/core/managers/workbook-manager.cjs +38 -13
  56. package/dist/cjs/core/managers/workbook-manager.cjs.map +3 -3
  57. package/dist/cjs/core/map-serializer.cjs +19 -9
  58. package/dist/cjs/core/map-serializer.cjs.map +2 -2
  59. package/dist/cjs/core/named-expression-renamer.cjs +19 -9
  60. package/dist/cjs/core/named-expression-renamer.cjs.map +2 -2
  61. package/dist/cjs/core/resource-keys.cjs +67 -0
  62. package/dist/cjs/core/resource-keys.cjs.map +10 -0
  63. package/dist/cjs/core/schema/cell-orm.cjs +19 -9
  64. package/dist/cjs/core/schema/cell-orm.cjs.map +2 -2
  65. package/dist/cjs/core/schema/grid-orm.cjs +19 -9
  66. package/dist/cjs/core/schema/grid-orm.cjs.map +2 -2
  67. package/dist/cjs/core/schema/schema-builder.cjs +19 -9
  68. package/dist/cjs/core/schema/schema-builder.cjs.map +2 -2
  69. package/dist/cjs/core/schema/schema-helpers.cjs +19 -9
  70. package/dist/cjs/core/schema/schema-helpers.cjs.map +2 -2
  71. package/dist/cjs/core/schema/schema.cjs +19 -9
  72. package/dist/cjs/core/schema/schema.cjs.map +2 -2
  73. package/dist/cjs/core/schema/table-orm.cjs +19 -9
  74. package/dist/cjs/core/schema/table-orm.cjs.map +2 -2
  75. package/dist/cjs/core/sheet-renamer.cjs +19 -9
  76. package/dist/cjs/core/sheet-renamer.cjs.map +2 -2
  77. package/dist/cjs/core/sheet-utils.cjs +19 -9
  78. package/dist/cjs/core/sheet-utils.cjs.map +2 -2
  79. package/dist/cjs/core/table-renamer.cjs +19 -9
  80. package/dist/cjs/core/table-renamer.cjs.map +2 -2
  81. package/dist/cjs/core/types.cjs +19 -9
  82. package/dist/cjs/core/types.cjs.map +2 -2
  83. package/dist/cjs/core/utils/color-utils.cjs +19 -9
  84. package/dist/cjs/core/utils/color-utils.cjs.map +2 -2
  85. package/dist/cjs/core/utils/range-serializer.cjs +19 -9
  86. package/dist/cjs/core/utils/range-serializer.cjs.map +2 -2
  87. package/dist/cjs/core/utils/range-utils.cjs +19 -9
  88. package/dist/cjs/core/utils/range-utils.cjs.map +2 -2
  89. package/dist/cjs/core/utils/spreadsheet-visualizer.cjs +19 -9
  90. package/dist/cjs/core/utils/spreadsheet-visualizer.cjs.map +2 -2
  91. package/dist/cjs/core/utils.cjs +19 -9
  92. package/dist/cjs/core/utils.cjs.map +2 -2
  93. package/dist/cjs/core/workbook-renamer.cjs +19 -9
  94. package/dist/cjs/core/workbook-renamer.cjs.map +2 -2
  95. package/dist/cjs/debug/flags.cjs +19 -9
  96. package/dist/cjs/debug/flags.cjs.map +2 -2
  97. package/dist/cjs/evaluator/arithmetic/add/add.cjs +19 -9
  98. package/dist/cjs/evaluator/arithmetic/add/add.cjs.map +2 -2
  99. package/dist/cjs/evaluator/arithmetic/divide/divide.cjs +19 -9
  100. package/dist/cjs/evaluator/arithmetic/divide/divide.cjs.map +2 -2
  101. package/dist/cjs/evaluator/arithmetic/multiply/multiply.cjs +19 -9
  102. package/dist/cjs/evaluator/arithmetic/multiply/multiply.cjs.map +2 -2
  103. package/dist/cjs/evaluator/arithmetic/power/power.cjs +19 -9
  104. package/dist/cjs/evaluator/arithmetic/power/power.cjs.map +2 -2
  105. package/dist/cjs/evaluator/arithmetic/subtract/subtract.cjs +19 -9
  106. package/dist/cjs/evaluator/arithmetic/subtract/subtract.cjs.map +2 -2
  107. package/dist/cjs/evaluator/comparison/equals.cjs +19 -9
  108. package/dist/cjs/evaluator/comparison/equals.cjs.map +2 -2
  109. package/dist/cjs/evaluator/comparison/greater-than-or-equal.cjs +19 -9
  110. package/dist/cjs/evaluator/comparison/greater-than-or-equal.cjs.map +2 -2
  111. package/dist/cjs/evaluator/comparison/greater-than.cjs +19 -9
  112. package/dist/cjs/evaluator/comparison/greater-than.cjs.map +2 -2
  113. package/dist/cjs/evaluator/comparison/less-than-or-equal.cjs +19 -9
  114. package/dist/cjs/evaluator/comparison/less-than-or-equal.cjs.map +2 -2
  115. package/dist/cjs/evaluator/comparison/less-than.cjs +19 -9
  116. package/dist/cjs/evaluator/comparison/less-than.cjs.map +2 -2
  117. package/dist/cjs/evaluator/comparison/not-equals.cjs +19 -9
  118. package/dist/cjs/evaluator/comparison/not-equals.cjs.map +2 -2
  119. package/dist/cjs/evaluator/concatenation/concatenate.cjs +19 -9
  120. package/dist/cjs/evaluator/concatenation/concatenate.cjs.map +2 -2
  121. package/dist/cjs/evaluator/dependency-nodes/ast-evaluation-node.cjs +19 -9
  122. package/dist/cjs/evaluator/dependency-nodes/ast-evaluation-node.cjs.map +2 -2
  123. package/dist/cjs/evaluator/dependency-nodes/base-eval-node.cjs +35 -9
  124. package/dist/cjs/evaluator/dependency-nodes/base-eval-node.cjs.map +3 -3
  125. package/dist/cjs/evaluator/dependency-nodes/cell-value-node.cjs +22 -9
  126. package/dist/cjs/evaluator/dependency-nodes/cell-value-node.cjs.map +3 -3
  127. package/dist/cjs/evaluator/dependency-nodes/empty-cell-evaluation-node.cjs +35 -11
  128. package/dist/cjs/evaluator/dependency-nodes/empty-cell-evaluation-node.cjs.map +3 -3
  129. package/dist/cjs/evaluator/dependency-nodes/resource-dependency-node.cjs +61 -0
  130. package/dist/cjs/evaluator/dependency-nodes/resource-dependency-node.cjs.map +10 -0
  131. package/dist/cjs/evaluator/dependency-nodes/spill-meta-node.cjs +19 -9
  132. package/dist/cjs/evaluator/dependency-nodes/spill-meta-node.cjs.map +2 -2
  133. package/dist/cjs/evaluator/dependency-nodes/virtual-cell-value-node.cjs +22 -9
  134. package/dist/cjs/evaluator/dependency-nodes/virtual-cell-value-node.cjs.map +3 -3
  135. package/dist/cjs/evaluator/evaluate-scalar-operator.cjs +19 -9
  136. package/dist/cjs/evaluator/evaluate-scalar-operator.cjs.map +2 -2
  137. package/dist/cjs/evaluator/evaluation-context.cjs +19 -9
  138. package/dist/cjs/evaluator/evaluation-context.cjs.map +2 -2
  139. package/dist/cjs/evaluator/evaluation-error.cjs +19 -9
  140. package/dist/cjs/evaluator/evaluation-error.cjs.map +2 -2
  141. package/dist/cjs/evaluator/formula-evaluator.cjs +55 -12
  142. package/dist/cjs/evaluator/formula-evaluator.cjs.map +3 -3
  143. package/dist/cjs/evaluator/range-evaluation-node.cjs +35 -11
  144. package/dist/cjs/evaluator/range-evaluation-node.cjs.map +3 -3
  145. package/dist/cjs/functions/_template/template.cjs +19 -9
  146. package/dist/cjs/functions/_template/template.cjs.map +2 -2
  147. package/dist/cjs/functions/array/sequence/sequence.cjs +19 -9
  148. package/dist/cjs/functions/array/sequence/sequence.cjs.map +2 -2
  149. package/dist/cjs/functions/criteria-parser.cjs +19 -9
  150. package/dist/cjs/functions/criteria-parser.cjs.map +2 -2
  151. package/dist/cjs/functions/criteria-utils.cjs +19 -9
  152. package/dist/cjs/functions/criteria-utils.cjs.map +2 -2
  153. package/dist/cjs/functions/function-registry.cjs +19 -9
  154. package/dist/cjs/functions/function-registry.cjs.map +2 -2
  155. package/dist/cjs/functions/function-utils.cjs +19 -9
  156. package/dist/cjs/functions/function-utils.cjs.map +2 -2
  157. package/dist/cjs/functions/information/cell/cell.cjs +19 -9
  158. package/dist/cjs/functions/information/cell/cell.cjs.map +2 -2
  159. package/dist/cjs/functions/information/column/column.cjs +19 -9
  160. package/dist/cjs/functions/information/column/column.cjs.map +2 -2
  161. package/dist/cjs/functions/information/row/row.cjs +19 -9
  162. package/dist/cjs/functions/information/row/row.cjs.map +2 -2
  163. package/dist/cjs/functions/logical/and/and.cjs +19 -9
  164. package/dist/cjs/functions/logical/and/and.cjs.map +2 -2
  165. package/dist/cjs/functions/logical/if/if.cjs +19 -9
  166. package/dist/cjs/functions/logical/if/if.cjs.map +2 -2
  167. package/dist/cjs/functions/logical/iferror/iferror.cjs +19 -9
  168. package/dist/cjs/functions/logical/iferror/iferror.cjs.map +2 -2
  169. package/dist/cjs/functions/logical/or/or.cjs +19 -9
  170. package/dist/cjs/functions/logical/or/or.cjs.map +2 -2
  171. package/dist/cjs/functions/lookup/count/count-utils.cjs +19 -9
  172. package/dist/cjs/functions/lookup/count/count-utils.cjs.map +2 -2
  173. package/dist/cjs/functions/lookup/count/count.cjs +19 -9
  174. package/dist/cjs/functions/lookup/count/count.cjs.map +2 -2
  175. package/dist/cjs/functions/lookup/count/countif.cjs +19 -9
  176. package/dist/cjs/functions/lookup/count/countif.cjs.map +2 -2
  177. package/dist/cjs/functions/lookup/count/countifs.cjs +19 -9
  178. package/dist/cjs/functions/lookup/count/countifs.cjs.map +2 -2
  179. package/dist/cjs/functions/lookup/index-lookup/index-lookup.cjs +19 -9
  180. package/dist/cjs/functions/lookup/index-lookup/index-lookup.cjs.map +2 -2
  181. package/dist/cjs/functions/lookup/match/match.cjs +21 -10
  182. package/dist/cjs/functions/lookup/match/match.cjs.map +3 -3
  183. package/dist/cjs/functions/lookup/xlookup/xlookup.cjs +19 -9
  184. package/dist/cjs/functions/lookup/xlookup/xlookup.cjs.map +2 -2
  185. package/dist/cjs/functions/math/average/average-utils.cjs +19 -9
  186. package/dist/cjs/functions/math/average/average-utils.cjs.map +2 -2
  187. package/dist/cjs/functions/math/average/average.cjs +19 -9
  188. package/dist/cjs/functions/math/average/average.cjs.map +2 -2
  189. package/dist/cjs/functions/math/average/averageif.cjs +19 -9
  190. package/dist/cjs/functions/math/average/averageif.cjs.map +2 -2
  191. package/dist/cjs/functions/math/average/averageifs.cjs +19 -9
  192. package/dist/cjs/functions/math/average/averageifs.cjs.map +2 -2
  193. package/dist/cjs/functions/math/ceiling/ceiling.cjs +19 -9
  194. package/dist/cjs/functions/math/ceiling/ceiling.cjs.map +2 -2
  195. package/dist/cjs/functions/math/max/max-utils.cjs +19 -9
  196. package/dist/cjs/functions/math/max/max-utils.cjs.map +2 -2
  197. package/dist/cjs/functions/math/max/max.cjs +19 -9
  198. package/dist/cjs/functions/math/max/max.cjs.map +2 -2
  199. package/dist/cjs/functions/math/max/maxif.cjs +19 -9
  200. package/dist/cjs/functions/math/max/maxif.cjs.map +2 -2
  201. package/dist/cjs/functions/math/max/maxifs.cjs +19 -9
  202. package/dist/cjs/functions/math/max/maxifs.cjs.map +2 -2
  203. package/dist/cjs/functions/math/min/min-utils.cjs +19 -9
  204. package/dist/cjs/functions/math/min/min-utils.cjs.map +2 -2
  205. package/dist/cjs/functions/math/min/min.cjs +19 -9
  206. package/dist/cjs/functions/math/min/min.cjs.map +2 -2
  207. package/dist/cjs/functions/math/min/minif.cjs +19 -9
  208. package/dist/cjs/functions/math/min/minif.cjs.map +2 -2
  209. package/dist/cjs/functions/math/min/minifs.cjs +19 -9
  210. package/dist/cjs/functions/math/min/minifs.cjs.map +2 -2
  211. package/dist/cjs/functions/math/sum/sum.cjs +19 -9
  212. package/dist/cjs/functions/math/sum/sum.cjs.map +2 -2
  213. package/dist/cjs/functions/math/sum/sumif.cjs +19 -9
  214. package/dist/cjs/functions/math/sum/sumif.cjs.map +2 -2
  215. package/dist/cjs/functions/math/sum/sumifs.cjs +19 -9
  216. package/dist/cjs/functions/math/sum/sumifs.cjs.map +2 -2
  217. package/dist/cjs/functions/math/sum/summation-utils.cjs +19 -9
  218. package/dist/cjs/functions/math/sum/summation-utils.cjs.map +2 -2
  219. package/dist/cjs/functions/reference/address/address.cjs +19 -9
  220. package/dist/cjs/functions/reference/address/address.cjs.map +2 -2
  221. package/dist/cjs/functions/reference/indirect/indirect.cjs +19 -9
  222. package/dist/cjs/functions/reference/indirect/indirect.cjs.map +2 -2
  223. package/dist/cjs/functions/reference/offset/offset.cjs +19 -9
  224. package/dist/cjs/functions/reference/offset/offset.cjs.map +2 -2
  225. package/dist/cjs/functions/text/concatenate/concatenate.cjs +21 -9
  226. package/dist/cjs/functions/text/concatenate/concatenate.cjs.map +3 -3
  227. package/dist/cjs/functions/text/exact/exact.cjs +19 -9
  228. package/dist/cjs/functions/text/exact/exact.cjs.map +2 -2
  229. package/dist/cjs/functions/text/find/find.cjs +19 -9
  230. package/dist/cjs/functions/text/find/find.cjs.map +2 -2
  231. package/dist/cjs/functions/text/left/left.cjs +19 -9
  232. package/dist/cjs/functions/text/left/left.cjs.map +2 -2
  233. package/dist/cjs/functions/text/len/len.cjs +19 -9
  234. package/dist/cjs/functions/text/len/len.cjs.map +2 -2
  235. package/dist/cjs/functions/text/mid/mid.cjs +19 -9
  236. package/dist/cjs/functions/text/mid/mid.cjs.map +2 -2
  237. package/dist/cjs/functions/text/right/right.cjs +19 -9
  238. package/dist/cjs/functions/text/right/right.cjs.map +2 -2
  239. package/dist/cjs/functions/text/text-helpers.cjs +19 -9
  240. package/dist/cjs/functions/text/text-helpers.cjs.map +2 -2
  241. package/dist/cjs/functions/text/textjoin/textjoin.cjs +19 -9
  242. package/dist/cjs/functions/text/textjoin/textjoin.cjs.map +2 -2
  243. package/dist/cjs/lib.cjs +24 -13
  244. package/dist/cjs/lib.cjs.map +2 -2
  245. package/dist/cjs/package.json +1 -1
  246. package/dist/cjs/parser/ast.cjs +19 -9
  247. package/dist/cjs/parser/ast.cjs.map +2 -2
  248. package/dist/cjs/parser/formatter.cjs +19 -9
  249. package/dist/cjs/parser/formatter.cjs.map +2 -2
  250. package/dist/cjs/parser/grammar.cjs +19 -9
  251. package/dist/cjs/parser/grammar.cjs.map +2 -2
  252. package/dist/cjs/parser/lexer.cjs +19 -9
  253. package/dist/cjs/parser/lexer.cjs.map +2 -2
  254. package/dist/cjs/parser/parser.cjs +19 -9
  255. package/dist/cjs/parser/parser.cjs.map +2 -2
  256. package/dist/cjs/react/hooks.cjs +31 -10
  257. package/dist/cjs/react/hooks.cjs.map +2 -2
  258. package/dist/mjs/core/commands/command-executor.mjs +7 -5
  259. package/dist/mjs/core/commands/command-executor.mjs.map +3 -3
  260. package/dist/mjs/core/commands/content-commands.mjs +279 -2
  261. package/dist/mjs/core/commands/content-commands.mjs.map +3 -3
  262. package/dist/mjs/core/commands/named-expression-commands.mjs +121 -6
  263. package/dist/mjs/core/commands/named-expression-commands.mjs.map +3 -3
  264. package/dist/mjs/core/commands/structure-commands.mjs +204 -8
  265. package/dist/mjs/core/commands/structure-commands.mjs.map +3 -3
  266. package/dist/mjs/core/commands/table-commands.mjs +117 -6
  267. package/dist/mjs/core/commands/table-commands.mjs.map +3 -3
  268. package/dist/mjs/core/commands/types.mjs +18 -1
  269. package/dist/mjs/core/commands/types.mjs.map +3 -3
  270. package/dist/mjs/core/engine-snapshot.mjs +11 -0
  271. package/dist/mjs/core/engine-snapshot.mjs.map +10 -0
  272. package/dist/mjs/core/engine.mjs +35 -26
  273. package/dist/mjs/core/engine.mjs.map +3 -3
  274. package/dist/mjs/core/managers/cache-manager.mjs +105 -1
  275. package/dist/mjs/core/managers/cache-manager.mjs.map +3 -3
  276. package/dist/mjs/core/managers/dependency-manager.mjs +687 -2
  277. package/dist/mjs/core/managers/dependency-manager.mjs.map +3 -3
  278. package/dist/mjs/core/managers/evaluation-manager.mjs +283 -4
  279. package/dist/mjs/core/managers/evaluation-manager.mjs.map +3 -3
  280. package/dist/mjs/core/managers/frontier-dependency-manager.mjs +47 -4
  281. package/dist/mjs/core/managers/frontier-dependency-manager.mjs.map +3 -3
  282. package/dist/mjs/core/managers/named-expression-manager.mjs +104 -21
  283. package/dist/mjs/core/managers/named-expression-manager.mjs.map +3 -3
  284. package/dist/mjs/core/managers/reference-manager.mjs +7 -1
  285. package/dist/mjs/core/managers/reference-manager.mjs.map +3 -3
  286. package/dist/mjs/core/managers/style-manager.mjs +10 -1
  287. package/dist/mjs/core/managers/style-manager.mjs.map +3 -3
  288. package/dist/mjs/core/managers/table-manager.mjs +14 -4
  289. package/dist/mjs/core/managers/table-manager.mjs.map +3 -3
  290. package/dist/mjs/core/managers/workbook-manager.mjs +20 -5
  291. package/dist/mjs/core/managers/workbook-manager.mjs.map +3 -3
  292. package/dist/mjs/core/resource-keys.mjs +27 -0
  293. package/dist/mjs/core/resource-keys.mjs.map +10 -0
  294. package/dist/mjs/evaluator/dependency-nodes/base-eval-node.mjs +17 -1
  295. package/dist/mjs/evaluator/dependency-nodes/base-eval-node.mjs.map +3 -3
  296. package/dist/mjs/evaluator/dependency-nodes/cell-value-node.mjs +4 -1
  297. package/dist/mjs/evaluator/dependency-nodes/cell-value-node.mjs.map +3 -3
  298. package/dist/mjs/evaluator/dependency-nodes/empty-cell-evaluation-node.mjs +17 -3
  299. package/dist/mjs/evaluator/dependency-nodes/empty-cell-evaluation-node.mjs.map +3 -3
  300. package/dist/mjs/evaluator/dependency-nodes/resource-dependency-node.mjs +21 -0
  301. package/dist/mjs/evaluator/dependency-nodes/resource-dependency-node.mjs.map +10 -0
  302. package/dist/mjs/evaluator/dependency-nodes/virtual-cell-value-node.mjs +4 -1
  303. package/dist/mjs/evaluator/dependency-nodes/virtual-cell-value-node.mjs.map +3 -3
  304. package/dist/mjs/evaluator/formula-evaluator.mjs +42 -4
  305. package/dist/mjs/evaluator/formula-evaluator.mjs.map +3 -3
  306. package/dist/mjs/evaluator/range-evaluation-node.mjs +17 -3
  307. package/dist/mjs/evaluator/range-evaluation-node.mjs.map +3 -3
  308. package/dist/mjs/functions/lookup/match/match.mjs +3 -2
  309. package/dist/mjs/functions/lookup/match/match.mjs.map +3 -3
  310. package/dist/mjs/functions/text/concatenate/concatenate.mjs +3 -1
  311. package/dist/mjs/functions/text/concatenate/concatenate.mjs.map +3 -3
  312. package/dist/mjs/package.json +1 -1
  313. package/dist/types/core/commands/content-commands.d.ts +31 -1
  314. package/dist/types/core/commands/named-expression-commands.d.ts +16 -1
  315. package/dist/types/core/commands/structure-commands.d.ts +24 -1
  316. package/dist/types/core/commands/table-commands.d.ts +16 -1
  317. package/dist/types/core/commands/types.d.ts +25 -1
  318. package/dist/types/core/engine-snapshot.d.ts +138 -0
  319. package/dist/types/core/engine.d.ts +1 -0
  320. package/dist/types/core/managers/cache-manager.d.ts +9 -0
  321. package/dist/types/core/managers/dependency-manager.d.ts +56 -1
  322. package/dist/types/core/managers/dependency-node.d.ts +2 -1
  323. package/dist/types/core/managers/evaluation-manager.d.ts +21 -1
  324. package/dist/types/core/managers/frontier-dependency-manager.d.ts +12 -2
  325. package/dist/types/core/managers/named-expression-manager.d.ts +17 -1
  326. package/dist/types/core/managers/reference-manager.d.ts +3 -0
  327. package/dist/types/core/managers/style-manager.d.ts +3 -0
  328. package/dist/types/core/managers/table-manager.d.ts +3 -0
  329. package/dist/types/core/managers/workbook-manager.d.ts +4 -1
  330. package/dist/types/core/resource-keys.d.ts +14 -0
  331. package/dist/types/evaluator/dependency-nodes/base-eval-node.d.ts +5 -0
  332. package/dist/types/evaluator/dependency-nodes/cell-value-node.d.ts +1 -0
  333. package/dist/types/evaluator/dependency-nodes/empty-cell-evaluation-node.d.ts +8 -1
  334. package/dist/types/evaluator/dependency-nodes/resource-dependency-node.d.ts +8 -0
  335. package/dist/types/evaluator/dependency-nodes/virtual-cell-value-node.d.ts +1 -0
  336. package/dist/types/evaluator/range-evaluation-node.d.ts +8 -1
  337. package/package.json +6 -2
@@ -2,27 +2,37 @@ var __defProp = Object.defineProperty;
2
2
  var __getOwnPropNames = Object.getOwnPropertyNames;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __moduleCache = /* @__PURE__ */ new WeakMap;
5
+ function __accessProp(key) {
6
+ return this[key];
7
+ }
6
8
  var __toCommonJS = (from) => {
7
- var entry = __moduleCache.get(from), desc;
9
+ var entry = (__moduleCache ??= new WeakMap).get(from), desc;
8
10
  if (entry)
9
11
  return entry;
10
12
  entry = __defProp({}, "__esModule", { value: true });
11
- if (from && typeof from === "object" || typeof from === "function")
12
- __getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
13
- get: () => from[key],
14
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
- }));
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (var key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(entry, key))
16
+ __defProp(entry, key, {
17
+ get: __accessProp.bind(from, key),
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
16
21
  __moduleCache.set(from, entry);
17
22
  return entry;
18
23
  };
24
+ var __moduleCache;
25
+ var __returnValue = (v) => v;
26
+ function __exportSetter(name, newValue) {
27
+ this[name] = __returnValue.bind(null, newValue);
28
+ }
19
29
  var __export = (target, all) => {
20
30
  for (var name in all)
21
31
  __defProp(target, name, {
22
32
  get: all[name],
23
33
  enumerable: true,
24
34
  configurable: true,
25
- set: (newValue) => all[name] = () => newValue
35
+ set: __exportSetter.bind(all, name)
26
36
  });
27
37
  };
28
38
 
@@ -41,6 +51,27 @@ __export(exports_content_commands, {
41
51
  module.exports = __toCommonJS(exports_content_commands);
42
52
  var import_types = require("./types.cjs");
43
53
  var import_utils = require("../utils.cjs");
54
+ function buildTouchedCells(cells) {
55
+ const deduped = new Map;
56
+ for (const cell of cells) {
57
+ deduped.set(`${cell.address.workbookName}:${cell.address.sheetName}:${import_utils.getCellReference(cell.address)}`, {
58
+ address: cell.address,
59
+ beforeKind: import_types.getSerializedCellValueKind(cell.before),
60
+ afterKind: import_types.getSerializedCellValueKind(cell.after)
61
+ });
62
+ }
63
+ return Array.from(deduped.values());
64
+ }
65
+ function getAddressKey(address) {
66
+ return `${address.workbookName}:${address.sheetName}:${import_utils.getCellReference(address)}`;
67
+ }
68
+ function captureCellContents(workbookManager, addresses) {
69
+ const contents = new Map;
70
+ for (const address of addresses) {
71
+ contents.set(getAddressKey(address), workbookManager.getCellContent(address));
72
+ }
73
+ return contents;
74
+ }
44
75
 
45
76
  class SetCellContentCommand {
46
77
  workbookManager;
@@ -49,6 +80,8 @@ class SetCellContentCommand {
49
80
  requiresReevaluation = true;
50
81
  previousValue;
51
82
  hadPreviousValue = false;
83
+ executeFootprint = import_types.emptyMutationInvalidation();
84
+ undoFootprint = import_types.emptyMutationInvalidation();
52
85
  constructor(workbookManager, address, newContent) {
53
86
  this.workbookManager = workbookManager;
54
87
  this.address = address;
@@ -65,6 +98,26 @@ class SetCellContentCommand {
65
98
  this.previousValue = sheet.content.get(key);
66
99
  }
67
100
  this.workbookManager.setCellContent(this.address, this.newContent);
101
+ this.executeFootprint = {
102
+ touchedCells: buildTouchedCells([
103
+ {
104
+ address: this.address,
105
+ before: this.previousValue,
106
+ after: this.newContent
107
+ }
108
+ ]),
109
+ resourceKeys: []
110
+ };
111
+ this.undoFootprint = {
112
+ touchedCells: buildTouchedCells([
113
+ {
114
+ address: this.address,
115
+ before: this.newContent,
116
+ after: this.hadPreviousValue ? this.previousValue : undefined
117
+ }
118
+ ]),
119
+ resourceKeys: []
120
+ };
68
121
  }
69
122
  undo() {
70
123
  if (this.hadPreviousValue) {
@@ -73,6 +126,9 @@ class SetCellContentCommand {
73
126
  this.workbookManager.setCellContent(this.address, undefined);
74
127
  }
75
128
  }
129
+ getInvalidationFootprint(phase) {
130
+ return phase === "execute" ? this.executeFootprint : this.undoFootprint;
131
+ }
76
132
  toAction() {
77
133
  return {
78
134
  type: import_types.ActionTypes.SET_CELL_CONTENT,
@@ -90,6 +146,8 @@ class SetSheetContentCommand {
90
146
  newContent;
91
147
  requiresReevaluation = true;
92
148
  previousContent;
149
+ executeFootprint = import_types.emptyMutationInvalidation();
150
+ undoFootprint = import_types.emptyMutationInvalidation();
93
151
  constructor(workbookManager, opts, newContent) {
94
152
  this.workbookManager = workbookManager;
95
153
  this.opts = opts;
@@ -101,12 +159,44 @@ class SetSheetContentCommand {
101
159
  this.previousContent = new Map(sheet.content);
102
160
  }
103
161
  this.workbookManager.setSheetContent(this.opts, this.newContent);
162
+ const touchedKeys = new Set([
163
+ ...Array.from(this.previousContent?.keys() ?? []),
164
+ ...Array.from(this.newContent.keys())
165
+ ]);
166
+ const touchedCells = buildTouchedCells(Array.from(touchedKeys, (key) => ({
167
+ address: {
168
+ workbookName: this.opts.workbookName,
169
+ sheetName: this.opts.sheetName,
170
+ ...import_utils.parseCellReference(key)
171
+ },
172
+ before: this.previousContent?.get(key),
173
+ after: this.newContent.get(key)
174
+ })));
175
+ this.executeFootprint = {
176
+ touchedCells,
177
+ resourceKeys: []
178
+ };
179
+ this.undoFootprint = {
180
+ touchedCells: buildTouchedCells(Array.from(touchedKeys, (key) => ({
181
+ address: {
182
+ workbookName: this.opts.workbookName,
183
+ sheetName: this.opts.sheetName,
184
+ ...import_utils.parseCellReference(key)
185
+ },
186
+ before: this.newContent.get(key),
187
+ after: this.previousContent?.get(key)
188
+ }))),
189
+ resourceKeys: []
190
+ };
104
191
  }
105
192
  undo() {
106
193
  if (this.previousContent) {
107
194
  this.workbookManager.setSheetContent(this.opts, this.previousContent);
108
195
  }
109
196
  }
197
+ getInvalidationFootprint(phase) {
198
+ return phase === "execute" ? this.executeFootprint : this.undoFootprint;
199
+ }
110
200
  toAction() {
111
201
  return {
112
202
  type: import_types.ActionTypes.SET_SHEET_CONTENT,
@@ -123,11 +213,14 @@ class ClearRangeCommand {
123
213
  address;
124
214
  requiresReevaluation = true;
125
215
  clearedCells = new Map;
216
+ executeFootprint = import_types.emptyMutationInvalidation();
217
+ undoFootprint = import_types.emptyMutationInvalidation();
126
218
  constructor(workbookManager, address) {
127
219
  this.workbookManager = workbookManager;
128
220
  this.address = address;
129
221
  }
130
222
  execute() {
223
+ this.clearedCells.clear();
131
224
  try {
132
225
  for (const cellAddress of this.workbookManager.iterateCellsInRange(this.address)) {
133
226
  const key = import_utils.getCellReference(cellAddress);
@@ -138,6 +231,30 @@ class ClearRangeCommand {
138
231
  }
139
232
  } catch {}
140
233
  this.workbookManager.clearSpreadsheetRange(this.address);
234
+ this.executeFootprint = {
235
+ touchedCells: buildTouchedCells(Array.from(this.clearedCells.entries(), ([key, before]) => ({
236
+ address: {
237
+ workbookName: this.address.workbookName,
238
+ sheetName: this.address.sheetName,
239
+ ...import_utils.parseCellReference(key)
240
+ },
241
+ before,
242
+ after: undefined
243
+ }))),
244
+ resourceKeys: []
245
+ };
246
+ this.undoFootprint = {
247
+ touchedCells: buildTouchedCells(Array.from(this.clearedCells.entries(), ([key, after]) => ({
248
+ address: {
249
+ workbookName: this.address.workbookName,
250
+ sheetName: this.address.sheetName,
251
+ ...import_utils.parseCellReference(key)
252
+ },
253
+ before: undefined,
254
+ after
255
+ }))),
256
+ resourceKeys: []
257
+ };
141
258
  }
142
259
  undo() {
143
260
  for (const [key, value] of this.clearedCells) {
@@ -150,6 +267,9 @@ class ClearRangeCommand {
150
267
  }, value);
151
268
  }
152
269
  }
270
+ getInvalidationFootprint(phase) {
271
+ return phase === "execute" ? this.executeFootprint : this.undoFootprint;
272
+ }
153
273
  toAction() {
154
274
  return {
155
275
  type: import_types.ActionTypes.CLEAR_RANGE,
@@ -169,6 +289,9 @@ class PasteCellsCommand {
169
289
  requiresReevaluation = true;
170
290
  targetSnapshots = [];
171
291
  sourceSnapshots = [];
292
+ executeFootprint = import_types.emptyMutationInvalidation();
293
+ undoFootprint = import_types.emptyMutationInvalidation();
294
+ executedContents = new Map;
172
295
  constructor(workbookManager, copyManager, source, target, options) {
173
296
  this.workbookManager = workbookManager;
174
297
  this.copyManager = copyManager;
@@ -177,6 +300,9 @@ class PasteCellsCommand {
177
300
  this.options = options;
178
301
  }
179
302
  execute() {
303
+ this.targetSnapshots = [];
304
+ this.sourceSnapshots = [];
305
+ this.executedContents.clear();
180
306
  if (this.source.length > 0) {
181
307
  const firstSource = this.source[0];
182
308
  const colOffset = this.target.colIndex - firstSource.colIndex;
@@ -219,6 +345,22 @@ class PasteCellsCommand {
219
345
  }
220
346
  }
221
347
  this.copyManager.pasteCells(this.source, this.target, this.options);
348
+ const touchedAddresses = [
349
+ ...this.targetSnapshots.map((snapshot) => snapshot.address),
350
+ ...this.sourceSnapshots.map((snapshot) => snapshot.address)
351
+ ];
352
+ this.executedContents = captureCellContents(this.workbookManager, touchedAddresses);
353
+ this.executeFootprint = {
354
+ touchedCells: buildTouchedCells(touchedAddresses.map((address) => {
355
+ const beforeSnapshot = this.targetSnapshots.find((snapshot) => snapshot.address.workbookName === address.workbookName && snapshot.address.sheetName === address.sheetName && snapshot.address.colIndex === address.colIndex && snapshot.address.rowIndex === address.rowIndex) ?? this.sourceSnapshots.find((snapshot) => snapshot.address.workbookName === address.workbookName && snapshot.address.sheetName === address.sheetName && snapshot.address.colIndex === address.colIndex && snapshot.address.rowIndex === address.rowIndex);
356
+ return {
357
+ address,
358
+ before: beforeSnapshot?.content,
359
+ after: this.executedContents.get(getAddressKey(address))
360
+ };
361
+ })),
362
+ resourceKeys: []
363
+ };
222
364
  }
223
365
  undo() {
224
366
  for (const snapshot of this.targetSnapshots) {
@@ -235,6 +377,23 @@ class PasteCellsCommand {
235
377
  }
236
378
  }
237
379
  }
380
+ const touchedAddresses = [
381
+ ...this.targetSnapshots.map((snapshot) => snapshot.address),
382
+ ...this.sourceSnapshots.map((snapshot) => snapshot.address)
383
+ ];
384
+ this.undoFootprint = {
385
+ touchedCells: buildTouchedCells(touchedAddresses.map((address) => {
386
+ return {
387
+ address,
388
+ before: this.executedContents.get(getAddressKey(address)),
389
+ after: this.workbookManager.getCellContent(address)
390
+ };
391
+ })),
392
+ resourceKeys: []
393
+ };
394
+ }
395
+ getInvalidationFootprint(phase) {
396
+ return phase === "execute" ? this.executeFootprint : this.undoFootprint;
238
397
  }
239
398
  toAction() {
240
399
  return {
@@ -256,6 +415,9 @@ class FillAreasCommand {
256
415
  options;
257
416
  requiresReevaluation = true;
258
417
  targetSnapshots = new Map;
418
+ executeFootprint = import_types.emptyMutationInvalidation();
419
+ undoFootprint = import_types.emptyMutationInvalidation();
420
+ executedContents = new Map;
259
421
  constructor(workbookManager, copyManager, seedRange, targetRanges, options) {
260
422
  this.workbookManager = workbookManager;
261
423
  this.copyManager = copyManager;
@@ -264,6 +426,8 @@ class FillAreasCommand {
264
426
  this.options = options;
265
427
  }
266
428
  execute() {
429
+ this.targetSnapshots.clear();
430
+ this.executedContents.clear();
267
431
  for (const targetRange of this.targetRanges) {
268
432
  const sheet = this.workbookManager.getSheet({
269
433
  workbookName: targetRange.workbookName,
@@ -295,6 +459,16 @@ class FillAreasCommand {
295
459
  }
296
460
  }
297
461
  this.copyManager.fillAreas(this.seedRange, this.targetRanges, this.options);
462
+ const touchedAddresses = Array.from(this.targetSnapshots.values()).map((snapshot) => snapshot.address);
463
+ this.executedContents = captureCellContents(this.workbookManager, touchedAddresses);
464
+ this.executeFootprint = {
465
+ touchedCells: buildTouchedCells(touchedAddresses.map((address) => ({
466
+ address,
467
+ before: this.targetSnapshots.get(getAddressKey(address))?.content,
468
+ after: this.executedContents.get(getAddressKey(address))
469
+ }))),
470
+ resourceKeys: []
471
+ };
298
472
  }
299
473
  undo() {
300
474
  for (const snapshot of this.targetSnapshots.values()) {
@@ -303,6 +477,18 @@ class FillAreasCommand {
303
477
  this.workbookManager.setCellMetadata(snapshot.address, snapshot.metadata);
304
478
  }
305
479
  }
480
+ const touchedAddresses = Array.from(this.targetSnapshots.values()).map((snapshot) => snapshot.address);
481
+ this.undoFootprint = {
482
+ touchedCells: buildTouchedCells(touchedAddresses.map((address) => ({
483
+ address,
484
+ before: this.executedContents.get(getAddressKey(address)),
485
+ after: this.workbookManager.getCellContent(address)
486
+ }))),
487
+ resourceKeys: []
488
+ };
489
+ }
490
+ getInvalidationFootprint(phase) {
491
+ return phase === "execute" ? this.executeFootprint : this.undoFootprint;
306
492
  }
307
493
  toAction() {
308
494
  return {
@@ -324,6 +510,9 @@ class MoveCellCommand {
324
510
  requiresReevaluation = true;
325
511
  sourceSnapshot;
326
512
  targetSnapshot;
513
+ executeFootprint = import_types.emptyMutationInvalidation();
514
+ undoFootprint = import_types.emptyMutationInvalidation();
515
+ executedContents = new Map;
327
516
  constructor(workbookManager, copyManager, source, target) {
328
517
  this.workbookManager = workbookManager;
329
518
  this.copyManager = copyManager;
@@ -331,6 +520,9 @@ class MoveCellCommand {
331
520
  this.target = target;
332
521
  }
333
522
  execute() {
523
+ this.sourceSnapshot = undefined;
524
+ this.targetSnapshot = undefined;
525
+ this.executedContents.clear();
334
526
  const sourceSheet = this.workbookManager.getSheet({
335
527
  workbookName: this.source.workbookName,
336
528
  sheetName: this.source.sheetName
@@ -360,6 +552,16 @@ class MoveCellCommand {
360
552
  type: "formula",
361
553
  include: "all"
362
554
  });
555
+ const touchedAddresses = [this.source, this.target];
556
+ this.executedContents = captureCellContents(this.workbookManager, touchedAddresses);
557
+ this.executeFootprint = {
558
+ touchedCells: buildTouchedCells(touchedAddresses.map((address) => ({
559
+ address,
560
+ before: this.sourceSnapshot?.address === address ? this.sourceSnapshot.content : this.targetSnapshot?.content,
561
+ after: this.executedContents.get(getAddressKey(address))
562
+ }))),
563
+ resourceKeys: []
564
+ };
363
565
  }
364
566
  undo() {
365
567
  if (this.sourceSnapshot) {
@@ -374,6 +576,18 @@ class MoveCellCommand {
374
576
  this.workbookManager.setCellMetadata(this.targetSnapshot.address, this.targetSnapshot.metadata);
375
577
  }
376
578
  }
579
+ const touchedAddresses = [this.source, this.target];
580
+ this.undoFootprint = {
581
+ touchedCells: buildTouchedCells(touchedAddresses.map((address) => ({
582
+ address,
583
+ before: this.executedContents.get(getAddressKey(address)),
584
+ after: this.workbookManager.getCellContent(address)
585
+ }))),
586
+ resourceKeys: []
587
+ };
588
+ }
589
+ getInvalidationFootprint(phase) {
590
+ return phase === "execute" ? this.executeFootprint : this.undoFootprint;
377
591
  }
378
592
  toAction() {
379
593
  return {
@@ -394,6 +608,9 @@ class MoveRangeCommand {
394
608
  requiresReevaluation = true;
395
609
  sourceSnapshots = [];
396
610
  targetSnapshots = [];
611
+ executeFootprint = import_types.emptyMutationInvalidation();
612
+ undoFootprint = import_types.emptyMutationInvalidation();
613
+ executedContents = new Map;
397
614
  constructor(workbookManager, copyManager, sourceRange, target) {
398
615
  this.workbookManager = workbookManager;
399
616
  this.copyManager = copyManager;
@@ -401,6 +618,9 @@ class MoveRangeCommand {
401
618
  this.target = target;
402
619
  }
403
620
  execute() {
621
+ this.sourceSnapshots = [];
622
+ this.targetSnapshots = [];
623
+ this.executedContents.clear();
404
624
  const sourceCells = this.copyManager.expandRangeToCells(this.sourceRange);
405
625
  for (const cell of sourceCells) {
406
626
  const sheet = this.workbookManager.getSheet({
@@ -446,6 +666,22 @@ class MoveRangeCommand {
446
666
  type: "formula",
447
667
  include: "all"
448
668
  });
669
+ const touchedAddresses = [
670
+ ...this.sourceSnapshots.map((snapshot) => snapshot.address),
671
+ ...this.targetSnapshots.map((snapshot) => snapshot.address)
672
+ ];
673
+ this.executedContents = captureCellContents(this.workbookManager, touchedAddresses);
674
+ this.executeFootprint = {
675
+ touchedCells: buildTouchedCells(touchedAddresses.map((address) => {
676
+ const snapshot = this.sourceSnapshots.find((candidate) => getAddressKey(candidate.address) === getAddressKey(address)) ?? this.targetSnapshots.find((candidate) => getAddressKey(candidate.address) === getAddressKey(address));
677
+ return {
678
+ address,
679
+ before: snapshot?.content,
680
+ after: this.executedContents.get(getAddressKey(address))
681
+ };
682
+ })),
683
+ resourceKeys: []
684
+ };
449
685
  }
450
686
  undo() {
451
687
  for (const snapshot of this.sourceSnapshots) {
@@ -460,6 +696,21 @@ class MoveRangeCommand {
460
696
  this.workbookManager.setCellMetadata(snapshot.address, snapshot.metadata);
461
697
  }
462
698
  }
699
+ const touchedAddresses = [
700
+ ...this.sourceSnapshots.map((snapshot) => snapshot.address),
701
+ ...this.targetSnapshots.map((snapshot) => snapshot.address)
702
+ ];
703
+ this.undoFootprint = {
704
+ touchedCells: buildTouchedCells(touchedAddresses.map((address) => ({
705
+ address,
706
+ before: this.executedContents.get(getAddressKey(address)),
707
+ after: this.workbookManager.getCellContent(address)
708
+ }))),
709
+ resourceKeys: []
710
+ };
711
+ }
712
+ getInvalidationFootprint(phase) {
713
+ return phase === "execute" ? this.executeFootprint : this.undoFootprint;
463
714
  }
464
715
  toAction() {
465
716
  return {
@@ -483,6 +734,10 @@ class AutoFillCommand {
483
734
  requiresReevaluation = true;
484
735
  previousContent = new Map;
485
736
  previousMetadata = new Map;
737
+ executeFootprint = import_types.emptyMutationInvalidation();
738
+ undoFootprint = import_types.emptyMutationInvalidation();
739
+ touchedAddresses = [];
740
+ executedContents = new Map;
486
741
  constructor(workbookManager, styleManager, autoFillManager, opts, seedRange, fillRanges, direction) {
487
742
  this.workbookManager = workbookManager;
488
743
  this.styleManager = styleManager;
@@ -493,6 +748,10 @@ class AutoFillCommand {
493
748
  this.direction = direction;
494
749
  }
495
750
  execute() {
751
+ this.previousContent.clear();
752
+ this.previousMetadata.clear();
753
+ this.touchedAddresses = [];
754
+ this.executedContents.clear();
496
755
  for (const fillRange of this.fillRanges) {
497
756
  if (fillRange.end.col.type === "infinity" || fillRange.end.row.type === "infinity") {
498
757
  continue;
@@ -510,6 +769,7 @@ class AutoFillCommand {
510
769
  colIndex: col,
511
770
  rowIndex: row
512
771
  };
772
+ this.touchedAddresses.push(address);
513
773
  const content = this.workbookManager.getCellContent(address);
514
774
  if (content !== undefined) {
515
775
  this.previousContent.set(key, content);
@@ -522,6 +782,18 @@ class AutoFillCommand {
522
782
  }
523
783
  }
524
784
  this.autoFillManager.fill(this.opts, this.seedRange, this.fillRanges, this.direction);
785
+ this.executedContents = captureCellContents(this.workbookManager, this.touchedAddresses);
786
+ this.executeFootprint = {
787
+ touchedCells: buildTouchedCells(this.touchedAddresses.map((address) => {
788
+ const key = import_utils.getCellReference(address);
789
+ return {
790
+ address,
791
+ before: this.previousContent.get(key),
792
+ after: this.executedContents.get(getAddressKey(address))
793
+ };
794
+ })),
795
+ resourceKeys: []
796
+ };
525
797
  }
526
798
  undo() {
527
799
  const currentContent = this.workbookManager.getSheetSerialized(this.opts);
@@ -557,6 +829,17 @@ class AutoFillCommand {
557
829
  }
558
830
  }
559
831
  this.workbookManager.setSheetContent(this.opts, newContent);
832
+ this.undoFootprint = {
833
+ touchedCells: buildTouchedCells(this.touchedAddresses.map((address) => ({
834
+ address,
835
+ before: this.executedContents.get(getAddressKey(address)),
836
+ after: this.workbookManager.getCellContent(address)
837
+ }))),
838
+ resourceKeys: []
839
+ };
840
+ }
841
+ getInvalidationFootprint(phase) {
842
+ return phase === "execute" ? this.executeFootprint : this.undoFootprint;
560
843
  }
561
844
  toAction() {
562
845
  return {
@@ -571,4 +854,4 @@ class AutoFillCommand {
571
854
  }
572
855
  }
573
856
 
574
- //# debugId=C5074A7894EBFBCB64756E2164756E21
857
+ //# debugId=7AAB2F977AF7BA6364756E2164756E21