@vnejs/plugins.views.settings 0.2.3 → 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.
@@ -18,8 +18,6 @@ export const SettingsExampleText = ({ isShow = false, locs = {}, PARAMS, shared,
18
18
  const tm = setTimeout(() => setTokens([]), PARAMS.SETTINGS_VIEW.TRANSITION);
19
19
  return () => clearTimeout(tm);
20
20
  }, [isShow, isForce, PARAMS.SETTINGS_VIEW.TRANSITION]);
21
- const charDelay = isForce
22
- ? 0
23
- : PARAMS.TEXT_SMOOTH.TOKEN_RENDER_DELAY / Number(shared.settings[SETTINGS.TEXT_SMOOTH.TOKEN_RENDER_SPEED]);
21
+ const charDelay = isForce ? 0 : PARAMS.TEXT_SMOOTH.TOKEN_RENDER_DELAY / Number(shared.settings[SETTINGS.TEXT_SMOOTH.TOKEN_RENDER_SPEED]);
24
22
  return (_jsx(SmoothText, { tokens: tokens, isForce: isForce, charDelay: charDelay, tokensVisibleForce: isForce ? tokens.length : null, transition: PARAMS.SETTINGS_VIEW.VIEW_PROPS.exampleText.transition, size: PARAMS.SETTINGS_VIEW.VIEW_PROPS.exampleText.size, color: PARAMS.SETTINGS_VIEW.VIEW_PROPS.exampleText.color, height: PARAMS.SETTINGS_VIEW.VIEW_PROPS.exampleText.height, scrollBarTextSize: Number(shared.settings[SETTINGS.TEXTSIZE.VALUE]) }));
25
23
  };
@@ -12,7 +12,20 @@ const SettingsViewComponent = ({ store, onMount, PARAMS, emit, EVENTS, shared, C
12
12
  isForce: isRealForce,
13
13
  transition: isRealForce ? 0 : PARAMS.SETTINGS_VIEW.TRANSITION,
14
14
  }), [isShow, isRealForce, propsByView.view, PARAMS.SETTINGS_VIEW.TRANSITION]);
15
- const propsTab = useMemo(() => ({ store, onMount, PARAMS, emit, EVENTS, shared, CONST, SETTINGS, isForce: isRealForce, currentItem: currentArrowVerticalItem, currentItemInner, locs }), [store, onMount, PARAMS, emit, EVENTS, shared, CONST, SETTINGS, isRealForce, currentArrowVerticalItem, currentItemInner, locs]);
15
+ const propsTab = useMemo(() => ({
16
+ store,
17
+ onMount,
18
+ PARAMS,
19
+ emit,
20
+ EVENTS,
21
+ shared,
22
+ CONST,
23
+ SETTINGS,
24
+ isForce: isRealForce,
25
+ currentItem: currentArrowVerticalItem,
26
+ currentItemInner,
27
+ locs,
28
+ }), [store, onMount, PARAMS, emit, EVENTS, shared, CONST, SETTINGS, isRealForce, currentArrowVerticalItem, currentItemInner, locs]);
16
29
  return (_jsx(View, { ...propsView, children: Object.entries(tabsContent).map(([key, content]) => (_createElement(SettingsTabContent, { ...propsTab, key: key, isShow: tabKey === key, fields: content.fields, showTextExample: content.showTextExample, locs: content.locs ?? locs }))) }));
17
30
  };
18
31
  export const render = createRenderFunc(SettingsViewComponent);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/plugins.views.settings",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -30,9 +30,7 @@ export class SettingsViewController extends ModuleController<
30
30
  const key = this.tabKeyOf(payload);
31
31
 
32
32
  const tabsContent = payload.tabs
33
- ? Object.fromEntries(
34
- Object.entries(payload.tabs).map(([tabKey, settingsTab]) => [tabKey, this.tabContentOf(settingsTab, locs)]),
35
- )
33
+ ? Object.fromEntries(Object.entries(payload.tabs).map(([tabKey, settingsTab]) => [tabKey, this.tabContentOf(settingsTab, locs)]))
36
34
  : { ...(this.state.tabsContent ?? {}), [key]: this.tabContentOf(tab, locs) };
37
35
 
38
36
  return {
@@ -7,7 +7,10 @@ import { CONTROLS_EVENTS, createSettingsViewTestModule, registerSettingsViewPlug
7
7
 
8
8
  const generalTab = {
9
9
  titleLocKey: "general",
10
- fields: [{ settingKey: "a", type: "toggle" }, { settingKey: "b", type: "toggle" }],
10
+ fields: [
11
+ { settingKey: "a", type: "toggle" },
12
+ { settingKey: "b", type: "toggle" },
13
+ ],
11
14
  };
12
15
 
13
16
  describe("SettingsViewArrows", () => {
@@ -86,7 +89,11 @@ describe("SettingsViewArrows", () => {
86
89
  await observer.emit(SUBSCRIBE_EVENTS.TAB_SET, {
87
90
  tab: {
88
91
  titleLocKey: "audio",
89
- fields: [{ settingKey: "c", type: "toggle" }, { settingKey: "d", type: "toggle" }, { settingKey: "e", type: "toggle" }],
92
+ fields: [
93
+ { settingKey: "c", type: "toggle" },
94
+ { settingKey: "d", type: "toggle" },
95
+ { settingKey: "e", type: "toggle" },
96
+ ],
90
97
  },
91
98
  });
92
99
 
@@ -1,12 +1,7 @@
1
1
  import { CONSTANTS as CONTROLS_CONST, PLUGIN_NAME as CONTROLS, SUBSCRIBE_EVENTS as CONTROLS_EVENTS } from "@vnejs/contracts.controls";
2
2
  import { PARAMS, PLUGIN_NAME, SUBSCRIBE_EVENTS } from "@vnejs/contracts.views.settings";
3
3
  import { SourcesSet } from "@vnejs/sources-set";
4
- import {
5
- createTestModule as baseCreateTestModule,
6
- registerCoreVne,
7
- registerVnePlugin,
8
- stubSilentEvent,
9
- } from "@vnejs/test-utils";
4
+ import { createTestModule as baseCreateTestModule, registerCoreVne, registerVnePlugin, stubSilentEvent } from "@vnejs/test-utils";
10
5
 
11
6
  export const registerSettingsViewPluginVne = () => {
12
7
  registerCoreVne();
package/src/types.ts CHANGED
@@ -5,9 +5,7 @@ import type { SettingsKeys as TextsizeSettingsKeys, PluginName as TextsizePlugin
5
5
  import type { Params as TextSmoothParams, PluginName as TextSmoothPluginName, SettingsKeys as TextSmoothSettingsKeys } from "@vnejs/contracts.text.smooth";
6
6
  import type { Params, PluginName, SubscribeEvents } from "@vnejs/contracts.views.settings";
7
7
 
8
- export type SettingsViewPluginEvents = ModuleComponentsEvents &
9
- Record<PluginName, SubscribeEvents> &
10
- Record<SettingsPluginName, SettingsSubscribeEvents>;
8
+ export type SettingsViewPluginEvents = ModuleComponentsEvents & Record<PluginName, SubscribeEvents> & Record<SettingsPluginName, SettingsSubscribeEvents>;
11
9
 
12
10
  export type SettingsViewPluginConstants = ModuleComponentsConstants & Record<ControlsPluginName, ControlsConstants>;
13
11
 
@@ -15,6 +13,4 @@ export type SettingsViewPluginSettings = ModuleComponentsSettings &
15
13
  Record<TextSmoothPluginName, TextSmoothSettingsKeys> &
16
14
  Record<TextsizePluginName, TextsizeSettingsKeys>;
17
15
 
18
- export type SettingsViewPluginParams = ModuleComponentsParams &
19
- Record<PluginName, Params> &
20
- Record<TextSmoothPluginName, TextSmoothParams>;
16
+ export type SettingsViewPluginParams = ModuleComponentsParams & Record<PluginName, Params> & Record<TextSmoothPluginName, TextSmoothParams>;
@@ -41,9 +41,7 @@ export const SettingsExampleText = ({ isShow = false, locs = {}, PARAMS, shared,
41
41
  return () => clearTimeout(tm);
42
42
  }, [isShow, isForce, PARAMS.SETTINGS_VIEW.TRANSITION]);
43
43
 
44
- const charDelay = isForce
45
- ? 0
46
- : PARAMS.TEXT_SMOOTH.TOKEN_RENDER_DELAY / Number(shared.settings[SETTINGS.TEXT_SMOOTH.TOKEN_RENDER_SPEED]);
44
+ const charDelay = isForce ? 0 : PARAMS.TEXT_SMOOTH.TOKEN_RENDER_DELAY / Number(shared.settings[SETTINGS.TEXT_SMOOTH.TOKEN_RENDER_SPEED]);
47
45
 
48
46
  return (
49
47
  <SmoothText
@@ -40,7 +40,20 @@ const SettingsViewComponent = ({ store, onMount, PARAMS, emit, EVENTS, shared, C
40
40
  );
41
41
 
42
42
  const propsTab = useMemo(
43
- () => ({ store, onMount, PARAMS, emit, EVENTS, shared, CONST, SETTINGS, isForce: isRealForce, currentItem: currentArrowVerticalItem, currentItemInner, locs }),
43
+ () => ({
44
+ store,
45
+ onMount,
46
+ PARAMS,
47
+ emit,
48
+ EVENTS,
49
+ shared,
50
+ CONST,
51
+ SETTINGS,
52
+ isForce: isRealForce,
53
+ currentItem: currentArrowVerticalItem,
54
+ currentItemInner,
55
+ locs,
56
+ }),
44
57
  [store, onMount, PARAMS, emit, EVENTS, shared, CONST, SETTINGS, isRealForce, currentArrowVerticalItem, currentItemInner, locs],
45
58
  );
46
59