@vnejs/plugins.views.settings 0.1.1 → 0.1.2
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
|
@@ -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
|
@@ -2,9 +2,9 @@ import { useEffect, useMemo, useState } from "react";
|
|
|
2
2
|
|
|
3
3
|
import { SmoothText } from "@vnejs/uis.react";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { tokenizeText } from "@vnejs/helpers";
|
|
6
6
|
|
|
7
|
-
const
|
|
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 (
|
|
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}
|