@stratusjs/angular 0.5.12 → 0.5.13

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.
@@ -80793,6 +80793,9 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
80793
80793
  this.saveSelection();
80794
80794
  }
80795
80795
  this.updateSnapshot();
80796
+ if (this.debug) {
80797
+ console.log(`[${this.eventName}]:`, { instance, data });
80798
+ }
80796
80799
  instance.trigger(this.eventName, data, this);
80797
80800
  }
80798
80801
  trigger(name, data, callee) {
@@ -80807,7 +80810,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
80807
80810
  console.warn(`${this.name}.trigger(): unable to inject html without a set editor.`);
80808
80811
  return;
80809
80812
  }
80810
- if (['insert', 'restore'].includes(name)) {
80813
+ if (!['insert', 'restore'].includes(name)) {
80811
80814
  console.warn(`${this.name}.trigger():`, name, 'event is not supported.');
80812
80815
  return;
80813
80816
  }
@@ -80835,7 +80838,13 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
80835
80838
  console.warn(`${this.name}.restoreSnapshot(): unable to restore editor session without a snapshot.`);
80836
80839
  return false;
80837
80840
  }
80841
+ if (this.debug) {
80842
+ console.log('[restoreSnapshot]is focused:', this.editor.core.hasFocus());
80843
+ }
80844
+ this.editor.events.disableBlur();
80845
+ this.editor.events.focus();
80838
80846
  this.editor.snapshot.restore(this.snapshot);
80847
+ this.editor.events.enableBlur();
80839
80848
  return true;
80840
80849
  }
80841
80850
  updateSnapshot() {
@@ -80849,7 +80858,13 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
80849
80858
  console.warn(`${this.name}.restoreSelection(): unable to restore editor selection.`);
80850
80859
  return false;
80851
80860
  }
80861
+ if (this.debug) {
80862
+ console.log('[restoreSelection]is focused:', this.editor.core.hasFocus());
80863
+ }
80864
+ this.editor.events.disableBlur();
80865
+ this.editor.events.focus();
80852
80866
  this.editor.selection.restore();
80867
+ this.editor.events.enableBlur();
80853
80868
  return true;
80854
80869
  }
80855
80870
  saveSelection() {
@@ -80857,7 +80872,9 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
80857
80872
  console.warn(`${this.name}.saveSelection(): unable to save editor selection.`);
80858
80873
  return false;
80859
80874
  }
80875
+ this.editor.events.disableBlur();
80860
80876
  this.editor.selection.save();
80877
+ this.editor.events.enableBlur();
80861
80878
  return true;
80862
80879
  }
80863
80880
  clearSelection() {
@@ -81033,9 +81050,10 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
81033
81050
  });
81034
81051
  FroalaEditor.PLUGINS.linkManager = function linkManager(editor) {
81035
81052
  let inputButton;
81036
- const linkPlugin = FroalaEditor.PLUGINS.link(editor);
81037
81053
  const debug = false;
81038
81054
  function _init() {
81055
+ this.uid = uniqueId$3(`froala_link_manager_`);
81056
+ Stratus.Instances[this.uid] = this;
81039
81057
  inputButton = new InputButtonPlugin({
81040
81058
  name: 'Link Manager',
81041
81059
  eventName: 'link-library',
@@ -81048,19 +81066,22 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
81048
81066
  if (link.target) {
81049
81067
  attrs.target = '_blank';
81050
81068
  }
81051
- linkPlugin.insert(link.url, link.text, attrs);
81069
+ editor.link.insert(link.url, link.text, attrs);
81052
81070
  },
81053
81071
  autoSaveSelection: true,
81054
81072
  autoRestoreSelection: true,
81055
81073
  debug
81056
81074
  });
81075
+ this.inputButton = inputButton;
81076
+ this.editor = editor;
81057
81077
  }
81058
- function onClick() {
81078
+ function onClick(el, data) {
81059
81079
  if (!editor.el) {
81060
81080
  console.warn('linkManager.onClick(): unable to find element');
81061
81081
  return;
81062
81082
  }
81063
- inputButton.onClick(editor.el, linkPlugin.get());
81083
+ const link = editor.link.get();
81084
+ inputButton.onClick(editor.el, link);
81064
81085
  }
81065
81086
  return {
81066
81087
  _init,
@@ -81070,10 +81091,11 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
81070
81091
  FroalaEditor.RegisterCommand('linkManager', {
81071
81092
  title: 'Insert from Link Library',
81072
81093
  undo: false,
81073
- focus: false,
81094
+ focus: true,
81074
81095
  modal: true,
81096
+ refreshOnCallback: false,
81075
81097
  callback() {
81076
- this.linkManager.onClick(undefined, FroalaEditor.PLUGINS.link(this).get());
81098
+ this.linkManager.onClick();
81077
81099
  },
81078
81100
  plugin: 'linkManager',
81079
81101
  }),
@@ -81084,7 +81106,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
81084
81106
  focus: false,
81085
81107
  modal: true,
81086
81108
  callback() {
81087
- this.linkManager.onClick(undefined, FroalaEditor.PLUGINS.link(this).get());
81109
+ this.linkManager.onClick(undefined, this.link.get());
81088
81110
  },
81089
81111
  plugin: 'linkManager',
81090
81112
  }),
@@ -81101,7 +81123,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
81101
81123
  eventName: 'link-library',
81102
81124
  editor: this,
81103
81125
  insert: (link) => {
81104
- FroalaEditor.PLUGINS.link(this).insert(link.url, '', { 'aria-label': link.title });
81126
+ this.link.insert(link.url, '', { 'aria-label': link.title });
81105
81127
  },
81106
81128
  autoSaveSelection: true,
81107
81129
  autoRestoreSelection: true,
@@ -129759,7 +129781,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129759
129781
  var __metadata = (undefined && undefined.__metadata) || function (k, v) {
129760
129782
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
129761
129783
  };
129762
- if (cookie('env')) ;
129763
129784
  let AppModule = exports('AppModule', class AppModule {
129764
129785
  constructor() {
129765
129786
  this.initialTimeout = 1000;