@limetech/lime-elements 37.26.5 → 37.27.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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [37.27.0](https://github.com/Lundalogik/lime-elements/compare/v37.26.5...v37.27.0) (2024-05-02)
2
+
3
+
4
+ ### Features
5
+
6
+
7
+ * **text editor:** add new icons and mod/option key display depending on user system ([4cc1c3e](https://github.com/Lundalogik/lime-elements/commit/4cc1c3e1e2dd333959e71c14fa41dd056f938895))
8
+
1
9
  ## [37.26.5](https://github.com/Lundalogik/lime-elements/compare/v37.26.4...v37.26.5) (2024-05-02)
2
10
 
3
11
 
@@ -12714,7 +12714,7 @@ var base = {
12714
12714
  222: "'"
12715
12715
  };
12716
12716
 
12717
- var shift = {
12717
+ var shift$1 = {
12718
12718
  48: ")",
12719
12719
  49: "!",
12720
12720
  50: "@",
@@ -12753,11 +12753,11 @@ for (var i = 1; i <= 24; i++) base[i + 111] = "F" + i;
12753
12753
  // And the alphabetic keys
12754
12754
  for (var i = 65; i <= 90; i++) {
12755
12755
  base[i] = String.fromCharCode(i + 32);
12756
- shift[i] = String.fromCharCode(i);
12756
+ shift$1[i] = String.fromCharCode(i);
12757
12757
  }
12758
12758
 
12759
12759
  // For each code that doesn't have a shift-equivalent, copy the base name
12760
- for (var code in base) if (!shift.hasOwnProperty(code)) shift[code] = base[code];
12760
+ for (var code in base) if (!shift$1.hasOwnProperty(code)) shift$1[code] = base[code];
12761
12761
 
12762
12762
  function keyName(event) {
12763
12763
  // On macOS, keys held with Shift and Cmd don't reflect the effect of Shift in `.key`.
@@ -12766,7 +12766,7 @@ function keyName(event) {
12766
12766
  ie && event.shiftKey && event.key && event.key.length == 1 ||
12767
12767
  event.key == "Unidentified";
12768
12768
  var name = (!ignoreKey && event.key) ||
12769
- (event.shiftKey ? shift : base)[event.keyCode] ||
12769
+ (event.shiftKey ? shift$1 : base)[event.keyCode] ||
12770
12770
  event.key || "Unidentified";
12771
12771
  // Edge sometimes produces wrong names (Issue #3)
12772
12772
  if (name == "Esc") name = "Escape";
@@ -15984,55 +15984,68 @@ class MenuCommandFactory {
15984
15984
  }
15985
15985
  }
15986
15986
 
15987
+ const getCommandSymbols = () => {
15988
+ const macUserAgent = /Macintosh|MacIntel|MacPPC|Mac68K/;
15989
+ if (navigator.userAgent.match(macUserAgent)) {
15990
+ return { mod: '⌘', option: '⌥', shift: '⇧' };
15991
+ }
15992
+ return { mod: 'Ctrl', option: 'Alt', shift: 'Shift' };
15993
+ };
15994
+ const { mod, shift } = getCommandSymbols();
15987
15995
  const textEditorMenuItems = [
15988
15996
  {
15997
+ value: 'strong',
15989
15998
  text: 'Bold',
15990
- commandText: '⌘ B',
15991
- icon: 'bold',
15999
+ commandText: `${mod} B`,
16000
+ icon: '-lime-text-bold',
15992
16001
  iconOnly: true,
15993
16002
  },
15994
16003
  {
16004
+ value: 'em',
15995
16005
  text: 'Italic',
15996
- commandText: '⌘ I',
15997
- icon: 'italic',
15998
- iconOnly: true,
15999
- },
16000
- {
16001
- text: 'Add or remove link',
16002
- commandText: '⌘ shift U',
16003
- icon: 'link',
16006
+ commandText: `${mod} I`,
16007
+ icon: '-lime-text-italic',
16004
16008
  iconOnly: true,
16005
16009
  },
16006
16010
  { separator: true },
16007
16011
  {
16012
+ value: 'headerlevel1',
16008
16013
  text: 'Header Level 1',
16009
- icon: 'header_1',
16014
+ commandText: `${mod} ${shift} 1`,
16015
+ icon: '-lime-text-h-heading-1',
16010
16016
  iconOnly: true,
16011
16017
  },
16012
16018
  {
16019
+ value: 'headerlevel2',
16013
16020
  text: 'Header Level 2',
16014
- icon: 'header_2',
16021
+ commandText: `${mod} ${shift} 2`,
16022
+ icon: '-lime-text-h-heading-2',
16015
16023
  iconOnly: true,
16016
16024
  },
16017
16025
  {
16026
+ value: 'headerlevel3',
16018
16027
  text: 'Header Level 3',
16019
- icon: 'header_3',
16028
+ commandText: `${mod} ${shift} 3`,
16029
+ icon: '-lime-text-h-heading-3',
16020
16030
  iconOnly: true,
16021
16031
  },
16022
16032
  { separator: true },
16023
16033
  {
16024
- text: 'List',
16025
- icon: 'list',
16034
+ value: 'bullet_list',
16035
+ text: 'Bullet list',
16036
+ icon: '-lime-text-bulleted-list',
16026
16037
  iconOnly: true,
16027
16038
  },
16028
16039
  {
16040
+ value: 'ordered_list',
16029
16041
  text: 'Numbered list',
16030
- icon: 'numbered_list',
16042
+ icon: '-lime-text-ordered-list',
16031
16043
  iconOnly: true,
16032
16044
  },
16033
16045
  {
16046
+ value: 'blockquote',
16034
16047
  text: 'Blockquote',
16035
- icon: 'quote_right',
16048
+ icon: '-lime-text-blockquote',
16036
16049
  iconOnly: true,
16037
16050
  },
16038
16051
  ];