@bpmn-io/feel-editor 1.9.1 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +62 -35
- package/dist/index.js +62 -35
- package/package.json +22 -21
package/dist/index.es.js
CHANGED
|
@@ -391,9 +391,14 @@ function completions({ variables = [], builtins = [] }) {
|
|
|
391
391
|
* @typedef { 'expression' | 'unaryTests' } Dialect
|
|
392
392
|
*/
|
|
393
393
|
|
|
394
|
+
/**
|
|
395
|
+
* @typedef { 'camunda' | undefined } ParserDialect
|
|
396
|
+
*/
|
|
397
|
+
|
|
394
398
|
/**
|
|
395
399
|
* @param { {
|
|
396
400
|
* dialect?: Dialect,
|
|
401
|
+
* parserDialect?: ParserDialect,
|
|
397
402
|
* context?: Record<string, any>,
|
|
398
403
|
* completions?: import('@codemirror/autocomplete').CompletionSource[]
|
|
399
404
|
* } } options
|
|
@@ -409,7 +414,7 @@ function language(options) {
|
|
|
409
414
|
*
|
|
410
415
|
* @return {Record<string, any>}
|
|
411
416
|
*/
|
|
412
|
-
function createContext(variables
|
|
417
|
+
function createContext(variables) {
|
|
413
418
|
return variables.slice().reverse().reduce((context, builtin) => {
|
|
414
419
|
context[builtin.name] = () => {};
|
|
415
420
|
|
|
@@ -418,7 +423,8 @@ function createContext(variables, builtins) {
|
|
|
418
423
|
}
|
|
419
424
|
|
|
420
425
|
/**
|
|
421
|
-
* @typedef { '
|
|
426
|
+
* @typedef { import('../language').Dialect } Dialect
|
|
427
|
+
* @typedef { import('../language').ParserDialect } ParserDialect
|
|
422
428
|
* @typedef { import('..').Variable } Variable
|
|
423
429
|
*/
|
|
424
430
|
|
|
@@ -433,10 +439,15 @@ const builtinsFacet = Facet.define();
|
|
|
433
439
|
const variablesFacet = Facet.define();
|
|
434
440
|
|
|
435
441
|
/**
|
|
436
|
-
* @type {Facet<
|
|
442
|
+
* @type {Facet<Dialect>}
|
|
437
443
|
*/
|
|
438
444
|
const dialectFacet = Facet.define();
|
|
439
445
|
|
|
446
|
+
/**
|
|
447
|
+
* @type {Facet<ParserDialect>}
|
|
448
|
+
*/
|
|
449
|
+
const parserDialectFacet = Facet.define();
|
|
450
|
+
|
|
440
451
|
/**
|
|
441
452
|
* @typedef {object} Variable
|
|
442
453
|
* @property {string} name name or key of the variable
|
|
@@ -451,6 +462,7 @@ const dialectFacet = Facet.define();
|
|
|
451
462
|
/**
|
|
452
463
|
* @typedef { {
|
|
453
464
|
* dialect?: import('../language').Dialect,
|
|
465
|
+
* parserDialect?: import('../language').ParserDialect,
|
|
454
466
|
* variables?: Variable[],
|
|
455
467
|
* builtins?: Variable[]
|
|
456
468
|
* } } CoreConfig
|
|
@@ -466,6 +478,7 @@ const dialectFacet = Facet.define();
|
|
|
466
478
|
*/
|
|
467
479
|
function configure({
|
|
468
480
|
dialect = 'expression',
|
|
481
|
+
parserDialect,
|
|
469
482
|
variables = [],
|
|
470
483
|
builtins = [],
|
|
471
484
|
completions: completions$1 = completions({ builtins, variables })
|
|
@@ -477,8 +490,10 @@ function configure({
|
|
|
477
490
|
dialectFacet.of(dialect),
|
|
478
491
|
builtinsFacet.of(builtins),
|
|
479
492
|
variablesFacet.of(variables),
|
|
493
|
+
parserDialectFacet.of(parserDialect),
|
|
480
494
|
language({
|
|
481
495
|
dialect,
|
|
496
|
+
parserDialect,
|
|
482
497
|
context,
|
|
483
498
|
completions: completions$1
|
|
484
499
|
})
|
|
@@ -495,11 +510,13 @@ function get(state) {
|
|
|
495
510
|
const builtins = state.facet(builtinsFacet)[0];
|
|
496
511
|
const variables = state.facet(variablesFacet)[0];
|
|
497
512
|
const dialect = state.facet(dialectFacet)[0];
|
|
513
|
+
const parserDialect = state.facet(parserDialectFacet)[0];
|
|
498
514
|
|
|
499
515
|
return {
|
|
500
516
|
builtins,
|
|
501
517
|
variables,
|
|
502
|
-
dialect
|
|
518
|
+
dialect,
|
|
519
|
+
parserDialect
|
|
503
520
|
};
|
|
504
521
|
}
|
|
505
522
|
|
|
@@ -554,7 +571,7 @@ var camundaTags = [
|
|
|
554
571
|
},
|
|
555
572
|
{
|
|
556
573
|
name: "number(from)",
|
|
557
|
-
description: "<p>Parses the given string to a number.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">number(from: string): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">number("1500.5")\n// 1500.5\n</code></pre>\n"
|
|
574
|
+
description: "<p>Parses the given string to a number.</p>\n<p>Returns <code>null</code> if the string is not a number.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">number(from: string): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">number("1500.5")\n// 1500.5\n</code></pre>\n"
|
|
558
575
|
},
|
|
559
576
|
{
|
|
560
577
|
name: "context(entries)",
|
|
@@ -562,11 +579,11 @@ var camundaTags = [
|
|
|
562
579
|
},
|
|
563
580
|
{
|
|
564
581
|
name: "date(from)",
|
|
565
|
-
description: "<p>Returns a date from the given value.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">date(from: string): date\n</code></pre>\n<p>Parses the given string into a date.</p>\n<pre><code class=\"language-feel\">date(from: date and time): date\n</code></pre>\n<p>Extracts the date component from the given date and time.</p>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">date("2018-04-29")\n// date("2018-04-29")\n\ndate(date and time("2012-12-25T11:00:00"))\n// date("2012-12-25")\n</code></pre>\n"
|
|
582
|
+
description: "<p>Returns a date from the given value.</p>\n<p>Returns <code>null</code> if the string is not a valid calendar date. For example, <code>"2024-06-31"</code> is invalid because June has\nonly 30 days.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">date(from: string): date\n</code></pre>\n<p>Parses the given string into a date.</p>\n<pre><code class=\"language-feel\">date(from: date and time): date\n</code></pre>\n<p>Extracts the date component from the given date and time.</p>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">date("2018-04-29")\n// date("2018-04-29")\n\ndate(date and time("2012-12-25T11:00:00"))\n// date("2012-12-25")\n</code></pre>\n"
|
|
566
583
|
},
|
|
567
584
|
{
|
|
568
585
|
name: "date(year, month, day)",
|
|
569
|
-
description: "<p>Returns a date from the given components.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">date(year: number, month: number, day: number): date\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">date(2012, 12, 25)\n// date("2012-12-25")\n</code></pre>\n"
|
|
586
|
+
description: "<p>Returns a date from the given components.</p>\n<p>Returns <code>null</code> if the components don't represent a valid calendar date. For example, <code>2024,6,31</code> is invalid because\nJune has only 30 days.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">date(year: number, month: number, day: number): date\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">date(2012, 12, 25)\n// date("2012-12-25")\n</code></pre>\n"
|
|
570
587
|
},
|
|
571
588
|
{
|
|
572
589
|
name: "time(from)",
|
|
@@ -582,7 +599,7 @@ var camundaTags = [
|
|
|
582
599
|
},
|
|
583
600
|
{
|
|
584
601
|
name: "date and time(from)",
|
|
585
|
-
description: "<p>Parses the given string into a date and time.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">date and time(from: string): date and time\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">date and time("2018-04-29T09:30:00")\n// date and time("2018-04-29T09:30:00")\n</code></pre>\n"
|
|
602
|
+
description: "<p>Parses the given string into a date and time.</p>\n<p>Returns <code>null</code> if the string is not a valid calendar date. For example, <code>"2024-06-31T10:00:00"</code> is invalid because\nJune has only 30 days.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">date and time(from: string): date and time\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">date and time("2018-04-29T09:30:00")\n// date and time("2018-04-29T09:30:00")\n</code></pre>\n"
|
|
586
603
|
},
|
|
587
604
|
{
|
|
588
605
|
name: "date and time(date, time)",
|
|
@@ -712,6 +729,14 @@ var camundaTags = [
|
|
|
712
729
|
name: "string join(list, delimiter, prefix, suffix)",
|
|
713
730
|
description: "<p><em>Camunda Extension</em></p>\n<p>Joins a list of strings into a single string. This is similar to\nJava's <a href=\"https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/stream/Collectors.html#joining(java.lang.CharSequence,java.lang.CharSequence,java.lang.CharSequence)\">joining</a>\nfunction.</p>\n<p>If an item of the list is <code>null</code>, the item is ignored for the result string. If an item is\nneither a string nor <code>null</code>, the function returns <code>null</code> instead of a string.</p>\n<p>The resulting string starts with <code>prefix</code>, contains a <code>delimiter</code> between each element, and ends\nwith <code>suffix</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">string join(list: list<string>, delimiter: string, prefix: string, suffix: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">string join(["a","b","c"], ", ", "[", "]")\n// "[a, b, c]"\n</code></pre>\n"
|
|
714
731
|
},
|
|
732
|
+
{
|
|
733
|
+
name: "is empty(list)",
|
|
734
|
+
description: "<p><em>Camunda Extension</em></p>\n<p>Returns <code>true</code> if the given list is empty. Otherwise, returns <code>false</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">is empty(list: list): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">is empty([])\n// true\n\nis empty([1,2,3])\n// false\n</code></pre>\n"
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
name: "partition(list, size)",
|
|
738
|
+
description: "<p><em>Camunda Extension</em></p>\n<p>Returns consecutive sublists of a list, each of the same size (the final list may be smaller).</p>\n<p>If <code>size</code> is less than <code>0</code>, it returns <code>null</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">partition(list: list, size: number): list\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">partition([1,2,3,4,5], 2)\n// [[1,2], [3,4], [5]]\n\npartition([], 2)\n// []\n\npartition([1,2], 0)\n// null\n</code></pre>\n"
|
|
739
|
+
},
|
|
715
740
|
{
|
|
716
741
|
name: "decimal(n, scale)",
|
|
717
742
|
description: "<p>Rounds the given value at the given scale.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">decimal(n: number, scale: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">decimal(1/3, 2)\n// .33\n\ndecimal(1.5, 0)\n// 2\n</code></pre>\n"
|
|
@@ -890,11 +915,11 @@ var camundaTags = [
|
|
|
890
915
|
},
|
|
891
916
|
{
|
|
892
917
|
name: "substring(string, start position)",
|
|
893
|
-
description: "<p>Returns a substring of the given value starting at <code>start position</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">substring(string: string, start position: number): string\n</code></pre>\n<p>The <code>start position</code> starts at the index <code>1</code>. The last position is <code>-1</code>.</p>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">substring("foobar", 3)\n// "obar"\n</code></pre>\n"
|
|
918
|
+
description: "<p>Returns a substring of the given value starting at <code>start position</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">substring(string: string, start position: number): string\n</code></pre>\n<p>The <code>start position</code> starts at the index <code>1</code>. The last position is <code>-1</code>.</p>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">substring("foobar", 3)\n// "obar"\n\nsubstring("foobar", -2)\n// "ar"\n</code></pre>\n"
|
|
894
919
|
},
|
|
895
920
|
{
|
|
896
921
|
name: "substring(string, start position, length)",
|
|
897
|
-
description: "<p>Returns a substring of the given value starting at <code>start position</code
|
|
922
|
+
description: "<p>Returns a substring of the given value, starting at <code>start position</code> with the given <code>length</code>. If <code>length</code> is greater than\nthe remaining characters of the value, it returns all characters from <code>start position</code> until the end.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">substring(string: string, start position: number, length: number): string\n</code></pre>\n<p>The <code>start position</code> starts at the index <code>1</code>. The last position is <code>-1</code>.</p>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">substring("foobar", 3, 3)\n// "oba"\n\nsubstring("foobar", -3, 2)\n// "ba"\n\nsubstring("foobar", 3, 10)\n// "obar"\n</code></pre>\n"
|
|
898
923
|
},
|
|
899
924
|
{
|
|
900
925
|
name: "string length(string)",
|
|
@@ -952,6 +977,22 @@ var camundaTags = [
|
|
|
952
977
|
name: "extract(string, pattern)",
|
|
953
978
|
description: "<p><em>Camunda Extension</em></p>\n<p>Returns all matches of the pattern in the given string. Returns an empty list if the pattern doesn't\nmatch.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">extract(string: string, pattern: string): list<string>\n</code></pre>\n<p>The <code>pattern</code> is a string that contains a regular expression.</p>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">extract("references are 1234, 1256, 1378", "12[0-9]*")\n// ["1234","1256"]\n</code></pre>\n"
|
|
954
979
|
},
|
|
980
|
+
{
|
|
981
|
+
name: "trim(string)",
|
|
982
|
+
description: "<p><em>Camunda Extension</em></p>\n<p>Returns the given string without leading and trailing spaces.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">trim(string: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">trim(" hello world ")\n// "hello world"\n\ntrim("hello world ")\n// "hello world"\n</code></pre>\n"
|
|
983
|
+
},
|
|
984
|
+
{
|
|
985
|
+
name: "uuid()",
|
|
986
|
+
description: "<p><em>Camunda Extension</em></p>\n<p>Returns a UUID (Universally Unique Identifier) with 36 characters.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">uuid(): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">uuid()\n// "7793aab1-d761-4d38-916b-b7270e309894"\n</code></pre>\n"
|
|
987
|
+
},
|
|
988
|
+
{
|
|
989
|
+
name: "to base64(value)",
|
|
990
|
+
description: "<p><em>Camunda Extension</em></p>\n<p>Returns the given string encoded in Base64 format.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">to base64(value: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">to base64("FEEL")\n// "RkVFTA=="\n</code></pre>\n"
|
|
991
|
+
},
|
|
992
|
+
{
|
|
993
|
+
name: "is blank(string)",
|
|
994
|
+
description: "<p><em>Camunda Extension</em></p>\n<p>Returns <code>true</code> if the given string is blank (empty or contains only whitespaces).</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">is blank(string: string): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">is blank("")\n// true\n\nis blank(" ")\n// true\n\nis blank("hello world")\n// false\n</code></pre>\n"
|
|
995
|
+
},
|
|
955
996
|
{
|
|
956
997
|
name: "now()",
|
|
957
998
|
description: "<p>Returns the current date and time including the timezone.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">now(): date and time\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">now()\n// date and time("2020-07-31T14:27:30@Europe/Berlin")\n</code></pre>\n"
|
|
@@ -983,22 +1024,6 @@ var camundaTags = [
|
|
|
983
1024
|
{
|
|
984
1025
|
name: "last day of month(date)",
|
|
985
1026
|
description: "<p><em>Camunda Extension</em></p>\n<p>Takes the month of the given date or date-time value and returns the last day of this month.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">last day of month(date: date): date\n</code></pre>\n<pre><code class=\"language-feel\">last day of month(date: date and time): date\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">last day of month(date("2022-10-01"))\n// date("2022-10-31"))\n\nlast day of month(date and time("2022-10-16T12:00:00"))\n// date("2022-10-31"))\n</code></pre>\n"
|
|
986
|
-
},
|
|
987
|
-
{
|
|
988
|
-
name: "is empty(list)",
|
|
989
|
-
description: "<p><em>Camunda Extension</em></p>\n<p>Returns true if the given list is empty. Otherwise, returns false.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">is empty(list: list): boolean</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">is empty([])\n// true\n\nis empty([1,2,3])\n// false\n</code></pre>"
|
|
990
|
-
},
|
|
991
|
-
{
|
|
992
|
-
name: "trim(string)",
|
|
993
|
-
description: "<p><em>Camunda Extension</em></p>\n<p>Returns the given string without leading and trailing spaces.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">trim(string: string): string</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">trim(\" hello world \")\n// \"hello world\"\n\ntrim(\"hello world \")\n// \"hello world\"\n</code></pre>"
|
|
994
|
-
},
|
|
995
|
-
{
|
|
996
|
-
name: "uuid()",
|
|
997
|
-
description: "<p><em>Camunda Extension</em></p>\n<p>Returns a UUID (Universally Unique Identifier) with 36 characters.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">uuid(): string</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">uuid()\n// \"7793aab1-d761-4d38-916b-b7270e309894\"\n</code></pre>"
|
|
998
|
-
},
|
|
999
|
-
{
|
|
1000
|
-
name: "to base64(string)",
|
|
1001
|
-
description: "<p><em>Camunda Extension</em></p>\n<p>Returns the given string encoded in Base64 format.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">to base64(value: string): string</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">to base64(\"FEEL\")\n// \"RkVFTA==\"\n</code></pre>"
|
|
1002
1027
|
}
|
|
1003
1028
|
];
|
|
1004
1029
|
|
|
@@ -1047,6 +1072,11 @@ const camunda = parseBuiltins(camundaTags);
|
|
|
1047
1072
|
* @typedef { import('./core').Variable } Variable
|
|
1048
1073
|
*/
|
|
1049
1074
|
|
|
1075
|
+
/**
|
|
1076
|
+
* @typedef { import('./language').Dialect } Dialect
|
|
1077
|
+
* @typedef { import('./language').ParserDialect } ParserDialect
|
|
1078
|
+
*/
|
|
1079
|
+
|
|
1050
1080
|
/**
|
|
1051
1081
|
* @typedef {object} Builtin
|
|
1052
1082
|
* @property {string} name
|
|
@@ -1064,6 +1094,7 @@ const placeholderConf = new Compartment();
|
|
|
1064
1094
|
* @param {DOMNode} config.container
|
|
1065
1095
|
* @param {Extension[]} [config.extensions]
|
|
1066
1096
|
* @param {Dialect} [config.dialect='expression']
|
|
1097
|
+
* @param {ParserDialect} [config.parserDialect]
|
|
1067
1098
|
* @param {DOMNode|String} [config.tooltipContainer]
|
|
1068
1099
|
* @param {Function} [config.onChange]
|
|
1069
1100
|
* @param {Function} [config.onKeyDown]
|
|
@@ -1072,12 +1103,11 @@ const placeholderConf = new Compartment();
|
|
|
1072
1103
|
* @param {String} [config.value]
|
|
1073
1104
|
* @param {Variable[]} [config.variables]
|
|
1074
1105
|
* @param {Variable[]} [config.builtins]
|
|
1075
|
-
*
|
|
1076
|
-
* @returns {Object} editor
|
|
1077
1106
|
*/
|
|
1078
1107
|
function FeelEditor({
|
|
1079
1108
|
extensions: editorExtensions = [],
|
|
1080
1109
|
dialect = 'expression',
|
|
1110
|
+
parserDialect,
|
|
1081
1111
|
container,
|
|
1082
1112
|
contentAttributes = {},
|
|
1083
1113
|
tooltipContainer,
|
|
@@ -1132,7 +1162,8 @@ function FeelEditor({
|
|
|
1132
1162
|
coreConf.of(configure({
|
|
1133
1163
|
dialect,
|
|
1134
1164
|
builtins,
|
|
1135
|
-
variables
|
|
1165
|
+
variables,
|
|
1166
|
+
parserDialect
|
|
1136
1167
|
})),
|
|
1137
1168
|
bracketMatching(),
|
|
1138
1169
|
indentOnInput(),
|
|
@@ -1216,16 +1247,12 @@ FeelEditor.prototype.getSelection = function() {
|
|
|
1216
1247
|
*/
|
|
1217
1248
|
FeelEditor.prototype.setVariables = function(variables) {
|
|
1218
1249
|
|
|
1219
|
-
const
|
|
1220
|
-
dialect,
|
|
1221
|
-
builtins
|
|
1222
|
-
} = get(this._cmEditor.state);
|
|
1250
|
+
const config = get(this._cmEditor.state);
|
|
1223
1251
|
|
|
1224
1252
|
this._cmEditor.dispatch({
|
|
1225
1253
|
effects: [
|
|
1226
1254
|
coreConf.reconfigure(configure({
|
|
1227
|
-
|
|
1228
|
-
builtins,
|
|
1255
|
+
...config,
|
|
1229
1256
|
variables
|
|
1230
1257
|
}))
|
|
1231
1258
|
]
|
package/dist/index.js
CHANGED
|
@@ -393,9 +393,14 @@ function completions({ variables = [], builtins = [] }) {
|
|
|
393
393
|
* @typedef { 'expression' | 'unaryTests' } Dialect
|
|
394
394
|
*/
|
|
395
395
|
|
|
396
|
+
/**
|
|
397
|
+
* @typedef { 'camunda' | undefined } ParserDialect
|
|
398
|
+
*/
|
|
399
|
+
|
|
396
400
|
/**
|
|
397
401
|
* @param { {
|
|
398
402
|
* dialect?: Dialect,
|
|
403
|
+
* parserDialect?: ParserDialect,
|
|
399
404
|
* context?: Record<string, any>,
|
|
400
405
|
* completions?: import('@codemirror/autocomplete').CompletionSource[]
|
|
401
406
|
* } } options
|
|
@@ -411,7 +416,7 @@ function language(options) {
|
|
|
411
416
|
*
|
|
412
417
|
* @return {Record<string, any>}
|
|
413
418
|
*/
|
|
414
|
-
function createContext(variables
|
|
419
|
+
function createContext(variables) {
|
|
415
420
|
return variables.slice().reverse().reduce((context, builtin) => {
|
|
416
421
|
context[builtin.name] = () => {};
|
|
417
422
|
|
|
@@ -420,7 +425,8 @@ function createContext(variables, builtins) {
|
|
|
420
425
|
}
|
|
421
426
|
|
|
422
427
|
/**
|
|
423
|
-
* @typedef { '
|
|
428
|
+
* @typedef { import('../language').Dialect } Dialect
|
|
429
|
+
* @typedef { import('../language').ParserDialect } ParserDialect
|
|
424
430
|
* @typedef { import('..').Variable } Variable
|
|
425
431
|
*/
|
|
426
432
|
|
|
@@ -435,10 +441,15 @@ const builtinsFacet = state.Facet.define();
|
|
|
435
441
|
const variablesFacet = state.Facet.define();
|
|
436
442
|
|
|
437
443
|
/**
|
|
438
|
-
* @type {Facet<
|
|
444
|
+
* @type {Facet<Dialect>}
|
|
439
445
|
*/
|
|
440
446
|
const dialectFacet = state.Facet.define();
|
|
441
447
|
|
|
448
|
+
/**
|
|
449
|
+
* @type {Facet<ParserDialect>}
|
|
450
|
+
*/
|
|
451
|
+
const parserDialectFacet = state.Facet.define();
|
|
452
|
+
|
|
442
453
|
/**
|
|
443
454
|
* @typedef {object} Variable
|
|
444
455
|
* @property {string} name name or key of the variable
|
|
@@ -453,6 +464,7 @@ const dialectFacet = state.Facet.define();
|
|
|
453
464
|
/**
|
|
454
465
|
* @typedef { {
|
|
455
466
|
* dialect?: import('../language').Dialect,
|
|
467
|
+
* parserDialect?: import('../language').ParserDialect,
|
|
456
468
|
* variables?: Variable[],
|
|
457
469
|
* builtins?: Variable[]
|
|
458
470
|
* } } CoreConfig
|
|
@@ -468,6 +480,7 @@ const dialectFacet = state.Facet.define();
|
|
|
468
480
|
*/
|
|
469
481
|
function configure({
|
|
470
482
|
dialect = 'expression',
|
|
483
|
+
parserDialect,
|
|
471
484
|
variables = [],
|
|
472
485
|
builtins = [],
|
|
473
486
|
completions: completions$1 = completions({ builtins, variables })
|
|
@@ -479,8 +492,10 @@ function configure({
|
|
|
479
492
|
dialectFacet.of(dialect),
|
|
480
493
|
builtinsFacet.of(builtins),
|
|
481
494
|
variablesFacet.of(variables),
|
|
495
|
+
parserDialectFacet.of(parserDialect),
|
|
482
496
|
language({
|
|
483
497
|
dialect,
|
|
498
|
+
parserDialect,
|
|
484
499
|
context,
|
|
485
500
|
completions: completions$1
|
|
486
501
|
})
|
|
@@ -497,11 +512,13 @@ function get(state) {
|
|
|
497
512
|
const builtins = state.facet(builtinsFacet)[0];
|
|
498
513
|
const variables = state.facet(variablesFacet)[0];
|
|
499
514
|
const dialect = state.facet(dialectFacet)[0];
|
|
515
|
+
const parserDialect = state.facet(parserDialectFacet)[0];
|
|
500
516
|
|
|
501
517
|
return {
|
|
502
518
|
builtins,
|
|
503
519
|
variables,
|
|
504
|
-
dialect
|
|
520
|
+
dialect,
|
|
521
|
+
parserDialect
|
|
505
522
|
};
|
|
506
523
|
}
|
|
507
524
|
|
|
@@ -556,7 +573,7 @@ var camundaTags = [
|
|
|
556
573
|
},
|
|
557
574
|
{
|
|
558
575
|
name: "number(from)",
|
|
559
|
-
description: "<p>Parses the given string to a number.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">number(from: string): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">number("1500.5")\n// 1500.5\n</code></pre>\n"
|
|
576
|
+
description: "<p>Parses the given string to a number.</p>\n<p>Returns <code>null</code> if the string is not a number.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">number(from: string): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">number("1500.5")\n// 1500.5\n</code></pre>\n"
|
|
560
577
|
},
|
|
561
578
|
{
|
|
562
579
|
name: "context(entries)",
|
|
@@ -564,11 +581,11 @@ var camundaTags = [
|
|
|
564
581
|
},
|
|
565
582
|
{
|
|
566
583
|
name: "date(from)",
|
|
567
|
-
description: "<p>Returns a date from the given value.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">date(from: string): date\n</code></pre>\n<p>Parses the given string into a date.</p>\n<pre><code class=\"language-feel\">date(from: date and time): date\n</code></pre>\n<p>Extracts the date component from the given date and time.</p>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">date("2018-04-29")\n// date("2018-04-29")\n\ndate(date and time("2012-12-25T11:00:00"))\n// date("2012-12-25")\n</code></pre>\n"
|
|
584
|
+
description: "<p>Returns a date from the given value.</p>\n<p>Returns <code>null</code> if the string is not a valid calendar date. For example, <code>"2024-06-31"</code> is invalid because June has\nonly 30 days.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">date(from: string): date\n</code></pre>\n<p>Parses the given string into a date.</p>\n<pre><code class=\"language-feel\">date(from: date and time): date\n</code></pre>\n<p>Extracts the date component from the given date and time.</p>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">date("2018-04-29")\n// date("2018-04-29")\n\ndate(date and time("2012-12-25T11:00:00"))\n// date("2012-12-25")\n</code></pre>\n"
|
|
568
585
|
},
|
|
569
586
|
{
|
|
570
587
|
name: "date(year, month, day)",
|
|
571
|
-
description: "<p>Returns a date from the given components.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">date(year: number, month: number, day: number): date\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">date(2012, 12, 25)\n// date("2012-12-25")\n</code></pre>\n"
|
|
588
|
+
description: "<p>Returns a date from the given components.</p>\n<p>Returns <code>null</code> if the components don't represent a valid calendar date. For example, <code>2024,6,31</code> is invalid because\nJune has only 30 days.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">date(year: number, month: number, day: number): date\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">date(2012, 12, 25)\n// date("2012-12-25")\n</code></pre>\n"
|
|
572
589
|
},
|
|
573
590
|
{
|
|
574
591
|
name: "time(from)",
|
|
@@ -584,7 +601,7 @@ var camundaTags = [
|
|
|
584
601
|
},
|
|
585
602
|
{
|
|
586
603
|
name: "date and time(from)",
|
|
587
|
-
description: "<p>Parses the given string into a date and time.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">date and time(from: string): date and time\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">date and time("2018-04-29T09:30:00")\n// date and time("2018-04-29T09:30:00")\n</code></pre>\n"
|
|
604
|
+
description: "<p>Parses the given string into a date and time.</p>\n<p>Returns <code>null</code> if the string is not a valid calendar date. For example, <code>"2024-06-31T10:00:00"</code> is invalid because\nJune has only 30 days.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">date and time(from: string): date and time\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">date and time("2018-04-29T09:30:00")\n// date and time("2018-04-29T09:30:00")\n</code></pre>\n"
|
|
588
605
|
},
|
|
589
606
|
{
|
|
590
607
|
name: "date and time(date, time)",
|
|
@@ -714,6 +731,14 @@ var camundaTags = [
|
|
|
714
731
|
name: "string join(list, delimiter, prefix, suffix)",
|
|
715
732
|
description: "<p><em>Camunda Extension</em></p>\n<p>Joins a list of strings into a single string. This is similar to\nJava's <a href=\"https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/stream/Collectors.html#joining(java.lang.CharSequence,java.lang.CharSequence,java.lang.CharSequence)\">joining</a>\nfunction.</p>\n<p>If an item of the list is <code>null</code>, the item is ignored for the result string. If an item is\nneither a string nor <code>null</code>, the function returns <code>null</code> instead of a string.</p>\n<p>The resulting string starts with <code>prefix</code>, contains a <code>delimiter</code> between each element, and ends\nwith <code>suffix</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">string join(list: list<string>, delimiter: string, prefix: string, suffix: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">string join(["a","b","c"], ", ", "[", "]")\n// "[a, b, c]"\n</code></pre>\n"
|
|
716
733
|
},
|
|
734
|
+
{
|
|
735
|
+
name: "is empty(list)",
|
|
736
|
+
description: "<p><em>Camunda Extension</em></p>\n<p>Returns <code>true</code> if the given list is empty. Otherwise, returns <code>false</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">is empty(list: list): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">is empty([])\n// true\n\nis empty([1,2,3])\n// false\n</code></pre>\n"
|
|
737
|
+
},
|
|
738
|
+
{
|
|
739
|
+
name: "partition(list, size)",
|
|
740
|
+
description: "<p><em>Camunda Extension</em></p>\n<p>Returns consecutive sublists of a list, each of the same size (the final list may be smaller).</p>\n<p>If <code>size</code> is less than <code>0</code>, it returns <code>null</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">partition(list: list, size: number): list\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">partition([1,2,3,4,5], 2)\n// [[1,2], [3,4], [5]]\n\npartition([], 2)\n// []\n\npartition([1,2], 0)\n// null\n</code></pre>\n"
|
|
741
|
+
},
|
|
717
742
|
{
|
|
718
743
|
name: "decimal(n, scale)",
|
|
719
744
|
description: "<p>Rounds the given value at the given scale.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">decimal(n: number, scale: number): number\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">decimal(1/3, 2)\n// .33\n\ndecimal(1.5, 0)\n// 2\n</code></pre>\n"
|
|
@@ -892,11 +917,11 @@ var camundaTags = [
|
|
|
892
917
|
},
|
|
893
918
|
{
|
|
894
919
|
name: "substring(string, start position)",
|
|
895
|
-
description: "<p>Returns a substring of the given value starting at <code>start position</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">substring(string: string, start position: number): string\n</code></pre>\n<p>The <code>start position</code> starts at the index <code>1</code>. The last position is <code>-1</code>.</p>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">substring("foobar", 3)\n// "obar"\n</code></pre>\n"
|
|
920
|
+
description: "<p>Returns a substring of the given value starting at <code>start position</code>.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">substring(string: string, start position: number): string\n</code></pre>\n<p>The <code>start position</code> starts at the index <code>1</code>. The last position is <code>-1</code>.</p>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">substring("foobar", 3)\n// "obar"\n\nsubstring("foobar", -2)\n// "ar"\n</code></pre>\n"
|
|
896
921
|
},
|
|
897
922
|
{
|
|
898
923
|
name: "substring(string, start position, length)",
|
|
899
|
-
description: "<p>Returns a substring of the given value starting at <code>start position</code
|
|
924
|
+
description: "<p>Returns a substring of the given value, starting at <code>start position</code> with the given <code>length</code>. If <code>length</code> is greater than\nthe remaining characters of the value, it returns all characters from <code>start position</code> until the end.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">substring(string: string, start position: number, length: number): string\n</code></pre>\n<p>The <code>start position</code> starts at the index <code>1</code>. The last position is <code>-1</code>.</p>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">substring("foobar", 3, 3)\n// "oba"\n\nsubstring("foobar", -3, 2)\n// "ba"\n\nsubstring("foobar", 3, 10)\n// "obar"\n</code></pre>\n"
|
|
900
925
|
},
|
|
901
926
|
{
|
|
902
927
|
name: "string length(string)",
|
|
@@ -954,6 +979,22 @@ var camundaTags = [
|
|
|
954
979
|
name: "extract(string, pattern)",
|
|
955
980
|
description: "<p><em>Camunda Extension</em></p>\n<p>Returns all matches of the pattern in the given string. Returns an empty list if the pattern doesn't\nmatch.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">extract(string: string, pattern: string): list<string>\n</code></pre>\n<p>The <code>pattern</code> is a string that contains a regular expression.</p>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">extract("references are 1234, 1256, 1378", "12[0-9]*")\n// ["1234","1256"]\n</code></pre>\n"
|
|
956
981
|
},
|
|
982
|
+
{
|
|
983
|
+
name: "trim(string)",
|
|
984
|
+
description: "<p><em>Camunda Extension</em></p>\n<p>Returns the given string without leading and trailing spaces.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">trim(string: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">trim(" hello world ")\n// "hello world"\n\ntrim("hello world ")\n// "hello world"\n</code></pre>\n"
|
|
985
|
+
},
|
|
986
|
+
{
|
|
987
|
+
name: "uuid()",
|
|
988
|
+
description: "<p><em>Camunda Extension</em></p>\n<p>Returns a UUID (Universally Unique Identifier) with 36 characters.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">uuid(): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">uuid()\n// "7793aab1-d761-4d38-916b-b7270e309894"\n</code></pre>\n"
|
|
989
|
+
},
|
|
990
|
+
{
|
|
991
|
+
name: "to base64(value)",
|
|
992
|
+
description: "<p><em>Camunda Extension</em></p>\n<p>Returns the given string encoded in Base64 format.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">to base64(value: string): string\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">to base64("FEEL")\n// "RkVFTA=="\n</code></pre>\n"
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
name: "is blank(string)",
|
|
996
|
+
description: "<p><em>Camunda Extension</em></p>\n<p>Returns <code>true</code> if the given string is blank (empty or contains only whitespaces).</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">is blank(string: string): boolean\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">is blank("")\n// true\n\nis blank(" ")\n// true\n\nis blank("hello world")\n// false\n</code></pre>\n"
|
|
997
|
+
},
|
|
957
998
|
{
|
|
958
999
|
name: "now()",
|
|
959
1000
|
description: "<p>Returns the current date and time including the timezone.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">now(): date and time\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">now()\n// date and time("2020-07-31T14:27:30@Europe/Berlin")\n</code></pre>\n"
|
|
@@ -985,22 +1026,6 @@ var camundaTags = [
|
|
|
985
1026
|
{
|
|
986
1027
|
name: "last day of month(date)",
|
|
987
1028
|
description: "<p><em>Camunda Extension</em></p>\n<p>Takes the month of the given date or date-time value and returns the last day of this month.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">last day of month(date: date): date\n</code></pre>\n<pre><code class=\"language-feel\">last day of month(date: date and time): date\n</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">last day of month(date("2022-10-01"))\n// date("2022-10-31"))\n\nlast day of month(date and time("2022-10-16T12:00:00"))\n// date("2022-10-31"))\n</code></pre>\n"
|
|
988
|
-
},
|
|
989
|
-
{
|
|
990
|
-
name: "is empty(list)",
|
|
991
|
-
description: "<p><em>Camunda Extension</em></p>\n<p>Returns true if the given list is empty. Otherwise, returns false.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">is empty(list: list): boolean</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">is empty([])\n// true\n\nis empty([1,2,3])\n// false\n</code></pre>"
|
|
992
|
-
},
|
|
993
|
-
{
|
|
994
|
-
name: "trim(string)",
|
|
995
|
-
description: "<p><em>Camunda Extension</em></p>\n<p>Returns the given string without leading and trailing spaces.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">trim(string: string): string</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">trim(\" hello world \")\n// \"hello world\"\n\ntrim(\"hello world \")\n// \"hello world\"\n</code></pre>"
|
|
996
|
-
},
|
|
997
|
-
{
|
|
998
|
-
name: "uuid()",
|
|
999
|
-
description: "<p><em>Camunda Extension</em></p>\n<p>Returns a UUID (Universally Unique Identifier) with 36 characters.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">uuid(): string</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">uuid()\n// \"7793aab1-d761-4d38-916b-b7270e309894\"\n</code></pre>"
|
|
1000
|
-
},
|
|
1001
|
-
{
|
|
1002
|
-
name: "to base64(string)",
|
|
1003
|
-
description: "<p><em>Camunda Extension</em></p>\n<p>Returns the given string encoded in Base64 format.</p>\n<p><strong>Function signature</strong></p>\n<pre><code class=\"language-feel\">to base64(value: string): string</code></pre>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-feel\">to base64(\"FEEL\")\n// \"RkVFTA==\"\n</code></pre>"
|
|
1004
1029
|
}
|
|
1005
1030
|
];
|
|
1006
1031
|
|
|
@@ -1049,6 +1074,11 @@ const camunda = parseBuiltins(camundaTags);
|
|
|
1049
1074
|
* @typedef { import('./core').Variable } Variable
|
|
1050
1075
|
*/
|
|
1051
1076
|
|
|
1077
|
+
/**
|
|
1078
|
+
* @typedef { import('./language').Dialect } Dialect
|
|
1079
|
+
* @typedef { import('./language').ParserDialect } ParserDialect
|
|
1080
|
+
*/
|
|
1081
|
+
|
|
1052
1082
|
/**
|
|
1053
1083
|
* @typedef {object} Builtin
|
|
1054
1084
|
* @property {string} name
|
|
@@ -1066,6 +1096,7 @@ const placeholderConf = new state.Compartment();
|
|
|
1066
1096
|
* @param {DOMNode} config.container
|
|
1067
1097
|
* @param {Extension[]} [config.extensions]
|
|
1068
1098
|
* @param {Dialect} [config.dialect='expression']
|
|
1099
|
+
* @param {ParserDialect} [config.parserDialect]
|
|
1069
1100
|
* @param {DOMNode|String} [config.tooltipContainer]
|
|
1070
1101
|
* @param {Function} [config.onChange]
|
|
1071
1102
|
* @param {Function} [config.onKeyDown]
|
|
@@ -1074,12 +1105,11 @@ const placeholderConf = new state.Compartment();
|
|
|
1074
1105
|
* @param {String} [config.value]
|
|
1075
1106
|
* @param {Variable[]} [config.variables]
|
|
1076
1107
|
* @param {Variable[]} [config.builtins]
|
|
1077
|
-
*
|
|
1078
|
-
* @returns {Object} editor
|
|
1079
1108
|
*/
|
|
1080
1109
|
function FeelEditor({
|
|
1081
1110
|
extensions: editorExtensions = [],
|
|
1082
1111
|
dialect = 'expression',
|
|
1112
|
+
parserDialect,
|
|
1083
1113
|
container,
|
|
1084
1114
|
contentAttributes = {},
|
|
1085
1115
|
tooltipContainer,
|
|
@@ -1134,7 +1164,8 @@ function FeelEditor({
|
|
|
1134
1164
|
coreConf.of(configure({
|
|
1135
1165
|
dialect,
|
|
1136
1166
|
builtins,
|
|
1137
|
-
variables
|
|
1167
|
+
variables,
|
|
1168
|
+
parserDialect
|
|
1138
1169
|
})),
|
|
1139
1170
|
language$1.bracketMatching(),
|
|
1140
1171
|
language$1.indentOnInput(),
|
|
@@ -1218,16 +1249,12 @@ FeelEditor.prototype.getSelection = function() {
|
|
|
1218
1249
|
*/
|
|
1219
1250
|
FeelEditor.prototype.setVariables = function(variables) {
|
|
1220
1251
|
|
|
1221
|
-
const
|
|
1222
|
-
dialect,
|
|
1223
|
-
builtins
|
|
1224
|
-
} = get(this._cmEditor.state);
|
|
1252
|
+
const config = get(this._cmEditor.state);
|
|
1225
1253
|
|
|
1226
1254
|
this._cmEditor.dispatch({
|
|
1227
1255
|
effects: [
|
|
1228
1256
|
coreConf.reconfigure(configure({
|
|
1229
|
-
|
|
1230
|
-
builtins,
|
|
1257
|
+
...config,
|
|
1231
1258
|
variables
|
|
1232
1259
|
}))
|
|
1233
1260
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bpmn-io/feel-editor",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "Editor for FEEL expressions.",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"lint": "eslint .",
|
|
18
18
|
"pull:platform-docs": "git -C camunda-platform-docs pull || git clone git@github.com:camunda/camunda-platform-docs.git camunda-platform-docs",
|
|
19
19
|
"start": "cross-env SINGLE_START=true npm run dev",
|
|
20
|
+
"start:camunda": "cross-env SINGLE_START=camunda npm run dev",
|
|
20
21
|
"dev": "npm test -- --auto-watch --no-single-run",
|
|
21
22
|
"prepare": "run-s build"
|
|
22
23
|
},
|
|
@@ -47,31 +48,31 @@
|
|
|
47
48
|
],
|
|
48
49
|
"license": "MIT",
|
|
49
50
|
"dependencies": {
|
|
50
|
-
"@bpmn-io/feel-lint": "^1.
|
|
51
|
+
"@bpmn-io/feel-lint": "^1.4.0",
|
|
51
52
|
"@codemirror/autocomplete": "^6.16.2",
|
|
52
|
-
"@codemirror/commands": "^6.
|
|
53
|
+
"@codemirror/commands": "^6.8.0",
|
|
53
54
|
"@codemirror/language": "^6.10.2",
|
|
54
|
-
"@codemirror/lint": "^6.8.
|
|
55
|
-
"@codemirror/state": "^6.
|
|
56
|
-
"@codemirror/view": "^6.
|
|
57
|
-
"@lezer/highlight": "^1.2.
|
|
58
|
-
"lang-feel": "^2.
|
|
55
|
+
"@codemirror/lint": "^6.8.4",
|
|
56
|
+
"@codemirror/state": "^6.5.1",
|
|
57
|
+
"@codemirror/view": "^6.36.2",
|
|
58
|
+
"@lezer/highlight": "^1.2.1",
|
|
59
|
+
"lang-feel": "^2.3.0",
|
|
59
60
|
"min-dom": "^4.2.1"
|
|
60
61
|
},
|
|
61
62
|
"devDependencies": {
|
|
62
|
-
"@babel/core": "^7.
|
|
63
|
-
"@rollup/plugin-commonjs": "^
|
|
63
|
+
"@babel/core": "^7.26.0",
|
|
64
|
+
"@rollup/plugin-commonjs": "^28.0.2",
|
|
64
65
|
"@rollup/plugin-json": "^6.1.0",
|
|
65
|
-
"@testing-library/dom": "^
|
|
66
|
-
"@testing-library/user-event": "^14.
|
|
67
|
-
"babel-loader": "^9.1
|
|
68
|
-
"babel-plugin-istanbul": "^
|
|
69
|
-
"chai": "^4.
|
|
66
|
+
"@testing-library/dom": "^10.4.0",
|
|
67
|
+
"@testing-library/user-event": "^14.6.1",
|
|
68
|
+
"babel-loader": "^9.2.1",
|
|
69
|
+
"babel-plugin-istanbul": "^7.0.0",
|
|
70
|
+
"chai": "^4.5.0",
|
|
70
71
|
"cross-env": "^7.0.3",
|
|
71
72
|
"eslint": "^8.57.0",
|
|
72
73
|
"eslint-plugin-bpmn-io": "^1.0.0",
|
|
73
|
-
"glob": "^
|
|
74
|
-
"karma": "^6.4.
|
|
74
|
+
"glob": "^11.0.1",
|
|
75
|
+
"karma": "^6.4.4",
|
|
75
76
|
"karma-chrome-launcher": "^3.2.0",
|
|
76
77
|
"karma-coverage": "^2.2.1",
|
|
77
78
|
"karma-debug-launcher": "^0.0.5",
|
|
@@ -80,14 +81,14 @@
|
|
|
80
81
|
"karma-mocha": "^2.0.1",
|
|
81
82
|
"karma-sinon-chai": "^2.0.2",
|
|
82
83
|
"karma-webpack": "^5.0.1",
|
|
83
|
-
"marked": "^9.1.
|
|
84
|
-
"mocha": "^10.
|
|
84
|
+
"marked": "^9.1.6",
|
|
85
|
+
"mocha": "^10.8.2",
|
|
85
86
|
"mocha-test-container-support": "^0.2.0",
|
|
86
87
|
"npm-run-all": "^4.1.5",
|
|
87
88
|
"puppeteer": "^23.1.1",
|
|
88
|
-
"rollup": "^4.
|
|
89
|
+
"rollup": "^4.31.0",
|
|
89
90
|
"sinon": "^17.0.1",
|
|
90
91
|
"sinon-chai": "^3.7.0",
|
|
91
|
-
"webpack": "^5.
|
|
92
|
+
"webpack": "^5.97.1"
|
|
92
93
|
}
|
|
93
94
|
}
|