@trebco/treb 31.0.2 → 31.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/treb.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /*! API v31.0. Copyright 2018-2024 trebco, llc. All rights reserved. LGPL: https://treb.app/license */
1
+ /*! API v31.1. Copyright 2018-2024 trebco, llc. All rights reserved. LGPL: https://treb.app/license */
2
2
 
3
3
  /**
4
4
  * add our tag to the map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trebco/treb",
3
- "version": "31.0.2",
3
+ "version": "31.1.3",
4
4
  "license": "LGPL-3.0-or-later",
5
5
  "homepage": "https://treb.app",
6
6
  "repository": {
@@ -19,17 +19,26 @@
19
19
  *
20
20
  */
21
21
 
22
- import type { FunctionDescriptor } from 'treb-grid';
22
+ // import type { FunctionDescriptor } from 'treb-grid';
23
23
 
24
24
  /**
25
25
  * this is similar to a function descriptor, but we need a lot less
26
26
  * information. not sure if we should composite them.
27
27
  */
28
- export interface TranslatedFunctionDescriptor extends FunctionDescriptor {
28
+ export interface TranslatedFunctionDescriptor {
29
29
 
30
30
  /** original name (name in english), so we know what to replace. */
31
31
  base: string;
32
32
 
33
+ /** name (localized) */
34
+ name: string;
35
+
36
+ /** description, if we have it. if not, show the english description? or nothing? dunno */
37
+ description?: string;
38
+
39
+ /** argument names only */
40
+ arguments?: string[];
41
+
33
42
  }
34
43
 
35
44
  export interface LanguageModel {
@@ -1230,6 +1230,8 @@ export class EmbeddedSpreadsheet<USER_DATA_TYPE = unknown> {
1230
1230
  map[entry.base.toUpperCase()] = entry;
1231
1231
  }
1232
1232
 
1233
+ // console.info({map});
1234
+
1233
1235
  list = list.map(descriptor => {
1234
1236
  const partial = map[descriptor.name.toUpperCase()];
1235
1237
 
@@ -1239,10 +1241,25 @@ export class EmbeddedSpreadsheet<USER_DATA_TYPE = unknown> {
1239
1241
  // setting function names / descriptions.
1240
1242
 
1241
1243
  if (partial) {
1242
- return {
1244
+
1245
+ const clone: FunctionDescriptor = JSON.parse(JSON.stringify({
1243
1246
  ...descriptor,
1244
- ...partial,
1245
- };
1247
+ name: partial.name,
1248
+ }));
1249
+
1250
+ if (partial.description) {
1251
+ clone.description = partial.description;
1252
+ }
1253
+ if (partial.arguments && clone.arguments) {
1254
+ for (const [index, argument] of partial.arguments.entries()) {
1255
+ if (clone.arguments[index]) {
1256
+ clone.arguments[index].name = argument;
1257
+ }
1258
+ }
1259
+ }
1260
+
1261
+ return clone;
1262
+
1246
1263
  }
1247
1264
  return descriptor;
1248
1265
  });
@@ -2028,10 +2028,12 @@ export class TileRenderer {
2028
2028
 
2029
2029
  const m2 = GetFontMetrics(fonts.base, base_font.variants);
2030
2030
 
2031
+ /*
2031
2032
  if (cell.value) {
2032
2033
  console.info(fonts.base, {m2});
2033
2034
  }
2034
-
2035
+ */
2036
+
2035
2037
  // set stroke for underline
2036
2038
 
2037
2039
  // FIXME: color here should default to style, not ''. it's working only