@nordcraft/std-lib 1.0.37 → 1.0.39

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/lib.ts CHANGED
@@ -1,196 +1,257 @@
1
1
 
2
2
  export const formulas = {
3
- "@toddle/not": {
3
+ "@toddle/dateFromString": {
4
4
  "$schema": "../../schemas/libFormula.schema.json",
5
- "name": "Not",
6
- "description": "Get the Boolean opposite of an input value.",
5
+ "name": "Date From String",
7
6
  "arguments": [
8
7
  {
9
- "name": "Input",
8
+ "name": "Date string",
9
+ "description": "A String representing a date, for example \"January 1, 1970\".",
10
+ "type": {
11
+ "type": "String"
12
+ },
10
13
  "formula": {
11
14
  "type": "value",
12
- "value": true
13
- },
14
- "description": "The input value.",
15
- "type": {
16
- "type": "Boolean"
15
+ "value": "January 1, 1970"
17
16
  }
18
17
  }
19
18
  ],
19
+ "description": "Convert a string to a Date.",
20
20
  "output": {
21
- "description": "Returns True if the input value is False, and False if the input value is True.",
21
+ "description": "The input value converted to a Date.",
22
22
  "type": {
23
- "type": "Boolean"
23
+ "type": "Date"
24
24
  }
25
25
  }
26
26
  },
27
- "@toddle/trim": {
27
+ "@toddle/randomNumber": {
28
28
  "$schema": "../../schemas/libFormula.schema.json",
29
- "name": "Trim",
30
- "description": "Remove any leading and trailing white spaces from a String.",
29
+ "name": "Random number",
30
+ "description": "return a random Number between 0 and 1.",
31
+ "arguments": [],
32
+ "cache": false,
33
+ "output": {
34
+ "description": "A random Number between 0 and 1.",
35
+ "type": {
36
+ "type": "Number"
37
+ }
38
+ }
39
+ },
40
+ "@toddle/encodeBase64": {
41
+ "$schema": "../../schemas/libFormula.schema.json",
42
+ "name": "Encode to base64",
31
43
  "arguments": [
32
44
  {
33
- "name": "String",
45
+ "name": "Value",
34
46
  "formula": {
35
47
  "type": "value",
36
- "value": ""
48
+ "value": "Input value"
37
49
  },
38
- "description": "The String to trim.",
39
50
  "type": {
40
51
  "type": "String"
41
- }
52
+ },
53
+ "description": "The input string to be encoded."
42
54
  }
43
55
  ],
56
+ "description": "Encode a string to base64.",
44
57
  "output": {
45
- "description": "The trimmed String.",
58
+ "description": "The base 64 encoded string.",
46
59
  "type": {
47
60
  "type": "String"
48
61
  }
49
62
  }
50
63
  },
51
- "@toddle/lowercase": {
64
+ "@toddle/getHttpOnlyCookie": {
52
65
  "$schema": "../../schemas/libFormula.schema.json",
53
- "name": "Lower case",
54
- "description": "Convert a string to lowercase.",
66
+ "name": "Get Http-Only Cookie",
67
+ "description": "Get the value of an Http-Only cookie by name. This formula will is only intended to be used server-side for SSR/proxied API requests to read Http-Only cookies.",
55
68
  "arguments": [
56
69
  {
57
- "name": "String",
70
+ "name": "Cookie name",
58
71
  "formula": {
59
72
  "type": "value",
60
- "value": "string"
73
+ "value": null
61
74
  },
62
- "description": "Input String",
75
+ "description": "The name of the Http-Only cookie you want to get the value of.",
63
76
  "type": {
64
77
  "type": "String"
65
78
  }
66
79
  }
67
80
  ],
68
81
  "output": {
69
- "description": "The input String with all characters converted to lowercase.",
82
+ "description": "The value of the cookie. If no cookie is found, this will return Null. If you use this formula client-side, it will return a placeholder template string.",
70
83
  "type": {
71
84
  "type": "String"
72
85
  }
73
86
  }
74
87
  },
75
- "@toddle/concatenate": {
88
+ "@toddle/parseJSON": {
76
89
  "$schema": "../../schemas/libFormula.schema.json",
77
- "name": "Concatenate",
78
- "description": "Concatenate two or more values.",
90
+ "name": "Parse JSON",
91
+ "description": "Parse a String to JSON.",
79
92
  "arguments": [
80
93
  {
81
- "name": "0",
94
+ "name": "JSON string",
82
95
  "formula": {
83
96
  "type": "value",
84
- "value": ""
97
+ "value": null
85
98
  },
99
+ "description": "The String to be parsed.",
86
100
  "type": {
87
- "type": "Array \\| String"
101
+ "type": "String"
88
102
  }
89
103
  }
90
104
  ],
91
- "variableArguments": true,
92
105
  "output": {
106
+ "description": "The parsed JSON value. If the input is not a valid String, this returns Null.",
93
107
  "type": {
94
- "type": "Array \\| String"
95
- },
96
- "description": "Returns a String or Array containing all the specified input values."
108
+ "type": "Any"
109
+ }
97
110
  }
98
111
  },
99
- "@toddle/timestamp": {
112
+ "@toddle/append": {
100
113
  "$schema": "../../schemas/libFormula.schema.json",
101
- "name": "Timestamp",
102
- "description": "Get the timestamp from a Date, e.g. 1633462980000.",
114
+ "name": "Append",
115
+ "description": "Add an element to the end of an Array.",
103
116
  "arguments": [
104
117
  {
105
- "name": "Date",
106
- "description": "The date to get the timestamp from.",
118
+ "name": "Array",
107
119
  "type": {
108
- "type": "Date"
120
+ "type": "Array"
109
121
  },
122
+ "description": "The Array to append to.",
123
+ "formula": {
124
+ "type": "array",
125
+ "arguments": []
126
+ }
127
+ },
128
+ {
129
+ "name": "Item",
130
+ "type": {
131
+ "type": "Any"
132
+ },
133
+ "description": "The item to append to the Array.",
110
134
  "formula": {
111
135
  "type": "value",
112
- "value": null
136
+ "value": "Item"
113
137
  }
114
138
  }
115
139
  ],
116
140
  "output": {
117
- "description": "The timestamp from the date input.",
141
+ "description": "A new Array containing all elements from the input Array, including the new item.",
118
142
  "type": {
119
- "type": "Number"
143
+ "type": "Array"
120
144
  }
121
145
  }
122
146
  },
123
- "@toddle/indexOf": {
147
+ "@toddle/dropLast": {
124
148
  "$schema": "../../schemas/libFormula.schema.json",
125
- "name": "Index of",
126
- "description": "Find the index of a specific item in an Array or String.",
149
+ "name": "Drop last",
150
+ "description": "Remove item(s) from the end of an Array or String.",
127
151
  "arguments": [
128
152
  {
129
153
  "name": "Array",
130
154
  "formula": {
131
155
  "type": "value",
132
- "value": ""
156
+ "value": null
133
157
  },
134
- "description": "The value to search.",
158
+ "description": "The input value.",
135
159
  "type": {
136
160
  "type": "Array \\| String"
137
161
  }
138
162
  },
139
163
  {
140
- "name": "Item",
164
+ "name": "Count",
141
165
  "formula": {
142
166
  "type": "value",
143
- "value": ""
167
+ "value": 1
144
168
  },
145
- "description": "The items to search for.",
146
169
  "type": {
147
- "type": "Any"
148
- }
170
+ "type": "Number"
171
+ },
172
+ "description": "Number of items to remove."
149
173
  }
150
174
  ],
151
175
  "output": {
152
- "description": "If the item exists in the Array, the index of that item is returned. If the item is not found, -1 is returned.",
176
+ "description": "A copy of the list without the last item(s).",
153
177
  "type": {
154
- "type": "Number"
178
+ "type": "Array \\| String"
155
179
  }
156
180
  }
157
181
  },
158
- "@toddle/squareRoot": {
182
+ "@toddle/sort_by": {
159
183
  "$schema": "../../schemas/libFormula.schema.json",
160
- "name": "Square root",
161
- "description": "Get the square root of a Number.",
184
+ "name": "Sort by",
185
+ "description": "Sort an Array using a formula.",
162
186
  "arguments": [
163
187
  {
164
- "name": "Number",
188
+ "name": "Array",
165
189
  "formula": {
166
190
  "type": "value",
167
- "value": 1
191
+ "value": []
168
192
  },
169
- "description": "The input Number.",
170
193
  "type": {
171
- "type": "Number"
172
- }
194
+ "type": "Array"
195
+ },
196
+ "description": "The input Array."
197
+ },
198
+ {
199
+ "name": "Formula",
200
+ "formula": {
201
+ "type": "path",
202
+ "path": [
203
+ "Args",
204
+ "item"
205
+ ]
206
+ },
207
+ "type": {
208
+ "type": "Formula"
209
+ },
210
+ "isFunction": true,
211
+ "description": "The sorting formula. The output of this formula will determine the sort order of the items. If the formula returns an Array, the items will first be sorted by the first item, then the second, etc."
212
+ },
213
+ {
214
+ "name": "Ascending?",
215
+ "formula": {
216
+ "type": "value",
217
+ "value": true
218
+ },
219
+ "type": {
220
+ "type": "Boolean"
221
+ },
222
+ "description": "Should the list be sorted in ascending order?"
173
223
  }
174
224
  ],
175
225
  "output": {
176
- "description": "The square root of the input Number.",
226
+ "description": "The input Array sorted by the value returned by the sorting formula.",
177
227
  "type": {
178
228
  "type": "Number"
179
229
  }
180
230
  }
181
231
  },
182
- "@toddle/logarithm": {
232
+ "@toddle/power": {
183
233
  "$schema": "../../schemas/libFormula.schema.json",
184
- "name": "Logarithm",
185
- "description": "Return the logarithm of a Number.",
234
+ "name": "Power",
235
+ "description": "Raise a number to a power.",
186
236
  "arguments": [
187
237
  {
188
- "name": "Number",
238
+ "name": "Base",
189
239
  "formula": {
190
240
  "type": "value",
191
- "value": 1
241
+ "value": 3
192
242
  },
193
- "description": "A Number greater than or equal to 0.",
243
+ "description": "The number to be raised to the exponent.",
244
+ "type": {
245
+ "type": "Number"
246
+ }
247
+ },
248
+ {
249
+ "name": "Exponent",
250
+ "formula": {
251
+ "type": "value",
252
+ "value": 2
253
+ },
254
+ "description": "The exponent to raise the base to.",
194
255
  "type": {
195
256
  "type": "Number"
196
257
  }
@@ -200,574 +261,704 @@
200
261
  "type": {
201
262
  "type": "Number"
202
263
  },
203
- "description": "The natural logarithm of the Number."
264
+ "description": "The result of raising the base to the exponent."
204
265
  }
205
266
  },
206
- "@toddle/range": {
267
+ "@toddle/notEqual": {
207
268
  "$schema": "../../schemas/libFormula.schema.json",
208
- "name": "Range",
209
- "description": "Create an Array of numbers between a Min and Max value.",
269
+ "name": "Not equal",
270
+ "description": "Compute if values are not identical.",
210
271
  "arguments": [
211
272
  {
273
+ "name": "First",
212
274
  "formula": {
213
275
  "type": "value",
214
- "value": 0
276
+ "value": ""
215
277
  },
216
- "name": "Min",
217
- "description": "The smallest value in the list.",
278
+ "description": "First value.",
218
279
  "type": {
219
- "type": "Number"
280
+ "type": "Any"
220
281
  }
221
282
  },
222
283
  {
223
- "name": "Max",
284
+ "name": "Second",
224
285
  "formula": {
225
286
  "type": "value",
226
- "value": 10
287
+ "value": ""
227
288
  },
228
- "description": "The largest value in the list.",
289
+ "description": "Second value.",
229
290
  "type": {
230
- "type": "Number"
291
+ "type": "Any"
231
292
  }
232
293
  }
233
294
  ],
234
295
  "output": {
235
- "description": "An Array containing all the numbers between Min and Max, inclusive.",
296
+ "description": "Returns True if the values are not identical, otherwise False.",
236
297
  "type": {
237
- "type": "Array"
298
+ "type": "Any"
238
299
  }
239
300
  }
240
301
  },
241
- "@toddle/size": {
302
+ "@toddle/concatenate": {
242
303
  "$schema": "../../schemas/libFormula.schema.json",
243
- "name": "Size",
244
- "description": "Get the size of an Array, Object or String.",
304
+ "name": "Concatenate",
305
+ "description": "Concatenate two or more values.",
245
306
  "arguments": [
246
307
  {
247
- "name": "Collection",
308
+ "name": "0",
248
309
  "formula": {
249
310
  "type": "value",
250
- "value": [
251
- 1,
252
- 2,
253
- 3
254
- ]
311
+ "value": ""
255
312
  },
256
- "description": "The collection to get the size of.",
257
313
  "type": {
258
- "type": "Array \\| Object \\| String"
314
+ "type": "Array \\| String"
259
315
  }
260
316
  }
261
317
  ],
318
+ "variableArguments": true,
262
319
  "output": {
263
- "description": "The size of the collection.",
264
320
  "type": {
265
- "type": "Number"
266
- }
267
- }
268
- },
269
- "@toddle/matches": {
321
+ "type": "Array \\| String"
322
+ },
323
+ "description": "Returns a String or Array containing all the specified input values."
324
+ }
325
+ },
326
+ "@toddle/timestamp": {
270
327
  "$schema": "../../schemas/libFormula.schema.json",
271
- "name": "Matches",
272
- "description": "Finds the (global) matches in a String based on a regular expression.",
328
+ "name": "Timestamp",
329
+ "description": "Get the timestamp from a Date, e.g. 1633462980000.",
273
330
  "arguments": [
274
331
  {
275
- "name": "Input",
332
+ "name": "Date",
333
+ "description": "The date to get the timestamp from.",
334
+ "type": {
335
+ "type": "Date"
336
+ },
337
+ "formula": {
338
+ "type": "value",
339
+ "value": null
340
+ }
341
+ }
342
+ ],
343
+ "output": {
344
+ "description": "The timestamp from the date input.",
345
+ "type": {
346
+ "type": "Number"
347
+ }
348
+ }
349
+ },
350
+ "@toddle/includes": {
351
+ "$schema": "../../schemas/libFormula.schema.json",
352
+ "name": "Includes",
353
+ "description": "Test if an Array or String includes a specific item or value.",
354
+ "arguments": [
355
+ {
356
+ "name": "Array",
276
357
  "formula": {
277
358
  "type": "value",
278
359
  "value": ""
279
360
  },
280
- "description": "The string to search for matches in.",
361
+ "description": "The value to search.",
281
362
  "type": {
282
- "type": "String"
363
+ "type": "Array \\| String"
283
364
  }
284
365
  },
285
366
  {
286
- "name": "Regular expression",
367
+ "name": "Item",
287
368
  "formula": {
288
369
  "type": "value",
289
370
  "value": ""
290
371
  },
291
- "description": "The regular expression to use for matching.",
372
+ "description": "The item or value to search for.",
292
373
  "type": {
293
- "type": "String"
374
+ "type": "Any"
294
375
  }
295
- },
376
+ }
377
+ ],
378
+ "output": {
379
+ "description": "Returns True if the item or value exists in the Array or string. Returns False if no match is found.",
380
+ "type": {
381
+ "type": "Boolean"
382
+ }
383
+ }
384
+ },
385
+ "@toddle/number": {
386
+ "$schema": "../../schemas/libFormula.schema.json",
387
+ "name": "Number",
388
+ "description": "Convert a value of any type to a Number.",
389
+ "arguments": [
296
390
  {
297
- "name": "Global search",
391
+ "name": "Input",
392
+ "description": "Value of any type",
393
+ "type": {
394
+ "type": "Any"
395
+ },
298
396
  "formula": {
299
397
  "type": "value",
300
- "value": true
301
- },
302
- "description": "Test the regular expression against all possible matches in a string.",
303
- "type": {
304
- "type": "Boolean"
398
+ "value": "1"
305
399
  }
306
- },
400
+ }
401
+ ],
402
+ "output": {
403
+ "description": "The input value converted to a Number.",
404
+ "type": {
405
+ "type": "Number"
406
+ }
407
+ }
408
+ },
409
+ "@toddle/greaterOrEqueal": {
410
+ "$schema": "../../schemas/libFormula.schema.json",
411
+ "name": "Greater or equal",
412
+ "description": "Compute whether a value is larger than or equal to another value.",
413
+ "arguments": [
307
414
  {
308
- "name": "Case insensitive",
415
+ "name": "First",
309
416
  "formula": {
310
417
  "type": "value",
311
- "value": false
418
+ "value": ""
312
419
  },
313
- "description": "Ignore case while attempting a match in a string.",
420
+ "description": "First value to be compared.",
314
421
  "type": {
315
- "type": "Boolean"
422
+ "type": "Number"
316
423
  }
317
424
  },
318
425
  {
319
- "name": "Multi line",
426
+ "name": "Second",
320
427
  "formula": {
321
428
  "type": "value",
322
- "value": false
429
+ "value": ""
323
430
  },
324
- "description": "Treat multiline strings as multiple lines.",
431
+ "description": "Second value to be compared.",
325
432
  "type": {
326
- "type": "Boolean"
433
+ "type": "Number"
327
434
  }
328
435
  }
329
436
  ],
330
437
  "output": {
331
- "description": "An Array of Strings",
438
+ "description": "Returns True if the first Number is larger than or equal to the second Number.",
332
439
  "type": {
333
- "type": "Array"
440
+ "type": "Boolean"
334
441
  }
335
442
  }
336
443
  },
337
- "@toddle/now": {
444
+ "@toddle/dateFromTimestamp": {
338
445
  "$schema": "../../schemas/libFormula.schema.json",
339
- "name": "Now",
340
- "description": "Get a Date representing \"Now\"",
341
- "arguments": [],
342
- "cache": false,
446
+ "name": "Date From Timestamp",
447
+ "arguments": [
448
+ {
449
+ "name": "Timestamp",
450
+ "description": "A Number in milliseconds since 1st January, 1970 (EPOCH).",
451
+ "type": {
452
+ "type": "Number"
453
+ },
454
+ "formula": {
455
+ "type": "value",
456
+ "value": 1687787245933
457
+ }
458
+ }
459
+ ],
460
+ "description": "Convert a timestamp (milliseconds) to a Date.",
343
461
  "output": {
344
- "description": "A Date object initialized at the current date/time.",
462
+ "description": "The input value converted to a Date.",
345
463
  "type": {
346
464
  "type": "Date"
347
465
  }
348
466
  }
349
467
  },
350
- "@toddle/roundDown": {
468
+ "@toddle/getFromLocalStorage": {
351
469
  "$schema": "../../schemas/libFormula.schema.json",
352
- "name": "Round down",
353
- "description": "Round a Number down to the nearest decimal point.",
470
+ "name": "Get from Local Storage",
471
+ "description": "Read a value from local storage with the provided key.",
472
+ "cache": false,
354
473
  "arguments": [
355
474
  {
356
- "name": "Input",
357
- "description": "Number to round down.",
475
+ "name": "Key",
476
+ "formula": {
477
+ "type": "value",
478
+ "value": null
479
+ },
480
+ "description": "The key to read from local storage.",
358
481
  "type": {
359
- "type": "Number"
482
+ "type": "String"
483
+ }
484
+ }
485
+ ],
486
+ "output": {
487
+ "description": "The value found in local storage. If no value is found, this will return Null.",
488
+ "type": {
489
+ "type": "Any"
490
+ }
491
+ }
492
+ },
493
+ "@toddle/formatDate": {
494
+ "$schema": "../../schemas/libFormula.schema.json",
495
+ "name": "Format Date",
496
+ "arguments": [
497
+ {
498
+ "name": "Date",
499
+ "description": "Date to format",
500
+ "type": {
501
+ "type": "Date"
360
502
  },
361
503
  "formula": {
362
504
  "type": "value",
363
- "value": 1
505
+ "value": null
364
506
  }
365
507
  },
366
508
  {
367
- "name": "Decimals",
368
- "description": "Number of decimals to round to.",
509
+ "name": "Locale(s)",
510
+ "description": "Optional locale to use for formatting the Date, e.g. \"en\" or \"fr\". Multiple locales can be provided (as an Array of Strings) to provide a fallback locale. The default value is the runtime's locale.",
369
511
  "type": {
370
- "type": "Number"
512
+ "type": "Array \\| String"
371
513
  },
372
514
  "formula": {
373
515
  "type": "value",
374
- "value": 0
516
+ "value": null
517
+ }
518
+ },
519
+ {
520
+ "name": "Options",
521
+ "description": "Optional Object for configuring the formatting of the output. See the [DateTimeFormat syntax on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#syntax).",
522
+ "type": {
523
+ "type": "Object"
524
+ },
525
+ "formula": {
526
+ "type": "value",
527
+ "value": null
375
528
  }
376
529
  }
377
530
  ],
531
+ "description": "Format a date using the Intl.DateTimeFormat API. See the [DateTimeFormat docs on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat).",
378
532
  "output": {
533
+ "description": "The Date input formatted as a String.",
379
534
  "type": {
380
- "type": "Number"
381
- },
382
- "description": "The rounded Number."
535
+ "type": "String"
536
+ }
383
537
  }
384
538
  },
385
- "@toddle/append": {
539
+ "@toddle/clamp": {
386
540
  "$schema": "../../schemas/libFormula.schema.json",
387
- "name": "Append",
388
- "description": "Add an element to the end of an Array.",
541
+ "name": "Clamp",
542
+ "description": "Limit a value to a specified Min and Max value.",
389
543
  "arguments": [
390
544
  {
391
- "name": "Array",
545
+ "name": "Value",
392
546
  "type": {
393
- "type": "Array"
547
+ "type": "Number"
394
548
  },
395
- "description": "The Array to append to.",
396
549
  "formula": {
397
- "type": "array",
398
- "arguments": []
550
+ "type": "value",
551
+ "value": null
552
+ },
553
+ "description": "Number to round."
554
+ },
555
+ {
556
+ "name": "Min",
557
+ "type": {
558
+ "type": "Number"
559
+ },
560
+ "description": "The smallest allowed Number.",
561
+ "formula": {
562
+ "type": "value",
563
+ "value": 0
399
564
  }
400
565
  },
401
566
  {
402
- "name": "Item",
567
+ "name": "Max",
403
568
  "type": {
404
- "type": "Any"
569
+ "type": "Number"
405
570
  },
406
- "description": "The item to append to the Array.",
571
+ "description": "The largest allowed Number.",
407
572
  "formula": {
408
573
  "type": "value",
409
- "value": "Item"
574
+ "value": 100
410
575
  }
411
576
  }
412
577
  ],
413
578
  "output": {
414
- "description": "A new Array containing all elements from the input Array, including the new item.",
415
579
  "type": {
416
- "type": "Array"
417
- }
580
+ "type": "Number"
581
+ },
582
+ "description": "Returns the input value if between the specified Min and Max. Otherwise, it returns the Min or Max value."
418
583
  }
419
584
  },
420
- "@toddle/dateFromString": {
585
+ "@toddle/drop": {
421
586
  "$schema": "../../schemas/libFormula.schema.json",
422
- "name": "Date From String",
587
+ "name": "Drop",
588
+ "description": "Remove items from the beginning of an Array or String.",
423
589
  "arguments": [
424
590
  {
425
- "name": "Date string",
426
- "description": "A String representing a date, for example \"January 1, 1970\".",
591
+ "name": "Array",
592
+ "formula": {
593
+ "type": "value",
594
+ "value": null
595
+ },
596
+ "description": "The input value.",
427
597
  "type": {
428
- "type": "String"
598
+ "type": "Array \\| String"
599
+ }
600
+ },
601
+ {
602
+ "name": "Count",
603
+ "description": "Number of items to remove.",
604
+ "type": {
605
+ "type": "Number"
429
606
  },
430
607
  "formula": {
431
608
  "type": "value",
432
- "value": "January 1, 1970"
609
+ "value": 1
433
610
  }
434
611
  }
435
612
  ],
436
- "description": "Convert a string to a Date.",
437
613
  "output": {
438
- "description": "The input value converted to a Date.",
614
+ "description": "A copy of the list without the first items.",
439
615
  "type": {
440
- "type": "Date"
616
+ "type": "Array \\| String"
441
617
  }
442
618
  }
443
619
  },
444
- "@toddle/absolute": {
620
+ "@toddle/get": {
445
621
  "$schema": "../../schemas/libFormula.schema.json",
446
- "name": "Absolute",
447
- "description": "Get the absolute value of a Number.",
622
+ "name": "Get",
623
+ "description": "Extract a value from an Object, Array or String at the specified path.",
448
624
  "arguments": [
449
625
  {
450
- "name": "Value",
626
+ "name": "Object",
627
+ "formula": {
628
+ "type": "value",
629
+ "value": null
630
+ },
631
+ "description": "The Object, Array or String you want to extract an item from.",
632
+ "type": {
633
+ "type": "Array \\| Object \\| String"
634
+ }
635
+ },
636
+ {
637
+ "name": "Path",
451
638
  "formula": {
452
639
  "type": "value",
453
- "value": -1
640
+ "value": "Item"
454
641
  },
642
+ "description": "The Path can be either a Number, a String, or an Array.",
455
643
  "type": {
456
- "type": "Number"
457
- },
458
- "description": "The input Number."
644
+ "type": "Array<String> \\| Number \\| String"
645
+ }
459
646
  }
460
647
  ],
461
648
  "output": {
462
- "description": "The absolute value of the input.",
649
+ "description": "The value found at the Path. If no value is found, this value of the output is Null.",
463
650
  "type": {
464
- "type": "Number"
651
+ "type": "Any"
465
652
  }
466
653
  }
467
654
  },
468
- "@toddle/encodeURIComponent": {
655
+ "@toddle/getFromSessionStorage": {
469
656
  "$schema": "../../schemas/libFormula.schema.json",
470
- "name": "Encode URI Component",
471
- "description": "Encode a URI component, escaping certain characters to their UTF-8 representation.",
657
+ "name": "Get from Session Storage",
658
+ "description": "Read a value from session storage with the provided key.",
659
+ "cache": false,
472
660
  "arguments": [
473
661
  {
474
- "name": "URIComponent",
662
+ "name": "Key",
475
663
  "formula": {
476
664
  "type": "value",
477
665
  "value": null
478
666
  },
479
- "description": "The URI component to encode.",
667
+ "description": "The key to read from session storage.",
480
668
  "type": {
481
669
  "type": "String"
482
670
  }
483
671
  }
484
672
  ],
485
673
  "output": {
486
- "description": "The encoded URI component.",
674
+ "description": "The value found in session storage.",
487
675
  "type": {
488
- "type": "String"
676
+ "type": "Any"
489
677
  }
490
678
  }
491
679
  },
492
- "@toddle/modulo": {
680
+ "@toddle/min": {
493
681
  "$schema": "../../schemas/libFormula.schema.json",
494
- "name": "Modulo",
495
- "description": "Get the remainder when dividing two Numbers.",
682
+ "name": "Min",
683
+ "description": "Find the smallest Number from a list of inputs.",
496
684
  "arguments": [
497
685
  {
498
- "name": "Dividend",
686
+ "name": "0",
499
687
  "formula": {
500
688
  "type": "value",
501
- "value": 1
689
+ "value": null
502
690
  },
503
- "description": "The number to be divided.",
691
+ "description": "Input number",
504
692
  "type": {
505
693
  "type": "Number"
506
694
  }
507
695
  },
508
696
  {
509
- "name": "Divider",
697
+ "name": "1",
510
698
  "formula": {
511
699
  "type": "value",
512
- "value": 1
700
+ "value": null
513
701
  },
514
- "description": "The number to divide by.",
702
+ "description": "Input number",
515
703
  "type": {
516
704
  "type": "Number"
517
705
  }
518
706
  }
519
707
  ],
708
+ "variableArguments": true,
520
709
  "output": {
521
- "description": "The remainder when the Dividend is divided by the Divider.",
710
+ "description": "The smallest of the input Numbers.",
522
711
  "type": {
523
712
  "type": "Number"
524
713
  }
525
714
  }
526
715
  },
527
- "@toddle/defaultTo": {
716
+ "@toddle/findLast": {
528
717
  "$schema": "../../schemas/libFormula.schema.json",
529
- "name": "Default to",
530
- "description": "Return the first value that is not False or Null.",
718
+ "name": "Find Last",
719
+ "description": "Search through an Array of items and apply a formula to each item, to return the last item where the formula returns True.",
531
720
  "arguments": [
532
721
  {
533
- "name": "0",
722
+ "name": "Array",
534
723
  "formula": {
535
724
  "type": "value",
536
725
  "value": null
537
726
  },
538
- "description": "The inital value.",
727
+ "description": "The array to search.",
539
728
  "type": {
540
- "type": "Any"
729
+ "type": "Array"
541
730
  }
542
731
  },
543
732
  {
544
- "name": "1",
545
- "description": "The first fallback value to be used if the primary value is Null or False.",
546
- "type": {
547
- "type": "Any"
548
- },
733
+ "name": "Formula",
734
+ "isFunction": true,
549
735
  "formula": {
550
- "type": "value",
551
- "value": "default"
736
+ "type": "path",
737
+ "path": [
738
+ "Args",
739
+ "item"
740
+ ]
741
+ },
742
+ "description": "The predicate formula that each item in the Array is passed to.",
743
+ "type": {
744
+ "type": "Formula"
552
745
  }
553
746
  }
554
747
  ],
555
- "variableArguments": true,
556
748
  "output": {
557
- "description": "Returns the first value that is not False or Null. Returns Null if no valid values is given.",
749
+ "description": "The last item in the Array where the formula returns True. Returns Null if the predicate formula did not return True for any item.",
558
750
  "type": {
559
751
  "type": "Any"
560
752
  }
561
753
  }
562
754
  },
563
- "@toddle/reduce": {
755
+ "@toddle/unique": {
564
756
  "$schema": "../../schemas/libFormula.schema.json",
565
- "name": "Reduce",
566
- "description": "Reduce a group of items to a single value by applying each item to a reducer formula.",
757
+ "name": "Unique",
758
+ "description": "Remove duplicate values from an Array.",
567
759
  "arguments": [
568
760
  {
569
761
  "name": "Array",
570
762
  "formula": {
571
763
  "type": "value",
572
- "value": null
764
+ "value": []
573
765
  },
574
- "description": "The Array or Object of items to be reduced.",
575
766
  "type": {
576
- "type": "Array \\| Object"
577
- }
578
- },
579
- {
580
- "name": "Formula",
581
- "isFunction": true,
582
- "formula": {
583
- "type": "value",
584
- "value": null
767
+ "type": "Array"
585
768
  },
586
- "description": "The reducer formula. Each item in the Array is applied to the formula along with the accumulator. The result of this formula will be a new accumulator used for the next item.",
587
- "type": {
588
- "type": "Formula"
589
- }
590
- },
769
+ "description": "The input Array."
770
+ }
771
+ ],
772
+ "output": {
773
+ "description": "The input Array with all duplicate values removed.",
774
+ "type": {
775
+ "type": "Array"
776
+ }
777
+ }
778
+ },
779
+ "@toddle/boolean": {
780
+ "$schema": "../../schemas/libFormula.schema.json",
781
+ "name": "Boolean",
782
+ "description": "Convert a value of any type to a Boolean.",
783
+ "arguments": [
591
784
  {
592
- "name": "Accumulator",
593
- "formula": {
594
- "type": "value",
595
- "value": null
596
- },
597
- "description": "The initial value of the accumulator. This value is passed to the reducer formula along with the first item in the Array, and the result is used as the accumulator for the next item.",
785
+ "name": "Input",
786
+ "description": "Value of any type.",
598
787
  "type": {
599
788
  "type": "Any"
789
+ },
790
+ "formula": {
791
+ "type": "value",
792
+ "value": "1"
600
793
  }
601
794
  }
602
795
  ],
603
796
  "output": {
604
- "description": "The value returned from applying the last item to the reducer formula.",
797
+ "description": "The input value converted to a Boolean. False and Null will return False, all other values will return True.",
605
798
  "type": {
606
- "type": "Any"
799
+ "type": "Boolean"
607
800
  }
608
801
  }
609
802
  },
610
- "@toddle/deleteKey": {
803
+ "@toddle/absolute": {
611
804
  "$schema": "../../schemas/libFormula.schema.json",
612
- "name": "Delete",
613
- "description": "Return a copy of the input Object or Array without the specified key.",
805
+ "name": "Absolute",
806
+ "description": "Get the absolute value of a Number.",
614
807
  "arguments": [
615
808
  {
616
- "name": "Object",
809
+ "name": "Value",
617
810
  "formula": {
618
811
  "type": "value",
619
- "value": null
812
+ "value": -1
620
813
  },
621
- "description": "The input record.",
622
814
  "type": {
623
- "type": "Array \\| Object"
624
- }
625
- },
815
+ "type": "Number"
816
+ },
817
+ "description": "The input Number."
818
+ }
819
+ ],
820
+ "output": {
821
+ "description": "The absolute value of the input.",
822
+ "type": {
823
+ "type": "Number"
824
+ }
825
+ }
826
+ },
827
+ "@toddle/trim": {
828
+ "$schema": "../../schemas/libFormula.schema.json",
829
+ "name": "Trim",
830
+ "description": "Remove any leading and trailing white spaces from a String.",
831
+ "arguments": [
626
832
  {
627
- "name": "Path",
833
+ "name": "String",
628
834
  "formula": {
629
835
  "type": "value",
630
- "value": "Item"
836
+ "value": ""
631
837
  },
632
- "description": "The path can be either a Number (if the first argument is an array), a String, or an Array of strings. If an Array is given, the property at that path will be removed.",
838
+ "description": "The String to trim.",
633
839
  "type": {
634
- "type": "Array<Number \\| String> \\| Number \\| String"
840
+ "type": "String"
635
841
  }
636
842
  }
637
843
  ],
638
844
  "output": {
639
- "description": "A copy of the record without the property specified in the Path.",
845
+ "description": "The trimmed String.",
640
846
  "type": {
641
- "type": "Object"
847
+ "type": "String"
642
848
  }
643
849
  }
644
850
  },
645
- "@toddle/power": {
851
+ "@toddle/groupBy": {
646
852
  "$schema": "../../schemas/libFormula.schema.json",
647
- "name": "Power",
648
- "description": "Raise a number to a power.",
853
+ "name": "Group by",
854
+ "description": "Group an Array of items into an Object based on a grouping formula.",
649
855
  "arguments": [
650
856
  {
651
- "name": "Base",
857
+ "name": "Array",
652
858
  "formula": {
653
859
  "type": "value",
654
- "value": 3
860
+ "value": null
655
861
  },
656
- "description": "The number to be raised to the exponent.",
862
+ "description": "Array of items to be grouped.",
657
863
  "type": {
658
- "type": "Number"
864
+ "type": "Array"
659
865
  }
660
866
  },
661
867
  {
662
- "name": "Exponent",
868
+ "name": "Formula",
869
+ "isFunction": true,
663
870
  "formula": {
664
871
  "type": "value",
665
- "value": 2
872
+ "value": null
666
873
  },
667
- "description": "The exponent to raise the base to.",
874
+ "description": "The grouping formula used to group the items. The String returned from the formula will match the key in the output Oject.",
668
875
  "type": {
669
- "type": "Number"
876
+ "type": "Formula"
670
877
  }
671
878
  }
672
879
  ],
673
880
  "output": {
881
+ "description": "An Object where each key matches a value returned by the grouping formula, and each value is the list of items that share the return value.",
674
882
  "type": {
675
- "type": "Number"
676
- },
677
- "description": "The result of raising the base to the exponent."
883
+ "type": "Object"
884
+ }
678
885
  }
679
886
  },
680
- "@toddle/filter": {
887
+ "@toddle/range": {
681
888
  "$schema": "../../schemas/libFormula.schema.json",
682
- "name": "Filter",
683
- "description": "Return a new Array containing only the elements for which the provided formula evaluates to True.",
889
+ "name": "Range",
890
+ "description": "Create an Array of numbers between a Min and Max value.",
684
891
  "arguments": [
685
892
  {
686
- "name": "Array",
687
893
  "formula": {
688
894
  "type": "value",
689
- "value": null
895
+ "value": 0
690
896
  },
691
- "description": "The array of items to be filtered.",
897
+ "name": "Min",
898
+ "description": "The smallest value in the list.",
692
899
  "type": {
693
- "type": "Array"
900
+ "type": "Number"
694
901
  }
695
902
  },
696
903
  {
697
- "name": "Formula",
698
- "isFunction": true,
904
+ "name": "Max",
699
905
  "formula": {
700
- "type": "path",
701
- "path": [
702
- "Args",
703
- "item"
704
- ]
906
+ "type": "value",
907
+ "value": 10
705
908
  },
706
- "description": "Predicate formula for filtering items.",
909
+ "description": "The largest value in the list.",
707
910
  "type": {
708
- "type": "Formula"
911
+ "type": "Number"
709
912
  }
710
913
  }
711
914
  ],
712
915
  "output": {
713
- "description": "New Array containing only the items for which the Formula evaluated to True.",
916
+ "description": "An Array containing all the numbers between Min and Max, inclusive.",
714
917
  "type": {
715
918
  "type": "Array"
716
919
  }
717
920
  }
718
921
  },
719
- "@toddle/takeLast": {
922
+ "@toddle/max": {
720
923
  "$schema": "../../schemas/libFormula.schema.json",
721
- "name": "Take last",
722
- "description": "Take items from the end of an Array or String.",
924
+ "name": "Max",
925
+ "description": "Find the largest Number from a list of inputs.",
723
926
  "arguments": [
724
927
  {
725
- "name": "Array",
928
+ "name": "0",
726
929
  "formula": {
727
930
  "type": "value",
728
931
  "value": null
729
932
  },
730
- "description": "The input value.",
933
+ "description": "Input Number.",
731
934
  "type": {
732
- "type": "Array \\| String"
935
+ "type": "Number"
733
936
  }
734
937
  },
735
938
  {
736
- "name": "Count",
939
+ "name": "1",
737
940
  "formula": {
738
941
  "type": "value",
739
- "value": 1
942
+ "value": null
740
943
  },
741
- "description": "Number of items to take.",
944
+ "description": "Input Number.",
742
945
  "type": {
743
946
  "type": "Number"
744
947
  }
745
948
  }
746
949
  ],
950
+ "variableArguments": true,
747
951
  "output": {
748
- "description": "The last items from the Array or String.",
749
- "type": {
750
- "type": "Array \\| String"
751
- }
752
- }
753
- },
754
- "@toddle/randomNumber": {
755
- "$schema": "../../schemas/libFormula.schema.json",
756
- "name": "Random number",
757
- "description": "return a random Number between 0 and 1.",
758
- "arguments": [],
759
- "cache": false,
760
- "output": {
761
- "description": "A random Number between 0 and 1.",
952
+ "description": "The largest of the input Numbers.",
762
953
  "type": {
763
954
  "type": "Number"
764
955
  }
765
956
  }
766
957
  },
767
- "@toddle/find": {
958
+ "@toddle/filter": {
768
959
  "$schema": "../../schemas/libFormula.schema.json",
769
- "name": "Find",
770
- "description": "Search through an Array of items and apply a formula to each item, to return the first item where the provided formula returns True.",
960
+ "name": "Filter",
961
+ "description": "Return a new Array containing only the elements for which the provided formula evaluates to True.",
771
962
  "arguments": [
772
963
  {
773
964
  "name": "Array",
@@ -775,7 +966,7 @@
775
966
  "type": "value",
776
967
  "value": null
777
968
  },
778
- "description": "The array to search through",
969
+ "description": "The array of items to be filtered.",
779
970
  "type": {
780
971
  "type": "Array"
781
972
  }
@@ -790,252 +981,158 @@
790
981
  "item"
791
982
  ]
792
983
  },
793
- "description": "The predicate formula that each item in the array is passed to.",
984
+ "description": "Predicate formula for filtering items.",
794
985
  "type": {
795
986
  "type": "Formula"
796
987
  }
797
988
  }
798
989
  ],
799
990
  "output": {
800
- "description": "The first item in the Array where the formula returns True. Returns Null if the predicate formula did not return True for any item.",
801
- "type": {
802
- "type": "Any"
803
- }
804
- }
805
- },
806
- "@toddle/sum": {
807
- "$schema": "../../schemas/libFormula.schema.json",
808
- "name": "Sum",
809
- "description": "Return the sum of an Array of numbers",
810
- "arguments": [
811
- {
812
- "name": "Array",
813
- "type": {
814
- "type": "Array"
815
- },
816
- "description": "The array of numbers to sum.",
817
- "formula": {
818
- "type": "array",
819
- "arguments": []
820
- }
821
- }
822
- ],
823
- "output": {
824
- "description": "The total sum from adding all the numbers in the Array.",
991
+ "description": "New Array containing only the items for which the Formula evaluated to True.",
825
992
  "type": {
826
- "type": "Number"
993
+ "type": "Array"
827
994
  }
828
995
  }
829
996
  },
830
- "@toddle/capitalize": {
997
+ "@toddle/decodeBase64": {
831
998
  "$schema": "../../schemas/libFormula.schema.json",
832
- "name": "Capitalize",
833
- "description": "Capitalize a string: make the first letter uppercase whilst keeping the rest lowercase.",
999
+ "name": "Decode base64",
834
1000
  "arguments": [
835
1001
  {
836
- "name": "String",
1002
+ "name": "Base64 value",
837
1003
  "formula": {
838
1004
  "type": "value",
839
- "value": "string"
1005
+ "value": "Input value"
840
1006
  },
841
- "description": "An input String.",
842
1007
  "type": {
843
1008
  "type": "String"
844
- }
1009
+ },
1010
+ "description": "The input data encoded as base64."
845
1011
  }
846
1012
  ],
1013
+ "description": "Deocde a base64 string to utf-8.",
847
1014
  "output": {
848
- "description": "The capitalized String.",
1015
+ "description": "The decoded string.",
849
1016
  "type": {
850
1017
  "type": "String"
851
1018
  }
852
1019
  }
853
1020
  },
854
- "@toddle/isServer": {
855
- "$schema": "../../schemas/libFormula.schema.json",
856
- "name": "Is Server",
857
- "description": "Get information about whether formulas are currently evaluated server-side or client-side.",
858
- "arguments": [],
859
- "output": {
860
- "description": "Returns True if formulas are evaluated server-side, and False if formulas are evaluated client-side.",
861
- "type": {
862
- "type": "Boolean"
863
- }
864
- }
865
- },
866
- "@toddle/parseURL": {
1021
+ "@toddle/startsWith": {
867
1022
  "$schema": "../../schemas/libFormula.schema.json",
868
- "name": "Parse URL",
869
- "description": "Parse a URL",
1023
+ "name": "Starts with",
1024
+ "description": "Check if a String has a given prefix.",
870
1025
  "arguments": [
871
1026
  {
872
- "name": "URL",
1027
+ "name": "String",
873
1028
  "formula": {
874
1029
  "type": "value",
875
- "value": null
1030
+ "value": ""
876
1031
  },
877
- "description": "The URL value to parse.",
1032
+ "description": "The String to check.",
878
1033
  "type": {
879
1034
  "type": "String"
880
1035
  }
881
1036
  },
882
1037
  {
883
- "name": "Base",
884
- "formula": {
885
- "type": "value",
886
- "value": null
887
- },
888
- "description": "An optional base for the URL. Use this to resolve relative URLs.",
889
- "type": {
890
- "type": "String"
891
- }
892
- }
893
- ],
894
- "output": {
895
- "description": "An object containing: \"hostname\", \"searchParams\", \"path\", \"hash\", \"href\", \"protocol\", \"port\", \"origin\"",
896
- "type": {
897
- "type": "Object"
898
- }
899
- }
900
- },
901
- "@toddle/getFromSessionStorage": {
902
- "$schema": "../../schemas/libFormula.schema.json",
903
- "name": "Get from Session Storage",
904
- "description": "Read a value from session storage with the provided key.",
905
- "cache": false,
906
- "arguments": [
907
- {
908
- "name": "Key",
1038
+ "name": "Prefix",
909
1039
  "formula": {
910
1040
  "type": "value",
911
- "value": null
1041
+ "value": ""
912
1042
  },
913
- "description": "The key to read from session storage.",
1043
+ "description": "The prefix to check for.",
914
1044
  "type": {
915
1045
  "type": "String"
916
1046
  }
917
1047
  }
918
1048
  ],
919
1049
  "output": {
920
- "description": "The value found in session storage.",
1050
+ "description": "Returns True if the input String starts with the prefix, otherwise False",
921
1051
  "type": {
922
- "type": "Any"
1052
+ "type": "Boolean"
923
1053
  }
924
1054
  }
925
1055
  },
926
- "@toddle/formatDate": {
1056
+ "@toddle/squareRoot": {
927
1057
  "$schema": "../../schemas/libFormula.schema.json",
928
- "name": "Format Date",
1058
+ "name": "Square root",
1059
+ "description": "Get the square root of a Number.",
929
1060
  "arguments": [
930
1061
  {
931
- "name": "Date",
932
- "description": "Date to format",
933
- "type": {
934
- "type": "Date"
935
- },
1062
+ "name": "Number",
936
1063
  "formula": {
937
1064
  "type": "value",
938
- "value": null
939
- }
940
- },
941
- {
942
- "name": "Locale(s)",
943
- "description": "Optional locale to use for formatting the Date, e.g. \"en\" or \"fr\". Multiple locales can be provided (as an Array of Strings) to provide a fallback locale. The default value is the runtime's locale.",
944
- "type": {
945
- "type": "Array \\| String"
1065
+ "value": 1
946
1066
  },
947
- "formula": {
948
- "type": "value",
949
- "value": null
950
- }
951
- },
952
- {
953
- "name": "Options",
954
- "description": "Optional Object for configuring the formatting of the output. See the [DateTimeFormat syntax on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#syntax).",
1067
+ "description": "The input Number.",
955
1068
  "type": {
956
- "type": "Object"
957
- },
958
- "formula": {
959
- "type": "value",
960
- "value": null
1069
+ "type": "Number"
961
1070
  }
962
1071
  }
963
1072
  ],
964
- "description": "Format a date using the Intl.DateTimeFormat API. See the [DateTimeFormat docs on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat).",
965
1073
  "output": {
966
- "description": "The Date input formatted as a String.",
1074
+ "description": "The square root of the input Number.",
967
1075
  "type": {
968
- "type": "String"
1076
+ "type": "Number"
969
1077
  }
970
1078
  }
971
1079
  },
972
- "@toddle/get": {
1080
+ "@toddle/indexOf": {
973
1081
  "$schema": "../../schemas/libFormula.schema.json",
974
- "name": "Get",
975
- "description": "Extract a value from an Object, Array or String at the specified path.",
1082
+ "name": "Index of",
1083
+ "description": "Find the index of a specific item in an Array or String.",
976
1084
  "arguments": [
977
1085
  {
978
- "name": "Object",
1086
+ "name": "Array",
979
1087
  "formula": {
980
1088
  "type": "value",
981
- "value": null
1089
+ "value": ""
982
1090
  },
983
- "description": "The Object, Array or String you want to extract an item from.",
1091
+ "description": "The value to search.",
984
1092
  "type": {
985
- "type": "Array \\| Object \\| String"
1093
+ "type": "Array \\| String"
986
1094
  }
987
1095
  },
988
1096
  {
989
- "name": "Path",
1097
+ "name": "Item",
990
1098
  "formula": {
991
1099
  "type": "value",
992
- "value": "Item"
1100
+ "value": ""
993
1101
  },
994
- "description": "The Path can be either a Number, a String, or an Array.",
1102
+ "description": "The items to search for.",
995
1103
  "type": {
996
- "type": "Array<String> \\| Number \\| String"
1104
+ "type": "Any"
997
1105
  }
998
1106
  }
999
1107
  ],
1000
1108
  "output": {
1001
- "description": "The value found at the Path. If no value is found, this value of the output is Null.",
1109
+ "description": "If the item exists in the Array, the index of that item is returned. If the item is not found, -1 is returned.",
1002
1110
  "type": {
1003
- "type": "Any"
1111
+ "type": "Number"
1004
1112
  }
1005
1113
  }
1006
1114
  },
1007
- "@toddle/divide": {
1115
+ "@toddle/lowercase": {
1008
1116
  "$schema": "../../schemas/libFormula.schema.json",
1009
- "name": "Divide",
1010
- "description": "Perform a division calculation.",
1117
+ "name": "Lower case",
1118
+ "description": "Convert a string to lowercase.",
1011
1119
  "arguments": [
1012
1120
  {
1013
- "name": "Dividend",
1014
- "description": "The number to be divided.",
1015
- "type": {
1016
- "type": "Number"
1017
- },
1121
+ "name": "String",
1018
1122
  "formula": {
1019
1123
  "type": "value",
1020
- "value": 1
1021
- }
1022
- },
1023
- {
1024
- "name": "Divisor",
1025
- "description": "The number to divide by.",
1026
- "type": {
1027
- "type": "Number"
1124
+ "value": "string"
1028
1125
  },
1029
- "formula": {
1030
- "type": "value",
1031
- "value": 1
1126
+ "description": "Input String",
1127
+ "type": {
1128
+ "type": "String"
1032
1129
  }
1033
1130
  }
1034
1131
  ],
1035
1132
  "output": {
1036
- "description": "The result of dividing the dividend with the divisor.",
1133
+ "description": "The input String with all characters converted to lowercase.",
1037
1134
  "type": {
1038
- "type": "Number"
1135
+ "type": "String"
1039
1136
  }
1040
1137
  }
1041
1138
  },
@@ -1077,104 +1174,86 @@
1077
1174
  }
1078
1175
  }
1079
1176
  },
1080
- "@toddle/reverse": {
1177
+ "@toddle/canShare": {
1081
1178
  "$schema": "../../schemas/libFormula.schema.json",
1082
- "name": "Reverse",
1083
- "description": "Reverse the order of an Array.",
1179
+ "name": "Can Share",
1180
+ "description": "Return a Boolean indicating whether the provided data can be shared (with the \"Share\" action).",
1084
1181
  "arguments": [
1085
1182
  {
1086
- "name": "Array",
1183
+ "name": "URL",
1184
+ "description": "The URL you want to check.",
1185
+ "type": {
1186
+ "type": "String"
1187
+ },
1087
1188
  "formula": {
1088
1189
  "type": "value",
1089
- "value": null
1090
- },
1091
- "description": "The Array to be reversed.",
1092
- "type": {
1093
- "type": "Array"
1094
- }
1095
- }
1096
- ],
1097
- "output": {
1098
- "type": {
1099
- "type": "Array"
1190
+ "value": null
1191
+ }
1100
1192
  },
1101
- "description": "The reversed Array."
1102
- }
1103
- },
1104
- "@toddle/round": {
1105
- "$schema": "../../schemas/libFormula.schema.json",
1106
- "name": "Round",
1107
- "description": "Round a Number to the nearest decimal point.",
1108
- "arguments": [
1109
1193
  {
1110
- "name": "Input",
1111
- "description": "Number to round.",
1194
+ "name": "Title",
1195
+ "description": "The title you want to check.",
1112
1196
  "type": {
1113
- "type": "Number"
1197
+ "type": "String"
1114
1198
  },
1115
1199
  "formula": {
1116
1200
  "type": "value",
1117
- "value": 1
1201
+ "value": null
1118
1202
  }
1119
1203
  },
1120
1204
  {
1121
- "name": "Decimals",
1122
- "description": "Number of decimals to round to.",
1205
+ "name": "Text",
1206
+ "description": "The text you want to check.",
1123
1207
  "type": {
1124
- "type": "Number"
1208
+ "type": "String"
1125
1209
  },
1126
1210
  "formula": {
1127
1211
  "type": "value",
1128
- "value": 0
1212
+ "value": null
1129
1213
  }
1130
1214
  }
1131
- ],
1132
- "output": {
1133
- "type": {
1134
- "type": "Number"
1135
- },
1136
- "description": "The rounded Number."
1137
- }
1215
+ ]
1138
1216
  },
1139
- "@toddle/includes": {
1217
+ "@toddle/keyBy": {
1140
1218
  "$schema": "../../schemas/libFormula.schema.json",
1141
- "name": "Includes",
1142
- "description": "Test if an Array or String includes a specific item or value.",
1219
+ "name": "Key by",
1220
+ "description": "Organize an Array of items into an Object based on a Key formula.",
1143
1221
  "arguments": [
1144
1222
  {
1145
1223
  "name": "Array",
1146
1224
  "formula": {
1147
1225
  "type": "value",
1148
- "value": ""
1226
+ "value": null
1149
1227
  },
1150
- "description": "The value to search.",
1228
+ "description": "Array of items.",
1151
1229
  "type": {
1152
- "type": "Array \\| String"
1230
+ "type": "Array"
1153
1231
  }
1154
1232
  },
1155
1233
  {
1156
- "name": "Item",
1234
+ "name": "Formula",
1235
+ "isFunction": true,
1157
1236
  "formula": {
1158
1237
  "type": "value",
1159
- "value": ""
1238
+ "value": null
1160
1239
  },
1161
- "description": "The item or value to search for.",
1240
+ "description": "The key formula used to index the items. The String returned from the formula will match the key in the output Object.",
1162
1241
  "type": {
1163
- "type": "Any"
1242
+ "type": "Formula"
1164
1243
  }
1165
1244
  }
1166
1245
  ],
1167
1246
  "output": {
1168
- "description": "Returns True if the item or value exists in the Array or string. Returns False if no match is found.",
1247
+ "description": "An Object where each key matches a value returned by the key formula, and each value is the item that String was returned for.",
1169
1248
  "type": {
1170
- "type": "Boolean"
1249
+ "type": "Object"
1171
1250
  }
1172
1251
  }
1173
1252
  },
1174
- "@toddle/greaterOrEqueal": {
1253
+ "@toddle/lessOrEqual": {
1175
1254
  "$schema": "../../schemas/libFormula.schema.json",
1176
- "name": "Greater or equal",
1177
- "description": "Compute whether a value is larger than or equal to another value.",
1255
+ "name": "Less or equal",
1256
+ "description": "Compute if a value is smaller than or equal to another value.",
1178
1257
  "arguments": [
1179
1258
  {
1180
1259
  "name": "First",
@@ -1182,7 +1261,7 @@
1182
1261
  "type": "value",
1183
1262
  "value": ""
1184
1263
  },
1185
- "description": "First value to be compared.",
1264
+ "description": "First Number to be compared.",
1186
1265
  "type": {
1187
1266
  "type": "Number"
1188
1267
  }
@@ -1193,274 +1272,305 @@
1193
1272
  "type": "value",
1194
1273
  "value": ""
1195
1274
  },
1196
- "description": "Second value to be compared.",
1275
+ "description": "Second Number to be compared.",
1197
1276
  "type": {
1198
1277
  "type": "Number"
1199
1278
  }
1200
1279
  }
1201
1280
  ],
1202
1281
  "output": {
1203
- "description": "Returns True if the first Number is larger than or equal to the second Number.",
1282
+ "description": "Returns True if the First Number is smaller than or equal to the second Number, otherwise it returns False.",
1204
1283
  "type": {
1205
1284
  "type": "Boolean"
1206
1285
  }
1207
1286
  }
1208
1287
  },
1209
- "@toddle/join": {
1288
+ "@toddle/minus": {
1210
1289
  "$schema": "../../schemas/libFormula.schema.json",
1211
- "name": "Join",
1212
- "description": "Combine an Array of Strings in to a single String.",
1290
+ "name": "Minus",
1291
+ "description": "Subtract a Number from a Number.",
1213
1292
  "arguments": [
1214
1293
  {
1215
- "name": "Array",
1294
+ "name": "Minuend",
1216
1295
  "formula": {
1217
1296
  "type": "value",
1218
- "value": null
1297
+ "value": 1
1219
1298
  },
1220
- "description": "An array of Strings.",
1299
+ "description": "The number to subtract from.",
1221
1300
  "type": {
1222
- "type": "Array"
1301
+ "type": "Number"
1223
1302
  }
1224
1303
  },
1225
1304
  {
1226
- "name": "Separator",
1305
+ "name": "Substrahend",
1227
1306
  "formula": {
1228
1307
  "type": "value",
1229
- "value": ", "
1308
+ "value": 1
1230
1309
  },
1231
- "description": "A separator String that is inserted in between each item in the Array to join.",
1310
+ "description": "The number to subtract.",
1232
1311
  "type": {
1233
- "type": "String"
1312
+ "type": "Number"
1234
1313
  }
1235
1314
  }
1236
1315
  ],
1237
1316
  "output": {
1238
- "description": "A String combining each item in the input Array separated by the separator String, e.g. joining [\"a\", \"b\", \"c\"] with a \",\" separator will return \"a,b,c\".",
1317
+ "description": "The result of subtracting the Substrahend from the Minuend.",
1239
1318
  "type": {
1240
- "type": "String"
1319
+ "type": "Number"
1241
1320
  }
1242
1321
  }
1243
1322
  },
1244
- "@toddle/uppercase": {
1323
+ "@toddle/roundDown": {
1245
1324
  "$schema": "../../schemas/libFormula.schema.json",
1246
- "name": "Uppercase",
1247
- "description": "Convert a String to uppercase.",
1325
+ "name": "Round down",
1326
+ "description": "Round a Number down to the nearest decimal point.",
1248
1327
  "arguments": [
1249
1328
  {
1250
- "name": "String",
1329
+ "name": "Input",
1330
+ "description": "Number to round down.",
1331
+ "type": {
1332
+ "type": "Number"
1333
+ },
1251
1334
  "formula": {
1252
1335
  "type": "value",
1253
- "value": "string"
1254
- },
1255
- "description": "Input String.",
1336
+ "value": 1
1337
+ }
1338
+ },
1339
+ {
1340
+ "name": "Decimals",
1341
+ "description": "Number of decimals to round to.",
1256
1342
  "type": {
1257
- "type": "String"
1343
+ "type": "Number"
1344
+ },
1345
+ "formula": {
1346
+ "type": "value",
1347
+ "value": 0
1258
1348
  }
1259
1349
  }
1260
1350
  ],
1261
1351
  "output": {
1262
- "description": "The input String with all characters converted to uppercase.",
1263
1352
  "type": {
1264
- "type": "String"
1265
- }
1353
+ "type": "Number"
1354
+ },
1355
+ "description": "The rounded Number."
1266
1356
  }
1267
1357
  },
1268
- "@toddle/notEqual": {
1358
+ "@toddle/every": {
1269
1359
  "$schema": "../../schemas/libFormula.schema.json",
1270
- "name": "Not equal",
1271
- "description": "Compute if values are not identical.",
1360
+ "name": "Every",
1361
+ "description": "Run a formula returns for all items in an Array.",
1272
1362
  "arguments": [
1273
1363
  {
1274
- "name": "First",
1364
+ "name": "Array",
1275
1365
  "formula": {
1276
1366
  "type": "value",
1277
- "value": ""
1367
+ "value": null
1278
1368
  },
1279
- "description": "First value.",
1369
+ "description": "The array of items to evaluate.",
1280
1370
  "type": {
1281
- "type": "Any"
1371
+ "type": "Array"
1282
1372
  }
1283
1373
  },
1284
1374
  {
1285
- "name": "Second",
1375
+ "name": "Formula",
1376
+ "isFunction": true,
1286
1377
  "formula": {
1287
- "type": "value",
1288
- "value": ""
1378
+ "type": "path",
1379
+ "path": [
1380
+ "Args",
1381
+ "item"
1382
+ ]
1289
1383
  },
1290
- "description": "Second value.",
1384
+ "description": "Predicate formula for evaluating each item.",
1291
1385
  "type": {
1292
- "type": "Any"
1386
+ "type": "Formula"
1293
1387
  }
1294
1388
  }
1295
1389
  ],
1296
1390
  "output": {
1297
- "description": "Returns True if the values are not identical, otherwise False.",
1391
+ "description": "Returns True if the predicate formula returns true for all items in the Array, otherwise False.",
1298
1392
  "type": {
1299
- "type": "Any"
1393
+ "type": "Array"
1300
1394
  }
1301
1395
  }
1302
1396
  },
1303
- "@toddle/drop": {
1397
+ "@toddle/round": {
1304
1398
  "$schema": "../../schemas/libFormula.schema.json",
1305
- "name": "Drop",
1306
- "description": "Remove items from the beginning of an Array or String.",
1399
+ "name": "Round",
1400
+ "description": "Round a Number to the nearest decimal point.",
1307
1401
  "arguments": [
1308
1402
  {
1309
- "name": "Array",
1403
+ "name": "Input",
1404
+ "description": "Number to round.",
1405
+ "type": {
1406
+ "type": "Number"
1407
+ },
1310
1408
  "formula": {
1311
1409
  "type": "value",
1312
- "value": null
1313
- },
1314
- "description": "The input value.",
1315
- "type": {
1316
- "type": "Array \\| String"
1410
+ "value": 1
1317
1411
  }
1318
1412
  },
1319
1413
  {
1320
- "name": "Count",
1321
- "description": "Number of items to remove.",
1414
+ "name": "Decimals",
1415
+ "description": "Number of decimals to round to.",
1322
1416
  "type": {
1323
1417
  "type": "Number"
1324
1418
  },
1325
1419
  "formula": {
1326
1420
  "type": "value",
1327
- "value": 1
1421
+ "value": 0
1328
1422
  }
1329
1423
  }
1330
1424
  ],
1331
1425
  "output": {
1332
- "description": "A copy of the list without the first items.",
1333
1426
  "type": {
1334
- "type": "Array \\| String"
1335
- }
1427
+ "type": "Number"
1428
+ },
1429
+ "description": "The rounded Number."
1336
1430
  }
1337
1431
  },
1338
- "@toddle/parseJSON": {
1432
+ "@toddle/reverse": {
1339
1433
  "$schema": "../../schemas/libFormula.schema.json",
1340
- "name": "Parse JSON",
1341
- "description": "Parse a String to JSON.",
1434
+ "name": "Reverse",
1435
+ "description": "Reverse the order of an Array.",
1342
1436
  "arguments": [
1343
1437
  {
1344
- "name": "JSON string",
1438
+ "name": "Array",
1345
1439
  "formula": {
1346
1440
  "type": "value",
1347
1441
  "value": null
1348
1442
  },
1349
- "description": "The String to be parsed.",
1443
+ "description": "The Array to be reversed.",
1350
1444
  "type": {
1351
- "type": "String"
1445
+ "type": "Array"
1352
1446
  }
1353
1447
  }
1354
1448
  ],
1355
1449
  "output": {
1356
- "description": "The parsed JSON value. If the input is not a valid String, this returns Null.",
1357
1450
  "type": {
1358
- "type": "Any"
1359
- }
1451
+ "type": "Array"
1452
+ },
1453
+ "description": "The reversed Array."
1360
1454
  }
1361
1455
  },
1362
- "@toddle/clamp": {
1456
+ "@toddle/getElementById": {
1363
1457
  "$schema": "../../schemas/libFormula.schema.json",
1364
- "name": "Clamp",
1365
- "description": "Limit a value to a specified Min and Max value.",
1458
+ "name": "Get element by id",
1459
+ "description": "Return a DOM element with a given id.",
1460
+ "cache": false,
1366
1461
  "arguments": [
1367
1462
  {
1368
- "name": "Value",
1463
+ "name": "Id",
1464
+ "formula": {
1465
+ "type": "value",
1466
+ "value": "element-id"
1467
+ },
1369
1468
  "type": {
1370
- "type": "Number"
1469
+ "type": "String"
1371
1470
  },
1471
+ "description": "The id of the DOM element to return."
1472
+ }
1473
+ ],
1474
+ "output": {
1475
+ "description": "The DOM element with the given id. If no DOM element is found, this will return Null.",
1476
+ "type": {
1477
+ "type": "Element"
1478
+ }
1479
+ }
1480
+ },
1481
+ "@toddle/reduce": {
1482
+ "$schema": "../../schemas/libFormula.schema.json",
1483
+ "name": "Reduce",
1484
+ "description": "Reduce a group of items to a single value by applying each item to a reducer formula.",
1485
+ "arguments": [
1486
+ {
1487
+ "name": "Array",
1372
1488
  "formula": {
1373
1489
  "type": "value",
1374
1490
  "value": null
1375
1491
  },
1376
- "description": "Number to round."
1492
+ "description": "The Array or Object of items to be reduced.",
1493
+ "type": {
1494
+ "type": "Array \\| Object"
1495
+ }
1377
1496
  },
1378
1497
  {
1379
- "name": "Min",
1380
- "type": {
1381
- "type": "Number"
1382
- },
1383
- "description": "The smallest allowed Number.",
1498
+ "name": "Formula",
1499
+ "isFunction": true,
1384
1500
  "formula": {
1385
1501
  "type": "value",
1386
- "value": 0
1502
+ "value": null
1503
+ },
1504
+ "description": "The reducer formula. Each item in the Array is applied to the formula along with the accumulator. The result of this formula will be a new accumulator used for the next item.",
1505
+ "type": {
1506
+ "type": "Formula"
1387
1507
  }
1388
1508
  },
1389
1509
  {
1390
- "name": "Max",
1391
- "type": {
1392
- "type": "Number"
1393
- },
1394
- "description": "The largest allowed Number.",
1510
+ "name": "Accumulator",
1395
1511
  "formula": {
1396
1512
  "type": "value",
1397
- "value": 100
1513
+ "value": null
1514
+ },
1515
+ "description": "The initial value of the accumulator. This value is passed to the reducer formula along with the first item in the Array, and the result is used as the accumulator for the next item.",
1516
+ "type": {
1517
+ "type": "Any"
1398
1518
  }
1399
1519
  }
1400
1520
  ],
1401
1521
  "output": {
1522
+ "description": "The value returned from applying the last item to the reducer formula.",
1402
1523
  "type": {
1403
- "type": "Number"
1404
- },
1405
- "description": "Returns the input value if between the specified Min and Max. Otherwise, it returns the Min or Max value."
1524
+ "type": "Any"
1525
+ }
1406
1526
  }
1407
1527
  },
1408
- "@toddle/getCookie": {
1528
+ "@toddle/entries": {
1409
1529
  "$schema": "../../schemas/libFormula.schema.json",
1410
- "name": "Get Cookie",
1411
- "description": "Get the value of a cookie by name. This formula is available both server-side and client-side. Http-Only cookies will only be available server-side.",
1530
+ "name": "Entries",
1531
+ "description": "Get an Array of entries from a given Object.",
1412
1532
  "arguments": [
1413
1533
  {
1414
- "name": "Cookie name",
1534
+ "name": "Object",
1415
1535
  "formula": {
1416
1536
  "type": "value",
1417
1537
  "value": null
1418
1538
  },
1419
- "description": "The name of the cookie you want to get the value of.",
1539
+ "description": "Input record",
1420
1540
  "type": {
1421
- "type": "String"
1541
+ "type": "Object"
1422
1542
  }
1423
1543
  }
1424
1544
  ],
1425
1545
  "output": {
1426
- "description": "The value of the cookie. If a value is not found, this return value will be Null.",
1546
+ "description": "Returns an Array of entries for the given input record. The entries are Objects with a “Key” and “Value” property.",
1427
1547
  "type": {
1428
- "type": "String"
1548
+ "type": "Array"
1429
1549
  }
1430
1550
  }
1431
1551
  },
1432
- "@toddle/lastIndexOf": {
1552
+ "@toddle/shuffle": {
1433
1553
  "$schema": "../../schemas/libFormula.schema.json",
1434
- "name": "Last Index of",
1435
- "description": "Search an Array or String to find the index of the last occurrence of a specified item or substring.",
1554
+ "name": "Shuffle",
1555
+ "description": "Shuffle items in an Array or String.",
1556
+ "cache": false,
1436
1557
  "arguments": [
1437
1558
  {
1438
1559
  "name": "Array",
1439
1560
  "formula": {
1440
1561
  "type": "value",
1441
- "value": ""
1562
+ "value": null
1442
1563
  },
1443
- "description": "The value to search.",
1564
+ "description": "The input value.",
1444
1565
  "type": {
1445
1566
  "type": "Array \\| String"
1446
1567
  }
1447
- },
1448
- {
1449
- "name": "Item",
1450
- "formula": {
1451
- "type": "value",
1452
- "value": ""
1453
- },
1454
- "description": "The item or substring to search for.",
1455
- "type": {
1456
- "type": "Any"
1457
- }
1458
1568
  }
1459
1569
  ],
1460
1570
  "output": {
1461
- "description": "If the item or substring exists in the Array, the last index of that item is returned. If the item is not found, -1 is returned.",
1571
+ "description": "The shuffled Array or String.",
1462
1572
  "type": {
1463
- "type": "Number"
1573
+ "type": "Array \\| String"
1464
1574
  }
1465
1575
  }
1466
1576
  },
@@ -1503,157 +1613,231 @@
1503
1613
  }
1504
1614
  }
1505
1615
  },
1506
- "@toddle/getFromLocalStorage": {
1616
+ "@toddle/multiply": {
1507
1617
  "$schema": "../../schemas/libFormula.schema.json",
1508
- "name": "Get from Local Storage",
1509
- "description": "Read a value from local storage with the provided key.",
1510
- "cache": false,
1618
+ "name": "Multiply",
1619
+ "description": "Multiply two or more Numbers.",
1511
1620
  "arguments": [
1512
1621
  {
1513
- "name": "Key",
1622
+ "name": "0",
1514
1623
  "formula": {
1515
1624
  "type": "value",
1516
- "value": null
1625
+ "value": 1
1517
1626
  },
1518
- "description": "The key to read from local storage.",
1519
1627
  "type": {
1520
- "type": "String"
1521
- }
1628
+ "type": "Number"
1629
+ },
1630
+ "description": "Number to be multiplied."
1631
+ },
1632
+ {
1633
+ "name": "1",
1634
+ "formula": {
1635
+ "type": "value",
1636
+ "value": 1
1637
+ },
1638
+ "type": {
1639
+ "type": "Number"
1640
+ },
1641
+ "description": "Number to be multiplied."
1522
1642
  }
1523
1643
  ],
1644
+ "variableArguments": true,
1524
1645
  "output": {
1525
- "description": "The value found in local storage. If no value is found, this will return Null.",
1646
+ "description": "The product of multiplying the input Numbers.",
1526
1647
  "type": {
1527
- "type": "Any"
1648
+ "type": "Number"
1528
1649
  }
1529
1650
  }
1530
1651
  },
1531
- "@toddle/string": {
1652
+ "@toddle/add": {
1532
1653
  "$schema": "../../schemas/libFormula.schema.json",
1533
- "name": "String",
1534
- "description": "Convert a value of any type to a String.",
1654
+ "name": "Add",
1535
1655
  "arguments": [
1536
1656
  {
1537
- "name": "Input",
1538
- "description": "Value of any type.",
1657
+ "name": "0",
1658
+ "description": "Number to be added.",
1539
1659
  "type": {
1540
- "type": "Any"
1660
+ "type": "Number"
1541
1661
  },
1542
1662
  "formula": {
1543
1663
  "type": "value",
1544
- "value": "1"
1664
+ "value": 1
1665
+ }
1666
+ },
1667
+ {
1668
+ "name": "1",
1669
+ "type": {
1670
+ "type": "Number"
1671
+ },
1672
+ "description": "Number to be added.",
1673
+ "formula": {
1674
+ "type": "value",
1675
+ "value": 1
1545
1676
  }
1546
1677
  }
1547
1678
  ],
1679
+ "variableArguments": true,
1680
+ "description": "Get the sum of multiple numbers.",
1548
1681
  "output": {
1549
- "description": "The input value converted to a String",
1682
+ "description": "The sum of all the input numbers.",
1550
1683
  "type": {
1551
- "type": "String"
1684
+ "type": "Number"
1552
1685
  }
1553
1686
  }
1554
1687
  },
1555
- "@toddle/first": {
1688
+ "@toddle/json": {
1556
1689
  "$schema": "../../schemas/libFormula.schema.json",
1557
- "name": "First",
1558
- "description": "Return the first item in an Array.",
1690
+ "name": "JSON",
1691
+ "description": "Convert a value into a JSON String.",
1559
1692
  "arguments": [
1560
1693
  {
1561
- "name": "Array",
1694
+ "name": "Input",
1562
1695
  "formula": {
1563
1696
  "type": "value",
1564
- "value": []
1697
+ "value": null
1565
1698
  },
1699
+ "description": "The input value.",
1566
1700
  "type": {
1567
- "type": "Array"
1701
+ "type": "Any"
1702
+ }
1703
+ },
1704
+ {
1705
+ "name": "Indentation",
1706
+ "formula": {
1707
+ "type": "value",
1708
+ "value": 0
1568
1709
  },
1569
- "description": "An Array of items."
1710
+ "description": "The number of spaces used for indentation in the JSON String.",
1711
+ "type": {
1712
+ "type": "Number"
1713
+ }
1570
1714
  }
1571
1715
  ],
1572
1716
  "output": {
1573
- "description": "The first item in the Array.",
1717
+ "description": "The JSON String.",
1574
1718
  "type": {
1575
- "type": "Any"
1719
+ "type": "String"
1576
1720
  }
1577
1721
  }
1578
1722
  },
1579
- "@toddle/prepend": {
1723
+ "@toddle/find": {
1580
1724
  "$schema": "../../schemas/libFormula.schema.json",
1581
- "name": "Prepend",
1582
- "description": "Add an element to the start of an Array.",
1725
+ "name": "Find",
1726
+ "description": "Search through an Array of items and apply a formula to each item, to return the first item where the provided formula returns True.",
1583
1727
  "arguments": [
1584
1728
  {
1585
1729
  "name": "Array",
1730
+ "formula": {
1731
+ "type": "value",
1732
+ "value": null
1733
+ },
1734
+ "description": "The array to search through",
1586
1735
  "type": {
1587
1736
  "type": "Array"
1588
- },
1589
- "description": "The Array to prepend to.",
1590
- "formula": {
1591
- "type": "array",
1592
- "arguments": []
1593
1737
  }
1594
1738
  },
1595
1739
  {
1596
- "name": "Item",
1597
- "type": {
1598
- "type": "Any"
1599
- },
1600
- "description": "The item to prepend to the Array.",
1740
+ "name": "Formula",
1741
+ "isFunction": true,
1601
1742
  "formula": {
1602
- "type": "value",
1603
- "value": "Item"
1743
+ "type": "path",
1744
+ "path": [
1745
+ "Args",
1746
+ "item"
1747
+ ]
1748
+ },
1749
+ "description": "The predicate formula that each item in the array is passed to.",
1750
+ "type": {
1751
+ "type": "Formula"
1604
1752
  }
1605
1753
  }
1606
1754
  ],
1607
1755
  "output": {
1608
- "description": "A new Array containing the new item and all the elements from the input Array.",
1756
+ "description": "The first item in the Array where the formula returns True. Returns Null if the predicate formula did not return True for any item.",
1609
1757
  "type": {
1610
- "type": "Array"
1758
+ "type": "Any"
1611
1759
  }
1612
1760
  }
1613
1761
  },
1614
- "@toddle/groupBy": {
1762
+ "@toddle/branchName": {
1615
1763
  "$schema": "../../schemas/libFormula.schema.json",
1616
- "name": "Group by",
1617
- "description": "Group an Array of items into an Object based on a grouping formula.",
1764
+ "name": "Branch Name",
1765
+ "description": "Get the name of the current branch. For production, the branch name is 'main'.",
1766
+ "arguments": [],
1767
+ "output": {
1768
+ "description": "Returns the name of the current branch.",
1769
+ "type": {
1770
+ "type": "String"
1771
+ }
1772
+ }
1773
+ },
1774
+ "@toddle/encodeURIComponent": {
1775
+ "$schema": "../../schemas/libFormula.schema.json",
1776
+ "name": "Encode URI Component",
1777
+ "description": "Encode a URI component, escaping certain characters to their UTF-8 representation.",
1618
1778
  "arguments": [
1619
1779
  {
1620
- "name": "Array",
1780
+ "name": "URIComponent",
1621
1781
  "formula": {
1622
1782
  "type": "value",
1623
1783
  "value": null
1624
1784
  },
1625
- "description": "Array of items to be grouped.",
1785
+ "description": "The URI component to encode.",
1626
1786
  "type": {
1627
- "type": "Array"
1787
+ "type": "String"
1628
1788
  }
1629
- },
1789
+ }
1790
+ ],
1791
+ "output": {
1792
+ "description": "The encoded URI component.",
1793
+ "type": {
1794
+ "type": "String"
1795
+ }
1796
+ }
1797
+ },
1798
+ "@toddle/roundUp": {
1799
+ "$schema": "../../schemas/libFormula.schema.json",
1800
+ "name": "Round up",
1801
+ "description": "Round a Number up to the nearest decimal point.",
1802
+ "arguments": [
1630
1803
  {
1631
- "name": "Formula",
1632
- "isFunction": true,
1804
+ "name": "Input",
1805
+ "description": "Number to round up.",
1806
+ "type": {
1807
+ "type": "Number"
1808
+ },
1633
1809
  "formula": {
1634
1810
  "type": "value",
1635
- "value": null
1636
- },
1637
- "description": "The grouping formula used to group the items. The String returned from the formula will match the key in the output Oject.",
1811
+ "value": 1
1812
+ }
1813
+ },
1814
+ {
1815
+ "name": "Decimals",
1816
+ "description": "Number of decimals to round to.",
1638
1817
  "type": {
1639
- "type": "Formula"
1818
+ "type": "Number"
1819
+ },
1820
+ "formula": {
1821
+ "type": "value",
1822
+ "value": 0
1640
1823
  }
1641
1824
  }
1642
1825
  ],
1643
1826
  "output": {
1644
- "description": "An Object where each key matches a value returned by the grouping formula, and each value is the list of items that share the return value.",
1645
1827
  "type": {
1646
- "type": "Object"
1647
- }
1828
+ "type": "Number"
1829
+ },
1830
+ "description": "The rounded Number."
1648
1831
  }
1649
1832
  },
1650
- "@toddle/add": {
1833
+ "@toddle/divide": {
1651
1834
  "$schema": "../../schemas/libFormula.schema.json",
1652
- "name": "Add",
1835
+ "name": "Divide",
1836
+ "description": "Perform a division calculation.",
1653
1837
  "arguments": [
1654
1838
  {
1655
- "name": "0",
1656
- "description": "Number to be added.",
1839
+ "name": "Dividend",
1840
+ "description": "The number to be divided.",
1657
1841
  "type": {
1658
1842
  "type": "Number"
1659
1843
  },
@@ -1663,77 +1847,52 @@
1663
1847
  }
1664
1848
  },
1665
1849
  {
1666
- "name": "1",
1850
+ "name": "Divisor",
1851
+ "description": "The number to divide by.",
1667
1852
  "type": {
1668
1853
  "type": "Number"
1669
1854
  },
1670
- "description": "Number to be added.",
1671
1855
  "formula": {
1672
1856
  "type": "value",
1673
1857
  "value": 1
1674
1858
  }
1675
1859
  }
1676
1860
  ],
1677
- "variableArguments": true,
1678
- "description": "Get the sum of multiple numbers.",
1679
1861
  "output": {
1680
- "description": "The sum of all the input numbers.",
1862
+ "description": "The result of dividing the dividend with the divisor.",
1681
1863
  "type": {
1682
1864
  "type": "Number"
1683
1865
  }
1684
1866
  }
1685
1867
  },
1686
- "@toddle/userAgent": {
1687
- "$schema": "../../schemas/libFormula.schema.json",
1688
- "name": "User Agent",
1689
- "description": "Get the user agent for the browser or from the User-Agent header on the server",
1690
- "arguments": [],
1691
- "output": {
1692
- "description": "The user agent string.",
1693
- "type": {
1694
- "type": "String"
1695
- }
1696
- }
1697
- },
1698
- "@toddle/lessThan": {
1868
+ "@toddle/logarithm": {
1699
1869
  "$schema": "../../schemas/libFormula.schema.json",
1700
- "name": "Less than",
1701
- "description": "Compute if a value is smaller than another value.",
1870
+ "name": "Logarithm",
1871
+ "description": "Return the logarithm of a Number.",
1702
1872
  "arguments": [
1703
1873
  {
1704
- "name": "First",
1705
- "formula": {
1706
- "type": "value",
1707
- "value": ""
1708
- },
1709
- "description": "First Number to be compared.",
1710
- "type": {
1711
- "type": "Number"
1712
- }
1713
- },
1714
- {
1715
- "name": "Second",
1874
+ "name": "Number",
1716
1875
  "formula": {
1717
1876
  "type": "value",
1718
- "value": ""
1877
+ "value": 1
1719
1878
  },
1720
- "description": "Second Number to be compared.",
1879
+ "description": "A Number greater than or equal to 0.",
1721
1880
  "type": {
1722
1881
  "type": "Number"
1723
1882
  }
1724
1883
  }
1725
1884
  ],
1726
1885
  "output": {
1727
- "description": "Returns True if the First Number is smaller than the second Number, otherwise it returns False.",
1728
1886
  "type": {
1729
- "type": "Boolean"
1730
- }
1887
+ "type": "Number"
1888
+ },
1889
+ "description": "The natural logarithm of the Number."
1731
1890
  }
1732
1891
  },
1733
- "@toddle/fromEntries": {
1892
+ "@toddle/join": {
1734
1893
  "$schema": "../../schemas/libFormula.schema.json",
1735
- "name": "From entries",
1736
- "description": "Transform an Array of key-value pairs into an Object. This formula is the reverse of Entries.",
1894
+ "name": "Join",
1895
+ "description": "Combine an Array of Strings in to a single String.",
1737
1896
  "arguments": [
1738
1897
  {
1739
1898
  "name": "Array",
@@ -1741,217 +1900,190 @@
1741
1900
  "type": "value",
1742
1901
  "value": null
1743
1902
  },
1744
- "description": "An Array of Objects. Each Object should have a `key` and `value` property named `key` and `value` respectively e.g. `[{ key: 'yourKey', value: 'yourValue' }]`.",
1903
+ "description": "An array of Strings.",
1745
1904
  "type": {
1746
1905
  "type": "Array"
1747
1906
  }
1907
+ },
1908
+ {
1909
+ "name": "Separator",
1910
+ "formula": {
1911
+ "type": "value",
1912
+ "value": ", "
1913
+ },
1914
+ "description": "A separator String that is inserted in between each item in the Array to join.",
1915
+ "type": {
1916
+ "type": "String"
1917
+ }
1748
1918
  }
1749
1919
  ],
1750
1920
  "output": {
1751
- "description": "An Object containing all entries from the input Array in the format `{yourKey: yourValue}`.",
1921
+ "description": "A String combining each item in the input Array separated by the separator String, e.g. joining [\"a\", \"b\", \"c\"] with a \",\" separator will return \"a,b,c\".",
1752
1922
  "type": {
1753
- "type": "Object"
1923
+ "type": "String"
1754
1924
  }
1755
1925
  }
1756
1926
  },
1757
- "@toddle/unique": {
1927
+ "@toddle/deleteKey": {
1758
1928
  "$schema": "../../schemas/libFormula.schema.json",
1759
- "name": "Unique",
1760
- "description": "Remove duplicate values from an Array.",
1929
+ "name": "Delete",
1930
+ "description": "Return a copy of the input Object or Array without the specified key.",
1761
1931
  "arguments": [
1762
1932
  {
1763
- "name": "Array",
1933
+ "name": "Object",
1764
1934
  "formula": {
1765
1935
  "type": "value",
1766
- "value": []
1936
+ "value": null
1767
1937
  },
1938
+ "description": "The input record.",
1768
1939
  "type": {
1769
- "type": "Array"
1940
+ "type": "Array \\| Object"
1941
+ }
1942
+ },
1943
+ {
1944
+ "name": "Path",
1945
+ "formula": {
1946
+ "type": "value",
1947
+ "value": "Item"
1770
1948
  },
1771
- "description": "The input Array."
1949
+ "description": "The path can be either a Number (if the first argument is an array), a String, or an Array of strings. If an Array is given, the property at that path will be removed.",
1950
+ "type": {
1951
+ "type": "Array<Number \\| String> \\| Number \\| String"
1952
+ }
1772
1953
  }
1773
1954
  ],
1774
1955
  "output": {
1775
- "description": "The input Array with all duplicate values removed.",
1956
+ "description": "A copy of the record without the property specified in the Path.",
1776
1957
  "type": {
1777
- "type": "Array"
1958
+ "type": "Object"
1778
1959
  }
1779
1960
  }
1780
1961
  },
1781
- "@toddle/getHttpOnlyCookie": {
1962
+ "@toddle/not": {
1782
1963
  "$schema": "../../schemas/libFormula.schema.json",
1783
- "name": "Get Http-Only Cookie",
1784
- "description": "Get the value of an Http-Only cookie by name. This formula will is only intended to be used server-side for SSR/proxied API requests to read Http-Only cookies.",
1964
+ "name": "Not",
1965
+ "description": "Get the Boolean opposite of an input value.",
1785
1966
  "arguments": [
1786
1967
  {
1787
- "name": "Cookie name",
1968
+ "name": "Input",
1788
1969
  "formula": {
1789
1970
  "type": "value",
1790
- "value": null
1971
+ "value": true
1791
1972
  },
1792
- "description": "The name of the Http-Only cookie you want to get the value of.",
1973
+ "description": "The input value.",
1793
1974
  "type": {
1794
- "type": "String"
1975
+ "type": "Boolean"
1795
1976
  }
1796
1977
  }
1797
1978
  ],
1798
1979
  "output": {
1799
- "description": "The value of the cookie. If no cookie is found, this will return Null. If you use this formula client-side, it will return a placeholder template string.",
1800
- "type": {
1801
- "type": "String"
1802
- }
1803
- }
1804
- },
1805
- "@toddle/languages": {
1806
- "$schema": "../../schemas/libFormula.schema.json",
1807
- "name": "Languages",
1808
- "description": "An array of the preferred languages for the user, based on the Navigator.languages property (on the client) or the Accept-Language header (on the server).",
1809
- "arguments": [],
1810
- "output": {
1811
- "description": "An array with the preferred languages for the user.",
1980
+ "description": "Returns True if the input value is False, and False if the input value is True.",
1812
1981
  "type": {
1813
- "type": "Array"
1982
+ "type": "Boolean"
1814
1983
  }
1815
1984
  }
1816
1985
  },
1817
- "@toddle/lessOrEqual": {
1986
+ "@toddle/fromEntries": {
1818
1987
  "$schema": "../../schemas/libFormula.schema.json",
1819
- "name": "Less or equal",
1820
- "description": "Compute if a value is smaller than or equal to another value.",
1988
+ "name": "From entries",
1989
+ "description": "Transform an Array of key-value pairs into an Object. This formula is the reverse of Entries.",
1821
1990
  "arguments": [
1822
1991
  {
1823
- "name": "First",
1824
- "formula": {
1825
- "type": "value",
1826
- "value": ""
1827
- },
1828
- "description": "First Number to be compared.",
1829
- "type": {
1830
- "type": "Number"
1831
- }
1832
- },
1833
- {
1834
- "name": "Second",
1992
+ "name": "Array",
1835
1993
  "formula": {
1836
1994
  "type": "value",
1837
- "value": ""
1995
+ "value": null
1838
1996
  },
1839
- "description": "Second Number to be compared.",
1997
+ "description": "An Array of Objects. Each Object should have a `key` and `value` property named `key` and `value` respectively e.g. `[{ key: 'yourKey', value: 'yourValue' }]`.",
1840
1998
  "type": {
1841
- "type": "Number"
1999
+ "type": "Array"
1842
2000
  }
1843
2001
  }
1844
2002
  ],
1845
2003
  "output": {
1846
- "description": "Returns True if the First Number is smaller than or equal to the second Number, otherwise it returns False.",
2004
+ "description": "An Object containing all entries from the input Array in the format `{yourKey: yourValue}`.",
1847
2005
  "type": {
1848
- "type": "Boolean"
2006
+ "type": "Object"
1849
2007
  }
1850
2008
  }
1851
2009
  },
1852
- "@toddle/canShare": {
2010
+ "@toddle/defaultTo": {
1853
2011
  "$schema": "../../schemas/libFormula.schema.json",
1854
- "name": "Can Share",
1855
- "description": "Return a Boolean indicating whether the provided data can be shared (with the \"Share\" action).",
2012
+ "name": "Default to",
2013
+ "description": "Return the first value that is not False or Null.",
1856
2014
  "arguments": [
1857
2015
  {
1858
- "name": "URL",
1859
- "description": "The URL you want to check.",
1860
- "type": {
1861
- "type": "String"
1862
- },
2016
+ "name": "0",
1863
2017
  "formula": {
1864
2018
  "type": "value",
1865
2019
  "value": null
1866
- }
1867
- },
1868
- {
1869
- "name": "Title",
1870
- "description": "The title you want to check.",
1871
- "type": {
1872
- "type": "String"
1873
2020
  },
1874
- "formula": {
1875
- "type": "value",
1876
- "value": null
2021
+ "description": "The inital value.",
2022
+ "type": {
2023
+ "type": "Any"
1877
2024
  }
1878
2025
  },
1879
2026
  {
1880
- "name": "Text",
1881
- "description": "The text you want to check.",
2027
+ "name": "1",
2028
+ "description": "The first fallback value to be used if the primary value is Null or False.",
1882
2029
  "type": {
1883
- "type": "String"
2030
+ "type": "Any"
1884
2031
  },
1885
2032
  "formula": {
1886
2033
  "type": "value",
1887
- "value": null
2034
+ "value": "default"
1888
2035
  }
1889
2036
  }
1890
- ]
1891
- },
1892
- "@toddle/encodeBase64": {
1893
- "$schema": "../../schemas/libFormula.schema.json",
1894
- "name": "Encode to base64",
1895
- "arguments": [
1896
- {
1897
- "name": "Value",
1898
- "formula": {
1899
- "type": "value",
1900
- "value": "Input value"
1901
- },
1902
- "type": {
1903
- "type": "String"
1904
- },
1905
- "description": "The input string to be encoded."
1906
- }
1907
2037
  ],
1908
- "description": "Encode a string to base64.",
2038
+ "variableArguments": true,
1909
2039
  "output": {
1910
- "description": "The base 64 encoded string.",
2040
+ "description": "Returns the first value that is not False or Null. Returns Null if no valid values is given.",
1911
2041
  "type": {
1912
- "type": "String"
2042
+ "type": "Any"
1913
2043
  }
1914
2044
  }
1915
2045
  },
1916
- "@toddle/equals": {
2046
+ "@toddle/now": {
1917
2047
  "$schema": "../../schemas/libFormula.schema.json",
1918
- "name": "Equals",
1919
- "description": "Compute if values are identical.",
1920
- "arguments": [
1921
- {
1922
- "name": "First",
1923
- "formula": {
1924
- "type": "value",
1925
- "value": ""
1926
- },
1927
- "description": "First Value",
1928
- "type": {
1929
- "type": "Any"
1930
- }
1931
- },
2048
+ "name": "Now",
2049
+ "description": "Get a Date representing \"Now\"",
2050
+ "arguments": [],
2051
+ "cache": false,
2052
+ "output": {
2053
+ "description": "A Date object initialized at the current date/time.",
2054
+ "type": {
2055
+ "type": "Date"
2056
+ }
2057
+ }
2058
+ },
2059
+ "@toddle/typeOf": {
2060
+ "$schema": "../../schemas/libFormula.schema.json",
2061
+ "name": "Type of",
2062
+ "description": "Get the type of a given input.",
2063
+ "arguments": [
1932
2064
  {
1933
- "name": "Second",
2065
+ "name": "Input",
1934
2066
  "formula": {
1935
2067
  "type": "value",
1936
- "value": ""
2068
+ "value": 1
1937
2069
  },
1938
- "description": "Second Value",
2070
+ "description": "The input value.",
1939
2071
  "type": {
1940
2072
  "type": "Any"
1941
2073
  }
1942
2074
  }
1943
2075
  ],
1944
2076
  "output": {
1945
- "description": "Returns True if the input values are identical, otherwise False.",
2077
+ "description": "The type of the input value. Types can be one of: String, Boolean, Number, Array, Object, or Null.",
1946
2078
  "type": {
1947
- "type": "Boolean"
2079
+ "type": "Any"
1948
2080
  }
1949
2081
  }
1950
2082
  },
1951
- "@toddle/sort_by": {
2083
+ "@toddle/last": {
1952
2084
  "$schema": "../../schemas/libFormula.schema.json",
1953
- "name": "Sort by",
1954
- "description": "Sort an Array using a formula.",
2085
+ "name": "Last",
2086
+ "description": "Get the last item in an Array.",
1955
2087
  "arguments": [
1956
2088
  {
1957
2089
  "name": "Array",
@@ -1963,45 +2095,19 @@
1963
2095
  "type": "Array"
1964
2096
  },
1965
2097
  "description": "The input Array."
1966
- },
1967
- {
1968
- "name": "Formula",
1969
- "formula": {
1970
- "type": "path",
1971
- "path": [
1972
- "Args",
1973
- "item"
1974
- ]
1975
- },
1976
- "type": {
1977
- "type": "Formula"
1978
- },
1979
- "isFunction": true,
1980
- "description": "The sorting formula. The output of this formula will determine the sort order of the items. If the formula returns an Array, the items will first be sorted by the first item, then the second, etc."
1981
- },
1982
- {
1983
- "name": "Ascending?",
1984
- "formula": {
1985
- "type": "value",
1986
- "value": true
1987
- },
1988
- "type": {
1989
- "type": "Boolean"
1990
- },
1991
- "description": "Should the list be sorted in ascending order?"
1992
2098
  }
1993
2099
  ],
1994
2100
  "output": {
1995
- "description": "The input Array sorted by the value returned by the sorting formula.",
2101
+ "description": "The last item in the Array.",
1996
2102
  "type": {
1997
- "type": "Number"
2103
+ "type": "Any"
1998
2104
  }
1999
2105
  }
2000
2106
  },
2001
- "@toddle/map": {
2107
+ "@toddle/takeLast": {
2002
2108
  "$schema": "../../schemas/libFormula.schema.json",
2003
- "name": "Map",
2004
- "description": "Run a formula on each item of an Array to return a new Array.",
2109
+ "name": "Take last",
2110
+ "description": "Take items from the end of an Array or String.",
2005
2111
  "arguments": [
2006
2112
  {
2007
2113
  "name": "Array",
@@ -2009,317 +2115,339 @@
2009
2115
  "type": "value",
2010
2116
  "value": null
2011
2117
  },
2012
- "description": "The Array of items.",
2118
+ "description": "The input value.",
2013
2119
  "type": {
2014
- "type": "Array"
2120
+ "type": "Array \\| String"
2015
2121
  }
2016
2122
  },
2017
2123
  {
2018
- "name": "Formula",
2019
- "isFunction": true,
2124
+ "name": "Count",
2020
2125
  "formula": {
2021
- "type": "path",
2022
- "path": [
2023
- "Args",
2024
- "item"
2025
- ]
2126
+ "type": "value",
2127
+ "value": 1
2026
2128
  },
2027
- "description": "The formula to run on each item of the Array.",
2129
+ "description": "Number of items to take.",
2028
2130
  "type": {
2029
- "type": "Formula"
2131
+ "type": "Number"
2030
2132
  }
2031
2133
  }
2032
2134
  ],
2033
2135
  "output": {
2034
- "description": "A new Array containing all the values returned from running the provided formula on each item in the provided input Array.",
2136
+ "description": "The last items from the Array or String.",
2035
2137
  "type": {
2036
- "type": "Array"
2138
+ "type": "Array \\| String"
2037
2139
  }
2038
2140
  }
2039
2141
  },
2040
- "@toddle/entries": {
2142
+ "@toddle/flatten": {
2041
2143
  "$schema": "../../schemas/libFormula.schema.json",
2042
- "name": "Entries",
2043
- "description": "Get an Array of entries from a given Object.",
2144
+ "name": "Flatten",
2145
+ "description": "Flatten a nested Array.",
2044
2146
  "arguments": [
2045
2147
  {
2046
- "name": "Object",
2047
- "formula": {
2048
- "type": "value",
2049
- "value": null
2050
- },
2051
- "description": "Input record",
2148
+ "name": "Array",
2149
+ "description": "An Array containing one or more Arrays.",
2052
2150
  "type": {
2053
- "type": "Object"
2151
+ "type": "Array"
2152
+ },
2153
+ "formula": {
2154
+ "type": "array",
2155
+ "arguments": []
2054
2156
  }
2055
2157
  }
2056
2158
  ],
2057
2159
  "output": {
2058
- "description": "Returns an Array of entries for the given input record. The entries are Objects with a “Key” and “Value” property.",
2160
+ "description": "A flattened Array where all items in the original array are concatenated.",
2059
2161
  "type": {
2060
2162
  "type": "Array"
2061
2163
  }
2062
2164
  }
2063
2165
  },
2064
- "@toddle/getElementById": {
2166
+ "@toddle/uppercase": {
2065
2167
  "$schema": "../../schemas/libFormula.schema.json",
2066
- "name": "Get element by id",
2067
- "description": "Return a DOM element with a given id.",
2068
- "cache": false,
2168
+ "name": "Uppercase",
2169
+ "description": "Convert a String to uppercase.",
2069
2170
  "arguments": [
2070
2171
  {
2071
- "name": "Id",
2172
+ "name": "String",
2072
2173
  "formula": {
2073
2174
  "type": "value",
2074
- "value": "element-id"
2175
+ "value": "string"
2075
2176
  },
2177
+ "description": "Input String.",
2076
2178
  "type": {
2077
2179
  "type": "String"
2078
- },
2079
- "description": "The id of the DOM element to return."
2180
+ }
2080
2181
  }
2081
2182
  ],
2082
2183
  "output": {
2083
- "description": "The DOM element with the given id. If no DOM element is found, this will return Null.",
2184
+ "description": "The input String with all characters converted to uppercase.",
2084
2185
  "type": {
2085
- "type": "Element"
2186
+ "type": "String"
2086
2187
  }
2087
2188
  }
2088
2189
  },
2089
- "@toddle/decodeBase64": {
2190
+ "@toddle/sum": {
2090
2191
  "$schema": "../../schemas/libFormula.schema.json",
2091
- "name": "Decode base64",
2192
+ "name": "Sum",
2193
+ "description": "Return the sum of an Array of numbers",
2092
2194
  "arguments": [
2093
2195
  {
2094
- "name": "Base64 value",
2095
- "formula": {
2096
- "type": "value",
2097
- "value": "Input value"
2098
- },
2196
+ "name": "Array",
2099
2197
  "type": {
2100
- "type": "String"
2198
+ "type": "Array"
2101
2199
  },
2102
- "description": "The input data encoded as base64."
2200
+ "description": "The array of numbers to sum.",
2201
+ "formula": {
2202
+ "type": "array",
2203
+ "arguments": []
2204
+ }
2103
2205
  }
2104
2206
  ],
2105
- "description": "Deocde a base64 string to utf-8.",
2106
2207
  "output": {
2107
- "description": "The decoded string.",
2208
+ "description": "The total sum from adding all the numbers in the Array.",
2108
2209
  "type": {
2109
- "type": "String"
2210
+ "type": "Number"
2110
2211
  }
2111
2212
  }
2112
2213
  },
2113
- "@toddle/flatten": {
2214
+ "@toddle/first": {
2114
2215
  "$schema": "../../schemas/libFormula.schema.json",
2115
- "name": "Flatten",
2116
- "description": "Flatten a nested Array.",
2216
+ "name": "First",
2217
+ "description": "Return the first item in an Array.",
2117
2218
  "arguments": [
2118
2219
  {
2119
2220
  "name": "Array",
2120
- "description": "An Array containing one or more Arrays.",
2221
+ "formula": {
2222
+ "type": "value",
2223
+ "value": []
2224
+ },
2121
2225
  "type": {
2122
2226
  "type": "Array"
2123
2227
  },
2124
- "formula": {
2125
- "type": "array",
2126
- "arguments": []
2127
- }
2228
+ "description": "An Array of items."
2128
2229
  }
2129
2230
  ],
2130
2231
  "output": {
2131
- "description": "A flattened Array where all items in the original array are concatenated.",
2232
+ "description": "The first item in the Array.",
2132
2233
  "type": {
2133
- "type": "Array"
2234
+ "type": "Any"
2134
2235
  }
2135
2236
  }
2136
2237
  },
2137
- "@toddle/dropLast": {
2238
+ "@toddle/parseURL": {
2138
2239
  "$schema": "../../schemas/libFormula.schema.json",
2139
- "name": "Drop last",
2140
- "description": "Remove item(s) from the end of an Array or String.",
2240
+ "name": "Parse URL",
2241
+ "description": "Parse a URL",
2141
2242
  "arguments": [
2142
2243
  {
2143
- "name": "Array",
2244
+ "name": "URL",
2144
2245
  "formula": {
2145
2246
  "type": "value",
2146
2247
  "value": null
2147
2248
  },
2148
- "description": "The input value.",
2249
+ "description": "The URL value to parse.",
2149
2250
  "type": {
2150
- "type": "Array \\| String"
2251
+ "type": "String"
2151
2252
  }
2152
2253
  },
2153
2254
  {
2154
- "name": "Count",
2255
+ "name": "Base",
2155
2256
  "formula": {
2156
2257
  "type": "value",
2157
- "value": 1
2258
+ "value": null
2158
2259
  },
2260
+ "description": "An optional base for the URL. Use this to resolve relative URLs.",
2159
2261
  "type": {
2160
- "type": "Number"
2161
- },
2162
- "description": "Number of items to remove."
2262
+ "type": "String"
2263
+ }
2163
2264
  }
2164
2265
  ],
2165
2266
  "output": {
2166
- "description": "A copy of the list without the last item(s).",
2267
+ "description": "An object containing: \"hostname\", \"searchParams\", \"path\", \"hash\", \"href\", \"protocol\", \"port\", \"origin\"",
2167
2268
  "type": {
2168
- "type": "Array \\| String"
2269
+ "type": "Object"
2169
2270
  }
2170
2271
  }
2171
2272
  },
2172
- "@toddle/minus": {
2273
+ "@toddle/prepend": {
2173
2274
  "$schema": "../../schemas/libFormula.schema.json",
2174
- "name": "Minus",
2175
- "description": "Subtract a Number from a Number.",
2275
+ "name": "Prepend",
2276
+ "description": "Add an element to the start of an Array.",
2176
2277
  "arguments": [
2177
2278
  {
2178
- "name": "Minuend",
2179
- "formula": {
2180
- "type": "value",
2181
- "value": 1
2182
- },
2183
- "description": "The number to subtract from.",
2279
+ "name": "Array",
2184
2280
  "type": {
2185
- "type": "Number"
2281
+ "type": "Array"
2282
+ },
2283
+ "description": "The Array to prepend to.",
2284
+ "formula": {
2285
+ "type": "array",
2286
+ "arguments": []
2186
2287
  }
2187
2288
  },
2188
2289
  {
2189
- "name": "Substrahend",
2290
+ "name": "Item",
2291
+ "type": {
2292
+ "type": "Any"
2293
+ },
2294
+ "description": "The item to prepend to the Array.",
2190
2295
  "formula": {
2191
2296
  "type": "value",
2192
- "value": 1
2193
- },
2194
- "description": "The number to subtract.",
2195
- "type": {
2196
- "type": "Number"
2297
+ "value": "Item"
2197
2298
  }
2198
2299
  }
2199
2300
  ],
2200
2301
  "output": {
2201
- "description": "The result of subtracting the Substrahend from the Minuend.",
2302
+ "description": "A new Array containing the new item and all the elements from the input Array.",
2202
2303
  "type": {
2203
- "type": "Number"
2304
+ "type": "Array"
2204
2305
  }
2205
2306
  }
2206
2307
  },
2207
- "@toddle/max": {
2308
+ "@toddle/matches": {
2208
2309
  "$schema": "../../schemas/libFormula.schema.json",
2209
- "name": "Max",
2210
- "description": "Find the largest Number from a list of inputs.",
2310
+ "name": "Matches",
2311
+ "description": "Finds the (global) matches in a String based on a regular expression.",
2211
2312
  "arguments": [
2212
2313
  {
2213
- "name": "0",
2314
+ "name": "Input",
2315
+ "formula": {
2316
+ "type": "value",
2317
+ "value": ""
2318
+ },
2319
+ "description": "The string to search for matches in.",
2320
+ "type": {
2321
+ "type": "String"
2322
+ }
2323
+ },
2324
+ {
2325
+ "name": "Regular expression",
2326
+ "formula": {
2327
+ "type": "value",
2328
+ "value": ""
2329
+ },
2330
+ "description": "The regular expression to use for matching.",
2331
+ "type": {
2332
+ "type": "String"
2333
+ }
2334
+ },
2335
+ {
2336
+ "name": "Global search",
2337
+ "formula": {
2338
+ "type": "value",
2339
+ "value": true
2340
+ },
2341
+ "description": "Test the regular expression against all possible matches in a string.",
2342
+ "type": {
2343
+ "type": "Boolean"
2344
+ }
2345
+ },
2346
+ {
2347
+ "name": "Case insensitive",
2214
2348
  "formula": {
2215
2349
  "type": "value",
2216
- "value": null
2350
+ "value": false
2217
2351
  },
2218
- "description": "Input Number.",
2352
+ "description": "Ignore case while attempting a match in a string.",
2219
2353
  "type": {
2220
- "type": "Number"
2354
+ "type": "Boolean"
2221
2355
  }
2222
2356
  },
2223
2357
  {
2224
- "name": "1",
2358
+ "name": "Multi line",
2225
2359
  "formula": {
2226
2360
  "type": "value",
2227
- "value": null
2361
+ "value": false
2228
2362
  },
2229
- "description": "Input Number.",
2363
+ "description": "Treat multiline strings as multiple lines.",
2230
2364
  "type": {
2231
- "type": "Number"
2365
+ "type": "Boolean"
2232
2366
  }
2233
2367
  }
2234
2368
  ],
2235
- "variableArguments": true,
2236
2369
  "output": {
2237
- "description": "The largest of the input Numbers.",
2370
+ "description": "An Array of Strings",
2238
2371
  "type": {
2239
- "type": "Number"
2372
+ "type": "Array"
2240
2373
  }
2241
2374
  }
2242
2375
  },
2243
- "@toddle/every": {
2376
+ "@toddle/userAgent": {
2244
2377
  "$schema": "../../schemas/libFormula.schema.json",
2245
- "name": "Every",
2246
- "description": "Run a formula returns for all items in an Array.",
2378
+ "name": "User Agent",
2379
+ "description": "Get the user agent for the browser or from the User-Agent header on the server",
2380
+ "arguments": [],
2381
+ "output": {
2382
+ "description": "The user agent string.",
2383
+ "type": {
2384
+ "type": "String"
2385
+ }
2386
+ }
2387
+ },
2388
+ "@toddle/getCookie": {
2389
+ "$schema": "../../schemas/libFormula.schema.json",
2390
+ "name": "Get Cookie",
2391
+ "description": "Get the value of a cookie by name. This formula is available both server-side and client-side. Http-Only cookies will only be available server-side.",
2247
2392
  "arguments": [
2248
2393
  {
2249
- "name": "Array",
2394
+ "name": "Cookie name",
2250
2395
  "formula": {
2251
2396
  "type": "value",
2252
2397
  "value": null
2253
2398
  },
2254
- "description": "The array of items to evaluate.",
2255
- "type": {
2256
- "type": "Array"
2257
- }
2258
- },
2259
- {
2260
- "name": "Formula",
2261
- "isFunction": true,
2262
- "formula": {
2263
- "type": "path",
2264
- "path": [
2265
- "Args",
2266
- "item"
2267
- ]
2268
- },
2269
- "description": "Predicate formula for evaluating each item.",
2399
+ "description": "The name of the cookie you want to get the value of.",
2270
2400
  "type": {
2271
- "type": "Formula"
2401
+ "type": "String"
2272
2402
  }
2273
2403
  }
2274
2404
  ],
2275
2405
  "output": {
2276
- "description": "Returns True if the predicate formula returns true for all items in the Array, otherwise False.",
2406
+ "description": "The value of the cookie. If a value is not found, this return value will be Null.",
2277
2407
  "type": {
2278
- "type": "Array"
2408
+ "type": "String"
2279
2409
  }
2280
2410
  }
2281
2411
  },
2282
- "@toddle/min": {
2412
+ "@toddle/encodeJSON": {
2283
2413
  "$schema": "../../schemas/libFormula.schema.json",
2284
- "name": "Min",
2285
- "description": "Find the smallest Number from a list of inputs.",
2414
+ "name": "Encode JSON",
2415
+ "description": "Encode data as JSON.",
2286
2416
  "arguments": [
2287
2417
  {
2288
- "name": "0",
2418
+ "name": "Data",
2289
2419
  "formula": {
2290
2420
  "type": "value",
2291
2421
  "value": null
2292
2422
  },
2293
- "description": "Input number",
2423
+ "description": "The data to convert.",
2294
2424
  "type": {
2295
- "type": "Number"
2425
+ "type": "Any"
2296
2426
  }
2297
2427
  },
2298
2428
  {
2299
- "name": "1",
2429
+ "name": "Indent",
2300
2430
  "formula": {
2301
2431
  "type": "value",
2302
- "value": null
2432
+ "value": 2
2303
2433
  },
2304
- "description": "Input number",
2434
+ "description": "How many characters the encoded value will be indented.",
2305
2435
  "type": {
2306
2436
  "type": "Number"
2307
2437
  }
2308
2438
  }
2309
2439
  ],
2310
- "variableArguments": true,
2311
2440
  "output": {
2312
- "description": "The smallest of the input Numbers.",
2441
+ "description": "The encoded JSON value.",
2313
2442
  "type": {
2314
- "type": "Number"
2443
+ "type": "String"
2315
2444
  }
2316
2445
  }
2317
2446
  },
2318
- "@toddle/shuffle": {
2447
+ "@toddle/take": {
2319
2448
  "$schema": "../../schemas/libFormula.schema.json",
2320
- "name": "Shuffle",
2321
- "description": "Shuffle items in an Array or String.",
2322
- "cache": false,
2449
+ "name": "Take",
2450
+ "description": "Take items from the start of an Array or String.",
2323
2451
  "arguments": [
2324
2452
  {
2325
2453
  "name": "Array",
@@ -2327,37 +2455,13 @@
2327
2455
  "type": "value",
2328
2456
  "value": null
2329
2457
  },
2330
- "description": "The input value.",
2458
+ "description": "Input Array or String.",
2331
2459
  "type": {
2332
2460
  "type": "Array \\| String"
2333
2461
  }
2334
- }
2335
- ],
2336
- "output": {
2337
- "description": "The shuffled Array or String.",
2338
- "type": {
2339
- "type": "Array \\| String"
2340
- }
2341
- }
2342
- },
2343
- "@toddle/multiply": {
2344
- "$schema": "../../schemas/libFormula.schema.json",
2345
- "name": "Multiply",
2346
- "description": "Multiply two or more Numbers.",
2347
- "arguments": [
2348
- {
2349
- "name": "0",
2350
- "formula": {
2351
- "type": "value",
2352
- "value": 1
2353
- },
2354
- "type": {
2355
- "type": "Number"
2356
- },
2357
- "description": "Number to be multiplied."
2358
2462
  },
2359
2463
  {
2360
- "name": "1",
2464
+ "name": "Count",
2361
2465
  "formula": {
2362
2466
  "type": "value",
2363
2467
  "value": 1
@@ -2365,57 +2469,20 @@
2365
2469
  "type": {
2366
2470
  "type": "Number"
2367
2471
  },
2368
- "description": "Number to be multiplied."
2369
- }
2370
- ],
2371
- "variableArguments": true,
2372
- "output": {
2373
- "description": "The product of multiplying the input Numbers.",
2374
- "type": {
2375
- "type": "Number"
2376
- }
2377
- }
2378
- },
2379
- "@toddle/dateFromTimestamp": {
2380
- "$schema": "../../schemas/libFormula.schema.json",
2381
- "name": "Date From Timestamp",
2382
- "arguments": [
2383
- {
2384
- "name": "Timestamp",
2385
- "description": "A Number in milliseconds since 1st January, 1970 (EPOCH).",
2386
- "type": {
2387
- "type": "Number"
2388
- },
2389
- "formula": {
2390
- "type": "value",
2391
- "value": 1687787245933
2392
- }
2472
+ "description": "Number of items to take."
2393
2473
  }
2394
2474
  ],
2395
- "description": "Convert a timestamp (milliseconds) to a Date.",
2396
- "output": {
2397
- "description": "The input value converted to a Date.",
2398
- "type": {
2399
- "type": "Date"
2400
- }
2401
- }
2402
- },
2403
- "@toddle/branchName": {
2404
- "$schema": "../../schemas/libFormula.schema.json",
2405
- "name": "Branch Name",
2406
- "description": "Get the name of the current branch. For production, the branch name is 'main'.",
2407
- "arguments": [],
2408
2475
  "output": {
2409
- "description": "Returns the name of the current branch.",
2476
+ "description": "The first items from the Array or String.",
2410
2477
  "type": {
2411
- "type": "String"
2478
+ "type": "Array \\| String"
2412
2479
  }
2413
2480
  }
2414
2481
  },
2415
- "@toddle/boolean": {
2482
+ "@toddle/string": {
2416
2483
  "$schema": "../../schemas/libFormula.schema.json",
2417
- "name": "Boolean",
2418
- "description": "Convert a value of any type to a Boolean.",
2484
+ "name": "String",
2485
+ "description": "Convert a value of any type to a String.",
2419
2486
  "arguments": [
2420
2487
  {
2421
2488
  "name": "Input",
@@ -2430,75 +2497,99 @@
2430
2497
  }
2431
2498
  ],
2432
2499
  "output": {
2433
- "description": "The input value converted to a Boolean. False and Null will return False, all other values will return True.",
2500
+ "description": "The input value converted to a String",
2434
2501
  "type": {
2435
- "type": "Boolean"
2502
+ "type": "String"
2436
2503
  }
2437
2504
  }
2438
2505
  },
2439
- "@toddle/last": {
2506
+ "@toddle/greaterThan": {
2440
2507
  "$schema": "../../schemas/libFormula.schema.json",
2441
- "name": "Last",
2442
- "description": "Get the last item in an Array.",
2508
+ "name": "Greater than",
2509
+ "description": "Compute if a value is larger than another value.",
2443
2510
  "arguments": [
2444
2511
  {
2445
- "name": "Array",
2512
+ "name": "First",
2446
2513
  "formula": {
2447
2514
  "type": "value",
2448
- "value": []
2515
+ "value": ""
2449
2516
  },
2517
+ "description": "First value to be compared.",
2450
2518
  "type": {
2451
- "type": "Array"
2519
+ "type": "Number"
2520
+ }
2521
+ },
2522
+ {
2523
+ "name": "Second",
2524
+ "formula": {
2525
+ "type": "value",
2526
+ "value": ""
2452
2527
  },
2453
- "description": "The input Array."
2528
+ "description": "Second value to be compared.",
2529
+ "type": {
2530
+ "type": "Number"
2531
+ }
2454
2532
  }
2455
2533
  ],
2456
2534
  "output": {
2457
- "description": "The last item in the Array.",
2535
+ "description": "Returns True if the first Number is larger than the second Number.",
2458
2536
  "type": {
2459
- "type": "Any"
2537
+ "type": "Boolean"
2460
2538
  }
2461
2539
  }
2462
2540
  },
2463
- "@toddle/roundUp": {
2541
+ "@toddle/equals": {
2464
2542
  "$schema": "../../schemas/libFormula.schema.json",
2465
- "name": "Round up",
2466
- "description": "Round a Number up to the nearest decimal point.",
2543
+ "name": "Equals",
2544
+ "description": "Compute if values are identical.",
2467
2545
  "arguments": [
2468
2546
  {
2469
- "name": "Input",
2470
- "description": "Number to round up.",
2471
- "type": {
2472
- "type": "Number"
2473
- },
2547
+ "name": "First",
2474
2548
  "formula": {
2475
2549
  "type": "value",
2476
- "value": 1
2550
+ "value": ""
2551
+ },
2552
+ "description": "First Value",
2553
+ "type": {
2554
+ "type": "Any"
2477
2555
  }
2478
2556
  },
2479
2557
  {
2480
- "name": "Decimals",
2481
- "description": "Number of decimals to round to.",
2482
- "type": {
2483
- "type": "Number"
2484
- },
2558
+ "name": "Second",
2485
2559
  "formula": {
2486
2560
  "type": "value",
2487
- "value": 0
2561
+ "value": ""
2562
+ },
2563
+ "description": "Second Value",
2564
+ "type": {
2565
+ "type": "Any"
2488
2566
  }
2489
2567
  }
2490
2568
  ],
2491
2569
  "output": {
2570
+ "description": "Returns True if the input values are identical, otherwise False.",
2571
+ "type": {
2572
+ "type": "Boolean"
2573
+ }
2574
+ }
2575
+ },
2576
+ "@toddle/currentURL": {
2577
+ "$schema": "../../schemas/libFormula.schema.json",
2578
+ "name": "Current URL",
2579
+ "description": "Return the current URL of the browser. Use the \"Parse URL\" formula for working with the URL.",
2580
+ "arguments": [],
2581
+ "cache": false,
2582
+ "output": {
2583
+ "description": "The browser's current URL.",
2492
2584
  "type": {
2493
- "type": "Number"
2494
- },
2495
- "description": "The rounded Number."
2585
+ "type": "String"
2586
+ }
2496
2587
  }
2497
2588
  },
2498
- "@toddle/findLast": {
2589
+ "@toddle/findIndex": {
2499
2590
  "$schema": "../../schemas/libFormula.schema.json",
2500
- "name": "Find Last",
2501
- "description": "Search through an Array of items and apply a formula to each item, to return the last item where the formula returns True.",
2591
+ "name": "Find index",
2592
+ "description": "Search through an Array of items and apply a formula to each item, to return the index of the first item where the formula returns True.",
2502
2593
  "arguments": [
2503
2594
  {
2504
2595
  "name": "Array",
@@ -2528,156 +2619,111 @@
2528
2619
  }
2529
2620
  ],
2530
2621
  "output": {
2531
- "description": "The last item in the Array where the formula returns True. Returns Null if the predicate formula did not return True for any item.",
2622
+ "description": "The index of the first item in the Array where the predicate formula returns True. Returns -1 if the predicate formula did not return True for any item.",
2532
2623
  "type": {
2533
2624
  "type": "Any"
2534
2625
  }
2535
2626
  }
2536
2627
  },
2537
- "@toddle/json": {
2628
+ "@toddle/capitalize": {
2538
2629
  "$schema": "../../schemas/libFormula.schema.json",
2539
- "name": "JSON",
2540
- "description": "Convert a value into a JSON String.",
2630
+ "name": "Capitalize",
2631
+ "description": "Capitalize a string: make the first letter uppercase whilst keeping the rest lowercase.",
2541
2632
  "arguments": [
2542
2633
  {
2543
- "name": "Input",
2544
- "formula": {
2545
- "type": "value",
2546
- "value": null
2547
- },
2548
- "description": "The input value.",
2549
- "type": {
2550
- "type": "Any"
2551
- }
2552
- },
2553
- {
2554
- "name": "Indentation",
2634
+ "name": "String",
2555
2635
  "formula": {
2556
2636
  "type": "value",
2557
- "value": 0
2637
+ "value": "string"
2558
2638
  },
2559
- "description": "The number of spaces used for indentation in the JSON String.",
2639
+ "description": "An input String.",
2560
2640
  "type": {
2561
- "type": "Number"
2641
+ "type": "String"
2562
2642
  }
2563
2643
  }
2564
2644
  ],
2565
2645
  "output": {
2566
- "description": "The JSON String.",
2646
+ "description": "The capitalized String.",
2567
2647
  "type": {
2568
2648
  "type": "String"
2569
2649
  }
2570
2650
  }
2571
2651
  },
2572
- "@toddle/typeOf": {
2652
+ "@toddle/decodeURIComponent": {
2573
2653
  "$schema": "../../schemas/libFormula.schema.json",
2574
- "name": "Type of",
2575
- "description": "Get the type of a given input.",
2654
+ "name": "Decode URI Component",
2655
+ "description": "Decode a URI component that was previously encoded with the Encode URI Component formula.",
2576
2656
  "arguments": [
2577
2657
  {
2578
- "name": "Input",
2658
+ "name": "EncodedURI",
2579
2659
  "formula": {
2580
2660
  "type": "value",
2581
- "value": 1
2661
+ "value": null
2582
2662
  },
2583
- "description": "The input value.",
2584
2663
  "type": {
2585
- "type": "Any"
2586
- }
2664
+ "type": "String"
2665
+ },
2666
+ "description": "The encoded URI to decode."
2587
2667
  }
2588
2668
  ],
2589
2669
  "output": {
2590
- "description": "The type of the input value. Types can be one of: String, Boolean, Number, Array, Object, or Null.",
2670
+ "description": "The decoded URI component.",
2591
2671
  "type": {
2592
- "type": "Any"
2672
+ "type": "String"
2593
2673
  }
2594
2674
  }
2595
2675
  },
2596
- "@toddle/greaterThan": {
2676
+ "@toddle/languages": {
2597
2677
  "$schema": "../../schemas/libFormula.schema.json",
2598
- "name": "Greater than",
2599
- "description": "Compute if a value is larger than another value.",
2600
- "arguments": [
2601
- {
2602
- "name": "First",
2603
- "formula": {
2604
- "type": "value",
2605
- "value": ""
2606
- },
2607
- "description": "First value to be compared.",
2608
- "type": {
2609
- "type": "Number"
2610
- }
2611
- },
2612
- {
2613
- "name": "Second",
2614
- "formula": {
2615
- "type": "value",
2616
- "value": ""
2617
- },
2618
- "description": "Second value to be compared.",
2619
- "type": {
2620
- "type": "Number"
2621
- }
2622
- }
2623
- ],
2678
+ "name": "Languages",
2679
+ "description": "An array of the preferred languages for the user, based on the Navigator.languages property (on the client) or the Accept-Language header (on the server).",
2680
+ "arguments": [],
2624
2681
  "output": {
2625
- "description": "Returns True if the first Number is larger than the second Number.",
2682
+ "description": "An array with the preferred languages for the user.",
2626
2683
  "type": {
2627
- "type": "Boolean"
2684
+ "type": "Array"
2628
2685
  }
2629
2686
  }
2630
2687
  },
2631
- "@toddle/formatNumber": {
2688
+ "@toddle/modulo": {
2632
2689
  "$schema": "../../schemas/libFormula.schema.json",
2633
- "name": "Format Number",
2690
+ "name": "Modulo",
2691
+ "description": "Get the remainder when dividing two Numbers.",
2634
2692
  "arguments": [
2635
2693
  {
2636
- "name": "Input",
2637
- "description": "Number to format.",
2638
- "type": {
2639
- "type": "Number"
2640
- },
2694
+ "name": "Dividend",
2641
2695
  "formula": {
2642
2696
  "type": "value",
2643
- "value": 100
2644
- }
2645
- },
2646
- {
2647
- "name": "Locale(s)",
2648
- "description": "Optional locale to use for formatting the Number, e.g. \"en\" or \"fr\". Multiple locales can be provided (as an Array of Strings) to provide a fallback locale. The default value is the runtime's locale.",
2649
- "type": {
2650
- "type": "Array \\| String"
2697
+ "value": 1
2651
2698
  },
2652
- "formula": {
2653
- "type": "value",
2654
- "value": null
2699
+ "description": "The number to be divided.",
2700
+ "type": {
2701
+ "type": "Number"
2655
2702
  }
2656
2703
  },
2657
2704
  {
2658
- "name": "Options",
2659
- "description": "Optional Object for configuring the formatting of the output. See the [NumberFormat locale options on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locale_options).",
2660
- "type": {
2661
- "type": "Object"
2662
- },
2705
+ "name": "Divider",
2663
2706
  "formula": {
2664
2707
  "type": "value",
2665
- "value": null
2708
+ "value": 1
2709
+ },
2710
+ "description": "The number to divide by.",
2711
+ "type": {
2712
+ "type": "Number"
2666
2713
  }
2667
2714
  }
2668
2715
  ],
2669
- "description": "Format a Number using the Intl.NumberFormat API. See the [NumberFormat docs on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat).",
2670
2716
  "output": {
2671
- "description": "The Number input formatted as a String.",
2717
+ "description": "The remainder when the Dividend is divided by the Divider.",
2672
2718
  "type": {
2673
- "type": "String"
2719
+ "type": "Number"
2674
2720
  }
2675
2721
  }
2676
2722
  },
2677
- "@toddle/take": {
2723
+ "@toddle/map": {
2678
2724
  "$schema": "../../schemas/libFormula.schema.json",
2679
- "name": "Take",
2680
- "description": "Take items from the start of an Array or String.",
2725
+ "name": "Map",
2726
+ "description": "Run a formula on each item of an Array to return a new Array.",
2681
2727
  "arguments": [
2682
2728
  {
2683
2729
  "name": "Array",
@@ -2685,51 +2731,31 @@
2685
2731
  "type": "value",
2686
2732
  "value": null
2687
2733
  },
2688
- "description": "Input Array or String.",
2734
+ "description": "The Array of items.",
2689
2735
  "type": {
2690
- "type": "Array \\| String"
2736
+ "type": "Array"
2691
2737
  }
2692
2738
  },
2693
2739
  {
2694
- "name": "Count",
2695
- "formula": {
2696
- "type": "value",
2697
- "value": 1
2698
- },
2699
- "type": {
2700
- "type": "Number"
2701
- },
2702
- "description": "Number of items to take."
2703
- }
2704
- ],
2705
- "output": {
2706
- "description": "The first items from the Array or String.",
2707
- "type": {
2708
- "type": "Array \\| String"
2709
- }
2710
- }
2711
- },
2712
- "@toddle/decodeURIComponent": {
2713
- "$schema": "../../schemas/libFormula.schema.json",
2714
- "name": "Decode URI Component",
2715
- "description": "Decode a URI component that was previously encoded with the Encode URI Component formula.",
2716
- "arguments": [
2717
- {
2718
- "name": "EncodedURI",
2740
+ "name": "Formula",
2741
+ "isFunction": true,
2719
2742
  "formula": {
2720
- "type": "value",
2721
- "value": null
2743
+ "type": "path",
2744
+ "path": [
2745
+ "Args",
2746
+ "item"
2747
+ ]
2722
2748
  },
2749
+ "description": "The formula to run on each item of the Array.",
2723
2750
  "type": {
2724
- "type": "String"
2725
- },
2726
- "description": "The encoded URI to decode."
2751
+ "type": "Formula"
2752
+ }
2727
2753
  }
2728
2754
  ],
2729
2755
  "output": {
2730
- "description": "The decoded URI component.",
2756
+ "description": "A new Array containing all the values returned from running the provided formula on each item in the provided input Array.",
2731
2757
  "type": {
2732
- "type": "String"
2758
+ "type": "Array"
2733
2759
  }
2734
2760
  }
2735
2761
  },
@@ -2771,149 +2797,159 @@
2771
2797
  "description": "The resulting String."
2772
2798
  }
2773
2799
  },
2774
- "@toddle/currentURL": {
2800
+ "@toddle/lessThan": {
2775
2801
  "$schema": "../../schemas/libFormula.schema.json",
2776
- "name": "Current URL",
2777
- "description": "Return the current URL of the browser. Use the \"Parse URL\" formula for working with the URL.",
2778
- "arguments": [],
2779
- "cache": false,
2802
+ "name": "Less than",
2803
+ "description": "Compute if a value is smaller than another value.",
2804
+ "arguments": [
2805
+ {
2806
+ "name": "First",
2807
+ "formula": {
2808
+ "type": "value",
2809
+ "value": ""
2810
+ },
2811
+ "description": "First Number to be compared.",
2812
+ "type": {
2813
+ "type": "Number"
2814
+ }
2815
+ },
2816
+ {
2817
+ "name": "Second",
2818
+ "formula": {
2819
+ "type": "value",
2820
+ "value": ""
2821
+ },
2822
+ "description": "Second Number to be compared.",
2823
+ "type": {
2824
+ "type": "Number"
2825
+ }
2826
+ }
2827
+ ],
2780
2828
  "output": {
2781
- "description": "The browser's current URL.",
2829
+ "description": "Returns True if the First Number is smaller than the second Number, otherwise it returns False.",
2782
2830
  "type": {
2783
- "type": "String"
2831
+ "type": "Boolean"
2784
2832
  }
2785
2833
  }
2786
2834
  },
2787
- "@toddle/findIndex": {
2835
+ "@toddle/formatNumber": {
2788
2836
  "$schema": "../../schemas/libFormula.schema.json",
2789
- "name": "Find index",
2790
- "description": "Search through an Array of items and apply a formula to each item, to return the index of the first item where the formula returns True.",
2837
+ "name": "Format Number",
2791
2838
  "arguments": [
2792
2839
  {
2793
- "name": "Array",
2840
+ "name": "Input",
2841
+ "description": "Number to format.",
2842
+ "type": {
2843
+ "type": "Number"
2844
+ },
2794
2845
  "formula": {
2795
2846
  "type": "value",
2796
- "value": null
2797
- },
2798
- "description": "The array to search.",
2847
+ "value": 100
2848
+ }
2849
+ },
2850
+ {
2851
+ "name": "Locale(s)",
2852
+ "description": "Optional locale to use for formatting the Number, e.g. \"en\" or \"fr\". Multiple locales can be provided (as an Array of Strings) to provide a fallback locale. The default value is the runtime's locale.",
2799
2853
  "type": {
2800
- "type": "Array"
2854
+ "type": "Array \\| String"
2855
+ },
2856
+ "formula": {
2857
+ "type": "value",
2858
+ "value": null
2801
2859
  }
2802
2860
  },
2803
2861
  {
2804
- "name": "Formula",
2805
- "isFunction": true,
2806
- "formula": {
2807
- "type": "path",
2808
- "path": [
2809
- "Args",
2810
- "item"
2811
- ]
2812
- },
2813
- "description": "The predicate formula that each item in the Array is passed to.",
2862
+ "name": "Options",
2863
+ "description": "Optional Object for configuring the formatting of the output. See the [NumberFormat locale options on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locale_options).",
2814
2864
  "type": {
2815
- "type": "Formula"
2865
+ "type": "Object"
2866
+ },
2867
+ "formula": {
2868
+ "type": "value",
2869
+ "value": null
2816
2870
  }
2817
2871
  }
2818
2872
  ],
2873
+ "description": "Format a Number using the Intl.NumberFormat API. See the [NumberFormat docs on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat).",
2819
2874
  "output": {
2820
- "description": "The index of the first item in the Array where the predicate formula returns True. Returns -1 if the predicate formula did not return True for any item.",
2875
+ "description": "The Number input formatted as a String.",
2821
2876
  "type": {
2822
- "type": "Any"
2877
+ "type": "String"
2823
2878
  }
2824
2879
  }
2825
2880
  },
2826
- "@toddle/startsWith": {
2881
+ "@toddle/lastIndexOf": {
2827
2882
  "$schema": "../../schemas/libFormula.schema.json",
2828
- "name": "Starts with",
2829
- "description": "Check if a String has a given prefix.",
2883
+ "name": "Last Index of",
2884
+ "description": "Search an Array or String to find the index of the last occurrence of a specified item or substring.",
2830
2885
  "arguments": [
2831
2886
  {
2832
- "name": "String",
2887
+ "name": "Array",
2833
2888
  "formula": {
2834
2889
  "type": "value",
2835
2890
  "value": ""
2836
2891
  },
2837
- "description": "The String to check.",
2892
+ "description": "The value to search.",
2838
2893
  "type": {
2839
- "type": "String"
2894
+ "type": "Array \\| String"
2840
2895
  }
2841
2896
  },
2842
2897
  {
2843
- "name": "Prefix",
2898
+ "name": "Item",
2844
2899
  "formula": {
2845
2900
  "type": "value",
2846
2901
  "value": ""
2847
2902
  },
2848
- "description": "The prefix to check for.",
2903
+ "description": "The item or substring to search for.",
2849
2904
  "type": {
2850
- "type": "String"
2905
+ "type": "Any"
2851
2906
  }
2852
2907
  }
2853
2908
  ],
2854
2909
  "output": {
2855
- "description": "Returns True if the input String starts with the prefix, otherwise False",
2910
+ "description": "If the item or substring exists in the Array, the last index of that item is returned. If the item is not found, -1 is returned.",
2856
2911
  "type": {
2857
- "type": "Boolean"
2912
+ "type": "Number"
2858
2913
  }
2859
2914
  }
2860
2915
  },
2861
- "@toddle/encodeJSON": {
2916
+ "@toddle/size": {
2862
2917
  "$schema": "../../schemas/libFormula.schema.json",
2863
- "name": "Encode JSON",
2864
- "description": "Encode data as JSON.",
2918
+ "name": "Size",
2919
+ "description": "Get the size of an Array, Object or String.",
2865
2920
  "arguments": [
2866
2921
  {
2867
- "name": "Data",
2868
- "formula": {
2869
- "type": "value",
2870
- "value": null
2871
- },
2872
- "description": "The data to convert.",
2873
- "type": {
2874
- "type": "Any"
2875
- }
2876
- },
2877
- {
2878
- "name": "Indent",
2922
+ "name": "Collection",
2879
2923
  "formula": {
2880
2924
  "type": "value",
2881
- "value": 2
2925
+ "value": [
2926
+ 1,
2927
+ 2,
2928
+ 3
2929
+ ]
2882
2930
  },
2883
- "description": "How many characters the encoded value will be indented.",
2931
+ "description": "The collection to get the size of.",
2884
2932
  "type": {
2885
- "type": "Number"
2933
+ "type": "Array \\| Object \\| String"
2886
2934
  }
2887
2935
  }
2888
2936
  ],
2889
2937
  "output": {
2890
- "description": "The encoded JSON value.",
2938
+ "description": "The size of the collection.",
2891
2939
  "type": {
2892
- "type": "String"
2940
+ "type": "Number"
2893
2941
  }
2894
2942
  }
2895
2943
  },
2896
- "@toddle/number": {
2944
+ "@toddle/isServer": {
2897
2945
  "$schema": "../../schemas/libFormula.schema.json",
2898
- "name": "Number",
2899
- "description": "Convert a value of any type to a Number.",
2900
- "arguments": [
2901
- {
2902
- "name": "Input",
2903
- "description": "Value of any type",
2904
- "type": {
2905
- "type": "Any"
2906
- },
2907
- "formula": {
2908
- "type": "value",
2909
- "value": "1"
2910
- }
2911
- }
2912
- ],
2946
+ "name": "Is Server",
2947
+ "description": "Get information about whether formulas are currently evaluated server-side or client-side.",
2948
+ "arguments": [],
2913
2949
  "output": {
2914
- "description": "The input value converted to a Number.",
2950
+ "description": "Returns True if formulas are evaluated server-side, and False if formulas are evaluated client-side.",
2915
2951
  "type": {
2916
- "type": "Number"
2952
+ "type": "Boolean"
2917
2953
  }
2918
2954
  }
2919
2955
  },
@@ -2962,93 +2998,29 @@
2962
2998
  "type": "Object"
2963
2999
  }
2964
3000
  }
2965
- },
2966
- "@toddle/keyBy": {
2967
- "$schema": "../../schemas/libFormula.schema.json",
2968
- "name": "Key by",
2969
- "description": "Organize an Array of items into an Object based on a Key formula.",
2970
- "arguments": [
2971
- {
2972
- "name": "Array",
2973
- "formula": {
2974
- "type": "value",
2975
- "value": null
2976
- },
2977
- "description": "Array of items.",
2978
- "type": {
2979
- "type": "Array"
2980
- }
2981
- },
2982
- {
2983
- "name": "Formula",
2984
- "isFunction": true,
2985
- "formula": {
2986
- "type": "value",
2987
- "value": null
2988
- },
2989
- "description": "The key formula used to index the items. The String returned from the formula will match the key in the output Object.",
2990
- "type": {
2991
- "type": "Formula"
2992
- }
2993
- }
2994
- ],
2995
- "output": {
2996
- "description": "An Object where each key matches a value returned by the key formula, and each value is the item that String was returned for.",
2997
- "type": {
2998
- "type": "Object"
2999
- }
3000
- }
3001
3001
  }
3002
3002
  };
3003
3003
  export const actions = {
3004
- "@toddle/stopPropagation": {
3005
- "$schema": "../../schemas/libAction.schema.json",
3006
- "name": "Stop propagation",
3007
- "docs-link": "https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation",
3008
- "description": "Stop the event from bubbling up the DOM to parent elements.",
3009
- "group": "events",
3010
- "arguments": []
3011
- },
3012
- "@toddle/sleep": {
3004
+ "@toddle/setCookie": {
3013
3005
  "$schema": "../../schemas/libAction.schema.json",
3014
- "name": "Sleep",
3015
- "description": "Run an action after a delay.",
3016
- "group": "timers",
3006
+ "name": "Set cookie",
3007
+ "description": "Save a key/value pair as a non-http-only cookie (readable on the client). Useful for storing user preferences.",
3008
+ "group": "cookies",
3017
3009
  "arguments": [
3018
3010
  {
3019
- "name": "Delay in milliseconds",
3020
- "description": "The number of milliseconds to wait before an action is executed.",
3011
+ "name": "Name",
3012
+ "description": "The name of the cookie.",
3021
3013
  "type": {
3022
- "type": "Number"
3014
+ "type": "String"
3023
3015
  },
3024
3016
  "formula": {
3025
3017
  "type": "value",
3026
- "value": 500
3018
+ "value": ""
3027
3019
  }
3028
- }
3029
- ],
3030
- "events": {
3031
- "tick": {
3032
- "actions": []
3033
- }
3034
- }
3035
- },
3036
- "@toddle/clearSessionStorage": {
3037
- "$schema": "../../schemas/libAction.schema.json",
3038
- "name": "Clear session storage",
3039
- "description": "Delete all values in session storage.",
3040
- "group": "session_storage",
3041
- "arguments": []
3042
- },
3043
- "@toddle/deleteFromSessionStorage": {
3044
- "$schema": "../../schemas/libAction.schema.json",
3045
- "name": "Delete from session storage",
3046
- "description": "Delete a value from session storage (if found) based on the provided key.",
3047
- "group": "session_storage",
3048
- "arguments": [
3020
+ },
3049
3021
  {
3050
- "name": "Key",
3051
- "description": "The key in session storage to delete.",
3022
+ "name": "Value",
3023
+ "description": "The value to be stored in the cookie.",
3052
3024
  "type": {
3053
3025
  "type": "String"
3054
3026
  },
@@ -3056,42 +3028,34 @@
3056
3028
  "type": "value",
3057
3029
  "value": ""
3058
3030
  }
3059
- }
3060
- ]
3061
- },
3062
- "@toddle/setHttpOnlyCookie": {
3063
- "$schema": "../../schemas/libAction.schema.json",
3064
- "name": "Set HttpOnly cookie",
3065
- "description": "Save a key/value pair as an Http-Only cookie. Useful for storing JWTs or other tokens.",
3066
- "group": "cookies",
3067
- "arguments": [
3031
+ },
3068
3032
  {
3069
- "name": "Name",
3070
- "description": "The name of the cookie.",
3033
+ "name": "Expires in",
3034
+ "description": "(Optional) Time in seconds until the cookie expires. If this is null, the cookie will expire at the end of the user's session.",
3071
3035
  "type": {
3072
- "type": "String"
3036
+ "type": "Number"
3073
3037
  },
3074
3038
  "formula": {
3075
3039
  "type": "value",
3076
- "value": "access_token"
3040
+ "value": null
3077
3041
  }
3078
3042
  },
3079
3043
  {
3080
- "name": "Value",
3081
- "description": "The value to be stored in the cookie.",
3044
+ "name": "SameSite",
3045
+ "description": "(Optional) The SameSite attribute of the cookie. Defaults to Lax.",
3082
3046
  "type": {
3083
3047
  "type": "String"
3084
3048
  },
3085
3049
  "formula": {
3086
3050
  "type": "value",
3087
- "value": ""
3051
+ "value": null
3088
3052
  }
3089
3053
  },
3090
3054
  {
3091
- "name": "Expires in",
3092
- "description": "(Optional) Time in seconds until the cookie expires. This should be null for JWTs to use the JWT's expiration. If not provided, the cookie will be a session cookie. If set to 0, the cookie will be deleted.",
3055
+ "name": "Path",
3056
+ "description": "(Optional) The Path attribute of the cookie. Defaults to /.",
3093
3057
  "type": {
3094
- "type": "Number"
3058
+ "type": "String"
3095
3059
  },
3096
3060
  "formula": {
3097
3061
  "type": "value",
@@ -3099,49 +3063,92 @@
3099
3063
  }
3100
3064
  },
3101
3065
  {
3102
- "name": "SameSite",
3103
- "description": "(Optional) The SameSite attribute of the cookie. Defaults to Lax.",
3066
+ "name": "Include Subdomains",
3067
+ "description": "(Optional) Whether to include subdomains when setting the cookie. Defaults to true.",
3068
+ "type": {
3069
+ "type": "Boolean"
3070
+ },
3071
+ "formula": {
3072
+ "type": "value",
3073
+ "value": null
3074
+ }
3075
+ }
3076
+ ],
3077
+ "events": {
3078
+ "Success": {
3079
+ "description": "This event is triggered once the cookie has been saved.",
3080
+ "actions": []
3081
+ },
3082
+ "Error": {
3083
+ "description": "This event is triggered if the cookie could not be saved.",
3084
+ "actions": []
3085
+ }
3086
+ }
3087
+ },
3088
+ "@toddle/stopPropagation": {
3089
+ "$schema": "../../schemas/libAction.schema.json",
3090
+ "name": "Stop propagation",
3091
+ "docs-link": "https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation",
3092
+ "description": "Stop the event from bubbling up the DOM to parent elements.",
3093
+ "group": "events",
3094
+ "arguments": []
3095
+ },
3096
+ "@toddle/saveToLocalStorage": {
3097
+ "$schema": "../../schemas/libAction.schema.json",
3098
+ "name": "Save to local storage",
3099
+ "description": "Save a provided key/value to local storage by JSON encoding the value.",
3100
+ "group": "local_storage",
3101
+ "arguments": [
3102
+ {
3103
+ "name": "Key",
3104
+ "description": "The key to be used in local storage.",
3104
3105
  "type": {
3105
3106
  "type": "String"
3106
3107
  },
3107
3108
  "formula": {
3108
3109
  "type": "value",
3109
- "value": null
3110
+ "value": ""
3110
3111
  }
3111
3112
  },
3112
3113
  {
3113
- "name": "Path",
3114
- "description": "(Optional) The Path attribute of the cookie. Defaults to /.",
3114
+ "name": "Value",
3115
+ "description": "The value that should be saved in local storage. This can be anything that is serializable (String, Number, Boolean, Array or Object).",
3115
3116
  "type": {
3116
- "type": "String"
3117
+ "type": "Any"
3117
3118
  },
3118
3119
  "formula": {
3119
3120
  "type": "value",
3120
3121
  "value": null
3121
3122
  }
3122
- },
3123
+ }
3124
+ ]
3125
+ },
3126
+ "@toddle/copyToClipboard": {
3127
+ "$schema": "../../schemas/libAction.schema.json",
3128
+ "name": "Copy to clipboard",
3129
+ "description": "Copy contents to the clipboard.",
3130
+ "group": "sharing",
3131
+ "arguments": [
3123
3132
  {
3124
- "name": "Include Subdomains",
3125
- "description": "(Optional) Whether to include subdomains when setting the cookie. Defaults to true.",
3133
+ "name": "Value",
3134
+ "description": "The value you want to copy.",
3126
3135
  "type": {
3127
- "type": "Boolean"
3136
+ "type": "String"
3128
3137
  },
3129
3138
  "formula": {
3130
3139
  "type": "value",
3131
- "value": null
3140
+ "value": "<Param Value>"
3132
3141
  }
3133
3142
  }
3134
- ],
3135
- "events": {
3136
- "Success": {
3137
- "description": "This event is triggered once the cookie has been saved.",
3138
- "actions": []
3139
- },
3140
- "Error": {
3141
- "description": "This event is triggered if the cookie could not be saved.",
3142
- "actions": []
3143
- }
3144
- }
3143
+ ]
3144
+ },
3145
+ "@toddle/preventDefault": {
3146
+ "$schema": "../../schemas/libAction.schema.json",
3147
+ "name": "Prevent default",
3148
+ "docs-link": "https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault",
3149
+ "description": "Prevent default browser behavior for this event.",
3150
+ "group": "events",
3151
+ "arguments": []
3145
3152
  },
3146
3153
  "@toddle/setSessionCookies": {
3147
3154
  "$schema": "../../schemas/libAction.schema.json",
@@ -3183,45 +3190,37 @@
3183
3190
  }
3184
3191
  }
3185
3192
  },
3186
- "@toddle/saveToLocalStorage": {
3193
+ "@toddle/share": {
3187
3194
  "$schema": "../../schemas/libAction.schema.json",
3188
- "name": "Save to local storage",
3189
- "description": "Save a provided key/value to local storage by JSON encoding the value.",
3190
- "group": "local_storage",
3195
+ "name": "Share",
3196
+ "description": "Share data with title, text, and/or URL using the Navigator.share API.",
3197
+ "group": "sharing",
3191
3198
  "arguments": [
3192
3199
  {
3193
- "name": "Key",
3194
- "description": "The key to be used in local storage.",
3200
+ "name": "URL",
3201
+ "description": "The URL to share.",
3195
3202
  "type": {
3196
3203
  "type": "String"
3197
3204
  },
3198
3205
  "formula": {
3199
3206
  "type": "value",
3200
- "value": ""
3207
+ "value": null
3201
3208
  }
3202
3209
  },
3203
3210
  {
3204
- "name": "Value",
3205
- "description": "The value that should be saved in local storage. This can be anything that is serializable (String, Number, Boolean, Array or Object).",
3211
+ "name": "Title",
3212
+ "description": "The title to share.",
3206
3213
  "type": {
3207
- "type": "Any"
3214
+ "type": "String"
3208
3215
  },
3209
3216
  "formula": {
3210
3217
  "type": "value",
3211
3218
  "value": null
3212
3219
  }
3213
- }
3214
- ]
3215
- },
3216
- "@toddle/share": {
3217
- "$schema": "../../schemas/libAction.schema.json",
3218
- "name": "Share",
3219
- "description": "Share data with title, text, and/or URL using the Navigator.share API.",
3220
- "group": "sharing",
3221
- "arguments": [
3220
+ },
3222
3221
  {
3223
- "name": "URL",
3224
- "description": "The URL to share.",
3222
+ "name": "Text",
3223
+ "description": "The text to share.",
3225
3224
  "type": {
3226
3225
  "type": "String"
3227
3226
  },
@@ -3229,27 +3228,43 @@
3229
3228
  "type": "value",
3230
3229
  "value": null
3231
3230
  }
3232
- },
3231
+ }
3232
+ ]
3233
+ },
3234
+ "@toddle/deleteFromLocalStorage": {
3235
+ "$schema": "../../schemas/libAction.schema.json",
3236
+ "name": "Delete from local storage",
3237
+ "description": "Delete a value from local storage (if found) based on the provided key.",
3238
+ "group": "local_storage",
3239
+ "arguments": [
3233
3240
  {
3234
- "name": "Title",
3235
- "description": "The title to share.",
3241
+ "name": "Key",
3242
+ "description": "The key in local storage to delete.",
3236
3243
  "type": {
3237
3244
  "type": "String"
3238
3245
  },
3239
3246
  "formula": {
3240
3247
  "type": "value",
3241
- "value": null
3248
+ "value": ""
3242
3249
  }
3243
- },
3250
+ }
3251
+ ]
3252
+ },
3253
+ "@toddle/gotToURL": {
3254
+ "$schema": "../../schemas/libAction.schema.json",
3255
+ "name": "Go to URL",
3256
+ "description": "Navigate to a specified URL.",
3257
+ "group": "navigation",
3258
+ "arguments": [
3244
3259
  {
3245
- "name": "Text",
3246
- "description": "The text to share.",
3260
+ "name": "URL",
3261
+ "description": "The URL to navigate to.",
3247
3262
  "type": {
3248
3263
  "type": "String"
3249
3264
  },
3250
3265
  "formula": {
3251
3266
  "type": "value",
3252
- "value": null
3267
+ "value": "https://example.com"
3253
3268
  }
3254
3269
  }
3255
3270
  ]
@@ -3278,75 +3293,66 @@
3278
3293
  }
3279
3294
  }
3280
3295
  },
3281
- "@toddle/logToConsole": {
3296
+ "@toddle/saveToSessionStorage": {
3282
3297
  "$schema": "../../schemas/libAction.schema.json",
3283
- "name": "Log to console",
3284
- "description": "Log a message to the browser console.",
3285
- "group": "debugging",
3298
+ "name": "Save to session storage",
3299
+ "description": "Save a provided key/value to session storage by JSON encoding the value.",
3300
+ "group": "session_storage",
3286
3301
  "arguments": [
3287
3302
  {
3288
- "name": "Label",
3289
- "description": "A label for the message.",
3303
+ "name": "Key",
3304
+ "description": "The key to be used in session storage.",
3305
+ "type": {
3306
+ "type": "String"
3307
+ },
3290
3308
  "formula": {
3291
3309
  "type": "value",
3292
3310
  "value": ""
3293
3311
  }
3294
3312
  },
3295
3313
  {
3296
- "name": "Data",
3314
+ "name": "Value",
3315
+ "description": "The value that should be saved in session storage. This can be anything that is serializable (String, Number, Boolean, Array or Object).",
3297
3316
  "type": {
3298
3317
  "type": "Any"
3299
3318
  },
3300
- "description": "The data you want to log to the console.",
3301
3319
  "formula": {
3302
3320
  "type": "value",
3303
- "value": "<Data>"
3321
+ "value": null
3304
3322
  }
3305
3323
  }
3306
3324
  ]
3307
3325
  },
3308
- "@toddle/deleteFromLocalStorage": {
3326
+ "@toddle/clearSessionStorage": {
3309
3327
  "$schema": "../../schemas/libAction.schema.json",
3310
- "name": "Delete from local storage",
3311
- "description": "Delete a value from local storage (if found) based on the provided key.",
3312
- "group": "local_storage",
3328
+ "name": "Clear session storage",
3329
+ "description": "Delete all values in session storage.",
3330
+ "group": "session_storage",
3331
+ "arguments": []
3332
+ },
3333
+ "@toddle/logToConsole": {
3334
+ "$schema": "../../schemas/libAction.schema.json",
3335
+ "name": "Log to console",
3336
+ "description": "Log a message to the browser console.",
3337
+ "group": "debugging",
3313
3338
  "arguments": [
3314
3339
  {
3315
- "name": "Key",
3316
- "description": "The key in local storage to delete.",
3317
- "type": {
3318
- "type": "String"
3319
- },
3340
+ "name": "Label",
3341
+ "description": "A label for the message.",
3320
3342
  "formula": {
3321
3343
  "type": "value",
3322
3344
  "value": ""
3323
3345
  }
3324
- }
3325
- ]
3326
- },
3327
- "@toddle/preventDefault": {
3328
- "$schema": "../../schemas/libAction.schema.json",
3329
- "name": "Prevent default",
3330
- "docs-link": "https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault",
3331
- "description": "Prevent default browser behavior for this event.",
3332
- "group": "events",
3333
- "arguments": []
3334
- },
3335
- "@toddle/focus": {
3336
- "$schema": "../../schemas/libAction.schema.json",
3337
- "name": "Focus",
3338
- "description": "Move focus to a DOM element.",
3339
- "group": "events",
3340
- "arguments": [
3346
+ },
3341
3347
  {
3342
- "name": "Element",
3343
- "description": "The DOM element that should receive focus.",
3348
+ "name": "Data",
3344
3349
  "type": {
3345
- "type": "Element"
3350
+ "type": "Any"
3346
3351
  },
3352
+ "description": "The data you want to log to the console.",
3347
3353
  "formula": {
3348
3354
  "type": "value",
3349
- "value": null
3355
+ "value": "<Data>"
3350
3356
  }
3351
3357
  }
3352
3358
  ]
@@ -3358,10 +3364,10 @@
3358
3364
  "group": "local_storage",
3359
3365
  "arguments": []
3360
3366
  },
3361
- "@toddle/setCookie": {
3367
+ "@toddle/setHttpOnlyCookie": {
3362
3368
  "$schema": "../../schemas/libAction.schema.json",
3363
- "name": "Set cookie",
3364
- "description": "Save a key/value pair as a non-http-only cookie (readable on the client). Useful for storing user preferences.",
3369
+ "name": "Set HttpOnly cookie",
3370
+ "description": "Save a key/value pair as an Http-Only cookie. Useful for storing JWTs or other tokens.",
3365
3371
  "group": "cookies",
3366
3372
  "arguments": [
3367
3373
  {
@@ -3372,7 +3378,7 @@
3372
3378
  },
3373
3379
  "formula": {
3374
3380
  "type": "value",
3375
- "value": ""
3381
+ "value": "access_token"
3376
3382
  }
3377
3383
  },
3378
3384
  {
@@ -3388,7 +3394,7 @@
3388
3394
  },
3389
3395
  {
3390
3396
  "name": "Expires in",
3391
- "description": "(Optional) Time in seconds until the cookie expires. If this is null, the cookie will expire at the end of the user's session.",
3397
+ "description": "(Optional) Time in seconds until the cookie expires. This should be null for JWTs to use the JWT's expiration. If not provided, the cookie will be a session cookie. If set to 0, the cookie will be deleted.",
3392
3398
  "type": {
3393
3399
  "type": "Number"
3394
3400
  },
@@ -3442,47 +3448,41 @@
3442
3448
  }
3443
3449
  }
3444
3450
  },
3445
- "@toddle/copyToClipboard": {
3451
+ "@toddle/sleep": {
3446
3452
  "$schema": "../../schemas/libAction.schema.json",
3447
- "name": "Copy to clipboard",
3448
- "description": "Copy contents to the clipboard.",
3449
- "group": "sharing",
3453
+ "name": "Sleep",
3454
+ "description": "Run an action after a delay.",
3455
+ "group": "timers",
3450
3456
  "arguments": [
3451
3457
  {
3452
- "name": "Value",
3453
- "description": "The value you want to copy.",
3458
+ "name": "Delay in milliseconds",
3459
+ "description": "The number of milliseconds to wait before an action is executed.",
3454
3460
  "type": {
3455
- "type": "String"
3461
+ "type": "Number"
3456
3462
  },
3457
3463
  "formula": {
3458
3464
  "type": "value",
3459
- "value": "<Param Value>"
3465
+ "value": 500
3460
3466
  }
3461
3467
  }
3462
- ]
3468
+ ],
3469
+ "events": {
3470
+ "tick": {
3471
+ "actions": []
3472
+ }
3473
+ }
3463
3474
  },
3464
- "@toddle/saveToSessionStorage": {
3475
+ "@toddle/focus": {
3465
3476
  "$schema": "../../schemas/libAction.schema.json",
3466
- "name": "Save to session storage",
3467
- "description": "Save a provided key/value to session storage by JSON encoding the value.",
3468
- "group": "session_storage",
3477
+ "name": "Focus",
3478
+ "description": "Move focus to a DOM element.",
3479
+ "group": "events",
3469
3480
  "arguments": [
3470
3481
  {
3471
- "name": "Key",
3472
- "description": "The key to be used in session storage.",
3473
- "type": {
3474
- "type": "String"
3475
- },
3476
- "formula": {
3477
- "type": "value",
3478
- "value": ""
3479
- }
3480
- },
3481
- {
3482
- "name": "Value",
3483
- "description": "The value that should be saved in session storage. This can be anything that is serializable (String, Number, Boolean, Array or Object).",
3482
+ "name": "Element",
3483
+ "description": "The DOM element that should receive focus.",
3484
3484
  "type": {
3485
- "type": "Any"
3485
+ "type": "Element"
3486
3486
  },
3487
3487
  "formula": {
3488
3488
  "type": "value",
@@ -3491,21 +3491,21 @@
3491
3491
  }
3492
3492
  ]
3493
3493
  },
3494
- "@toddle/gotToURL": {
3494
+ "@toddle/deleteFromSessionStorage": {
3495
3495
  "$schema": "../../schemas/libAction.schema.json",
3496
- "name": "Go to URL",
3497
- "description": "Navigate to a specified URL.",
3498
- "group": "navigation",
3496
+ "name": "Delete from session storage",
3497
+ "description": "Delete a value from session storage (if found) based on the provided key.",
3498
+ "group": "session_storage",
3499
3499
  "arguments": [
3500
3500
  {
3501
- "name": "URL",
3502
- "description": "The URL to navigate to.",
3501
+ "name": "Key",
3502
+ "description": "The key in session storage to delete.",
3503
3503
  "type": {
3504
3504
  "type": "String"
3505
3505
  },
3506
3506
  "formula": {
3507
3507
  "type": "value",
3508
- "value": "https://example.com"
3508
+ "value": ""
3509
3509
  }
3510
3510
  }
3511
3511
  ]