@trebco/treb 25.0.1 → 25.4.2

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 (76) hide show
  1. package/{.eslintrc.js → .eslintrc.cjs} +4 -0
  2. package/api-config.json +1 -1
  3. package/api-generator/api-generator.ts +25 -55
  4. package/dist/treb-spreadsheet.mjs +14 -0
  5. package/{build → dist}/treb.d.ts +1 -1
  6. package/esbuild-custom-element.mjs +17 -265
  7. package/esbuild-utils.mjs +273 -0
  8. package/package.json +5 -4
  9. package/treb-base-types/src/cell.ts +23 -22
  10. package/treb-base-types/src/cells.ts +55 -2
  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/markup/toolbar.html +2 -2
  34. package/treb-embed/modern.tsconfig.json +3 -2
  35. package/treb-embed/src/custom-element/spreadsheet-constructor.ts +17 -14
  36. package/treb-embed/src/embedded-spreadsheet.ts +100 -69
  37. package/treb-embed/src/progress-dialog.ts +0 -3
  38. package/treb-embed/src/types.ts +13 -3
  39. package/treb-embed/style/dialog.scss +2 -0
  40. package/treb-embed/style/layout.scss +43 -40
  41. package/treb-embed/style/toolbar.scss +38 -38
  42. package/treb-embed/style/treb-icons.scss +53 -43
  43. package/treb-export/src/drawing2/chart2.ts +2 -2
  44. package/treb-export/src/drawing2/drawing2.ts +6 -4
  45. package/treb-export/src/export-worker/export-worker.ts +22 -24
  46. package/treb-export/src/export-worker/index-modern.ts +2 -1
  47. package/treb-export/src/export2.ts +15 -8
  48. package/treb-export/src/import2.ts +10 -5
  49. package/treb-export/src/workbook-sheet2.ts +2 -1
  50. package/treb-format/src/format.ts +23 -22
  51. package/treb-format/src/format_parser.ts +23 -22
  52. package/treb-format/src/value_parser.ts +23 -22
  53. package/treb-grid/src/editors/formula_bar.ts +2 -1
  54. package/treb-grid/src/editors/formula_editor_base.ts +4 -2
  55. package/treb-grid/src/editors/overlay_editor.ts +2 -1
  56. package/treb-grid/src/index.ts +12 -9
  57. package/treb-grid/src/layout/base_layout.ts +4 -2
  58. package/treb-grid/src/render/selection-renderer.ts +25 -23
  59. package/treb-grid/src/render/tile_renderer.ts +6 -4
  60. package/treb-grid/src/types/annotation.ts +33 -37
  61. package/treb-grid/src/types/data_model.ts +30 -22
  62. package/treb-grid/src/types/grid.ts +55 -584
  63. package/treb-grid/src/types/grid_base.ts +401 -7
  64. package/treb-grid/src/types/grid_events.ts +3 -0
  65. package/treb-grid/src/types/grid_selection.ts +22 -22
  66. package/treb-grid/src/types/named_range.ts +22 -22
  67. package/treb-grid/src/types/sheet.ts +8 -7
  68. package/treb-grid/src/types/sheet_types.ts +11 -7
  69. package/treb-grid/src/types/tab_bar.ts +1 -1
  70. package/treb-parser/src/parser.ts +5 -4
  71. package/tsproject.json +4 -5
  72. package/util/list-css-vars.sh +8 -11
  73. package/build/treb-spreadsheet.mjs +0 -14
  74. package/esbuild.js +0 -305
  75. package/tsconfig.json +0 -10
  76. /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,36 +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';
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';
82
88
 
83
- // ---
89
+ // --- types -------------------------------------------------------------------
84
90
 
85
91
  /**
86
92
  * options for saving files. we add the option for JSON formatting.
@@ -680,7 +686,7 @@ export class EmbeddedSpreadsheet {
680
686
  // to the current view. this can lead to strange behavior depending
681
687
  // on which window you're in. needs some thought.
682
688
 
683
- this.key_listener = this.HandleKeyDown.bind(this);
689
+ this.key_listener = (event) => this.HandleKeyDown(event);
684
690
  container.addEventListener('keydown', this.key_listener);
685
691
 
686
692
  const toll_initial_render = !!(data || this.options.document);
@@ -866,16 +872,12 @@ export class EmbeddedSpreadsheet {
866
872
 
867
873
  this.FlushUndo();
868
874
 
869
- // FIXME: this is deprecated [what?]
870
- // [this is now a file property, not an option]
871
-
872
- // if (options.freeze_rows || options.freeze_columns) {
873
- // this.grid.Freeze(options.freeze_rows || 0, options.freeze_columns || 0);
874
- // }
875
+ // why is this outside of the container test? there should be
876
+ // no reason to do this when headless
875
877
 
876
- // if (typeof options.show_headers !== 'undefined') {
877
878
  this.grid.ShowHeaders(this.options.headers);
878
- // }
879
+
880
+ // again, this should be gated on container
879
881
 
880
882
  // optionally scroll grid on create (async -- why?)
881
883
 
@@ -1053,6 +1055,11 @@ export class EmbeddedSpreadsheet {
1053
1055
  message: `You can't change part of an array`,
1054
1056
  }
1055
1057
 
1058
+ case ErrorCode.invalid_area_for_paste:
1059
+ return {
1060
+ message: 'Invalid area for paste',
1061
+ }
1062
+
1056
1063
  case ErrorCode.invalid_area_for_table:
1057
1064
  return {
1058
1065
  message: `Invalid area for table`,
@@ -1905,12 +1912,15 @@ export class EmbeddedSpreadsheet {
1905
1912
 
1906
1913
  const { x, y } = this.grid.GetScrollOffset();
1907
1914
  const scale = this.grid.scale || 1;
1915
+ const auto_size = { width: 301, height: 301 };
1916
+
1917
+ // we're not sizing this very well at scale, because scale is stepped. FIXME
1908
1918
 
1909
1919
  this.grid.CreateAnnotation({
1910
1920
  type,
1911
1921
  formula,
1912
1922
  // class_name,
1913
- }, undefined, undefined, target || { top: y / scale + 30, left: x / scale + 30, width: 300, height: 300 });
1923
+ }, undefined, undefined, target || { top: y / scale + 30, left: x / scale + 30, ...auto_size });
1914
1924
 
1915
1925
  }
1916
1926
 
@@ -2241,6 +2251,12 @@ export class EmbeddedSpreadsheet {
2241
2251
  */
2242
2252
  public async ExportBlob(): Promise<Blob> {
2243
2253
 
2254
+ // this is inlined to ensure the code will be tree-shaken properly
2255
+ if (!process.env.XLSX_SUPPORT) {
2256
+ console.warn('this build does not include xlsx support.');
2257
+ throw new Error('this build does not include xlsx support.');
2258
+ }
2259
+
2244
2260
  if (!this.export_worker) {
2245
2261
  this.export_worker = await this.LoadWorker('export');
2246
2262
  }
@@ -2338,6 +2354,12 @@ export class EmbeddedSpreadsheet {
2338
2354
  */
2339
2355
  public Export(): void {
2340
2356
 
2357
+ // this is inlined to ensure the code will be tree-shaken properly
2358
+ if (!process.env.XLSX_SUPPORT) {
2359
+ console.warn('this build does not include xlsx support.');
2360
+ return;
2361
+ }
2362
+
2341
2363
  // API v1 OK
2342
2364
 
2343
2365
  // it might be nice to merge the workers, but since export is (presumably)
@@ -3471,7 +3493,7 @@ export class EmbeddedSpreadsheet {
3471
3493
 
3472
3494
  // still for now we can take advantage of that and skip the check.
3473
3495
 
3474
- this.grid.ApplyBorders(range ? this.calculator.ResolveArea(range, this.grid.active_sheet) : undefined, borders, undefined, width);
3496
+ this.grid.ApplyBorders2(range ? this.calculator.ResolveArea(range, this.grid.active_sheet) : undefined, borders, {}, width);
3475
3497
 
3476
3498
  }
3477
3499
 
@@ -3896,6 +3918,12 @@ export class EmbeddedSpreadsheet {
3896
3918
  */
3897
3919
  protected async ImportXLSX(data: string, source: LoadSource): Promise<Blob | void> {
3898
3920
 
3921
+ // this is inlined to ensure the code will be tree-shaken properly
3922
+ if (!process.env.XLSX_SUPPORT) {
3923
+ console.warn('this build does not include xlsx support.');
3924
+ return;
3925
+ }
3926
+
3899
3927
  if (this.parent_view) {
3900
3928
  return this.parent_view.ImportXLSX(data, source);
3901
3929
  }
@@ -4354,7 +4382,9 @@ export class EmbeddedSpreadsheet {
4354
4382
  this.dialog?.ShowDialog({
4355
4383
  title: 'Error reading file',
4356
4384
  close_box: true,
4357
- message: 'Please make sure your file is a valid XLSX, CSV or TREB file.',
4385
+ message: process.env.XLSX_SUPPORT ?
4386
+ 'Please make sure your file is a valid XLSX, CSV or TREB file.' :
4387
+ 'Please make sure your file is a valid CSV or TREB file.' ,
4358
4388
  type: DialogType.error,
4359
4389
  timeout: 3000,
4360
4390
  });
@@ -4372,7 +4402,7 @@ export class EmbeddedSpreadsheet {
4372
4402
  if (/\.csv$/i.test(file.name)) {
4373
4403
  this.LoadCSV(reader.result as string, source);
4374
4404
  }
4375
- else if (/\.xls[xm]$/i.test(file.name)) {
4405
+ else if (process.env.XLSX_SUPPORT && /\.xls[xm]$/i.test(file.name)) {
4376
4406
  let contents: string;
4377
4407
 
4378
4408
  if (typeof reader.result === 'string') {
@@ -5224,35 +5254,35 @@ export class EmbeddedSpreadsheet {
5224
5254
  */
5225
5255
  protected async LoadWorker(name: string): Promise<Worker> {
5226
5256
 
5227
- // for esm we now support embedding the worker as a blob
5228
- // (as text, actually); we can construct it from the text
5229
- // as necessary.
5257
+ // this is inlined to ensure the code will be tree-shaken properly
5258
+ // (we're trying to force it to remove the imported worker script)
5230
5259
 
5231
- if (export_worker_script) {
5232
- try {
5233
- const worker = new Worker(
5234
- URL.createObjectURL(new Blob([export_worker_script], { type: 'application/javascript' })));
5235
- return worker;
5236
- }
5237
- catch (err) {
5238
- console.info('embedded worker failed');
5239
- console.error(err);
5260
+ if (process.env.XLSX_SUPPORT) {
5261
+
5262
+ // for esm we now support embedding the worker as a blob
5263
+ // (as text, actually); we can construct it from the text
5264
+ // as necessary.
5265
+
5266
+ if (export_worker_script) {
5267
+ try {
5268
+ const worker = new Worker(
5269
+ URL.createObjectURL(new Blob([export_worker_script], { type: 'application/javascript' })));
5270
+ return worker;
5271
+ }
5272
+ catch (err) {
5273
+ console.info('embedded worker failed');
5274
+ console.error(err);
5275
+ }
5240
5276
  }
5277
+
5278
+ }
5279
+ else {
5280
+ console.warn('this build does not include xlsx support.');
5241
5281
  }
5242
5282
 
5283
+ throw new Error('creating worker failed');
5284
+
5243
5285
  /*
5244
- if (EmbeddedSpreadsheet.export_worker_text) {
5245
- try {
5246
- const worker = new Worker(
5247
- URL.createObjectURL(new Blob([EmbeddedSpreadsheet.export_worker_text], { type: 'application/javascript' })));
5248
- return worker;
5249
- }
5250
- catch (err) {
5251
- console.info('embedded worker failed');
5252
- console.error(err);
5253
- }
5254
- }
5255
- */
5256
5286
 
5257
5287
  if (!EmbeddedSpreadsheet.treb_base_path) {
5258
5288
  console.warn('worker path is not set. it you are loading TREB in an ESM module, please either '
@@ -5304,6 +5334,7 @@ export class EmbeddedSpreadsheet {
5304
5334
  }
5305
5335
 
5306
5336
  return worker;
5337
+ */
5307
5338
 
5308
5339
  }
5309
5340
 
@@ -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>;
@@ -53,7 +53,9 @@
53
53
 
54
54
  line-height: 1.6em;
55
55
 
56
+ font-size: var(--treb-dialog-font-size, 16px);
56
57
  border: 1px solid var(--treb-dialog-border-color, var(--treb-ui-border-color, #999));
58
+ box-shadow: 0 4px 6px -4px rgba(0, 0, 0, .3);
57
59
 
58
60
  border-top-width: 3px;
59
61
  border-top-color: rgb(0, 157, 255);
@@ -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';
@@ -276,8 +276,8 @@
276
276
  border-top-right-radius: 0px;
277
277
  border-bottom-right-radius: 0px;
278
278
  &::after {
279
- mask-image: var(--treb-sidebar-icon-chevron-left);
280
- -webkit-mask-image: var(--treb-sidebar-icon-chevron-left);
279
+ mask-image: var(--icon-chevron-left);
280
+ -webkit-mask-image: var(--icon-chevron-left);
281
281
  }
282
282
  background: var(--treb-toolbar-button-background, #fff);
283
283
 
@@ -303,8 +303,8 @@
303
303
  mask-repeat: no-repeat;
304
304
  -webkit-mask-repeat: no-repeat;
305
305
  transition: background-color 0.1s ease;
306
- mask-image: var(--treb-mask-image);
307
- -webkit-mask-image: var(--treb-mask-image);
306
+ mask-image: var(--icon);
307
+ -webkit-mask-image: var(--icon);
308
308
  }
309
309
 
310
310
  &:hover::after {
@@ -312,23 +312,23 @@
312
312
  }
313
313
 
314
314
  &[data-command=recalculate] {
315
- --treb-mask-image: var(--treb-sidebar-icon-reset);
315
+ --icon: var(--icon-reset);
316
316
  }
317
317
 
318
318
  &[data-command=toggle-toolbar] {
319
- --treb-mask-image: var(--treb-sidebar-icon-toolbar);
319
+ --icon: var(--icon-toolbar);
320
320
  }
321
321
 
322
322
  &[data-command=revert] {
323
- --treb-mask-image: var(--treb-sidebar-icon-revert);
323
+ --icon: var(--icon-revert);
324
324
  }
325
325
 
326
326
  &[data-command=export-xlsx] {
327
- --treb-mask-image: var(--treb-sidebar-icon-export);
327
+ --icon: var(--icon-export);
328
328
  }
329
329
 
330
330
  &[data-command=about] {
331
- --treb-mask-image: var(--treb-sidebar-icon-about);
331
+ --icon: var(--icon-about);
332
332
  }
333
333
 
334
334
  }
@@ -358,40 +358,43 @@
358
358
  &::after {
359
359
  height: 12px;
360
360
  width: 12px;
361
- mask-image: var(--treb-sidebar-icon-chevron-right);
362
- -webkit-mask-image: var(--treb-sidebar-icon-chevron-right);
361
+ mask-image: var(--icon-chevron-right);
362
+ -webkit-mask-image: var(--icon-chevron-right);
363
363
  }
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
  }
@@ -258,47 +258,47 @@ $swatch-size: 18px;
258
258
 
259
259
  // ---------------------------------------------------------------------------
260
260
 
261
- [data-icon=file-menu]{ --icon: var(--treb-icon-file-menu); }
261
+ [data-icon=file-menu]{ --icon: var(--icon-file-menu); }
262
262
 
263
- [data-command=justify-left] { --icon: var(--treb-icon-text-align-left); }
264
- [data-command=justify-right] { --icon: var(--treb-icon-text-align-right); }
265
- [data-command=justify-center] { --icon: var(--treb-icon-text-align-center); }
266
-
267
- [data-command=align-top] { --icon: var(--treb-icon-text-align-top); }
268
- [data-command=align-middle] { --icon: var(--treb-icon-text-align-middle); }
269
- [data-command=align-bottom] { --icon: var(--treb-icon-text-align-bottom); }
270
- [data-command=merge-cells] { --icon: var(--treb-icon-merge-cells); }
271
- [data-command=unmerge-cells] { --icon: var(--treb-icon-unmerge-cells); }
272
-
273
- [data-command=fill-color] { --icon: var(--treb-icon-fill-color); }
274
- [data-command=text-color] { --icon: var(--treb-icon-text-color); }
275
-
276
- [data-command=lock-cells] { --icon: var(--treb-icon-lock); }
277
- [data-command=wrap-text] { --icon: var(--treb-icon-wrap-text); }
278
- [data-icon=comment] { --icon: var(--treb-icon-comment); }
279
- [data-icon=table] { --icon: var(--treb-icon-table); }
263
+ [data-command=justify-left] { --icon: var(--icon-text-align-left); }
264
+ [data-command=justify-right] { --icon: var(--icon-text-align-right); }
265
+ [data-command=justify-center] { --icon: var(--icon-text-align-center); }
266
+
267
+ [data-command=align-top] { --icon: var(--icon-text-align-top); }
268
+ [data-command=align-middle] { --icon: var(--icon-text-align-middle); }
269
+ [data-command=align-bottom] { --icon: var(--icon-text-align-bottom); }
270
+ [data-command=merge-cells] { --icon: var(--icon-merge-cells); }
271
+ [data-command=unmerge-cells] { --icon: var(--icon-unmerge-cells); }
272
+
273
+ [data-command=fill-color] { --icon: var(--icon-fill-color); }
274
+ [data-command=text-color] { --icon: var(--icon-text-color); }
275
+
276
+ [data-command=lock-cells] { --icon: var(--icon-lock); }
277
+ [data-command=wrap-text] { --icon: var(--icon-wrap-text); }
278
+ [data-icon=comment] { --icon: var(--icon-comment); }
279
+ [data-icon=table] { --icon: var(--icon-table); }
280
280
 
281
- [data-icon=layout] { --icon: var(--treb-icon-layout); }
282
- [data-command=freeze-panes] { --icon: var(--treb-icon-freeze); }
281
+ [data-icon=layout] { --icon: var(--icon-layout); }
282
+ [data-command=freeze-panes] { --icon: var(--icon-freeze); }
283
283
 
284
- [data-command=insert-column-chart] { --icon: var(--treb-icon-column-chart); }
285
- [data-command=insert-donut-chart] { --icon: var(--treb-icon-donut-chart); }
286
- [data-command=insert-bar-chart] { --icon: var(--treb-icon-bar-chart); }
287
- [data-command=insert-line-chart] { --icon: var(--treb-icon-line-chart); }
288
- [data-command=insert-image] { --icon: var(--treb-icon-image); }
289
-
290
- [data-command=border-bottom] { --icon: var(--treb-icon-border-bottom); }
291
- [data-command=border-left] { --icon: var(--treb-icon-border-left); }
292
- [data-command=border-right] { --icon: var(--treb-icon-border-right); }
293
- [data-command=border-top] { --icon: var(--treb-icon-border-top); }
294
- [data-command=border-outside] { --icon: var(--treb-icon-border-outer); }
295
- [data-command=border-all] { --icon: var(--treb-icon-border-all); }
296
- [data-command=border-none] { --icon: var(--treb-icon-border-none); }
297
- [data-command=border-double-bottom] { --icon: var(--treb-icon-border-double-bottom); }
298
- [data-icon=palette] { --icon: var(--treb-icon-palette); }
284
+ [data-command=insert-column-chart] { --icon: var(--icon-column-chart); }
285
+ [data-command=insert-donut-chart] { --icon: var(--icon-donut-chart); }
286
+ [data-command=insert-bar-chart] { --icon: var(--icon-bar-chart); }
287
+ [data-command=insert-line-chart] { --icon: var(--icon-line-chart); }
288
+ [data-command=insert-image] { --icon: var(--icon-image); }
289
+
290
+ [data-command=border-bottom] { --icon: var(--icon-border-bottom); }
291
+ [data-command=border-left] { --icon: var(--icon-border-left); }
292
+ [data-command=border-right] { --icon: var(--icon-border-right); }
293
+ [data-command=border-top] { --icon: var(--icon-border-top); }
294
+ [data-command=border-outside] { --icon: var(--icon-border-outer); }
295
+ [data-command=border-all] { --icon: var(--icon-border-all); }
296
+ [data-command=border-none] { --icon: var(--icon-border-none); }
297
+ [data-command=border-double-bottom] { --icon: var(--icon-border-double-bottom); }
298
+ [data-icon=palette] { --icon: var(--icon-palette); }
299
299
 
300
300
  [data-command=recalculate] {
301
- --icon: var(--treb-icon-recalculate);
301
+ --icon: var(--icon-recalculate);
302
302
  --icon-size: 20px 20px;
303
303
  }
304
304
 
@@ -375,8 +375,8 @@ $swatch-size: 18px;
375
375
  -webkit-mask-position: center;
376
376
  mask-repeat: no-repeat;
377
377
  -webkit-mask-repeat: no-repeat;
378
- mask-image: var(--treb-icon-x);
379
- -webkit-mask-image: var(--treb-icon-x);
378
+ mask-image: var(--icon-x);
379
+ -webkit-mask-image: var(--icon-x);
380
380
  mask-size: 24px 24px;
381
381
  -webkit-mask-size: 24px 24px;
382
382
  }