@arkitektio/bsx 2.1.0 → 2.2.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.
package/dist/shadcn.d.ts CHANGED
@@ -40,12 +40,12 @@ export declare const shadcnUiRenders: {
40
40
  code: "code";
41
41
  map: "map";
42
42
  filter: "filter";
43
+ x: "x";
43
44
  search: "search";
44
45
  file: "file";
45
46
  link: "link";
46
47
  check: "check";
47
48
  square: "square";
48
- x: "x";
49
49
  camera: "camera";
50
50
  grid: "grid";
51
51
  activity: "activity";
@@ -175,12 +175,12 @@ export declare const shadcnUiRenders: {
175
175
  code: "code";
176
176
  map: "map";
177
177
  filter: "filter";
178
+ x: "x";
178
179
  search: "search";
179
180
  file: "file";
180
181
  link: "link";
181
182
  check: "check";
182
183
  square: "square";
183
- x: "x";
184
184
  camera: "camera";
185
185
  grid: "grid";
186
186
  activity: "activity";
@@ -310,12 +310,12 @@ export declare const shadcnUiRenders: {
310
310
  code: "code";
311
311
  map: "map";
312
312
  filter: "filter";
313
+ x: "x";
313
314
  search: "search";
314
315
  file: "file";
315
316
  link: "link";
316
317
  check: "check";
317
318
  square: "square";
318
- x: "x";
319
319
  camera: "camera";
320
320
  grid: "grid";
321
321
  activity: "activity";
@@ -459,12 +459,12 @@ export declare const shadcnUiRenders: {
459
459
  code: "code";
460
460
  map: "map";
461
461
  filter: "filter";
462
+ x: "x";
462
463
  search: "search";
463
464
  file: "file";
464
465
  link: "link";
465
466
  check: "check";
466
467
  square: "square";
467
- x: "x";
468
468
  camera: "camera";
469
469
  grid: "grid";
470
470
  activity: "activity";
@@ -843,12 +843,12 @@ export declare const shadcnUiRenders: {
843
843
  code: "code";
844
844
  map: "map";
845
845
  filter: "filter";
846
+ x: "x";
846
847
  search: "search";
847
848
  file: "file";
848
849
  link: "link";
849
850
  check: "check";
850
851
  square: "square";
851
- x: "x";
852
852
  camera: "camera";
853
853
  grid: "grid";
854
854
  activity: "activity";
@@ -1032,12 +1032,12 @@ export declare const shadcnUiRenders: {
1032
1032
  code: "code";
1033
1033
  map: "map";
1034
1034
  filter: "filter";
1035
+ x: "x";
1035
1036
  search: "search";
1036
1037
  file: "file";
1037
1038
  link: "link";
1038
1039
  check: "check";
1039
1040
  square: "square";
1040
- x: "x";
1041
1041
  camera: "camera";
1042
1042
  grid: "grid";
1043
1043
  activity: "activity";
@@ -1169,12 +1169,12 @@ export declare const shadcnUiRenders: {
1169
1169
  code: "code";
1170
1170
  map: "map";
1171
1171
  filter: "filter";
1172
+ x: "x";
1172
1173
  search: "search";
1173
1174
  file: "file";
1174
1175
  link: "link";
1175
1176
  check: "check";
1176
1177
  square: "square";
1177
- x: "x";
1178
1178
  camera: "camera";
1179
1179
  grid: "grid";
1180
1180
  activity: "activity";
@@ -1425,12 +1425,12 @@ export declare const shadcnUiRenders: {
1425
1425
  code: "code";
1426
1426
  map: "map";
1427
1427
  filter: "filter";
1428
+ x: "x";
1428
1429
  search: "search";
1429
1430
  file: "file";
1430
1431
  link: "link";
1431
1432
  check: "check";
1432
1433
  square: "square";
1433
- x: "x";
1434
1434
  camera: "camera";
1435
1435
  grid: "grid";
1436
1436
  activity: "activity";
@@ -1668,12 +1668,12 @@ export declare const shadcnUiRenders: {
1668
1668
  code: "code";
1669
1669
  map: "map";
1670
1670
  filter: "filter";
1671
+ x: "x";
1671
1672
  search: "search";
1672
1673
  file: "file";
1673
1674
  link: "link";
1674
1675
  check: "check";
1675
1676
  square: "square";
1676
- x: "x";
1677
1677
  camera: "camera";
1678
1678
  grid: "grid";
1679
1679
  activity: "activity";
@@ -2098,12 +2098,12 @@ export declare const shadcnUiRenders: {
2098
2098
  code: "code";
2099
2099
  map: "map";
2100
2100
  filter: "filter";
2101
+ x: "x";
2101
2102
  search: "search";
2102
2103
  file: "file";
2103
2104
  link: "link";
2104
2105
  check: "check";
2105
2106
  square: "square";
2106
- x: "x";
2107
2107
  camera: "camera";
2108
2108
  grid: "grid";
2109
2109
  activity: "activity";
@@ -2288,12 +2288,12 @@ export declare const shadcnUiRenders: {
2288
2288
  code: "code";
2289
2289
  map: "map";
2290
2290
  filter: "filter";
2291
+ x: "x";
2291
2292
  search: "search";
2292
2293
  file: "file";
2293
2294
  link: "link";
2294
2295
  check: "check";
2295
2296
  square: "square";
2296
- x: "x";
2297
2297
  camera: "camera";
2298
2298
  grid: "grid";
2299
2299
  activity: "activity";
@@ -2447,12 +2447,12 @@ export declare const shadcnUiRenders: {
2447
2447
  code: "code";
2448
2448
  map: "map";
2449
2449
  filter: "filter";
2450
+ x: "x";
2450
2451
  search: "search";
2451
2452
  file: "file";
2452
2453
  link: "link";
2453
2454
  check: "check";
2454
2455
  square: "square";
2455
- x: "x";
2456
2456
  camera: "camera";
2457
2457
  grid: "grid";
2458
2458
  activity: "activity";
@@ -2611,12 +2611,12 @@ export declare const shadcnUiRenders: {
2611
2611
  code: "code";
2612
2612
  map: "map";
2613
2613
  filter: "filter";
2614
+ x: "x";
2614
2615
  search: "search";
2615
2616
  file: "file";
2616
2617
  link: "link";
2617
2618
  check: "check";
2618
2619
  square: "square";
2619
- x: "x";
2620
2620
  camera: "camera";
2621
2621
  grid: "grid";
2622
2622
  activity: "activity";
@@ -3118,12 +3118,12 @@ export declare const shadcnExtrasRenders: {
3118
3118
  code: "code";
3119
3119
  map: "map";
3120
3120
  filter: "filter";
3121
+ x: "x";
3121
3122
  search: "search";
3122
3123
  file: "file";
3123
3124
  link: "link";
3124
3125
  check: "check";
3125
3126
  square: "square";
3126
- x: "x";
3127
3127
  camera: "camera";
3128
3128
  grid: "grid";
3129
3129
  activity: "activity";
@@ -3529,12 +3529,12 @@ export declare const shadcnExtrasRenders: {
3529
3529
  code: "code";
3530
3530
  map: "map";
3531
3531
  filter: "filter";
3532
+ x: "x";
3532
3533
  search: "search";
3533
3534
  file: "file";
3534
3535
  link: "link";
3535
3536
  check: "check";
3536
3537
  square: "square";
3537
- x: "x";
3538
3538
  camera: "camera";
3539
3539
  grid: "grid";
3540
3540
  activity: "activity";
@@ -3694,12 +3694,12 @@ export declare const shadcnExtrasRenders: {
3694
3694
  code: "code";
3695
3695
  map: "map";
3696
3696
  filter: "filter";
3697
+ x: "x";
3697
3698
  search: "search";
3698
3699
  file: "file";
3699
3700
  link: "link";
3700
3701
  check: "check";
3701
3702
  square: "square";
3702
- x: "x";
3703
3703
  camera: "camera";
3704
3704
  grid: "grid";
3705
3705
  activity: "activity";
@@ -3927,12 +3927,12 @@ export declare const shadcnExtrasRenders: {
3927
3927
  code: "code";
3928
3928
  map: "map";
3929
3929
  filter: "filter";
3930
+ x: "x";
3930
3931
  search: "search";
3931
3932
  file: "file";
3932
3933
  link: "link";
3933
3934
  check: "check";
3934
3935
  square: "square";
3935
- x: "x";
3936
3936
  camera: "camera";
3937
3937
  grid: "grid";
3938
3938
  activity: "activity";
@@ -4094,12 +4094,12 @@ export declare const shadcnExtrasRenders: {
4094
4094
  code: "code";
4095
4095
  map: "map";
4096
4096
  filter: "filter";
4097
+ x: "x";
4097
4098
  search: "search";
4098
4099
  file: "file";
4099
4100
  link: "link";
4100
4101
  check: "check";
4101
4102
  square: "square";
4102
- x: "x";
4103
4103
  camera: "camera";
4104
4104
  grid: "grid";
4105
4105
  activity: "activity";
@@ -4252,12 +4252,12 @@ export declare const shadcnExtrasRenders: {
4252
4252
  code: "code";
4253
4253
  map: "map";
4254
4254
  filter: "filter";
4255
+ x: "x";
4255
4256
  search: "search";
4256
4257
  file: "file";
4257
4258
  link: "link";
4258
4259
  check: "check";
4259
4260
  square: "square";
4260
- x: "x";
4261
4261
  camera: "camera";
4262
4262
  grid: "grid";
4263
4263
  activity: "activity";
@@ -4424,12 +4424,12 @@ export declare const shadcnExtrasRenders: {
4424
4424
  code: "code";
4425
4425
  map: "map";
4426
4426
  filter: "filter";
4427
+ x: "x";
4427
4428
  search: "search";
4428
4429
  file: "file";
4429
4430
  link: "link";
4430
4431
  check: "check";
4431
4432
  square: "square";
4432
- x: "x";
4433
4433
  camera: "camera";
4434
4434
  grid: "grid";
4435
4435
  activity: "activity";
@@ -4567,12 +4567,12 @@ export declare const shadcnExtrasRenders: {
4567
4567
  code: "code";
4568
4568
  map: "map";
4569
4569
  filter: "filter";
4570
+ x: "x";
4570
4571
  search: "search";
4571
4572
  file: "file";
4572
4573
  link: "link";
4573
4574
  check: "check";
4574
4575
  square: "square";
4575
- x: "x";
4576
4576
  camera: "camera";
4577
4577
  grid: "grid";
4578
4578
  activity: "activity";
@@ -4712,12 +4712,12 @@ export declare const shadcnExtrasRenders: {
4712
4712
  code: "code";
4713
4713
  map: "map";
4714
4714
  filter: "filter";
4715
+ x: "x";
4715
4716
  search: "search";
4716
4717
  file: "file";
4717
4718
  link: "link";
4718
4719
  check: "check";
4719
4720
  square: "square";
4720
- x: "x";
4721
4721
  camera: "camera";
4722
4722
  grid: "grid";
4723
4723
  activity: "activity";
@@ -4878,12 +4878,12 @@ export declare const shadcnExtrasRenders: {
4878
4878
  code: "code";
4879
4879
  map: "map";
4880
4880
  filter: "filter";
4881
+ x: "x";
4881
4882
  search: "search";
4882
4883
  file: "file";
4883
4884
  link: "link";
4884
4885
  check: "check";
4885
4886
  square: "square";
4886
- x: "x";
4887
4887
  camera: "camera";
4888
4888
  grid: "grid";
4889
4889
  activity: "activity";
@@ -5135,12 +5135,12 @@ export declare const shadcnExtrasRenders: {
5135
5135
  code: "code";
5136
5136
  map: "map";
5137
5137
  filter: "filter";
5138
+ x: "x";
5138
5139
  search: "search";
5139
5140
  file: "file";
5140
5141
  link: "link";
5141
5142
  check: "check";
5142
5143
  square: "square";
5143
- x: "x";
5144
5144
  camera: "camera";
5145
5145
  grid: "grid";
5146
5146
  activity: "activity";
@@ -160,6 +160,7 @@
160
160
  "math.mul": {"params": [["a", "FLOAT"], ["b", "FLOAT"]], "returns": "FLOAT", "null": "null"},
161
161
  "math.div": {"params": [["a", "FLOAT"], ["b", "FLOAT"]], "returns": "FLOAT", "null": "null; division by zero is null"},
162
162
  "math.mod": {"params": [["a", "FLOAT"], ["b", "FLOAT"]], "returns": "FLOAT", "null": "null; modulo zero is null"},
163
+ "math.pow": {"params": [["a", "FLOAT"], ["b", "FLOAT"]], "returns": "FLOAT", "description": "a to the power of b.", "null": "null; a result that is not a finite number is null"},
163
164
  "math.neg": {"params": [["a", "FLOAT"]], "returns": "FLOAT", "null": "null"},
164
165
  "math.abs": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "null": "null"},
165
166
  "math.round": {"params": [["value", "FLOAT"], ["digits", "INT", false]], "returns": "FLOAT", "description": "Half away from zero, to `digits` decimals (0).", "null": "null"},
@@ -169,6 +170,32 @@
169
170
  "math.min": {"params": [["values", "LIST"]], "returns": "FLOAT", "null": "nulls are skipped; null when none is left"},
170
171
  "math.max": {"params": [["values", "LIST"]], "returns": "FLOAT", "null": "nulls are skipped; null when none is left"},
171
172
  "math.sum": {"params": [["values", "LIST"]], "returns": "FLOAT", "null": "nulls are skipped; 0 when none is left"},
173
+ "math.sqrt": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The square root.", "null": "null; a result that is not a finite number is null"},
174
+ "math.cbrt": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The cube root.", "null": "null; a result that is not a finite number is null"},
175
+ "math.exp": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "e to the power of value.", "null": "null; a result that is not a finite number is null"},
176
+ "math.log": {"params": [["value", "FLOAT"], ["base", "FLOAT", false]], "returns": "FLOAT", "description": "The logarithm to `base` (e).", "null": "null; a result that is not a finite number is null"},
177
+ "math.log2": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The base 2 logarithm.", "null": "null; a result that is not a finite number is null"},
178
+ "math.log10": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The base 10 logarithm.", "null": "null; a result that is not a finite number is null"},
179
+ "math.sin": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The sine of an angle in radians.", "null": "null; a result that is not a finite number is null"},
180
+ "math.cos": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The cosine of an angle in radians.", "null": "null; a result that is not a finite number is null"},
181
+ "math.tan": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The tangent of an angle in radians.", "null": "null; a result that is not a finite number is null"},
182
+ "math.asin": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The arcsine, in radians.", "null": "null; a result that is not a finite number is null"},
183
+ "math.acos": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The arccosine, in radians.", "null": "null; a result that is not a finite number is null"},
184
+ "math.atan": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The arctangent, in radians.", "null": "null; a result that is not a finite number is null"},
185
+ "math.atan2": {"params": [["y", "FLOAT"], ["x", "FLOAT"]], "returns": "FLOAT", "description": "The angle of the point (x, y), in radians.", "null": "null; a result that is not a finite number is null"},
186
+ "math.sinh": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The hyperbolic sine.", "null": "null; a result that is not a finite number is null"},
187
+ "math.cosh": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The hyperbolic cosine.", "null": "null; a result that is not a finite number is null"},
188
+ "math.tanh": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The hyperbolic tangent.", "null": "null; a result that is not a finite number is null"},
189
+ "math.asinh": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The inverse hyperbolic sine.", "null": "null; a result that is not a finite number is null"},
190
+ "math.acosh": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The inverse hyperbolic cosine.", "null": "null; a result that is not a finite number is null"},
191
+ "math.atanh": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The inverse hyperbolic tangent.", "null": "null; a result that is not a finite number is null"},
192
+ "math.degrees": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "Radians as degrees.", "null": "null; a result that is not a finite number is null"},
193
+ "math.radians": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "Degrees as radians.", "null": "null; a result that is not a finite number is null"},
194
+ "math.sign": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "-1, 0 or 1.", "null": "null; a result that is not a finite number is null"},
195
+ "math.trunc": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The integer part, towards zero.", "null": "null; a result that is not a finite number is null"},
196
+ "math.hypot": {"params": [["values", "LIST"]], "returns": "FLOAT", "description": "The square root of the sum of squares.", "null": "nulls are skipped; null when none is left"},
197
+ "math.pi": {"params": [], "returns": "FLOAT", "description": "The constant pi.", "null": "takes no arguments"},
198
+ "math.e": {"params": [], "returns": "FLOAT", "description": "The constant e.", "null": "takes no arguments"},
172
199
  "str.upper": {"params": [["value", "STRING"]], "returns": "STRING", "null": "null"},
173
200
  "str.lower": {"params": [["value", "STRING"]], "returns": "STRING", "null": "null"},
174
201
  "str.trim": {"params": [["value", "STRING"]], "returns": "STRING", "null": "null"},
@@ -160,6 +160,7 @@ export default {
160
160
  "math.mul": {"params": [["a", "FLOAT"], ["b", "FLOAT"]], "returns": "FLOAT", "null": "null"},
161
161
  "math.div": {"params": [["a", "FLOAT"], ["b", "FLOAT"]], "returns": "FLOAT", "null": "null; division by zero is null"},
162
162
  "math.mod": {"params": [["a", "FLOAT"], ["b", "FLOAT"]], "returns": "FLOAT", "null": "null; modulo zero is null"},
163
+ "math.pow": {"params": [["a", "FLOAT"], ["b", "FLOAT"]], "returns": "FLOAT", "description": "a to the power of b.", "null": "null; a result that is not a finite number is null"},
163
164
  "math.neg": {"params": [["a", "FLOAT"]], "returns": "FLOAT", "null": "null"},
164
165
  "math.abs": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "null": "null"},
165
166
  "math.round": {"params": [["value", "FLOAT"], ["digits", "INT", false]], "returns": "FLOAT", "description": "Half away from zero, to `digits` decimals (0).", "null": "null"},
@@ -169,6 +170,32 @@ export default {
169
170
  "math.min": {"params": [["values", "LIST"]], "returns": "FLOAT", "null": "nulls are skipped; null when none is left"},
170
171
  "math.max": {"params": [["values", "LIST"]], "returns": "FLOAT", "null": "nulls are skipped; null when none is left"},
171
172
  "math.sum": {"params": [["values", "LIST"]], "returns": "FLOAT", "null": "nulls are skipped; 0 when none is left"},
173
+ "math.sqrt": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The square root.", "null": "null; a result that is not a finite number is null"},
174
+ "math.cbrt": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The cube root.", "null": "null; a result that is not a finite number is null"},
175
+ "math.exp": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "e to the power of value.", "null": "null; a result that is not a finite number is null"},
176
+ "math.log": {"params": [["value", "FLOAT"], ["base", "FLOAT", false]], "returns": "FLOAT", "description": "The logarithm to `base` (e).", "null": "null; a result that is not a finite number is null"},
177
+ "math.log2": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The base 2 logarithm.", "null": "null; a result that is not a finite number is null"},
178
+ "math.log10": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The base 10 logarithm.", "null": "null; a result that is not a finite number is null"},
179
+ "math.sin": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The sine of an angle in radians.", "null": "null; a result that is not a finite number is null"},
180
+ "math.cos": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The cosine of an angle in radians.", "null": "null; a result that is not a finite number is null"},
181
+ "math.tan": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The tangent of an angle in radians.", "null": "null; a result that is not a finite number is null"},
182
+ "math.asin": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The arcsine, in radians.", "null": "null; a result that is not a finite number is null"},
183
+ "math.acos": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The arccosine, in radians.", "null": "null; a result that is not a finite number is null"},
184
+ "math.atan": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The arctangent, in radians.", "null": "null; a result that is not a finite number is null"},
185
+ "math.atan2": {"params": [["y", "FLOAT"], ["x", "FLOAT"]], "returns": "FLOAT", "description": "The angle of the point (x, y), in radians.", "null": "null; a result that is not a finite number is null"},
186
+ "math.sinh": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The hyperbolic sine.", "null": "null; a result that is not a finite number is null"},
187
+ "math.cosh": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The hyperbolic cosine.", "null": "null; a result that is not a finite number is null"},
188
+ "math.tanh": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The hyperbolic tangent.", "null": "null; a result that is not a finite number is null"},
189
+ "math.asinh": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The inverse hyperbolic sine.", "null": "null; a result that is not a finite number is null"},
190
+ "math.acosh": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The inverse hyperbolic cosine.", "null": "null; a result that is not a finite number is null"},
191
+ "math.atanh": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The inverse hyperbolic tangent.", "null": "null; a result that is not a finite number is null"},
192
+ "math.degrees": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "Radians as degrees.", "null": "null; a result that is not a finite number is null"},
193
+ "math.radians": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "Degrees as radians.", "null": "null; a result that is not a finite number is null"},
194
+ "math.sign": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "-1, 0 or 1.", "null": "null; a result that is not a finite number is null"},
195
+ "math.trunc": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The integer part, towards zero.", "null": "null; a result that is not a finite number is null"},
196
+ "math.hypot": {"params": [["values", "LIST"]], "returns": "FLOAT", "description": "The square root of the sum of squares.", "null": "nulls are skipped; null when none is left"},
197
+ "math.pi": {"params": [], "returns": "FLOAT", "description": "The constant pi.", "null": "takes no arguments"},
198
+ "math.e": {"params": [], "returns": "FLOAT", "description": "The constant e.", "null": "takes no arguments"},
172
199
  "str.upper": {"params": [["value", "STRING"]], "returns": "STRING", "null": "null"},
173
200
  "str.lower": {"params": [["value", "STRING"]], "returns": "STRING", "null": "null"},
174
201
  "str.trim": {"params": [["value", "STRING"]], "returns": "STRING", "null": "null"},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkitektio/bsx",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "The BSX language, the blok spec, runtime and React renderer: one copy for every Arkitekt frontend.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -18,7 +18,7 @@ describe('coverage', () => {
18
18
  it('implements every pure vocabulary function, and nothing else', () => {
19
19
  const declared = [...loadVocabulary().functions.values()].filter(fn => !fn.effect).map(fn => fn.name).sort();
20
20
  expect([...v2Functions.keys()].sort()).toEqual(declared);
21
- expect(declared).toHaveLength(80);
21
+ expect(declared).toHaveLength(107);
22
22
  expect(undeclaredImplementations()).toEqual([]);
23
23
  });
24
24
 
@@ -53,6 +53,37 @@ describe('the null table', () => {
53
53
  ['math.div', {a: 1, b: 0}, null],
54
54
  ['math.div', {a: null, b: 2}, null],
55
55
  ['math.mod', {a: 1, b: 0}, null],
56
+ ['math.pow', {a: null, b: 2}, null],
57
+ ['math.pow', {a: -8, b: 0.5}, null],
58
+ ['math.pow', {a: 10, b: 400}, null],
59
+ ['math.sqrt', {value: -1}, null],
60
+ ['math.cbrt', {value: null}, null],
61
+ ['math.exp', {value: 1000}, null],
62
+ ['math.log', {value: 0}, null],
63
+ ['math.log', {value: null}, null],
64
+ ['math.log', {value: 8, base: 1}, null],
65
+ ['math.log2', {value: -1}, null],
66
+ ['math.log10', {value: 0}, null],
67
+ ['math.sin', {value: null}, null],
68
+ ['math.cos', {value: null}, null],
69
+ ['math.tan', {value: null}, null],
70
+ ['math.asin', {value: 2}, null],
71
+ ['math.acos', {value: 2}, null],
72
+ ['math.atan', {value: null}, null],
73
+ ['math.atan2', {y: null, x: 1}, null],
74
+ ['math.sinh', {value: 1000}, null],
75
+ ['math.cosh', {value: 1000}, null],
76
+ ['math.tanh', {value: null}, null],
77
+ ['math.asinh', {value: null}, null],
78
+ ['math.acosh', {value: 0}, null],
79
+ ['math.atanh', {value: 1}, null],
80
+ ['math.degrees', {value: null}, null],
81
+ ['math.radians', {value: null}, null],
82
+ ['math.sign', {value: null}, null],
83
+ ['math.trunc', {value: null}, null],
84
+ ['math.hypot', {values: []}, null],
85
+ ['math.pi', {}, Math.PI],
86
+ ['math.e', {}, Math.E],
56
87
  ['math.neg', {a: null}, null],
57
88
  ['math.abs', {value: null}, null],
58
89
  ['math.round', {value: null}, null],
@@ -160,6 +191,34 @@ describe('semantics', () => {
160
191
  expect(call('math.clamp', {value: 12, min: 0, max: 10})).toBe(10);
161
192
  expect(call('math.max', {values: [1, 7, 3]})).toBe(7);
162
193
  expect(call('math.mod', {a: 7, b: 3})).toBe(1);
194
+ expect(call('math.pow', {a: 2, b: 10})).toBe(1024);
195
+ expect(call('math.sqrt', {value: 9})).toBe(3);
196
+ expect(call('math.cbrt', {value: 27})).toBe(3);
197
+ expect(call('math.exp', {value: 0})).toBe(1);
198
+ expect(call('math.log', {value: Math.E})).toBe(1);
199
+ expect(call('math.log', {value: 8, base: 2})).toBeCloseTo(3);
200
+ expect(call('math.log2', {value: 8})).toBe(3);
201
+ expect(call('math.log10', {value: 1000})).toBe(3);
202
+ expect(call('math.sin', {value: 0})).toBe(0);
203
+ expect(call('math.cos', {value: 0})).toBe(1);
204
+ expect(call('math.tan', {value: 0})).toBe(0);
205
+ expect(call('math.asin', {value: 1})).toBeCloseTo(Math.PI / 2);
206
+ expect(call('math.acos', {value: 1})).toBe(0);
207
+ expect(call('math.atan', {value: 1})).toBeCloseTo(Math.PI / 4);
208
+ expect(call('math.atan2', {y: 1, x: 1})).toBeCloseTo(Math.PI / 4);
209
+ expect(call('math.sinh', {value: 0})).toBe(0);
210
+ expect(call('math.cosh', {value: 0})).toBe(1);
211
+ expect(call('math.tanh', {value: 0})).toBe(0);
212
+ expect(call('math.asinh', {value: 0})).toBe(0);
213
+ expect(call('math.acosh', {value: 1})).toBe(0);
214
+ expect(call('math.atanh', {value: 0})).toBe(0);
215
+ expect(call('math.degrees', {value: Math.PI})).toBe(180);
216
+ expect(call('math.radians', {value: 180})).toBe(Math.PI);
217
+ expect(call('math.sign', {value: -3})).toBe(-1);
218
+ expect(call('math.trunc', {value: -1.5})).toBe(-1);
219
+ expect(call('math.hypot', {values: [3, 4]})).toBe(5);
220
+ expect(call('math.pi', {})).toBe(Math.PI);
221
+ expect(call('math.e', {})).toBe(Math.E);
163
222
  });
164
223
 
165
224
  it('works on strings', () => {
@@ -259,6 +259,14 @@ const mathUnary =
259
259
  return value === null ? null : operate(value);
260
260
  };
261
261
 
262
+ /** The classic functions: what is not a finite number (`sqrt(-1)`, `log(0)`) is null. */
263
+ const finite = (value: number): number | null => (Number.isFinite(value) ? value : null);
264
+
265
+ const mathReal = (operate: (value: number) => number): Impl => args => {
266
+ const value = num(args.value);
267
+ return value === null ? null : finite(operate(value));
268
+ };
269
+
262
270
  const strUnary =
263
271
  (operate: (value: string) => unknown): Impl =>
264
272
  args => {
@@ -333,6 +341,7 @@ const IMPLEMENTATIONS: Readonly<Partial<Record<string, Impl>>> = {
333
341
  'math.mul': mathBinary((a, b) => a * b),
334
342
  'math.div': mathBinary((a, b) => (b === 0 ? null : a / b)),
335
343
  'math.mod': mathBinary((a, b) => (b === 0 ? null : a % b)),
344
+ 'math.pow': mathBinary((a, b) => finite(a ** b)),
336
345
  'math.neg': mathUnary('a', value => -value || 0),
337
346
  'math.abs': mathUnary('value', Math.abs),
338
347
  'math.round': args => {
@@ -356,6 +365,45 @@ const IMPLEMENTATIONS: Readonly<Partial<Record<string, Impl>>> = {
356
365
  return values.length ? Math.max(...values) : null;
357
366
  },
358
367
  'math.sum': args => numbers(args.values).reduce((total, value) => total + value, 0),
368
+ 'math.sqrt': mathReal(Math.sqrt),
369
+ 'math.cbrt': mathReal(Math.cbrt),
370
+ 'math.exp': mathReal(Math.exp),
371
+ 'math.log': args => {
372
+ const value = num(args.value);
373
+ if (value === null) return null;
374
+ if (args.base === null || args.base === undefined) return finite(Math.log(value));
375
+ const base = num(args.base);
376
+ return base === null ? null : finite(Math.log(value) / Math.log(base));
377
+ },
378
+ 'math.log2': mathReal(Math.log2),
379
+ 'math.log10': mathReal(Math.log10),
380
+ 'math.sin': mathReal(Math.sin),
381
+ 'math.cos': mathReal(Math.cos),
382
+ 'math.tan': mathReal(Math.tan),
383
+ 'math.asin': mathReal(Math.asin),
384
+ 'math.acos': mathReal(Math.acos),
385
+ 'math.atan': mathReal(Math.atan),
386
+ 'math.atan2': args => {
387
+ const y = num(args.y);
388
+ const x = num(args.x);
389
+ return y === null || x === null ? null : finite(Math.atan2(y, x));
390
+ },
391
+ 'math.sinh': mathReal(Math.sinh),
392
+ 'math.cosh': mathReal(Math.cosh),
393
+ 'math.tanh': mathReal(Math.tanh),
394
+ 'math.asinh': mathReal(Math.asinh),
395
+ 'math.acosh': mathReal(Math.acosh),
396
+ 'math.atanh': mathReal(Math.atanh),
397
+ 'math.degrees': mathReal(value => (value * 180) / Math.PI),
398
+ 'math.radians': mathReal(value => (value * Math.PI) / 180),
399
+ 'math.sign': mathReal(value => Math.sign(value) || 0),
400
+ 'math.trunc': mathReal(value => Math.trunc(value) || 0),
401
+ 'math.hypot': args => {
402
+ const values = numbers(args.values);
403
+ return values.length ? finite(Math.hypot(...values)) : null;
404
+ },
405
+ 'math.pi': () => Math.PI,
406
+ 'math.e': () => Math.E,
359
407
 
360
408
  // str
361
409
  'str.upper': strUnary(value => value.toUpperCase()),
@@ -160,6 +160,7 @@
160
160
  "math.mul": {"params": [["a", "FLOAT"], ["b", "FLOAT"]], "returns": "FLOAT", "null": "null"},
161
161
  "math.div": {"params": [["a", "FLOAT"], ["b", "FLOAT"]], "returns": "FLOAT", "null": "null; division by zero is null"},
162
162
  "math.mod": {"params": [["a", "FLOAT"], ["b", "FLOAT"]], "returns": "FLOAT", "null": "null; modulo zero is null"},
163
+ "math.pow": {"params": [["a", "FLOAT"], ["b", "FLOAT"]], "returns": "FLOAT", "description": "a to the power of b.", "null": "null; a result that is not a finite number is null"},
163
164
  "math.neg": {"params": [["a", "FLOAT"]], "returns": "FLOAT", "null": "null"},
164
165
  "math.abs": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "null": "null"},
165
166
  "math.round": {"params": [["value", "FLOAT"], ["digits", "INT", false]], "returns": "FLOAT", "description": "Half away from zero, to `digits` decimals (0).", "null": "null"},
@@ -169,6 +170,32 @@
169
170
  "math.min": {"params": [["values", "LIST"]], "returns": "FLOAT", "null": "nulls are skipped; null when none is left"},
170
171
  "math.max": {"params": [["values", "LIST"]], "returns": "FLOAT", "null": "nulls are skipped; null when none is left"},
171
172
  "math.sum": {"params": [["values", "LIST"]], "returns": "FLOAT", "null": "nulls are skipped; 0 when none is left"},
173
+ "math.sqrt": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The square root.", "null": "null; a result that is not a finite number is null"},
174
+ "math.cbrt": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The cube root.", "null": "null; a result that is not a finite number is null"},
175
+ "math.exp": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "e to the power of value.", "null": "null; a result that is not a finite number is null"},
176
+ "math.log": {"params": [["value", "FLOAT"], ["base", "FLOAT", false]], "returns": "FLOAT", "description": "The logarithm to `base` (e).", "null": "null; a result that is not a finite number is null"},
177
+ "math.log2": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The base 2 logarithm.", "null": "null; a result that is not a finite number is null"},
178
+ "math.log10": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The base 10 logarithm.", "null": "null; a result that is not a finite number is null"},
179
+ "math.sin": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The sine of an angle in radians.", "null": "null; a result that is not a finite number is null"},
180
+ "math.cos": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The cosine of an angle in radians.", "null": "null; a result that is not a finite number is null"},
181
+ "math.tan": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The tangent of an angle in radians.", "null": "null; a result that is not a finite number is null"},
182
+ "math.asin": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The arcsine, in radians.", "null": "null; a result that is not a finite number is null"},
183
+ "math.acos": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The arccosine, in radians.", "null": "null; a result that is not a finite number is null"},
184
+ "math.atan": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The arctangent, in radians.", "null": "null; a result that is not a finite number is null"},
185
+ "math.atan2": {"params": [["y", "FLOAT"], ["x", "FLOAT"]], "returns": "FLOAT", "description": "The angle of the point (x, y), in radians.", "null": "null; a result that is not a finite number is null"},
186
+ "math.sinh": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The hyperbolic sine.", "null": "null; a result that is not a finite number is null"},
187
+ "math.cosh": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The hyperbolic cosine.", "null": "null; a result that is not a finite number is null"},
188
+ "math.tanh": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The hyperbolic tangent.", "null": "null; a result that is not a finite number is null"},
189
+ "math.asinh": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The inverse hyperbolic sine.", "null": "null; a result that is not a finite number is null"},
190
+ "math.acosh": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The inverse hyperbolic cosine.", "null": "null; a result that is not a finite number is null"},
191
+ "math.atanh": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The inverse hyperbolic tangent.", "null": "null; a result that is not a finite number is null"},
192
+ "math.degrees": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "Radians as degrees.", "null": "null; a result that is not a finite number is null"},
193
+ "math.radians": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "Degrees as radians.", "null": "null; a result that is not a finite number is null"},
194
+ "math.sign": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "-1, 0 or 1.", "null": "null; a result that is not a finite number is null"},
195
+ "math.trunc": {"params": [["value", "FLOAT"]], "returns": "FLOAT", "description": "The integer part, towards zero.", "null": "null; a result that is not a finite number is null"},
196
+ "math.hypot": {"params": [["values", "LIST"]], "returns": "FLOAT", "description": "The square root of the sum of squares.", "null": "nulls are skipped; null when none is left"},
197
+ "math.pi": {"params": [], "returns": "FLOAT", "description": "The constant pi.", "null": "takes no arguments"},
198
+ "math.e": {"params": [], "returns": "FLOAT", "description": "The constant e.", "null": "takes no arguments"},
172
199
  "str.upper": {"params": [["value", "STRING"]], "returns": "STRING", "null": "null"},
173
200
  "str.lower": {"params": [["value", "STRING"]], "returns": "STRING", "null": "null"},
174
201
  "str.trim": {"params": [["value", "STRING"]], "returns": "STRING", "null": "null"},