@lvce-editor/menu-worker 4.8.0 → 4.9.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.
@@ -2327,6 +2327,11 @@ const getKeyBindingString = (key, altKey, ctrlKey, shiftKey, metaKey) => {
2327
2327
  return string;
2328
2328
  };
2329
2329
 
2330
+ const keyBindingNode = {
2331
+ childCount: 1,
2332
+ className: MenuItemKeyBinding,
2333
+ type: Span
2334
+ };
2330
2335
  const getMenuItemDefaultDom = menuItem => {
2331
2336
  const {
2332
2337
  isFocused,
@@ -2335,7 +2340,7 @@ const getMenuItemDefaultDom = menuItem => {
2335
2340
  } = menuItem;
2336
2341
  let className = MenuItem;
2337
2342
  if (isFocused) {
2338
- className += ' ' + MenuItemFocused;
2343
+ className = mergeClassNames(className, MenuItemFocused);
2339
2344
  }
2340
2345
  const dom = [{
2341
2346
  childCount: 1,
@@ -2348,11 +2353,7 @@ const getMenuItemDefaultDom = menuItem => {
2348
2353
  dom[0].childCount++;
2349
2354
  const parsedKey = parseKey(key);
2350
2355
  const keyBindingsString = getKeyBindingString(parsedKey.key, false, parsedKey.isCtrl, parsedKey.isShift);
2351
- dom.push({
2352
- childCount: 1,
2353
- className: MenuItemKeyBinding,
2354
- type: Span
2355
- }, text(keyBindingsString));
2356
+ dom.push(keyBindingNode, text(keyBindingsString));
2356
2357
  }
2357
2358
  return dom;
2358
2359
  };
@@ -2373,11 +2374,12 @@ const getMenuItemDisabledDom = menuItem => {
2373
2374
  return [disabled, text(label)];
2374
2375
  };
2375
2376
 
2377
+ const unsupportedMenuItemNode = {
2378
+ childCount: 1,
2379
+ type: Div$1
2380
+ };
2376
2381
  const getMenuItemsNoopDom = () => {
2377
- return [{
2378
- childCount: 1,
2379
- type: Div$1
2380
- }, text(`Unsupport menu item type`)];
2382
+ return [unsupportedMenuItemNode, text(`Unsupport menu item type`)];
2381
2383
  };
2382
2384
 
2383
2385
  const separator = {
@@ -2407,10 +2409,9 @@ const getMenuItemSubMenuDom = menuItem => {
2407
2409
  label,
2408
2410
  level
2409
2411
  } = menuItem;
2410
- let className = MenuItem;
2411
- className += ' ' + MenuItemSubMenu;
2412
+ let className = mergeClassNames(MenuItem, MenuItemSubMenu);
2412
2413
  if (isFocused) {
2413
- className += ' ' + MenuItemFocused;
2414
+ className = mergeClassNames(className, MenuItemFocused);
2414
2415
  }
2415
2416
  return [{
2416
2417
  ariaExpanded: isExpanded,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/menu-worker",
3
- "version": "4.8.0",
3
+ "version": "4.9.0",
4
4
  "description": "Menu Worker",
5
5
  "repository": {
6
6
  "type": "git",