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
1248
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.3.0-20221218000328-e1b2a90 to 0.3.0-20221218162424-d362663

10

dist/base.d.ts
import type { Page } from './workspace';
import type { TextType } from './text-adapter';
import { Signal } from './utils/signal';
interface StaticValue {
_$litStatic$: string;
r: unknown;
}
export interface IBaseBlockProps {

@@ -13,2 +17,5 @@ flavour: string;

static version: [number, number];
flavour: string;
tag: StaticValue;
id: string;
page: Page;

@@ -18,5 +25,3 @@ propsUpdated: Signal<void>;

childMap: Map<string, number>;
flavour: string;
type: string;
id: string;
children: BaseBlockModel[];

@@ -33,2 +38,3 @@ text?: TextType;

}
export {};
//# sourceMappingURL=base.d.ts.map

3

dist/doc-providers.js

@@ -13,3 +13,4 @@ import { WebrtcProvider } from 'y-webrtc';

];
const isLocalhost = window.location.hostname === 'localhost';
const isWeb = typeof window !== 'undefined';
const isLocalhost = isWeb && window.location.hostname === 'localhost';
const signaling = isLocalhost ? LOCAL_SIGNALING : DEFAULT_SIGNALING;

@@ -16,0 +17,0 @@ export class DebugDocProvider extends WebrtcProvider {

import type { BaseBlockModel } from '../base';
import type { BlockProps, PrefixedBlockProps, YBlock, YBlocks } from '../workspace/page';
import { PrelimText, Text, TextType } from '../text-adapter';
import type { Workspace } from '../workspace';
export declare function assertExists<T>(val: T | null | undefined): asserts val is T;

@@ -12,2 +13,4 @@ export declare function assertFlavours(model: BaseBlockModel, allowed: string[]): void;

export declare function toBlockProps(prefixedProps: PrefixedBlockProps): Partial<BlockProps>;
export declare function encodeWorkspaceAsYjsUpdateV2(workspace: Workspace): string;
export declare function applyYjsUpdateV2(workspace: Workspace, update: string): void;
//# sourceMappingURL=utils.d.ts.map
import * as Y from 'yjs';
import { PrelimText, Text } from '../text-adapter';
import { fromBase64, toBase64 } from 'lib0/buffer';
const SYS_KEYS = new Set(['id', 'flavour', 'children']);

@@ -145,2 +146,8 @@ // https://stackoverflow.com/questions/31538010/test-if-a-variable-is-a-primitive-rather-than-an-object

}
export function encodeWorkspaceAsYjsUpdateV2(workspace) {
return toBase64(Y.encodeStateAsUpdateV2(workspace.doc));
}
export function applyYjsUpdateV2(workspace, update) {
Y.applyUpdateV2(workspace.doc, fromBase64(update));
}
//# sourceMappingURL=utils.js.map

@@ -8,3 +8,3 @@ import * as Y from 'yjs';

import { assertValidChildren, initSysProps, syncBlockProps, trySyncTextProp, toBlockProps, matchFlavours, } from '../utils/utils';
const IS_WEB = typeof window !== 'undefined';
const isWeb = typeof window !== 'undefined';
function createChildMap(yChildIds) {

@@ -30,3 +30,3 @@ return new Map(yChildIds.map((child, index) => [child, index]));

this._historyAddObserver = (event) => {
if (IS_WEB) {
if (isWeb) {
event.stackItem.meta.set('cursor-location', this.awareness.getLocalCursor());

@@ -307,3 +307,3 @@ }

'affine:list',
'affine:code-block',
'affine:code',
]) &&

@@ -310,0 +310,0 @@ !yBlock.get('prop:text')) {

{
"name": "@blocksuite/store",
"version": "0.3.0-20221218000328-e1b2a90",
"version": "0.3.0-20221218162424-d362663",
"description": "BlockSuite data store built for general purpose state management.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -5,2 +5,8 @@ import type { Page } from './workspace';

// ported from lit
interface StaticValue {
_$litStatic$: string;
r: unknown;
}
export interface IBaseBlockProps {

@@ -18,2 +24,5 @@ flavour: string;

static version: [number, number];
flavour!: string;
tag!: StaticValue;
id: string;

@@ -25,5 +34,3 @@ page: Page;

flavour!: string;
type!: string;
id: string;
children: BaseBlockModel[];

@@ -30,0 +37,0 @@ // TODO use schema

@@ -41,3 +41,4 @@ import type * as Y from 'yjs';

const isLocalhost = window.location.hostname === 'localhost';
const isWeb = typeof window !== 'undefined';
const isLocalhost = isWeb && window.location.hostname === 'localhost';
const signaling = isLocalhost ? LOCAL_SIGNALING : DEFAULT_SIGNALING;

@@ -44,0 +45,0 @@

@@ -10,2 +10,4 @@ import * as Y from 'yjs';

import { PrelimText, Text, TextType } from '../text-adapter';
import type { Workspace } from '../workspace';
import { fromBase64, toBase64 } from 'lib0/buffer';

@@ -196,1 +198,9 @@ const SYS_KEYS = new Set(['id', 'flavour', 'children']);

}
export function encodeWorkspaceAsYjsUpdateV2(workspace: Workspace): string {
return toBase64(Y.encodeStateAsUpdateV2(workspace.doc));
}
export function applyYjsUpdateV2(workspace: Workspace, update: string): void {
Y.applyUpdateV2(workspace.doc, fromBase64(update));
}

@@ -37,3 +37,3 @@ import * as Y from 'yjs';

const IS_WEB = typeof window !== 'undefined';
const isWeb = typeof window !== 'undefined';

@@ -364,3 +364,3 @@ function createChildMap(yChildIds: Y.Array<string>) {

private _historyAddObserver = (event: { stackItem: StackItem }) => {
if (IS_WEB) {
if (isWeb) {
event.stackItem.meta.set(

@@ -413,3 +413,3 @@ 'cursor-location',

'affine:list',
'affine:code-block',
'affine:code',
]) &&

@@ -416,0 +416,0 @@ !yBlock.get('prop:text')

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