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

prosemirror-tables-adui

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prosemirror-tables-adui - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "prosemirror-tables-adui",
"version": "1.0.0",
"version": "1.0.1",
"description": "ProseMirror's rowspan/colspan tables component",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -75,5 +75,5 @@ import {Plugin, PluginKey} from "prosemirror-state"

if (event.clientX - left <= handleWidth)
cell = edgeCell(view, event, "left")
cell = edgeCell(view, event, "left", handleWidth)
else if (right - event.clientX <= handleWidth)
cell = edgeCell(view, event, "right")
cell = edgeCell(view, event, "right", handleWidth)
}

@@ -116,7 +116,7 @@

while (dom.nodeName != "TABLE") { dom = dom.parentNode; }
const cols = [...dom.getElementsByTagName('col')];
const cols = [].slice.call(dom.getElementsByTagName('col'))
let cellMaxWidth = 960;
cols.forEach((col, i) => {
if (i !== colIndex) {
cellMaxWidth = cellMaxWidth - (col.style.width ? parseInt(col.style.width.split('px')[0], 10) : 100);
cellMaxWidth = cellMaxWidth - ((col.style && col.style.width) ? parseInt(col.style.width.split('px')[0], 10) : cellMinWidth);
}

@@ -166,4 +166,4 @@ });

function edgeCell(view, event, side) {
const buffer = side == 'right' ? -5 : 5; // Fixes finicky bug where posAtCoords could return wrong pos.
function edgeCell(view, event, side, handleWidth) {
const buffer = side == 'right' ? -handleWidth : handleWidth; // Fixes finicky bug where posAtCoords could return wrong pos.
let found = view.posAtCoords({left: event.clientX + buffer, top: event.clientY})

@@ -180,5 +180,5 @@ if (!found) return -1

function draggedWidth(dragging, event, cellMinWidth) {
function draggedWidth(dragging, event, cellMinWidth, cellMaxWidth) {
let offset = event.clientX - dragging.startX
return Math.max(cellMinWidth, dragging.startWidth + offset)
return Math.min(Math.max(cellMinWidth, dragging.startWidth + offset), cellMaxWidth)
}

@@ -185,0 +185,0 @@

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

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

Sorry, the diff of this file is not supported yet

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