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

@cocreate/cursors

Package Overview
Dependencies
Maintainers
0
Versions
245
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cocreate/cursors - npm Package Compare versions

Comparing version 1.23.5 to 1.24.0

demo/potential-selection-method.html

2

package.json
{
"name": "@cocreate/cursors",
"version": "1.23.5",
"version": "1.24.0",
"description": "Collaborative user cursor position for inputs, textarea's and contenteditable elements.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -107,2 +107,4 @@ /********************************************************************************

let domTextEditor = element;
if (element.hasAttribute('contenteditable')) {

@@ -114,6 +116,23 @@ contenteditable = true

// if (frameClientId == selection.socketId) continue;
element = element.contentDocument.documentElement;
domTextEditor = element = element.contentDocument.documentElement;
let pos = getElementPosition(domTextEditor.htmlString, start, end);
if (pos.path) {
element = element.querySelector(pos.path);
if (pos.start) {
let endPos = end - start;
if (endPos > 0)
end = pos.start + endPos;
else
end = pos.start;
start = pos.start;
}
}
}
if (!element.htmlString)
if (!domTextEditor.htmlString)
continue
// let pos = getElementPosition(domTextEditor.htmlString, start, end);

@@ -147,3 +166,6 @@

mirrorDiv.element = element;
element.insertAdjacentElement('afterend', mirrorDiv);
if (element.tagName === "HTML")
element.insertAdjacentElement('beforeend', mirrorDiv);
else
element.insertAdjacentElement('afterend', mirrorDiv);
// let parent = element.parentElement;

@@ -186,3 +208,3 @@ // let parentComputed = getComputedStyle(parent);

if (element.parentElement.style['display'] == 'inline') {
if (element.parentElement && element.parentElement.style['display'] == 'inline') {
style.top = element.clientTop + 'px';

@@ -237,3 +259,3 @@ style.left = element.clientLeft + 'px';

if (contenteditable) {
selectionElement = getElementPosition(element.htmlString, start, end);
selectionElement = getElementPosition(domTextEditor.htmlString, selection.start, selection.end);
}

@@ -244,3 +266,4 @@

lastChildElement = selection_user.lastElementChild;
lastChildTagName = lastChildElement.tagName.toLowerCase()
if (lastChildElement)
lastChildTagName = lastChildElement.tagName.toLowerCase()
}

@@ -470,3 +493,3 @@

observe: ['addedNodes'],
target: '[array][object][key]',
selector: '[array][object][key]',
callback: function (mutation) {

@@ -473,0 +496,0 @@ initElement(mutation.target);

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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