New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@blocksuite/virgo

Package Overview
Dependencies
Maintainers
5
Versions
509
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blocksuite/virgo - npm Package Compare versions

Comparing version 0.0.0-20230418192708-038c287a-nightly to 0.0.0-20230419082004-ba4cb881-nightly

12

dist/utils/transform-input.js

@@ -45,9 +45,9 @@ function handleInsertText(vRange, data, editor, attributes) {

if (vRange.index > 0) {
// https://dev.to/acanimal/how-to-slice-or-get-symbols-from-a-unicode-string-with-emojis-in-javascript-lets-learn-how-javascript-represent-strings-h3a
const tmpString = editor.yText.toString().slice(0, vRange.index);
const deletedCharacter = [...tmpString].slice(-1).join('');
const originalString = editor.yText.toString();
const segments = [...new Intl.Segmenter().segment(originalString)];
const deletedLength = segments[segments.length - 1].segment.length;
editor.slots.updated.once(() => {
editor.slots.vRangeUpdated.emit([
{
index: vRange.index - deletedCharacter.length,
index: vRange.index - deletedLength,
length: 0,

@@ -59,4 +59,4 @@ },

editor.deleteText({
index: vRange.index - deletedCharacter.length,
length: deletedCharacter.length,
index: vRange.index - deletedLength,
length: deletedLength,
});

@@ -63,0 +63,0 @@ }

{
"name": "@blocksuite/virgo",
"version": "0.0.0-20230418192708-038c287a-nightly",
"version": "0.0.0-20230419082004-ba4cb881-nightly",
"description": "A micro editor.",

@@ -27,3 +27,3 @@ "main": "dist/index.js",

"zod": "^3.21.4",
"@blocksuite/global": "0.0.0-20230418192708-038c287a-nightly"
"@blocksuite/global": "0.0.0-20230419082004-ba4cb881-nightly"
},

@@ -30,0 +30,0 @@ "scripts": {

@@ -60,9 +60,9 @@ import type { VRange } from '../types.js';

if (vRange.index > 0) {
// https://dev.to/acanimal/how-to-slice-or-get-symbols-from-a-unicode-string-with-emojis-in-javascript-lets-learn-how-javascript-represent-strings-h3a
const tmpString = editor.yText.toString().slice(0, vRange.index);
const deletedCharacter = [...tmpString].slice(-1).join('');
const originalString = editor.yText.toString();
const segments = [...new Intl.Segmenter().segment(originalString)];
const deletedLength = segments[segments.length - 1].segment.length;
editor.slots.updated.once(() => {
editor.slots.vRangeUpdated.emit([
{
index: vRange.index - deletedCharacter.length,
index: vRange.index - deletedLength,
length: 0,

@@ -75,4 +75,4 @@ },

editor.deleteText({
index: vRange.index - deletedCharacter.length,
length: deletedCharacter.length,
index: vRange.index - deletedLength,
length: deletedLength,
});

@@ -79,0 +79,0 @@ }

Sorry, the diff of this file is not supported yet

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