@lvce-editor/panel-worker 1.10.0 → 1.11.0
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/dist/panelWorkerMain.js +18 -2
- package/package.json +1 -1
package/dist/panelWorkerMain.js
CHANGED
|
@@ -1093,15 +1093,20 @@ const create = (uid, uri, x, y, width, height, platform, assetDir) => {
|
|
|
1093
1093
|
set(uid, state, state);
|
|
1094
1094
|
};
|
|
1095
1095
|
|
|
1096
|
+
const isEqual$1 = (oldState, newState) => {
|
|
1097
|
+
return oldState.childUid === newState.childUid;
|
|
1098
|
+
};
|
|
1099
|
+
|
|
1096
1100
|
const isEqual = (oldState, newState) => {
|
|
1097
1101
|
return oldState.assetDir === newState.assetDir && oldState.initial === newState.initial && oldState.currentViewletId === newState.currentViewletId && oldState.selectedIndex === newState.selectedIndex && oldState.views === newState.views && oldState.childUid === newState.childUid && oldState.actionsUid === newState.actionsUid;
|
|
1098
1102
|
};
|
|
1099
1103
|
|
|
1100
1104
|
const RenderItems = 4;
|
|
1101
1105
|
const RenderIncremental = 11;
|
|
1106
|
+
const RenderChildUid = 12;
|
|
1102
1107
|
|
|
1103
|
-
const modules = [isEqual];
|
|
1104
|
-
const numbers = [RenderIncremental];
|
|
1108
|
+
const modules = [isEqual, isEqual$1];
|
|
1109
|
+
const numbers = [RenderIncremental, RenderChildUid];
|
|
1105
1110
|
|
|
1106
1111
|
const diff = (oldState, newState) => {
|
|
1107
1112
|
const diffResult = [];
|
|
@@ -1241,6 +1246,15 @@ const toggleView = async (state, name) => {
|
|
|
1241
1246
|
return selectIndex(state, index);
|
|
1242
1247
|
};
|
|
1243
1248
|
|
|
1249
|
+
// TODO also need to dispose child when panel becomes hidden
|
|
1250
|
+
const renderChildUid = (oldState, newState) => {
|
|
1251
|
+
const oldChildUid = oldState.childUid;
|
|
1252
|
+
if (oldChildUid <= 0 || oldChildUid === newState.childUid) {
|
|
1253
|
+
return [];
|
|
1254
|
+
}
|
|
1255
|
+
return ['Viewlet.dispose', oldChildUid];
|
|
1256
|
+
};
|
|
1257
|
+
|
|
1244
1258
|
const mergeClassNames = (...classNames) => {
|
|
1245
1259
|
return classNames.filter(Boolean).join(' ');
|
|
1246
1260
|
};
|
|
@@ -1720,6 +1734,8 @@ const renderIncremental = (oldState, newState) => {
|
|
|
1720
1734
|
|
|
1721
1735
|
const getRenderer = diffType => {
|
|
1722
1736
|
switch (diffType) {
|
|
1737
|
+
case RenderChildUid:
|
|
1738
|
+
return renderChildUid;
|
|
1723
1739
|
case RenderIncremental:
|
|
1724
1740
|
return renderIncremental;
|
|
1725
1741
|
case RenderItems:
|