@lvce-editor/settings-view 2.1.0 → 2.3.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.
@@ -54,6 +54,49 @@ class VError extends Error {
54
54
  }
55
55
  }
56
56
 
57
+ class AssertionError extends Error {
58
+ constructor(message) {
59
+ super(message);
60
+ this.name = 'AssertionError';
61
+ }
62
+ }
63
+ const Object$1 = 1;
64
+ const Number$2 = 2;
65
+ const Array$1 = 3;
66
+ const String$1 = 4;
67
+ const Boolean$2 = 5;
68
+ const Function = 6;
69
+ const Null = 7;
70
+ const Unknown = 8;
71
+ const getType = value => {
72
+ switch (typeof value) {
73
+ case 'number':
74
+ return Number$2;
75
+ case 'function':
76
+ return Function;
77
+ case 'string':
78
+ return String$1;
79
+ case 'object':
80
+ if (value === null) {
81
+ return Null;
82
+ }
83
+ if (Array.isArray(value)) {
84
+ return Array$1;
85
+ }
86
+ return Object$1;
87
+ case 'boolean':
88
+ return Boolean$2;
89
+ default:
90
+ return Unknown;
91
+ }
92
+ };
93
+ const number = value => {
94
+ const type = getType(value);
95
+ if (type !== Number$2) {
96
+ throw new AssertionError('expected value to be of type number');
97
+ }
98
+ };
99
+
57
100
  const isMessagePort = value => {
58
101
  return value && value instanceof MessagePort;
59
102
  };
@@ -182,8 +225,8 @@ const getModuleNotFoundError = stderr => {
182
225
  const messageIndex = lines.findIndex(isModuleNotFoundMessage);
183
226
  const message = lines[messageIndex];
184
227
  return {
185
- message,
186
- code: ERR_MODULE_NOT_FOUND
228
+ code: ERR_MODULE_NOT_FOUND,
229
+ message
187
230
  };
188
231
  };
189
232
  const isModuleNotFoundError = stderr => {
@@ -206,14 +249,14 @@ const isUnhelpfulNativeModuleError = stderr => {
206
249
  const getNativeModuleErrorMessage = stderr => {
207
250
  const message = getMessageCodeBlock(stderr);
208
251
  return {
209
- message: `Incompatible native node module: ${message}`,
210
- code: E_INCOMPATIBLE_NATIVE_MODULE
252
+ code: E_INCOMPATIBLE_NATIVE_MODULE,
253
+ message: `Incompatible native node module: ${message}`
211
254
  };
212
255
  };
213
256
  const getModuleSyntaxError = () => {
214
257
  return {
215
- message: `ES Modules are not supported in electron`,
216
- code: E_MODULES_NOT_SUPPORTED_IN_ELECTRON
258
+ code: E_MODULES_NOT_SUPPORTED_IN_ELECTRON,
259
+ message: `ES Modules are not supported in electron`
217
260
  };
218
261
  };
219
262
  const getHelpfulChildProcessError = (stdout, stderr) => {
@@ -232,8 +275,8 @@ const getHelpfulChildProcessError = (stdout, stderr) => {
232
275
  rest
233
276
  } = getDetails(lines);
234
277
  return {
235
- message: actualMessage,
236
278
  code: '',
279
+ message: actualMessage,
237
280
  stack: rest
238
281
  };
239
282
  };
@@ -243,8 +286,8 @@ class IpcError extends VError {
243
286
  if (stdout || stderr) {
244
287
  // @ts-ignore
245
288
  const {
246
- message,
247
289
  code,
290
+ message,
248
291
  stack
249
292
  } = getHelpfulChildProcessError(stdout, stderr);
250
293
  const cause = new Error(message);
@@ -305,8 +348,8 @@ const wrap$f = global => {
305
348
  };
306
349
  const waitForFirstMessage = async port => {
307
350
  const {
308
- resolve,
309
- promise
351
+ promise,
352
+ resolve
310
353
  } = Promise.withResolvers();
311
354
  port.addEventListener('message', resolve, {
312
355
  once: true
@@ -326,8 +369,8 @@ const listen$6 = async () => {
326
369
  const type = firstMessage.params[0];
327
370
  if (type === 'message-port') {
328
371
  parentIpc.send({
329
- jsonrpc: '2.0',
330
372
  id: firstMessage.id,
373
+ jsonrpc: '2.0',
331
374
  result: null
332
375
  });
333
376
  parentIpc.dispose();
@@ -889,10 +932,11 @@ const create$2 = () => {
889
932
  wrapCommand(fn) {
890
933
  const wrapped = async (uid, ...args) => {
891
934
  const {
935
+ oldState,
892
936
  newState
893
937
  } = states[uid];
894
938
  const newerState = await fn(newState, ...args);
895
- if (newState === newerState) {
939
+ if (oldState === newerState || newState === newerState) {
896
940
  return;
897
941
  }
898
942
  const latest = states[uid];
@@ -1016,7 +1060,7 @@ const getFilteredItems = (items, tabs, searchValue, modifiedSettings, preference
1016
1060
  };
1017
1061
 
1018
1062
  const User = 1;
1019
- const Script = 2;
1063
+ const Script$1 = 2;
1020
1064
 
1021
1065
  const FocusSettingsInput = 2199;
1022
1066
 
@@ -1047,8 +1091,8 @@ const clear$1 = state => {
1047
1091
  deltaY: 0,
1048
1092
  filteredItems,
1049
1093
  focus: FocusSettingsInput,
1050
- focusSource: Script,
1051
- inputSource: Script,
1094
+ focusSource: Script$1,
1095
+ inputSource: Script$1,
1052
1096
  maxLineY,
1053
1097
  minLineY,
1054
1098
  scrollBarThumbHeight: thumbHeight,
@@ -1102,6 +1146,8 @@ const create$1 = (id, uri, x, y, width, height) => {
1102
1146
  scrollBarThumbTop: 0,
1103
1147
  scrollOffset: 0,
1104
1148
  searchValue: '',
1149
+ sideBarMinWidth: 100,
1150
+ sideBarWidth: 0,
1105
1151
  tabs: [],
1106
1152
  uri,
1107
1153
  visibleItems: [],
@@ -1112,6 +1158,10 @@ const create$1 = (id, uri, x, y, width, height) => {
1112
1158
  set$3(id, state, state);
1113
1159
  };
1114
1160
 
1161
+ const isEqual$5 = (oldState, newState) => {
1162
+ return oldState.sideBarWidth === newState.sideBarWidth;
1163
+ };
1164
+
1115
1165
  const isEqual$4 = (oldState, newState) => {
1116
1166
  return oldState.focus === newState.focus;
1117
1167
  };
@@ -1134,13 +1184,14 @@ const RenderValue = 3;
1134
1184
  const RenderSettingValues = 10;
1135
1185
  const RenderScrollOffset = 11;
1136
1186
  const RenderFocusContext = 12;
1187
+ const RenderCss = 13;
1137
1188
 
1138
1189
  const isEqual = (oldState, newState) => {
1139
1190
  return newState.inputSource === User || oldState.searchValue === newState.searchValue;
1140
1191
  };
1141
1192
 
1142
- const modules = [isEqual$3, isEqual, isEqual$1, isEqual$2, isEqual$4, isEqual$4];
1143
- const numbers = [RenderItems, RenderValue, RenderSettingValues, RenderScrollOffset, RenderFocus, RenderFocusContext];
1193
+ const modules = [isEqual$3, isEqual, isEqual$1, isEqual$2, isEqual$4, isEqual$4, isEqual$5];
1194
+ const numbers = [RenderItems, RenderValue, RenderSettingValues, RenderScrollOffset, RenderFocus, RenderFocusContext, RenderCss];
1144
1195
 
1145
1196
  const diff = (oldState, newState) => {
1146
1197
  const diffResult = [];
@@ -1176,7 +1227,7 @@ const AdditionalDetails = 'AdditionalDetails';
1176
1227
  const AdditionalDetailsEntry = 'AdditionalDetailsEntry';
1177
1228
  const AdditionalDetailsTitle = 'AdditionalDetailsTitle';
1178
1229
  const Aside$1 = 'Aside';
1179
- const Badge$1 = 'Badge';
1230
+ const Badge = 'Badge';
1180
1231
  const Button$1 = 'Button';
1181
1232
  const ButtonPrimary = 'ButtonPrimary';
1182
1233
  const CallStackArrow = 'CallStackArrow';
@@ -1412,7 +1463,7 @@ const ClassNames = {
1412
1463
  AdditionalDetailsEntry,
1413
1464
  AdditionalDetailsTitle,
1414
1465
  Aside: Aside$1,
1415
- Badge: Badge$1,
1466
+ Badge,
1416
1467
  Button: Button$1,
1417
1468
  ButtonPrimary,
1418
1469
  CallStackArrow,
@@ -1658,9 +1709,6 @@ const Label$1 = 66;
1658
1709
  const UpArrow = 14;
1659
1710
  const DownArrow = 16;
1660
1711
 
1661
- const DebugWorker = 55;
1662
- const RendererWorker$1 = 1;
1663
-
1664
1712
  const mergeClassNames = (...classNames) => {
1665
1713
  return classNames.filter(Boolean).join(' ');
1666
1714
  };
@@ -1875,6 +1923,25 @@ const handleInputFocus = state => {
1875
1923
  };
1876
1924
  };
1877
1925
 
1926
+ const handleResizerPointerDown = (state, eventX, eventY) => {
1927
+ return state;
1928
+ };
1929
+
1930
+ const handleResizerPointerMove = (state, eventX, eventY) => {
1931
+ const {
1932
+ sideBarMinWidth
1933
+ } = state;
1934
+ const newWidth = Math.max(eventX, sideBarMinWidth);
1935
+ return {
1936
+ ...state,
1937
+ sideBarWidth: newWidth
1938
+ };
1939
+ };
1940
+
1941
+ const handleResizerPointerUp = (state, eventX, eventY) => {
1942
+ return state;
1943
+ };
1944
+
1878
1945
  const handleScroll = (state, scrollTop, inputSource = User) => {
1879
1946
  return {
1880
1947
  ...state,
@@ -2022,6 +2089,19 @@ const getModifiedSettings = preferences => {
2022
2089
  return modifiedSettings;
2023
2090
  };
2024
2091
 
2092
+ const ClientX = 'event.clientX';
2093
+ const ClientY = 'event.clientY';
2094
+ const DeltaY = 'event.deltaY';
2095
+ const TargetName = 'event.target.name';
2096
+ const TargetValue = 'event.target.value';
2097
+
2098
+ const Script = 2;
2099
+
2100
+ const DebugWorker = 55;
2101
+ const RendererWorker$1 = 1;
2102
+
2103
+ const SetCss = 'Viewlet.setCss';
2104
+
2025
2105
  const rpcs = Object.create(null);
2026
2106
  const set$2 = (id, rpc) => {
2027
2107
  rpcs[id] = rpc;
@@ -2032,6 +2112,10 @@ const get = id => {
2032
2112
 
2033
2113
  const create = rpcId => {
2034
2114
  return {
2115
+ async dispose() {
2116
+ const rpc = get(rpcId);
2117
+ await rpc.dispose();
2118
+ },
2035
2119
  // @ts-ignore
2036
2120
  invoke(method, ...params) {
2037
2121
  const rpc = get(rpcId);
@@ -2046,19 +2130,15 @@ const create = rpcId => {
2046
2130
  },
2047
2131
  set(rpc) {
2048
2132
  set$2(rpcId, rpc);
2049
- },
2050
- async dispose() {
2051
- const rpc = get(rpcId);
2052
- await rpc.dispose();
2053
2133
  }
2054
2134
  };
2055
2135
  };
2056
2136
 
2057
2137
  const {
2138
+ dispose,
2058
2139
  invoke,
2059
2140
  invokeAndTransfer,
2060
- set: set$1,
2061
- dispose
2141
+ set: set$1
2062
2142
  } = create(RendererWorker$1);
2063
2143
  const searchFileHtml = async uri => {
2064
2144
  return invoke('ExtensionHost.searchFileWithHtml', uri);
@@ -2066,9 +2146,20 @@ const searchFileHtml = async uri => {
2066
2146
  const getFilePathElectron = async file => {
2067
2147
  return invoke('FileSystemHandle.getFilePathElectron', file);
2068
2148
  };
2149
+ /**
2150
+ * @deprecated
2151
+ */
2069
2152
  const showContextMenu = async (x, y, id, ...args) => {
2070
2153
  return invoke('ContextMenu.show', x, y, id, ...args);
2071
2154
  };
2155
+ const showContextMenu2 = async (uid, menuId, x, y, args) => {
2156
+ number(uid);
2157
+ number(menuId);
2158
+ number(x);
2159
+ number(y);
2160
+ // @ts-ignore
2161
+ await invoke('ContextMenu.show2', uid, menuId, x, y, args);
2162
+ };
2072
2163
  const getElectronVersion = async () => {
2073
2164
  return invoke('Process.getElectronVersion');
2074
2165
  };
@@ -2160,6 +2251,9 @@ const handleDebugChange = async params => {
2160
2251
  const getFolderIcon = async options => {
2161
2252
  return invoke('IconTheme.getFolderIcon', options);
2162
2253
  };
2254
+ const handleWorkspaceRefresh = async () => {
2255
+ return invoke('Layout.handleWorkspaceRefresh');
2256
+ };
2163
2257
  const closeWidget = async widgetId => {
2164
2258
  return invoke('Viewlet.closeWidget', widgetId);
2165
2259
  };
@@ -2184,6 +2278,9 @@ const getKeyBindings = async () => {
2184
2278
  const writeClipBoardText = async text => {
2185
2279
  await invoke('ClipBoard.writeText', /* text */text);
2186
2280
  };
2281
+ const readClipBoardText = async () => {
2282
+ return invoke('ClipBoard.readText');
2283
+ };
2187
2284
  const writeClipBoardImage = async blob => {
2188
2285
  // @ts-ignore
2189
2286
  await invoke('ClipBoard.writeImage', /* text */blob);
@@ -2208,8 +2305,8 @@ const getIcons = async requests => {
2208
2305
  const icons = await invoke('IconTheme.getIcons', requests);
2209
2306
  return icons;
2210
2307
  };
2211
- const activateByEvent = event => {
2212
- return invoke('ExtensionHostManagement.activateByEvent', event);
2308
+ const activateByEvent = (event, assetDir, platform) => {
2309
+ return invoke('ExtensionHostManagement.activateByEvent', event, assetDir, platform);
2213
2310
  };
2214
2311
  const setAdditionalFocus = focusKey => {
2215
2312
  // @ts-ignore
@@ -2227,6 +2324,33 @@ const sendMessagePortToRendererProcess = async port => {
2227
2324
  // @ts-ignore
2228
2325
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToRendererProcess', port, command, DebugWorker);
2229
2326
  };
2327
+ const sendMessagePortToTextMeasurementWorker = async port => {
2328
+ const command = 'TextMeasurement.handleMessagePort';
2329
+ // @ts-ignore
2330
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToTextMeasurementWorker', port, command, 0);
2331
+ };
2332
+ const sendMessagePortToSourceControlWorker = async port => {
2333
+ const command = 'SourceControl.handleMessagePort';
2334
+ // @ts-ignore
2335
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSourceControlWorker', port, command, 0);
2336
+ };
2337
+ const sendMessagePortToSharedProcess = async port => {
2338
+ const command = 'HandleElectronMessagePort.handleElectronMessagePort';
2339
+ // @ts-ignore
2340
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, command, 0);
2341
+ };
2342
+ const sendMessagePortToFileSystemProcess = async (port, rpcId) => {
2343
+ const command = 'HandleMessagePortForFileSystemProcess.handleMessagePortForFileSystemProcess';
2344
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, command, rpcId);
2345
+ };
2346
+ const sendMessagePortToIframeWorker = async (port, rpcId) => {
2347
+ const command = 'Iframes.handleMessagePort';
2348
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToIframeWorker', port, command, rpcId);
2349
+ };
2350
+ const sendMessagePortToExtensionManagementWorker = async (port, rpcId) => {
2351
+ const command = 'Extensions.handleMessagePort';
2352
+ await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionManagementWorker', port, command, rpcId);
2353
+ };
2230
2354
  const getPreference = async key => {
2231
2355
  return await invoke('Preferences.get', key);
2232
2356
  };
@@ -2292,13 +2416,29 @@ const installExtension = async id => {
2292
2416
  // @ts-ignore
2293
2417
  return invoke('ExtensionManagement.install', id);
2294
2418
  };
2419
+ const minimizeWindow = async () => {
2420
+ // @ts-ignore
2421
+ return invoke('ElectronWindow.minimize');
2422
+ };
2423
+ const unmaximizeWindow = async () => {
2424
+ // @ts-ignore
2425
+ return invoke('ElectronWindow.unmaximize');
2426
+ };
2427
+ const maximizeWindow = async () => {
2428
+ // @ts-ignore
2429
+ return invoke('ElectronWindow.maximize');
2430
+ };
2431
+ const closeWindow = async () => {
2432
+ // @ts-ignore
2433
+ return invoke('ElectronWindow.close');
2434
+ };
2295
2435
  const openExtensionSearch = async () => {
2296
2436
  // @ts-ignore
2297
2437
  return invoke('SideBar.openViewlet', 'Extensions');
2298
2438
  };
2299
2439
  const setExtensionsSearchValue = async searchValue => {
2300
2440
  // @ts-ignore
2301
- return invoke('Extensions.handleInput', searchValue);
2441
+ return invoke('Extensions.handleInput', searchValue, Script);
2302
2442
  };
2303
2443
  const openExternal = async uri => {
2304
2444
  // @ts-ignore
@@ -2320,6 +2460,9 @@ const getLogsDir = async () => {
2320
2460
  // @ts-ignore
2321
2461
  return invoke('PlatformPaths.getLogsDir');
2322
2462
  };
2463
+ const measureTextBlockHeight = async (actualInput, fontFamily, fontSize, lineHeightPx, width) => {
2464
+ return invoke(`MeasureTextHeight.measureTextBlockHeight`, actualInput, fontFamily, fontSize, lineHeightPx, width);
2465
+ };
2323
2466
  const registerMockRpc = commandMap => {
2324
2467
  const mockRpc = createMockRpc({
2325
2468
  commandMap
@@ -2333,6 +2476,7 @@ const RendererWorker = {
2333
2476
  activateByEvent,
2334
2477
  applyBulkReplacement,
2335
2478
  closeWidget,
2479
+ closeWindow,
2336
2480
  confirm,
2337
2481
  disableExtension,
2338
2482
  dispose,
@@ -2366,15 +2510,20 @@ const RendererWorker = {
2366
2510
  handleDebugPaused,
2367
2511
  handleDebugResumed,
2368
2512
  handleDebugScriptParsed,
2513
+ handleWorkspaceRefresh,
2369
2514
  installExtension,
2370
2515
  invoke,
2371
2516
  invokeAndTransfer,
2517
+ maximizeWindow,
2518
+ measureTextBlockHeight,
2519
+ minimizeWindow,
2372
2520
  openExtensionSearch,
2373
2521
  openExternal,
2374
2522
  openNativeFolder,
2375
2523
  openUri,
2376
2524
  openUrl,
2377
2525
  openWidget,
2526
+ readClipBoardText,
2378
2527
  readFile,
2379
2528
  registerMockRpc,
2380
2529
  registerWebViewInterceptor,
@@ -2386,12 +2535,18 @@ const RendererWorker = {
2386
2535
  sendMessagePortToEditorWorker,
2387
2536
  sendMessagePortToErrorWorker,
2388
2537
  sendMessagePortToExtensionHostWorker,
2538
+ sendMessagePortToExtensionManagementWorker,
2539
+ sendMessagePortToFileSystemProcess,
2389
2540
  sendMessagePortToFileSystemWorker,
2390
2541
  sendMessagePortToIconThemeWorker,
2542
+ sendMessagePortToIframeWorker,
2391
2543
  sendMessagePortToMarkdownWorker,
2392
2544
  sendMessagePortToRendererProcess,
2393
2545
  sendMessagePortToSearchProcess,
2546
+ sendMessagePortToSharedProcess,
2547
+ sendMessagePortToSourceControlWorker,
2394
2548
  sendMessagePortToSyntaxHighlightingWorker,
2549
+ sendMessagePortToTextMeasurementWorker,
2395
2550
  set: set$1,
2396
2551
  setAdditionalFocus,
2397
2552
  setColorTheme,
@@ -2400,10 +2555,12 @@ const RendererWorker = {
2400
2555
  setWebViewPort,
2401
2556
  setWorkspacePath,
2402
2557
  showContextMenu,
2558
+ showContextMenu2,
2403
2559
  showErrorDialog,
2404
2560
  showMessageBox,
2405
2561
  showSaveFilePicker,
2406
2562
  uninstallExtension,
2563
+ unmaximizeWindow,
2407
2564
  unregisterWebViewInterceptor,
2408
2565
  writeClipBoardImage,
2409
2566
  writeClipBoardText
@@ -4645,7 +4802,7 @@ const loadContent = async (state, savedState) => {
4645
4802
  filteredItems,
4646
4803
  history,
4647
4804
  historyIndex,
4648
- inputSource: Script,
4805
+ inputSource: Script$1,
4649
4806
  items,
4650
4807
  maxLineY,
4651
4808
  minLineY,
@@ -4655,11 +4812,32 @@ const loadContent = async (state, savedState) => {
4655
4812
  scrollBarThumbTop: thumbTop,
4656
4813
  scrollOffset,
4657
4814
  searchValue,
4815
+ sideBarWidth: 200,
4658
4816
  tabs: newTabs,
4659
4817
  visibleItems
4660
4818
  };
4661
4819
  };
4662
4820
 
4821
+ const getCss = sideBarWidth => {
4822
+ return `
4823
+ .Settings {
4824
+ --SettingsSideBarWidth: ${sideBarWidth}px;
4825
+ }
4826
+ .SettingsResizer {
4827
+ color: yellow;
4828
+ }
4829
+ `;
4830
+ };
4831
+
4832
+ const renderCss = (oldState, newState) => {
4833
+ const {
4834
+ id,
4835
+ sideBarWidth
4836
+ } = newState;
4837
+ const css = getCss(sideBarWidth);
4838
+ return [SetCss, id, css];
4839
+ };
4840
+
4663
4841
  const renderFocus = (oldState, newState) => {
4664
4842
  const {
4665
4843
  id
@@ -4676,15 +4854,17 @@ const renderFocusContext = (oldState, newState) => {
4676
4854
  const {
4677
4855
  Viewlet
4678
4856
  } = ClassNames;
4679
- const Badge = 'Badge';
4680
4857
  const CheckBox = 'CheckBox';
4681
4858
  const ErrorMessage = 'ErrorMessage';
4682
4859
  const InputBox = 'InputBox';
4683
4860
  const InputBoxError = 'InputBoxError';
4861
+ const InputBadge = 'InputBadge';
4684
4862
  const Label = 'Label';
4685
4863
  const MaskIcon = 'MaskIcon';
4686
4864
  const MaskIconClearAll = 'MaskIconClearAll';
4687
4865
  const ModifiedIndicator = 'ModifiedIndicator';
4866
+ const Resizer = 'Resizer';
4867
+ const ResizerHighlight = 'ResizerHighlight';
4688
4868
  const SearchFieldButton = 'SearchFieldButton';
4689
4869
  const Select = 'Select';
4690
4870
  const Settings = 'Settings';
@@ -4715,7 +4895,7 @@ const getSettingsInputBadgeDom = (filteredSettingsCount, hasSearchValue) => {
4715
4895
  const badgeText = matchingSettings(filteredSettingsCount);
4716
4896
  return [{
4717
4897
  childCount: 1,
4718
- className: Badge,
4898
+ className: InputBadge,
4719
4899
  type: Div
4720
4900
  }, text(badgeText)];
4721
4901
  };
@@ -4729,6 +4909,9 @@ const HandleSettingChecked = 'handleSettingChecked';
4729
4909
  const HandleWheel = 'handleWheel';
4730
4910
  const HandleSettingSelect = 'handleSettingSelect';
4731
4911
  const HandleInputFocus = 'handleInputFocus';
4912
+ const HandleResizerPointerDown = 'handleResizerPointerDown';
4913
+ const HandleResizerPointerMove = 'handleResizerPointerMove';
4914
+ const HandleResizerPointerUp = 'handleResizerPointerUp';
4732
4915
 
4733
4916
  const enabledClass = SearchFieldButton;
4734
4917
  const disabledClass = mergeClassNames(enabledClass, 'SearchFieldButtonDisabled');
@@ -4789,6 +4972,19 @@ const getSettingsHeaderDom = (filteredSettingsCount, hasSearchValue) => {
4789
4972
  }, ...getSettingsInputDom(), ...getSettingsInputBadgeDom(filteredSettingsCount, hasSearchValue), ...getSettingsInputButtonsDom(hasSearchValue)];
4790
4973
  };
4791
4974
 
4975
+ const getResizerVirtualDom = () => {
4976
+ return [{
4977
+ childCount: 1,
4978
+ className: mergeClassNames(Resizer, 'SettingsResizer'),
4979
+ onPointerDown: HandleResizerPointerDown,
4980
+ type: Div
4981
+ }, {
4982
+ childCount: 0,
4983
+ className: ResizerHighlight,
4984
+ type: Div
4985
+ }];
4986
+ };
4987
+
4792
4988
  const getContentHeadingDom = headerText => {
4793
4989
  return [{
4794
4990
  childCount: 1,
@@ -5170,10 +5366,10 @@ const getSettingsSideBarDom = tabs => {
5170
5366
 
5171
5367
  const getSettingsMainDom = (tabs, visibleItems, totalItemCount, searchValue, thumbHeight, thumbTop) => {
5172
5368
  return [{
5173
- childCount: 2,
5369
+ childCount: 3,
5174
5370
  className: SettingsMain,
5175
5371
  type: Div
5176
- }, ...getSettingsSideBarDom(tabs), ...getSettingsContentDom(visibleItems, tabs, searchValue, thumbHeight, thumbTop)];
5372
+ }, ...getSettingsSideBarDom(tabs), ...getResizerVirtualDom(), ...getSettingsContentDom(visibleItems, tabs, searchValue, thumbHeight, thumbTop)];
5177
5373
  };
5178
5374
 
5179
5375
  const parentNode = {
@@ -5238,6 +5434,8 @@ const renderValue = (oldState, newState) => {
5238
5434
 
5239
5435
  const getRenderer = diffType => {
5240
5436
  switch (diffType) {
5437
+ case RenderCss:
5438
+ return renderCss;
5241
5439
  case RenderFocus:
5242
5440
  return renderFocus;
5243
5441
  case RenderFocusContext:
@@ -5281,19 +5479,19 @@ const renderActions = () => {
5281
5479
  const renderEventListeners = () => {
5282
5480
  return [{
5283
5481
  name: HandleClickTab,
5284
- params: ['handleClickTab', 'event.target.name']
5482
+ params: ['handleClickTab', TargetName]
5285
5483
  }, {
5286
5484
  name: HandleInput,
5287
- params: ['handleInput', 'event.target.value']
5485
+ params: ['handleInput', TargetValue]
5288
5486
  }, {
5289
5487
  name: HandleClickClear,
5290
5488
  params: ['clear']
5291
5489
  }, {
5292
5490
  name: HandleSettingInput,
5293
- params: ['handleSettingInput', 'event.target.name', 'event.target.value']
5491
+ params: ['handleSettingInput', TargetName, TargetValue]
5294
5492
  }, {
5295
5493
  name: HandleSettingChecked,
5296
- params: ['handleSettingChecked', 'event.target.name', 'event.target.value']
5494
+ params: ['handleSettingChecked', TargetName, TargetValue]
5297
5495
  },
5298
5496
  // {
5299
5497
  // name: DomEventListenerFunctions.HandleScroll,
@@ -5302,14 +5500,25 @@ const renderEventListeners = () => {
5302
5500
  // },
5303
5501
  {
5304
5502
  name: HandleWheel,
5305
- params: ['handleWheel', 'event.deltaY'],
5503
+ params: ['handleWheel', DeltaY],
5306
5504
  passive: true
5307
5505
  }, {
5308
5506
  name: HandleSettingSelect,
5309
- params: ['handleSettingSelect', 'event.target.name', 'event.target.value']
5507
+ params: ['handleSettingSelect', TargetName, TargetValue]
5310
5508
  }, {
5311
5509
  name: HandleInputFocus,
5312
5510
  params: ['handleInputFocus']
5511
+ }, {
5512
+ name: HandleResizerPointerDown,
5513
+ params: ['handleResizerPointerDown', ClientX, ClientY],
5514
+ // @ts-ignore
5515
+ trackPointerEvents: [HandleResizerPointerMove, HandleResizerPointerUp]
5516
+ }, {
5517
+ name: HandleResizerPointerMove,
5518
+ params: ['handleResizerPointerMove', ClientX, ClientY]
5519
+ }, {
5520
+ name: HandleResizerPointerUp,
5521
+ params: ['handleResizerPointerUp', ClientX, ClientY]
5313
5522
  }];
5314
5523
  };
5315
5524
 
@@ -5355,7 +5564,7 @@ const useNextSearchValue = state => {
5355
5564
  ...state,
5356
5565
  filteredItems,
5357
5566
  historyIndex: newHistoryIndex,
5358
- inputSource: Script,
5567
+ inputSource: Script$1,
5359
5568
  searchValue: newSearchValue
5360
5569
  };
5361
5570
  };
@@ -5379,7 +5588,7 @@ const usePreviousSearchValue = state => {
5379
5588
  ...state,
5380
5589
  filteredItems,
5381
5590
  historyIndex: newHistoryIndex,
5382
- inputSource: Script,
5591
+ inputSource: Script$1,
5383
5592
  searchValue: newSearchValue
5384
5593
  };
5385
5594
  };
@@ -5397,6 +5606,9 @@ const commandMap = {
5397
5606
  'Settings.handleInput': wrapCommand(handleInput),
5398
5607
  'Settings.handleInputBlur': wrapCommand(handleInputBlur),
5399
5608
  'Settings.handleInputFocus': wrapCommand(handleInputFocus),
5609
+ 'Settings.handleResizerPointerDown': wrapCommand(handleResizerPointerDown),
5610
+ 'Settings.handleResizerPointerMove': wrapCommand(handleResizerPointerMove),
5611
+ 'Settings.handleResizerPointerUp': wrapCommand(handleResizerPointerUp),
5400
5612
  'Settings.handleScroll': wrapCommand(handleScroll),
5401
5613
  'Settings.handleSettingChecked': wrapCommand(handleSettingChecked),
5402
5614
  'Settings.handleSettingInput': wrapCommand(handleSettingInput),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/settings-view",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
4
4
  "description": "Explorer Worker",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,5 +9,8 @@
9
9
  "license": "MIT",
10
10
  "author": "Lvce Editor",
11
11
  "type": "module",
12
- "main": "dist/settingsViewWorkerMain.js"
12
+ "main": "dist/settingsViewWorkerMain.js",
13
+ "dependencies": {
14
+ "@lvce-editor/constants": "^2.3.0"
15
+ }
13
16
  }