markupeditor 0.9.11 → 0.9.12

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.
@@ -48,6 +48,29 @@
48
48
  "header": true,
49
49
  "border": true
50
50
  },
51
+ "help": {
52
+ "style": "Set paragraph style",
53
+ "bold": "Toggle bold",
54
+ "italic": "Toggle italic",
55
+ "underline": "Toggle underline",
56
+ "code": "Toggle code",
57
+ "strikethrough": "Toggle strikethrough",
58
+ "subscript": "Toggle subscript",
59
+ "superscript": "Toggle superscript",
60
+ "bullet": "Toggle bulleted list",
61
+ "number": "Toggle numbered list",
62
+ "indent": "Increase indent",
63
+ "outdent": "Decrease indent",
64
+ "link": "Insert/edit link",
65
+ "image": "Insert/edit image",
66
+ "table": "Insert/edit table",
67
+ "search": "Toggle search",
68
+ "searchForward": "Search forward",
69
+ "searchBackward": "Search backward",
70
+ "matchCase": "Match case",
71
+ "undo": "Undo",
72
+ "redo": "Redo"
73
+ },
51
74
  "augmentation": {
52
75
  "prepend": null,
53
76
  "append": null
@@ -19592,6 +19592,29 @@ var tableMenu = {
19592
19592
  header: true,
19593
19593
  border: true
19594
19594
  };
19595
+ var help = {
19596
+ style: "Set paragraph style",
19597
+ bold: "Toggle bold",
19598
+ italic: "Toggle italic",
19599
+ underline: "Toggle underline",
19600
+ code: "Toggle code",
19601
+ strikethrough: "Toggle strikethrough",
19602
+ subscript: "Toggle subscript",
19603
+ superscript: "Toggle superscript",
19604
+ bullet: "Toggle bulleted list",
19605
+ number: "Toggle numbered list",
19606
+ indent: "Increase indent",
19607
+ outdent: "Decrease indent",
19608
+ link: "Insert/edit link",
19609
+ image: "Insert/edit image",
19610
+ table: "Insert/edit table",
19611
+ search: "Toggle search",
19612
+ searchForward: "Search forward",
19613
+ searchBackward: "Search backward",
19614
+ matchCase: "Match case",
19615
+ undo: "Undo",
19616
+ redo: "Redo"
19617
+ };
19595
19618
  var augmentation = {
19596
19619
  prepend: null,
19597
19620
  append: null
@@ -19628,6 +19651,7 @@ var toolbarConfig = {
19628
19651
  styleMenu: styleMenu,
19629
19652
  styleBar: styleBar,
19630
19653
  tableMenu: tableMenu,
19654
+ help: help,
19631
19655
  augmentation: augmentation,
19632
19656
  icons: icons
19633
19657
  };
@@ -21440,10 +21464,11 @@ class LinkItem extends DialogItem {
21440
21464
  super(config);
21441
21465
  let keymap = this.config.keymap;
21442
21466
  let icons = config.toolbar.icons;
21467
+ let help = config.toolbar.help;
21443
21468
  let options = {
21444
21469
  enable: () => { return true }, // Always enabled because it is presented modally
21445
21470
  active: (state) => { return markActive(state, state.schema.marks.link) },
21446
- title: 'Insert/edit link' + keyString('link', keymap),
21471
+ title: help.link + keyString('link', keymap),
21447
21472
  icon: icons.link
21448
21473
  };
21449
21474
 
@@ -21755,10 +21780,11 @@ class ImageItem extends DialogItem {
21755
21780
  constructor(config) {
21756
21781
  super(config);
21757
21782
  let icons = config.toolbar.icons;
21783
+ let help = config.toolbar.help;
21758
21784
  let options = {
21759
21785
  enable: () => { return true }, // Always enabled because it is presented modally
21760
21786
  active: (state) => { return getImageAttributes(state).src },
21761
- title: 'Insert/edit image' + keyString('image', config.keymap),
21787
+ title: help.image + keyString('image', config.keymap),
21762
21788
  icon: icons.image
21763
21789
  };
21764
21790
 
@@ -22172,10 +22198,11 @@ class SearchItem {
22172
22198
  constructor(config) {
22173
22199
  let keymap = config.keymap;
22174
22200
  this.icons = config.toolbar.icons;
22201
+ this.help = config.toolbar.help;
22175
22202
  let options = {
22176
22203
  enable: () => { return true },
22177
22204
  active: () => { return this.showing() },
22178
- title: 'Toggle search' + keyString('search', keymap),
22205
+ title: this.help.search + keyString('search', keymap),
22179
22206
  icon: this.icons.search,
22180
22207
  id: prefix + '-searchitem'
22181
22208
  };
@@ -22299,11 +22326,11 @@ class SearchItem {
22299
22326
 
22300
22327
  // The searchBackward and searchForward buttons don't need updating
22301
22328
  let searchBackward = this.searchBackwardCommand.bind(this);
22302
- let searchBackwardItem = cmdItem(searchBackward, {title: "Search backward", icon: this.icons.searchBackward});
22329
+ let searchBackwardItem = cmdItem(searchBackward, {title: this.help.searchBackward, icon: this.icons.searchBackward});
22303
22330
  let searchBackwardDom = searchBackwardItem.render(view).dom;
22304
22331
  let searchBackwardSpan = crelt("span", {class: prefix + "-menuitem"}, searchBackwardDom);
22305
22332
  let searchForward = this.searchForwardCommand.bind(this);
22306
- let searchForwardItem = cmdItem(searchForward, {title: "Search forward", icon: this.icons.searchForward});
22333
+ let searchForwardItem = cmdItem(searchForward, {title: this.help.searchForward, icon: this.icons.searchForward});
22307
22334
  let searchForwardDom = searchForwardItem.render(view).dom;
22308
22335
  let searchForwardSpan = crelt("span", {class: prefix + "-menuitem"}, searchForwardDom);
22309
22336
  let separator = crelt("span", {class: prefix + "-menuseparator"});
@@ -22315,7 +22342,7 @@ class SearchItem {
22315
22342
  let toggleMatchCase = this.toggleMatchCaseCommand.bind(this);
22316
22343
  this.matchCaseItem = cmdItem(
22317
22344
  toggleMatchCase, {
22318
- title: "Match case",
22345
+ title: this.help.matchCase,
22319
22346
  icon: this.icons.matchCase,
22320
22347
  enable: () => {return true},
22321
22348
  active: () => {return this.caseSensitive}
@@ -22499,7 +22526,8 @@ function markActive(state, type) {
22499
22526
  * @returns string
22500
22527
  */
22501
22528
  function keyString(itemName, keymap) {
22502
- return ' (' + baseKeyString(itemName, keymap) + ')'
22529
+ let base = baseKeyString(itemName, keymap);
22530
+ return (base.length > 0) ? ' (' + base + ')' : ''
22503
22531
  }
22504
22532
 
22505
22533
  function baseKeyString(itemName, keymap) {
@@ -22775,6 +22803,7 @@ function insertBarItems(config) {
22775
22803
 
22776
22804
  function tableMenuItems(config) {
22777
22805
  let icons = config.toolbar.icons;
22806
+ let help = config.toolbar.help;
22778
22807
  let items = [];
22779
22808
  let { header, border } = config.toolbar.tableMenu;
22780
22809
  items.push(new TableCreateSubmenu({title: 'Insert table', label: 'Insert'}));
@@ -22818,7 +22847,7 @@ function tableMenuItems(config) {
22818
22847
  enable: (state) => { return isTableSelected(state) }
22819
22848
  }));
22820
22849
  }
22821
- return new Dropdown(items, { title: 'Insert/edit table', icon: icons.table })
22850
+ return new Dropdown(items, { title: help.table, icon: icons.table })
22822
22851
  }
22823
22852
 
22824
22853
  function tableEditItem(command, options) {
@@ -22854,25 +22883,26 @@ function tableBorderItem(command, options) {
22854
22883
  function styleBarItems(config, schema) {
22855
22884
  let keymap = config.keymap;
22856
22885
  let icons = config.toolbar.icons;
22886
+ let help = config.toolbar.help;
22857
22887
  let items = [];
22858
22888
  let { list, dent } = config.toolbar.styleBar;
22859
22889
  if (list) {
22860
22890
  let bullet = toggleListItem(
22861
22891
  schema,
22862
22892
  schema.nodes.bullet_list,
22863
- { title: 'Toggle bulleted list' + keyString('bullet', keymap), icon: icons.bulletList }
22893
+ { title: help.bullet + keyString('bullet', keymap), icon: icons.bulletList }
22864
22894
  );
22865
22895
  let number = toggleListItem(
22866
22896
  schema,
22867
22897
  schema.nodes.ordered_list,
22868
- { title: 'Toggle numbered list' + keyString('number', keymap), icon: icons.orderedList }
22898
+ { title: help.number + keyString('number', keymap), icon: icons.orderedList }
22869
22899
  );
22870
22900
  items.push(bullet);
22871
22901
  items.push(number);
22872
22902
  }
22873
22903
  if (dent) {
22874
- let indent = indentItem({ title: 'Increase indent' + keyString('indent', keymap), icon: icons.blockquote });
22875
- let outdent = outdentItem({ title: 'Decrease indent' + keyString('outdent', keymap), icon: icons.lift });
22904
+ let indent = indentItem({ title: help.indent + keyString('indent', keymap), icon: icons.blockquote });
22905
+ let outdent = outdentItem({ title: help.outdent + keyString('outdent', keymap), icon: icons.lift });
22876
22906
  items.push(indent);
22877
22907
  items.push(outdent);
22878
22908
  }
@@ -22922,15 +22952,16 @@ function outdentItem(options) {
22922
22952
  function formatItems(config, schema) {
22923
22953
  let keymap = config.keymap;
22924
22954
  let icons = config.toolbar.icons;
22955
+ let help = config.toolbar.help;
22925
22956
  let items = [];
22926
22957
  let { bold, italic, underline, code, strikethrough, subscript, superscript } = config.toolbar.formatBar;
22927
- if (bold) items.push(formatItem(schema.marks.strong, 'B', { title: 'Toggle bold' + keyString('bold', keymap), icon: icons.strong }));
22928
- if (italic) items.push(formatItem(schema.marks.em, 'I', { title: 'Toggle italic' + keyString('italic', keymap), icon: icons.em }));
22929
- if (underline) items.push(formatItem(schema.marks.u, 'U', { title: 'Toggle underline' + keyString('underline', keymap), icon: icons.u }));
22930
- if (code) items.push(formatItem(schema.marks.code, 'CODE', { title: 'Toggle code' + keyString('code', keymap), icon: icons.code }));
22931
- if (strikethrough) items.push(formatItem(schema.marks.s, 'DEL', { title: 'Toggle strikethrough' + keyString('strikethrough', keymap), icon: icons.s }));
22932
- if (subscript) items.push(formatItem(schema.marks.sub, 'SUB', { title: 'Toggle subscript' + keyString('subscript', keymap), icon: icons.sub }));
22933
- if (superscript) items.push(formatItem(schema.marks.sup, 'SUP', { title: 'Toggle superscript' + keyString('superscript', keymap), icon: icons.sup }));
22958
+ if (bold) items.push(formatItem(schema.marks.strong, 'B', { title: help.bold + keyString('bold', keymap), icon: icons.strong }));
22959
+ if (italic) items.push(formatItem(schema.marks.em, 'I', { title: help.italic + keyString('italic', keymap), icon: icons.em }));
22960
+ if (underline) items.push(formatItem(schema.marks.u, 'U', { title: help.underline + keyString('underline', keymap), icon: icons.u }));
22961
+ if (code) items.push(formatItem(schema.marks.code, 'CODE', { title: help.code + keyString('code', keymap), icon: icons.code }));
22962
+ if (strikethrough) items.push(formatItem(schema.marks.s, 'DEL', { title: help.strikethrough + keyString('strikethrough', keymap), icon: icons.s }));
22963
+ if (subscript) items.push(formatItem(schema.marks.sub, 'SUB', { title: help.subscript + keyString('subscript', keymap), icon: icons.sub }));
22964
+ if (superscript) items.push(formatItem(schema.marks.sup, 'SUP', { title: help.superscript + keyString('superscript', keymap), icon: icons.sup }));
22934
22965
  return items;
22935
22966
  }
22936
22967
 
@@ -22954,6 +22985,7 @@ function formatItem(markType, markName, options) {
22954
22985
  */
22955
22986
  function styleMenuItems(config, schema) {
22956
22987
  let keymap = config.keymap;
22988
+ let help = config.toolbar.help;
22957
22989
  let items = [];
22958
22990
  let { p, h1, h2, h3, h4, h5, h6, pre } = config.toolbar.styleMenu;
22959
22991
  if (p) items.push(new ParagraphStyleItem(schema.nodes.paragraph, 'P', { label: p, keymap: baseKeyString('p', keymap) }));
@@ -22974,10 +23006,10 @@ function styleMenuItems(config, schema) {
22974
23006
  return label ? (multiple ? label + '+' : label) : styleElement
22975
23007
  };
22976
23008
  let allLabels = [p, h1, h2, h3, h4, h5, h6, pre].filter(Boolean).flatMap(l => [l, l + '+']);
22977
- return [new Dropdown(items, { title: 'Set paragraph style', label: 'Style', titleUpdate: titleUpdate, labels: allLabels})]
23009
+ return [new Dropdown(items, { title: help.style, label: 'Style', titleUpdate: titleUpdate, labels: allLabels})]
22978
23010
  } else {
22979
23011
  let icons = config.toolbar.icons;
22980
- return [new Dropdown(items, { title: 'Set paragraph style', icon: icons.paragraphStyle })]
23012
+ return [new Dropdown(items, { title: help.style, icon: icons.paragraphStyle })]
22981
23013
  }
22982
23014
  }
22983
23015
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markupeditor",
3
- "version": "0.9.11",
3
+ "version": "0.9.12",
4
4
  "description": "A web component and API for WYSIWYG HTML editing.",
5
5
  "keywords": [
6
6
  "wysiwyg",