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,13 +1,17 @@
1
- export * from "./backNextButtonShard";
2
- export * from "./buttonShard";
3
- export * from "./cardShard";
4
- export * from "./checkboxShard";
5
- export * from "./containerShard";
6
- export * from "./imageShard";
7
- export * from "./inputListShard";
8
- export * from "./inputShard";
9
- export * from "./selectShard";
10
- export * from "./shard";
11
- export * from "./svgShard";
12
- export * from "./tabsShard";
13
- export * from "./textShard";
1
+ export * from "./backNextButton";
2
+ export * from "./button";
3
+ export * from "./card";
4
+ export * from "./checkbox";
5
+ export * from "./container";
6
+ export * from "./image";
7
+ export * from "./inputList";
8
+ export * from "./input";
9
+ export * from "./select";
10
+ export * from "./base";
11
+ export * from "./svg";
12
+ export * from "./tabs";
13
+ export * from "./text";
14
+ export * from "./extensionsStorageBar";
15
+ export * from "./fileInput";
16
+ export * from "./flexContainer";
17
+ export * from "./gridContainer";
@@ -1,4 +1,4 @@
1
- import { Shard, ShardContext } from "./shard";
1
+ import { Shard, ShardContext } from "./base";
2
2
  export interface InputShardContext extends ShardContext {
3
3
  value?: string;
4
4
  placeholder?: string;
@@ -9,6 +9,6 @@ export interface InputShardContext extends ShardContext {
9
9
  isDisabled?: () => boolean;
10
10
  }
11
11
  export declare class InputShard extends Shard<InputShardContext> {
12
- protected generateBody(): Record<keyof NonNullable<InputShardContext["modules"]>, HTMLElement | SVGElement>;
13
- protected update(): void;
12
+ protected render(): Record<keyof NonNullable<InputShardContext["modules"]>, HTMLElement | SVGElement>;
13
+ protected setContextStyles(): void;
14
14
  }
@@ -1,10 +1,11 @@
1
1
  import { DynamicClassStyles } from "../ui";
2
- import { Shard, ShardContext } from "./shard";
2
+ import { Shard, ShardContext } from "./base";
3
3
  export interface InputListShardContext<NumbersOnly extends boolean> extends ShardContext<"input"> {
4
4
  value?: NumbersOnly extends true ? number[] : (string | number)[];
5
5
  title?: string;
6
6
  fontSize?: number | "auto";
7
7
  numbersOnly?: NumbersOnly;
8
+ playerPicker?: NumbersOnly extends true ? boolean : never;
8
9
  onChange?: (value: NumbersOnly extends true ? number[] : (string | number)[]) => void;
9
10
  isDisabled?: () => boolean;
10
11
  }
@@ -12,5 +13,5 @@ export declare class InputListShard<NumbersOnly extends boolean> extends Shard<I
12
13
  protected get dynamicClassContainer(): DynamicClassStyles;
13
14
  protected get dynamicClassInput(): DynamicClassStyles;
14
15
  protected get dynamicClassToolsButton(): DynamicClassStyles;
15
- protected generateBody(): Record<keyof NonNullable<InputListShardContext<NumbersOnly>["modules"]>, HTMLElement | SVGElement>;
16
+ protected render(): Record<keyof NonNullable<InputListShardContext<NumbersOnly>["modules"]>, HTMLElement | SVGElement>;
16
17
  }
@@ -1,5 +1,5 @@
1
1
  import { DynamicClassStyles } from "../ui";
2
- import { Shard, ShardContext } from "./shard";
2
+ import { Shard, ShardContext } from "./base";
3
3
  export interface SelectShardContext extends Omit<ShardContext, "height"> {
4
4
  options: {
5
5
  name: string;
@@ -7,11 +7,13 @@ export interface SelectShardContext extends Omit<ShardContext, "height"> {
7
7
  icon?: SVGElement;
8
8
  }[];
9
9
  currentOption: string;
10
- onChange?: (name: any) => void;
10
+ onChange?: (name: string) => void;
11
11
  isDisabled?: () => boolean;
12
12
  }
13
13
  export declare class SelectShard extends Shard<SelectShardContext> {
14
14
  protected get dynamicClassContainer(): DynamicClassStyles;
15
- protected generateBody(): Record<keyof NonNullable<SelectShardContext["modules"]>, HTMLElement | SVGElement>;
16
- protected update(): void;
15
+ protected get dynamicClassSelect(): DynamicClassStyles;
16
+ protected get dynamicClassOptions(): DynamicClassStyles;
17
+ protected render(): Record<keyof NonNullable<SelectShardContext["modules"]>, HTMLElement | SVGElement>;
18
+ protected setContextStyles(): void;
17
19
  }
@@ -0,0 +1,11 @@
1
+ import { Shard, ShardContext } from "./base";
2
+ export interface SvgShardContext extends ShardContext {
3
+ svg: string | SVGElement;
4
+ fill?: string;
5
+ stroke?: string;
6
+ strokeWidth?: string;
7
+ recolor?: boolean;
8
+ }
9
+ export declare class SvgShard extends Shard<SvgShardContext> {
10
+ protected render(): Record<keyof NonNullable<SvgShardContext["modules"]>, SVGElement>;
11
+ }
@@ -1,18 +1,15 @@
1
- import { Shard, ShardContext } from "./shard";
1
+ import { Shard, ShardContext } from "./base";
2
2
  export interface TabsShardContext extends Omit<ShardContext, "height"> {
3
3
  tabs: {
4
4
  name: string;
5
5
  load?: () => void;
6
6
  unload?: () => void;
7
7
  run?: () => void;
8
- exit?: () => void;
9
8
  }[];
10
9
  currentTabName: string;
11
10
  }
12
11
  export declare class TabsShard extends Shard<TabsShardContext> {
13
- private tabHandlers;
14
- private clearDrawProcessHook;
15
12
  constructor(context: TabsShardContext);
16
- protected generateBody(): Record<keyof NonNullable<TabsShardContext["modules"]>, HTMLElement | SVGElement>;
17
- protected update(): void;
13
+ protected render(): Record<keyof NonNullable<TabsShardContext["modules"]>, HTMLElement | SVGElement>;
14
+ protected setContextStyles(): void;
18
15
  }
@@ -1,4 +1,4 @@
1
- import { Shard, ShardContext } from "./shard";
1
+ import { Shard, ShardContext } from "./base";
2
2
  export interface TextShardContext extends ShardContext {
3
3
  text?: string;
4
4
  fontSize?: number | "auto";
@@ -8,6 +8,6 @@ export interface TextShardContext extends ShardContext {
8
8
  }
9
9
  export declare class TextShard extends Shard<TextShardContext> {
10
10
  protected get defaultColor(): string;
11
- protected generateBody(): Record<keyof NonNullable<TextShardContext["modules"]>, HTMLElement | SVGElement>;
12
- protected update(): void;
11
+ protected render(): Record<keyof NonNullable<TextShardContext["modules"]>, HTMLElement | SVGElement>;
12
+ protected setContextStyles(): void;
13
13
  }
@@ -0,0 +1,7 @@
1
+ export interface DependentInfo {
2
+ coreVersion: string;
3
+ modData: import("./index").ModData;
4
+ }
5
+ export declare function getDependents(): DependentInfo[];
6
+ export declare function addDependent(dependent: DependentInfo): void;
7
+ export declare function initShared(): void;
@@ -0,0 +1,10 @@
1
+ import { BaseSubscreen } from "../ui";
2
+ export declare class CustomTranslationsSubscreen extends BaseSubscreen {
3
+ get name(): string;
4
+ private translationsContainer;
5
+ protected onLoad(): void;
6
+ private renderTranslationList;
7
+ private toggleActive;
8
+ private createCustomTranslation;
9
+ private deleteCustomTranslation;
10
+ }
@@ -0,0 +1,14 @@
1
+ import { type Locale } from "../localization";
2
+ import { BaseSubscreen } from "../ui";
3
+ export declare class LanguageDetailsSubscreen extends BaseSubscreen {
4
+ private readonly locale;
5
+ get name(): string;
6
+ constructor(locale: Locale);
7
+ protected onLoad(): void;
8
+ private renderModSupport;
9
+ private downloadModLanguageFile;
10
+ private getLeafKeys;
11
+ private fetchModTranslation;
12
+ private coveragePercent;
13
+ private getModSupportPercent;
14
+ }
@@ -0,0 +1,5 @@
1
+ import { BaseSubscreen } from "../ui";
2
+ export declare class LocalizationSubscreen extends BaseSubscreen {
3
+ get name(): string;
4
+ protected onLoad(): void;
5
+ }
@@ -0,0 +1,9 @@
1
+ import { ToastRenderData, ToastTheme, ToastThemeTier } from "./base";
2
+ export declare class AbdlToastTheme extends ToastTheme {
3
+ name: string;
4
+ details: string;
5
+ tier: ToastThemeTier;
6
+ init(): void;
7
+ render(renderData: ToastRenderData): HTMLDivElement;
8
+ }
9
+ export declare const abdlToastTheme: AbdlToastTheme;
@@ -0,0 +1,9 @@
1
+ import { ToastRenderData, ToastTheme, ToastThemeTier } from "./base";
2
+ export declare class AnimeToastTheme extends ToastTheme {
3
+ name: string;
4
+ details: string;
5
+ tier: ToastThemeTier;
6
+ init(): void;
7
+ render(renderData: ToastRenderData): HTMLDivElement;
8
+ }
9
+ export declare const animeToastTheme: AnimeToastTheme;
@@ -0,0 +1,39 @@
1
+ export type ToastType = "info" | "warning" | "error" | "success" | "spinner";
2
+ export declare enum ToastThemeTier {
3
+ R = "R",
4
+ SR = "SR",
5
+ SSR = "SSR"
6
+ }
7
+ interface BaseToastRenderData {
8
+ type: ToastType;
9
+ id: string;
10
+ title?: string;
11
+ message: string;
12
+ isInteractable?: boolean;
13
+ size: {
14
+ scaleWithCanvas: boolean;
15
+ scaleFactor: number;
16
+ };
17
+ buttons?: {
18
+ name: string;
19
+ action: () => void;
20
+ }[];
21
+ }
22
+ export interface PermanentToastRenderData extends BaseToastRenderData {
23
+ type: "spinner";
24
+ }
25
+ export interface TimedToastRenderData extends BaseToastRenderData {
26
+ type: "info" | "warning" | "error" | "success";
27
+ duration: number;
28
+ }
29
+ export type ToastRenderData = PermanentToastRenderData | TimedToastRenderData;
30
+ export declare abstract class ToastTheme {
31
+ abstract name: string;
32
+ abstract details: string;
33
+ abstract tier: ToastThemeTier;
34
+ protected get isUnlocked(): boolean;
35
+ protected unlock(): void;
36
+ abstract init(): void;
37
+ abstract render(data: ToastRenderData): HTMLDivElement;
38
+ }
39
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { ToastRenderData } from "./base";
2
+ import { ToastTheme, ToastThemeTier } from "./base";
3
+ export declare class CyberToastTheme extends ToastTheme {
4
+ name: string;
5
+ details: string;
6
+ tier: ToastThemeTier;
7
+ init(): void;
8
+ render(renderData: ToastRenderData): HTMLDivElement;
9
+ }
10
+ export declare const cyberToastTheme: CyberToastTheme;
@@ -0,0 +1,9 @@
1
+ import { ToastRenderData, ToastTheme, ToastThemeTier } from "./base";
2
+ export declare class DefaultToastTheme extends ToastTheme {
3
+ name: string;
4
+ details: string;
5
+ tier: ToastThemeTier;
6
+ init(): void;
7
+ render(renderData: ToastRenderData): HTMLDivElement;
8
+ }
9
+ export declare const defaultToastTheme: DefaultToastTheme;
@@ -0,0 +1 @@
1
+ export declare function createThemesDialog(): void;
@@ -1,50 +1,62 @@
1
- import { ModData } from "./index";
2
- interface Toast {
3
- id: string;
4
- title?: string;
5
- message: string;
6
- type: "info" | "warning" | "error" | "success" | "spinner";
7
- duration: number;
8
- theme?: ModData["singleToastsTheme"];
9
- }
1
+ import { PermanentToastRenderData, TimedToastRenderData, ToastTheme } from "./toast-themes/base";
2
+ export declare const EXTENSIONS_CURRENT_TOAST_THEME_KEY = "ZC_TOAST_THEME";
3
+ export declare const EXTENSIONS_UNLOCKED_TOAST_THEMES_KEY = "ZC_TOAST_THEMES";
4
+ export declare const themes: {
5
+ id: number;
6
+ theme: ToastTheme;
7
+ }[];
8
+ export declare function initToastThemes(): void;
9
+ export declare function getToastThemeById(id: number): ToastTheme | undefined;
10
+ export declare function getToastThemeId(theme: ToastTheme): number | undefined;
11
+ export declare function getUnlockedToastThemeIds(): number[];
12
+ export declare function isToastThemeUnlocked(theme: ToastTheme): boolean;
13
+ export declare function unlockToastTheme(theme: ToastTheme): void;
14
+ export declare function resetToastThemes(): void;
15
+ export declare function getActiveToastThemeId(): number;
16
+ export declare function setActiveToastTheme(theme: ToastTheme): void;
17
+ export declare function resolveActiveToastTheme(): ToastTheme;
18
+ export declare function dismissToast(toastElement: HTMLDivElement): void;
19
+ export declare function getOrCreateToastsContainer(): HTMLElement;
20
+ type PermanentToastProcessData = Omit<PermanentToastRenderData, "size" | "id">;
21
+ type TimedToastProcessData = Omit<TimedToastRenderData, "size" | "id">;
10
22
  export declare class ToastsManager {
11
23
  private generateToastId;
12
24
  private process;
13
25
  /**
14
- * Displays informational toast.
15
- * @param options - Title, message and duration of toast.
16
- */
17
- info({ title, message, duration }: Omit<Toast, "type" | "id" | "theme">): void;
26
+ * Displays informational toast.
27
+ * @param options - Title, message and duration of toast.
28
+ */
29
+ info(toastProperties: Omit<TimedToastProcessData, "type">): void;
18
30
  /**
19
- * Displays success toast.
20
- * @param options - Title, message and duration of toast.
21
- */
22
- success({ title, message, duration }: Omit<Toast, "type" | "id" | "theme">): void;
31
+ * Displays success toast.
32
+ * @param options - Title, message and duration of toast.
33
+ */
34
+ success(toastProperties: Omit<TimedToastProcessData, "type">): void;
23
35
  /**
24
- * Displays warning toast.
25
- * @param options - Title, message and duration of toast.
26
- */
27
- warn({ title, message, duration }: Omit<Toast, "type" | "id" | "theme">): void;
36
+ * Displays warning toast.
37
+ * @param options - Title, message and duration of toast.
38
+ */
39
+ warn(toastProperties: Omit<TimedToastProcessData, "type">): void;
28
40
  /**
29
- * Displays error toast.
30
- * @param options - Title, message and duration of toast.
31
- */
32
- error({ title, message, duration }: Omit<Toast, "type" | "id" | "theme">): void;
41
+ * Displays error toast.
42
+ * @param options - Title, message and duration of toast.
43
+ */
44
+ error(toastProperties: Omit<TimedToastProcessData, "type">): void;
33
45
  /**
34
- * Displays a long-running spinner toast and returns its ID.
35
- * Toast can be deleted manually with `toastsManager.removeSpinner(ID)` or by the user by clicking.
36
- * @param options - Title and message of toast.
37
- * @returns The unique ID of the created spinner toast.
38
- */
39
- spinner({ title, message }: Omit<Toast, "type" | "id" | "duration" | "theme">): string;
46
+ * Displays a long-running spinner toast and returns its ID.
47
+ * Toast can be deleted manually with `toastsManager.removeSpinner(ID)` or by the user by clicking.
48
+ * @param options - Title and message of toast.
49
+ * @returns The unique ID of the created spinner toast.
50
+ */
51
+ spinner(toastProperties: Omit<PermanentToastProcessData, "type">): string;
40
52
  /**
41
- * Removes a spinner toast by its ID.
42
- * @param id - Unique ID of the spinner toast to remove.
43
- */
53
+ * Removes a spinner toast by its ID.
54
+ * @param id - Unique ID of the spinner toast to remove.
55
+ */
44
56
  removeSpinner(id: string): void;
45
57
  }
46
58
  /**
47
- * Toast notifications controller, alternative to BC's native `ToastManager`.
48
- */
59
+ * Toast notifications controller, alternative to BC's native `ToastManager`.
60
+ */
49
61
  export declare const toastsManager: ToastsManager;
50
62
  export {};
@@ -1,4 +1,4 @@
1
- import { TabsShardContext, ButtonShardContext, TextShardContext, InputShardContext, CheckboxShardContext, InputListShardContext, ImageShardContext, SvgShardContext, BackNextButtonShardContext, CardShardContext, SelectShardContext, ContainerShardContext, Shard } from "./shards";
1
+ import { TabsShardContext, ButtonShardContext, TextShardContext, InputShardContext, CheckboxShardContext, InputListShardContext, ImageShardContext, SvgShardContext, BackNextButtonShardContext, CardShardContext, SelectShardContext, ContainerShardContext, Shard, ExtensionsStorageBarShardContext, FileInputShardContext, FlexContainerShardContext, GridContainerShardContext } from "./shards";
2
2
  export type Anchor = "top-left" | "top-right" | "bottom-left" | "bottom-right";
3
3
  export type SubscreenConstructor = new (...args: any[]) => BaseSubscreen;
4
4
  interface DrawPolylineArrowArgs {
@@ -31,6 +31,7 @@ export declare function dataUrlSvgWithColor(dataUrl: string, newColor: {
31
31
  stroke?: string;
32
32
  }): string;
33
33
  export declare function dataUrlSvgReplaceVars(dataUrl: string, vars: Record<string, string>): string;
34
+ export declare function svgFromString(svg: string): SVGElement;
34
35
  /**
35
36
  * Returns the value of a CSS variable if it exists, otherwise returns the provided fallback.
36
37
  * @param name - The name of the CSS variable (e.g. `"--button-color"`).
@@ -38,59 +39,83 @@ export declare function dataUrlSvgReplaceVars(dataUrl: string, vars: Record<stri
38
39
  * @returns The resolved CSS variable value or the fallback.
39
40
  */
40
41
  export declare function cssVar(name: string, fallback: string): string;
41
- export declare function getRelativeHeight(height: number): number;
42
- export declare function getRelativeWidth(width: number): number;
43
- export declare function getRelativeY(yPos: number, anchorPosition?: 'top' | 'bottom'): number;
44
- export declare function getRelativeX(xPos: number, anchorPosition?: 'left' | 'right'): number;
45
- /**
46
- * Sets the position of the given HTML element relative to the specified anchor point.
47
- * Position scaled relative to the current size of the main canvas.
48
- * @param element - The HTML element to position.
49
- * @param xPos - The base horizontal position value.
50
- * @param yPos - The base vertical position value.
51
- * @param anchor - The anchor point used for positioning. Defaults to `"top-left"`.
52
- * @returns void
53
- */
54
- export declare function setPosition(element: HTMLElement, xPos: number, yPos: number, anchor?: Anchor): void;
55
42
  /**
56
- * Sets the width and height of the given element,
57
- * scaled relative to the current size of the main canvas.
58
- * @param element - The element whose size should be updated.
59
- * @param width - The base width value.
60
- * @param height - The base height value.
61
- * @returns void
62
- */
43
+ * Returns a CSS height scaled to the main canvas (base space: 2000x1000).
44
+ * Based on `--height-unit`, so it updates automatically on resize.
45
+ * @param height - Height in base units.
46
+ */
47
+ export declare function getRelativeHeight(height: number): string;
48
+ /**
49
+ * Returns a CSS width scaled to the main canvas (base space: 2000x1000).
50
+ * Based on `--width-unit`, so it updates automatically on resize.
51
+ * @param width - Width in base units.
52
+ */
53
+ export declare function getRelativeWidth(width: number): string;
54
+ /**
55
+ * Returns a CSS vertical offset from the top or bottom edge of the main canvas.
56
+ * Based on `--canvas-*` and `--height-unit`, so it updates automatically on resize.
57
+ * @param yPos - Offset in base units.
58
+ * @param anchor - Canvas edge to measure from. Defaults to `"top"`.
59
+ */
60
+ export declare function getRelativeY(yPos: number, anchor?: "top" | "bottom"): string;
61
+ /**
62
+ * Returns a CSS horizontal offset from the left or right edge of the main canvas.
63
+ * Based on `--canvas-*` and `--width-unit`, so it updates automatically on resize.
64
+ * @param xPos - Offset in base units.
65
+ * @param anchor - Canvas edge to measure from. Defaults to `"left"`.
66
+ */
67
+ export declare function getRelativeX(xPos: number, anchor?: "left" | "right"): string;
68
+ /**
69
+ * Fixes the element to the main canvas at the given position (base space: 2000x1000).
70
+ * Uses CSS variables, so the position updates automatically on resize.
71
+ * @param element - The element to position.
72
+ * @param xPos - Horizontal offset in base units from the left or right canvas edge.
73
+ * @param yPos - Vertical offset in base units from the top or bottom canvas edge.
74
+ * @param anchor - Canvas corner the offsets are measured from. Defaults to `"top-left"`.
75
+ */
76
+ export declare function setPosition(element: HTMLElement | SVGElement, xPos: number, yPos: number, anchor?: Anchor): void;
77
+ /**
78
+ * Sets the element's width and height scaled to the main canvas (base space: 2000x1000).
79
+ * Uses CSS variables, so the size updates automatically on resize.
80
+ * @param element - The element to resize.
81
+ * @param width - Width in base units.
82
+ * @param height - Height in base units.
83
+ */
63
84
  export declare function setSize(element: HTMLElement | SVGElement, width: number, height: number): void;
64
85
  /**
65
- * Sets the font size of the given HTML element based on a target font size value,
66
- * scaled relative to the current size of the main canvas.
67
- * @param element - The HTML element whose font size should be updated.
68
- * @param targetFontSize - The base font size value to be scaled.
69
- * @returns void
70
- */
71
- export declare function setFontSize(element: HTMLElement, targetFontSize: number): void;
86
+ * Sets the element's font size scaled to the main canvas.
87
+ * One unit is 1% of the canvas's smaller side. Uses `--size-unit`, so it updates automatically on resize.
88
+ * @param element - The element whose font size should be set.
89
+ * @param targetFontSize - Font size in `--size-unit` units.
90
+ */
91
+ export declare function setFontSize(element: HTMLElement | SVGElement, targetFontSize: number): void;
72
92
  /**
73
93
  * Sets the font family of the given HTML element.
74
94
  * @param element - The HTML element whose font family should be updated.
75
95
  * @param fontFamily - Optional font family name. Defaults to `"sans-serif"`.
76
96
  * @returns void
77
97
  */
78
- export declare function setFontFamily(element: HTMLElement, fontFamily?: string): void;
98
+ export declare function setFontFamily(element: HTMLElement | SVGElement, fontFamily?: string): void;
79
99
  /**
80
- * Sets the padding of the given HTML element based on a target padding value,
81
- * scaled relative to the current size of the main canvas.
82
- * @param element - The HTML element whose padding should be updated.
83
- * @param targetPadding - The base padding value to be scaled.
84
- * @returns void
85
- */
86
- export declare function setPadding(element: HTMLElement, targetPadding: number): void;
100
+ * Sets the element's padding on all sides scaled to the main canvas.
101
+ * One unit is 1% of the canvas's smaller side. Uses `--size-unit`, so it updates automatically on resize.
102
+ * @param element - The element whose padding should be set.
103
+ * @param targetPadding - Padding in `--size-unit` units.
104
+ */
105
+ export declare function setPadding(element: HTMLElement | SVGElement, targetPadding: number): void;
87
106
  /**
88
- * Automatically sets the font size of the given HTML element based on the current size of the main canvas.
89
- * @param element - The HTML element whose font size should be updated.
90
- * @returns void
91
- */
92
- export declare function autosetFontSize(element: HTMLElement): void;
93
- export declare function setSizeUnitVariable(): void;
107
+ * Sets the element's font size to the default size for the current main canvas.
108
+ * Uses `--width-unit` and `--height-unit`, so it updates automatically on resize.
109
+ * @param element - The element whose font size should be set.
110
+ */
111
+ export declare function autosetFontSize(element: HTMLElement | SVGElement): void;
112
+ /**
113
+ * Returns a CSS length scaled to the main canvas.
114
+ * One unit is 1% of the canvas's smaller side. Based on `--size-unit`, so it updates automatically on resize.
115
+ * @param value - Value in `--size-unit` units.
116
+ * @returns A CSS length string, e.g. `calc(3 * var(--size-unit) * 1px)`.
117
+ */
118
+ export declare function u(value: number): string;
94
119
  /**
95
120
  * Adds a dynamically generated CSS class to the specified element.
96
121
  *
@@ -107,16 +132,58 @@ export declare function setSizeUnitVariable(): void;
107
132
  * @returns `void`
108
133
  */
109
134
  export declare function addDynamicClass(targetElement: HTMLElement | SVGElement, styles: DynamicClassStyles): void;
110
- export declare function setPreviousSubscreen(): void;
111
- export declare function setSubscreen(subscreen: BaseSubscreen | null): void;
135
+ /**
136
+ * Generates CSS class.
137
+ *
138
+ * The function checks a cache of previously created classes using a key generated from the provided styles.
139
+ * If a class with the same styles already exists, it simply returns this class name.
140
+ * Otherwise, it generates a unique class name (`dynamic-...`) with the corresponding CSS rules
141
+ * (including pseudo-classes `:hover`, `:active`, `:focus`, `:disabled` and pseudo-elements `::before`, `::after`) and returns generated class name,
142
+ *
143
+ * @param styles - An object of type `DynamicClassStyles`. Can contain:
144
+ * - `base` — base styles;
145
+ * - keys `hover`, `active`, `focus`, `disabled`, `before`, `after` — styles for the corresponding pseudo-classes/pseudo-elements;
146
+ * - any other keys — additional selectors in the form `.className{key}`.
147
+ * @returns `class name`
148
+ */
149
+ export declare function getDynamicClass(styles: DynamicClassStyles): string;
150
+ /**
151
+ * Dynamically injects @keyframes rules, similar to getDynamicClass.
152
+ * Returns the animation name to use in CSS.
153
+ * Cached by content hash so identical keyframes are not re-injected.
154
+ */
155
+ export declare function getDynamicKeyframes(name: string, frames: Record<string, Partial<CSSStyleDeclaration>>): string;
156
+ export declare function onClickOutside(element: HTMLElement, callback: (event: MouseEvent) => void): () => void;
157
+ export interface KeydownHandlerOptions {
158
+ once?: boolean;
159
+ }
160
+ export declare class KeydownManager {
161
+ private readonly handlers;
162
+ register(key: KeyboardEvent["key"], handler: () => void, options?: KeydownHandlerOptions): () => void;
163
+ handleKeydown(key: KeyboardEvent["key"]): boolean;
164
+ private unregister;
165
+ }
166
+ export declare const keydownManager: KeydownManager;
167
+ export declare function createTooltip(element: HTMLElement, items: {
168
+ text: string;
169
+ icon?: SVGElement | HTMLImageElement;
170
+ }[] | (() => ({
171
+ text: string;
172
+ icon?: SVGElement | HTMLImageElement;
173
+ })[])): void;
112
174
  export declare function getCurrentSubscreen(): BaseSubscreen | null;
113
175
  export declare function getPreviousSubscreen(): BaseSubscreen | null;
176
+ export declare function getSubscreenStack(): readonly BaseSubscreen[];
177
+ export declare function setSubscreen(nextSubscreen: BaseSubscreen | null): void;
178
+ export declare function setPreviousSubscreen(): void;
114
179
  /**
115
180
  * Abstract class to define subscreens with lifecycle management, UI element creation and navigation functionality.
116
181
  */
117
182
  export declare abstract class BaseSubscreen {
118
183
  protected readonly setSubscreen: typeof setSubscreen;
119
184
  protected readonly setPreviousSubscreen: typeof setPreviousSubscreen;
185
+ private unregisterEscape;
186
+ protected exitConfirmationMessage: string | null;
120
187
  protected get currentSubscreen(): BaseSubscreen | null;
121
188
  protected get previousSubscreen(): BaseSubscreen | null;
122
189
  abstract get name(): string;
@@ -136,13 +203,13 @@ export declare abstract class BaseSubscreen {
136
203
  *
137
204
  * You probably want to override {@link onLoad}, **do not** override `load` if you don't understand what you're doing.
138
205
  *
139
- * Override {@link onLoad} for creating UI elements.
206
+ * Override {@link onLoad} to define html elements.
140
207
  */
141
208
  load(): void;
142
209
  /**
143
210
  * Called once after `setSubscreen()`.
144
211
  *
145
- * Create UI elements here.
212
+ * Define html elements here.
146
213
  */
147
214
  protected onLoad?(): void;
148
215
  /**
@@ -191,8 +258,16 @@ export declare abstract class BaseSubscreen {
191
258
  */
192
259
  protected onResize?(): void;
193
260
  createExitButton(): void;
194
- createSubscreenTitle(): void;
195
- create(shard: Shard): HTMLElement;
261
+ createSubscreenStackBar(): HTMLElement;
262
+ createFromShard(shard: Shard): HTMLElement | SVGElement;
263
+ create(element: HTMLElement, properties: {
264
+ width?: number;
265
+ height?: number;
266
+ x?: number;
267
+ y?: number;
268
+ anchor?: Anchor;
269
+ parent?: HTMLElement;
270
+ }): HTMLElement;
196
271
  createButton(ctx: ButtonShardContext): HTMLButtonElement;
197
272
  createText(ctx: TextShardContext): HTMLParagraphElement;
198
273
  createInput(ctx: InputShardContext): HTMLInputElement | HTMLTextAreaElement;
@@ -206,5 +281,9 @@ export declare abstract class BaseSubscreen {
206
281
  createCard(ctx: CardShardContext): HTMLDivElement;
207
282
  createSelect(ctx: SelectShardContext): HTMLDivElement;
208
283
  createContainer(ctx: ContainerShardContext): HTMLDivElement;
284
+ createFlexContainer(ctx: FlexContainerShardContext): HTMLDivElement;
285
+ createGridContainer(ctx: GridContainerShardContext): HTMLDivElement;
286
+ createExtensionsStorageBar(ctx: ExtensionsStorageBarShardContext): HTMLDivElement;
287
+ createFileInput(ctx: FileInputShardContext): HTMLLabelElement;
209
288
  }
210
289
  export {};
@@ -1,3 +1,4 @@
1
+ import { ValidationOptions } from "class-validator";
1
2
  export * from "class-validator";
2
3
  export * from "class-transformer";
3
4
  export declare function validateData(data: any, dtoClass: any): Promise<{
@@ -5,3 +6,7 @@ export declare function validateData(data: any, dtoClass: any): Promise<{
5
6
  validatedData?: any;
6
7
  errors?: string[];
7
8
  }>;
9
+ export declare function ValidateWith<T extends object>(validator: (object: T) => boolean, validationOptions?: ValidationOptions): (object: T, propertyName: string) => void;
10
+ export declare function IsMemberNumber(validationOptions?: ValidationOptions): (object: object, propertyName: string) => void;
11
+ export declare function IsAssetGroupName(validationOptions?: ValidationOptions): (object: object, propertyName: string) => void;
12
+ export declare function IsAssetGroupItemName(validationOptions?: ValidationOptions): (object: object, propertyName: string) => void;