@vnejs/plugins.text.smooth 0.2.2 → 0.2.4
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/modules/cycle.d.ts +3 -3
- package/dist/modules/cycle.js +1 -1
- package/dist/modules/emit.end.d.ts +2 -2
- package/dist/modules/init.d.ts +1 -1
- package/dist/modules/init.js +1 -1
- package/package.json +1 -1
- package/src/modules/cycle.ts +1 -1
- package/src/modules/emit.end.ts +1 -1
- package/src/modules/init.ts +1 -1
- package/src/tests/init.test.ts +2 -2
- package/dist/utils/smooth.d.ts +0 -3
- package/dist/utils/smooth.js +0 -1
- package/src/utils/smooth.ts +0 -3
package/dist/modules/cycle.d.ts
CHANGED
|
@@ -6,11 +6,11 @@ export declare class TextSmoothCycle extends ModuleCore<TextSmoothPluginEvents,
|
|
|
6
6
|
name: string;
|
|
7
7
|
textUpdateRaf: number | null;
|
|
8
8
|
subscribe: () => void;
|
|
9
|
-
|
|
9
|
+
setup: () => Promise<import("@vnejs/shared").EmitResults<"vne:settings:init">> | undefined;
|
|
10
10
|
getSmoothState: () => import("@vnejs/contracts.text.smooth").ModuleGlobalStateTextSmooth;
|
|
11
11
|
onSmooth: ({ tokensVisible }?: TextSmoothPayload) => Promise<void>;
|
|
12
12
|
setUpdateTextRaf: (tokens?: TextSmoothPayload["tokens"]) => void;
|
|
13
|
-
createUpdateTextFunc: (tokens?: TextSmoothPayload["tokens"]) => Promise<void |
|
|
13
|
+
createUpdateTextFunc: (tokens?: TextSmoothPayload["tokens"]) => Promise<void | import("@vnejs/shared").EmitResults<"vne:text:smooth_done">>;
|
|
14
14
|
cancelRaf: () => void;
|
|
15
|
-
onCancel: () => Promise<
|
|
15
|
+
onCancel: () => Promise<import("@vnejs/shared").EmitResults<"vne:text:smooth_done">> | undefined;
|
|
16
16
|
}
|
package/dist/modules/cycle.js
CHANGED
|
@@ -8,7 +8,7 @@ export class TextSmoothCycle extends ModuleCore {
|
|
|
8
8
|
this.on(this.EVENTS.TEXT.EMIT_END, this.cancelRaf);
|
|
9
9
|
this.on(this.EVENTS.STATE.CLEAR, this.cancelRaf);
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
setup = () => this.emit(this.EVENTS.SETTINGS.INIT, {
|
|
12
12
|
name: this.SETTINGS.TEXT_SMOOTH.TOKEN_RENDER_SPEED,
|
|
13
13
|
value: this.PARAMS.TEXT_SMOOTH.DEFAULT_TOKEN_RENDER_SPEED,
|
|
14
14
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ModuleCore } from "@vnejs/module.core";
|
|
2
|
+
import type { TextEmitEndPayload } from "@vnejs/contracts.text";
|
|
2
3
|
import type { TextSmoothPluginConstants, TextSmoothPluginEvents, TextSmoothPluginParams, TextSmoothPluginSettings } from "../types.js";
|
|
3
|
-
import type { TextEmitEndPayload } from "../utils/smooth.js";
|
|
4
4
|
export declare class TextSmoothEmitEnd extends ModuleCore<TextSmoothPluginEvents, TextSmoothPluginConstants, TextSmoothPluginSettings, TextSmoothPluginParams> {
|
|
5
5
|
name: string;
|
|
6
6
|
subscribe: () => void;
|
|
7
7
|
onTextEmitEnd: ({ isForced }?: TextEmitEndPayload) => Promise<void>;
|
|
8
|
-
onTextRecalcDone: () => Promise<
|
|
8
|
+
onTextRecalcDone: () => Promise<import("@vnejs/shared").EmitResults<"vne:text:smooth_changed"> | undefined>;
|
|
9
9
|
}
|
package/dist/modules/init.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ import { ModuleCore } from "@vnejs/module.core";
|
|
|
2
2
|
import type { TextSmoothPluginConstants, TextSmoothPluginEvents, TextSmoothPluginParams, TextSmoothPluginSettings } from "../types.js";
|
|
3
3
|
export declare class TextSmoothInit extends ModuleCore<TextSmoothPluginEvents, TextSmoothPluginConstants, TextSmoothPluginSettings, TextSmoothPluginParams> {
|
|
4
4
|
name: string;
|
|
5
|
-
|
|
5
|
+
postinject: () => void;
|
|
6
6
|
}
|
package/dist/modules/init.js
CHANGED
package/package.json
CHANGED
package/src/modules/cycle.ts
CHANGED
|
@@ -24,7 +24,7 @@ export class TextSmoothCycle extends ModuleCore<
|
|
|
24
24
|
this.on(this.EVENTS.STATE.CLEAR, this.cancelRaf);
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
setup = () =>
|
|
28
28
|
this.emit(this.EVENTS.SETTINGS.INIT, {
|
|
29
29
|
name: this.SETTINGS.TEXT_SMOOTH.TOKEN_RENDER_SPEED,
|
|
30
30
|
value: this.PARAMS.TEXT_SMOOTH.DEFAULT_TOKEN_RENDER_SPEED,
|
package/src/modules/emit.end.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ModuleCore } from "@vnejs/module.core";
|
|
2
|
+
import type { TextEmitEndPayload } from "@vnejs/contracts.text";
|
|
2
3
|
|
|
3
4
|
import type { TextSmoothPluginConstants, TextSmoothPluginEvents, TextSmoothPluginParams, TextSmoothPluginSettings } from "../types.js";
|
|
4
|
-
import type { TextEmitEndPayload } from "../utils/smooth.js";
|
|
5
5
|
|
|
6
6
|
export class TextSmoothEmitEnd extends ModuleCore<TextSmoothPluginEvents, TextSmoothPluginConstants, TextSmoothPluginSettings, TextSmoothPluginParams> {
|
|
7
7
|
name = "text.smooth.emit.end";
|
package/src/modules/init.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { TextSmoothPluginConstants, TextSmoothPluginEvents, TextSmoothPlugi
|
|
|
5
5
|
export class TextSmoothInit extends ModuleCore<TextSmoothPluginEvents, TextSmoothPluginConstants, TextSmoothPluginSettings, TextSmoothPluginParams> {
|
|
6
6
|
name = "text.smooth.init";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
postinject = () => {
|
|
9
9
|
this.shared.isTextSmoothInProcess = false;
|
|
10
10
|
};
|
|
11
11
|
}
|
package/src/tests/init.test.ts
CHANGED
|
@@ -9,12 +9,12 @@ describe("TextSmoothInit", () => {
|
|
|
9
9
|
registerTextSmoothPluginVne();
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
it("
|
|
12
|
+
it("postinject resets isTextSmoothInProcess flag", () => {
|
|
13
13
|
const { module, shared } = createTextSmoothTestModule(TextSmoothInit, { subscribe: false });
|
|
14
14
|
|
|
15
15
|
shared.isTextSmoothInProcess = true;
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
(module as TextSmoothInit).postinject!();
|
|
18
18
|
|
|
19
19
|
expect(shared.isTextSmoothInProcess).toBe(false);
|
|
20
20
|
});
|
package/dist/utils/smooth.d.ts
DELETED
package/dist/utils/smooth.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/src/utils/smooth.ts
DELETED