asajs 3.0.2 → 3.0.5

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.
Files changed (286) hide show
  1. package/dist/cjs/compilers/BindingCompiler.js +458 -0
  2. package/dist/cjs/compilers/BindingFunctions.js +267 -0
  3. package/dist/cjs/compilers/Compiler.js +158 -0
  4. package/dist/cjs/compilers/Compress.js +55 -0
  5. package/dist/cjs/compilers/Config.js +138 -0
  6. package/dist/cjs/compilers/Encoder.js +90 -0
  7. package/dist/cjs/compilers/Installer.js +123 -0
  8. package/dist/cjs/compilers/PreCompile.js +86 -0
  9. package/dist/cjs/compilers/generator/GenerateDir.js +51 -0
  10. package/dist/cjs/compilers/generator/JsonBuilder.js +66 -0
  11. package/dist/cjs/compilers/generator/LangBuilder.js +65 -0
  12. package/dist/cjs/compilers/generator/Log.js +45 -0
  13. package/dist/cjs/compilers/generator/Manifest.js +63 -0
  14. package/dist/cjs/compilers/generator/Save.js +87 -0
  15. package/dist/cjs/compilers/generator/SearchFiles.js +70 -0
  16. package/dist/cjs/compilers/generator/Sounds.js +91 -0
  17. package/dist/cjs/compilers/generator/Template.js +54 -0
  18. package/dist/cjs/compilers/generator/UIBuilder.js +123 -0
  19. package/dist/cjs/compilers/reader/Audio.js +81 -0
  20. package/dist/cjs/compilers/reader/Color.js +65 -0
  21. package/dist/cjs/compilers/reader/CurrentLine.js +36 -0
  22. package/dist/cjs/compilers/reader/Env.js +21 -0
  23. package/dist/cjs/compilers/reader/GlobalVariables.js +23 -0
  24. package/dist/cjs/compilers/reader/Object.js +44 -0
  25. package/dist/cjs/compilers/reader/ReadBinding.js +67 -0
  26. package/dist/cjs/compilers/reader/ReadProperties.js +118 -0
  27. package/dist/cjs/components/AddCollectionChill.js +41 -0
  28. package/dist/cjs/components/Animation.js +127 -0
  29. package/dist/cjs/components/AnimationKeyFrame.js +49 -0
  30. package/dist/cjs/components/Class.js +95 -0
  31. package/dist/cjs/components/LocalizeText.js +59 -0
  32. package/dist/cjs/components/Modify.js +377 -0
  33. package/dist/cjs/components/Random.js +104 -0
  34. package/dist/cjs/components/UI.js +387 -0
  35. package/dist/cjs/components/Vanilla.js +57915 -0
  36. package/dist/cjs/index.js +291 -0
  37. package/dist/cjs/package.json +1 -0
  38. package/dist/cjs/template.js +37 -0
  39. package/dist/cjs/types/components/ChildIdentifier.js +16 -0
  40. package/dist/cjs/types/components/Identifier.js +17 -0
  41. package/dist/cjs/types/components/NameCallback.js +16 -0
  42. package/dist/cjs/types/components/UIIdentifier.js +16 -0
  43. package/dist/cjs/types/components/UIInterface.js +16 -0
  44. package/dist/cjs/types/enums/Anchor.js +39 -0
  45. package/dist/cjs/types/enums/AnimTypes.js +39 -0
  46. package/dist/cjs/types/enums/BindingCondition.js +36 -0
  47. package/dist/cjs/types/enums/BindingName.js +4208 -0
  48. package/dist/cjs/types/enums/BindingType.js +35 -0
  49. package/dist/cjs/types/enums/ClipDirecion.js +35 -0
  50. package/dist/cjs/types/enums/Collection.js +202 -0
  51. package/dist/cjs/types/enums/Direction.js +33 -0
  52. package/dist/cjs/types/enums/EasingTypes.js +62 -0
  53. package/dist/cjs/types/enums/EnumColor.js +37 -0
  54. package/dist/cjs/types/enums/FocusNavigationMode.js +34 -0
  55. package/dist/cjs/types/enums/FontSize.js +34 -0
  56. package/dist/cjs/types/enums/FontType.js +35 -0
  57. package/dist/cjs/types/enums/GlobalVariables.js +345 -0
  58. package/dist/cjs/types/enums/InputModeCondition.js +33 -0
  59. package/dist/cjs/types/enums/ItemAuxID.js +31 -0
  60. package/dist/cjs/types/enums/JsonUIArrayName.js +36 -0
  61. package/dist/cjs/types/enums/MappingFrom.js +81 -0
  62. package/dist/cjs/types/enums/MappingTo.js +248 -0
  63. package/dist/cjs/types/enums/MappingTypes.js +34 -0
  64. package/dist/cjs/types/enums/Orientation.js +32 -0
  65. package/dist/cjs/types/enums/Renderer.js +68 -0
  66. package/dist/cjs/types/enums/Rotation.js +33 -0
  67. package/dist/cjs/types/enums/Scope.js +32 -0
  68. package/dist/cjs/types/enums/TextTypes.js +33 -0
  69. package/dist/cjs/types/enums/TextureFileSystem.js +41 -0
  70. package/dist/cjs/types/enums/Types.js +57 -0
  71. package/dist/cjs/types/objects/Animation.js +16 -0
  72. package/dist/cjs/types/objects/BindingHook.js +16 -0
  73. package/dist/cjs/types/objects/BindingInterface.js +16 -0
  74. package/dist/cjs/types/objects/ButtonMapping.js +16 -0
  75. package/dist/cjs/types/objects/Factory.js +16 -0
  76. package/dist/cjs/types/objects/Installer.js +53 -0
  77. package/dist/cjs/types/objects/Manifest.js +56 -0
  78. package/dist/cjs/types/objects/Modify.js +16 -0
  79. package/dist/cjs/types/objects/PropertyBag.js +16 -0
  80. package/dist/cjs/types/objects/Sound.js +16 -0
  81. package/dist/cjs/types/objects/Variables.js +16 -0
  82. package/dist/cjs/types/objects/elements/Button.js +17 -0
  83. package/dist/cjs/types/objects/elements/CollectionPanel.js +17 -0
  84. package/dist/cjs/types/objects/elements/Custom.js +17 -0
  85. package/dist/cjs/types/objects/elements/Dropdown.js +17 -0
  86. package/dist/cjs/types/objects/elements/EditBox.js +17 -0
  87. package/dist/cjs/types/objects/elements/Grid.js +16 -0
  88. package/dist/cjs/types/objects/elements/Image.js +17 -0
  89. package/dist/cjs/types/objects/elements/InputPanel.js +16 -0
  90. package/dist/cjs/types/objects/elements/Label.js +17 -0
  91. package/dist/cjs/types/objects/elements/PropertiesType.js +17 -0
  92. package/dist/cjs/types/objects/elements/Screen.js +17 -0
  93. package/dist/cjs/types/objects/elements/ScrollView.js +17 -0
  94. package/dist/cjs/types/objects/elements/ScrollbarBox.js +17 -0
  95. package/dist/cjs/types/objects/elements/ScrollbarTrack.js +17 -0
  96. package/dist/cjs/types/objects/elements/SelectionWheel.js +17 -0
  97. package/dist/cjs/types/objects/elements/Slider.js +17 -0
  98. package/dist/cjs/types/objects/elements/SliderBox.js +17 -0
  99. package/dist/cjs/types/objects/elements/StackPanel.js +16 -0
  100. package/dist/cjs/types/objects/elements/Toggle.js +17 -0
  101. package/dist/cjs/types/objects/elements/TooltipTrigger.js +16 -0
  102. package/dist/cjs/types/objects/elements/panel.js +16 -0
  103. package/dist/cjs/types/objects/properties/Buttons.js +16 -0
  104. package/dist/cjs/types/objects/properties/CollectionIndexs.js +16 -0
  105. package/dist/cjs/types/objects/properties/Collections.js +16 -0
  106. package/dist/cjs/types/objects/properties/Controls.js +16 -0
  107. package/dist/cjs/types/objects/properties/Dropdowns.js +16 -0
  108. package/dist/cjs/types/objects/properties/Focus.js +16 -0
  109. package/dist/cjs/types/objects/properties/FocusContainerCustom.js +16 -0
  110. package/dist/cjs/types/objects/properties/Grids.js +16 -0
  111. package/dist/cjs/types/objects/properties/Inputs.js +16 -0
  112. package/dist/cjs/types/objects/properties/Layouts.js +16 -0
  113. package/dist/cjs/types/objects/properties/Properties.js +16 -0
  114. package/dist/cjs/types/objects/properties/Renderers.js +16 -0
  115. package/dist/cjs/types/objects/properties/Screens.js +16 -0
  116. package/dist/cjs/types/objects/properties/ScrollViews.js +16 -0
  117. package/dist/cjs/types/objects/properties/SelectionWheels.js +16 -0
  118. package/dist/cjs/types/objects/properties/SliderBoxs.js +16 -0
  119. package/dist/cjs/types/objects/properties/Sliders.js +16 -0
  120. package/dist/cjs/types/objects/properties/Sounds.js +16 -0
  121. package/dist/cjs/types/objects/properties/Specials.js +16 -0
  122. package/dist/cjs/types/objects/properties/Sprites.js +16 -0
  123. package/dist/cjs/types/objects/properties/StackPanels.js +16 -0
  124. package/dist/cjs/types/objects/properties/TTS.js +16 -0
  125. package/dist/cjs/types/objects/properties/TextEdits.js +16 -0
  126. package/dist/cjs/types/objects/properties/Texts.js +16 -0
  127. package/dist/cjs/types/objects/properties/Toggles.js +16 -0
  128. package/dist/cjs/types/objects/properties/TooltipTriggers.js +16 -0
  129. package/dist/cjs/types/objects/properties/Variables.js +16 -0
  130. package/dist/cjs/types/values/Any.js +16 -0
  131. package/dist/cjs/types/values/Binding.js +16 -0
  132. package/dist/cjs/types/values/Bool.js +16 -0
  133. package/dist/cjs/types/values/ColorVector.js +16 -0
  134. package/dist/cjs/types/values/ElementPath.js +16 -0
  135. package/dist/cjs/types/values/Hex.js +16 -0
  136. package/dist/cjs/types/values/Number.js +16 -0
  137. package/dist/cjs/types/values/RangeVector.js +16 -0
  138. package/dist/cjs/types/values/Str.js +16 -0
  139. package/dist/cjs/types/values/StringVector.js +16 -0
  140. package/dist/cjs/types/values/TargetElementPath.js +16 -0
  141. package/dist/cjs/types/values/Variable.js +16 -0
  142. package/dist/cjs/types/values/Vector.js +16 -0
  143. package/dist/esm/index.js +68470 -0
  144. package/dist/esm/package.json +1 -0
  145. package/dist/types/compilers/BindingCompiler.d.ts +44 -0
  146. package/dist/types/compilers/BindingFunctions.d.ts +10 -0
  147. package/dist/types/compilers/Compiler.d.ts +3 -0
  148. package/dist/types/compilers/Compress.d.ts +1 -0
  149. package/dist/types/compilers/Config.d.ts +95 -0
  150. package/dist/types/compilers/Encoder.d.ts +11 -0
  151. package/dist/types/compilers/Installer.d.ts +14 -0
  152. package/dist/types/compilers/PreCompile.d.ts +4 -0
  153. package/dist/types/compilers/generator/GenerateDir.d.ts +1 -0
  154. package/dist/types/compilers/generator/JsonBuilder.d.ts +28 -0
  155. package/dist/types/compilers/generator/LangBuilder.d.ts +4 -0
  156. package/dist/types/compilers/generator/Log.d.ts +9 -0
  157. package/dist/types/compilers/generator/Manifest.d.ts +21 -0
  158. package/dist/types/compilers/generator/Save.d.ts +16 -0
  159. package/dist/types/compilers/generator/SearchFiles.d.ts +11 -0
  160. package/dist/types/compilers/generator/Sounds.d.ts +5 -0
  161. package/dist/types/compilers/generator/Template.d.ts +1 -0
  162. package/dist/types/compilers/generator/UIBuilder.d.ts +9 -0
  163. package/dist/types/compilers/reader/Audio.d.ts +1 -0
  164. package/dist/types/compilers/reader/Color.d.ts +5 -0
  165. package/dist/types/compilers/reader/CurrentLine.d.ts +1 -0
  166. package/dist/types/compilers/reader/Env.d.ts +1 -0
  167. package/dist/types/compilers/reader/GlobalVariables.d.ts +1 -0
  168. package/dist/types/compilers/reader/Object.d.ts +11 -0
  169. package/dist/types/compilers/reader/ReadBinding.d.ts +6 -0
  170. package/dist/types/compilers/reader/ReadProperties.d.ts +3 -0
  171. package/dist/types/components/AddCollectionChill.d.ts +6 -0
  172. package/dist/types/components/Animation.d.ts +15 -0
  173. package/dist/types/components/AnimationKeyFrame.d.ts +10 -0
  174. package/dist/types/components/Class.d.ts +68 -0
  175. package/dist/types/components/LocalizeText.d.ts +21 -0
  176. package/dist/types/components/Modify.d.ts +30 -0
  177. package/dist/types/components/Random.d.ts +20 -0
  178. package/dist/types/components/UI.d.ts +89 -0
  179. package/dist/types/components/Vanilla.d.ts +19729 -0
  180. package/dist/types/index.d.ts +136 -0
  181. package/dist/types/template.d.ts +4 -0
  182. package/dist/types/types/components/ChildIdentifier.d.ts +11 -0
  183. package/dist/types/types/components/Identifier.d.ts +4 -0
  184. package/dist/types/types/components/NameCallback.d.ts +3 -0
  185. package/dist/types/types/components/UIIdentifier.d.ts +4 -0
  186. package/dist/types/types/components/UIInterface.d.ts +16 -0
  187. package/dist/types/types/enums/Anchor.d.ts +11 -0
  188. package/dist/types/types/enums/AnimTypes.d.ts +11 -0
  189. package/dist/types/types/enums/BindingCondition.d.ts +8 -0
  190. package/dist/types/types/enums/BindingName.d.ts +4180 -0
  191. package/dist/types/types/enums/BindingType.d.ts +7 -0
  192. package/dist/types/types/enums/ClipDirecion.d.ts +7 -0
  193. package/dist/types/types/enums/Collection.d.ts +174 -0
  194. package/dist/types/types/enums/Direction.d.ts +5 -0
  195. package/dist/types/types/enums/EasingTypes.d.ts +34 -0
  196. package/dist/types/types/enums/EnumColor.d.ts +9 -0
  197. package/dist/types/types/enums/FocusNavigationMode.d.ts +6 -0
  198. package/dist/types/types/enums/FontSize.d.ts +6 -0
  199. package/dist/types/types/enums/FontType.d.ts +7 -0
  200. package/dist/types/types/enums/GlobalVariables.d.ts +317 -0
  201. package/dist/types/types/enums/InputModeCondition.d.ts +5 -0
  202. package/dist/types/types/enums/ItemAuxID.d.ts +3 -0
  203. package/dist/types/types/enums/JsonUIArrayName.d.ts +7 -0
  204. package/dist/types/types/enums/MappingFrom.d.ts +53 -0
  205. package/dist/types/types/enums/MappingTo.d.ts +220 -0
  206. package/dist/types/types/enums/MappingTypes.d.ts +6 -0
  207. package/dist/types/types/enums/Orientation.d.ts +4 -0
  208. package/dist/types/types/enums/Renderer.d.ts +40 -0
  209. package/dist/types/types/enums/Rotation.d.ts +5 -0
  210. package/dist/types/types/enums/Scope.d.ts +4 -0
  211. package/dist/types/types/enums/TextTypes.d.ts +5 -0
  212. package/dist/types/types/enums/TextureFileSystem.d.ts +13 -0
  213. package/dist/types/types/enums/Types.d.ts +29 -0
  214. package/dist/types/types/objects/Animation.d.ts +36 -0
  215. package/dist/types/types/objects/BindingHook.d.ts +1 -0
  216. package/dist/types/types/objects/BindingInterface.d.ts +21 -0
  217. package/dist/types/types/objects/ButtonMapping.d.ts +18 -0
  218. package/dist/types/types/objects/Factory.d.ts +2 -0
  219. package/dist/types/types/objects/Installer.d.ts +26 -0
  220. package/dist/types/types/objects/Manifest.d.ts +74 -0
  221. package/dist/types/types/objects/Modify.d.ts +52 -0
  222. package/dist/types/types/objects/PropertyBag.d.ts +2 -0
  223. package/dist/types/types/objects/Sound.d.ts +8 -0
  224. package/dist/types/types/objects/Variables.d.ts +1 -0
  225. package/dist/types/types/objects/elements/Button.d.ts +4 -0
  226. package/dist/types/types/objects/elements/CollectionPanel.d.ts +4 -0
  227. package/dist/types/types/objects/elements/Custom.d.ts +5 -0
  228. package/dist/types/types/objects/elements/Dropdown.d.ts +4 -0
  229. package/dist/types/types/objects/elements/EditBox.d.ts +4 -0
  230. package/dist/types/types/objects/elements/Grid.d.ts +4 -0
  231. package/dist/types/types/objects/elements/Image.d.ts +4 -0
  232. package/dist/types/types/objects/elements/InputPanel.d.ts +7 -0
  233. package/dist/types/types/objects/elements/Label.d.ts +4 -0
  234. package/dist/types/types/objects/elements/PropertiesType.d.ts +45 -0
  235. package/dist/types/types/objects/elements/Screen.d.ts +4 -0
  236. package/dist/types/types/objects/elements/ScrollView.d.ts +5 -0
  237. package/dist/types/types/objects/elements/ScrollbarBox.d.ts +4 -0
  238. package/dist/types/types/objects/elements/ScrollbarTrack.d.ts +4 -0
  239. package/dist/types/types/objects/elements/SelectionWheel.d.ts +4 -0
  240. package/dist/types/types/objects/elements/Slider.d.ts +4 -0
  241. package/dist/types/types/objects/elements/SliderBox.d.ts +5 -0
  242. package/dist/types/types/objects/elements/StackPanel.d.ts +7 -0
  243. package/dist/types/types/objects/elements/Toggle.d.ts +4 -0
  244. package/dist/types/types/objects/elements/TooltipTrigger.d.ts +8 -0
  245. package/dist/types/types/objects/elements/panel.d.ts +6 -0
  246. package/dist/types/types/objects/properties/Buttons.d.ts +5 -0
  247. package/dist/types/types/objects/properties/CollectionIndexs.d.ts +4 -0
  248. package/dist/types/types/objects/properties/Collections.d.ts +6 -0
  249. package/dist/types/types/objects/properties/Controls.d.ts +27 -0
  250. package/dist/types/types/objects/properties/Dropdowns.d.ts +6 -0
  251. package/dist/types/types/objects/properties/Focus.d.ts +28 -0
  252. package/dist/types/types/objects/properties/FocusContainerCustom.d.ts +5 -0
  253. package/dist/types/types/objects/properties/Grids.d.ts +15 -0
  254. package/dist/types/types/objects/properties/Inputs.d.ts +13 -0
  255. package/dist/types/types/objects/properties/Layouts.d.ts +35 -0
  256. package/dist/types/types/objects/properties/Properties.d.ts +27 -0
  257. package/dist/types/types/objects/properties/Renderers.d.ts +5 -0
  258. package/dist/types/types/objects/properties/Screens.d.ts +23 -0
  259. package/dist/types/types/objects/properties/ScrollViews.d.ts +17 -0
  260. package/dist/types/types/objects/properties/SelectionWheels.d.ts +13 -0
  261. package/dist/types/types/objects/properties/SliderBoxs.d.ts +6 -0
  262. package/dist/types/types/objects/properties/Sliders.d.ts +23 -0
  263. package/dist/types/types/objects/properties/Sounds.d.ts +10 -0
  264. package/dist/types/types/objects/properties/Specials.d.ts +60 -0
  265. package/dist/types/types/objects/properties/Sprites.d.ts +33 -0
  266. package/dist/types/types/objects/properties/StackPanels.d.ts +5 -0
  267. package/dist/types/types/objects/properties/TTS.d.ts +24 -0
  268. package/dist/types/types/objects/properties/TextEdits.d.ts +19 -0
  269. package/dist/types/types/objects/properties/Texts.d.ts +26 -0
  270. package/dist/types/types/objects/properties/Toggles.d.ts +24 -0
  271. package/dist/types/types/objects/properties/TooltipTriggers.d.ts +7 -0
  272. package/dist/types/types/objects/properties/Variables.d.ts +3 -0
  273. package/dist/types/types/values/Any.d.ts +4 -0
  274. package/dist/types/types/values/Binding.d.ts +2 -0
  275. package/dist/types/types/values/Bool.d.ts +2 -0
  276. package/dist/types/types/values/ColorVector.d.ts +6 -0
  277. package/dist/types/types/values/ElementPath.d.ts +2 -0
  278. package/dist/types/types/values/Hex.d.ts +1 -0
  279. package/dist/types/types/values/Number.d.ts +4 -0
  280. package/dist/types/types/values/RangeVector.d.ts +5 -0
  281. package/dist/types/types/values/Str.d.ts +2 -0
  282. package/dist/types/types/values/StringVector.d.ts +6 -0
  283. package/dist/types/types/values/TargetElementPath.d.ts +1 -0
  284. package/dist/types/types/values/Variable.d.ts +1 -0
  285. package/dist/types/types/values/Vector.d.ts +5 -0
  286. package/package.json +4 -4
@@ -0,0 +1,377 @@
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 __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
21
+ var Modify_exports = {};
22
+ __export(Modify_exports, {
23
+ Modify: () => Modify
24
+ });
25
+ module.exports = __toCommonJS(Modify_exports);
26
+ var import_JsonBuilder = require("../compilers/generator/JsonBuilder");
27
+ var import_Log = require("../compilers/generator/Log");
28
+ var import_CurrentLine = require("../compilers/reader/CurrentLine");
29
+ var import_Object = require("../compilers/reader/Object");
30
+ var import_ReadBinding = require("../compilers/reader/ReadBinding");
31
+ var import_ReadProperties = require("../compilers/reader/ReadProperties");
32
+ var import_Class = require("./Class");
33
+ var import_Random = require("./Random");
34
+ var import_UI = require("./UI");
35
+ class Modify extends import_Class.Class {
36
+ constructor(properties, identifier) {
37
+ var _a, _b;
38
+ super();
39
+ __publicField(this, "properties", {});
40
+ __publicField(this, "controls");
41
+ __publicField(this, "bindings");
42
+ __publicField(this, "variables");
43
+ __publicField(this, "isValidPath");
44
+ __publicField(this, "name", "");
45
+ __publicField(this, "namespace", "");
46
+ __publicField(this, "modifyBindings");
47
+ __publicField(this, "removeModifyBindings");
48
+ __publicField(this, "modifyControls", {
49
+ remove: [],
50
+ replace: [],
51
+ insertBack: [],
52
+ insertFront: [],
53
+ insertAfter: [],
54
+ insertBefore: [],
55
+ moveAfter: [],
56
+ moveBack: [],
57
+ moveBefore: [],
58
+ moveFront: []
59
+ });
60
+ __publicField(this, "override", {
61
+ sourceBindings: {},
62
+ setProperties: (properties) => {
63
+ this.properties = {
64
+ ...this.properties,
65
+ ...properties
66
+ };
67
+ return this.override;
68
+ },
69
+ addChild: (element, properties, name, callback) => {
70
+ if (!element) {
71
+ this.controls || (this.controls = []);
72
+ return this.override;
73
+ }
74
+ if (!this.controls) this.controls = [];
75
+ name || (name = import_Random.Random.getName());
76
+ this.controls.push({
77
+ ["".concat(name, "@").concat(typeof element === "string" ? element.startsWith("@") ? element.slice(1) : element : element.getPath())]: properties ? (0, import_ReadProperties.ReadProperties)(properties) : {}
78
+ });
79
+ callback == null ? void 0 : callback(this, name);
80
+ return this.override;
81
+ },
82
+ addBindings: (bindings) => {
83
+ if (!bindings) {
84
+ this.bindings || (this.bindings = []);
85
+ return this.override;
86
+ }
87
+ if (Array.isArray(bindings))
88
+ for (const binding of bindings) this.override.addBindings(binding);
89
+ else (this.bindings || (this.bindings = [])).push((0, import_ReadBinding.ReadBinding)(bindings, this.override));
90
+ return this.override;
91
+ },
92
+ addVariables: (variables) => {
93
+ this.variables || (this.variables = {});
94
+ if (variables)
95
+ import_Object.Obj.forEach(variables, (key, value) => {
96
+ this.variables[key] = {
97
+ ...import_Object.Obj.map(value, (k, v) => {
98
+ return { key: k, value: (0, import_ReadProperties.ReadValue)(v) };
99
+ })
100
+ };
101
+ });
102
+ return this.override;
103
+ },
104
+ searchBinding: (bindingName, controlName, targetBindingName) => {
105
+ var _a, _b;
106
+ for (let index = 0; index < (((_a = this.bindings) == null ? void 0 : _a.length) || 0); index++) {
107
+ const binding = (_b = this.bindings) == null ? void 0 : _b[index];
108
+ if (controlName) {
109
+ if ((binding == null ? void 0 : binding.source_control_name) === controlName && binding.source_property_name === bindingName) {
110
+ if (targetBindingName) {
111
+ if (binding.target_property_name === targetBindingName) {
112
+ return targetBindingName;
113
+ } else return void 0;
114
+ } else return binding.target_property_name;
115
+ }
116
+ } else {
117
+ if ((binding == null ? void 0 : binding.source_property_name) === bindingName) {
118
+ if (targetBindingName) {
119
+ if (binding.target_property_name === targetBindingName) {
120
+ return targetBindingName;
121
+ } else return void 0;
122
+ } else return binding.target_property_name;
123
+ }
124
+ }
125
+ }
126
+ return void 0;
127
+ }
128
+ });
129
+ __publicField(this, "modify", {
130
+ bindings: {
131
+ remove: (bindings) => {
132
+ var _a, _b;
133
+ if (Array.isArray(bindings)) {
134
+ (_a = this.removeModifyBindings || (this.removeModifyBindings = [])) == null ? void 0 : _a.push(...bindings);
135
+ } else (_b = this.removeModifyBindings || (this.removeModifyBindings = [])) == null ? void 0 : _b.push(bindings);
136
+ return this.modify.bindings;
137
+ },
138
+ addBindings: (bindings) => {
139
+ if (Array.isArray(bindings))
140
+ bindings.forEach((binding) => this.modify.bindings.addBindings(binding));
141
+ else {
142
+ (this.modifyBindings || (this.modifyBindings = [])).push(
143
+ (0, import_ReadBinding.ReadBinding)(bindings, this.modify.bindings)
144
+ );
145
+ }
146
+ return this.modify.bindings;
147
+ }
148
+ },
149
+ controls: {
150
+ remove: (childName) => {
151
+ if (Array.isArray(childName)) this.modifyControls.remove.push(...childName);
152
+ else this.modifyControls.remove.push(childName);
153
+ return this.modify.controls;
154
+ },
155
+ moveAfter: (childName) => {
156
+ if (Array.isArray(childName)) this.modifyControls.moveAfter.push(...childName);
157
+ else this.modifyControls.moveAfter.push(childName);
158
+ return this.modify.controls;
159
+ },
160
+ moveBack: (childName) => {
161
+ if (Array.isArray(childName)) this.modifyControls.moveBack.push(...childName);
162
+ else this.modifyControls.moveBack.push(childName);
163
+ return this.modify.controls;
164
+ },
165
+ moveFront: (childName) => {
166
+ if (Array.isArray(childName)) this.modifyControls.moveFront.push(...childName);
167
+ else this.modifyControls.moveFront.push(childName);
168
+ return this.modify.controls;
169
+ },
170
+ moveBefore: (childName) => {
171
+ if (Array.isArray(childName)) this.modifyControls.moveBefore.push(...childName);
172
+ else this.modifyControls.moveBefore.push(childName);
173
+ return this.modify.controls;
174
+ },
175
+ replace: (childName, ui, properties, elementName) => {
176
+ this.modifyControls.replace.push([
177
+ childName,
178
+ {
179
+ ["".concat(elementName || import_Random.Random.getName(), "@").concat(typeof ui === "string" ? ui : ui.getPath())]: (0, import_ReadProperties.ReadProperties)(properties || {})
180
+ }
181
+ ]);
182
+ return this.modify.controls;
183
+ },
184
+ insertAfter: (childName, ui, properties, elementName) => {
185
+ this.modifyControls.insertAfter.push([
186
+ childName,
187
+ {
188
+ ["".concat(elementName || import_Random.Random.getName(), "@").concat(typeof ui === "string" ? ui : ui.getPath())]: (0, import_ReadProperties.ReadProperties)(properties || {})
189
+ }
190
+ ]);
191
+ return this.modify.controls;
192
+ },
193
+ insertBefore: (childName, ui, properties, elementName) => {
194
+ this.modifyControls.insertBefore.push([
195
+ childName,
196
+ {
197
+ ["".concat(elementName || import_Random.Random.getName(), "@").concat(typeof ui === "string" ? ui : ui.getPath())]: (0, import_ReadProperties.ReadProperties)(properties || {})
198
+ }
199
+ ]);
200
+ return this.modify.controls;
201
+ },
202
+ insertBack: (ui, properties, elementName) => {
203
+ this.modifyControls.insertBack.push({
204
+ ["".concat(elementName || import_Random.Random.getName(), "@").concat(typeof ui === "string" ? ui : ui.getPath())]: (0, import_ReadProperties.ReadProperties)(properties || {})
205
+ });
206
+ return this.modify.controls;
207
+ },
208
+ insertFront: (ui, properties, elementName) => {
209
+ this.modifyControls.insertFront.push({
210
+ ["".concat(elementName || import_Random.Random.getName(), "@").concat(typeof ui === "string" ? ui : ui.getPath())]: (0, import_ReadProperties.ReadProperties)(properties || {})
211
+ });
212
+ return this.modify.controls;
213
+ }
214
+ }
215
+ });
216
+ if (properties) this.override.setProperties(properties);
217
+ if (identifier && ((_b = (_a = identifier.name) == null ? void 0 : _a.match(/\w+/g)) == null ? void 0 : _b.length) === 1 && identifier.namespace)
218
+ this.isValidPath = true;
219
+ else this.isValidPath = false;
220
+ this.name = (identifier == null ? void 0 : identifier.name) || "";
221
+ this.namespace = (identifier == null ? void 0 : identifier.namespace) || "";
222
+ }
223
+ getPath() {
224
+ if (this.isValidPath) return "".concat(this.namespace, ".").concat(this.name);
225
+ else {
226
+ import_Log.Log.error("".concat((0, import_CurrentLine.CurrentLine)(), " Cannot use this element for extend or addChild!"));
227
+ return "";
228
+ }
229
+ }
230
+ getElement() {
231
+ return "@".concat(this.getPath());
232
+ }
233
+ extend(identifier, properties) {
234
+ return import_UI.UI.extend(this, properties, identifier);
235
+ }
236
+ getUI() {
237
+ const code = (0, import_ReadProperties.ReadProperties)(this.properties);
238
+ const modifications = [];
239
+ for (const key of ["type", "controls", "bindings", "button_mappings"])
240
+ if (this[key]) code[key] = this[key];
241
+ if (this.variables)
242
+ import_Object.Obj.forEach(this.variables, (k, v) => {
243
+ (code.variables || (code.variables = [])).push({
244
+ requires: k,
245
+ ...v
246
+ });
247
+ });
248
+ if (this.variables && Object.keys(this.variables).length === 0) code.variables || (code.variables = []);
249
+ {
250
+ if (this.modifyBindings) {
251
+ modifications.push({
252
+ array_name: "bindings",
253
+ operation: "insert_front",
254
+ value: this.modifyBindings
255
+ });
256
+ }
257
+ if (this.removeModifyBindings) {
258
+ modifications.push(
259
+ ...this.removeModifyBindings.map((v) => ({
260
+ array_name: "bindings",
261
+ operation: "remove",
262
+ where: v
263
+ }))
264
+ );
265
+ }
266
+ }
267
+ {
268
+ modifications.push(
269
+ ...this.modifyControls.remove.map((controlName) => ({
270
+ array_name: "controls",
271
+ operation: "remove",
272
+ control_name: controlName
273
+ }))
274
+ );
275
+ modifications.push(
276
+ ...this.modifyControls.moveAfter.map((controlName) => ({
277
+ array_name: "controls",
278
+ operation: "move_after",
279
+ control_name: controlName
280
+ }))
281
+ );
282
+ modifications.push(
283
+ ...this.modifyControls.moveBack.map((controlName) => ({
284
+ array_name: "controls",
285
+ operation: "move_back",
286
+ control_name: controlName
287
+ }))
288
+ );
289
+ modifications.push(
290
+ ...this.modifyControls.moveBefore.map((controlName) => ({
291
+ array_name: "controls",
292
+ operation: "move_before",
293
+ control_name: controlName
294
+ }))
295
+ );
296
+ modifications.push(
297
+ ...this.modifyControls.moveFront.map((controlName) => ({
298
+ array_name: "controls",
299
+ operation: "move_front",
300
+ control_name: controlName
301
+ }))
302
+ );
303
+ modifications.push(
304
+ ...this.modifyControls.replace.map(([childName, element]) => ({
305
+ array_name: "controls",
306
+ operation: "replace",
307
+ control_name: childName,
308
+ value: element
309
+ }))
310
+ );
311
+ modifications.push(
312
+ ...this.modifyControls.insertAfter.map(([childName, element]) => ({
313
+ array_name: "controls",
314
+ operation: "insert_after",
315
+ control_name: childName,
316
+ value: [element]
317
+ }))
318
+ );
319
+ modifications.push(
320
+ ...this.modifyControls.insertBefore.map(([childName, element]) => ({
321
+ array_name: "controls",
322
+ operation: "insert_before",
323
+ control_name: childName,
324
+ value: [element]
325
+ }))
326
+ );
327
+ if (this.modifyControls.insertBack.length)
328
+ modifications.push({
329
+ array_name: "controls",
330
+ operation: "insert_back",
331
+ value: this.modifyControls.insertBack
332
+ });
333
+ if (this.modifyControls.insertFront.length)
334
+ modifications.push({
335
+ array_name: "controls",
336
+ operation: "insert_front",
337
+ value: this.modifyControls.insertFront
338
+ });
339
+ }
340
+ if (modifications.length > 0) code["modifications"] = modifications;
341
+ for (const bindingKey in this.override.sourceBindings) {
342
+ const targetBinding = this.override.sourceBindings[bindingKey];
343
+ const [sourceBinding, sourceControl] = bindingKey.split(":");
344
+ code.bindings.push({
345
+ binding_type: "view",
346
+ source_control_name: sourceControl,
347
+ source_property_name: sourceBinding,
348
+ target_property_name: targetBinding
349
+ });
350
+ }
351
+ return Object.keys(code).length > 0 ? code : void 0;
352
+ }
353
+ addChild(element, properties, elementName) {
354
+ this.modify.controls.insertFront(element, properties, elementName);
355
+ return this;
356
+ }
357
+ static register(filePath, elementPath, properties) {
358
+ return this.registerWithNamespace(filePath, elementPath, "", properties);
359
+ }
360
+ static registerWithNamespace(filePath, elementPath, namespace, properties) {
361
+ var _a;
362
+ const modify = import_JsonBuilder.JsonBuilder.getModify(filePath, elementPath);
363
+ (_a = modify == null ? void 0 : modify.override) == null ? void 0 : _a.setProperties(properties || {});
364
+ return modify || import_JsonBuilder.JsonBuilder.registerModify(
365
+ filePath,
366
+ elementPath,
367
+ new Modify(properties, {
368
+ name: elementPath,
369
+ namespace
370
+ })
371
+ );
372
+ }
373
+ }
374
+ // Annotate the CommonJS export names for ESM import in node:
375
+ 0 && (module.exports = {
376
+ Modify
377
+ });
@@ -0,0 +1,104 @@
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 __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
21
+ var Random_exports = {};
22
+ __export(Random_exports, {
23
+ Random: () => Random
24
+ });
25
+ module.exports = __toCommonJS(Random_exports);
26
+ var import_Class = require("./Class");
27
+ var import_Config = require("../compilers/Config");
28
+ const HEX = Array.from(
29
+ { length: 256 },
30
+ (_, i) => i.toString(16).toUpperCase().padStart(2, "0")
31
+ );
32
+ const CHARS = "0123456789abcdefghijklmnopqrstuvwxyz";
33
+ const _Random = class _Random extends import_Class.Class {
34
+ static get uiConfig() {
35
+ var _a;
36
+ return (_a = this._uiConfig) != null ? _a : this._uiConfig = import_Config.Configs.getConfig().compiler.UI;
37
+ }
38
+ static get isObfuscate() {
39
+ return import_Config.Configs.getConfig().compiler.UI.obfuscateName;
40
+ }
41
+ static get uniqueKey() {
42
+ var _a;
43
+ return (_a = this._uniqueKey) != null ? _a : this._uniqueKey = _Random.genString(5, 16).toUpperCase();
44
+ }
45
+ static get prefix() {
46
+ return this.uniqueKey;
47
+ }
48
+ static genString(length, base = 32) {
49
+ const chars = CHARS.slice(0, base);
50
+ const out = new Array(length);
51
+ try {
52
+ const buffer = new Uint8Array(length);
53
+ crypto.getRandomValues(buffer);
54
+ for (let i = 0; i < length; i++) {
55
+ out[i] = chars[buffer[i] % base];
56
+ }
57
+ } catch (e) {
58
+ for (let i = 0; i < length; i++) {
59
+ out[i] = chars[Math.floor(Math.random() * base)];
60
+ }
61
+ }
62
+ return out.join("");
63
+ }
64
+ static getName(length = _Random.uiConfig.nameLength) {
65
+ if (_Random.isObfuscate) return _Random.genString(length);
66
+ const counter = ++_Random.counter.element;
67
+ return "".concat(_Random.prefix, "_ELEMENT_").concat(counter.toString(16).toUpperCase());
68
+ }
69
+ static getAnimationName(length = _Random.uiConfig.nameLength) {
70
+ if (_Random.isObfuscate) return _Random.genString(length);
71
+ const counter = ++_Random.counter.animation;
72
+ return "".concat(_Random.prefix, "_ANIMATION_").concat(counter.toString(16).toUpperCase());
73
+ }
74
+ static getNamespace() {
75
+ if (!_Random.namespaces) {
76
+ const { namespaceAmount, namespaceLength } = _Random.uiConfig;
77
+ _Random.namespaces = Array.from(
78
+ { length: namespaceAmount },
79
+ (_, index2) => _Random.isObfuscate ? _Random.genString(namespaceLength) : "".concat(_Random.prefix, "_NAMESPACE_").concat((index2 + 1).toString(16).toUpperCase())
80
+ );
81
+ }
82
+ const index = _Random.namespaceIndex++ % _Random.namespaces.length;
83
+ return _Random.namespaces[index];
84
+ }
85
+ static getUUID() {
86
+ const b = Array.from({ length: 16 }, () => Math.floor(Math.random() * 256));
87
+ return "".concat(HEX[b[0]]).concat(HEX[b[1]]).concat(HEX[b[2]]).concat(HEX[b[3]], "-").concat(HEX[b[4]]).concat(HEX[b[5]], "-").concat(HEX[b[6]]).concat(HEX[b[7]], "-").concat(HEX[b[8]]).concat(HEX[b[9]], "-").concat(HEX[b[10]]).concat(HEX[b[11]]).concat(HEX[b[12]]).concat(HEX[b[13]]).concat(HEX[b[14]]).concat(HEX[b[15]]);
88
+ }
89
+ static bindingName() {
90
+ if (_Random.isObfuscate) return "#".concat(_Random.genString(_Random.uiConfig.nameLength));
91
+ const counter = ++_Random.counter.binding;
92
+ return "#".concat(_Random.prefix, "_BINDING_").concat(counter.toString(16).toUpperCase());
93
+ }
94
+ };
95
+ __publicField(_Random, "namespaces");
96
+ __publicField(_Random, "namespaceIndex", 0);
97
+ __publicField(_Random, "_uiConfig");
98
+ __publicField(_Random, "_uniqueKey");
99
+ __publicField(_Random, "counter", { element: 0, animation: 0, binding: 0 });
100
+ let Random = _Random;
101
+ // Annotate the CommonJS export names for ESM import in node:
102
+ 0 && (module.exports = {
103
+ Random
104
+ });