@lvce-editor/settings-view 1.1.0 → 1.2.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/settingsViewWorkerMain.js +170 -4
- package/package.json +1 -1
|
@@ -981,6 +981,13 @@ const loadContent = async (state, savedState) => {
|
|
|
981
981
|
};
|
|
982
982
|
};
|
|
983
983
|
|
|
984
|
+
const Viewlet$1 = 'Viewlet';
|
|
985
|
+
const ClassNames = {
|
|
986
|
+
__proto__: null,
|
|
987
|
+
Viewlet: Viewlet$1};
|
|
988
|
+
const mergeClassNames = (...classNames) => {
|
|
989
|
+
return classNames.filter(Boolean).join(' ');
|
|
990
|
+
};
|
|
984
991
|
const Div = 4;
|
|
985
992
|
const H1 = 5;
|
|
986
993
|
const Text = 12;
|
|
@@ -996,10 +1003,15 @@ const text = data => {
|
|
|
996
1003
|
};
|
|
997
1004
|
};
|
|
998
1005
|
|
|
1006
|
+
const {
|
|
1007
|
+
Viewlet} = ClassNames;
|
|
1008
|
+
const Settings = 'Settings';
|
|
1009
|
+
|
|
999
1010
|
const getSettingsDom = state => {
|
|
1000
1011
|
return [{
|
|
1001
1012
|
type: VirtualDomElements.Div,
|
|
1002
|
-
childCount: 1
|
|
1013
|
+
childCount: 1,
|
|
1014
|
+
className: mergeClassNames(Viewlet, Settings)
|
|
1003
1015
|
}, {
|
|
1004
1016
|
type: VirtualDomElements.H1,
|
|
1005
1017
|
childCount: 1
|
|
@@ -1043,15 +1055,169 @@ const renderActions = () => {
|
|
|
1043
1055
|
return [];
|
|
1044
1056
|
};
|
|
1045
1057
|
|
|
1058
|
+
const HandleClickCallStackItem = 'handleClickCallStackItem';
|
|
1059
|
+
const HandleClickWatchExpression = 'handleClickWatchExpression';
|
|
1060
|
+
const HandleClickWatchExpressionDelete = 'handleClickWatchExpressionDelete';
|
|
1061
|
+
const HandleClickCheckBox = 'handleClickCheckBox';
|
|
1062
|
+
const HandleClickContinue = 'handleClickContinue';
|
|
1063
|
+
const HandleClickDebugButton = 'handleClickDebugButton';
|
|
1064
|
+
const HandleClickPause = 'handleClickPause';
|
|
1065
|
+
const HandleClickScopeValue = 'handleClickScopeValue';
|
|
1066
|
+
const HandleClickSectionBreakPoints = 'handleClickSectionBreakPoints';
|
|
1067
|
+
const HandleClickSectionCallstack = 'handleClickSectionCallstack';
|
|
1068
|
+
const HandleClickSectionHeading = 'handleClickSectionHeading';
|
|
1069
|
+
const HandleClickSectionScope = 'handleClickSectionScope';
|
|
1070
|
+
const HandleClickSectionWatch = 'handleClickSectionWatch';
|
|
1071
|
+
const HandleClickStepInto = 'handleClickStepInto';
|
|
1072
|
+
const HandleClickStepOut = 'handleClickStepOut';
|
|
1073
|
+
const HandleClickStepOver = 'handleClickStepOver';
|
|
1074
|
+
const HandleDebugInput = 'handleDebugInput';
|
|
1075
|
+
const HandleClickSectionAction = 'handleClickSectionAction';
|
|
1076
|
+
const HandleInputFieldChange = 'handleInputFieldChange';
|
|
1077
|
+
const HandleInputBlur = 'handleInputBlur';
|
|
1078
|
+
const HandleSectionHeaderContextMenu = 'handleSectionHeaderContextMenu';
|
|
1079
|
+
const HandleWatchExpressionContextMenu = 'handleWatchExpressionContextMenu';
|
|
1080
|
+
|
|
1081
|
+
// TODo use numeric ids
|
|
1082
|
+
|
|
1083
|
+
const renderEventListeners = () => {
|
|
1084
|
+
return [{
|
|
1085
|
+
name: HandleClickContinue,
|
|
1086
|
+
params: ['handleClickContinue']
|
|
1087
|
+
}, {
|
|
1088
|
+
name: HandleClickDebugButton,
|
|
1089
|
+
params: ['handleClickDebugButton', 'event.target.name']
|
|
1090
|
+
}, {
|
|
1091
|
+
name: HandleClickPause,
|
|
1092
|
+
params: ['handleClickPause']
|
|
1093
|
+
}, {
|
|
1094
|
+
name: HandleClickStepOver,
|
|
1095
|
+
params: ['handleClickStepOver']
|
|
1096
|
+
}, {
|
|
1097
|
+
name: HandleClickStepInto,
|
|
1098
|
+
params: ['handleClickStepInto']
|
|
1099
|
+
}, {
|
|
1100
|
+
name: HandleClickStepOut,
|
|
1101
|
+
params: ['handleClickStepOut']
|
|
1102
|
+
}, {
|
|
1103
|
+
name: HandleClickSectionWatch,
|
|
1104
|
+
params: ['HandleClickSectionWatch']
|
|
1105
|
+
}, {
|
|
1106
|
+
name: HandleClickSectionBreakPoints,
|
|
1107
|
+
params: ['handleClickSectionBreakpoints']
|
|
1108
|
+
}, {
|
|
1109
|
+
name: HandleClickSectionScope,
|
|
1110
|
+
params: ['handleClickSectionScope']
|
|
1111
|
+
}, {
|
|
1112
|
+
name: HandleClickSectionCallstack,
|
|
1113
|
+
params: ['handleClickSectionCallstack']
|
|
1114
|
+
}, {
|
|
1115
|
+
name: HandleClickSectionBreakPoints,
|
|
1116
|
+
params: ['handleClickSectionBreakPoints']
|
|
1117
|
+
}, {
|
|
1118
|
+
name: HandleDebugInput,
|
|
1119
|
+
params: ['handleDebugInput', 'event.target.value']
|
|
1120
|
+
}, {
|
|
1121
|
+
name: HandleClickSectionHeading,
|
|
1122
|
+
params: ['handleClickSectionHeading', 'event.target.dataset.name', 'event.button'],
|
|
1123
|
+
preventDefault: true
|
|
1124
|
+
}, {
|
|
1125
|
+
name: HandleClickCheckBox,
|
|
1126
|
+
params: ['handleClickCheckBox', 'event.target.name']
|
|
1127
|
+
}, {
|
|
1128
|
+
name: HandleClickDebugButton,
|
|
1129
|
+
params: ['handleClickDebugButton', 'event.target.name']
|
|
1130
|
+
}, {
|
|
1131
|
+
name: HandleClickCallStackItem,
|
|
1132
|
+
params: ['handleClickCallStackItem', 'event.target.dataset.index']
|
|
1133
|
+
}, {
|
|
1134
|
+
name: HandleClickWatchExpression,
|
|
1135
|
+
params: ['handleClickWatchExpression', 'event.target.dataset.index', 'event.defaultPrevented']
|
|
1136
|
+
}, {
|
|
1137
|
+
name: HandleClickWatchExpressionDelete,
|
|
1138
|
+
params: ['handleClickWatchExpressionDelete', 'event.target.dataset.index'],
|
|
1139
|
+
preventDefault: true
|
|
1140
|
+
}, {
|
|
1141
|
+
name: HandleClickScopeValue,
|
|
1142
|
+
params: ['handleClickScopeValue', 'event.target.dataset.index', 'event.button']
|
|
1143
|
+
}, {
|
|
1144
|
+
name: HandleInputFieldChange,
|
|
1145
|
+
params: ['handleInputFieldChange', 'event.target.name', 'event.target.value']
|
|
1146
|
+
}, {
|
|
1147
|
+
name: HandleClickSectionAction,
|
|
1148
|
+
params: ['handleClickSectionAction', 'event.target.name']
|
|
1149
|
+
}, {
|
|
1150
|
+
name: HandleInputBlur,
|
|
1151
|
+
params: ['handleInputBlur']
|
|
1152
|
+
}, {
|
|
1153
|
+
name: HandleSectionHeaderContextMenu,
|
|
1154
|
+
params: ['handleSectionHeaderContextMenu', 'event.clientX', 'event.clientY', 'event.target.dataset.name'],
|
|
1155
|
+
preventDefault: true
|
|
1156
|
+
}, {
|
|
1157
|
+
name: HandleWatchExpressionContextMenu,
|
|
1158
|
+
params: ['handleWatchExpressionContextMenu', 'event.clientX', 'event.clientY', 'event.target.dataset.index'],
|
|
1159
|
+
preventDefault: true
|
|
1160
|
+
}];
|
|
1161
|
+
};
|
|
1162
|
+
|
|
1163
|
+
const getSavedMinLineY = savedState => {
|
|
1164
|
+
if (savedState && typeof savedState === 'object' && 'minLineY' in savedState && typeof savedState.minLineY === 'number') {
|
|
1165
|
+
return savedState.minLineY;
|
|
1166
|
+
}
|
|
1167
|
+
return 0;
|
|
1168
|
+
};
|
|
1169
|
+
const getSavedDeltaY = savedState => {
|
|
1170
|
+
if (savedState && typeof savedState === 'object' && 'deltaY' in savedState && typeof savedState.deltaY === 'number') {
|
|
1171
|
+
return savedState.deltaY;
|
|
1172
|
+
}
|
|
1173
|
+
return 0;
|
|
1174
|
+
};
|
|
1175
|
+
const getSavedWorkspacePath = savedState => {
|
|
1176
|
+
if (savedState && typeof savedState === 'object' && 'workspacePath' in savedState && typeof savedState.workspacePath === 'string') {
|
|
1177
|
+
return savedState.workspacePath;
|
|
1178
|
+
}
|
|
1179
|
+
return '';
|
|
1180
|
+
};
|
|
1181
|
+
const restoreState = savedState => {
|
|
1182
|
+
if (!savedState) {
|
|
1183
|
+
return {
|
|
1184
|
+
root: '',
|
|
1185
|
+
minLineY: 0,
|
|
1186
|
+
deltaY: 0
|
|
1187
|
+
};
|
|
1188
|
+
}
|
|
1189
|
+
const root = getSavedWorkspacePath(savedState);
|
|
1190
|
+
const minLineY = getSavedMinLineY(savedState);
|
|
1191
|
+
const deltaY = getSavedDeltaY(savedState);
|
|
1192
|
+
return {
|
|
1193
|
+
root,
|
|
1194
|
+
minLineY,
|
|
1195
|
+
deltaY
|
|
1196
|
+
};
|
|
1197
|
+
};
|
|
1198
|
+
|
|
1199
|
+
const saveState = uid => {
|
|
1200
|
+
return {
|
|
1201
|
+
expandedPaths: [],
|
|
1202
|
+
root: '',
|
|
1203
|
+
minLineY: 0,
|
|
1204
|
+
maxLineY: 0,
|
|
1205
|
+
deltaY: 0
|
|
1206
|
+
};
|
|
1207
|
+
};
|
|
1208
|
+
|
|
1046
1209
|
const commandMap = {
|
|
1047
1210
|
'Initialize.initialize': initialize,
|
|
1048
1211
|
'Settings.create': create$1,
|
|
1049
|
-
'Settings.getCommandIds': getCommandIds,
|
|
1050
|
-
'Settings.terminate': terminate,
|
|
1051
1212
|
'Settings.diff2': diff2,
|
|
1213
|
+
'Settings.getCommandIds': getCommandIds,
|
|
1052
1214
|
'Settings.loadContent': wrapCommand(loadContent),
|
|
1215
|
+
'Settings.render2': render2,
|
|
1053
1216
|
'Settings.renderActions': renderActions,
|
|
1054
|
-
'Settings.
|
|
1217
|
+
'Settings.renderEventListeners': renderEventListeners,
|
|
1218
|
+
'Settings.restoreState': restoreState,
|
|
1219
|
+
'Settings.saveState': saveState,
|
|
1220
|
+
'Settings.terminate': terminate
|
|
1055
1221
|
};
|
|
1056
1222
|
|
|
1057
1223
|
const rpcs = Object.create(null);
|