Huge News!Announcing our $40M Series B led by Abstract Ventures.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.4.0-20230212194855-047e1b9 to 0.4.0-20230213234455-1a23f69

8

dist/components/virgo-unit-text.js

@@ -9,3 +9,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

import { customElement, property } from 'lit/decorators.js';
import { styleMap } from 'lit/directives/style-map.js';
import { ZERO_WIDTH_SPACE } from '../constant.js';
const unitTextStyles = styleMap({
whiteSpace: 'pre',
});
let VirgoUnitText = class VirgoUnitText extends LitElement {

@@ -19,3 +23,5 @@ constructor() {

// cause the sync problem about the cursor position
return html `<span data-virgo-text="true">${this.str}</span>`;
return html `<span style=${unitTextStyles} data-virgo-text="true"
>${this.str}</span
>`;
}

@@ -22,0 +28,0 @@ createRenderRoot() {

@@ -496,2 +496,21 @@ import { expect, test } from '@playwright/test';

});
test('input continuous spaces', async ({ page }) => {
await enterVirgoPlayground(page);
await focusVirgoRichText(page);
const editorA = page.locator('[data-virgo-root="true"]').nth(0);
const editorB = page.locator('[data-virgo-root="true"]').nth(1);
expect(await editorA.innerText()).toBe(ZERO_WIDTH_SPACE);
expect(await editorB.innerText()).toBe(ZERO_WIDTH_SPACE);
await type(page, 'abc def');
expect(await editorA.innerText()).toBe('abc def');
expect(await editorB.innerText()).toBe('abc def');
await focusVirgoRichText(page);
await page.keyboard.press('ArrowLeft');
await page.keyboard.press('ArrowLeft');
await page.keyboard.press('ArrowLeft');
await page.keyboard.press('ArrowLeft');
await page.keyboard.press('Enter');
expect(await editorA.innerText()).toBe('abc \n' + ' def');
expect(await editorB.innerText()).toBe('abc \n' + ' def');
});
//# sourceMappingURL=virgo.spec.js.map

4

package.json
{
"name": "@blocksuite/virgo",
"version": "0.4.0-20230212194855-047e1b9",
"version": "0.4.0-20230213234455-1a23f69",
"description": "A micro editor.",

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

"dependencies": {
"@blocksuite/global": "0.4.0-20230212194855-047e1b9",
"@blocksuite/global": "0.4.0-20230213234455-1a23f69",
"zod": "^3.20.2"

@@ -29,0 +29,0 @@ },

import { html, LitElement } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import { styleMap } from 'lit/directives/style-map.js';
import { ZERO_WIDTH_SPACE } from '../constant.js';
const unitTextStyles = styleMap({
whiteSpace: 'pre',
});
@customElement('virgo-unit-text')

@@ -14,3 +19,5 @@ export class VirgoUnitText extends LitElement {

// cause the sync problem about the cursor position
return html`<span data-virgo-text="true">${this.str}</span>`;
return html`<span style=${unitTextStyles} data-virgo-text="true"
>${this.str}</span
>`;
}

@@ -17,0 +24,0 @@

@@ -591,1 +591,28 @@ import { expect, test } from '@playwright/test';

});
test('input continuous spaces', async ({ page }) => {
await enterVirgoPlayground(page);
await focusVirgoRichText(page);
const editorA = page.locator('[data-virgo-root="true"]').nth(0);
const editorB = page.locator('[data-virgo-root="true"]').nth(1);
expect(await editorA.innerText()).toBe(ZERO_WIDTH_SPACE);
expect(await editorB.innerText()).toBe(ZERO_WIDTH_SPACE);
await type(page, 'abc def');
expect(await editorA.innerText()).toBe('abc def');
expect(await editorB.innerText()).toBe('abc def');
await focusVirgoRichText(page);
await page.keyboard.press('ArrowLeft');
await page.keyboard.press('ArrowLeft');
await page.keyboard.press('ArrowLeft');
await page.keyboard.press('ArrowLeft');
await page.keyboard.press('Enter');
expect(await editorA.innerText()).toBe('abc \n' + ' def');
expect(await editorB.innerText()).toBe('abc \n' + ' def');
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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