@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
@@ -22,6 +22,7 @@ module.exports = {
22
22
  }
23
23
  ],
24
24
  'camelcase': 'off',
25
+ '@typescript-eslint/no-unsafe-declaration-merging': 'error',
25
26
  '@typescript-eslint/camelcase': 'off',
26
27
  // '@typescript-eslint/explicit-function-return-type': 'off',
27
28
  '@typescript-eslint/quotes': [
@@ -53,6 +54,9 @@ module.exports = {
53
54
 
54
55
  'grouped-accessor-pairs': ['error', 'getBeforeSet'],
55
56
 
57
+ '@typescript-eslint/consistent-type-imports': 'error',
58
+ // '@typescript-eslint/consistent-type-exports': 'error',
59
+
56
60
  }
57
61
 
58
62
  /*
package/api-config.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  "package": "./package.json",
4
4
 
5
- "output": "./build/treb.d.ts",
5
+ "output": "./dist/treb.d.ts",
6
6
 
7
7
  "root": "./declaration",
8
8
 
@@ -118,10 +118,13 @@ function CleanTransformer<T extends ts.Node>(): ts.TransformerFactory<T> {
118
118
  */
119
119
  let exported_module = false;
120
120
 
121
- return context => {
122
- const visit: ts.Visitor = node => {
121
+ return (context: ts.TransformationContext) => {
123
122
 
124
- const modifiers = (node.modifiers || []).map(member => {
123
+ const visit: ts.Visitor = (node: ts.Node): ts.Node|undefined => {
124
+
125
+ // FIXME: not sure what this was before
126
+
127
+ const modifiers = ((node as any).modifiers || []).map((member: ts.Node) => {
125
128
  return ts.SyntaxKind[member.kind];
126
129
  });
127
130
 
@@ -211,7 +214,7 @@ function CleanTransformer<T extends ts.Node>(): ts.TransformerFactory<T> {
211
214
  })
212
215
  ));
213
216
 
214
- if ((node as any).jsDoc) {
217
+ if ((node as any).jsDoc && (node as any).jsDoc[0]) {
215
218
 
216
219
  const source_text = node.getSourceFile().text;
217
220
  const jsDoc: ts.JSDoc[] = (node as any).jsDoc;
@@ -361,8 +364,10 @@ function CleanTransformer<T extends ts.Node>(): ts.TransformerFactory<T> {
361
364
  }
362
365
 
363
366
  return ts.visitEachChild(node, child => visit(child), context);
364
- }
365
- return node => ts.visitNode(node, visit);
367
+ };
368
+
369
+ return (node: T) => ts.visitEachChild(node, visit, context);
370
+
366
371
  };
367
372
 
368
373
  }
@@ -430,23 +435,18 @@ function CollectDependencyTransformer<T extends ts.Node>(
430
435
 
431
436
  };
432
437
 
433
- return context => {
434
- const visit: ts.Visitor = node => {
438
+ return (context: ts.TransformationContext) => {
439
+
440
+ const visitor: ts.Visitor = (node: ts.Node) => {
441
+ return node;
442
+ }
443
+
444
+ const visit: ts.Visitor = (node: ts.Node) => {
435
445
 
436
446
  const modifiers = ts.canHaveModifiers(node) ? (ts.getModifiers(node) || []).map(member => {
437
447
  return ts.SyntaxKind[member.kind];
438
448
  }) : [];
439
449
 
440
- /*
441
- const modifiers = (node.modifiers || []).map(member => {
442
- return ts.SyntaxKind[member.kind];
443
- });
444
-
445
- if (modifiers.length) {
446
- console.info({modifiers, modifiers2});
447
- }
448
- */
449
-
450
450
  const tags = GetDocTags(node);
451
451
 
452
452
  const internal =
@@ -456,40 +456,6 @@ function CollectDependencyTransformer<T extends ts.Node>(
456
456
  const declared = modifiers.includes('DeclareKeyword');
457
457
  const is_public = !(modifiers.includes('ProtectedKeyword') || modifiers.includes('PrivateKeyword'));
458
458
 
459
- /*
460
- if ((node as any).name && ts.isIdentifier((node as any).name)) {
461
- const name = (node as any).name.escapedText.toString();
462
- if (/treb/i.test(name)) {
463
- console.info(name, node.kind, ts.SyntaxKind[node.kind] );
464
- }
465
- }
466
- */
467
-
468
- /*
469
- if ((node as any).name && ts.isIdentifier((node as any).name)) {
470
- const name = (node as any).name.escapedText.toString();
471
- if (/trebglobal$/i.test(name)) {
472
- console.info({name, exported, internal, modifiers});
473
- console.info(node);
474
- console.info('');
475
- }
476
- }
477
- */
478
-
479
- /*
480
- if (exported && declared) {
481
- if ((node as any).name && ts.isIdentifier((node as any).name)) {
482
- const name = (node as any).name.escapedText.toString();
483
- //if (/treb$/i.test(name)) {
484
- console.info({name, exported, internal, modifiers});
485
- // console.info(node);
486
- // console.info('');
487
- //}
488
- }
489
-
490
- }
491
- */
492
-
493
459
  if (ts.isModuleDeclaration(node)
494
460
  || ts.isClassDeclaration(node)
495
461
  || ts.isInterfaceDeclaration(node)
@@ -709,9 +675,12 @@ function CollectDependencyTransformer<T extends ts.Node>(
709
675
 
710
676
  }
711
677
 
712
- return ts.visitEachChild(node, child => visit(child), context);
713
- }
714
- return node => ts.visitNode(node, visit);
678
+ return ts.visitEachChild(node, visit, context);
679
+ };
680
+
681
+ return node => ts.visitEachChild(node, visit, context);
682
+
683
+
715
684
  }
716
685
  }
717
686
 
@@ -750,6 +719,7 @@ const ReadTypes = async (file: string, types?: string[], origination = 'C', dept
750
719
  for (let i = 0; i < depth; i++) { depth_prefix += ' '; }
751
720
 
752
721
  const RelativeFilePath = (key: string): string => {
722
+
753
723
  for (const prefix of Object.keys(config.map)) {
754
724
  if (key.startsWith(prefix)) { // should === ?
755
725
  const replaced = key.replace(prefix, config.map[prefix]);