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

@blocksuite/store

Package Overview
Dependencies
Maintainers
0
Versions
1271
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.19.0 to 0.19.1

33

CHANGELOG.md
# @blocksuite/store
## 0.19.1
### Patch Changes
- ded71c4: chore: release blocksuite
## Feat
- feat(edgeless): release frame by clicking ungroup button (#8984)
## Fix
- fix(edgeless): new inner frame should be inside parent frame (#8985)
- fix(inline): range in different document (#8986)
- fix(blocks): focus ai input after position updated (#8981)
- fix(edgeless): export template job and image upload api (#8980)
- fix: preview won't disappear after drag end (#8979)
- fix: corner cases of dnd (#8978)
- fix(blocks): doc link import/export handling (#8976)
## Chore
- chore(blocks): add image file upload entries to keyboard toolbar (#8987)
- chore(blocks): set readonly to database on mobile (#8975)
- chore: lock file maintenance (#8983)
- chore: lock file maintenance (#8982)
- chore: remove legacy versions in transformer and adapter (#8974)
- Updated dependencies [ded71c4]
- @blocksuite/global@0.19.1
- @blocksuite/inline@0.19.1
- @blocksuite/sync@0.19.1
## 0.19.0

@@ -4,0 +37,0 @@

1

dist/store/meta.d.ts

@@ -63,3 +63,2 @@ import type * as Y from 'yjs';

setProperties(meta: DocsPropertiesMeta): void;
updateVersion(collection: DocCollection): void;
/**

@@ -66,0 +65,0 @@ * @deprecated Only used for legacy doc version validation

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

}
updateVersion(collection) {
this._proxy.workspaceVersion = COLLECTION_VERSION;
this._proxy.pageVersion = PAGE_VERSION;
const _versions = {};
collection.schema.flavourSchemaMap.forEach((schema, flavour) => {
_versions[flavour] = schema.version;
});
this._proxy.blockVersions = _versions;
}
/**

@@ -174,0 +165,0 @@ * @deprecated Only used for legacy doc version validation

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

});
const { content, pageVersion, workspaceVersion, pageId, workspaceId } = slice.data;
const { content, pageId, workspaceId } = slice.data;
const contentSnapshot = [];

@@ -120,4 +120,2 @@ for (const block of content) {

pageId,
pageVersion,
workspaceVersion,
content: contentSnapshot,

@@ -207,3 +205,3 @@ };

});
const { content, pageVersion, workspaceVersion, workspaceId, pageId } = snapshot;
const { content, workspaceId, pageId } = snapshot;
// Create a temporary root snapshot to encompass all content blocks

@@ -229,4 +227,2 @@ const tmpRootSnapshot = {

content: contentBlocks,
pageVersion,
workspaceVersion,
workspaceId,

@@ -371,9 +367,3 @@ pageId,

const { meta } = this._collection;
const { pageVersion, workspaceVersion, docs } = meta;
if (!pageVersion) {
throw new BlockSuiteError(ErrorCode.TransformerError, 'Page version not found');
}
if (!workspaceVersion) {
throw new BlockSuiteError(ErrorCode.TransformerError, 'Workspace version not found');
}
const { docs } = meta;
if (!docs) {

@@ -383,4 +373,2 @@ throw new BlockSuiteError(ErrorCode.TransformerError, 'Docs not found');

return {
pageVersion,
workspaceVersion,
properties: {}, // for backward compatibility

@@ -387,0 +375,0 @@ pages: JSON.parse(JSON.stringify(docs)),

@@ -7,4 +7,2 @@ import type { Doc } from '../store/index.js';

pageId: string;
pageVersion: number;
workspaceVersion: number;
};

@@ -15,5 +13,3 @@ export declare class Slice {

get docId(): string;
get pageVersion(): number;
get workspaceId(): string;
get workspaceVersion(): number;
constructor(data: SliceData);

@@ -20,0 +16,0 @@ static fromModels(doc: Doc, models: DraftModel[]): Slice;

@@ -1,2 +0,1 @@

import { BlockSuiteError, ErrorCode } from '@blocksuite/global/exceptions';
export class Slice {

@@ -9,11 +8,5 @@ get content() {

}
get pageVersion() {
return this.data.pageVersion;
}
get workspaceId() {
return this.data.workspaceId;
}
get workspaceVersion() {
return this.data.workspaceVersion;
}
constructor(data) {

@@ -23,7 +16,2 @@ this.data = data;

static fromModels(doc, models) {
const meta = doc.collection.meta;
const { pageVersion, workspaceVersion } = meta;
if (!pageVersion || !workspaceVersion) {
throw new BlockSuiteError(ErrorCode.ModelCRUDError, 'pageVersion or workspaceVersion not found when creating slice');
}
return new Slice({

@@ -33,4 +21,2 @@ content: models,

pageId: doc.id,
pageVersion,
workspaceVersion,
});

@@ -37,0 +23,0 @@ }

@@ -15,4 +15,2 @@ import { z } from 'zod';

content: BlockSnapshot[];
pageVersion: number;
workspaceVersion: number;
workspaceId: string;

@@ -25,4 +23,2 @@ pageId: string;

type: 'info';
pageVersion: number;
workspaceVersion: number;
properties: DocsPropertiesMeta;

@@ -29,0 +25,0 @@ };

@@ -13,4 +13,2 @@ import { z } from 'zod';

content: BlockSnapshotSchema.array(),
pageVersion: z.number(),
workspaceVersion: z.number(),
workspaceId: z.string(),

@@ -22,4 +20,2 @@ pageId: z.string(),

type: z.literal('info'),
pageVersion: z.number(),
workspaceVersion: z.number(),
properties: z.record(z.any()),

@@ -26,0 +22,0 @@ });

{
"name": "@blocksuite/store",
"version": "0.19.0",
"version": "0.19.1",
"description": "BlockSuite data store built for general purpose state management.",

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

"dependencies": {
"@blocksuite/global": "0.19.0",
"@blocksuite/inline": "0.19.0",
"@blocksuite/sync": "0.19.0",
"@blocksuite/global": "0.19.1",
"@blocksuite/inline": "0.19.1",
"@blocksuite/sync": "0.19.1",
"@preact/signals-core": "^1.8.0",

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

@@ -248,14 +248,2 @@ import type * as Y from 'yjs';

updateVersion(collection: DocCollection) {
this._proxy.workspaceVersion = COLLECTION_VERSION;
this._proxy.pageVersion = PAGE_VERSION;
const _versions: Record<string, number> = {};
collection.schema.flavourSchemaMap.forEach((schema, flavour) => {
_versions[flavour] = schema.version;
});
this._proxy.blockVersions = _versions;
}
/**

@@ -262,0 +250,0 @@ * @deprecated Only used for legacy doc version validation

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

});
const { content, pageVersion, workspaceVersion, pageId, workspaceId } =
slice.data;
const { content, pageId, workspaceId } = slice.data;
const contentSnapshot = [];

@@ -162,4 +161,2 @@ for (const block of content) {

pageId,
pageVersion,
workspaceVersion,
content: contentSnapshot,

@@ -263,4 +260,3 @@ };

const { content, pageVersion, workspaceVersion, workspaceId, pageId } =
snapshot;
const { content, workspaceId, pageId } = snapshot;

@@ -292,4 +288,2 @@ // Create a temporary root snapshot to encompass all content blocks

content: contentBlocks,
pageVersion,
workspaceVersion,
workspaceId,

@@ -481,15 +475,3 @@ pageId,

const { meta } = this._collection;
const { pageVersion, workspaceVersion, docs } = meta;
if (!pageVersion) {
throw new BlockSuiteError(
ErrorCode.TransformerError,
'Page version not found'
);
}
if (!workspaceVersion) {
throw new BlockSuiteError(
ErrorCode.TransformerError,
'Workspace version not found'
);
}
const { docs } = meta;
if (!docs) {

@@ -499,4 +481,2 @@ throw new BlockSuiteError(ErrorCode.TransformerError, 'Docs not found');

return {
pageVersion,
workspaceVersion,
properties: {}, // for backward compatibility

@@ -503,0 +483,0 @@ pages: JSON.parse(JSON.stringify(docs)) as DocMeta[],

@@ -1,3 +0,1 @@

import { BlockSuiteError, ErrorCode } from '@blocksuite/global/exceptions';
import type { Doc } from '../store/index.js';

@@ -10,4 +8,2 @@ import type { DraftModel } from './draft.js';

pageId: string;
pageVersion: number;
workspaceVersion: number;
};

@@ -24,6 +20,2 @@

get pageVersion() {
return this.data.pageVersion;
}
get workspaceId() {

@@ -33,17 +25,5 @@ return this.data.workspaceId;

get workspaceVersion() {
return this.data.workspaceVersion;
}
constructor(readonly data: SliceData) {}
static fromModels(doc: Doc, models: DraftModel[]) {
const meta = doc.collection.meta;
const { pageVersion, workspaceVersion } = meta;
if (!pageVersion || !workspaceVersion) {
throw new BlockSuiteError(
ErrorCode.ModelCRUDError,
'pageVersion or workspaceVersion not found when creating slice'
);
}
return new Slice({

@@ -53,6 +33,4 @@ content: models,

pageId: doc.id,
pageVersion,
workspaceVersion,
});
}
}

@@ -26,4 +26,2 @@ import { z } from 'zod';

content: BlockSnapshot[];
pageVersion: number;
workspaceVersion: number;
workspaceId: string;

@@ -36,4 +34,2 @@ pageId: string;

content: BlockSnapshotSchema.array(),
pageVersion: z.number(),
workspaceVersion: z.number(),
workspaceId: z.string(),

@@ -46,4 +42,2 @@ pageId: z.string(),

type: 'info';
pageVersion: number;
workspaceVersion: number;
properties: DocsPropertiesMeta;

@@ -56,4 +50,2 @@ };

type: z.literal('info'),
pageVersion: z.number(),
workspaceVersion: z.number(),
properties: z.record(z.any()),

@@ -60,0 +52,0 @@ });

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

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