zois-core 2.2.0 → 3.0.0

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 (158) hide show
  1. package/dist/assets/icons/toast-themes/abdl/bottle.svg +10 -0
  2. package/dist/assets/icons/toast-themes/abdl/diaper.svg +11 -0
  3. package/dist/assets/icons/toast-themes/abdl/heart.svg +7 -0
  4. package/dist/assets/icons/toast-themes/abdl/sparkle.svg +5 -0
  5. package/dist/assets/icons/toast-themes/abdl/star.svg +5 -0
  6. package/dist/assets/icons/toast-themes/abdl/teddy.svg +18 -0
  7. package/dist/assets/icons/toast-themes/anime/error.svg +20 -0
  8. package/dist/assets/icons/toast-themes/anime/info.svg +20 -0
  9. package/dist/assets/icons/toast-themes/anime/success.svg +16 -0
  10. package/dist/assets/icons/toast-themes/anime/warning.svg +19 -0
  11. package/dist/changelogs.js +628 -295
  12. package/dist/cssVars.js +46 -0
  13. package/dist/dialogs.js +523 -83
  14. package/dist/events.js +28 -6
  15. package/dist/index.js +27 -70
  16. package/dist/localization.js +250 -40
  17. package/dist/messaging.js +1 -1
  18. package/dist/migration.js +37 -0
  19. package/dist/modules/baseModule.js +110 -0
  20. package/dist/modules/index.js +4 -0
  21. package/dist/modules/loadingStrategy.js +20 -0
  22. package/dist/modules/moduleContext.js +56 -0
  23. package/dist/modules/modulesManager.js +175 -0
  24. package/dist/{modSdk.js → patching.js} +33 -9
  25. package/dist/rpc.js +139 -0
  26. package/dist/scripts/zois-core.js +18 -0
  27. package/dist/settings.js +90 -0
  28. package/dist/settingsDialog.js +1361 -0
  29. package/dist/shard-modules/{attributesModule.js → attributes.js} +2 -2
  30. package/dist/shard-modules/{shardModule.js → base.js} +2 -2
  31. package/dist/shard-modules/{centerModule.js → center.js} +4 -2
  32. package/dist/shard-modules/{clickModule.js → click.js} +2 -2
  33. package/dist/shard-modules/{counterUpModule.js → counterUp.js} +2 -2
  34. package/dist/shard-modules/{dynamicClassModule.js → dynamicClass.js} +2 -2
  35. package/dist/shard-modules/index.js +9 -9
  36. package/dist/shard-modules/{multiClickModule.js → multiClick.js} +2 -2
  37. package/dist/shard-modules/{styleModule.js → style.js} +2 -2
  38. package/dist/shard-modules/{typeModule.js → type.js} +2 -2
  39. package/dist/shards/backNextButton.js +173 -0
  40. package/dist/shards/{shard.js → base.js} +15 -15
  41. package/dist/shards/{buttonShard.js → button.js} +30 -52
  42. package/dist/shards/{cardShard.js → card.js} +4 -4
  43. package/dist/shards/{checkboxShard.js → checkbox.js} +6 -13
  44. package/dist/shards/{containerShard.js → container.js} +2 -2
  45. package/dist/shards/extensionsStorageBar.js +377 -0
  46. package/dist/shards/fileInput.js +180 -0
  47. package/dist/shards/flexContainer.js +30 -0
  48. package/dist/shards/gridContainer.js +34 -0
  49. package/dist/shards/{imageShard.js → image.js} +8 -6
  50. package/dist/shards/index.js +17 -13
  51. package/dist/shards/{inputShard.js → input.js} +4 -4
  52. package/dist/shards/{inputListShard.js → inputList.js} +22 -4
  53. package/dist/shards/select.js +201 -0
  54. package/dist/shards/svg.js +28 -0
  55. package/dist/shards/{tabsShard.js → tabs.js} +18 -19
  56. package/dist/shards/{textShard.js → text.js} +4 -4
  57. package/dist/shared.js +215 -0
  58. package/dist/styles.css +0 -51
  59. package/dist/subscreens/customTranslations.js +239 -0
  60. package/dist/subscreens/languageDetails.js +194 -0
  61. package/dist/subscreens/localization.js +115 -0
  62. package/dist/toast-themes/abdl.js +419 -0
  63. package/dist/toast-themes/anime.js +483 -0
  64. package/dist/toast-themes/base.js +40 -0
  65. package/dist/toast-themes/cyber.js +538 -0
  66. package/dist/toast-themes/default.js +282 -0
  67. package/dist/toastThemesDialog.js +274 -0
  68. package/dist/toasts.js +195 -174
  69. package/dist/types/cssVars.d.ts +1 -0
  70. package/dist/types/dialogs.d.ts +46 -18
  71. package/dist/types/events.d.ts +11 -2
  72. package/dist/types/global.d.ts +4 -3
  73. package/dist/types/index.d.ts +12 -19
  74. package/dist/types/localization.d.ts +25 -3
  75. package/dist/types/migration.d.ts +6 -0
  76. package/dist/types/modules/baseModule.d.ts +108 -0
  77. package/dist/types/modules/index.d.ts +4 -0
  78. package/dist/types/modules/loadingStrategy.d.ts +7 -0
  79. package/dist/types/modules/moduleContext.d.ts +9 -0
  80. package/dist/types/modules/modulesManager.d.ts +23 -0
  81. package/dist/types/{modSdk.d.ts → patching.d.ts} +2 -3
  82. package/dist/types/rpc.d.ts +72 -0
  83. package/dist/types/settings.d.ts +19 -0
  84. package/dist/types/settingsDialog.d.ts +4 -0
  85. package/dist/types/shard-modules/{attributesModule.d.ts → attributes.d.ts} +2 -2
  86. package/dist/types/shard-modules/{shardModule.d.ts → base.d.ts} +2 -2
  87. package/dist/types/shard-modules/{centerModule.d.ts → center.d.ts} +2 -1
  88. package/dist/types/shard-modules/{clickModule.d.ts → click.d.ts} +2 -2
  89. package/dist/types/shard-modules/{counterUpModule.d.ts → counterUp.d.ts} +2 -2
  90. package/dist/types/shard-modules/{dynamicClassModule.d.ts → dynamicClass.d.ts} +2 -2
  91. package/dist/types/shard-modules/index.d.ts +9 -9
  92. package/dist/types/shard-modules/{multiClickModule.d.ts → multiClick.d.ts} +2 -2
  93. package/dist/types/shard-modules/{styleModule.d.ts → style.d.ts} +2 -2
  94. package/dist/types/shard-modules/{typeModule.d.ts → type.d.ts} +2 -2
  95. package/dist/types/shards/{backNextButtonShard.d.ts → backNextButton.d.ts} +4 -3
  96. package/dist/types/shards/{shard.d.ts → base.d.ts} +3 -2
  97. package/dist/types/shards/{buttonShard.d.ts → button.d.ts} +6 -6
  98. package/dist/types/shards/{cardShard.d.ts → card.d.ts} +3 -3
  99. package/dist/types/shards/{checkboxShard.d.ts → checkbox.d.ts} +5 -5
  100. package/dist/types/shards/{containerShard.d.ts → container.d.ts} +2 -2
  101. package/dist/types/shards/extensionsStorageBar.d.ts +28 -0
  102. package/dist/types/shards/fileInput.d.ts +10 -0
  103. package/dist/types/shards/flexContainer.d.ts +14 -0
  104. package/dist/types/shards/gridContainer.d.ts +18 -0
  105. package/dist/types/shards/{imageShard.d.ts → image.d.ts} +2 -2
  106. package/dist/types/shards/index.d.ts +17 -13
  107. package/dist/types/shards/{inputShard.d.ts → input.d.ts} +3 -3
  108. package/dist/types/shards/{inputListShard.d.ts → inputList.d.ts} +3 -2
  109. package/dist/types/shards/{selectShard.d.ts → select.d.ts} +6 -4
  110. package/dist/types/shards/svg.d.ts +11 -0
  111. package/dist/types/shards/{tabsShard.d.ts → tabs.d.ts} +3 -6
  112. package/dist/types/shards/{textShard.d.ts → text.d.ts} +3 -3
  113. package/dist/types/shared.d.ts +7 -0
  114. package/dist/types/subscreens/customTranslations.d.ts +10 -0
  115. package/dist/types/subscreens/languageDetails.d.ts +14 -0
  116. package/dist/types/subscreens/localization.d.ts +5 -0
  117. package/dist/types/toast-themes/abdl.d.ts +9 -0
  118. package/dist/types/toast-themes/anime.d.ts +9 -0
  119. package/dist/types/toast-themes/base.d.ts +39 -0
  120. package/dist/types/toast-themes/cyber.d.ts +10 -0
  121. package/dist/types/toast-themes/default.d.ts +9 -0
  122. package/dist/types/toastThemesDialog.d.ts +1 -0
  123. package/dist/types/toasts.d.ts +48 -36
  124. package/dist/types/ui.d.ts +128 -49
  125. package/dist/types/validation.d.ts +5 -0
  126. package/dist/ui.js +414 -79
  127. package/dist/validation.js +79 -1
  128. package/dist/wardrobe.js +2 -2
  129. package/package.json +37 -15
  130. package/dist/core-subscreen/coreSubscreen.js +0 -81
  131. package/dist/core-subscreen/developmentSubscreen.js +0 -22
  132. package/dist/core-subscreen/generalSubscreen.js +0 -23
  133. package/dist/core-subscreen/mainSubscreen.js +0 -58
  134. package/dist/core-subscreen/shards/coreButtonShard.js +0 -30
  135. package/dist/core-subscreen/shards/coreCheckboxShard.js +0 -33
  136. package/dist/core-subscreen/shards/coreInputListShard.js +0 -38
  137. package/dist/core-subscreen/shards/coreSelectShard.js +0 -17
  138. package/dist/core-subscreen/shards/coreTextShard.js +0 -9
  139. package/dist/core-subscreen/shards/index.js +0 -5
  140. package/dist/core-subscreen/toastsSubscreen.js +0 -111
  141. package/dist/core.js +0 -192
  142. package/dist/shards/backNextButtonShard.js +0 -99
  143. package/dist/shards/selectShard.js +0 -131
  144. package/dist/shards/svgShard.js +0 -29
  145. package/dist/types/core-subscreen/coreSubscreen.d.ts +0 -15
  146. package/dist/types/core-subscreen/developmentSubscreen.d.ts +0 -5
  147. package/dist/types/core-subscreen/generalSubscreen.d.ts +0 -5
  148. package/dist/types/core-subscreen/mainSubscreen.d.ts +0 -6
  149. package/dist/types/core-subscreen/shards/coreButtonShard.d.ts +0 -5
  150. package/dist/types/core-subscreen/shards/coreCheckboxShard.d.ts +0 -6
  151. package/dist/types/core-subscreen/shards/coreInputListShard.d.ts +0 -6
  152. package/dist/types/core-subscreen/shards/coreSelectShard.d.ts +0 -5
  153. package/dist/types/core-subscreen/shards/coreTextShard.d.ts +0 -4
  154. package/dist/types/core-subscreen/shards/index.d.ts +0 -5
  155. package/dist/types/core-subscreen/toastsSubscreen.d.ts +0 -5
  156. package/dist/types/core.d.ts +0 -18
  157. package/dist/types/shards/svgShard.d.ts +0 -12
  158. package/scripts/zois-core.mjs +0 -184
@@ -1,5 +1,5 @@
1
1
  import { plainToInstance } from "class-transformer";
2
- import { validate } from "class-validator";
2
+ import { registerDecorator, validate } from "class-validator";
3
3
  export * from "class-validator";
4
4
  export * from "class-transformer";
5
5
  async function validateData(data, dtoClass) {
@@ -26,6 +26,84 @@ async function validateData(data, dtoClass) {
26
26
  };
27
27
  }
28
28
  }
29
+ function ValidateWith(validator, validationOptions) {
30
+ return (object, propertyName) => {
31
+ registerDecorator({
32
+ name: "validateCustom",
33
+ target: object.constructor,
34
+ propertyName,
35
+ options: validationOptions,
36
+ validator: {
37
+ validate(value, args) {
38
+ return validator(args.object);
39
+ },
40
+ defaultMessage(args) {
41
+ return "Params error";
42
+ }
43
+ }
44
+ });
45
+ };
46
+ }
47
+ function IsMemberNumber(validationOptions) {
48
+ return function(object, propertyName) {
49
+ registerDecorator({
50
+ name: "isMemberNumber",
51
+ target: object.constructor,
52
+ propertyName,
53
+ options: validationOptions,
54
+ validator: {
55
+ validate(value) {
56
+ return typeof value === "number" && Number.isInteger(value) && value > 0 && Number.isFinite(value);
57
+ },
58
+ defaultMessage(args) {
59
+ return `Property "${args.property}" with value "${args.value}" is not valid member number`;
60
+ }
61
+ }
62
+ });
63
+ };
64
+ }
65
+ function IsAssetGroupName(validationOptions) {
66
+ return function(object, propertyName) {
67
+ registerDecorator({
68
+ name: "isAssetGroupName",
69
+ target: object.constructor,
70
+ propertyName,
71
+ options: validationOptions,
72
+ validator: {
73
+ validate(value) {
74
+ const g = AssetGroupGet("Female3DCG", value);
75
+ return !!g;
76
+ },
77
+ defaultMessage(args) {
78
+ return `Property "${args.property}" with value "${args.value}" is not valid asset group name`;
79
+ }
80
+ }
81
+ });
82
+ };
83
+ }
84
+ function IsAssetGroupItemName(validationOptions) {
85
+ return function(object, propertyName) {
86
+ registerDecorator({
87
+ name: "isAssetGroupItemName",
88
+ target: object.constructor,
89
+ propertyName,
90
+ options: validationOptions,
91
+ validator: {
92
+ validate(value) {
93
+ const g = AssetGroupGet("Female3DCG", value);
94
+ return !!g && g.IsItem();
95
+ },
96
+ defaultMessage(args) {
97
+ return `Property "${args.property}" with value "${args.value}" is not valid asset group item name`;
98
+ }
99
+ }
100
+ });
101
+ };
102
+ }
29
103
  export {
104
+ IsAssetGroupItemName,
105
+ IsAssetGroupName,
106
+ IsMemberNumber,
107
+ ValidateWith,
30
108
  validateData
31
109
  };
package/dist/wardrobe.js CHANGED
@@ -124,7 +124,7 @@ function importAppearance(C, bundleToAttach, include = ["Cosplay", "Binds", "Col
124
124
  }
125
125
  const _item = CharacterAppearanceSetItem(C, item.Asset.Group.Name, item.Asset, item.Color);
126
126
  if (!_item) continue;
127
- if (item.Craft && CraftingValidate(item.Craft, item.Asset) !== CraftingStatusType.CRITICAL_ERROR) _item.Craft = item.Craft;
127
+ if (item.Craft && CraftingValidate(item.Craft, item.Asset, true, true, true) !== CraftingStatusType.CRITICAL_ERROR) _item.Craft = item.Craft;
128
128
  if (item.Property) {
129
129
  ValidationSanitizeProperties(C, item);
130
130
  _item.Property = item.Property;
@@ -147,7 +147,7 @@ function addRequiredAppearanceItems(appearanceBundle) {
147
147
  if (appearanceBundle.find((i) => i.Asset.Group.Name === group.Name)) return;
148
148
  const asset = AssetGet("Female3DCG", group.Name, group.Asset[0]?.Name);
149
149
  if (!asset) return;
150
- appearanceBundle.push({ Asset: asset, Color: group.DefaultColor });
150
+ appearanceBundle.push({ Asset: asset, Color: [group.DefaultColor], Difficulty: asset.Difficulty, Property: {} });
151
151
  });
152
152
  }
153
153
  export {
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "zois-core",
3
- "version": "2.2.0",
4
- "description": "The core for the my mods, which contains a shared code reused in all my mods",
3
+ "version": "3.0.0",
4
+ "description": "Library for developing mods for BC. It includes the tools that I consider necessary. The library is being developed mostly for personal use in my mods.",
5
5
  "bin": {
6
- "zois-core": "scripts/zois-core.mjs"
6
+ "zois-core": "dist/scripts/zois-core.js"
7
7
  },
8
8
  "author": "Zoi",
9
9
  "license": "MIT",
@@ -15,17 +15,13 @@
15
15
  "import": "./dist/index.js",
16
16
  "types": "./dist/types/index.d.ts"
17
17
  },
18
- "./core": {
19
- "import": "./dist/core.js",
20
- "types": "./dist/types/core.d.ts"
21
- },
22
18
  "./messaging": {
23
19
  "import": "./dist/messaging.js",
24
20
  "types": "./dist/types/messaging.d.ts"
25
21
  },
26
- "./mod-sdk": {
27
- "import": "./dist/modSdk.js",
28
- "types": "./dist/types/modSdk.d.ts"
22
+ "./patching": {
23
+ "import": "./dist/patching.js",
24
+ "types": "./dist/types/patching.d.ts"
29
25
  },
30
26
  "./ui": {
31
27
  "import": "./dist/ui.js",
@@ -70,27 +66,53 @@
70
66
  "./events": {
71
67
  "import": "./dist/events.js",
72
68
  "types": "./dist/types/events.d.ts"
69
+ },
70
+ "./rpc": {
71
+ "import": "./dist/rpc.js",
72
+ "types": "./dist/types/rpc.d.ts"
73
+ },
74
+ "./settings": {
75
+ "import": "./dist/settings.js",
76
+ "types": "./dist/types/settings.d.ts"
77
+ },
78
+ "./modules": {
79
+ "import": "./dist/modules/index.js",
80
+ "types": "./dist/types/modules/index.d.ts"
81
+ },
82
+ "./migration": {
83
+ "import": "./dist/migration.js",
84
+ "types": "./dist/types/migration.d.ts"
85
+ },
86
+ "./subscreens/localization": {
87
+ "import": "./dist/subscreens/localization.js",
88
+ "types": "./dist/types/subscreens/localization.d.ts"
73
89
  }
74
90
  },
75
91
  "dependencies": {
76
92
  "@octokit/rest": "^22.0.1",
77
- "bondage-club-mod-sdk": "^1.2.0",
78
93
  "chalk": "^5.6.2",
79
94
  "class-transformer": "^0.5.1",
80
95
  "class-validator": "^0.14.4",
96
+ "clsx": "^2.1.1",
97
+ "country-flag-icons": "^1.6.20",
81
98
  "lucide": "^1.24.0",
82
- "reflect-metadata": "^0.2.2"
99
+ "reflect-metadata": "^0.2.2",
100
+ "tsx-dom": "^3.1.0"
83
101
  },
84
102
  "devDependencies": {
85
- "bc-stubs": "130.0.0-Beta.1",
103
+ "@vitest/coverage-v8": "^5.0.3",
104
+ "bc-stubs": "133.0.0",
86
105
  "esbuild": "^0.28.1",
87
106
  "esbuild-plugin-copy": "^2.1.1",
88
107
  "glob": "^13.0.6",
108
+ "happy-dom": "^20.14.5",
89
109
  "nodemon": "^3.1.14",
90
110
  "simple-git": "^3.36.0",
91
- "typescript": "^5.9.3"
111
+ "typescript": "^5.9.3",
112
+ "vitest": "^5.0.3"
92
113
  },
93
114
  "scripts": {
94
- "build": "node scripts/build.mjs"
115
+ "build": "node scripts/build.mjs",
116
+ "test": "vitest run"
95
117
  }
96
118
  }
@@ -1,81 +0,0 @@
1
- import { BaseSubscreen } from "../ui";
2
- import { CoreButtonShard } from "./shards/coreButtonShard";
3
- import { StyleModule } from "../shard-modules";
4
- import { CoreCheckboxShard, CoreInputListShard, CoreSelectShard, CoreTextShard } from "./shards";
5
- class CoreSubscreen extends BaseSubscreen {
6
- g = 40;
7
- h = 0.05;
8
- interval = null;
9
- run() {
10
- DrawRect(0, 0, 2e3, 1e3, "#008600ff");
11
- for (let x = 0; x <= 2e3; x += this.g) {
12
- DrawRect(x, 0, 5, 1e3, "#17a117ff");
13
- }
14
- for (let y = 0; y <= 1e3; y += this.g) {
15
- DrawRect(0, y, 2e3, 5, "#17a117ff");
16
- }
17
- }
18
- load() {
19
- this.createText({
20
- x: 60,
21
- y: 40,
22
- text: this.name,
23
- fontSize: 6,
24
- modules: {
25
- base: [
26
- new StyleModule({
27
- fontWeight: "bold"
28
- })
29
- ]
30
- }
31
- });
32
- this.createButton({
33
- anchor: "top-right",
34
- x: 40,
35
- y: 40,
36
- width: 90,
37
- height: 90,
38
- icon: "Icons/Exit.png",
39
- onClick: () => this.exit()
40
- });
41
- this.g = 40;
42
- this.h = 0.05;
43
- this.interval = setInterval(() => {
44
- this.g += this.h;
45
- if (this.g >= 60) this.h = -0.05;
46
- if (this.g <= 40) this.h = 0.05;
47
- }, 50);
48
- }
49
- createText(ctx) {
50
- const shard = new CoreTextShard(ctx);
51
- const htmlElement = shard.mount();
52
- return htmlElement;
53
- }
54
- createButton(ctx) {
55
- const shard = new CoreButtonShard(ctx);
56
- const htmlElement = shard.mount();
57
- return htmlElement;
58
- }
59
- createCheckbox(ctx) {
60
- const shard = new CoreCheckboxShard(ctx);
61
- const htmlElement = shard.mount();
62
- return htmlElement;
63
- }
64
- createInputList(ctx) {
65
- const shard = new CoreInputListShard(ctx);
66
- const htmlElement = shard.mount();
67
- return htmlElement;
68
- }
69
- createSelect(ctx) {
70
- const shard = new CoreSelectShard(ctx);
71
- const htmlElement = shard.mount();
72
- return htmlElement;
73
- }
74
- unload() {
75
- super.unload();
76
- if (this.interval) clearInterval(this.interval);
77
- }
78
- }
79
- export {
80
- CoreSubscreen
81
- };
@@ -1,22 +0,0 @@
1
- import { CoreSubscreen } from "./coreSubscreen";
2
- class DevelopmentSubscreen extends CoreSubscreen {
3
- get name() {
4
- return "Development";
5
- }
6
- load() {
7
- super.load();
8
- this.createCheckbox({
9
- x: 60,
10
- y: 200,
11
- text: "Auto Connect To Dev Server",
12
- isChecked: localStorage.getItem("autoConnectToDevServer") === "true",
13
- onChange: () => {
14
- const prev = localStorage.getItem("autoConnectToDevServer");
15
- localStorage.setItem("autoConnectToDevServer", prev === "true" ? "false" : "true");
16
- }
17
- });
18
- }
19
- }
20
- export {
21
- DevelopmentSubscreen
22
- };
@@ -1,23 +0,0 @@
1
- import { coreSettings } from "../core";
2
- import { CoreSubscreen } from "./coreSubscreen";
3
- class GeneralSubscreen extends CoreSubscreen {
4
- get name() {
5
- return "General";
6
- }
7
- load() {
8
- super.load();
9
- this.createCheckbox({
10
- x: 60,
11
- y: 200,
12
- text: "Dev Mode",
13
- isChecked: !!coreSettings.devMode,
14
- onChange: () => {
15
- coreSettings.devMode = false;
16
- delete PreferenceExtensionsSettings.ZOIS_CORE;
17
- }
18
- });
19
- }
20
- }
21
- export {
22
- GeneralSubscreen
23
- };
@@ -1,58 +0,0 @@
1
- import { BookText, createElement } from "lucide";
2
- import { GeneralSubscreen } from "./generalSubscreen";
3
- import { CoreSubscreen } from "./coreSubscreen";
4
- import { syncSettings } from "../core";
5
- import { ToastsSubscreen } from "./toastsSubscreen";
6
- import { DevelopmentSubscreen } from "./developmentSubscreen";
7
- class MainSubscreen extends CoreSubscreen {
8
- get name() {
9
- return "Zoi's Modding Core";
10
- }
11
- load() {
12
- super.load();
13
- this.createText({
14
- x: 60,
15
- y: 120,
16
- text: "Here are all the experimental settings and settings for developing and debugging my mods."
17
- });
18
- [new GeneralSubscreen(), new ToastsSubscreen(), new DevelopmentSubscreen()].forEach((s, i) => {
19
- this.createButton({
20
- x: 100,
21
- y: 240 + 115 * i,
22
- padding: 2,
23
- text: s.name,
24
- width: 600,
25
- fontSize: 5,
26
- onClick: () => {
27
- this.setSubscreen(s);
28
- }
29
- });
30
- });
31
- this.createButton({
32
- anchor: "bottom-right",
33
- x: 40,
34
- y: 40,
35
- width: 90,
36
- height: 90,
37
- icon: createElement(BookText),
38
- onClick: () => {
39
- window.open(`https://github.com/FurryZoi/zois-core`, "_blank");
40
- }
41
- });
42
- this.createText({
43
- text: "This place is in WIP stage",
44
- x: 1e3,
45
- y: 500,
46
- fontSize: 6
47
- });
48
- }
49
- exit() {
50
- super.exit();
51
- this.setSubscreen(null);
52
- PreferenceSubscreenExtensionsClear();
53
- syncSettings();
54
- }
55
- }
56
- export {
57
- MainSubscreen
58
- };
@@ -1,30 +0,0 @@
1
- import { ButtonShard } from "../../shards";
2
- class CoreButtonShard extends ButtonShard {
3
- get dynamicClassButton() {
4
- return {
5
- ...super.dynamicClassButton,
6
- base: {
7
- ...super.dynamicClassButton.base,
8
- display: "flex",
9
- alignItems: "center",
10
- justifyContent: "center",
11
- columnGap: "1.25vw",
12
- border: "2px solid #33c633",
13
- outline: "none",
14
- cursor: "pointer",
15
- background: "#20a214",
16
- color: "#004800",
17
- borderRadius: "0.1em"
18
- },
19
- hover: {
20
- ...super.dynamicClassButton.hover,
21
- background: "#39bd2dff",
22
- color: "#76ff76ff",
23
- borderColor: "#76ff76ff"
24
- }
25
- };
26
- }
27
- }
28
- export {
29
- CoreButtonShard
30
- };
@@ -1,33 +0,0 @@
1
- import { CheckboxShard } from "../../shards";
2
- class CoreCheckboxShard extends CheckboxShard {
3
- get dynamicClassInput() {
4
- return {
5
- ...super.dynamicClassInput,
6
- base: {
7
- ...super.dynamicClassInput.base,
8
- border: "var(--border-width) solid #33c633 !important",
9
- backgroundColor: "#20a214 !important",
10
- color: "rgb(162, 255, 19) !important"
11
- },
12
- hover: {
13
- ...super.dynamicClassInput.hover,
14
- backgroundColor: "#39bd2dff !important",
15
- color: "#76ff76ff !important"
16
- },
17
- before: {
18
- ...super.dynamicClassInput.before,
19
- backgroundColor: "rgb(162, 255, 19) !important"
20
- },
21
- ".zcDisabled": {
22
- ...super.dynamicClassInput[".zcDisabled"],
23
- backgroundColor: "var(--disabled-color)"
24
- }
25
- };
26
- }
27
- get textColor() {
28
- return "rgb(162, 255, 19)";
29
- }
30
- }
31
- export {
32
- CoreCheckboxShard
33
- };
@@ -1,38 +0,0 @@
1
- import { InputListShard } from "../../shards";
2
- class CoreInputListShard extends InputListShard {
3
- get dynamicClassContainer() {
4
- return {
5
- ...super.dynamicClassContainer,
6
- base: {
7
- ...super.dynamicClassContainer.base,
8
- background: "#20a214 !important",
9
- border: "2px solid #33c633"
10
- },
11
- "> div:first-child > b": {
12
- ...super.dynamicClassContainer["> div:first-child > b"],
13
- color: "rgb(155, 255, 0)"
14
- },
15
- "> div:last-child > div": {
16
- ...super.dynamicClassContainer["> div:last-child > div"],
17
- background: "rgb(112, 234, 68)",
18
- color: "black"
19
- }
20
- };
21
- }
22
- get dynamicClassToolsButton() {
23
- return {
24
- ...super.dynamicClassToolsButton,
25
- base: {
26
- ...super.dynamicClassToolsButton.base,
27
- background: "rgb(112, 234, 68)",
28
- color: "black"
29
- },
30
- hover: {
31
- background: "rgb(77, 221, 65)"
32
- }
33
- };
34
- }
35
- }
36
- export {
37
- CoreInputListShard
38
- };
@@ -1,17 +0,0 @@
1
- import { SelectShard } from "../../shards";
2
- class CoreSelectShard extends SelectShard {
3
- get dynamicClassContainer() {
4
- return {
5
- ...super.dynamicClassContainer,
6
- base: {
7
- ...super.dynamicClassContainer.base,
8
- background: "#20a214",
9
- color: "rgb(162, 255, 19)",
10
- border: "2px solid #33c633"
11
- }
12
- };
13
- }
14
- }
15
- export {
16
- CoreSelectShard
17
- };
@@ -1,9 +0,0 @@
1
- import { TextShard } from "../../shards";
2
- class CoreTextShard extends TextShard {
3
- get defaultColor() {
4
- return "rgb(162, 255, 19)";
5
- }
6
- }
7
- export {
8
- CoreTextShard
9
- };
@@ -1,5 +0,0 @@
1
- export * from "./coreButtonShard";
2
- export * from "./coreTextShard";
3
- export * from "./coreSelectShard";
4
- export * from "./coreCheckboxShard";
5
- export * from "./coreInputListShard";
@@ -1,111 +0,0 @@
1
- import { coreSettings, syncSettings } from "../core";
2
- import { CoreSubscreen } from "./coreSubscreen";
3
- import { toastsManager } from "../toasts";
4
- class ToastsSubscreen extends CoreSubscreen {
5
- get name() {
6
- return "Toasts";
7
- }
8
- load() {
9
- super.load();
10
- this.createCheckbox({
11
- x: 60,
12
- y: 200,
13
- text: "Blacklist Enabled",
14
- isChecked: !!coreSettings.toasts?.blacklist?.enabled,
15
- onChange: () => {
16
- coreSettings.toasts ??= {};
17
- coreSettings.toasts.blacklist ??= {};
18
- coreSettings.toasts.blacklist.enabled = !coreSettings.toasts.blacklist.enabled;
19
- }
20
- });
21
- this.createCheckbox({
22
- x: 60,
23
- y: 280,
24
- text: "Prevent Using Single Theme",
25
- isChecked: !!coreSettings.toasts?.preventUsingSingleTheme,
26
- onChange: () => {
27
- coreSettings.toasts ??= {};
28
- coreSettings.toasts.preventUsingSingleTheme = !coreSettings.toasts.preventUsingSingleTheme;
29
- }
30
- });
31
- this.createText({
32
- text: "Toasts Position:",
33
- x: 60,
34
- y: 380
35
- });
36
- this.createSelect({
37
- x: 400,
38
- y: 360,
39
- width: 500,
40
- options: [
41
- {
42
- name: "top-left",
43
- text: "Top Left"
44
- },
45
- {
46
- name: "top-right",
47
- text: "Top Right"
48
- },
49
- {
50
- name: "bottom-left",
51
- text: "Bottom Left"
52
- },
53
- {
54
- name: "bottom-right",
55
- text: "Bottom Right"
56
- }
57
- ],
58
- currentOption: coreSettings.toasts?.position ?? "bottom-left",
59
- onChange: (pos) => {
60
- coreSettings.toasts ??= {};
61
- coreSettings.toasts.position = pos;
62
- }
63
- });
64
- this.createInputList({
65
- title: "Blacklist",
66
- x: 1100,
67
- y: 200,
68
- width: 800,
69
- height: 600,
70
- value: coreSettings.toasts?.blacklist?.content ?? [],
71
- onChange: (value) => {
72
- coreSettings.toasts ??= {};
73
- coreSettings.toasts.blacklist ??= {};
74
- coreSettings.toasts.blacklist.content = value;
75
- }
76
- });
77
- this.createButton({
78
- text: "Test",
79
- x: 60,
80
- y: 850,
81
- padding: 1,
82
- width: 400,
83
- onClick: () => {
84
- syncSettings();
85
- toastsManager.success({
86
- title: "Something was completed successfully",
87
- message: "Message details",
88
- duration: 8e3
89
- });
90
- toastsManager.info({
91
- title: "Very important announcement",
92
- message: "You have been informed that you have been informed",
93
- duration: 8e3
94
- });
95
- toastsManager.warn({
96
- title: "Don't look at me like that",
97
- message: "You were warned",
98
- duration: 8e3
99
- });
100
- toastsManager.error({
101
- title: "Critical bug found",
102
- message: "Catch him!",
103
- duration: 8e3
104
- });
105
- }
106
- });
107
- }
108
- }
109
- export {
110
- ToastsSubscreen
111
- };