@odoo/o-spreadsheet 19.5.0-alpha.13 → 19.5.0-alpha.15

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 (106) hide show
  1. package/dist/o_spreadsheet.cjs +2849 -2625
  2. package/dist/o_spreadsheet.css +17 -6
  3. package/dist/o_spreadsheet.esm.js +2845 -2625
  4. package/dist/o_spreadsheet.iife.js +2848 -2624
  5. package/dist/o_spreadsheet.min.iife.js +299 -299
  6. package/dist/o_spreadsheet.xml +21 -13
  7. package/dist/types/actions/menu_items_actions.d.ts +3 -2
  8. package/dist/types/collaborative/command_squisher.d.ts +1 -1
  9. package/dist/types/collaborative/session.d.ts +3 -1
  10. package/dist/types/components/figures/chart/chartJs/zoomable_chart/zoomable_chartjs.d.ts +1 -0
  11. package/dist/types/components/figures/figure/figure.d.ts +1 -0
  12. package/dist/types/components/figures/figure_container/figure_container.d.ts +6 -2
  13. package/dist/types/components/full_screen_figure/full_screen_figure.d.ts +12 -1
  14. package/dist/types/components/grid_overlay/grid_overlay.d.ts +1 -0
  15. package/dist/types/components/headers_overlay/headers_overlay.d.ts +2 -0
  16. package/dist/types/components/helpers/figure_drag_helper.d.ts +3 -3
  17. package/dist/types/components/helpers/figure_snap_helper.d.ts +8 -3
  18. package/dist/types/components/helpers/zoom.d.ts +0 -10
  19. package/dist/types/components/link/link_editor/link_editor.d.ts +1 -0
  20. package/dist/types/components/side_panel/components/radio_selection/radio_selection.d.ts +1 -1
  21. package/dist/types/components/side_panel/find_and_replace/find_and_replace.d.ts +1 -0
  22. package/dist/types/components/side_panel/find_and_replace/find_and_replace_store.d.ts +2 -1
  23. package/dist/types/components/side_panel/table_panel/table_panel.d.ts +6 -0
  24. package/dist/types/components/side_panel/table_style_editor_panel/table_style_editor_panel.d.ts +2 -0
  25. package/dist/types/components/tables/table_resizer/table_resizer.d.ts +1 -0
  26. package/dist/types/components/top_bar/color_editor/color_editor.d.ts +1 -1
  27. package/dist/types/constants.d.ts +2 -2
  28. package/dist/types/formulas/compiler.d.ts +1 -1
  29. package/dist/types/functions/helper_lookup.d.ts +1 -1
  30. package/dist/types/helpers/cells/cell_evaluation.d.ts +1 -1
  31. package/dist/types/helpers/color_themes.d.ts +2 -0
  32. package/dist/types/helpers/figures/chart.d.ts +5 -5
  33. package/dist/types/helpers/figures/charts/chart_common.d.ts +3 -3
  34. package/dist/types/helpers/figures/charts/chart_data_sources.d.ts +3 -3
  35. package/dist/types/helpers/figures/charts/chart_ui_common.d.ts +3 -3
  36. package/dist/types/helpers/figures/charts/runtime/chart_data_extractor.d.ts +13 -12
  37. package/dist/types/helpers/figures/charts/runtime/chartjs_title.d.ts +2 -2
  38. package/dist/types/helpers/filter_helpers.d.ts +2 -2
  39. package/dist/types/helpers/links.d.ts +1 -1
  40. package/dist/types/helpers/owl3_helpers.d.ts +4 -0
  41. package/dist/types/helpers/pivot/pivot_composer_helpers.d.ts +1 -1
  42. package/dist/types/helpers/pivot/pivot_presentation.d.ts +2 -2
  43. package/dist/types/helpers/pivot/pivot_registry.d.ts +4 -5
  44. package/dist/types/helpers/pivot/spreadsheet_pivot/runtime_definition_spreadsheet_pivot.d.ts +2 -2
  45. package/dist/types/helpers/range.d.ts +1 -1
  46. package/dist/types/index.d.ts +7 -8
  47. package/dist/types/model.d.ts +17 -10
  48. package/dist/types/owl3_compatibility_layer.d.ts +1 -14
  49. package/dist/types/plugins/core/range.d.ts +1 -1
  50. package/dist/types/plugins/core/squisher.d.ts +4 -1
  51. package/dist/types/plugins/core/tables.d.ts +2 -1
  52. package/dist/types/plugins/core/unsquisher.d.ts +1 -1
  53. package/dist/types/plugins/core_plugin.d.ts +1 -1
  54. package/dist/types/plugins/{ui_stateful → evaluation}/cell_computed_style.d.ts +4 -4
  55. package/dist/types/plugins/{ui_core_views/cell_evaluation/evaluation_plugin.d.ts → evaluation/cell_evaluation/cell_evaluation_plugin.d.ts} +7 -7
  56. package/dist/types/plugins/{ui_core_views → evaluation}/cell_evaluation/compilation_parameters.d.ts +2 -2
  57. package/dist/types/plugins/{ui_core_views → evaluation}/cell_evaluation/evaluator.d.ts +2 -2
  58. package/dist/types/plugins/{ui_core_views → evaluation}/custom_colors.d.ts +5 -5
  59. package/dist/types/plugins/{ui_core_views → evaluation}/dynamic_tables.d.ts +4 -4
  60. package/dist/types/plugins/{ui_feature → evaluation}/dynamic_translate.d.ts +2 -2
  61. package/dist/types/plugins/evaluation/evaluation_chart.d.ts +27 -0
  62. package/dist/types/plugins/{ui_core_views → evaluation}/evaluation_conditional_format.d.ts +4 -4
  63. package/dist/types/plugins/{ui_core_views → evaluation}/evaluation_data_validation.d.ts +4 -4
  64. package/dist/types/plugins/{ui_stateful → evaluation}/filter_evaluation.d.ts +5 -5
  65. package/dist/types/plugins/{ui_core_views → evaluation}/fingerprint.d.ts +2 -2
  66. package/dist/types/plugins/evaluation/formula_tracker.d.ts +8 -0
  67. package/dist/types/plugins/evaluation/geo_loader.d.ts +12 -0
  68. package/dist/types/plugins/{ui_core_views → evaluation}/header_sizes_ui.d.ts +5 -5
  69. package/dist/types/plugins/{ui_stateful/header_visibility_ui.d.ts → evaluation/header_visibility_evaluation.d.ts} +2 -2
  70. package/dist/types/plugins/evaluation/pivot_presence_plugin.d.ts +12 -0
  71. package/dist/types/plugins/{ui_core_views → evaluation}/pivot_ui.d.ts +6 -6
  72. package/dist/types/plugins/evaluation/subtotal_evaluation.d.ts +5 -0
  73. package/dist/types/plugins/{ui_stateful → evaluation}/table_computed_style.d.ts +7 -7
  74. package/dist/types/plugins/evaluation_plugin.d.ts +31 -0
  75. package/dist/types/plugins/plugin_registries.d.ts +11 -5
  76. package/dist/types/plugins/ui_feature/chart_ui.d.ts +6 -0
  77. package/dist/types/plugins/ui_feature/color_theme.d.ts +0 -3
  78. package/dist/types/plugins/ui_feature/geo_features.d.ts +1 -6
  79. package/dist/types/plugins/{ui_core_views → ui_stateful}/cell_icon_plugin.d.ts +2 -2
  80. package/dist/types/registries/chart_data_source_registry.d.ts +4 -5
  81. package/dist/types/registries/chart_registry.d.ts +4 -5
  82. package/dist/types/registries/criterion_registry.d.ts +4 -4
  83. package/dist/types/registries/evaluation_registry.d.ts +2 -2
  84. package/dist/types/registries/figures_registry.d.ts +1 -1
  85. package/dist/types/stores/zoom_store.d.ts +15 -2
  86. package/dist/types/types/collaborative/transport_service.d.ts +1 -0
  87. package/dist/types/types/commands.d.ts +32 -17
  88. package/dist/types/types/functions.d.ts +2 -2
  89. package/dist/types/types/getters.d.ts +102 -20
  90. package/dist/types/types/model.d.ts +2 -1
  91. package/dist/types/types/rendering.d.ts +2 -0
  92. package/package.json +2 -2
  93. package/dist/types/plugins/core_view_plugin.d.ts +0 -29
  94. package/dist/types/plugins/ui_core_views/evaluation_chart.d.ts +0 -26
  95. package/dist/types/plugins/ui_core_views/formula_tracker.d.ts +0 -8
  96. package/dist/types/plugins/ui_feature/pivot_presence_plugin.d.ts +0 -11
  97. package/dist/types/plugins/ui_feature/subtotal_evaluation.d.ts +0 -5
  98. package/dist/types/types/core_getters.d.ts +0 -77
  99. /package/dist/types/plugins/{ui_core_views → evaluation}/cell_evaluation/binary_grid.d.ts +0 -0
  100. /package/dist/types/plugins/{ui_core_views → evaluation}/cell_evaluation/formula_dependency_graph.d.ts +0 -0
  101. /package/dist/types/plugins/{ui_core_views → evaluation}/cell_evaluation/interval_tree.d.ts +0 -0
  102. /package/dist/types/plugins/{ui_core_views → evaluation}/cell_evaluation/position_set.d.ts +0 -0
  103. /package/dist/types/plugins/{ui_core_views → evaluation}/cell_evaluation/r_tree.d.ts +0 -0
  104. /package/dist/types/plugins/{ui_core_views → evaluation}/cell_evaluation/range_set.d.ts +0 -0
  105. /package/dist/types/plugins/{ui_core_views → evaluation}/cell_evaluation/spreading_relation.d.ts +0 -0
  106. /package/dist/types/plugins/{ui_core_views → evaluation}/cell_evaluation/zone_set.d.ts +0 -0
@@ -1,10 +1,10 @@
1
1
  import { Cell } from "../../types/cells";
2
- import { CoreViewPlugin } from "../core_view_plugin";
2
+ import { EvaluationPlugin } from "../evaluation_plugin";
3
3
  /**
4
4
  * A string that represents the shape of a formula.
5
5
  */
6
6
  export type Fingerprint = string;
7
- export declare class FingerprintPlugin extends CoreViewPlugin {
7
+ export declare class FingerprintPlugin extends EvaluationPlugin {
8
8
  static getters: readonly ["getCellFingerprint"];
9
9
  getCellFingerprint(cell: Cell): Fingerprint | undefined;
10
10
  private computeFormulaFingerprint;
@@ -0,0 +1,8 @@
1
+ import { EvaluationCommand } from "../../types/commands";
2
+ import { EvaluationPlugin } from "../evaluation_plugin";
3
+ export declare class FormulaTrackerPlugin extends EvaluationPlugin {
4
+ static getters: readonly ["getCellsWithTrackedFormula"];
5
+ private trackedCells;
6
+ handle(cmd: EvaluationCommand): void;
7
+ getCellsWithTrackedFormula(formula: string): number[];
8
+ }
@@ -0,0 +1,12 @@
1
+ import { GeoChartRegion } from "../../types/chart/geo_chart";
2
+ import { EvaluationPlugin, EvaluationPluginConfig } from "../evaluation_plugin";
3
+ export declare class GeoLoaderEvaluation extends EvaluationPlugin {
4
+ static getters: readonly ["getGeoJsonFeatures", "geoFeatureNameToId", "getGeoChartAvailableRegions"];
5
+ private readonly geoJsonService;
6
+ private geoJsonCache;
7
+ constructor(config: EvaluationPluginConfig);
8
+ getGeoChartAvailableRegions(): GeoChartRegion[];
9
+ getGeoJsonFeatures(region: string): GeoJSON.Feature[] | undefined;
10
+ geoFeatureNameToId(region: string, featureName: string): string | undefined;
11
+ private convertToGeoJson;
12
+ }
@@ -1,8 +1,8 @@
1
1
  import { Canvas2DContext } from "../../types/canvas";
2
- import { Command } from "../../types/commands";
2
+ import { EvaluationCommand } from "../../types/commands";
3
3
  import { AnchorOffset } from "../../types/figure";
4
4
  import { CellPosition, Dimension, HeaderIndex, Immutable, Pixel, UID } from "../../types/misc";
5
- import { CoreViewPlugin } from "../core_view_plugin";
5
+ import { EvaluationPlugin } from "../evaluation_plugin";
6
6
  interface HeaderSizeState {
7
7
  tallestCellInRow: Immutable<Record<UID, Array<CellWithSize | undefined>>>;
8
8
  }
@@ -10,12 +10,12 @@ interface CellWithSize {
10
10
  cell: CellPosition;
11
11
  size: Pixel;
12
12
  }
13
- export declare class HeaderSizeUIPlugin extends CoreViewPlugin<HeaderSizeState> implements HeaderSizeState {
13
+ export declare class HeaderSizeUIPlugin extends EvaluationPlugin<HeaderSizeState> implements HeaderSizeState {
14
14
  static getters: readonly ["getRowSize", "getHeaderSize", "getMaxAnchorOffset"];
15
15
  readonly tallestCellInRow: Immutable<Record<UID, Array<CellWithSize | undefined>>>;
16
16
  ctx: Canvas2DContext;
17
- beforeHandle(cmd: Command): void;
18
- handle(cmd: Command): void;
17
+ beforeHandle(cmd: EvaluationCommand): void;
18
+ handle(cmd: EvaluationCommand): void;
19
19
  getRowSize(sheetId: UID, row: HeaderIndex): Pixel;
20
20
  getMaxAnchorOffset(sheetId: UID, height: Pixel, width: Pixel): AnchorOffset;
21
21
  getHeaderSize(sheetId: UID, dimension: Dimension, index: HeaderIndex): Pixel;
@@ -1,7 +1,7 @@
1
1
  import { CellPosition, Dimension, HeaderIndex, UID } from "../../types/misc";
2
2
  import { ExcelWorkbookData } from "../../types/workbook_data";
3
- import { UIPlugin } from "../ui_plugin";
4
- export declare class HeaderVisibilityUIPlugin extends UIPlugin {
3
+ import { EvaluationPlugin } from "../evaluation_plugin";
4
+ export declare class HeaderVisibilityEvaluationPlugin extends EvaluationPlugin {
5
5
  static getters: readonly ["getNextVisibleCellPosition", "findVisibleHeader", "findLastVisibleColRowIndex", "findFirstVisibleColRowIndex", "isRowHidden", "isColHidden", "isHeaderHidden"];
6
6
  isRowHidden(sheetId: UID, index: number): boolean;
7
7
  isColHidden(sheetId: UID, index: number): boolean;
@@ -0,0 +1,12 @@
1
+ import { PivotPresenceTracker } from "../../helpers/pivot/pivot_presence_tracker";
2
+ import { EvaluationCommand } from "../../types/commands";
3
+ import { UID } from "../../types/misc";
4
+ import { EvaluationPlugin } from "../evaluation_plugin";
5
+ export declare class PivotPresencePlugin extends EvaluationPlugin {
6
+ static getters: readonly ["getPivotPresenceTracker"];
7
+ private trackPresencePivotId?;
8
+ private sheetId?;
9
+ private tracker?;
10
+ handle(cmd: EvaluationCommand): void;
11
+ getPivotPresenceTracker(pivotId: UID, sheetId: UID): PivotPresenceTracker | undefined;
12
+ }
@@ -1,25 +1,25 @@
1
1
  import { CompiledFormula } from "../../formulas/compiler";
2
2
  import { CellValue } from "../../types/cells";
3
- import { Command } from "../../types/commands";
3
+ import { EvaluationCommand } from "../../types/commands";
4
4
  import { CellPosition, Matrix, SortDirection, UID } from "../../types/misc";
5
5
  import { PivotCoreMeasure, PivotStyle, PivotTableCell } from "../../types/pivot";
6
6
  import { Pivot } from "../../types/pivot_runtime";
7
- import { CoreViewPlugin, CoreViewPluginConfig } from "../core_view_plugin";
7
+ import { EvaluationPlugin, EvaluationPluginConfig } from "../evaluation_plugin";
8
8
  export declare const UNDO_REDO_PIVOT_COMMANDS: string[];
9
9
  interface PivotEvaluatedArgs {
10
10
  functionName: string;
11
11
  args: (CellValue | Matrix<CellValue> | undefined)[];
12
12
  }
13
- export declare class PivotUIPlugin extends CoreViewPlugin {
13
+ export declare class PivotUIPlugin extends EvaluationPlugin {
14
14
  static getters: readonly ["getPivot", "getFirstPivotFunction", "getPivotCellSortDirection", "getPivotIdFromPosition", "getPivotIdsFromPosition", "getPivotCellFromPosition", "generateNewCalculatedMeasureName", "isPivotUnused", "isSpillPivotFormula", "getAllPivotArrayFormulas", "getPivotStyleAtPosition"];
15
15
  private pivots;
16
16
  private unusedPivotsInFormulas?;
17
17
  private custom;
18
18
  private pivotPositionCache;
19
19
  private shouldInvalidateCache;
20
- constructor(config: CoreViewPluginConfig);
21
- beforeHandle(cmd: Command): void;
22
- handle(cmd: Command): void;
20
+ constructor(config: EvaluationPluginConfig);
21
+ beforeHandle(cmd: EvaluationCommand): void;
22
+ handle(cmd: EvaluationCommand): void;
23
23
  finalize(): void;
24
24
  /**
25
25
  * Get the id of the first pivot in the formula at the given position. Returns undefined if there
@@ -0,0 +1,5 @@
1
+ import { EvaluationCommand } from "../../types/commands";
2
+ import { EvaluationPlugin } from "../evaluation_plugin";
3
+ export declare class SubtotalEvaluationPlugin extends EvaluationPlugin {
4
+ handle(cmd: EvaluationCommand): void;
5
+ }
@@ -1,10 +1,10 @@
1
- import { Command } from "../../types/commands";
1
+ import { Command, EvaluationCommand } from "../../types/commands";
2
2
  import { Border, CellPosition, Style } from "../../types/misc";
3
- import { UIPlugin } from "../ui_plugin";
4
- export declare class TableComputedStylePlugin extends UIPlugin {
3
+ import { EvaluationPlugin } from "../evaluation_plugin";
4
+ export declare class TableComputedStylePlugin extends EvaluationPlugin {
5
5
  static getters: readonly ["getCellTableStyle", "getCellTableBorder"];
6
6
  private tableStyles;
7
- handle(cmd: Command): void;
7
+ handle(cmd: EvaluationCommand): void;
8
8
  finalize(): void;
9
9
  getCellTableStyle(position: CellPosition): Style | undefined;
10
10
  getCellTableBorder(position: CellPosition): Border | undefined;
@@ -21,8 +21,8 @@ export declare class TableComputedStylePlugin extends UIPlugin {
21
21
  */
22
22
  private getTableMapping;
23
23
  }
24
- declare const invalidateTableStyleCommands: readonly ["HIDE_COLUMNS_ROWS", "UNHIDE_COLUMNS_ROWS", "UNFOLD_HEADER_GROUP", "UNGROUP_HEADERS", "FOLD_HEADER_GROUP", "FOLD_ALL_HEADER_GROUPS", "UNFOLD_ALL_HEADER_GROUPS", "FOLD_HEADER_GROUPS_IN_ZONE", "UNFOLD_HEADER_GROUPS_IN_ZONE", "CREATE_TABLE", "UPDATE_TABLE", "UPDATE_FILTER", "REMOVE_TABLE", "RESIZE_TABLE", "CREATE_TABLE_STYLE", "REMOVE_TABLE_STYLE", "DELETE_CONTENT"];
25
- export declare function doesCommandInvalidatesTableStyle(cmd: Command): cmd is {
24
+ declare const invalidateTableStyleCommands: readonly ["HIDE_COLUMNS_ROWS", "UNHIDE_COLUMNS_ROWS", "UNFOLD_HEADER_GROUP", "UNGROUP_HEADERS", "FOLD_HEADER_GROUP", "FOLD_ALL_HEADER_GROUPS", "UNFOLD_ALL_HEADER_GROUPS", "FOLD_HEADER_GROUPS_IN_ZONE", "UNFOLD_HEADER_GROUPS_IN_ZONE", "CREATE_TABLE", "UPDATE_TABLE", "UPDATE_FILTER", "REMOVE_TABLE", "CREATE_TABLE_STYLE", "REMOVE_TABLE_STYLE", "DELETE_CONTENT"];
25
+ export declare function doesCommandInvalidatesTableStyle<C extends Command>(cmd: C): cmd is Extract<C, {
26
26
  type: (typeof invalidateTableStyleCommands)[number];
27
- } & Command;
27
+ }>;
28
28
  export {};
@@ -0,0 +1,31 @@
1
+ import { Session } from "../collaborative/session";
2
+ import { StateObserver } from "../state_observer";
3
+ import { EvaluationCommand, EvaluationCommandDispatcher } from "../types/commands";
4
+ import { Currency } from "../types/currency";
5
+ import { EvaluationGetters } from "../types/getters";
6
+ import { Color } from "../types/misc";
7
+ import { ModelConfig } from "../types/model";
8
+ import { BasePlugin } from "./base_plugin";
9
+ export interface EvaluationPluginConfig {
10
+ readonly getters: EvaluationGetters;
11
+ readonly stateObserver: StateObserver;
12
+ readonly custom: ModelConfig["custom"];
13
+ readonly session: Session;
14
+ readonly dispatch: EvaluationCommandDispatcher["dispatch"];
15
+ readonly defaultCurrency?: Partial<Currency>;
16
+ readonly customColors: Color[];
17
+ readonly external: ModelConfig["external"];
18
+ }
19
+ export interface EvaluationPluginConstructor {
20
+ new (config: EvaluationPluginConfig): EvaluationPlugin;
21
+ getters: readonly string[];
22
+ }
23
+ /**
24
+ * Evaluation plugins handle any data derived from core data (i.e. evaluation).
25
+ * They cannot impact the model data (i.e. cannot dispatch core commands).
26
+ */
27
+ export declare class EvaluationPlugin<State = any> extends BasePlugin<State, EvaluationCommand> {
28
+ protected getters: EvaluationGetters;
29
+ protected dispatch: EvaluationCommandDispatcher["dispatch"];
30
+ constructor({ getters, stateObserver, dispatch }: EvaluationPluginConfig);
31
+ }
@@ -1,8 +1,14 @@
1
1
  import { Registry } from "../registries/registry";
2
2
  import { CorePluginConstructor } from "./core_plugin";
3
- import { CoreViewPluginConstructor } from "./core_view_plugin";
3
+ import { EvaluationPluginConstructor } from "./evaluation_plugin";
4
4
  import { UIPluginConstructor } from "./ui_plugin";
5
- export declare const corePluginRegistry: Registry<CorePluginConstructor>;
6
- export declare const featurePluginRegistry: Registry<UIPluginConstructor>;
7
- export declare const statefulUIPluginRegistry: Registry<UIPluginConstructor>;
8
- export declare const coreViewsPluginRegistry: Registry<CoreViewPluginConstructor>;
5
+ export declare class PluginRegistry<T extends new (config: any) => any> extends Registry<T> {
6
+ private readonly PluginClass;
7
+ constructor(PluginClass: new (config: any) => any);
8
+ add(key: string, value: T): this;
9
+ replace(key: string, value: T): this;
10
+ }
11
+ export declare const corePluginRegistry: PluginRegistry<CorePluginConstructor>;
12
+ export declare const featurePluginRegistry: PluginRegistry<UIPluginConstructor>;
13
+ export declare const statefulUIPluginRegistry: PluginRegistry<UIPluginConstructor>;
14
+ export declare const evaluationPluginRegistry: PluginRegistry<EvaluationPluginConstructor>;
@@ -0,0 +1,6 @@
1
+ import { ChartRuntime } from "../../types/chart/chart";
2
+ import { UIPlugin } from "../ui_plugin";
3
+ export declare class ChartUIPlugin extends UIPlugin {
4
+ static getters: readonly ["getChartRuntime"];
5
+ getChartRuntime(chartId: string): ChartRuntime;
6
+ }
@@ -1,9 +1,6 @@
1
1
  import { Command } from "../../types/commands";
2
2
  import { GridRenderingTheme } from "../../types/rendering";
3
3
  import { UIPlugin, UIPluginConfig } from "../ui_plugin";
4
- export declare const BACKGROUND_HEADER_SELECTED_COLOR = "#E8EAED";
5
- export declare const BACKGROUND_HEADER_ACTIVE_COLOR = "#595959";
6
- export declare const COLOR_THEMES: Record<string, GridRenderingTheme>;
7
4
  export declare class ColorThemeUIPlugin extends UIPlugin {
8
5
  static getters: readonly ["isDarkMode", "getSpreadsheetTheme"];
9
6
  private colorScheme?;
@@ -3,21 +3,16 @@ import { Command } from "../../types/commands";
3
3
  import { UID } from "../../types/misc";
4
4
  import { UIPlugin, UIPluginConfig } from "../ui_plugin";
5
5
  export declare class GeoFeaturePlugin extends UIPlugin {
6
- static getters: readonly ["getGeoJsonFeatures", "geoFeatureNameToId", "getGeoChartAvailableRegions", "getAvailableChartRegions"];
6
+ static getters: readonly ["getAvailableChartRegions"];
7
7
  private readonly geoJsonService;
8
- private geoJsonCache;
9
8
  /** Stores the initial region of each geo chart at the time of the START command */
10
9
  private initialRegions;
11
10
  constructor(config: UIPluginConfig);
12
11
  handle(cmd: Command): void;
13
12
  private trackInitialRegion;
14
- getGeoChartAvailableRegions(): GeoChartRegion[];
15
13
  /**
16
14
  * Returns the regions that can be selected as an alternative for a given geo chart in dashboard mode.
17
15
  * The available alternatives are based on the initial region of the chart (before any dashboard-level change).
18
16
  */
19
17
  getAvailableChartRegions(chartId: UID): GeoChartRegion[];
20
- getGeoJsonFeatures(region: string): GeoJSON.Feature[] | undefined;
21
- geoFeatureNameToId(region: string, featureName: string): string | undefined;
22
- private convertToGeoJson;
23
18
  }
@@ -2,8 +2,8 @@ import { GridIcon } from "../../registries/icons_on_cell_registry";
2
2
  import { Command } from "../../types/commands";
3
3
  import { CellPosition } from "../../types/misc";
4
4
  import { Rect } from "../../types/rendering";
5
- import { CoreViewPlugin } from "../core_view_plugin";
6
- export declare class CellIconPlugin extends CoreViewPlugin {
5
+ import { UIPlugin } from "../ui_plugin";
6
+ export declare class CellIconPlugin extends UIPlugin {
7
7
  static getters: readonly ["doesCellHaveGridIcon", "getCellIcons", "getCellIconRect"];
8
8
  private cellIconsCache;
9
9
  handle(cmd: Command): void;
@@ -1,8 +1,7 @@
1
1
  import type * as ChartJS from "chart.js";
2
2
  import { ChartCreationContext, ChartData, ChartDataSource, ChartDataSourceType, ChartType, DataSetStyle, ExcelChartDefinition } from "../types/chart/chart";
3
3
  import { CommandResult } from "../types/commands";
4
- import { CoreGetters } from "../types/core_getters";
5
- import { Getters } from "../types/getters";
4
+ import { CoreGetters, EvaluationGetters } from "../types/getters";
6
5
  import { RangeAdapterFunctions, UID } from "../types/misc";
7
6
  import { Validator } from "../types/validator";
8
7
  import { Registry } from "./registry";
@@ -13,15 +12,15 @@ export interface ChartDataSourceBuilder<TExternal, TInternal> {
13
12
  fromHierarchicalContextCreation: (context: ChartCreationContext) => ChartDataSource<string>;
14
13
  validate: (dataSource: TExternal, validator: Validator) => CommandResult | CommandResult[];
15
14
  transform(dataSource: TExternal, defaultSheetId: UID, rangeAdapters: RangeAdapterFunctions): TExternal;
16
- extractData(dataSource: TInternal, chartId: UID, getters: Getters): ChartData;
17
- extractHierarchicalData(dataSource: TInternal, chartId: UID, getters: Getters): ChartData;
15
+ extractData(dataSource: TInternal, chartId: UID, getters: EvaluationGetters): ChartData;
16
+ extractHierarchicalData(dataSource: TInternal, chartId: UID, getters: EvaluationGetters): ChartData;
18
17
  adaptRanges(dataSource: TInternal, rangeAdapters: RangeAdapterFunctions): TInternal;
19
18
  duplicateInDuplicatedSheet(dataSource: TInternal, sheetIdFrom: UID, sheetIdTo: UID, getters: CoreGetters): TInternal;
20
19
  getDefinition(dataSource: TInternal, defaultSheetId: UID, getters: CoreGetters): TExternal;
21
20
  getContextCreation(dataSource: TExternal): ChartCreationContext;
22
21
  getHierarchicalContextCreation(dataSource: TExternal): ChartCreationContext;
23
22
  toExcelDataSets(dataSource: TInternal, dataSetStyles: DataSetStyle, getters: CoreGetters): Pick<ExcelChartDefinition, "dataSets" | "labelRange"> | undefined;
24
- onDataSetClick?: (chartType: ChartType, chartId: UID, event: ChartJS.ChartEvent, items: ChartJS.ActiveElement[], chartJsChart: ChartJS.Chart, getters: Getters) => void;
23
+ onDataSetClick?: (chartType: ChartType, chartId: UID, event: ChartJS.ChartEvent, items: ChartJS.ActiveElement[], chartJsChart: ChartJS.Chart, getters: EvaluationGetters) => void;
25
24
  onDataSetHover?: (chartType: ChartType, chartId: UID, event: ChartJS.ChartEvent, items: ChartJS.ActiveElement[], chartJsChart: ChartJS.Chart) => void;
26
25
  }
27
26
  export interface ChartDataSourceRegistry extends Registry<ChartDataSourceBuilder<unknown, unknown>> {
@@ -1,9 +1,8 @@
1
1
  import { CoreChartOptions } from "chart.js";
2
- import { CompiledFormula } from "..";
2
+ import { ColorThemeName, CompiledFormula } from "..";
3
3
  import { ChartCreationContext, ChartData, ChartRuntime, ChartType, ChartTypeDefinition, ExcelChartDefinition } from "../types/chart/chart";
4
4
  import { CommandResult } from "../types/commands";
5
- import { CoreGetters } from "../types/core_getters";
6
- import { Getters } from "../types/getters";
5
+ import { CoreGetters, EvaluationGetters } from "../types/getters";
7
6
  import { RangeAdapterFunctions, UID } from "../types/misc";
8
7
  import { Range } from "../types/range";
9
8
  import { Validator } from "../types/validator";
@@ -46,8 +45,8 @@ export interface ChartTypeBuilder<T extends ChartType> {
46
45
  * Get the definition of the chart used for excel export.
47
46
  * If the chart is not supported by Excel, this function returns undefined.
48
47
  */
49
- getDefinitionForExcel(getters: Getters, definition: ChartTypeDefinition<T, Range>, params: Pick<ExcelChartDefinition, "dataSets" | "labelRange">): ExcelChartDefinition | undefined;
50
- getRuntime(getters: Getters, definition: ChartTypeDefinition<T, Range>, chartDataExtractors: ChartDataExtractors, sheetId: UID, eventHandlers: ChartJsEventHandlers): ChartRuntime;
48
+ getDefinitionForExcel(getters: EvaluationGetters, definition: ChartTypeDefinition<T, Range>, params: Pick<ExcelChartDefinition, "dataSets" | "labelRange">): ExcelChartDefinition | undefined;
49
+ getRuntime(getters: EvaluationGetters, definition: ChartTypeDefinition<T, Range>, chartDataExtractors: ChartDataExtractors, sheetId: UID, eventHandlers: ChartJsEventHandlers, colorThemeName: ColorThemeName): ChartRuntime;
51
50
  /** Get all the formulas used in the chart */
52
51
  getFormulas(getters: CoreGetters, sheetId: UID, definition: ChartTypeDefinition<T, Range>): CompiledFormula[];
53
52
  allowedDefinitionKeys: readonly string[];
@@ -1,6 +1,6 @@
1
1
  import { CellValue } from "../types/cells";
2
2
  import { EvaluatedCriterion, GenericCriterion, GenericCriterionType } from "../types/generic_criterion";
3
- import { Getters } from "../types/getters";
3
+ import { EvaluationGetters } from "../types/getters";
4
4
  import { UID } from "../types/misc";
5
5
  import { Range } from "../types/range";
6
6
  import { Registry } from "./registry";
@@ -20,13 +20,13 @@ export type CriterionEvaluator<T = unknown> = {
20
20
  * For more complex criteria (like "top10"), we might want to pre-compute some data before evaluating the criterion for
21
21
  * each cell, to avoid recomputing everything each time.
22
22
  */
23
- preComputeCriterion?: (criterion: GenericCriterion, criterionRanges: Range[], getters: Getters) => T;
23
+ preComputeCriterion?: (criterion: GenericCriterion, criterionRanges: Range[], getters: EvaluationGetters) => T;
24
24
  /**
25
25
  * Returns the error string to display when the value is not valid.
26
26
  *
27
27
  * The criterion values should be in canonical form (non-localized), and formulas should be evaluated.
28
28
  */
29
- getErrorString: (criterion: EvaluatedCriterion, getters: Getters, sheetId: UID) => string;
29
+ getErrorString: (criterion: EvaluatedCriterion, getters: EvaluationGetters, sheetId: UID) => string;
30
30
  /**
31
31
  * Checks if a criterion value is valid.
32
32
  *
@@ -36,7 +36,7 @@ export type CriterionEvaluator<T = unknown> = {
36
36
  /** Return the number of values that the criterion must contains. Return undefined if the criterion can have any number of values */
37
37
  numberOfValues: (criterion: GenericCriterion) => number | undefined;
38
38
  name: string;
39
- getPreview: (criterion: GenericCriterion, getters: Getters) => string;
39
+ getPreview: (criterion: GenericCriterion, getters: EvaluationGetters) => string;
40
40
  /** Error string when a criterion value is invalid */
41
41
  criterionValueErrorString: string;
42
42
  allowedValues?: "onlyLiterals" | "onlyFormulas";
@@ -1,4 +1,4 @@
1
- import { Getters } from "../types/getters";
1
+ import { EvaluationGetters } from "../types/getters";
2
2
  import { Registry } from "./registry";
3
3
  /**
4
4
  * This registry is used to register functions that should be called after each iteration of the evaluation.
@@ -6,4 +6,4 @@ import { Registry } from "./registry";
6
6
  * to avoid to reload the data of the pivot at each function call (PIVOT.VALUE and PIVOT.HEADER). After each
7
7
  * evaluation iteration, the pivot has to be re-evaluated during the next iteration.
8
8
  */
9
- export declare const onIterationEndEvaluationRegistry: Registry<(getters: Getters) => void>;
9
+ export declare const onIterationEndEvaluationRegistry: Registry<(getters: EvaluationGetters) => void>;
@@ -15,7 +15,7 @@ export interface FigureContent {
15
15
  isThemeDependant: boolean;
16
16
  SidePanelComponent?: string;
17
17
  keepRatio?: boolean;
18
- minFigSize?: number;
18
+ minFigSize: number;
19
19
  borderWidth: (getters: Getters) => number;
20
20
  hasShadow: (getters: Getters) => boolean;
21
21
  isRounded: (getters: Getters) => boolean;
@@ -1,14 +1,27 @@
1
+ import { ZoomedMouseEvent } from "../components/helpers/zoom";
1
2
  import { Pixel } from "../types/misc";
2
- import { Rect } from "../types/rendering";
3
+ import { DOMCoordinates, Rect } from "../types/rendering";
3
4
  /**
4
5
  * Holds the zoom level of the spreadsheet UI, and everything derived purely from it.
5
6
  */
6
7
  export declare class ZoomStore {
7
8
  mutators: readonly ["setZoom"];
8
- storeGetters: readonly ["getZoomedRect"];
9
+ storeGetters: readonly ["getZoomedRect", "getZoomedEvent"];
9
10
  zoomLevel: number;
10
11
  setZoom(zoom: number): "noStateChange" | undefined;
11
12
  getZoomedRect(rect: Rect): Rect;
13
+ /**
14
+ * Return a POJO containing the original event as well as the client position and the client offset
15
+ * where the event would target if the spreadsheet was not zoomed
16
+ * @param ev unzoomed mouse event
17
+ * @param originalTargetPosition The original target bounding rect the resulting ZoomedMouseEvent offset must refer to
18
+ * @returns a ZoomedMouseEvent
19
+ */
20
+ getZoomedEvent<T extends MouseEvent>(ev: T, originalTargetPosition?: DOMCoordinates | null): ZoomedMouseEvent<T>;
21
+ /**
22
+ * Returns the bounding rect of the closest or self element who is targetable by a ZoomedMouseEvent
23
+ */
24
+ private getZoomTargetPosition;
12
25
  get scrollBarWidth(): Pixel;
13
26
  get cssZoom(): string;
14
27
  }
@@ -16,6 +16,7 @@ export interface RemoteRevisionMessage extends AbstractMessage {
16
16
  }
17
17
  export interface RemoteRevisionsSquishedMessage extends Omit<RemoteRevisionMessage, "commands"> {
18
18
  commands: (CoreCommand | SquishedCoreCommand)[];
19
+ squishedFailed?: boolean;
19
20
  }
20
21
  export interface RevisionUndoneMessage extends AbstractMessage {
21
22
  type: "REVISION_UNDONE";