@evlop/commons 1.0.260 → 1.0.262
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/cjs/bin/generate-icons-cache.js +4 -3
- package/dist/cjs/bin/generate-icons-cache.js.map +1 -1
- package/dist/cjs/src/edl/ExpressionHelper.d.ts +8 -0
- package/dist/cjs/src/edl/ExpressionHelper.d.ts.map +1 -0
- package/dist/cjs/src/edl/ExpressionHelper.js +52 -0
- package/dist/cjs/src/edl/ExpressionHelper.js.map +1 -0
- package/dist/cjs/src/edl/index.d.ts +2 -1
- package/dist/cjs/src/edl/index.d.ts.map +1 -1
- package/dist/cjs/src/edl/index.js +1 -1
- package/dist/cjs/src/edl/index.js.map +1 -1
- package/dist/cjs/src/edl/parser.d.ts +1 -1
- package/dist/cjs/src/edl/parser.d.ts.map +1 -1
- package/dist/cjs/src/edl/parser.js +103 -64
- package/dist/cjs/src/edl/parser.js.map +1 -1
- package/dist/cjs/src/edl/parser.test.js +280 -206
- package/dist/cjs/src/edl/parser.test.js.map +1 -1
- package/dist/esm/bin/generate-icons-cache.js +4 -3
- package/dist/esm/bin/generate-icons-cache.js.map +1 -1
- package/dist/esm/src/edl/ExpressionHelper.d.ts +8 -0
- package/dist/esm/src/edl/ExpressionHelper.d.ts.map +1 -0
- package/dist/esm/src/edl/ExpressionHelper.js +50 -0
- package/dist/esm/src/edl/ExpressionHelper.js.map +1 -0
- package/dist/esm/src/edl/index.d.ts +2 -1
- package/dist/esm/src/edl/index.d.ts.map +1 -1
- package/dist/esm/src/edl/index.js +1 -1
- package/dist/esm/src/edl/index.js.map +1 -1
- package/dist/esm/src/edl/parser.d.ts +1 -1
- package/dist/esm/src/edl/parser.d.ts.map +1 -1
- package/dist/esm/src/edl/parser.js +100 -64
- package/dist/esm/src/edl/parser.js.map +1 -1
- package/dist/esm/src/edl/parser.test.js +280 -206
- package/dist/esm/src/edl/parser.test.js.map +1 -1
- package/dist/types/src/edl/ExpressionHelper.d.ts +8 -0
- package/dist/types/src/edl/ExpressionHelper.d.ts.map +1 -0
- package/dist/types/src/edl/index.d.ts +2 -1
- package/dist/types/src/edl/index.d.ts.map +1 -1
- package/dist/types/src/edl/parser.d.ts +1 -1
- package/dist/types/src/edl/parser.d.ts.map +1 -1
- package/package.json +2 -2
@@ -0,0 +1,8 @@
|
|
1
|
+
declare const ExpressionHelper: {
|
2
|
+
breakTemplateStringToExpressionsAndStaticString: (templateString: string) => any[];
|
3
|
+
safelyCompileStringTemplate: (variables: string[]) => (templateString: string) => TimerHandler;
|
4
|
+
safelyCompileExpression: (variables: string[]) => (expression: string) => Function;
|
5
|
+
evaluateExpressionForValue: (expression: string) => any;
|
6
|
+
};
|
7
|
+
export default ExpressionHelper;
|
8
|
+
//# sourceMappingURL=ExpressionHelper.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ExpressionHelper.d.ts","sourceRoot":"","sources":["../../../../src/edl/ExpressionHelper.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,gBAAgB;sEAC8C,MAAM;6CAwB/B,MAAM,EAAE,sBAEvB,MAAM;yCAWM,MAAM,EAAE,kBAExB,MAAM;6CAMa,MAAM;CAGhD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
// Regex to match expressions in EDL
|
2
|
+
const expressionRegex = /{(\((?:(?!\)\}).)*\)|[^{}]*)}/g;
|
3
|
+
const ExpressionHelper = {
|
4
|
+
breakTemplateStringToExpressionsAndStaticString: (templateString) => {
|
5
|
+
const parts = [];
|
6
|
+
const regex = new RegExp(expressionRegex);
|
7
|
+
let match;
|
8
|
+
let lastIndex = 0;
|
9
|
+
while ((match = regex.exec(templateString)) !== null) {
|
10
|
+
const startIndex = match.index;
|
11
|
+
const endIndex = startIndex + match[0].length;
|
12
|
+
if (startIndex > lastIndex) {
|
13
|
+
parts.push({ startIndex, endIndex, type: 'string', value: templateString.slice(lastIndex, startIndex) });
|
14
|
+
}
|
15
|
+
parts.push({ startIndex, endIndex, type: 'expression', value: match[1] });
|
16
|
+
lastIndex = endIndex;
|
17
|
+
}
|
18
|
+
if (lastIndex < templateString.length) {
|
19
|
+
parts.push({ startIndex: lastIndex, endIndex: templateString.length, type: 'string', value: templateString.slice(lastIndex) });
|
20
|
+
}
|
21
|
+
return parts;
|
22
|
+
},
|
23
|
+
safelyCompileStringTemplate: (variables) => {
|
24
|
+
const variableNamesString = `{ ${variables.join(', ')} }`;
|
25
|
+
return (templateString) => {
|
26
|
+
try {
|
27
|
+
// replace all the {expression} with ${ expression } and wrap the whole template in a function
|
28
|
+
const processedTemplate = templateString.replace(expressionRegex, "${ $1 }");
|
29
|
+
if (processedTemplate === templateString)
|
30
|
+
return templateString;
|
31
|
+
return new Function(variableNamesString, `return \`${processedTemplate}\`;`);
|
32
|
+
}
|
33
|
+
catch (e) { }
|
34
|
+
};
|
35
|
+
},
|
36
|
+
safelyCompileExpression: (variables) => {
|
37
|
+
const variableNamesString = `{ ${variables.join(', ')} }`;
|
38
|
+
return (expression) => {
|
39
|
+
try {
|
40
|
+
return new Function(variableNamesString, `return ${expression};`);
|
41
|
+
}
|
42
|
+
catch (e) { }
|
43
|
+
};
|
44
|
+
},
|
45
|
+
evaluateExpressionForValue: (expression) => {
|
46
|
+
return eval(`(${expression})`);
|
47
|
+
}
|
48
|
+
};
|
49
|
+
export default ExpressionHelper;
|
50
|
+
//# sourceMappingURL=ExpressionHelper.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ExpressionHelper.js","sourceRoot":"","sources":["../../../../src/edl/ExpressionHelper.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,MAAM,eAAe,GAAG,gCAAgC,CAAC;AAEzD,MAAM,gBAAgB,GAAG;IACvB,+CAA+C,EAAE,CAAC,cAAsB,EAAE,EAAE;QAC1E,MAAM,KAAK,GAAG,EAAE,CAAC;QAEjB,MAAM,KAAK,GAAG,IAAI,MA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AAC,CAAC;gBAE7E,IAAG,iBAAiB,KAAK,cAAc;oBAAE,OAAO,cAAc,CAAC;gBAE/D,OAAO,IAAI,QAAQ,CAAC,mBAAmB,EAAE,YAAY,iBAAiB,KAAK,CAAC,CAAC;aAC9E;YAAC,OAAM,CAAC,EAAC,GAAE;QACd,CAAC,CAAA;IACH,CAAC;IACD,uBAAuB,EAAG,CAAC,SAAmB,EAAE,EAAE;QAChD,MAAM,mBAAmB,GAAG,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;QAC1D,OAAO,CAAC,UAAkB,EAAE,EAAE;YAC5B,IAAG;gBACD,OAAO,IAAI,QAAQ,CAAC,mBAAmB,EAAE,UAAU,UAAU,GAAG,CAAC,CAAC;aACnE;YAAC,OAAM,CAAC,EAAC,GAAE;QACd,CAAC,CAAA;IACH,CAAC;IACD,0BAA0B,EAAE,CAAC,UAAkB,EAAE,EAAE;QACjD,OAAO,IAAI,CAAC,IAAI,UAAU,GAAG,CAAC,CAAC;IACjC,CAAC;CACF,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
+
import * as lodash from 'lodash';
|
2
3
|
declare type RenderContextStaticValues = {
|
3
4
|
[key: string]: any;
|
4
5
|
};
|
@@ -51,7 +52,7 @@ export declare const EDL: {
|
|
51
52
|
}) => any;
|
52
53
|
DataSource: typeof import("./elements/DataSource").default;
|
53
54
|
};
|
54
|
-
parse: ((edl: any) => any[]) &
|
55
|
+
parse: ((edl: any) => any[]) & lodash.MemoizedFunction;
|
55
56
|
};
|
56
57
|
export default EDL;
|
57
58
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/edl/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAyC,MAAM,OAAO,CAAC;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/edl/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAS9D,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAQjC,aAAK,yBAAyB,GAAG;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAA;AAOD,aAAK,kBAAkB,GAAG,MAAM,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;AAS7E,aAAK,UAAU,GAAG;IAChB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAA;AASD,iBAAS,eAAe,CAAC,IAAI,KAAA,EAAE,OAAO,KAAA,QAErC;AAED,iBAAS,gBAAgB,CAAC,WAAW,KAAA,QAEpC;AAGD,iBAAS,6BAA6B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,QAG9D;AAED,iBAAS,8BAA8B,CAAC,gBAAgB,EAAE,yBAAyB,QAGlF;AAED,iBAAS,0BAA0B,CAAC,KAAK,EAAE,kBAAkB,QAS5D;AAED,iBAAS,2BAA2B,CAAC,MAAM,EAAE,kBAAkB,EAAE,QAEhE;AAED,iBAAS,UAAU,CAAC,UAAU,EAAE,UAAU,QAEzC;AAUD,UAAU,cAAc;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,GAAG,CAAC;IACV,WAAW,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IACpC,MAAM,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACpC;AA8DD,eAAO,MAAM,GAAG;6EA5DiE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;CAyE9F,CAAC;AAEF,eAAe,GAAG,CAAC"}
|
@@ -8,7 +8,7 @@ import { axiosClient } from '../helpers';
|
|
8
8
|
import { useActionable, useScope } from '../hooks';
|
9
9
|
import localStorage from './localStorage';
|
10
10
|
import { EDLProvider } from '../contexts/EDLContext';
|
11
|
-
|
11
|
+
import * as lodash from 'lodash';
|
12
12
|
// actual elements that are availabe to render, these are react components
|
13
13
|
const edlElements = {
|
14
14
|
...coreElements,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/edl/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAU,MAAM,QAAQ,CAAC;AACjE,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,YAAY,MAAM,YAAY,CAAC;AACtC,OAAO,gBAAgB,MAAM,iBAAiB,CAAC;AAC/C,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,MAAM,MAAM,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/edl/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAU,MAAM,QAAQ,CAAC;AACjE,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,YAAY,MAAM,YAAY,CAAC;AACtC,OAAO,gBAAgB,MAAM,iBAAiB,CAAC;AAC/C,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,WAAW,EAA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EAAE,CAAC,WAAW,CAAC,CAAC,CAAA;IAEjB,MAAM,cAAc,GAAG,OAAO,CAAC,GAAE,EAAE,CAAA,gBAAgB,CAAC,YAAY,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAA;IAEvH,OAAO,OAAO,CAAC,GAAE,EAAE,CAAA,oBAAC,WAAW,IAAC,KAAK,EAAE,EAAC,cAAc,EAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,iBAAiB,EAAE,GAAG,cAAc,CAAC,GAAI,EAAE,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAC,CAAC;AACzJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,GAAG,GAAG;IACf,MAAM,EAAE,SAAS;IACjB,eAAe;IACf,gBAAgB;IAChB,oBAAoB,EAAE,6BAA6B;IACnD,qBAAqB,EAAE,8BAA8B;IACrD,6BAA6B;IAC7B,8BAA8B;IAC9B,2BAA2B;IAC3B,0BAA0B;IAC1B,UAAU;IACV,QAAQ,EAAE,WAAW;IACrB,KAAK,EAAE,gBAAgB;CAC1B,CAAC;AAEF,eAAe,GAAG,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../src/edl/parser.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../src/edl/parser.ts"],"names":[],"mappings":"AAoIA,iBAAS,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,SAoJnE;AAGD,eAAe,QAAQ,CAAC"}
|
@@ -1,59 +1,15 @@
|
|
1
1
|
import { map, random, set, split, toPath, union } from "lodash";
|
2
2
|
import { decode as decodeHtmlEntities } from "he";
|
3
|
+
import ExpressionHelper from "./ExpressionHelper";
|
3
4
|
const inbuiltVariables = ['context', 'data', 'setRuntimeData', 'setState', 'setStates', 'state', 'dispatchAction', 'createAction'];
|
4
|
-
// Regex to match expressions in EDL
|
5
|
-
const expressionRegex = /{(\((?:(?!\)\}).)*\)|[^{}]*)}/g;
|
6
5
|
// Regex to match opening tag in EDL
|
7
6
|
const openingTagRegex = /<([a-zA-Z0-9_]+)((?:\s+[a-zA-Z0-9_\-\.\:]+=(?:"[^"]*"|'[^']*'|`[^`]*`|\{\{(?:(?!\}\}).)*\}\}|\{\[(?:(?!\]\}).)*\]\}|\{\((?:(?!\)\}).)*\)\}|\{[^\}]*\}))*)\s*(\/)?>/s;
|
8
7
|
// Regex to match closing tag in EDL
|
9
8
|
const closingTagRegex = /<\/([a-zA-Z0-9_]+)>/;
|
10
9
|
// Regex to match attributes
|
11
|
-
const attributeRegex = /([a-zA-Z0-9_\-\.\:]+)=("[^"]*"|'[^']*'|`[^`]*`|\{
|
10
|
+
const attributeRegex = /([a-zA-Z0-9_\-\.\:]+)=("[^"]*"|'[^']*'|`[^`]*`|\{[^\}]*\})/sg;
|
12
11
|
// Regex to split the JSX string into tokens using opening or closing tag regex pattern
|
13
|
-
const openingOrClosingTagRegex = /(<(?:\/)?(?:[a-zA-Z0-9_]+)(?:(?:\s+[a-zA-Z0-9_\-\.\:]+=(?:"[^"]*"|'[^']*'|`[^`]*`|\{
|
14
|
-
const TemplateCompiler = {
|
15
|
-
breakTemplateStringToExpressionsAndStaticString: (templateString) => {
|
16
|
-
const parts = [];
|
17
|
-
const regex = new RegExp(expressionRegex);
|
18
|
-
let match;
|
19
|
-
let lastIndex = 0;
|
20
|
-
while ((match = regex.exec(templateString)) !== null) {
|
21
|
-
const startIndex = match.index;
|
22
|
-
const endIndex = startIndex + match[0].length;
|
23
|
-
if (startIndex > lastIndex) {
|
24
|
-
parts.push({ startIndex, endIndex, type: 'string', value: templateString.slice(lastIndex, startIndex) });
|
25
|
-
}
|
26
|
-
parts.push({ startIndex, endIndex, type: 'expression', value: match[1] });
|
27
|
-
lastIndex = endIndex;
|
28
|
-
}
|
29
|
-
if (lastIndex < templateString.length) {
|
30
|
-
parts.push({ startIndex: lastIndex, endIndex: templateString.length, type: 'string', value: templateString.slice(lastIndex) });
|
31
|
-
}
|
32
|
-
return parts;
|
33
|
-
},
|
34
|
-
compileStringTemplate: (variables) => {
|
35
|
-
const variableNamesString = `{ ${variables.join(', ')} }`;
|
36
|
-
return (templateString) => {
|
37
|
-
try {
|
38
|
-
// replace all the {expression} with ${ expression } and wrap the whole template in a function
|
39
|
-
const processedTemplate = templateString.replace(expressionRegex, "${ $1 }");
|
40
|
-
if (processedTemplate === templateString)
|
41
|
-
return templateString;
|
42
|
-
return new Function(variableNamesString, `return \`${processedTemplate}\`;`);
|
43
|
-
}
|
44
|
-
catch (e) { }
|
45
|
-
};
|
46
|
-
},
|
47
|
-
compileExpression: variables => {
|
48
|
-
const variableNamesString = `{ ${variables.join(', ')} }`;
|
49
|
-
return (expression) => {
|
50
|
-
try {
|
51
|
-
return new Function(variableNamesString, `return ${expression};`);
|
52
|
-
}
|
53
|
-
catch (e) { }
|
54
|
-
};
|
55
|
-
}
|
56
|
-
};
|
12
|
+
const openingOrClosingTagRegex = /(<(?:\/)?(?:[a-zA-Z0-9_]+)(?:(?:\s+[a-zA-Z0-9_\-\.\:]+=(?:"[^"]*"|'[^']*'|`[^`]*`|\{[^\}]*\}))*)\s*(?:\/)?>)/s;
|
57
13
|
function generateUniqueId() {
|
58
14
|
return random(1000, 9999999999).toString(36);
|
59
15
|
}
|
@@ -81,6 +37,65 @@ function extractScriptsAndVariables(inputString) {
|
|
81
37
|
});
|
82
38
|
return { cleanedString, scriptsById, variables: Array.from(allVariables) };
|
83
39
|
}
|
40
|
+
const expressionBracketOpeningClosingPairs = {
|
41
|
+
'{': '}',
|
42
|
+
'(': ')',
|
43
|
+
'[': ']',
|
44
|
+
'`': '`',
|
45
|
+
'"': '"',
|
46
|
+
"'": "'",
|
47
|
+
};
|
48
|
+
const stringDelimiters = new Set(['`', '"', "'"]);
|
49
|
+
const openingBrackets = new Set(Object.keys(expressionBracketOpeningClosingPairs));
|
50
|
+
const closingBrackets = new Set(Object.values(expressionBracketOpeningClosingPairs));
|
51
|
+
const allBrackets = new Set([...openingBrackets, ...closingBrackets]);
|
52
|
+
// look for { and go untill }, counting all (, {, } and ), untill all opening braces are matched with closing braces
|
53
|
+
function extractExpressions(inputString) {
|
54
|
+
const expressions = {};
|
55
|
+
let cleanedString = inputString;
|
56
|
+
const expressionPositions = [];
|
57
|
+
const stack = [];
|
58
|
+
let expressionStartPosition = -1;
|
59
|
+
for (let i = 0; i < inputString.length; i++) {
|
60
|
+
const char = inputString[i];
|
61
|
+
// Start new expression when we find an opening brace
|
62
|
+
if (char === '{' && stack.length === 0) {
|
63
|
+
expressionStartPosition = i + 1;
|
64
|
+
stack.push(char);
|
65
|
+
continue;
|
66
|
+
}
|
67
|
+
if (stack.length === 0)
|
68
|
+
continue; // if expression has not started yet, skip it
|
69
|
+
if (!allBrackets.has(char))
|
70
|
+
continue; // if the character is not a bracket, skip it
|
71
|
+
if (inputString[i - 1] === '\\')
|
72
|
+
continue; // if the character is escaped, skip it
|
73
|
+
const lastOpenedBracket = stack[stack.length - 1];
|
74
|
+
const requiredClosingBracket = expressionBracketOpeningClosingPairs[lastOpenedBracket];
|
75
|
+
if (char === requiredClosingBracket) {
|
76
|
+
stack.pop();
|
77
|
+
if (stack.length === 0) {
|
78
|
+
expressionPositions.push({ start: expressionStartPosition, end: i - 1 });
|
79
|
+
}
|
80
|
+
}
|
81
|
+
else if (stringDelimiters.has(lastOpenedBracket)) { // if a string delimiter is opened, we dont care obout other opening brackets
|
82
|
+
continue;
|
83
|
+
}
|
84
|
+
else if (openingBrackets.has(char)) {
|
85
|
+
stack.push(char);
|
86
|
+
}
|
87
|
+
}
|
88
|
+
let correctionFactor = 0;
|
89
|
+
for (const { start, end } of expressionPositions) {
|
90
|
+
const expression = inputString.slice(start, end + 1);
|
91
|
+
const uniqueId = generateUniqueId();
|
92
|
+
expressions[uniqueId] = expression;
|
93
|
+
const newString = cleanedString.slice(0, start - correctionFactor) + uniqueId + cleanedString.slice(end - correctionFactor + 1);
|
94
|
+
cleanedString = newString;
|
95
|
+
correctionFactor += expression.length - uniqueId.length;
|
96
|
+
}
|
97
|
+
return { expressions, cleanedString };
|
98
|
+
}
|
84
99
|
const asVariableRegex = /:as="([^"]+)"/g;
|
85
100
|
function extractAsVariables(inputString) {
|
86
101
|
const asVariables = new Set();
|
@@ -91,22 +106,39 @@ function extractAsVariables(inputString) {
|
|
91
106
|
return Array.from(asVariables);
|
92
107
|
}
|
93
108
|
// This function takes a JSX string as input and returns an array of objects representing the parsed JSX structure.
|
94
|
-
function parseEDL(
|
109
|
+
function parseEDL(_edlString, additionalVariables) {
|
110
|
+
let edlString = _edlString;
|
95
111
|
// separate the scripts and extract variables from the edl string
|
96
112
|
const { cleanedString: edlStringWithCodeRemovedFromScript, scriptsById, variables: scriptVariables } = extractScriptsAndVariables(edlString);
|
113
|
+
edlString = edlStringWithCodeRemovedFromScript;
|
114
|
+
// extract expressions from the edl string
|
115
|
+
const { expressions: expressionsById, cleanedString: edlStringWithCodeRemovedFromScriptAndExpressionsRemoved } = extractExpressions(edlString);
|
116
|
+
edlString = edlStringWithCodeRemovedFromScriptAndExpressionsRemoved;
|
97
117
|
// remove unnecessary whitespace from the edl string, after code has been removed from the script tags
|
98
|
-
|
118
|
+
edlString = removeUnnecessaryWhitespace(edlString);
|
99
119
|
// Extract :as variables and include them in the union
|
100
|
-
const asVariables = extractAsVariables(
|
120
|
+
const asVariables = extractAsVariables(edlString);
|
101
121
|
const variables = union(inbuiltVariables, Array.from(additionalVariables), scriptVariables, asVariables);
|
102
|
-
const
|
103
|
-
const
|
104
|
-
const
|
122
|
+
const safelyCompileStringTemplate = ExpressionHelper.safelyCompileStringTemplate(variables);
|
123
|
+
const safelyCompileExpression = ExpressionHelper.safelyCompileExpression(variables);
|
124
|
+
const evaluateExpressionForValue = ExpressionHelper.evaluateExpressionForValue;
|
125
|
+
const breakTemplateStringToExpressionsAndStaticString = ExpressionHelper.breakTemplateStringToExpressionsAndStaticString;
|
126
|
+
const safelyEvaluateExpressionForValueOrFunction = expression => {
|
127
|
+
try {
|
128
|
+
const evaluatedValue = evaluateExpressionForValue(expression);
|
129
|
+
if (typeof evaluatedValue === 'function')
|
130
|
+
throw new Error("Function cannot ke kept as static prop");
|
131
|
+
return evaluatedValue;
|
132
|
+
}
|
133
|
+
catch (e) {
|
134
|
+
return safelyCompileExpression(expression);
|
135
|
+
}
|
136
|
+
};
|
105
137
|
// Initialize an empty array to store the final JSX objects
|
106
138
|
const jsxObjects = [];
|
107
139
|
// Initialize an empty stack to keep track of the nested JSX elements
|
108
140
|
const jsxStack = [];
|
109
|
-
String(
|
141
|
+
String(edlString).split(openingOrClosingTagRegex).forEach(token => {
|
110
142
|
// If the token is an empty string, skip it
|
111
143
|
if (token.trim() === '') {
|
112
144
|
return;
|
@@ -114,7 +146,7 @@ function parseEDL(edlString, additionalVariables) {
|
|
114
146
|
// If the token is not an opening or closing JSX tag, treat it as plain text
|
115
147
|
if (token[0] !== '<') {
|
116
148
|
const parentNode = jsxStack[jsxStack.length - 1];
|
117
|
-
const parts = breakTemplateStringToExpressionsAndStaticString(decodeHtmlEntities(token)).map(({ type, value }) => type == 'expression' ?
|
149
|
+
const parts = breakTemplateStringToExpressionsAndStaticString(decodeHtmlEntities(token)).map(({ type, value }) => type == 'expression' ? safelyEvaluateExpressionForValueOrFunction(expressionsById[value]) : value);
|
118
150
|
if (parentNode) {
|
119
151
|
parentNode.children.push(...parts);
|
120
152
|
}
|
@@ -148,19 +180,23 @@ function parseEDL(edlString, additionalVariables) {
|
|
148
180
|
}
|
149
181
|
const value = attributeMatch[2].slice(1, -1);
|
150
182
|
// Check if the attribute value is dynamic (enclosed in curly braces) either variable or js expression
|
151
|
-
const
|
183
|
+
const isJavascriptExpressionProp = attributeMatch[2].startsWith("{");
|
152
184
|
const isTemplateProp = attributeMatch[2].startsWith("`");
|
153
|
-
if (
|
185
|
+
if (isJavascriptExpressionProp) {
|
186
|
+
const expression = expressionsById[value];
|
154
187
|
try {
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
188
|
+
const evaluatedValue = safelyEvaluateExpressionForValueOrFunction(expression);
|
189
|
+
if (typeof evaluatedValue === 'function') {
|
190
|
+
variableProps[attributeName] = safelyCompileExpression(expression);
|
191
|
+
}
|
192
|
+
else {
|
193
|
+
set(staticProps, attributeName, evaluatedValue);
|
194
|
+
}
|
160
195
|
}
|
196
|
+
catch (error) { }
|
161
197
|
}
|
162
198
|
else if (isTemplateProp) {
|
163
|
-
variableProps[attributeName] =
|
199
|
+
variableProps[attributeName] = safelyCompileStringTemplate(value);
|
164
200
|
}
|
165
201
|
else {
|
166
202
|
// If the value is not dynamic, assign it directly to the props object
|
@@ -179,7 +215,7 @@ function parseEDL(edlString, additionalVariables) {
|
|
179
215
|
delete newElement.staticProps[':scriptId'];
|
180
216
|
const code = scriptsById[scriptId].code;
|
181
217
|
const exportVariables = scriptsById[scriptId].variables;
|
182
|
-
newElement.variableProps[':function'] =
|
218
|
+
newElement.variableProps[':function'] = safelyCompileExpression(`()=>{ ${code} \n setRuntimeData({ ${exportVariables.join(', ')} }); }`);
|
183
219
|
}
|
184
220
|
// If there's a parent node, add the new element as a child to the parent node
|
185
221
|
if (jsxStack.length > 0) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../../src/edl/parser.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../../src/edl/parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC3E,OAAO,EAAE,MAAM,IAAI,kBAAkB,EAAE,MAAM,IAAI,CAAC;AAClD,OAAO,gBAAgB,MAAM,oBAAoB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