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

@blocksuite/store

Package Overview
Dependencies
Maintainers
2
Versions
1329
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

to
0.0.0-canary-20241212001527

8

CHANGELOG.md
# @blocksuite/store
## 0.0.0-canary-20241211001530
## 0.0.0-canary-20241212001527

@@ -9,5 +9,5 @@ ### Patch Changes

- Updated dependencies
- @blocksuite/global@0.0.0-canary-20241211001530
- @blocksuite/inline@0.0.0-canary-20241211001530
- @blocksuite/sync@0.0.0-canary-20241211001530
- @blocksuite/global@0.0.0-canary-20241212001527
- @blocksuite/inline@0.0.0-canary-20241212001527
- @blocksuite/sync@0.0.0-canary-20241212001527

@@ -14,0 +14,0 @@ ## 0.18.5

@@ -25,3 +25,3 @@ import { BlockSuiteError } from '@blocksuite/global/exceptions';

try {
const blockSnapshot = await this.job.blockToSnapshot(model);
const blockSnapshot = this.job.blockToSnapshot(model);
if (!blockSnapshot)

@@ -42,3 +42,3 @@ return;

try {
const docSnapshot = await this.job.docToSnapshot(doc);
const docSnapshot = this.job.docToSnapshot(doc);
if (!docSnapshot)

@@ -59,3 +59,3 @@ return;

try {
const sliceSnapshot = await this.job.sliceToSnapshot(slice);
const sliceSnapshot = this.job.sliceToSnapshot(slice);
if (!sliceSnapshot)

@@ -62,0 +62,0 @@ return;

@@ -28,5 +28,5 @@ import type { BlockModel, InternalPrimitives } from '../schema/index.js';

fromSnapshot({ json, }: FromSnapshotPayload): Promise<SnapshotNode<Props>> | SnapshotNode<Props>;
toSnapshot({ model, }: ToSnapshotPayload<Props>): Promise<BlockSnapshotLeaf> | BlockSnapshotLeaf;
toSnapshot({ model }: ToSnapshotPayload<Props>): BlockSnapshotLeaf;
}
export {};
//# sourceMappingURL=base.d.ts.map

@@ -28,3 +28,3 @@ import { internalPrimitives } from '../schema/index.js';

}
toSnapshot({ model, }) {
toSnapshot({ model }) {
const { id, flavour, version } = model;

@@ -31,0 +31,0 @@ const props = this._propsToSnapshot(model);

@@ -17,6 +17,6 @@ import type { BlockModel } from '../schema/index.js';

private readonly _slots;
blockToSnapshot: (model: DraftModel) => Promise<BlockSnapshot | undefined>;
blockToSnapshot: (model: DraftModel) => BlockSnapshot | undefined;
collectionInfoToSnapshot: () => CollectionInfoSnapshot | undefined;
docToSnapshot: (doc: Doc) => Promise<DocSnapshot | undefined>;
sliceToSnapshot: (slice: Slice) => Promise<SliceSnapshot | undefined>;
docToSnapshot: (doc: Doc) => DocSnapshot | undefined;
sliceToSnapshot: (slice: Slice) => SliceSnapshot | undefined;
snapshotToBlock: (snapshot: BlockSnapshot, doc: Doc, parent?: string, index?: number) => Promise<BlockModel | undefined>;

@@ -23,0 +23,0 @@ snapshotToDoc: (snapshot: DocSnapshot) => Promise<Doc | undefined>;

@@ -30,5 +30,5 @@ import { BlockSuiteError, ErrorCode } from '@blocksuite/global/exceptions';

};
this.blockToSnapshot = async (model) => {
this.blockToSnapshot = (model) => {
try {
const snapshot = await this._blockToSnapshot(model);
const snapshot = this._blockToSnapshot(model);
BlockSnapshotSchema.parse(snapshot);

@@ -67,3 +67,3 @@ return snapshot;

};
this.docToSnapshot = async (doc) => {
this.docToSnapshot = (doc) => {
try {

@@ -79,3 +79,3 @@ this._slots.beforeExport.emit({

}
const blocks = await this.blockToSnapshot(rootModel);
const blocks = this.blockToSnapshot(rootModel);
if (!blocks) {

@@ -103,3 +103,3 @@ return;

};
this.sliceToSnapshot = async (slice) => {
this.sliceToSnapshot = (slice) => {
try {

@@ -113,3 +113,3 @@ this._slots.beforeExport.emit({

for (const block of content) {
const blockSnapshot = await this.blockToSnapshot(block);
const blockSnapshot = this.blockToSnapshot(block);
if (!blockSnapshot) {

@@ -275,3 +275,3 @@ return;

}
async _blockToSnapshot(model) {
_blockToSnapshot(model) {
this._slots.beforeExport.emit({

@@ -283,9 +283,9 @@ type: 'block',

const transformer = this._getTransformer(schema);
const snapshotLeaf = await transformer.toSnapshot({
const snapshotLeaf = transformer.toSnapshot({
model,
assets: this._assetsManager,
});
const children = await Promise.all(model.children.map(child => {
const children = model.children.map(child => {
return this._blockToSnapshot(child);
}));
});
const snapshot = {

@@ -292,0 +292,0 @@ type: 'block',

{
"name": "@blocksuite/store",
"version": "0.0.0-canary-20241211001530",
"version": "0.0.0-canary-20241212001527",
"description": "BlockSuite data store built for general purpose state management.",

@@ -23,5 +23,5 @@ "type": "module",

"dependencies": {
"@blocksuite/global": "0.0.0-canary-20241211001530",
"@blocksuite/inline": "0.0.0-canary-20241211001530",
"@blocksuite/sync": "0.0.0-canary-20241211001530",
"@blocksuite/global": "0.0.0-canary-20241212001527",
"@blocksuite/inline": "0.0.0-canary-20241212001527",
"@blocksuite/sync": "0.0.0-canary-20241212001527",
"@preact/signals-core": "^1.8.0",

@@ -28,0 +28,0 @@ "@types/flexsearch": "^0.7.6",

@@ -21,2 +21,3 @@ import { BlockSuiteError, ErrorCode } from '@blocksuite/global/exceptions';

}
async set(value: Blob): Promise<string>;

@@ -23,0 +24,0 @@

@@ -78,3 +78,3 @@ import { BlockSuiteError } from '@blocksuite/global/exceptions';

try {
const blockSnapshot = await this.job.blockToSnapshot(model);
const blockSnapshot = this.job.blockToSnapshot(model);
if (!blockSnapshot) return;

@@ -100,3 +100,3 @@ return await this.fromBlockSnapshot({

try {
const docSnapshot = await this.job.docToSnapshot(doc);
const docSnapshot = this.job.docToSnapshot(doc);
if (!docSnapshot) return;

@@ -122,3 +122,3 @@ return await this.fromDocSnapshot({

try {
const sliceSnapshot = await this.job.sliceToSnapshot(slice);
const sliceSnapshot = this.job.sliceToSnapshot(slice);
if (!sliceSnapshot) return;

@@ -125,0 +125,0 @@ wrapFakeNote(sliceSnapshot);

@@ -67,5 +67,3 @@ import type { BlockModel, InternalPrimitives } from '../schema/index.js';

toSnapshot({
model,
}: ToSnapshotPayload<Props>): Promise<BlockSnapshotLeaf> | BlockSnapshotLeaf {
toSnapshot({ model }: ToSnapshotPayload<Props>): BlockSnapshotLeaf {
const { id, flavour, version } = model;

@@ -72,0 +70,0 @@

@@ -65,7 +65,5 @@ import { BlockSuiteError, ErrorCode } from '@blocksuite/global/exceptions';

blockToSnapshot = async (
model: DraftModel
): Promise<BlockSnapshot | undefined> => {
blockToSnapshot = (model: DraftModel): BlockSnapshot | undefined => {
try {
const snapshot = await this._blockToSnapshot(model);
const snapshot = this._blockToSnapshot(model);
BlockSnapshotSchema.parse(snapshot);

@@ -106,3 +104,3 @@

docToSnapshot = async (doc: Doc): Promise<DocSnapshot | undefined> => {
docToSnapshot = (doc: Doc): DocSnapshot | undefined => {
try {

@@ -121,3 +119,3 @@ this._slots.beforeExport.emit({

}
const blocks = await this.blockToSnapshot(rootModel);
const blocks = this.blockToSnapshot(rootModel);
if (!blocks) {

@@ -146,5 +144,3 @@ return;

sliceToSnapshot = async (
slice: Slice
): Promise<SliceSnapshot | undefined> => {
sliceToSnapshot = (slice: Slice): SliceSnapshot | undefined => {
try {

@@ -159,3 +155,3 @@ this._slots.beforeExport.emit({

for (const block of content) {
const blockSnapshot = await this.blockToSnapshot(block);
const blockSnapshot = this.blockToSnapshot(block);
if (!blockSnapshot) {

@@ -365,3 +361,3 @@ return;

private async _blockToSnapshot(model: DraftModel): Promise<BlockSnapshot> {
private _blockToSnapshot(model: DraftModel): BlockSnapshot {
this._slots.beforeExport.emit({

@@ -373,11 +369,9 @@ type: 'block',

const transformer = this._getTransformer(schema);
const snapshotLeaf = await transformer.toSnapshot({
const snapshotLeaf = transformer.toSnapshot({
model,
assets: this._assetsManager,
});
const children = await Promise.all(
model.children.map(child => {
return this._blockToSnapshot(child);
})
);
const children = model.children.map(child => {
return this._blockToSnapshot(child);
});
const snapshot: BlockSnapshot = {

@@ -384,0 +378,0 @@ type: 'block',

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

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