@lvce-editor/editor-worker 19.52.0 → 19.54.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.
@@ -5420,7 +5420,8 @@ const getLanguages = async (platform, assetDir) => {
5420
5420
  };
5421
5421
 
5422
5422
  const measureCharacterWidth = async (fontWeight, fontSize, fontFamily, letterSpacing) => {
5423
- return await measureTextWidth('a', fontWeight, fontSize, fontFamily, letterSpacing, false, 0);
5423
+ const width = await measureTextWidth('a', fontWeight, fontSize, fontFamily, letterSpacing, false, 0);
5424
+ return width + letterSpacing;
5424
5425
  };
5425
5426
 
5426
5427
  const normalizeLineEndings = content => {
@@ -5434,6 +5435,9 @@ const get$3 = async key => {
5434
5435
  const value = await getPreference(key);
5435
5436
  return value;
5436
5437
  };
5438
+ const update = async settings => {
5439
+ await invoke$a('Preferences.update', settings);
5440
+ };
5437
5441
 
5438
5442
  const createEditor = async ({
5439
5443
  assetDir,
@@ -8336,6 +8340,7 @@ const ToggleBlockComment = 'Toggle Block Comment';
8336
8340
  const ToggleBreakpoint = 'Toggle Breakpoint';
8337
8341
  const Undo = 'Undo';
8338
8342
  const Unfold = 'Editor: Unfold';
8343
+ const ViewToggleMinimap = 'View: Toggle Minimap';
8339
8344
 
8340
8345
  const goToDefinition$1 = () => {
8341
8346
  return i18nString(GoToDefinition);
@@ -8473,6 +8478,9 @@ const editorOpenColorPicker = () => {
8473
8478
  const editorCloseColorPicker = () => {
8474
8479
  return i18nString(EditorCloseColorPicker);
8475
8480
  };
8481
+ const viewToggleMinimap = () => {
8482
+ return i18nString(ViewToggleMinimap);
8483
+ };
8476
8484
  const editorCopyLineDown = () => {
8477
8485
  return i18nString(EditorCopyLineDown);
8478
8486
  };
@@ -13842,6 +13850,9 @@ const getQuickPickMenuEntries = () => {
13842
13850
  }, {
13843
13851
  id: 'Editor.showSourceActions2',
13844
13852
  label: sourceAction()
13853
+ }, {
13854
+ id: 'Editor.toggleMinimap',
13855
+ label: viewToggleMinimap()
13845
13856
  }];
13846
13857
  };
13847
13858
 
@@ -15997,6 +16008,13 @@ const setDebugEnabled = (state, enabled) => {
15997
16008
  return state;
15998
16009
  };
15999
16010
 
16011
+ const toggleMinimap = async () => {
16012
+ const minimapEnabled = await getMinimapEnabled();
16013
+ await update({
16014
+ 'editor.minimap.enabled': !minimapEnabled
16015
+ });
16016
+ };
16017
+
16000
16018
  /**
16001
16019
  * Unregister a listener for editor events
16002
16020
  * @param listenerType - The type of event to stop listening for
@@ -16510,6 +16528,7 @@ const commandMap = {
16510
16528
  'Editor.toggleBreakpoint': wrapCommand(toggleBreakpoint),
16511
16529
  'Editor.toggleComment': wrapCommand(toggleComment),
16512
16530
  'Editor.toggleLineComment': wrapCommand(editorToggleLineComment),
16531
+ 'Editor.toggleMinimap': toggleMinimap,
16513
16532
  'Editor.type': wrapCommand(type, true),
16514
16533
  'Editor.typeWithAutoClosing': wrapCommand(typeWithAutoClosing, true),
16515
16534
  'Editor.undo': wrapCommand(undo),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/editor-worker",
3
- "version": "19.52.0",
3
+ "version": "19.54.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git@github.com:lvce-editor/editor-worker.git"