@trebco/treb 25.2.0 → 25.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/{.eslintrc.js → .eslintrc.cjs} +4 -0
  2. package/api-generator/api-generator.ts +25 -55
  3. package/dist/treb-spreadsheet.mjs +9 -9
  4. package/dist/treb.d.ts +2 -2
  5. package/esbuild-custom-element.mjs +5 -264
  6. package/esbuild-utils.mjs +273 -0
  7. package/package.json +2 -2
  8. package/treb-base-types/src/cell.ts +23 -22
  9. package/treb-base-types/src/cells.ts +55 -2
  10. package/treb-base-types/src/theme.ts +0 -11
  11. package/treb-base-types/src/union.ts +2 -1
  12. package/treb-calculator/src/calculator.ts +8 -5
  13. package/treb-calculator/src/dag/array-vertex.ts +22 -22
  14. package/treb-calculator/src/dag/graph.ts +25 -23
  15. package/treb-calculator/src/dag/leaf_vertex.ts +23 -22
  16. package/treb-calculator/src/dag/spreadsheet_vertex.ts +25 -23
  17. package/treb-calculator/src/expression-calculator.ts +23 -22
  18. package/treb-calculator/src/function-error.ts +23 -22
  19. package/treb-calculator/src/functions/base-functions.ts +3 -2
  20. package/treb-calculator/src/functions/checkbox.ts +23 -22
  21. package/treb-calculator/src/functions/complex-functions.ts +2 -1
  22. package/treb-calculator/src/functions/finance-functions.ts +22 -22
  23. package/treb-calculator/src/functions/information-functions.ts +22 -22
  24. package/treb-calculator/src/functions/matrix-functions.ts +2 -1
  25. package/treb-calculator/src/functions/statistics-functions.ts +22 -22
  26. package/treb-calculator/src/functions/text-functions.ts +23 -22
  27. package/treb-calculator/src/primitives.ts +23 -22
  28. package/treb-calculator/src/utilities.ts +23 -24
  29. package/treb-charts/src/chart-functions.ts +22 -22
  30. package/treb-charts/src/chart.ts +6 -3
  31. package/treb-charts/src/renderer.ts +25 -23
  32. package/treb-charts/src/util.ts +23 -22
  33. package/treb-embed/modern.tsconfig.json +3 -2
  34. package/treb-embed/src/custom-element/spreadsheet-constructor.ts +57 -14
  35. package/treb-embed/src/embedded-spreadsheet.ts +81 -47
  36. package/treb-embed/src/options.ts +11 -0
  37. package/treb-embed/src/progress-dialog.ts +0 -3
  38. package/treb-embed/src/types.ts +14 -3
  39. package/treb-embed/style/layout.scss +32 -29
  40. package/treb-embed/style/theme-defaults.scss +5 -0
  41. package/treb-export/src/drawing2/chart2.ts +2 -2
  42. package/treb-export/src/drawing2/drawing2.ts +6 -4
  43. package/treb-export/src/export-worker/export-worker.ts +22 -24
  44. package/treb-export/src/export-worker/index-modern.ts +2 -1
  45. package/treb-export/src/export2.ts +15 -8
  46. package/treb-export/src/import2.ts +10 -5
  47. package/treb-export/src/workbook-sheet2.ts +2 -1
  48. package/treb-format/src/format.ts +23 -22
  49. package/treb-format/src/format_parser.ts +23 -22
  50. package/treb-format/src/value_parser.ts +23 -22
  51. package/treb-grid/src/editors/formula_bar.ts +2 -1
  52. package/treb-grid/src/editors/formula_editor_base.ts +4 -2
  53. package/treb-grid/src/editors/overlay_editor.ts +2 -1
  54. package/treb-grid/src/index.ts +12 -9
  55. package/treb-grid/src/layout/base_layout.ts +4 -2
  56. package/treb-grid/src/render/selection-renderer.ts +25 -23
  57. package/treb-grid/src/render/tile_renderer.ts +6 -4
  58. package/treb-grid/src/types/annotation.ts +33 -37
  59. package/treb-grid/src/types/data_model.ts +30 -22
  60. package/treb-grid/src/types/grid.ts +55 -584
  61. package/treb-grid/src/types/grid_base.ts +401 -7
  62. package/treb-grid/src/types/grid_events.ts +3 -0
  63. package/treb-grid/src/types/grid_selection.ts +22 -22
  64. package/treb-grid/src/types/named_range.ts +22 -22
  65. package/treb-grid/src/types/sheet.ts +8 -7
  66. package/treb-grid/src/types/sheet_types.ts +11 -7
  67. package/treb-grid/src/types/tab_bar.ts +1 -1
  68. package/treb-parser/src/parser.ts +5 -4
  69. package/tsproject.json +3 -4
  70. package/tsconfig.json +0 -10
  71. /package/treb-embed/src/{custom-element/content-types.d.ts → content-types.d.ts} +0 -0
@@ -21,27 +21,37 @@
21
21
 
22
22
  // --- imports -----------------------------------------------------------------
23
23
 
24
- import {
25
- Grid, GridEvent, SerializeOptions, Annotation,
24
+ // eslint-disable-next-line @typescript-eslint/triple-slash-reference
25
+ /// <reference path="./content-types.d.ts" />
26
+
27
+ import type {
28
+ GridEvent, SerializeOptions, Annotation,
26
29
  SerializedModel, FreezePane, SerializedSheet,
27
- BorderConstants, SheetChangeEvent, GridOptions,
28
- Sheet, GridSelection, CellEvent, FunctionDescriptor,
29
- DataModel, AnnotationViewData, ErrorCode, UA
30
+ SheetChangeEvent, GridOptions,
31
+ GridSelection, CellEvent, FunctionDescriptor,
32
+ AnnotationViewData,
33
+ } from 'treb-grid';
34
+
35
+ import {
36
+ DataModel, Grid, BorderConstants, Sheet, ErrorCode, UA
30
37
  } from 'treb-grid';
31
38
 
32
39
  import {
33
40
  Parser, DecimalMarkType,
34
41
  ArgumentSeparatorType, QuotedSheetNameRegex } from 'treb-parser';
35
42
 
36
- import { Calculator, EvaluateOptions, LeafVertex } from 'treb-calculator';
43
+ import { Calculator, type EvaluateOptions, type LeafVertex } from 'treb-calculator';
44
+
45
+ import type {
46
+ ICellAddress,
47
+ IArea, CellValue, Point,
48
+ Complex, ExtendedUnion, IRectangle,
49
+ AddressReference, RangeReference, TableSortOptions, Table, TableTheme,
50
+ } from 'treb-base-types';
37
51
 
38
52
  import {
39
- ThemeColor2,
40
- IsCellAddress, Localization, Style, ICellAddress,
41
- Area, IArea, CellValue, Point,
42
- IsFlatData, IsFlatDataArray, Rectangle, IsComplex,
43
- ComplexToString, Complex, ExtendedUnion, IRectangle,
44
- AddressReference, RangeReference, IsArea, TableSortOptions, Table, ThemeColorTable, TableTheme,
53
+ IsArea, ThemeColorTable, ComplexToString, Rectangle, IsComplex,
54
+ Localization, Style, ThemeColor2, IsCellAddress, Area, IsFlatData, IsFlatDataArray,
45
55
  } from 'treb-base-types';
46
56
 
47
57
  import { EventSource, Yield, ValidateURI } from 'treb-utils';
@@ -51,37 +61,32 @@ import { NumberFormatCache, ValueParser, NumberFormat } from 'treb-format';
51
61
 
52
62
  import { Dialog, DialogType } from './progress-dialog';
53
63
  import { Spinner } from './spinner';
54
- import { EmbeddedSpreadsheetOptions, DefaultOptions, ExportOptions } from './options';
55
- import { TREBDocument, SaveFileType, LoadSource, EmbeddedSheetEvent, InsertTableOptions } from './types';
64
+ import { type EmbeddedSpreadsheetOptions, DefaultOptions, type ExportOptions } from './options';
65
+ import { type TREBDocument, SaveFileType, LoadSource, type EmbeddedSheetEvent, type InsertTableOptions } from './types';
56
66
 
57
67
  import type { LanguageModel, TranslatedFunctionDescriptor } from './language-model';
58
68
  import type { SelectionState } from './selection-state';
59
69
  import type { BorderToolbarMessage, ToolbarMessage } from './toolbar-message';
60
70
 
61
71
  import { Chart, ChartFunctions } from 'treb-charts';
62
-
63
- // --- 3d party ----------------------------------------------------------------
64
-
65
- // import * as FileSaver from 'file-saver';
66
-
67
- // --- style -------------------------------------------------------------------
68
-
69
- // we moved grid style (sass) imports from grid -> here so we can better
70
- // support headless/server-side grid. if we build with esbuild they'd
71
- // disappear so we could move these back...
72
-
73
- // import 'treb-grid/style/grid-layout.scss';
74
- // import 'treb-grid/style/grid.scss';
75
- // import '../style/embed.scss';
76
-
77
72
  import type { SetRangeOptions } from 'treb-grid';
78
73
 
79
- // ---
74
+ // --- worker ------------------------------------------------------------------
80
75
 
81
- import export_worker_script from 'worker:../../treb-export/src/export-worker/index-modern.ts';
82
- const crocus = 100;
76
+ /**
77
+ * note the clumsy URI-like syntax. if typescript can see that the thing
78
+ * is a ts file, even if we have a prefix and a type defined for that
79
+ * prefix, it will still try to read it.
80
+ *
81
+ * this is not a great solution. I was thinking about letting ts read it.
82
+ * That won't impact esbuild, and it has the helpful side effect of type
83
+ * checking the worker when we run tsc. but it doesn't like the .ts extension.
84
+ * also it actually tries to import the file, which means you have to export
85
+ * some junk value.
86
+ */
87
+ import export_worker_script from 'worker://../../treb-export/src/export-worker/index-modern.ts';
83
88
 
84
- // ---
89
+ // --- types -------------------------------------------------------------------
85
90
 
86
91
  /**
87
92
  * options for saving files. we add the option for JSON formatting.
@@ -501,11 +506,15 @@ export class EmbeddedSpreadsheet {
501
506
  }
502
507
  }
503
508
 
509
+ if (this.options.document && this.options.inline_document) {
510
+ console.warn('both document and inline-document are provided');
511
+ }
512
+
504
513
  const network_document = this.options.document;
505
514
 
506
515
  // optionally data from storage, with fallback
507
516
 
508
- let data: string | undefined;
517
+ let data: string | undefined | TREBDocument;
509
518
  let source: LoadSource | undefined;
510
519
 
511
520
  // don't load if we're a split view. we can also skip the
@@ -518,6 +527,14 @@ export class EmbeddedSpreadsheet {
518
527
  }
519
528
  }
520
529
 
530
+ // if we have an inline document, and there was nothing in local storage,
531
+ // load the inline document now. not for splits.
532
+
533
+ if (!data && !this.options.toll_initial_load && !options.model && options.inline_document) {
534
+ data = options.inline_document;
535
+ source = LoadSource.INLINE_DOCUMENT;
536
+ }
537
+
521
538
  // this one should not be done for a split view, but we should still
522
539
  // do it if the toll flag is set, and storage key is set.
523
540
 
@@ -681,7 +698,7 @@ export class EmbeddedSpreadsheet {
681
698
  // to the current view. this can lead to strange behavior depending
682
699
  // on which window you're in. needs some thought.
683
700
 
684
- this.key_listener = this.HandleKeyDown.bind(this);
701
+ this.key_listener = (event) => this.HandleKeyDown(event);
685
702
  container.addEventListener('keydown', this.key_listener);
686
703
 
687
704
  const toll_initial_render = !!(data || this.options.document);
@@ -853,8 +870,12 @@ export class EmbeddedSpreadsheet {
853
870
  // FIXME: this should yield so we can subscribe to events before the initial load
854
871
 
855
872
  if (data) {
856
- this.LoadDocument(JSON.parse(data),
857
- { recalculate: !!this.options.recalculate, source});
873
+ if (typeof data === 'string') {
874
+ data = JSON.parse(data);
875
+ }
876
+ if (data) {
877
+ this.LoadDocument(data as TREBDocument, { recalculate: !!this.options.recalculate, source});
878
+ }
858
879
  }
859
880
  else if (!network_document) {
860
881
 
@@ -867,16 +888,12 @@ export class EmbeddedSpreadsheet {
867
888
 
868
889
  this.FlushUndo();
869
890
 
870
- // FIXME: this is deprecated [what?]
871
- // [this is now a file property, not an option]
872
-
873
- // if (options.freeze_rows || options.freeze_columns) {
874
- // this.grid.Freeze(options.freeze_rows || 0, options.freeze_columns || 0);
875
- // }
891
+ // why is this outside of the container test? there should be
892
+ // no reason to do this when headless
876
893
 
877
- // if (typeof options.show_headers !== 'undefined') {
878
894
  this.grid.ShowHeaders(this.options.headers);
879
- // }
895
+
896
+ // again, this should be gated on container
880
897
 
881
898
  // optionally scroll grid on create (async -- why?)
882
899
 
@@ -1054,6 +1071,11 @@ export class EmbeddedSpreadsheet {
1054
1071
  message: `You can't change part of an array`,
1055
1072
  }
1056
1073
 
1074
+ case ErrorCode.invalid_area_for_paste:
1075
+ return {
1076
+ message: 'Invalid area for paste',
1077
+ }
1078
+
1057
1079
  case ErrorCode.invalid_area_for_table:
1058
1080
  return {
1059
1081
  message: `Invalid area for table`,
@@ -1906,12 +1928,15 @@ export class EmbeddedSpreadsheet {
1906
1928
 
1907
1929
  const { x, y } = this.grid.GetScrollOffset();
1908
1930
  const scale = this.grid.scale || 1;
1931
+ const auto_size = { width: 301, height: 301 };
1932
+
1933
+ // we're not sizing this very well at scale, because scale is stepped. FIXME
1909
1934
 
1910
1935
  this.grid.CreateAnnotation({
1911
1936
  type,
1912
1937
  formula,
1913
1938
  // class_name,
1914
- }, undefined, undefined, target || { top: y / scale + 30, left: x / scale + 30, width: 300, height: 300 });
1939
+ }, undefined, undefined, target || { top: y / scale + 30, left: x / scale + 30, ...auto_size });
1915
1940
 
1916
1941
  }
1917
1942
 
@@ -2298,6 +2323,15 @@ export class EmbeddedSpreadsheet {
2298
2323
  */
2299
2324
  public Revert(): void {
2300
2325
 
2326
+ if (this.options.inline_document) {
2327
+ this.LoadDocument(this.options.inline_document);
2328
+ if (this.options.storage_key) {
2329
+ this.SaveLocalStorage('reverted_backup');
2330
+ localStorage.removeItem(this.options.storage_key);
2331
+ }
2332
+ return;
2333
+ }
2334
+
2301
2335
  const canonical = this.options.document;
2302
2336
 
2303
2337
  if (canonical) {
@@ -3484,7 +3518,7 @@ export class EmbeddedSpreadsheet {
3484
3518
 
3485
3519
  // still for now we can take advantage of that and skip the check.
3486
3520
 
3487
- this.grid.ApplyBorders(range ? this.calculator.ResolveArea(range, this.grid.active_sheet) : undefined, borders, undefined, width);
3521
+ this.grid.ApplyBorders2(range ? this.calculator.ResolveArea(range, this.grid.active_sheet) : undefined, borders, {}, width);
3488
3522
 
3489
3523
  }
3490
3524
 
@@ -20,6 +20,7 @@
20
20
  */
21
21
 
22
22
  import type { ICellAddress } from 'treb-base-types';
23
+ import type { TREBDocument } from './types';
23
24
 
24
25
  /**
25
26
  * options for exporting CSV/TSV
@@ -97,6 +98,16 @@ export interface EmbeddedSpreadsheetOptions {
97
98
  */
98
99
  document?: string;
99
100
 
101
+ /**
102
+ * @internal - testing
103
+ *
104
+ * load document directly from data. obeys the same rules as `document`
105
+ * regarding local storage and revert. if you provide both document and
106
+ * inline_document we will show a warning, but inline_document will take
107
+ * precedence.
108
+ */
109
+ inline_document?: TREBDocument;
110
+
100
111
  /**
101
112
  * fetch network document (URI)
102
113
  * @deprecated - use `document`
@@ -19,9 +19,6 @@
19
19
  *
20
20
  */
21
21
 
22
- import {tmpl, NodeModel} from 'treb-utils';
23
- // import '../style/icon.scss';
24
-
25
22
  export enum DialogType {
26
23
  default = '',
27
24
  info = 'info',
@@ -20,7 +20,8 @@
20
20
  */
21
21
 
22
22
  import type { IArea, Table, TableTheme } from 'treb-base-types';
23
- import type { MacroFunction, SerializedNamedExpression, SerializedSheet } from 'treb-grid';
23
+ import type { SerializedNamedExpression, SerializedSheet } from 'treb-grid';
24
+ import type { SerializedMacroFunction } from 'treb-grid/src/types/data_model';
24
25
 
25
26
  export enum SaveFileType {
26
27
  json = 'json',
@@ -38,6 +39,12 @@ export enum SaveFileType {
38
39
  // and so on
39
40
  //
40
41
 
42
+ /**
43
+ * we're not exporting this type in the public API because there are so many
44
+ * nested types that aren't used anywhere else (in public functions).
45
+ *
46
+ * I would like to do it, though, that `any` looks bad in the public API.
47
+ */
41
48
  export interface TREBDocument {
42
49
  app: string;
43
50
  version: string;
@@ -48,8 +55,11 @@ export interface TREBDocument {
48
55
  decimal_mark?: '.' | ',';
49
56
  active_sheet?: number;
50
57
  rendered_values?: boolean;
51
- named_ranges?: {[index: string]: IArea};
52
- macro_functions?: MacroFunction[];
58
+
59
+ // named_ranges?: {[index: string]: IArea};
60
+ named_ranges?: Record<string, IArea>;
61
+
62
+ macro_functions?: SerializedMacroFunction[];
53
63
  named_expressions?: SerializedNamedExpression[];
54
64
  tables?: Table[];
55
65
  shared_resources?: Record<string, string>;
@@ -64,6 +74,7 @@ export enum LoadSource {
64
74
  LOCAL_FILE = 'local-file',
65
75
  NETWORK_FILE = 'network-file',
66
76
  LOCAL_STORAGE = 'local-storage',
77
+ INLINE_DOCUMENT = 'inline-document',
67
78
  UNDO = 'undo',
68
79
  }
69
80
 
@@ -2,7 +2,7 @@
2
2
  @import './grid.scss';
3
3
  @import './theme-defaults.scss';
4
4
  @import './dark-theme.scss';
5
- @import 'treb-charts/style/charts.scss';
5
+ @import '../../treb-charts/style/charts.scss';
6
6
  @import './dialog.scss';
7
7
  @import './spinner.scss';
8
8
  @import './treb-icons.scss';
@@ -364,34 +364,37 @@
364
364
 
365
365
  }
366
366
 
367
- }
368
367
 
369
- // these are (atm) outside of the container because we want them
370
- // to be able to float over any outside content as well... what's the
371
- // rule with that? something about stacking contexts? of course we're
372
- // always goint to be fighting z-indexes.
373
- //
374
- // ...possible to use a dialog element? TODO: investigate...
375
- //
376
-
377
- .treb-resize-rect {
378
- all: initial;
379
- z-index: 9998; // ugh
380
- position: absolute;
381
- top: 0px;
382
- left: 0px;
383
- border: 1px dotted var(--treb-resize-frame-color, blue);
384
- width: 100%;
385
- height: 100%;
386
- display: block;
387
- }
368
+ // these are (atm) outside of the container because we want them
369
+ // to be able to float over any outside content as well... what's the
370
+ // rule with that? something about stacking contexts? of course we're
371
+ // always goint to be fighting z-indexes.
372
+ //
373
+ // ...possible to use a dialog element? TODO: investigate...
374
+ //
375
+
376
+ // OK, but then we can't scope properly. so no.
377
+
378
+ .treb-resize-rect {
379
+ all: initial;
380
+ z-index: 9998; // ugh
381
+ position: fixed;
382
+ top: 0px;
383
+ left: 0px;
384
+ border: 1px dotted var(--treb-resize-frame-color, blue);
385
+ width: 100%;
386
+ height: 100%;
387
+ display: block;
388
+ }
389
+
390
+ .treb-resize-mask {
391
+ all: initial;
392
+ z-index: 9999; // ugh
393
+ position: fixed;
394
+ top: 0px;
395
+ left: 0px;
396
+ width: 100vw;
397
+ height: 100vh;
398
+ }
388
399
 
389
- .treb-resize-mask {
390
- all: initial;
391
- z-index: 9999; // ugh
392
- position: fixed;
393
- top: 0px;
394
- left: 0px;
395
- width: 100vw;
396
- height: 100vh;
397
400
  }
@@ -182,9 +182,14 @@ $text-reference-color-5: rgb(254, 47, 1);
182
182
  background: var(--treb-grid-background, #fff);
183
183
  }
184
184
 
185
+ /*
186
+ * we stopped using this in favor of sheet backgrounds. although
187
+ * there's a case to be made for the static background as well.
188
+ *
185
189
  .grid-background {
186
190
  background-image: var(--treb-grid-background-image, none);
187
191
  }
192
+ */
188
193
 
189
194
  /**
190
195
  * this is used for freeze-area highlights
@@ -21,7 +21,7 @@
21
21
 
22
22
  // import * as ElementTree from 'elementtree';
23
23
  // import { Element, ElementTree as Tree } from 'elementtree';
24
- import { UnitAddress, UnitRange, UnitLiteral, ExpressionUnit } from 'treb-parser';
24
+ import type { UnitAddress, UnitRange, UnitLiteral, ExpressionUnit } from 'treb-parser';
25
25
 
26
26
  import { static_title, ref_title, chart_template } from './chart-template-components2';
27
27
  import { column_json, column_series } from './column-chart-template2';
@@ -41,7 +41,7 @@ import { scatter_series as scatter2_series } from './scatter2-chart-template';
41
41
  // import { v4 as uuidv4 } from 'uuid';
42
42
 
43
43
  import { Localization } from 'treb-base-types';
44
- import { RelationshipMap } from '../relationship';
44
+ import type { RelationshipMap } from '../relationship';
45
45
 
46
46
  export interface ChartOptions {
47
47
  type: 'donut'|'column'|'bar'|'scatter'|'scatter2';
@@ -19,10 +19,12 @@
19
19
  *
20
20
  */
21
21
 
22
- import { EmbeddedImage, ImageOptions } from './embedded-image';
23
- import { Chart, ChartOptions} from './chart2';
24
- import { RelationshipMap, AddRel } from '../relationship';
25
- import { Corner } from 'treb-base-types/src';
22
+ import type { ImageOptions } from './embedded-image';
23
+ import { EmbeddedImage } from './embedded-image';
24
+ import type { ChartOptions} from './chart2';
25
+ import { Chart} from './chart2';
26
+ import type { RelationshipMap} from '../relationship';
27
+ import { AddRel } from '../relationship';
26
28
 
27
29
  const pixel_offset = 9525;
28
30
 
@@ -1,27 +1,25 @@
1
- /*
2
- * This file is part of TREB.
3
- *
4
- * TREB is free software: you can redistribute it and/or modify it under the
5
- * terms of the GNU General Public License as published by the Free Software
6
- * Foundation, either version 3 of the License, or (at your option) any
7
- * later version.
8
- *
9
- * TREB is distributed in the hope that it will be useful, but WITHOUT ANY
10
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12
- * details.
13
- *
14
- * You should have received a copy of the GNU General Public License along
15
- * with TREB. If not, see <https://www.gnu.org/licenses/>.
16
- *
17
- * Copyright 2022-2023 trebco, llc.
18
- * info@treb.app
19
- *
20
- */
21
-
22
- // import { Importer } from '../import';
23
- // import { Exporter } from '../export';
24
- import type { ImportedSheetData, IArea } from 'treb-base-types/src';
1
+ /*
2
+ * This file is part of TREB.
3
+ *
4
+ * TREB is free software: you can redistribute it and/or modify it under the
5
+ * terms of the GNU General Public License as published by the Free Software
6
+ * Foundation, either version 3 of the License, or (at your option) any
7
+ * later version.
8
+ *
9
+ * TREB is distributed in the hope that it will be useful, but WITHOUT ANY
10
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12
+ * details.
13
+ *
14
+ * You should have received a copy of the GNU General Public License along
15
+ * with TREB. If not, see <https://www.gnu.org/licenses/>.
16
+ *
17
+ * Copyright 2022-2023 trebco, llc.
18
+ * info@treb.app
19
+ *
20
+ */
21
+
22
+ import type { ImportedSheetData } from 'treb-base-types/src';
25
23
 
26
24
  import { Exporter } from '../export2';
27
25
  import { Importer } from '../import2';
@@ -19,4 +19,5 @@
19
19
  *
20
20
  */
21
21
 
22
- import './export-worker';
22
+ import './export-worker';
23
+
@@ -34,25 +34,32 @@ const XMLDeclaration = `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\
34
34
  import { template } from './template-2';
35
35
  import type { SerializedSheet } from 'treb-grid';
36
36
 
37
- import { IArea, Area, ICellAddress, Cells, ValueType, CellValue, Style, DataValidation, ValidationType,
38
- AnnotationLayout, Corner as LayoutCorner, ICellAddress2, Table, Cell } from 'treb-base-types';
37
+ import type { IArea, ICellAddress, CellValue, DataValidation,
38
+ AnnotationLayout, Corner as LayoutCorner, Cell } from 'treb-base-types';
39
+ import { Area, Cells, ValueType, Style, ValidationType } from 'treb-base-types';
39
40
 
40
41
  // import * as xmlparser from 'fast-xml-parser';
41
- import { XMLParser, XmlBuilderOptions, XMLBuilder } from 'fast-xml-parser';
42
+ import type { XmlBuilderOptions} from 'fast-xml-parser';
43
+ import { XMLParser, XMLBuilder } from 'fast-xml-parser';
42
44
 
43
45
  import { SharedStrings } from './shared-strings2';
44
- import { StyleCache, XlColor, BorderEdge } from './workbook-style2';
46
+ import type { XlColor, BorderEdge } from './workbook-style2';
47
+ import { StyleCache } from './workbook-style2';
45
48
  import { Theme } from './workbook-theme2';
46
49
 
47
- import { RelationshipMap, AddRel } from './relationship';
50
+ import type { RelationshipMap} from './relationship';
51
+ import { AddRel } from './relationship';
48
52
  import { XMLOptions2 } from './xml-utils';
49
53
 
50
- import { Parser, UnitAddress, UnitRange, ExpressionUnit, IllegalSheetNameRegex, QuotedSheetNameRegex } from 'treb-parser';
54
+ import type { UnitAddress, UnitRange, ExpressionUnit} from 'treb-parser';
55
+ import { Parser, QuotedSheetNameRegex } from 'treb-parser';
51
56
 
52
57
  // FIXME: move
53
- import { Chart, ChartOptions } from './drawing2/chart2';
58
+ import type { ChartOptions } from './drawing2/chart2';
59
+ import { Chart } from './drawing2/chart2';
54
60
  import type { ImageOptions } from './drawing2/embedded-image';
55
- import { Drawing, TwoCellAnchor } from './drawing2/drawing2';
61
+ import type { TwoCellAnchor } from './drawing2/drawing2';
62
+ import { Drawing } from './drawing2/drawing2';
56
63
  import type { TableDescription, TableFooterType } from './workbook2';
57
64
 
58
65
  export class Exporter {
@@ -22,11 +22,16 @@
22
22
  //import * as JSZip from 'jszip';
23
23
  import JSZip from 'jszip';
24
24
 
25
- import { AnchoredChartDescription, ChartType, TableDescription, Workbook } from './workbook2';
26
- import { Parser, ParseResult } from 'treb-parser';
27
- import { is_range, RangeType, ShiftRange, InRange, AddressType, is_address, HyperlinkType } from './address-type';
28
- import { ImportedSheetData, AnchoredAnnotation, CellParseResult, ValueType, AnnotationLayout, Corner as LayoutCorner, ICellAddress, DataValidation, ValidationType, IArea } from 'treb-base-types/src';
29
- import { Sheet, VisibleState } from './workbook-sheet2';
25
+ import type { AnchoredChartDescription} from './workbook2';
26
+ import { ChartType, Workbook } from './workbook2';
27
+ import type { ParseResult } from 'treb-parser';
28
+ import { Parser } from 'treb-parser';
29
+ import type { RangeType, AddressType, HyperlinkType } from './address-type';
30
+ import { is_range, ShiftRange, InRange, is_address } from './address-type';
31
+ import type { ImportedSheetData, AnchoredAnnotation, CellParseResult, AnnotationLayout, Corner as LayoutCorner, ICellAddress, DataValidation, IArea } from 'treb-base-types/src';
32
+ import { ValueType, ValidationType } from 'treb-base-types/src';
33
+ import type { Sheet} from './workbook-sheet2';
34
+ import { VisibleState } from './workbook-sheet2';
30
35
  import type { CellAnchor } from './drawing2/drawing2';
31
36
  import { XMLUtils } from './xml-utils';
32
37
 
@@ -41,7 +41,8 @@
41
41
  */
42
42
 
43
43
 
44
- import { AddressType, RangeType, is_range } from './address-type';
44
+ import type { AddressType, RangeType} from './address-type';
45
+ import { is_range } from './address-type';
45
46
  import type { SharedStrings } from './shared-strings2';
46
47
  import type { Drawing } from './drawing2/drawing2';
47
48
  import type { RelationshipMap } from './relationship';
@@ -1,28 +1,29 @@
1
- /*
2
- * This file is part of TREB.
3
- *
4
- * TREB is free software: you can redistribute it and/or modify it under the
5
- * terms of the GNU General Public License as published by the Free Software
6
- * Foundation, either version 3 of the License, or (at your option) any
7
- * later version.
8
- *
9
- * TREB is distributed in the hope that it will be useful, but WITHOUT ANY
10
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12
- * details.
13
- *
14
- * You should have received a copy of the GNU General Public License along
15
- * with TREB. If not, see <https://www.gnu.org/licenses/>.
16
- *
17
- * Copyright 2022-2023 trebco, llc.
18
- * info@treb.app
19
- *
20
- */
21
-
1
+ /*
2
+ * This file is part of TREB.
3
+ *
4
+ * TREB is free software: you can redistribute it and/or modify it under the
5
+ * terms of the GNU General Public License as published by the Free Software
6
+ * Foundation, either version 3 of the License, or (at your option) any
7
+ * later version.
8
+ *
9
+ * TREB is distributed in the hope that it will be useful, but WITHOUT ANY
10
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12
+ * details.
13
+ *
14
+ * You should have received a copy of the GNU General Public License along
15
+ * with TREB. If not, see <https://www.gnu.org/licenses/>.
16
+ *
17
+ * Copyright 2022-2023 trebco, llc.
18
+ * info@treb.app
19
+ *
20
+ */
21
+
22
22
  import { FormatParser } from './format_parser';
23
23
  import { NumberFormatSection } from './number_format_section';
24
+ import type { TextPart, Complex, DimensionedQuantity, CellValue} from 'treb-base-types';
24
25
  import {
25
- Localization, TextPartFlag, TextPart, Complex, DimensionedQuantity, CellValue, IsDimensionedQuantity,
26
+ Localization, TextPartFlag, IsDimensionedQuantity,
26
27
  } from 'treb-base-types';
27
28
 
28
29
  //