@vnejs/plugins.views.settings 0.1.1 → 0.1.3

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/const/params.js CHANGED
@@ -2,7 +2,7 @@ export const TRANSITION = 500;
2
2
  export const ZINDEX = 4000;
3
3
  export const LOC_LABEL = "settings";
4
4
 
5
- export const BACKGROUND = "Menu/save";
5
+ export const BACKGROUND = "save";
6
6
 
7
7
  export const TABS = {};
8
8
 
@@ -15,7 +15,7 @@ export const VIEW_PROPS = {
15
15
 
16
16
  cross: { position: { bottom: 90, right: 120 }, svg: { size: 60 } },
17
17
 
18
- exampleText: { size: 60, height: 300, color: "var(--vne-color-active)" },
18
+ exampleText: { size: 60, height: 300, color: "var(--vne-color-active)", transition: 300 },
19
19
 
20
20
  fieldsGap: 48,
21
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/plugins.views.settings",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -2,9 +2,9 @@ import { useEffect, useMemo, useState } from "react";
2
2
 
3
3
  import { SmoothText } from "@vnejs/uis.react";
4
4
 
5
- const EMPTY_ARRAY = [];
5
+ import { tokenizeText } from "@vnejs/helpers";
6
6
 
7
- const mapTokens = (token) => ({ token });
7
+ const EMPTY_ARRAY = [];
8
8
 
9
9
  export const SettingsExampleText = ({ isShow = false, locs = {}, ...props } = {}) => {
10
10
  const [tokens, setTokens] = useState(EMPTY_ARRAY);
@@ -14,9 +14,7 @@ export const SettingsExampleText = ({ isShow = false, locs = {}, ...props } = {}
14
14
  const text = useMemo(() => locs["fields.text.example"] ?? "", [locs]);
15
15
 
16
16
  useEffect(() => {
17
- if (!isShow) return;
18
-
19
- setTokens([...text].map(mapTokens));
17
+ if (isShow) setTokens(tokenizeText(text));
20
18
  }, [isShow, text]);
21
19
 
22
20
  useEffect(() => {
@@ -32,6 +30,7 @@ export const SettingsExampleText = ({ isShow = false, locs = {}, ...props } = {}
32
30
  tokens={tokens}
33
31
  isForce={isForce}
34
32
  charDelay={props.PARAMS.TEXT.TOKEN_RENDER_DELAY / props.shared.settings[props.SETTINGS.TEXT.TOKEN_RENDER_SPEED]}
33
+ transition={props.PARAMS.SETTINGS_VIEW.VIEW_PROPS.exampleText.transition}
35
34
  size={props.PARAMS.SETTINGS_VIEW.VIEW_PROPS.exampleText.size}
36
35
  color={props.PARAMS.SETTINGS_VIEW.VIEW_PROPS.exampleText.color}
37
36
  height={props.PARAMS.SETTINGS_VIEW.VIEW_PROPS.exampleText.height}
@@ -54,6 +54,7 @@ export const SettingsTabContent = ({ isShow = false, isForce = false, locs = {},
54
54
  {props.showTextExample && (
55
55
  <SettingsExampleText
56
56
  {...props}
57
+ locs={locs}
57
58
  isShow={isShow}
58
59
  isForce={isForce}
59
60
  text={locs["fields.text.example"] || ""}