@ricsam/formula-engine 0.2.2 → 0.2.3
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/cjs/core/ast-traverser.cjs +19 -9
- package/dist/cjs/core/ast-traverser.cjs.map +2 -2
- package/dist/cjs/core/autofill-utils.cjs +19 -9
- package/dist/cjs/core/autofill-utils.cjs.map +2 -2
- package/dist/cjs/core/cell-mover.cjs +19 -9
- package/dist/cjs/core/cell-mover.cjs.map +2 -2
- package/dist/cjs/core/commands/command-executor.cjs +24 -13
- package/dist/cjs/core/commands/command-executor.cjs.map +3 -3
- package/dist/cjs/core/commands/content-commands.cjs +292 -9
- package/dist/cjs/core/commands/content-commands.cjs.map +3 -3
- package/dist/cjs/core/commands/metadata-commands.cjs +19 -9
- package/dist/cjs/core/commands/metadata-commands.cjs.map +2 -2
- package/dist/cjs/core/commands/named-expression-commands.cjs +138 -13
- package/dist/cjs/core/commands/named-expression-commands.cjs.map +3 -3
- package/dist/cjs/core/commands/structure-commands.cjs +216 -15
- package/dist/cjs/core/commands/structure-commands.cjs.map +3 -3
- package/dist/cjs/core/commands/style-commands.cjs +19 -9
- package/dist/cjs/core/commands/style-commands.cjs.map +2 -2
- package/dist/cjs/core/commands/table-commands.cjs +134 -13
- package/dist/cjs/core/commands/table-commands.cjs.map +3 -3
- package/dist/cjs/core/commands/types.cjs +36 -9
- package/dist/cjs/core/commands/types.cjs.map +3 -3
- package/dist/cjs/core/engine-snapshot.cjs +51 -0
- package/dist/cjs/core/engine-snapshot.cjs.map +10 -0
- package/dist/cjs/core/engine.cjs +51 -34
- package/dist/cjs/core/engine.cjs.map +3 -3
- package/dist/cjs/core/managers/cache-manager.cjs +123 -9
- package/dist/cjs/core/managers/cache-manager.cjs.map +3 -3
- package/dist/cjs/core/managers/copy-manager.cjs +19 -9
- package/dist/cjs/core/managers/copy-manager.cjs.map +2 -2
- package/dist/cjs/core/managers/dependency-manager.cjs +697 -9
- package/dist/cjs/core/managers/dependency-manager.cjs.map +3 -3
- package/dist/cjs/core/managers/dependency-node.cjs +14 -8
- package/dist/cjs/core/managers/dependency-node.cjs.map +1 -1
- package/dist/cjs/core/managers/evaluation-manager.cjs +296 -11
- package/dist/cjs/core/managers/evaluation-manager.cjs.map +3 -3
- package/dist/cjs/core/managers/event-manager.cjs +19 -9
- package/dist/cjs/core/managers/event-manager.cjs.map +2 -2
- package/dist/cjs/core/managers/frontier-dependency-manager.cjs +65 -12
- package/dist/cjs/core/managers/frontier-dependency-manager.cjs.map +3 -3
- package/dist/cjs/core/managers/isDependencyNode.cjs +19 -9
- package/dist/cjs/core/managers/isDependencyNode.cjs.map +2 -2
- package/dist/cjs/core/managers/named-expression-manager.cjs +121 -29
- package/dist/cjs/core/managers/named-expression-manager.cjs.map +3 -3
- package/dist/cjs/core/managers/range-eval-order-builder.cjs +19 -9
- package/dist/cjs/core/managers/range-eval-order-builder.cjs.map +2 -2
- package/dist/cjs/core/managers/reference-manager.cjs +25 -9
- package/dist/cjs/core/managers/reference-manager.cjs.map +3 -3
- package/dist/cjs/core/managers/schema-manager.cjs +19 -9
- package/dist/cjs/core/managers/schema-manager.cjs.map +2 -2
- package/dist/cjs/core/managers/style-manager.cjs +28 -9
- package/dist/cjs/core/managers/style-manager.cjs.map +3 -3
- package/dist/cjs/core/managers/table-manager.cjs +25 -9
- package/dist/cjs/core/managers/table-manager.cjs.map +3 -3
- package/dist/cjs/core/managers/workbook-manager.cjs +38 -13
- package/dist/cjs/core/managers/workbook-manager.cjs.map +3 -3
- package/dist/cjs/core/map-serializer.cjs +19 -9
- package/dist/cjs/core/map-serializer.cjs.map +2 -2
- package/dist/cjs/core/named-expression-renamer.cjs +19 -9
- package/dist/cjs/core/named-expression-renamer.cjs.map +2 -2
- package/dist/cjs/core/resource-keys.cjs +67 -0
- package/dist/cjs/core/resource-keys.cjs.map +10 -0
- package/dist/cjs/core/schema/cell-orm.cjs +19 -9
- package/dist/cjs/core/schema/cell-orm.cjs.map +2 -2
- package/dist/cjs/core/schema/grid-orm.cjs +19 -9
- package/dist/cjs/core/schema/grid-orm.cjs.map +2 -2
- package/dist/cjs/core/schema/schema-builder.cjs +19 -9
- package/dist/cjs/core/schema/schema-builder.cjs.map +2 -2
- package/dist/cjs/core/schema/schema-helpers.cjs +19 -9
- package/dist/cjs/core/schema/schema-helpers.cjs.map +2 -2
- package/dist/cjs/core/schema/schema.cjs +19 -9
- package/dist/cjs/core/schema/schema.cjs.map +2 -2
- package/dist/cjs/core/schema/table-orm.cjs +19 -9
- package/dist/cjs/core/schema/table-orm.cjs.map +2 -2
- package/dist/cjs/core/sheet-renamer.cjs +19 -9
- package/dist/cjs/core/sheet-renamer.cjs.map +2 -2
- package/dist/cjs/core/sheet-utils.cjs +19 -9
- package/dist/cjs/core/sheet-utils.cjs.map +2 -2
- package/dist/cjs/core/table-renamer.cjs +19 -9
- package/dist/cjs/core/table-renamer.cjs.map +2 -2
- package/dist/cjs/core/types.cjs +19 -9
- package/dist/cjs/core/types.cjs.map +2 -2
- package/dist/cjs/core/utils/color-utils.cjs +19 -9
- package/dist/cjs/core/utils/color-utils.cjs.map +2 -2
- package/dist/cjs/core/utils/range-serializer.cjs +19 -9
- package/dist/cjs/core/utils/range-serializer.cjs.map +2 -2
- package/dist/cjs/core/utils/range-utils.cjs +19 -9
- package/dist/cjs/core/utils/range-utils.cjs.map +2 -2
- package/dist/cjs/core/utils/spreadsheet-visualizer.cjs +19 -9
- package/dist/cjs/core/utils/spreadsheet-visualizer.cjs.map +2 -2
- package/dist/cjs/core/utils.cjs +19 -9
- package/dist/cjs/core/utils.cjs.map +2 -2
- package/dist/cjs/core/workbook-renamer.cjs +19 -9
- package/dist/cjs/core/workbook-renamer.cjs.map +2 -2
- package/dist/cjs/debug/flags.cjs +19 -9
- package/dist/cjs/debug/flags.cjs.map +2 -2
- package/dist/cjs/evaluator/arithmetic/add/add.cjs +19 -9
- package/dist/cjs/evaluator/arithmetic/add/add.cjs.map +2 -2
- package/dist/cjs/evaluator/arithmetic/divide/divide.cjs +19 -9
- package/dist/cjs/evaluator/arithmetic/divide/divide.cjs.map +2 -2
- package/dist/cjs/evaluator/arithmetic/multiply/multiply.cjs +19 -9
- package/dist/cjs/evaluator/arithmetic/multiply/multiply.cjs.map +2 -2
- package/dist/cjs/evaluator/arithmetic/power/power.cjs +19 -9
- package/dist/cjs/evaluator/arithmetic/power/power.cjs.map +2 -2
- package/dist/cjs/evaluator/arithmetic/subtract/subtract.cjs +19 -9
- package/dist/cjs/evaluator/arithmetic/subtract/subtract.cjs.map +2 -2
- package/dist/cjs/evaluator/comparison/equals.cjs +19 -9
- package/dist/cjs/evaluator/comparison/equals.cjs.map +2 -2
- package/dist/cjs/evaluator/comparison/greater-than-or-equal.cjs +19 -9
- package/dist/cjs/evaluator/comparison/greater-than-or-equal.cjs.map +2 -2
- package/dist/cjs/evaluator/comparison/greater-than.cjs +19 -9
- package/dist/cjs/evaluator/comparison/greater-than.cjs.map +2 -2
- package/dist/cjs/evaluator/comparison/less-than-or-equal.cjs +19 -9
- package/dist/cjs/evaluator/comparison/less-than-or-equal.cjs.map +2 -2
- package/dist/cjs/evaluator/comparison/less-than.cjs +19 -9
- package/dist/cjs/evaluator/comparison/less-than.cjs.map +2 -2
- package/dist/cjs/evaluator/comparison/not-equals.cjs +19 -9
- package/dist/cjs/evaluator/comparison/not-equals.cjs.map +2 -2
- package/dist/cjs/evaluator/concatenation/concatenate.cjs +19 -9
- package/dist/cjs/evaluator/concatenation/concatenate.cjs.map +2 -2
- package/dist/cjs/evaluator/dependency-nodes/ast-evaluation-node.cjs +19 -9
- package/dist/cjs/evaluator/dependency-nodes/ast-evaluation-node.cjs.map +2 -2
- package/dist/cjs/evaluator/dependency-nodes/base-eval-node.cjs +35 -9
- package/dist/cjs/evaluator/dependency-nodes/base-eval-node.cjs.map +3 -3
- package/dist/cjs/evaluator/dependency-nodes/cell-value-node.cjs +22 -9
- package/dist/cjs/evaluator/dependency-nodes/cell-value-node.cjs.map +3 -3
- package/dist/cjs/evaluator/dependency-nodes/empty-cell-evaluation-node.cjs +35 -11
- package/dist/cjs/evaluator/dependency-nodes/empty-cell-evaluation-node.cjs.map +3 -3
- package/dist/cjs/evaluator/dependency-nodes/resource-dependency-node.cjs +61 -0
- package/dist/cjs/evaluator/dependency-nodes/resource-dependency-node.cjs.map +10 -0
- package/dist/cjs/evaluator/dependency-nodes/spill-meta-node.cjs +19 -9
- package/dist/cjs/evaluator/dependency-nodes/spill-meta-node.cjs.map +2 -2
- package/dist/cjs/evaluator/dependency-nodes/virtual-cell-value-node.cjs +22 -9
- package/dist/cjs/evaluator/dependency-nodes/virtual-cell-value-node.cjs.map +3 -3
- package/dist/cjs/evaluator/evaluate-scalar-operator.cjs +19 -9
- package/dist/cjs/evaluator/evaluate-scalar-operator.cjs.map +2 -2
- package/dist/cjs/evaluator/evaluation-context.cjs +19 -9
- package/dist/cjs/evaluator/evaluation-context.cjs.map +2 -2
- package/dist/cjs/evaluator/evaluation-error.cjs +19 -9
- package/dist/cjs/evaluator/evaluation-error.cjs.map +2 -2
- package/dist/cjs/evaluator/formula-evaluator.cjs +55 -12
- package/dist/cjs/evaluator/formula-evaluator.cjs.map +3 -3
- package/dist/cjs/evaluator/range-evaluation-node.cjs +35 -11
- package/dist/cjs/evaluator/range-evaluation-node.cjs.map +3 -3
- package/dist/cjs/functions/_template/template.cjs +19 -9
- package/dist/cjs/functions/_template/template.cjs.map +2 -2
- package/dist/cjs/functions/array/sequence/sequence.cjs +19 -9
- package/dist/cjs/functions/array/sequence/sequence.cjs.map +2 -2
- package/dist/cjs/functions/criteria-parser.cjs +19 -9
- package/dist/cjs/functions/criteria-parser.cjs.map +2 -2
- package/dist/cjs/functions/criteria-utils.cjs +19 -9
- package/dist/cjs/functions/criteria-utils.cjs.map +2 -2
- package/dist/cjs/functions/function-registry.cjs +19 -9
- package/dist/cjs/functions/function-registry.cjs.map +2 -2
- package/dist/cjs/functions/function-utils.cjs +19 -9
- package/dist/cjs/functions/function-utils.cjs.map +2 -2
- package/dist/cjs/functions/information/cell/cell.cjs +19 -9
- package/dist/cjs/functions/information/cell/cell.cjs.map +2 -2
- package/dist/cjs/functions/information/column/column.cjs +19 -9
- package/dist/cjs/functions/information/column/column.cjs.map +2 -2
- package/dist/cjs/functions/information/row/row.cjs +19 -9
- package/dist/cjs/functions/information/row/row.cjs.map +2 -2
- package/dist/cjs/functions/logical/and/and.cjs +19 -9
- package/dist/cjs/functions/logical/and/and.cjs.map +2 -2
- package/dist/cjs/functions/logical/if/if.cjs +19 -9
- package/dist/cjs/functions/logical/if/if.cjs.map +2 -2
- package/dist/cjs/functions/logical/iferror/iferror.cjs +19 -9
- package/dist/cjs/functions/logical/iferror/iferror.cjs.map +2 -2
- package/dist/cjs/functions/logical/or/or.cjs +19 -9
- package/dist/cjs/functions/logical/or/or.cjs.map +2 -2
- package/dist/cjs/functions/lookup/count/count-utils.cjs +19 -9
- package/dist/cjs/functions/lookup/count/count-utils.cjs.map +2 -2
- package/dist/cjs/functions/lookup/count/count.cjs +19 -9
- package/dist/cjs/functions/lookup/count/count.cjs.map +2 -2
- package/dist/cjs/functions/lookup/count/countif.cjs +19 -9
- package/dist/cjs/functions/lookup/count/countif.cjs.map +2 -2
- package/dist/cjs/functions/lookup/count/countifs.cjs +19 -9
- package/dist/cjs/functions/lookup/count/countifs.cjs.map +2 -2
- package/dist/cjs/functions/lookup/index-lookup/index-lookup.cjs +19 -9
- package/dist/cjs/functions/lookup/index-lookup/index-lookup.cjs.map +2 -2
- package/dist/cjs/functions/lookup/match/match.cjs +21 -10
- package/dist/cjs/functions/lookup/match/match.cjs.map +3 -3
- package/dist/cjs/functions/lookup/xlookup/xlookup.cjs +19 -9
- package/dist/cjs/functions/lookup/xlookup/xlookup.cjs.map +2 -2
- package/dist/cjs/functions/math/average/average-utils.cjs +19 -9
- package/dist/cjs/functions/math/average/average-utils.cjs.map +2 -2
- package/dist/cjs/functions/math/average/average.cjs +19 -9
- package/dist/cjs/functions/math/average/average.cjs.map +2 -2
- package/dist/cjs/functions/math/average/averageif.cjs +19 -9
- package/dist/cjs/functions/math/average/averageif.cjs.map +2 -2
- package/dist/cjs/functions/math/average/averageifs.cjs +19 -9
- package/dist/cjs/functions/math/average/averageifs.cjs.map +2 -2
- package/dist/cjs/functions/math/ceiling/ceiling.cjs +19 -9
- package/dist/cjs/functions/math/ceiling/ceiling.cjs.map +2 -2
- package/dist/cjs/functions/math/max/max-utils.cjs +19 -9
- package/dist/cjs/functions/math/max/max-utils.cjs.map +2 -2
- package/dist/cjs/functions/math/max/max.cjs +19 -9
- package/dist/cjs/functions/math/max/max.cjs.map +2 -2
- package/dist/cjs/functions/math/max/maxif.cjs +19 -9
- package/dist/cjs/functions/math/max/maxif.cjs.map +2 -2
- package/dist/cjs/functions/math/max/maxifs.cjs +19 -9
- package/dist/cjs/functions/math/max/maxifs.cjs.map +2 -2
- package/dist/cjs/functions/math/min/min-utils.cjs +19 -9
- package/dist/cjs/functions/math/min/min-utils.cjs.map +2 -2
- package/dist/cjs/functions/math/min/min.cjs +19 -9
- package/dist/cjs/functions/math/min/min.cjs.map +2 -2
- package/dist/cjs/functions/math/min/minif.cjs +19 -9
- package/dist/cjs/functions/math/min/minif.cjs.map +2 -2
- package/dist/cjs/functions/math/min/minifs.cjs +19 -9
- package/dist/cjs/functions/math/min/minifs.cjs.map +2 -2
- package/dist/cjs/functions/math/sum/sum.cjs +19 -9
- package/dist/cjs/functions/math/sum/sum.cjs.map +2 -2
- package/dist/cjs/functions/math/sum/sumif.cjs +19 -9
- package/dist/cjs/functions/math/sum/sumif.cjs.map +2 -2
- package/dist/cjs/functions/math/sum/sumifs.cjs +19 -9
- package/dist/cjs/functions/math/sum/sumifs.cjs.map +2 -2
- package/dist/cjs/functions/math/sum/summation-utils.cjs +19 -9
- package/dist/cjs/functions/math/sum/summation-utils.cjs.map +2 -2
- package/dist/cjs/functions/reference/address/address.cjs +19 -9
- package/dist/cjs/functions/reference/address/address.cjs.map +2 -2
- package/dist/cjs/functions/reference/indirect/indirect.cjs +19 -9
- package/dist/cjs/functions/reference/indirect/indirect.cjs.map +2 -2
- package/dist/cjs/functions/reference/offset/offset.cjs +19 -9
- package/dist/cjs/functions/reference/offset/offset.cjs.map +2 -2
- package/dist/cjs/functions/text/concatenate/concatenate.cjs +21 -9
- package/dist/cjs/functions/text/concatenate/concatenate.cjs.map +3 -3
- package/dist/cjs/functions/text/exact/exact.cjs +19 -9
- package/dist/cjs/functions/text/exact/exact.cjs.map +2 -2
- package/dist/cjs/functions/text/find/find.cjs +19 -9
- package/dist/cjs/functions/text/find/find.cjs.map +2 -2
- package/dist/cjs/functions/text/left/left.cjs +19 -9
- package/dist/cjs/functions/text/left/left.cjs.map +2 -2
- package/dist/cjs/functions/text/len/len.cjs +19 -9
- package/dist/cjs/functions/text/len/len.cjs.map +2 -2
- package/dist/cjs/functions/text/mid/mid.cjs +19 -9
- package/dist/cjs/functions/text/mid/mid.cjs.map +2 -2
- package/dist/cjs/functions/text/right/right.cjs +19 -9
- package/dist/cjs/functions/text/right/right.cjs.map +2 -2
- package/dist/cjs/functions/text/text-helpers.cjs +19 -9
- package/dist/cjs/functions/text/text-helpers.cjs.map +2 -2
- package/dist/cjs/functions/text/textjoin/textjoin.cjs +19 -9
- package/dist/cjs/functions/text/textjoin/textjoin.cjs.map +2 -2
- package/dist/cjs/lib.cjs +24 -13
- package/dist/cjs/lib.cjs.map +2 -2
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/parser/ast.cjs +19 -9
- package/dist/cjs/parser/ast.cjs.map +2 -2
- package/dist/cjs/parser/formatter.cjs +19 -9
- package/dist/cjs/parser/formatter.cjs.map +2 -2
- package/dist/cjs/parser/grammar.cjs +19 -9
- package/dist/cjs/parser/grammar.cjs.map +2 -2
- package/dist/cjs/parser/lexer.cjs +19 -9
- package/dist/cjs/parser/lexer.cjs.map +2 -2
- package/dist/cjs/parser/parser.cjs +19 -9
- package/dist/cjs/parser/parser.cjs.map +2 -2
- package/dist/cjs/react/hooks.cjs +31 -10
- package/dist/cjs/react/hooks.cjs.map +2 -2
- package/dist/mjs/core/commands/command-executor.mjs +7 -5
- package/dist/mjs/core/commands/command-executor.mjs.map +3 -3
- package/dist/mjs/core/commands/content-commands.mjs +279 -2
- package/dist/mjs/core/commands/content-commands.mjs.map +3 -3
- package/dist/mjs/core/commands/named-expression-commands.mjs +121 -6
- package/dist/mjs/core/commands/named-expression-commands.mjs.map +3 -3
- package/dist/mjs/core/commands/structure-commands.mjs +204 -8
- package/dist/mjs/core/commands/structure-commands.mjs.map +3 -3
- package/dist/mjs/core/commands/table-commands.mjs +117 -6
- package/dist/mjs/core/commands/table-commands.mjs.map +3 -3
- package/dist/mjs/core/commands/types.mjs +18 -1
- package/dist/mjs/core/commands/types.mjs.map +3 -3
- package/dist/mjs/core/engine-snapshot.mjs +11 -0
- package/dist/mjs/core/engine-snapshot.mjs.map +10 -0
- package/dist/mjs/core/engine.mjs +35 -26
- package/dist/mjs/core/engine.mjs.map +3 -3
- package/dist/mjs/core/managers/cache-manager.mjs +105 -1
- package/dist/mjs/core/managers/cache-manager.mjs.map +3 -3
- package/dist/mjs/core/managers/dependency-manager.mjs +687 -2
- package/dist/mjs/core/managers/dependency-manager.mjs.map +3 -3
- package/dist/mjs/core/managers/evaluation-manager.mjs +283 -4
- package/dist/mjs/core/managers/evaluation-manager.mjs.map +3 -3
- package/dist/mjs/core/managers/frontier-dependency-manager.mjs +47 -4
- package/dist/mjs/core/managers/frontier-dependency-manager.mjs.map +3 -3
- package/dist/mjs/core/managers/named-expression-manager.mjs +104 -21
- package/dist/mjs/core/managers/named-expression-manager.mjs.map +3 -3
- package/dist/mjs/core/managers/reference-manager.mjs +7 -1
- package/dist/mjs/core/managers/reference-manager.mjs.map +3 -3
- package/dist/mjs/core/managers/style-manager.mjs +10 -1
- package/dist/mjs/core/managers/style-manager.mjs.map +3 -3
- package/dist/mjs/core/managers/table-manager.mjs +7 -1
- package/dist/mjs/core/managers/table-manager.mjs.map +3 -3
- package/dist/mjs/core/managers/workbook-manager.mjs +20 -5
- package/dist/mjs/core/managers/workbook-manager.mjs.map +3 -3
- package/dist/mjs/core/resource-keys.mjs +27 -0
- package/dist/mjs/core/resource-keys.mjs.map +10 -0
- package/dist/mjs/evaluator/dependency-nodes/base-eval-node.mjs +17 -1
- package/dist/mjs/evaluator/dependency-nodes/base-eval-node.mjs.map +3 -3
- package/dist/mjs/evaluator/dependency-nodes/cell-value-node.mjs +4 -1
- package/dist/mjs/evaluator/dependency-nodes/cell-value-node.mjs.map +3 -3
- package/dist/mjs/evaluator/dependency-nodes/empty-cell-evaluation-node.mjs +17 -3
- package/dist/mjs/evaluator/dependency-nodes/empty-cell-evaluation-node.mjs.map +3 -3
- package/dist/mjs/evaluator/dependency-nodes/resource-dependency-node.mjs +21 -0
- package/dist/mjs/evaluator/dependency-nodes/resource-dependency-node.mjs.map +10 -0
- package/dist/mjs/evaluator/dependency-nodes/virtual-cell-value-node.mjs +4 -1
- package/dist/mjs/evaluator/dependency-nodes/virtual-cell-value-node.mjs.map +3 -3
- package/dist/mjs/evaluator/formula-evaluator.mjs +42 -4
- package/dist/mjs/evaluator/formula-evaluator.mjs.map +3 -3
- package/dist/mjs/evaluator/range-evaluation-node.mjs +17 -3
- package/dist/mjs/evaluator/range-evaluation-node.mjs.map +3 -3
- package/dist/mjs/functions/lookup/match/match.mjs +3 -2
- package/dist/mjs/functions/lookup/match/match.mjs.map +3 -3
- package/dist/mjs/functions/text/concatenate/concatenate.mjs +3 -1
- package/dist/mjs/functions/text/concatenate/concatenate.mjs.map +3 -3
- package/dist/mjs/package.json +1 -1
- package/dist/types/core/commands/content-commands.d.ts +31 -1
- package/dist/types/core/commands/named-expression-commands.d.ts +16 -1
- package/dist/types/core/commands/structure-commands.d.ts +24 -1
- package/dist/types/core/commands/table-commands.d.ts +16 -1
- package/dist/types/core/commands/types.d.ts +25 -1
- package/dist/types/core/engine-snapshot.d.ts +138 -0
- package/dist/types/core/engine.d.ts +1 -0
- package/dist/types/core/managers/cache-manager.d.ts +9 -0
- package/dist/types/core/managers/dependency-manager.d.ts +56 -1
- package/dist/types/core/managers/dependency-node.d.ts +2 -1
- package/dist/types/core/managers/evaluation-manager.d.ts +21 -1
- package/dist/types/core/managers/frontier-dependency-manager.d.ts +12 -2
- package/dist/types/core/managers/named-expression-manager.d.ts +17 -1
- package/dist/types/core/managers/reference-manager.d.ts +3 -0
- package/dist/types/core/managers/style-manager.d.ts +3 -0
- package/dist/types/core/managers/table-manager.d.ts +3 -0
- package/dist/types/core/managers/workbook-manager.d.ts +4 -1
- package/dist/types/core/resource-keys.d.ts +14 -0
- package/dist/types/evaluator/dependency-nodes/base-eval-node.d.ts +5 -0
- package/dist/types/evaluator/dependency-nodes/cell-value-node.d.ts +1 -0
- package/dist/types/evaluator/dependency-nodes/empty-cell-evaluation-node.d.ts +8 -1
- package/dist/types/evaluator/dependency-nodes/resource-dependency-node.d.ts +8 -0
- package/dist/types/evaluator/dependency-nodes/virtual-cell-value-node.d.ts +1 -0
- package/dist/types/evaluator/range-evaluation-node.d.ts +8 -1
- 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
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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: (
|
|
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=
|
|
857
|
+
//# debugId=7AAB2F977AF7BA6364756E2164756E21
|