asajs 4.0.0-indev-3 → 4.0.0-indev-4
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/README.md +56 -2
- package/config.d.ts +4 -1
- package/dist/js/compilers/Configuration.js +2 -2
- package/dist/js/compilers/Memory.js +1 -1
- package/dist/js/compilers/PreCompile.js +12 -1
- package/dist/js/compilers/ui/builder.js +32 -8
- package/dist/js/compilers/ui/installer.js +139 -4
- package/dist/js/compilers/ui/linker.js +28 -10
- package/dist/js/compilers/ui/manifest.js +3 -2
- package/dist/types/compilers/PreCompile.d.ts +2 -0
- package/dist/types/compilers/ui/installer.d.ts +11 -1
- package/dist/types/compilers/ui/linker.d.ts +1 -0
- package/dist/types/compilers/ui/manifest.d.ts +1 -0
- package/dist/types/types/vanilla/intellisense.d.ts +11194 -11194
- package/package.json +1 -1
- package/resources/asajs.config.cjs +5 -2
- package/dist/js/compilers/RunEnd.js +0 -7
- package/dist/js/compilers/bindings/Funtion.js +0 -71
- package/dist/js/compilers/ui/builddata.js +0 -4
- package/dist/js/compilers/ui/config.js +0 -1
- package/dist/js/compilers/ui/prevdata.js +0 -8
- package/dist/js/config..js +0 -1
- package/dist/js/config.js +0 -1
- package/dist/js/types/config.js +0 -1
- package/dist/js/types/enums/SmartAnimationType.js +0 -3
- package/dist/types/compilers/RunEnd.d.ts +0 -1
- package/dist/types/compilers/bindings/Funtion.d.ts +0 -7
- package/dist/types/compilers/ui/builddata.d.ts +0 -1
- package/dist/types/compilers/ui/config.d.ts +0 -1
- package/dist/types/compilers/ui/prevdata.d.ts +0 -3
- package/dist/types/config..d.ts +0 -2
- package/dist/types/config.d.ts +0 -13
- package/dist/types/types/config.d.ts +0 -13
- package/dist/types/types/enums/SmartAnimationType.d.ts +0 -2
package/package.json
CHANGED
|
@@ -4,11 +4,14 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export const config = {
|
|
6
6
|
packinfo: {
|
|
7
|
-
name: "AsaJS",
|
|
7
|
+
name: "AsaJS - Installer Test",
|
|
8
8
|
description: "Create your Minecraft JSON-UI resource packs using JavaScript.",
|
|
9
|
+
version: [4, 0, 0],
|
|
9
10
|
},
|
|
10
11
|
compiler: {
|
|
11
12
|
enabled: true,
|
|
12
|
-
|
|
13
|
+
autoImport: true,
|
|
14
|
+
autoEnable: true,
|
|
15
|
+
importToPreview: false,
|
|
13
16
|
},
|
|
14
17
|
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { RandomBindingString } from "../../components/Utils.js";
|
|
2
|
-
import { Parser } from "./Parser.js";
|
|
3
|
-
export const FunctionMap = new Map();
|
|
4
|
-
function callFn(name, ...args) {
|
|
5
|
-
return FunctionMap.get(name)(...args);
|
|
6
|
-
}
|
|
7
|
-
// Default Functions
|
|
8
|
-
FunctionMap.set("abs", number => {
|
|
9
|
-
const randomBinding = RandomBindingString(16);
|
|
10
|
-
return {
|
|
11
|
-
genBindings: [{ source: `((-1 + (${number} > 0) * 2) * ${number})`, target: randomBinding }],
|
|
12
|
-
value: randomBinding,
|
|
13
|
-
};
|
|
14
|
-
});
|
|
15
|
-
FunctionMap.set("new", expression => {
|
|
16
|
-
const randomBinding = RandomBindingString(16);
|
|
17
|
-
return {
|
|
18
|
-
genBindings: [{ source: expression, target: randomBinding }],
|
|
19
|
-
value: randomBinding,
|
|
20
|
-
};
|
|
21
|
-
});
|
|
22
|
-
FunctionMap.set("sqrt", number => {
|
|
23
|
-
const rtn = RandomBindingString(16), $1 = RandomBindingString(16), $2 = RandomBindingString(16);
|
|
24
|
-
const { genBindings: absValue, value: absRtn } = callFn("abs", number);
|
|
25
|
-
return {
|
|
26
|
-
genBindings: [
|
|
27
|
-
{
|
|
28
|
-
source: `${number} * 100 / 2`,
|
|
29
|
-
target: $1,
|
|
30
|
-
},
|
|
31
|
-
...absValue,
|
|
32
|
-
{
|
|
33
|
-
source: `${absRtn} > 1`,
|
|
34
|
-
target: $2,
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
source: `(${number} < 0) * -1 + (${number} > -1) * (${$2} * ((${rtn} + ${number} / ${rtn}) / 2) + (not ${$2}) * ${rtn})`,
|
|
38
|
-
target: rtn,
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
value: rtn,
|
|
42
|
-
};
|
|
43
|
-
});
|
|
44
|
-
FunctionMap.set("translatable", key => {
|
|
45
|
-
return {
|
|
46
|
-
value: `'%' + ${key}`,
|
|
47
|
-
};
|
|
48
|
-
});
|
|
49
|
-
FunctionMap.set("bin", input => {
|
|
50
|
-
const { ret, bindings } = Parser.intToBin(input);
|
|
51
|
-
bindings.push({
|
|
52
|
-
source: `'§z' + ${Array.from({ length: 30 }, (_, i) => `${ret}${30 - i - 1}`).join(" + ")}`,
|
|
53
|
-
target: ret,
|
|
54
|
-
});
|
|
55
|
-
return { genBindings: bindings, value: ret };
|
|
56
|
-
});
|
|
57
|
-
FunctionMap.set("bind", (value, bait) => {
|
|
58
|
-
const ret = RandomBindingString(16);
|
|
59
|
-
if (!bait) {
|
|
60
|
-
throw new Error("Bait is required");
|
|
61
|
-
}
|
|
62
|
-
return {
|
|
63
|
-
genBindings: [{ source: `((${bait} - ${bait}) + ${value})`, target: ret }],
|
|
64
|
-
value: ret,
|
|
65
|
-
};
|
|
66
|
-
});
|
|
67
|
-
FunctionMap.set("int", input => {
|
|
68
|
-
return {
|
|
69
|
-
value: input,
|
|
70
|
-
};
|
|
71
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/js/config..js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/js/config.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/js/types/config.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/types/config..d.ts
DELETED
package/dist/types/config.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Variable } from "./src/types/properties/value.js";
|
|
2
|
-
export interface Config {
|
|
3
|
-
compiler?: {
|
|
4
|
-
enabled?: boolean;
|
|
5
|
-
linked?: boolean;
|
|
6
|
-
};
|
|
7
|
-
packinfo?: {
|
|
8
|
-
name?: string;
|
|
9
|
-
description?: string;
|
|
10
|
-
version?: [number, number, number];
|
|
11
|
-
};
|
|
12
|
-
global_variables?: Record<Variable, string>;
|
|
13
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Variable } from "./properties/value.js";
|
|
2
|
-
export interface Config {
|
|
3
|
-
compiler?: {
|
|
4
|
-
enabled?: boolean;
|
|
5
|
-
linked?: boolean;
|
|
6
|
-
};
|
|
7
|
-
packinfo?: {
|
|
8
|
-
name?: string;
|
|
9
|
-
description?: string;
|
|
10
|
-
version?: [number, number, number];
|
|
11
|
-
};
|
|
12
|
-
global_variables?: Record<Variable, string>;
|
|
13
|
-
}
|