@vnejs/plugins.views.screens.loading 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -2
- package/dist/modules/loading.js +2 -2
- package/dist/types.d.ts +2 -2
- package/package.json +1 -1
- package/src/index.ts +2 -2
- package/src/modules/loading.ts +2 -2
- package/src/tests/setup.ts +2 -2
- package/src/types.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "@vnejs/contracts.views.screens.loading";
|
|
2
2
|
import { regPlugin } from "@vnejs/shared";
|
|
3
|
-
import { PARAMS, PLUGIN_NAME, SUBSCRIBE_EVENTS } from "@vnejs/contracts.views.screens.loading";
|
|
3
|
+
import { CONSTANTS, PARAMS, PLUGIN_NAME, SUBSCRIBE_EVENTS } from "@vnejs/contracts.views.screens.loading";
|
|
4
4
|
import { LoadingController } from "./modules/controller.js";
|
|
5
5
|
import { LoadingControllerBg } from "./modules/controller.bg.js";
|
|
6
6
|
import { Loading } from "./modules/loading.js";
|
|
7
7
|
import { LoadingView } from "./modules/view.js";
|
|
8
|
-
regPlugin(PLUGIN_NAME, { events: SUBSCRIBE_EVENTS, params: PARAMS }, [LoadingController, LoadingControllerBg, Loading, LoadingView]);
|
|
8
|
+
regPlugin(PLUGIN_NAME, { constants: CONSTANTS, events: SUBSCRIBE_EVENTS, params: PARAMS }, [LoadingController, LoadingControllerBg, Loading, LoadingView]);
|
package/dist/modules/loading.js
CHANGED
|
@@ -5,10 +5,10 @@ export class Loading extends ModuleCore {
|
|
|
5
5
|
this.on(this.EVENTS.LOADING.EMIT, this.onLoadingEmit);
|
|
6
6
|
};
|
|
7
7
|
onLoadingEmit = async ({ promiseFunc } = {}) => {
|
|
8
|
-
this.
|
|
8
|
+
this.emit(this.EVENTS.LOGS.EMIT, { action: this.CONST.LOADING.LOGS_ACTIONS.START });
|
|
9
9
|
await this.emit(this.EVENTS.LOADING.SHOW);
|
|
10
10
|
await Promise.all([promiseFunc?.(), this.waitTimeout(this.PARAMS.LOADING.MIN_SHOW_TIME)]);
|
|
11
11
|
await this.emit(this.EVENTS.LOADING.HIDE);
|
|
12
|
-
this.
|
|
12
|
+
this.emit(this.EVENTS.LOGS.EMIT, { action: this.CONST.LOADING.LOGS_ACTIONS.FINISH });
|
|
13
13
|
};
|
|
14
14
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ import type { PluginName as LogsPluginName, SubscribeEvents as LogsSubscribeEven
|
|
|
3
3
|
import type { PluginName as MemoryPluginName, SubscribeEvents as MemorySubscribeEvents } from "@vnejs/contracts.core.memory";
|
|
4
4
|
import type { PluginName as SystemPluginName, SubscribeEvents as SystemSubscribeEvents } from "@vnejs/contracts.core.system";
|
|
5
5
|
import type { PluginName as LocsPluginName, SubscribeEvents as LocsSubscribeEvents } from "@vnejs/contracts.text.locs";
|
|
6
|
-
import type { Params, PluginName, SubscribeEvents } from "@vnejs/contracts.views.screens.loading";
|
|
6
|
+
import type { Constants, Params, PluginName, SubscribeEvents } from "@vnejs/contracts.views.screens.loading";
|
|
7
7
|
export type LoadingPluginEvents = ModuleComponentsEvents & Record<PluginName, SubscribeEvents> & Record<LogsPluginName, LogsSubscribeEvents> & Record<MemoryPluginName, MemorySubscribeEvents> & Record<SystemPluginName, SystemSubscribeEvents> & Record<LocsPluginName, LocsSubscribeEvents>;
|
|
8
|
-
export type LoadingPluginConstants = ModuleComponentsConstants
|
|
8
|
+
export type LoadingPluginConstants = ModuleComponentsConstants & Record<PluginName, Constants>;
|
|
9
9
|
export type LoadingPluginSettings = ModuleComponentsSettings;
|
|
10
10
|
export type LoadingPluginParams = ModuleComponentsParams & Record<PluginName, Params>;
|
|
11
11
|
export type LoadingPluginState = {
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "@vnejs/contracts.views.screens.loading";
|
|
2
2
|
|
|
3
3
|
import { regPlugin } from "@vnejs/shared";
|
|
4
|
-
import { PARAMS, PLUGIN_NAME, SUBSCRIBE_EVENTS } from "@vnejs/contracts.views.screens.loading";
|
|
4
|
+
import { CONSTANTS, PARAMS, PLUGIN_NAME, SUBSCRIBE_EVENTS } from "@vnejs/contracts.views.screens.loading";
|
|
5
5
|
|
|
6
6
|
import { LoadingController } from "./modules/controller.js";
|
|
7
7
|
import { LoadingControllerBg } from "./modules/controller.bg.js";
|
|
8
8
|
import { Loading } from "./modules/loading.js";
|
|
9
9
|
import { LoadingView } from "./modules/view.js";
|
|
10
10
|
|
|
11
|
-
regPlugin(PLUGIN_NAME, { events: SUBSCRIBE_EVENTS, params: PARAMS }, [LoadingController, LoadingControllerBg, Loading, LoadingView]);
|
|
11
|
+
regPlugin(PLUGIN_NAME, { constants: CONSTANTS, events: SUBSCRIBE_EVENTS, params: PARAMS }, [LoadingController, LoadingControllerBg, Loading, LoadingView]);
|
package/src/modules/loading.ts
CHANGED
|
@@ -12,10 +12,10 @@ export class Loading extends ModuleCore<LoadingPluginEvents, LoadingPluginConsta
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
onLoadingEmit = async ({ promiseFunc }: LoadingEmitPayload = {}) => {
|
|
15
|
-
this.
|
|
15
|
+
this.emit(this.EVENTS.LOGS.EMIT, { action: this.CONST.LOADING.LOGS_ACTIONS.START });
|
|
16
16
|
await this.emit(this.EVENTS.LOADING.SHOW);
|
|
17
17
|
await Promise.all([promiseFunc?.(), this.waitTimeout(this.PARAMS.LOADING.MIN_SHOW_TIME)]);
|
|
18
18
|
await this.emit(this.EVENTS.LOADING.HIDE);
|
|
19
|
-
this.
|
|
19
|
+
this.emit(this.EVENTS.LOGS.EMIT, { action: this.CONST.LOADING.LOGS_ACTIONS.FINISH });
|
|
20
20
|
};
|
|
21
21
|
}
|
package/src/tests/setup.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { CONSTANTS as LAYER_CONST, PLUGIN_NAME as LAYER, SETTINGS_KEYS as LAYER_SETTINGS } from "@vnejs/contracts.canvas.layer";
|
|
2
2
|
import { SUBSCRIBE_EVENTS as MEDIA_EVENTS } from "@vnejs/contracts.core.media";
|
|
3
|
-
import { PARAMS, PLUGIN_NAME, SUBSCRIBE_EVENTS } from "@vnejs/contracts.views.screens.loading";
|
|
3
|
+
import { CONSTANTS, PARAMS, PLUGIN_NAME, SUBSCRIBE_EVENTS } from "@vnejs/contracts.views.screens.loading";
|
|
4
4
|
import { createTestModule as baseCreateTestModule, registerCoreVne, registerVnePlugin, stubEvent, stubSilentEvent } from "@vnejs/test-utils";
|
|
5
5
|
|
|
6
6
|
export const registerLoadingPluginVne = () => {
|
|
7
7
|
registerCoreVne();
|
|
8
8
|
registerVnePlugin(LAYER, { constants: LAYER_CONST, settings: LAYER_SETTINGS });
|
|
9
|
-
registerVnePlugin(PLUGIN_NAME, { events: SUBSCRIBE_EVENTS, params: PARAMS });
|
|
9
|
+
registerVnePlugin(PLUGIN_NAME, { constants: CONSTANTS, events: SUBSCRIBE_EVENTS, params: PARAMS });
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
export const createLoadingTestModule = <T extends Parameters<typeof baseCreateTestModule>[0]>(
|
package/src/types.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { PluginName as LogsPluginName, SubscribeEvents as LogsSubscribeEven
|
|
|
3
3
|
import type { PluginName as MemoryPluginName, SubscribeEvents as MemorySubscribeEvents } from "@vnejs/contracts.core.memory";
|
|
4
4
|
import type { PluginName as SystemPluginName, SubscribeEvents as SystemSubscribeEvents } from "@vnejs/contracts.core.system";
|
|
5
5
|
import type { PluginName as LocsPluginName, SubscribeEvents as LocsSubscribeEvents } from "@vnejs/contracts.text.locs";
|
|
6
|
-
import type { Params, PluginName, SubscribeEvents } from "@vnejs/contracts.views.screens.loading";
|
|
6
|
+
import type { Constants, Params, PluginName, SubscribeEvents } from "@vnejs/contracts.views.screens.loading";
|
|
7
7
|
|
|
8
8
|
export type LoadingPluginEvents = ModuleComponentsEvents &
|
|
9
9
|
Record<PluginName, SubscribeEvents> &
|
|
@@ -12,7 +12,7 @@ export type LoadingPluginEvents = ModuleComponentsEvents &
|
|
|
12
12
|
Record<SystemPluginName, SystemSubscribeEvents> &
|
|
13
13
|
Record<LocsPluginName, LocsSubscribeEvents>;
|
|
14
14
|
|
|
15
|
-
export type LoadingPluginConstants = ModuleComponentsConstants
|
|
15
|
+
export type LoadingPluginConstants = ModuleComponentsConstants & Record<PluginName, Constants>;
|
|
16
16
|
|
|
17
17
|
export type LoadingPluginSettings = ModuleComponentsSettings;
|
|
18
18
|
|