@shaderfrog/core 2.0.1 → 3.0.1
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/engine.d.ts +41 -4
- package/engine.js +7 -2
- package/graph/context.d.ts +6 -5
- package/graph/context.js +38 -48
- package/graph/data-nodes.d.ts +15 -6
- package/graph/data-nodes.js +1 -1
- package/graph/graph-types.d.ts +26 -6
- package/graph/graph-types.js +69 -0
- package/graph/graph.d.ts +28 -3
- package/graph/graph.js +87 -23
- package/graph/graph.test.js +18 -4
- package/graph/parsers.d.ts +2 -1
- package/graph/parsers.js +9 -5
- package/graph/shader-sections.d.ts +30 -13
- package/graph/shader-sections.js +92 -18
- package/package.json +3 -3
- package/plugins/babylon/bablyengine.js +5 -9
- package/plugins/babylon/importers.js +1 -1
- package/plugins/playcanvas/importers.js +1 -1
- package/plugins/playcanvas/playengine.js +5 -9
- package/plugins/three/importers.d.ts +1 -1
- package/plugins/three/importers.js +35 -12
- package/plugins/three/threngine.d.ts +6 -4
- package/plugins/three/threngine.js +54 -37
- package/plugins/three/threngine.test.js +1 -2
- package/strategy/assignemntTo.js +3 -4
- package/strategy/assignmentTo.d.ts +10 -0
- package/strategy/assignmentTo.js +35 -0
- package/strategy/index.d.ts +1 -1
- package/strategy/index.js +1 -1
- package/strategy/strategy.d.ts +2 -2
- package/strategy/strategy.js +1 -1
- package/util/ast.d.ts +3 -2
- package/util/ast.js +8 -0
- package/util/indexByid.d.ts +4 -0
- package/util/indexByid.js +18 -0
- package/util/math.d.ts +2 -0
- package/util/math.js +6 -0
- package/util/whitespace.js +4 -11
package/util/math.js
ADDED
package/util/whitespace.js
CHANGED
|
@@ -34,7 +34,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
34
34
|
}
|
|
35
35
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
36
36
|
};
|
|
37
|
-
import { makeFnStatement } from './ast';
|
|
37
|
+
import { makeFnStatement, makeLiteral } from './ast';
|
|
38
38
|
var log = function () {
|
|
39
39
|
var _a;
|
|
40
40
|
var args = [];
|
|
@@ -88,17 +88,14 @@ export var addFnStmtWithIndent = function (fnBody, newNode) {
|
|
|
88
88
|
return __spreadArray(__spreadArray([], __read(statements), false), [
|
|
89
89
|
// This simple hack is way easier than trying to modify the function body
|
|
90
90
|
// opening brace and/or the previous statement
|
|
91
|
-
|
|
91
|
+
makeLiteral('', indent),
|
|
92
92
|
addWs(newNode, "\n"),
|
|
93
93
|
], false);
|
|
94
94
|
};
|
|
95
95
|
export var unshiftFnStmtWithIndent = function (fnBody, newNode) {
|
|
96
96
|
var statements = fnBody.body.statements;
|
|
97
97
|
var indent = guessFnIndent(fnBody);
|
|
98
|
-
return __spreadArray([
|
|
99
|
-
addWs(newNode, "\n"),
|
|
100
|
-
{ type: 'literal', literal: '', whitespace: indent }
|
|
101
|
-
], __read(statements), false);
|
|
98
|
+
return __spreadArray([addWs(newNode, "\n"), makeLiteral('', indent)], __read(statements), false);
|
|
102
99
|
};
|
|
103
100
|
export var spliceFnStmtWithIndent = function (fnBody, index) {
|
|
104
101
|
var newNodes = [];
|
|
@@ -108,10 +105,6 @@ export var spliceFnStmtWithIndent = function (fnBody, index) {
|
|
|
108
105
|
var statements = fnBody.body.statements;
|
|
109
106
|
var indent = guessFnIndent(fnBody);
|
|
110
107
|
return __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(statements.slice(0, index)), false), __read(newNodes.map(function (n) { return addWs(n, "\n"); })), false), [
|
|
111
|
-
|
|
112
|
-
type: 'literal',
|
|
113
|
-
literal: '',
|
|
114
|
-
whitespace: indent,
|
|
115
|
-
}
|
|
108
|
+
makeLiteral('', indent)
|
|
116
109
|
], false), __read(statements.slice(index)), false);
|
|
117
110
|
};
|