asajs 3.0.2 → 3.0.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/dist/cjs/compilers/BindingCompiler.js +458 -0
- package/dist/cjs/compilers/BindingFunctions.js +267 -0
- package/dist/cjs/compilers/Compiler.js +158 -0
- package/dist/cjs/compilers/Compress.js +55 -0
- package/dist/cjs/compilers/Config.js +138 -0
- package/dist/cjs/compilers/Encoder.js +90 -0
- package/dist/cjs/compilers/Installer.js +123 -0
- package/dist/cjs/compilers/PreCompile.js +86 -0
- package/dist/cjs/compilers/generator/GenerateDir.js +51 -0
- package/dist/cjs/compilers/generator/JsonBuilder.js +66 -0
- package/dist/cjs/compilers/generator/LangBuilder.js +65 -0
- package/dist/cjs/compilers/generator/Log.js +45 -0
- package/dist/cjs/compilers/generator/Manifest.js +63 -0
- package/dist/cjs/compilers/generator/Save.js +87 -0
- package/dist/cjs/compilers/generator/SearchFiles.js +70 -0
- package/dist/cjs/compilers/generator/Sounds.js +91 -0
- package/dist/cjs/compilers/generator/Template.js +54 -0
- package/dist/cjs/compilers/generator/UIBuilder.js +123 -0
- package/dist/cjs/compilers/reader/Audio.js +81 -0
- package/dist/cjs/compilers/reader/Color.js +65 -0
- package/dist/cjs/compilers/reader/CurrentLine.js +36 -0
- package/dist/cjs/compilers/reader/Env.js +21 -0
- package/dist/cjs/compilers/reader/GlobalVariables.js +23 -0
- package/dist/cjs/compilers/reader/Object.js +44 -0
- package/dist/cjs/compilers/reader/ReadBinding.js +67 -0
- package/dist/cjs/compilers/reader/ReadProperties.js +118 -0
- package/dist/cjs/components/AddCollectionChill.js +41 -0
- package/dist/cjs/components/Animation.js +127 -0
- package/dist/cjs/components/AnimationKeyFrame.js +49 -0
- package/dist/cjs/components/Class.js +95 -0
- package/dist/cjs/components/LocalizeText.js +59 -0
- package/dist/cjs/components/Modify.js +377 -0
- package/dist/cjs/components/Random.js +104 -0
- package/dist/cjs/components/UI.js +387 -0
- package/dist/cjs/components/Vanilla.js +57915 -0
- package/dist/cjs/index.js +291 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/template.js +37 -0
- package/dist/cjs/types/components/ChildIdentifier.js +16 -0
- package/dist/cjs/types/components/Identifier.js +17 -0
- package/dist/cjs/types/components/NameCallback.js +16 -0
- package/dist/cjs/types/components/UIIdentifier.js +16 -0
- package/dist/cjs/types/components/UIInterface.js +16 -0
- package/dist/cjs/types/enums/Anchor.js +39 -0
- package/dist/cjs/types/enums/AnimTypes.js +39 -0
- package/dist/cjs/types/enums/BindingCondition.js +36 -0
- package/dist/cjs/types/enums/BindingName.js +4208 -0
- package/dist/cjs/types/enums/BindingType.js +35 -0
- package/dist/cjs/types/enums/ClipDirecion.js +35 -0
- package/dist/cjs/types/enums/Collection.js +202 -0
- package/dist/cjs/types/enums/Direction.js +33 -0
- package/dist/cjs/types/enums/EasingTypes.js +62 -0
- package/dist/cjs/types/enums/EnumColor.js +37 -0
- package/dist/cjs/types/enums/FocusNavigationMode.js +34 -0
- package/dist/cjs/types/enums/FontSize.js +34 -0
- package/dist/cjs/types/enums/FontType.js +35 -0
- package/dist/cjs/types/enums/GlobalVariables.js +345 -0
- package/dist/cjs/types/enums/InputModeCondition.js +33 -0
- package/dist/cjs/types/enums/ItemAuxID.js +31 -0
- package/dist/cjs/types/enums/JsonUIArrayName.js +36 -0
- package/dist/cjs/types/enums/MappingFrom.js +81 -0
- package/dist/cjs/types/enums/MappingTo.js +248 -0
- package/dist/cjs/types/enums/MappingTypes.js +34 -0
- package/dist/cjs/types/enums/Orientation.js +32 -0
- package/dist/cjs/types/enums/Renderer.js +68 -0
- package/dist/cjs/types/enums/Rotation.js +33 -0
- package/dist/cjs/types/enums/Scope.js +32 -0
- package/dist/cjs/types/enums/TextTypes.js +33 -0
- package/dist/cjs/types/enums/TextureFileSystem.js +41 -0
- package/dist/cjs/types/enums/Types.js +57 -0
- package/dist/cjs/types/objects/Animation.js +16 -0
- package/dist/cjs/types/objects/BindingHook.js +16 -0
- package/dist/cjs/types/objects/BindingInterface.js +16 -0
- package/dist/cjs/types/objects/ButtonMapping.js +16 -0
- package/dist/cjs/types/objects/Factory.js +16 -0
- package/dist/cjs/types/objects/Installer.js +53 -0
- package/dist/cjs/types/objects/Manifest.js +56 -0
- package/dist/cjs/types/objects/Modify.js +16 -0
- package/dist/cjs/types/objects/PropertyBag.js +16 -0
- package/dist/cjs/types/objects/Sound.js +16 -0
- package/dist/cjs/types/objects/Variables.js +16 -0
- package/dist/cjs/types/objects/elements/Button.js +17 -0
- package/dist/cjs/types/objects/elements/CollectionPanel.js +17 -0
- package/dist/cjs/types/objects/elements/Custom.js +17 -0
- package/dist/cjs/types/objects/elements/Dropdown.js +17 -0
- package/dist/cjs/types/objects/elements/EditBox.js +17 -0
- package/dist/cjs/types/objects/elements/Grid.js +16 -0
- package/dist/cjs/types/objects/elements/Image.js +17 -0
- package/dist/cjs/types/objects/elements/InputPanel.js +16 -0
- package/dist/cjs/types/objects/elements/Label.js +17 -0
- package/dist/cjs/types/objects/elements/PropertiesType.js +17 -0
- package/dist/cjs/types/objects/elements/Screen.js +17 -0
- package/dist/cjs/types/objects/elements/ScrollView.js +17 -0
- package/dist/cjs/types/objects/elements/ScrollbarBox.js +17 -0
- package/dist/cjs/types/objects/elements/ScrollbarTrack.js +17 -0
- package/dist/cjs/types/objects/elements/SelectionWheel.js +17 -0
- package/dist/cjs/types/objects/elements/Slider.js +17 -0
- package/dist/cjs/types/objects/elements/SliderBox.js +17 -0
- package/dist/cjs/types/objects/elements/StackPanel.js +16 -0
- package/dist/cjs/types/objects/elements/Toggle.js +17 -0
- package/dist/cjs/types/objects/elements/TooltipTrigger.js +16 -0
- package/dist/cjs/types/objects/elements/panel.js +16 -0
- package/dist/cjs/types/objects/properties/Buttons.js +16 -0
- package/dist/cjs/types/objects/properties/CollectionIndexs.js +16 -0
- package/dist/cjs/types/objects/properties/Collections.js +16 -0
- package/dist/cjs/types/objects/properties/Controls.js +16 -0
- package/dist/cjs/types/objects/properties/Dropdowns.js +16 -0
- package/dist/cjs/types/objects/properties/Focus.js +16 -0
- package/dist/cjs/types/objects/properties/FocusContainerCustom.js +16 -0
- package/dist/cjs/types/objects/properties/Grids.js +16 -0
- package/dist/cjs/types/objects/properties/Inputs.js +16 -0
- package/dist/cjs/types/objects/properties/Layouts.js +16 -0
- package/dist/cjs/types/objects/properties/Properties.js +16 -0
- package/dist/cjs/types/objects/properties/Renderers.js +16 -0
- package/dist/cjs/types/objects/properties/Screens.js +16 -0
- package/dist/cjs/types/objects/properties/ScrollViews.js +16 -0
- package/dist/cjs/types/objects/properties/SelectionWheels.js +16 -0
- package/dist/cjs/types/objects/properties/SliderBoxs.js +16 -0
- package/dist/cjs/types/objects/properties/Sliders.js +16 -0
- package/dist/cjs/types/objects/properties/Sounds.js +16 -0
- package/dist/cjs/types/objects/properties/Specials.js +16 -0
- package/dist/cjs/types/objects/properties/Sprites.js +16 -0
- package/dist/cjs/types/objects/properties/StackPanels.js +16 -0
- package/dist/cjs/types/objects/properties/TTS.js +16 -0
- package/dist/cjs/types/objects/properties/TextEdits.js +16 -0
- package/dist/cjs/types/objects/properties/Texts.js +16 -0
- package/dist/cjs/types/objects/properties/Toggles.js +16 -0
- package/dist/cjs/types/objects/properties/TooltipTriggers.js +16 -0
- package/dist/cjs/types/objects/properties/Variables.js +16 -0
- package/dist/cjs/types/values/Any.js +16 -0
- package/dist/cjs/types/values/Binding.js +16 -0
- package/dist/cjs/types/values/Bool.js +16 -0
- package/dist/cjs/types/values/ColorVector.js +16 -0
- package/dist/cjs/types/values/ElementPath.js +16 -0
- package/dist/cjs/types/values/Hex.js +16 -0
- package/dist/cjs/types/values/Number.js +16 -0
- package/dist/cjs/types/values/RangeVector.js +16 -0
- package/dist/cjs/types/values/Str.js +16 -0
- package/dist/cjs/types/values/StringVector.js +16 -0
- package/dist/cjs/types/values/TargetElementPath.js +16 -0
- package/dist/cjs/types/values/Variable.js +16 -0
- package/dist/cjs/types/values/Vector.js +16 -0
- package/dist/esm/index.js +68470 -0
- package/dist/esm/package.json +1 -0
- package/dist/types/compilers/BindingCompiler.d.ts +44 -0
- package/dist/types/compilers/BindingFunctions.d.ts +10 -0
- package/dist/types/compilers/Compiler.d.ts +3 -0
- package/dist/types/compilers/Compress.d.ts +1 -0
- package/dist/types/compilers/Config.d.ts +95 -0
- package/dist/types/compilers/Encoder.d.ts +11 -0
- package/dist/types/compilers/Installer.d.ts +14 -0
- package/dist/types/compilers/PreCompile.d.ts +4 -0
- package/dist/types/compilers/generator/GenerateDir.d.ts +1 -0
- package/dist/types/compilers/generator/JsonBuilder.d.ts +28 -0
- package/dist/types/compilers/generator/LangBuilder.d.ts +4 -0
- package/dist/types/compilers/generator/Log.d.ts +9 -0
- package/dist/types/compilers/generator/Manifest.d.ts +21 -0
- package/dist/types/compilers/generator/Save.d.ts +16 -0
- package/dist/types/compilers/generator/SearchFiles.d.ts +11 -0
- package/dist/types/compilers/generator/Sounds.d.ts +5 -0
- package/dist/types/compilers/generator/Template.d.ts +1 -0
- package/dist/types/compilers/generator/UIBuilder.d.ts +9 -0
- package/dist/types/compilers/reader/Audio.d.ts +1 -0
- package/dist/types/compilers/reader/Color.d.ts +5 -0
- package/dist/types/compilers/reader/CurrentLine.d.ts +1 -0
- package/dist/types/compilers/reader/Env.d.ts +1 -0
- package/dist/types/compilers/reader/GlobalVariables.d.ts +1 -0
- package/dist/types/compilers/reader/Object.d.ts +11 -0
- package/dist/types/compilers/reader/ReadBinding.d.ts +6 -0
- package/dist/types/compilers/reader/ReadProperties.d.ts +3 -0
- package/dist/types/components/AddCollectionChill.d.ts +6 -0
- package/dist/types/components/Animation.d.ts +15 -0
- package/dist/types/components/AnimationKeyFrame.d.ts +10 -0
- package/dist/types/components/Class.d.ts +68 -0
- package/dist/types/components/LocalizeText.d.ts +21 -0
- package/dist/types/components/Modify.d.ts +30 -0
- package/dist/types/components/Random.d.ts +20 -0
- package/dist/types/components/UI.d.ts +89 -0
- package/dist/types/components/Vanilla.d.ts +19729 -0
- package/dist/types/index.d.ts +136 -0
- package/dist/types/template.d.ts +4 -0
- package/dist/types/types/components/ChildIdentifier.d.ts +11 -0
- package/dist/types/types/components/Identifier.d.ts +4 -0
- package/dist/types/types/components/NameCallback.d.ts +3 -0
- package/dist/types/types/components/UIIdentifier.d.ts +4 -0
- package/dist/types/types/components/UIInterface.d.ts +16 -0
- package/dist/types/types/enums/Anchor.d.ts +11 -0
- package/dist/types/types/enums/AnimTypes.d.ts +11 -0
- package/dist/types/types/enums/BindingCondition.d.ts +8 -0
- package/dist/types/types/enums/BindingName.d.ts +4180 -0
- package/dist/types/types/enums/BindingType.d.ts +7 -0
- package/dist/types/types/enums/ClipDirecion.d.ts +7 -0
- package/dist/types/types/enums/Collection.d.ts +174 -0
- package/dist/types/types/enums/Direction.d.ts +5 -0
- package/dist/types/types/enums/EasingTypes.d.ts +34 -0
- package/dist/types/types/enums/EnumColor.d.ts +9 -0
- package/dist/types/types/enums/FocusNavigationMode.d.ts +6 -0
- package/dist/types/types/enums/FontSize.d.ts +6 -0
- package/dist/types/types/enums/FontType.d.ts +7 -0
- package/dist/types/types/enums/GlobalVariables.d.ts +317 -0
- package/dist/types/types/enums/InputModeCondition.d.ts +5 -0
- package/dist/types/types/enums/ItemAuxID.d.ts +3 -0
- package/dist/types/types/enums/JsonUIArrayName.d.ts +7 -0
- package/dist/types/types/enums/MappingFrom.d.ts +53 -0
- package/dist/types/types/enums/MappingTo.d.ts +220 -0
- package/dist/types/types/enums/MappingTypes.d.ts +6 -0
- package/dist/types/types/enums/Orientation.d.ts +4 -0
- package/dist/types/types/enums/Renderer.d.ts +40 -0
- package/dist/types/types/enums/Rotation.d.ts +5 -0
- package/dist/types/types/enums/Scope.d.ts +4 -0
- package/dist/types/types/enums/TextTypes.d.ts +5 -0
- package/dist/types/types/enums/TextureFileSystem.d.ts +13 -0
- package/dist/types/types/enums/Types.d.ts +29 -0
- package/dist/types/types/objects/Animation.d.ts +36 -0
- package/dist/types/types/objects/BindingHook.d.ts +1 -0
- package/dist/types/types/objects/BindingInterface.d.ts +21 -0
- package/dist/types/types/objects/ButtonMapping.d.ts +18 -0
- package/dist/types/types/objects/Factory.d.ts +2 -0
- package/dist/types/types/objects/Installer.d.ts +26 -0
- package/dist/types/types/objects/Manifest.d.ts +74 -0
- package/dist/types/types/objects/Modify.d.ts +52 -0
- package/dist/types/types/objects/PropertyBag.d.ts +2 -0
- package/dist/types/types/objects/Sound.d.ts +8 -0
- package/dist/types/types/objects/Variables.d.ts +1 -0
- package/dist/types/types/objects/elements/Button.d.ts +4 -0
- package/dist/types/types/objects/elements/CollectionPanel.d.ts +4 -0
- package/dist/types/types/objects/elements/Custom.d.ts +5 -0
- package/dist/types/types/objects/elements/Dropdown.d.ts +4 -0
- package/dist/types/types/objects/elements/EditBox.d.ts +4 -0
- package/dist/types/types/objects/elements/Grid.d.ts +4 -0
- package/dist/types/types/objects/elements/Image.d.ts +4 -0
- package/dist/types/types/objects/elements/InputPanel.d.ts +7 -0
- package/dist/types/types/objects/elements/Label.d.ts +4 -0
- package/dist/types/types/objects/elements/PropertiesType.d.ts +45 -0
- package/dist/types/types/objects/elements/Screen.d.ts +4 -0
- package/dist/types/types/objects/elements/ScrollView.d.ts +5 -0
- package/dist/types/types/objects/elements/ScrollbarBox.d.ts +4 -0
- package/dist/types/types/objects/elements/ScrollbarTrack.d.ts +4 -0
- package/dist/types/types/objects/elements/SelectionWheel.d.ts +4 -0
- package/dist/types/types/objects/elements/Slider.d.ts +4 -0
- package/dist/types/types/objects/elements/SliderBox.d.ts +5 -0
- package/dist/types/types/objects/elements/StackPanel.d.ts +7 -0
- package/dist/types/types/objects/elements/Toggle.d.ts +4 -0
- package/dist/types/types/objects/elements/TooltipTrigger.d.ts +8 -0
- package/dist/types/types/objects/elements/panel.d.ts +6 -0
- package/dist/types/types/objects/properties/Buttons.d.ts +5 -0
- package/dist/types/types/objects/properties/CollectionIndexs.d.ts +4 -0
- package/dist/types/types/objects/properties/Collections.d.ts +6 -0
- package/dist/types/types/objects/properties/Controls.d.ts +27 -0
- package/dist/types/types/objects/properties/Dropdowns.d.ts +6 -0
- package/dist/types/types/objects/properties/Focus.d.ts +28 -0
- package/dist/types/types/objects/properties/FocusContainerCustom.d.ts +5 -0
- package/dist/types/types/objects/properties/Grids.d.ts +15 -0
- package/dist/types/types/objects/properties/Inputs.d.ts +13 -0
- package/dist/types/types/objects/properties/Layouts.d.ts +35 -0
- package/dist/types/types/objects/properties/Properties.d.ts +27 -0
- package/dist/types/types/objects/properties/Renderers.d.ts +5 -0
- package/dist/types/types/objects/properties/Screens.d.ts +23 -0
- package/dist/types/types/objects/properties/ScrollViews.d.ts +17 -0
- package/dist/types/types/objects/properties/SelectionWheels.d.ts +13 -0
- package/dist/types/types/objects/properties/SliderBoxs.d.ts +6 -0
- package/dist/types/types/objects/properties/Sliders.d.ts +23 -0
- package/dist/types/types/objects/properties/Sounds.d.ts +10 -0
- package/dist/types/types/objects/properties/Specials.d.ts +60 -0
- package/dist/types/types/objects/properties/Sprites.d.ts +33 -0
- package/dist/types/types/objects/properties/StackPanels.d.ts +5 -0
- package/dist/types/types/objects/properties/TTS.d.ts +24 -0
- package/dist/types/types/objects/properties/TextEdits.d.ts +19 -0
- package/dist/types/types/objects/properties/Texts.d.ts +26 -0
- package/dist/types/types/objects/properties/Toggles.d.ts +24 -0
- package/dist/types/types/objects/properties/TooltipTriggers.d.ts +7 -0
- package/dist/types/types/objects/properties/Variables.d.ts +3 -0
- package/dist/types/types/values/Any.d.ts +4 -0
- package/dist/types/types/values/Binding.d.ts +2 -0
- package/dist/types/types/values/Bool.d.ts +2 -0
- package/dist/types/types/values/ColorVector.d.ts +6 -0
- package/dist/types/types/values/ElementPath.d.ts +2 -0
- package/dist/types/types/values/Hex.d.ts +1 -0
- package/dist/types/types/values/Number.d.ts +4 -0
- package/dist/types/types/values/RangeVector.d.ts +5 -0
- package/dist/types/types/values/Str.d.ts +2 -0
- package/dist/types/types/values/StringVector.d.ts +6 -0
- package/dist/types/types/values/TargetElementPath.d.ts +1 -0
- package/dist/types/types/values/Variable.d.ts +1 -0
- package/dist/types/types/values/Vector.d.ts +5 -0
- package/package.json +4 -4
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
31
|
+
var Save_exports = {};
|
|
32
|
+
__export(Save_exports, {
|
|
33
|
+
Save: () => Save
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(Save_exports);
|
|
36
|
+
var import_fs = __toESM(require("fs"));
|
|
37
|
+
var import_Class = require("../../components/Class");
|
|
38
|
+
var import_Random = require("../../components/Random");
|
|
39
|
+
const _Save = class _Save extends import_Class.Class {
|
|
40
|
+
static write(file, data, options) {
|
|
41
|
+
import_fs.default.writeFileSync(file, JSON.stringify(data), options);
|
|
42
|
+
}
|
|
43
|
+
static read(path, options) {
|
|
44
|
+
return JSON.parse(import_fs.default.readFileSync(path, options));
|
|
45
|
+
}
|
|
46
|
+
static createFile(path, data, write = import_fs.default.writeFileSync, read = import_fs.default.readFileSync) {
|
|
47
|
+
if (!_Save.isSaveCreated && !import_fs.default.existsSync(".save")) import_fs.default.mkdirSync(".save");
|
|
48
|
+
_Save.isSaveCreated = true;
|
|
49
|
+
if (!import_fs.default.existsSync(".save/".concat(path))) {
|
|
50
|
+
const $ = data();
|
|
51
|
+
write(".save/".concat(path), $, "utf-8");
|
|
52
|
+
return $;
|
|
53
|
+
} else return read(".save/".concat(path), "utf-8");
|
|
54
|
+
}
|
|
55
|
+
static createJson(path, data) {
|
|
56
|
+
return _Save.createFile(path, data, this.write, this.read);
|
|
57
|
+
}
|
|
58
|
+
static updateFile(path, data, write = import_fs.default.writeFileSync, read = import_fs.default.readFileSync) {
|
|
59
|
+
if (!_Save.isSaveCreated && !import_fs.default.existsSync(".save")) import_fs.default.mkdirSync(".save");
|
|
60
|
+
const backup = read(".save/".concat(path), "utf-8");
|
|
61
|
+
write(".save/".concat(path), data());
|
|
62
|
+
return backup;
|
|
63
|
+
}
|
|
64
|
+
static updateJson(path, data) {
|
|
65
|
+
return _Save.updateFile(path, data, import_fs.default.read, import_fs.default.readFileSync);
|
|
66
|
+
}
|
|
67
|
+
static uuid() {
|
|
68
|
+
return _Save.createJson("uuid", () => ({
|
|
69
|
+
uuid: [import_Random.Random.getUUID(), import_Random.Random.getUUID()]
|
|
70
|
+
})).uuid;
|
|
71
|
+
}
|
|
72
|
+
static resource(mcVersion = "stable") {
|
|
73
|
+
return _Save.createJson("compile-".concat(mcVersion), () => ({
|
|
74
|
+
isDevelopment: true,
|
|
75
|
+
folderName: import_Random.Random.getName()
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
static getBuildID() {
|
|
79
|
+
return _Save.createJson("buildID", () => [import_Random.Random.genString(16)])[0];
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
__publicField(_Save, "isSaveCreated", false);
|
|
83
|
+
let Save = _Save;
|
|
84
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
85
|
+
0 && (module.exports = {
|
|
86
|
+
Save
|
|
87
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var SearchFiles_exports = {};
|
|
30
|
+
__export(SearchFiles_exports, {
|
|
31
|
+
SearchFiles: () => SearchFiles
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(SearchFiles_exports);
|
|
34
|
+
var import_Class = require("../../components/Class");
|
|
35
|
+
var import_fs = __toESM(require("fs"));
|
|
36
|
+
function searchForEachFileRecursion(path, callback, $1 = "", $2 = "", $3 = "") {
|
|
37
|
+
var _a;
|
|
38
|
+
if (import_fs.default.statSync(path).isDirectory())
|
|
39
|
+
for (const file of import_fs.default.readdirSync(path))
|
|
40
|
+
searchForEachFileRecursion(
|
|
41
|
+
"".concat(path, "/").concat(file),
|
|
42
|
+
callback,
|
|
43
|
+
file,
|
|
44
|
+
"".concat($2, "/").concat(file),
|
|
45
|
+
(_a = $2.match(/(?<=\/)\w+$/)) == null ? void 0 : _a[0]
|
|
46
|
+
);
|
|
47
|
+
else
|
|
48
|
+
callback({
|
|
49
|
+
file: $1,
|
|
50
|
+
folder: $3 === "" ? void 0 : $3,
|
|
51
|
+
path: $2.slice(1)
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
class SearchFiles extends import_Class.Class {
|
|
55
|
+
static array(folderPath, prefix) {
|
|
56
|
+
const paths = [];
|
|
57
|
+
SearchFiles.forEach(
|
|
58
|
+
folderPath,
|
|
59
|
+
(value) => paths.push("".concat(prefix ? "".concat(prefix, "/") : "").concat(value.path))
|
|
60
|
+
);
|
|
61
|
+
return paths;
|
|
62
|
+
}
|
|
63
|
+
static forEach(folderPath, callback) {
|
|
64
|
+
searchForEachFileRecursion(folderPath, callback);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
68
|
+
0 && (module.exports = {
|
|
69
|
+
SearchFiles
|
|
70
|
+
});
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var Sounds_exports = {};
|
|
30
|
+
__export(Sounds_exports, {
|
|
31
|
+
SoundHandler: () => SoundHandler
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(Sounds_exports);
|
|
34
|
+
var import_fs = __toESM(require("fs"));
|
|
35
|
+
var import_jsonc_parser = require("jsonc-parser");
|
|
36
|
+
var import_Class = require("../../components/Class");
|
|
37
|
+
var import_Random = require("../../components/Random");
|
|
38
|
+
var import_PreCompile = require("../PreCompile");
|
|
39
|
+
const sounds = {};
|
|
40
|
+
class SoundHandler extends import_Class.Class {
|
|
41
|
+
static get(path) {
|
|
42
|
+
if (sounds[path]) {
|
|
43
|
+
return sounds[path];
|
|
44
|
+
} else {
|
|
45
|
+
return sounds[path] = "jsonui_scripting.".concat(import_Random.Random.getName());
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
static compile(installPath) {
|
|
49
|
+
const soundIds = Object.keys(sounds);
|
|
50
|
+
if (soundIds.length) {
|
|
51
|
+
if (!import_fs.default.existsSync("".concat(installPath, "/sounds"))) import_fs.default.mkdirSync("".concat(installPath, "/sounds"));
|
|
52
|
+
const soundDefinitions = {};
|
|
53
|
+
for (const soundPath of soundIds) {
|
|
54
|
+
const soundId = sounds[soundPath];
|
|
55
|
+
soundDefinitions[soundId] = {
|
|
56
|
+
category: "ui",
|
|
57
|
+
sounds: [
|
|
58
|
+
{
|
|
59
|
+
load_on_low_memory: true,
|
|
60
|
+
name: soundPath,
|
|
61
|
+
stream: true,
|
|
62
|
+
volume: 1
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
let bak;
|
|
68
|
+
if (import_fs.default.existsSync(".bedrock/sounds/sound_definitions.json")) {
|
|
69
|
+
bak = (0, import_jsonc_parser.parse)(
|
|
70
|
+
import_fs.default.readFileSync(".bedrock/sounds/sound_definitions.json", "utf-8")
|
|
71
|
+
).sound_definitions;
|
|
72
|
+
}
|
|
73
|
+
(0, import_PreCompile.UIWriteJson)(
|
|
74
|
+
"".concat(installPath, "/sounds/sound_definitions.json"),
|
|
75
|
+
{
|
|
76
|
+
format_version: "1.20.20",
|
|
77
|
+
sound_definitions: {
|
|
78
|
+
...bak,
|
|
79
|
+
...soundDefinitions
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"utf-8"
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
return soundIds.length;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
89
|
+
0 && (module.exports = {
|
|
90
|
+
SoundHandler
|
|
91
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var Template_exports = {};
|
|
30
|
+
__export(Template_exports, {
|
|
31
|
+
firstRun: () => firstRun
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(Template_exports);
|
|
34
|
+
var import_template = require("../../template");
|
|
35
|
+
var import_GenerateDir = require("./GenerateDir");
|
|
36
|
+
var import_fs = __toESM(require("fs"));
|
|
37
|
+
function firstRun() {
|
|
38
|
+
const template = {
|
|
39
|
+
".gitignore": import_template.gitignore,
|
|
40
|
+
"asakiyuki.config.cjs": import_template.config.replace("{packname}", "JsonUI Scripting").replace("{packdescription}", "Build with JsonUI Scripting <3").replace("{autoinstall}", "true").replace("{development}", "true").replace("{preview}", "false"),
|
|
41
|
+
"asakiyuki.global_variables.cjs": import_template.globalVariables,
|
|
42
|
+
"asakiyuki.env.cjs": import_template.env
|
|
43
|
+
};
|
|
44
|
+
for (const file in template) {
|
|
45
|
+
if (!import_fs.default.existsSync(file)) {
|
|
46
|
+
(0, import_GenerateDir.GenerateDir)(file);
|
|
47
|
+
import_fs.default.writeFileSync(file, template[file], "utf-8");
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
52
|
+
0 && (module.exports = {
|
|
53
|
+
firstRun
|
|
54
|
+
});
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var UIBuilder_exports = {};
|
|
30
|
+
__export(UIBuilder_exports, {
|
|
31
|
+
UIBuilder: () => UIBuilder
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(UIBuilder_exports);
|
|
34
|
+
var import_fs = __toESM(require("fs"));
|
|
35
|
+
var import_jsonc_parser = require("jsonc-parser");
|
|
36
|
+
var import_JsonBuilder = require("./JsonBuilder");
|
|
37
|
+
var import_SearchFiles = require("./SearchFiles");
|
|
38
|
+
var import_GenerateDir = require("./GenerateDir");
|
|
39
|
+
var import_PreCompile = require("../PreCompile");
|
|
40
|
+
class UIBuilder {
|
|
41
|
+
static delete(installPath) {
|
|
42
|
+
try {
|
|
43
|
+
import_fs.default.unlinkSync(installPath);
|
|
44
|
+
} catch (error) {
|
|
45
|
+
if (import_fs.default.existsSync(installPath)) import_fs.default.rmSync(installPath, { recursive: true });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
static jsonUI(installPath) {
|
|
49
|
+
const build = import_JsonBuilder.JsonBuilder.save.build;
|
|
50
|
+
let count = 0;
|
|
51
|
+
for (const file in build) {
|
|
52
|
+
const namespace = build[file].namespace;
|
|
53
|
+
delete build[file].namespace;
|
|
54
|
+
for (const jsonUI in build[file]) build[file][jsonUI] = build[file][jsonUI].getUI();
|
|
55
|
+
console.timeLog(
|
|
56
|
+
"COMPILER",
|
|
57
|
+
"".concat(file, " ").concat(Object.keys(build[file]).length, " elements has generated!")
|
|
58
|
+
);
|
|
59
|
+
build[file].namespace = namespace;
|
|
60
|
+
(0, import_PreCompile.UIWriteJson)("".concat(installPath, "/@/").concat(file), build[file], "utf-8");
|
|
61
|
+
delete build[file];
|
|
62
|
+
count++;
|
|
63
|
+
}
|
|
64
|
+
return count;
|
|
65
|
+
}
|
|
66
|
+
static modify(installPath) {
|
|
67
|
+
if (!import_fs.default.existsSync("".concat(installPath, "/ui"))) import_fs.default.mkdirSync("".concat(installPath, "/ui"));
|
|
68
|
+
let count = 0;
|
|
69
|
+
const modify = import_JsonBuilder.JsonBuilder.save.modify;
|
|
70
|
+
for (const key in modify) {
|
|
71
|
+
(0, import_GenerateDir.GenerateDir)(installPath, key);
|
|
72
|
+
for (const element in modify[key]) modify[key][element] = modify[key][element].getUI();
|
|
73
|
+
console.timeLog(
|
|
74
|
+
"COMPILER",
|
|
75
|
+
"".concat(key, " ").concat(Object.keys(modify[key]).length, " modify element(s) has generated!")
|
|
76
|
+
);
|
|
77
|
+
(0, import_PreCompile.UIWriteJson)("".concat(installPath, "/").concat(key), modify[key], "utf-8");
|
|
78
|
+
delete modify[key];
|
|
79
|
+
count++;
|
|
80
|
+
}
|
|
81
|
+
return count;
|
|
82
|
+
}
|
|
83
|
+
static uiDefs(installPath) {
|
|
84
|
+
const arr = import_SearchFiles.SearchFiles.array("".concat(installPath, "/@"), "@");
|
|
85
|
+
(0, import_PreCompile.UIWriteJson)("".concat(installPath, "/ui/_ui_defs.json"), { ui_defs: arr }, "utf-8");
|
|
86
|
+
return arr.length;
|
|
87
|
+
}
|
|
88
|
+
static contents(installPath) {
|
|
89
|
+
const arr = import_SearchFiles.SearchFiles.array(installPath);
|
|
90
|
+
(0, import_PreCompile.UIWriteJson)(
|
|
91
|
+
"".concat(installPath, "/contents.json"),
|
|
92
|
+
{
|
|
93
|
+
content: arr.map((v) => ({ path: v }))
|
|
94
|
+
},
|
|
95
|
+
"utf-8"
|
|
96
|
+
);
|
|
97
|
+
return arr.length;
|
|
98
|
+
}
|
|
99
|
+
static texturesList(installPath) {
|
|
100
|
+
const arr = import_SearchFiles.SearchFiles.array(installPath).filter((v) => /\.(png|jpg|jpeg)$/.test(v)).map((v) => v.replace(/\.(png|jpg|jpeg)$/, ""));
|
|
101
|
+
let textureList = [];
|
|
102
|
+
if (import_fs.default.existsSync(".bedrock/textures/textures_list.json")) {
|
|
103
|
+
const texturesList = import_fs.default.readFileSync(".bedrock/textures/textures_list.json", "utf-8");
|
|
104
|
+
textureList = (0, import_jsonc_parser.parse)(texturesList);
|
|
105
|
+
}
|
|
106
|
+
if (!import_fs.default.existsSync("".concat(installPath, "/textures"))) import_fs.default.mkdirSync("".concat(installPath, "/textures"));
|
|
107
|
+
(0, import_PreCompile.UIWriteJson)(
|
|
108
|
+
"".concat(installPath, "/textures/textures_list.json"),
|
|
109
|
+
[...arr, ...textureList],
|
|
110
|
+
"utf-8"
|
|
111
|
+
);
|
|
112
|
+
return arr.length;
|
|
113
|
+
}
|
|
114
|
+
static globalVariables(installPath) {
|
|
115
|
+
const globalVariables = import_JsonBuilder.JsonBuilder.save.globalVariables;
|
|
116
|
+
(0, import_PreCompile.UIWriteJson)("".concat(installPath, "/ui/_global_variables.json"), globalVariables, "utf-8");
|
|
117
|
+
return Object.keys(globalVariables).length;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
121
|
+
0 && (module.exports = {
|
|
122
|
+
UIBuilder
|
|
123
|
+
});
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var Audio_exports = {};
|
|
30
|
+
__export(Audio_exports, {
|
|
31
|
+
FormatAudio: () => FormatAudio
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(Audio_exports);
|
|
34
|
+
var import_fs = __toESM(require("fs"));
|
|
35
|
+
var import_SearchFiles = require("../generator/SearchFiles");
|
|
36
|
+
var import_child_process = require("child_process");
|
|
37
|
+
var import_Log = require("../generator/Log");
|
|
38
|
+
function FormatAudio() {
|
|
39
|
+
const reg = /\.(mp3|m4a|mp4|mov|opus|acc|flac)$/;
|
|
40
|
+
const files = import_SearchFiles.SearchFiles.array(".bedrock", ".bedrock").filter(
|
|
41
|
+
(path) => reg.test(path)
|
|
42
|
+
);
|
|
43
|
+
if (!files.length) return;
|
|
44
|
+
try {
|
|
45
|
+
(0, import_child_process.spawnSync)("ffmpeg", ["-version"], {
|
|
46
|
+
stdio: ["ignore", "ignore", "ignore"]
|
|
47
|
+
}).error;
|
|
48
|
+
console.timeLog(
|
|
49
|
+
"Compiler",
|
|
50
|
+
">> Starting to convert all found audio files to WAV format"
|
|
51
|
+
);
|
|
52
|
+
for (const file of files) {
|
|
53
|
+
const out = file.replace(reg, ".wav");
|
|
54
|
+
(0, import_child_process.execSync)("ffmpeg -i ".concat(file, " ").concat(out), {
|
|
55
|
+
stdio: "ignore"
|
|
56
|
+
});
|
|
57
|
+
import_fs.default.rmSync(file);
|
|
58
|
+
console.timeLog(
|
|
59
|
+
"Compiler",
|
|
60
|
+
">> Reformatting of ".concat(file.replace(
|
|
61
|
+
/^\.bedrock\//,
|
|
62
|
+
""
|
|
63
|
+
), " is complete.")
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
console.timeLog(
|
|
67
|
+
"Compiler",
|
|
68
|
+
">> Successfully reformatted ".concat(files.length, " audio file(s).")
|
|
69
|
+
);
|
|
70
|
+
console.log();
|
|
71
|
+
} catch (error) {
|
|
72
|
+
import_Log.Log.warning(
|
|
73
|
+
"You need to install 'ffmpeg' to your system environment variables to automatic convert all audio files to a format minecraft can read."
|
|
74
|
+
);
|
|
75
|
+
console.log();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
79
|
+
0 && (module.exports = {
|
|
80
|
+
FormatAudio
|
|
81
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var Color_exports = {};
|
|
20
|
+
__export(Color_exports, {
|
|
21
|
+
ColorHandler: () => ColorHandler
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(Color_exports);
|
|
24
|
+
var import_Class = require("../../components/Class");
|
|
25
|
+
class ColorHandler extends import_Class.Class {
|
|
26
|
+
static parse(data) {
|
|
27
|
+
if (data.startsWith("#")) data = data.slice(1);
|
|
28
|
+
try {
|
|
29
|
+
const color = parseInt(data, 16);
|
|
30
|
+
switch (data.length) {
|
|
31
|
+
case 3:
|
|
32
|
+
return [(color >> 8 & 15) / 15, (color >> 4 & 15) / 15, (color & 15) / 15];
|
|
33
|
+
case 6:
|
|
34
|
+
return [
|
|
35
|
+
(color >> 16 & 255) / 255,
|
|
36
|
+
(color >> 8 & 255) / 255,
|
|
37
|
+
(color & 255) / 255
|
|
38
|
+
];
|
|
39
|
+
case 4:
|
|
40
|
+
return [
|
|
41
|
+
(color >> 16 & 15) / 15,
|
|
42
|
+
(color >> 8 & 15) / 15,
|
|
43
|
+
(color >> 4 & 15) / 15,
|
|
44
|
+
(color & 15) / 15
|
|
45
|
+
];
|
|
46
|
+
case 8:
|
|
47
|
+
return [
|
|
48
|
+
(color >> 24 & 255) / 255,
|
|
49
|
+
(color >> 16 & 255) / 255,
|
|
50
|
+
(color >> 8 & 255) / 255,
|
|
51
|
+
(color & 255) / 255
|
|
52
|
+
];
|
|
53
|
+
default:
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
} catch (error) {
|
|
57
|
+
console.error(error);
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
63
|
+
0 && (module.exports = {
|
|
64
|
+
ColorHandler
|
|
65
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var CurrentLine_exports = {};
|
|
20
|
+
__export(CurrentLine_exports, {
|
|
21
|
+
CurrentLine: () => CurrentLine
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(CurrentLine_exports);
|
|
24
|
+
const regex = {
|
|
25
|
+
win32: /[A-Z]:(.+):\d+:\d+/g,
|
|
26
|
+
linux: /\/(.+):\d+:\d+/g
|
|
27
|
+
};
|
|
28
|
+
function CurrentLine() {
|
|
29
|
+
var _a;
|
|
30
|
+
const lines = (_a = new Error("Code Line").stack) == null ? void 0 : _a.match(regex[process.platform]);
|
|
31
|
+
return lines ? lines[lines.length - 1] : "Unknown";
|
|
32
|
+
}
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
CurrentLine
|
|
36
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var Env_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(Env_exports);
|
|
17
|
+
var import_Object = require("./Object");
|
|
18
|
+
import_Object.Obj.forEach(
|
|
19
|
+
require("".concat(process.cwd(), "/asakiyuki.env.cjs")).env,
|
|
20
|
+
(key, value) => process.env[key] = value
|
|
21
|
+
);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var GlobalVariables_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(GlobalVariables_exports);
|
|
17
|
+
var import_Object = require("./Object");
|
|
18
|
+
var import_JsonBuilder = require("../generator/JsonBuilder");
|
|
19
|
+
var import_ReadProperties = require("./ReadProperties");
|
|
20
|
+
import_Object.Obj.forEach(
|
|
21
|
+
require("".concat(process.cwd(), "/asakiyuki.global_variables.cjs")).global_variables,
|
|
22
|
+
(key, value) => import_JsonBuilder.JsonBuilder.registerGlobalVariable(key, (0, import_ReadProperties.ReadValue)(value))
|
|
23
|
+
);
|