@micromag/viewer 0.3.19 → 0.3.23
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/es/index.js +12 -6
- package/lib/index.js +12 -6
- package/package.json +8 -8
package/es/index.js
CHANGED
|
@@ -1055,16 +1055,22 @@ var ViewerMenu = function ViewerMenu(_ref) {
|
|
|
1055
1055
|
screenType = _ref2$type === void 0 ? null : _ref2$type;
|
|
1056
1056
|
|
|
1057
1057
|
var items = useMemo(function () {
|
|
1058
|
-
return screens.
|
|
1059
|
-
var
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
}).map(function (it) {
|
|
1058
|
+
return screens.map(function (it) {
|
|
1059
|
+
var children = screens.filter(function (s) {
|
|
1060
|
+
return s.parentId === it.id;
|
|
1061
|
+
});
|
|
1063
1062
|
return {
|
|
1064
1063
|
screen: it,
|
|
1065
1064
|
screenId: it.id,
|
|
1066
|
-
current: screenId === it.id
|
|
1065
|
+
current: screenId === it.id || (children.find(function (c) {
|
|
1066
|
+
return c.id === screenId;
|
|
1067
|
+
}) || null) !== null,
|
|
1068
|
+
visible: ((it === null || it === void 0 ? void 0 : it.parentId) || null) === null
|
|
1067
1069
|
};
|
|
1070
|
+
}).filter(function (_ref3) {
|
|
1071
|
+
var _ref3$visible = _ref3.visible,
|
|
1072
|
+
visible = _ref3$visible === void 0 ? true : _ref3$visible;
|
|
1073
|
+
return visible;
|
|
1068
1074
|
});
|
|
1069
1075
|
}, [screens, screenId]);
|
|
1070
1076
|
var trackEvent = useTrackEvent();
|
package/lib/index.js
CHANGED
|
@@ -1073,16 +1073,22 @@ var ViewerMenu = function ViewerMenu(_ref) {
|
|
|
1073
1073
|
screenType = _ref2$type === void 0 ? null : _ref2$type;
|
|
1074
1074
|
|
|
1075
1075
|
var items = React.useMemo(function () {
|
|
1076
|
-
return screens.
|
|
1077
|
-
var
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
}).map(function (it) {
|
|
1076
|
+
return screens.map(function (it) {
|
|
1077
|
+
var children = screens.filter(function (s) {
|
|
1078
|
+
return s.parentId === it.id;
|
|
1079
|
+
});
|
|
1081
1080
|
return {
|
|
1082
1081
|
screen: it,
|
|
1083
1082
|
screenId: it.id,
|
|
1084
|
-
current: screenId === it.id
|
|
1083
|
+
current: screenId === it.id || (children.find(function (c) {
|
|
1084
|
+
return c.id === screenId;
|
|
1085
|
+
}) || null) !== null,
|
|
1086
|
+
visible: ((it === null || it === void 0 ? void 0 : it.parentId) || null) === null
|
|
1085
1087
|
};
|
|
1088
|
+
}).filter(function (_ref3) {
|
|
1089
|
+
var _ref3$visible = _ref3.visible,
|
|
1090
|
+
visible = _ref3$visible === void 0 ? true : _ref3$visible;
|
|
1091
|
+
return visible;
|
|
1086
1092
|
});
|
|
1087
1093
|
}, [screens, screenId]);
|
|
1088
1094
|
var trackEvent = hooks.useTrackEvent();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/viewer",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.23",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -59,12 +59,12 @@
|
|
|
59
59
|
"@fortawesome/fontawesome-svg-core": "^1.2.32",
|
|
60
60
|
"@fortawesome/free-solid-svg-icons": "^5.15.1",
|
|
61
61
|
"@fortawesome/react-fontawesome": "^0.1.13",
|
|
62
|
-
"@micromag/core": "^0.3.
|
|
63
|
-
"@micromag/element-scroll": "^0.3.
|
|
64
|
-
"@micromag/elements": "^0.3.
|
|
65
|
-
"@micromag/fields": "^0.3.
|
|
66
|
-
"@micromag/intl": "^0.3.
|
|
67
|
-
"@micromag/screens": "^0.3.
|
|
62
|
+
"@micromag/core": "^0.3.23",
|
|
63
|
+
"@micromag/element-scroll": "^0.3.23",
|
|
64
|
+
"@micromag/elements": "^0.3.23",
|
|
65
|
+
"@micromag/fields": "^0.3.23",
|
|
66
|
+
"@micromag/intl": "^0.3.23",
|
|
67
|
+
"@micromag/screens": "^0.3.23",
|
|
68
68
|
"@react-spring/core": "^9.1.1",
|
|
69
69
|
"@react-spring/web": "^9.1.1",
|
|
70
70
|
"@use-gesture/react": "^10.2.4",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"publishConfig": {
|
|
82
82
|
"access": "public"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "0b692c48b420a885265c7d0ccdfcb207dda89e33"
|
|
85
85
|
}
|