@vnejs/plugins.view.coralina.interface.controls 0.1.3 → 0.1.5
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 +3 -1
- package/modules/controller.js +4 -2
- package/package.json +1 -1
- package/view/index.jsx +2 -2
package/const/params.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { getVneLength } from "@vnejs/uis.utils";
|
|
2
|
+
|
|
1
3
|
export const VIEW_PROPS = {
|
|
2
4
|
adv: {
|
|
3
5
|
icon: { width: 96, height: 96, isOpacityOnHover: true },
|
|
4
|
-
view: { left: 360, bottom: 24, translateX:
|
|
6
|
+
view: { left: 360, bottom: 24, translateX: getVneLength(240) },
|
|
5
7
|
flex: { gap: 36 },
|
|
6
8
|
},
|
|
7
9
|
line: {
|
package/modules/controller.js
CHANGED
|
@@ -31,7 +31,7 @@ export class InterfaceControlsController extends ModuleController {
|
|
|
31
31
|
this.on(this.EVENTS.INTERFACE.VISIBLE_CHANGED, this.onVisibleChanged);
|
|
32
32
|
|
|
33
33
|
this.on(this.EVENTS.SYSTEM.STARTED, this.getIconsSrcs);
|
|
34
|
-
this.on(this.EVENTS.MEMORY.CLEARED, this.
|
|
34
|
+
this.on(this.EVENTS.MEMORY.CLEARED, this.onMemoryCleared);
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
beforeShow = async () => this.updateState({ icons: await this.getIconsSrcs() });
|
|
@@ -65,6 +65,8 @@ export class InterfaceControlsController extends ModuleController {
|
|
|
65
65
|
return this.updateStateAndViewForce({ isVisible, isShow, view });
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
+
onMemoryCleared = async () => this.updateStateAndViewFast({ icons: await this.getIconsSrcs() });
|
|
69
|
+
|
|
68
70
|
toggleUnvisibleControls = (isVisible) => {
|
|
69
71
|
const args = { key: `${this.name}-unvisible`, controls: this.controlsUnvisible, index: this.controlsIndex + 500 };
|
|
70
72
|
|
|
@@ -76,7 +78,7 @@ export class InterfaceControlsController extends ModuleController {
|
|
|
76
78
|
getIconsSrcs = () => Promise.all(this.PARAMS.INTERFACE_CONTROLS_VIEW.ITEMS.map(this.getOneIconSrcs));
|
|
77
79
|
|
|
78
80
|
getOneIconSrcs = async ({ icon = "", iconHover = "" } = {}) => {
|
|
79
|
-
const [result, quality] = [{}, this.shared.settings[this.SETTINGS.
|
|
81
|
+
const [result, quality] = [{}, this.shared.settings[this.SETTINGS.LAYER.QUALITY]];
|
|
80
82
|
|
|
81
83
|
if (icon) result.src = (await this.loadImageMedia(`interface/${icon}`, "icons", quality, false, false)).src;
|
|
82
84
|
if (iconHover) result.srcHover = (await this.loadImageMedia(`interface/${iconHover}`, "icons", quality, false, false)).src;
|
package/package.json
CHANGED
package/view/index.jsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
2
2
|
import { createRoot } from "react-dom/client";
|
|
3
3
|
|
|
4
|
-
import { Flex, Icon, View } from "@vnejs/uis.
|
|
4
|
+
import { Flex, Icon, View } from "@vnejs/uis.react";
|
|
5
5
|
|
|
6
6
|
const InterfaceControls = ({ store, onMount, ...props } = {}) => {
|
|
7
7
|
const [{ isShow = false, isVisible = false, isForce = false, view = "", icons = [] }, setState] = useState({});
|