Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lilium-text

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lilium-text - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

47

dev/liliumtext.js

@@ -18,6 +18,17 @@ class LiliumTextCommand {

el.addEventListener('click', (ev) => {
el.addEventListener('mousedown', ev => {
ev.preventDefault();
ev.stopPropagation();
return false;
});
el.addEventListener('mouseup', (ev) => {
ev.preventDefault();
ev.stopPropagation();
editor.log('Executed command ' + this.webName + (this.param ? (" with parameter '" + this.param + "'") : ''));
editor.fire('command', this.webName);
this.execute(ev, this, editor);
return false;
});

@@ -40,2 +51,14 @@

highlightNode(node) {
const selection = this.editor.restoreSelection();
const range = document.createRange();
this.editor.log("Highlighting node " + node.nodeName + " from Web Command");
range.selectNode(node);
selection.removeAllRanges();
selection.addRange(range);
this.editor.storeRange(range);
}
executeText() {

@@ -92,2 +115,4 @@ const selection = this.editor.restoreSelection();

selection.getRangeAt(0).insertNode(newElem);
this.highlightNode(newElem);
} else if (!leftExistWrap != !rightExistWrap) {

@@ -744,11 +769,15 @@ // Apparently there is no XOR in Javascript, so here's a syntax monstrosity

storeRange() {
const tempSelection = window.getSelection();
storeRange(maybeRange) {
if (maybeRange) {
this._tempRange = maybeRange;
} else {
const tempSelection = window.getSelection();
if (tempSelection.type == "None" || !tempSelection.focusNode) {
const range = document.createRange();
range.setStart(this.contentel, 0);
this._tempRange = range;
} else {
this._tempRange = tempSelection.getRangeAt(0).cloneRange();
if (tempSelection.type == "None" || !tempSelection.focusNode) {
const range = document.createRange();
range.setStart(this.contentel, 0);
this._tempRange = range;
} else {
this._tempRange = tempSelection.getRangeAt(0).cloneRange();
}
}

@@ -755,0 +784,0 @@

2

package.json
{
"name": "lilium-text",
"version": "0.2.1",
"version": "0.2.2",
"description": "Web rich text editor. Ready to be used in a test environment.",

@@ -5,0 +5,0 @@ "main": "build/liliumtext.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc