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

@blocksuite/store

Package Overview
Dependencies
Maintainers
5
Versions
1264
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blocksuite/store - npm Package Compare versions

Comparing version 0.4.0-20230125204655-410ba23 to 0.4.0-20230126161407-c60bfba

4

dist/base.d.ts

@@ -5,3 +5,2 @@ /// <reference types="@blocksuite/global" />

import { Signal } from '@blocksuite/global/utils';
import type { DeltaOperation } from 'quill';
import type * as Y from 'yjs';

@@ -32,5 +31,2 @@ interface StaticValue {

lastChild(): BaseBlockModel | null;
block2html(childText: string, _previousSiblingId: string, _nextSiblingId: string, begin?: number, end?: number): string;
block2Text(childText: string, begin?: number, end?: number): string;
_deltaLeaf2Html(deltaLeaf: DeltaOperation): string;
dispose(): void;

@@ -37,0 +33,0 @@ }

@@ -24,39 +24,2 @@ import { Signal } from '@blocksuite/global/utils';

}
block2html(childText, _previousSiblingId, _nextSiblingId, begin, end) {
const delta = this.text?.sliceToDelta(begin || 0, end) || [];
const text = delta.reduce((html, item) => {
return html + this._deltaLeaf2Html(item);
}, '');
return `${text}${childText}`;
}
block2Text(childText, begin, end) {
const text = (this.text?.toString() || '').slice(begin || 0, end);
return `${text}${childText}`;
}
_deltaLeaf2Html(deltaLeaf) {
let text = deltaLeaf.insert;
const attributes = deltaLeaf.attributes;
if (!attributes) {
return text;
}
if (attributes.code) {
text = `<code>${text}</code>`;
}
if (attributes.bold) {
text = `<strong>${text}</strong>`;
}
if (attributes.italic) {
text = `<em>${text}</em>`;
}
if (attributes.underline) {
text = `<u>${text}</u>`;
}
if (attributes.strikethrough) {
text = `<s>${text}</s>`;
}
if (attributes.link) {
text = `<a href='${attributes.link}'>${text}</a>`;
}
return text;
}
dispose() {

@@ -63,0 +26,0 @@ this.propsUpdated.dispose();

4

package.json
{
"name": "@blocksuite/store",
"version": "0.4.0-20230125204655-410ba23",
"version": "0.4.0-20230126161407-c60bfba",
"description": "BlockSuite data store built for general purpose state management.",

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

"dependencies": {
"@blocksuite/global": "0.4.0-20230125204655-410ba23",
"@blocksuite/global": "0.4.0-20230126161407-c60bfba",
"@types/flexsearch": "^0.7.3",

@@ -14,0 +14,0 @@ "buffer": "^6.0.3",

import type { Page } from './workspace/index.js';
import type { TextType } from './text-adapter.js';
import { Signal } from '@blocksuite/global/utils';
import type { DeltaOperation } from 'quill';
import type * as Y from 'yjs';

@@ -61,48 +60,2 @@

block2html(
childText: string,
_previousSiblingId: string,
_nextSiblingId: string,
begin?: number,
end?: number
) {
const delta = this.text?.sliceToDelta(begin || 0, end) || [];
const text = delta.reduce((html: string, item: DeltaOperation) => {
return html + this._deltaLeaf2Html(item);
}, '');
return `${text}${childText}`;
}
block2Text(childText: string, begin?: number, end?: number) {
const text = (this.text?.toString() || '').slice(begin || 0, end);
return `${text}${childText}`;
}
_deltaLeaf2Html(deltaLeaf: DeltaOperation) {
let text: string = deltaLeaf.insert;
const attributes = deltaLeaf.attributes;
if (!attributes) {
return text;
}
if (attributes.code) {
text = `<code>${text}</code>`;
}
if (attributes.bold) {
text = `<strong>${text}</strong>`;
}
if (attributes.italic) {
text = `<em>${text}</em>`;
}
if (attributes.underline) {
text = `<u>${text}</u>`;
}
if (attributes.strikethrough) {
text = `<s>${text}</s>`;
}
if (attributes.link) {
text = `<a href='${attributes.link}'>${text}</a>`;
}
return text;
}
dispose() {

@@ -109,0 +62,0 @@ this.propsUpdated.dispose();

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