@vnejs/plugins.settings.potato 0.1.13 → 0.1.15
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.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/modules/potato.d.ts +1 -2
- package/dist/modules/potato.js +4 -6
- package/dist/types.d.ts +2 -2
- package/dist/types.js +1 -1
- package/package.json +2 -2
- package/src/index.ts +2 -2
- package/src/modules/potato.ts +7 -8
- package/src/types.ts +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import "@vnejs/
|
|
1
|
+
import "@vnejs/contracts.settings.potato";
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "@vnejs/
|
|
1
|
+
import "@vnejs/contracts.settings.potato";
|
|
2
2
|
import { regPlugin } from "@vnejs/shared";
|
|
3
|
-
import { CONSTANTS, PLUGIN_NAME, SETTINGS_KEYS, SUBSCRIBE_EVENTS } from "@vnejs/
|
|
3
|
+
import { CONSTANTS, PLUGIN_NAME, SETTINGS_KEYS, SUBSCRIBE_EVENTS } from "@vnejs/contracts.settings.potato";
|
|
4
4
|
import { Potato } from "./modules/potato.js";
|
|
5
5
|
regPlugin(PLUGIN_NAME, { events: SUBSCRIBE_EVENTS, settings: SETTINGS_KEYS, constants: CONSTANTS }, [Potato]);
|
package/dist/modules/potato.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModuleCore } from "@vnejs/module.core";
|
|
2
2
|
import type { SettingsChangedResult } from "@vnejs/module.core";
|
|
3
|
-
import type { PotatoEmitPayload } from "@vnejs/
|
|
3
|
+
import type { PotatoEmitPayload } from "@vnejs/contracts.settings.potato";
|
|
4
4
|
import type { PotatoPluginConstants, PotatoPluginEvents, PotatoPluginParams, PotatoPluginSettings } from "../types.js";
|
|
5
5
|
export declare class Potato extends ModuleCore<PotatoPluginEvents, PotatoPluginConstants, PotatoPluginSettings, PotatoPluginParams> {
|
|
6
6
|
name: string;
|
|
@@ -9,5 +9,4 @@ export declare class Potato extends ModuleCore<PotatoPluginEvents, PotatoPluginC
|
|
|
9
9
|
init: () => Promise<void>;
|
|
10
10
|
onSettingChange: ({ name, value }: SettingsChangedResult) => false | Promise<unknown[]> | undefined;
|
|
11
11
|
onPotatoEmit: ({ value }?: PotatoEmitPayload) => void;
|
|
12
|
-
notPotato: (e: string) => boolean;
|
|
13
12
|
}
|
package/dist/modules/potato.js
CHANGED
|
@@ -14,16 +14,14 @@ export class Potato extends ModuleCore {
|
|
|
14
14
|
};
|
|
15
15
|
onSettingChange = ({ name, value }) => name === this.SETTINGS.POTATO.ENABLED && this.emit(this.EVENTS.POTATO.EMIT, { value: Boolean(value) });
|
|
16
16
|
onPotatoEmit = ({ value } = {}) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const enabled = Boolean(value);
|
|
18
|
+
this.shared.mediaNoTimeoutSources.set(this.CONST.POTATO.SOURCE, enabled);
|
|
19
|
+
this.shared.viewForceAnimationSources.set(this.CONST.POTATO.SOURCE, enabled);
|
|
20
|
+
if (enabled) {
|
|
20
21
|
this.styleElement && document.head.appendChild(this.styleElement);
|
|
21
22
|
}
|
|
22
23
|
else {
|
|
23
|
-
this.shared.mediaNoTimeoutSources = this.shared.mediaNoTimeoutSources.filter(this.notPotato);
|
|
24
|
-
this.shared.viewForceAnimationSources = this.shared.viewForceAnimationSources.filter(this.notPotato);
|
|
25
24
|
this.styleElement?.isConnected && document.head.removeChild(this.styleElement);
|
|
26
25
|
}
|
|
27
26
|
};
|
|
28
|
-
notPotato = (e) => e !== this.CONST.POTATO.SOURCE;
|
|
29
27
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "@vnejs/
|
|
1
|
+
import "@vnejs/contracts.settings.potato";
|
|
2
2
|
import type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCoreSettings } from "@vnejs/module.core";
|
|
3
|
-
import type { Constants, PluginName, SettingsKeys, SubscribeEvents } from "@vnejs/
|
|
3
|
+
import type { Constants, PluginName, SettingsKeys, SubscribeEvents } from "@vnejs/contracts.settings.potato";
|
|
4
4
|
export type PotatoPluginEvents = ModuleCoreEvents & Record<PluginName, SubscribeEvents>;
|
|
5
5
|
export type PotatoPluginConstants = ModuleCoreConstants & Record<PluginName, Constants>;
|
|
6
6
|
export type PotatoPluginSettings = ModuleCoreSettings & Record<PluginName, SettingsKeys>;
|
package/dist/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import "@vnejs/
|
|
1
|
+
import "@vnejs/contracts.settings.potato";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vnejs/plugins.settings.potato",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"author": "",
|
|
31
31
|
"license": "ISC",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@vnejs/
|
|
33
|
+
"@vnejs/contracts.settings.potato": "~0.1.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@vnejs/module.core": "~0.1.0",
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "@vnejs/
|
|
1
|
+
import "@vnejs/contracts.settings.potato";
|
|
2
2
|
|
|
3
3
|
import { regPlugin } from "@vnejs/shared";
|
|
4
|
-
import { CONSTANTS, PLUGIN_NAME, SETTINGS_KEYS, SUBSCRIBE_EVENTS } from "@vnejs/
|
|
4
|
+
import { CONSTANTS, PLUGIN_NAME, SETTINGS_KEYS, SUBSCRIBE_EVENTS } from "@vnejs/contracts.settings.potato";
|
|
5
5
|
|
|
6
6
|
import { Potato } from "./modules/potato.js";
|
|
7
7
|
|
package/src/modules/potato.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ModuleCore } from "@vnejs/module.core";
|
|
2
2
|
import type { SettingsChangedResult } from "@vnejs/module.core";
|
|
3
|
-
import type { PotatoEmitPayload } from "@vnejs/
|
|
3
|
+
import type { PotatoEmitPayload } from "@vnejs/contracts.settings.potato";
|
|
4
4
|
|
|
5
5
|
import type { PotatoPluginConstants, PotatoPluginEvents, PotatoPluginParams, PotatoPluginSettings } from "../types.js";
|
|
6
6
|
|
|
@@ -28,16 +28,15 @@ export class Potato extends ModuleCore<PotatoPluginEvents, PotatoPluginConstants
|
|
|
28
28
|
name === this.SETTINGS.POTATO.ENABLED && this.emit(this.EVENTS.POTATO.EMIT, { value: Boolean(value) } satisfies PotatoEmitPayload);
|
|
29
29
|
|
|
30
30
|
onPotatoEmit = ({ value }: PotatoEmitPayload = {}) => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
const enabled = Boolean(value);
|
|
32
|
+
|
|
33
|
+
this.shared.mediaNoTimeoutSources.set(this.CONST.POTATO.SOURCE, enabled);
|
|
34
|
+
this.shared.viewForceAnimationSources.set(this.CONST.POTATO.SOURCE, enabled);
|
|
35
|
+
|
|
36
|
+
if (enabled) {
|
|
34
37
|
this.styleElement && document.head.appendChild(this.styleElement);
|
|
35
38
|
} else {
|
|
36
|
-
this.shared.mediaNoTimeoutSources = this.shared.mediaNoTimeoutSources.filter(this.notPotato);
|
|
37
|
-
this.shared.viewForceAnimationSources = this.shared.viewForceAnimationSources.filter(this.notPotato);
|
|
38
39
|
this.styleElement?.isConnected && document.head.removeChild(this.styleElement);
|
|
39
40
|
}
|
|
40
41
|
};
|
|
41
|
-
|
|
42
|
-
notPotato = (e: string) => e !== this.CONST.POTATO.SOURCE;
|
|
43
42
|
}
|
package/src/types.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "@vnejs/
|
|
1
|
+
import "@vnejs/contracts.settings.potato";
|
|
2
2
|
|
|
3
3
|
import type { ModuleCoreConstants, ModuleCoreEvents, ModuleCoreParams, ModuleCoreSettings } from "@vnejs/module.core";
|
|
4
|
-
import type { Constants, PluginName, SettingsKeys, SubscribeEvents } from "@vnejs/
|
|
4
|
+
import type { Constants, PluginName, SettingsKeys, SubscribeEvents } from "@vnejs/contracts.settings.potato";
|
|
5
5
|
|
|
6
6
|
export type PotatoPluginEvents = ModuleCoreEvents & Record<PluginName, SubscribeEvents>;
|
|
7
7
|
|