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

@blocksuite/block-std

Package Overview
Dependencies
Maintainers
0
Versions
896
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blocksuite/block-std - npm Package Compare versions

Comparing version 0.17.16 to 0.17.17

dist/extension/selection.d.ts

28

CHANGELOG.md
# @blocksuite/block-std
## 0.17.17
### Patch Changes
- a89c9c1: ## Features
- feat: selection extension [#8464](https://github.com/toeverything/blocksuite/pull/8464)
## Bug Fixes
- perf(edgeless): reduce refresh of frame overlay [#8476](https://github.com/toeverything/blocksuite/pull/8476)
- fix(blocks): improve edgeless text block resizing behavior [#8473](https://github.com/toeverything/blocksuite/pull/8473)
- fix: turn off smooth scaling and cache bounds [#8472](https://github.com/toeverything/blocksuite/pull/8472)
- fix: add strategy option for portal [#8470](https://github.com/toeverything/blocksuite/pull/8470)
- fix(blocks): fix slash menu is triggered in ignored blocks [#8469](https://github.com/toeverything/blocksuite/pull/8469)
- fix(blocks): incorrect width of embed-linked-doc-block in edgeless [#8463](https://github.com/toeverything/blocksuite/pull/8463)
- fix: improve open link on link popup [#8462](https://github.com/toeverything/blocksuite/pull/8462)
- fix: do not enable shift-click center peek in edgeless [#8460](https://github.com/toeverything/blocksuite/pull/8460)
- fix(database): disable database block full-width in edgeless mode [#8461](https://github.com/toeverything/blocksuite/pull/8461)
- fix: check editable element active more accurately [#8457](https://github.com/toeverything/blocksuite/pull/8457)
- fix: edgeless image block rotate [#8458](https://github.com/toeverything/blocksuite/pull/8458)
- fix: outline popup ref area [#8456](https://github.com/toeverything/blocksuite/pull/8456)
- Updated dependencies [a89c9c1]
- @blocksuite/global@0.17.17
- @blocksuite/inline@0.17.17
- @blocksuite/store@0.17.17
## 0.17.16

@@ -4,0 +32,0 @@

3

dist/event/dispatcher.d.ts
import { DisposableGroup } from '@blocksuite/global/utils';
import { LifeCycleWatcher } from '../extension/index.js';
import { EditorHost } from '../view/index.js';
import { type UIEventHandler, UIEventStateContext } from './base.js';

@@ -28,3 +29,3 @@ declare const eventNames: readonly ["click", "doubleClick", "tripleClick", "pointerDown", "pointerMove", "pointerUp", "pointerOut", "dragStart", "dragMove", "dragEnd", "pinch", "pan", "keyDown", "keyUp", "selectionChange", "compositionStart", "compositionUpdate", "compositionEnd", "cut", "copy", "paste", "beforeInput", "blur", "focus", "drop", "contextMenu", "wheel"];

get active(): boolean;
get host(): import("../view/index.js").EditorHost;
get host(): EditorHost;
constructor(std: BlockSuite.Std);

@@ -31,0 +32,0 @@ private _bindEvents;

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

import { KeymapIdentifier } from '../identifier.js';
import { EditorHost } from '../view/index.js';
import { UIEventState, UIEventStateContext, } from './base.js';

@@ -184,2 +185,3 @@ import { ClipboardControl } from './control/clipboard.js';

element instanceof HTMLTextAreaElement ||
(element instanceof EditorHost && !element.doc.readonly) ||
element.isContentEditable);

@@ -186,0 +188,0 @@ }

@@ -8,2 +8,3 @@ export * from './block-view.js';

export * from './lifecycle-watcher.js';
export * from './selection.js';
export * from './service.js';

@@ -10,0 +11,0 @@ export * from './service-watcher.js';

@@ -8,2 +8,3 @@ export * from './block-view.js';

export * from './lifecycle-watcher.js';
export * from './selection.js';
export * from './service.js';

@@ -10,0 +11,0 @@ export * from './service-watcher.js';

@@ -5,2 +5,3 @@ import type { Command } from './command/index.js';

import type { BlockStdScope } from './scope/index.js';
import type { SelectionConstructor } from './selection/index.js';
import type { BlockViewType, WidgetViewMapType } from './spec/type.js';

@@ -26,2 +27,3 @@ export declare const BlockServiceIdentifier: import("@blocksuite/global/di").ServiceIdentifier<BlockService> & ((variant: import("@blocksuite/global/di").ServiceVariant) => import("@blocksuite/global/di").ServiceIdentifier<BlockService>);

}>);
export declare const SelectionIdentifier: import("@blocksuite/global/di").ServiceIdentifier<SelectionConstructor> & ((variant: import("@blocksuite/global/di").ServiceVariant) => import("@blocksuite/global/di").ServiceIdentifier<SelectionConstructor>);
//# sourceMappingURL=identifier.d.ts.map

@@ -11,2 +11,3 @@ import { createIdentifier } from '@blocksuite/global/di';

export const KeymapIdentifier = createIdentifier('Keymap');
export const SelectionIdentifier = createIdentifier('Selection');
//# sourceMappingURL=identifier.js.map

@@ -8,6 +8,4 @@ import type { ServiceProvider } from '@blocksuite/global/di';

import { UIEventDispatcher } from '../event/index.js';
import { GfxController } from '../gfx/controller.js';
import { RangeManager } from '../range/index.js';
import { SelectionManager } from '../selection/index.js';
import { ServiceManager } from '../service/index.js';
import { EditorHost } from '../view/element/index.js';

@@ -20,3 +18,3 @@ import { ViewStore } from '../view/view-store.js';

export declare class BlockStdScope {
static internalExtensions: (typeof CommandManager | typeof Clipboard | typeof GfxController | typeof SelectionManager | typeof RangeManager | typeof ViewStore | typeof ServiceManager | typeof UIEventDispatcher)[];
static internalExtensions: ExtensionType[];
private _getHost;

@@ -23,0 +21,0 @@ readonly container: Container;

@@ -9,3 +9,3 @@ import { Container } from '@blocksuite/global/di';

import { RangeManager } from '../range/index.js';
import { SelectionManager } from '../selection/index.js';
import { BlockSelectionExtension, CursorSelectionExtension, SelectionManager, SurfaceSelectionExtension, TextSelectionExtension, } from '../selection/index.js';
import { ServiceManager } from '../service/index.js';

@@ -23,2 +23,6 @@ import { EditorHost } from '../view/element/index.js';

GfxController,
BlockSelectionExtension,
TextSelectionExtension,
SurfaceSelectionExtension,
CursorSelectionExtension,
];

@@ -25,0 +29,0 @@ export class BlockStdScope {

@@ -0,4 +1,19 @@

import type { BlockSelection, CursorSelection, SurfaceSelection, TextSelection } from './variants/index.js';
export * from './base.js';
export * from './manager.js';
export * from './variants/index.js';
declare global {
namespace BlockSuite {
interface Selection {
block: typeof BlockSelection;
cursor: typeof CursorSelection;
surface: typeof SurfaceSelection;
text: typeof TextSelection;
}
type SelectionType = keyof Selection;
type SelectionInstance = {
[P in SelectionType]: InstanceType<Selection[P]>;
};
}
}
//# sourceMappingURL=index.d.ts.map

@@ -5,3 +5,3 @@ import { DisposableGroup, Slot } from '@blocksuite/global/utils';

import { LifeCycleWatcher } from '../extension/index.js';
interface SelectionConstructor {
export interface SelectionConstructor {
type: string;

@@ -47,3 +47,2 @@ new (...args: any[]): BaseSelection;

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

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

import { LifeCycleWatcher } from '../extension/index.js';
import { BlockSelection, CursorSelection, SurfaceSelection, TextSelection, } from './variants/index.js';
import { SelectionIdentifier } from '../identifier.js';
export class SelectionManager extends LifeCycleWatcher {

@@ -90,8 +90,5 @@ static { this.key = 'selectionManager'; }

_setupDefaultSelections() {
this.register([
TextSelection,
BlockSelection,
SurfaceSelection,
CursorSelection,
]);
this.std.provider.getAll(SelectionIdentifier).forEach(ctor => {
this.register(ctor);
});
}

@@ -98,0 +95,0 @@ clear(types) {

@@ -9,9 +9,3 @@ import { BaseSelection } from '../base.js';

}
declare global {
namespace BlockSuite {
interface Selection {
block: typeof BlockSelection;
}
}
}
export declare const BlockSelectionExtension: import("../../index.js").ExtensionType;
//# sourceMappingURL=block.d.ts.map
import z from 'zod';
import { SelectionExtension } from '../../extension/selection.js';
import { BaseSelection } from '../base.js';

@@ -26,2 +27,3 @@ const BlockSelectionSchema = z.object({

}
export const BlockSelectionExtension = SelectionExtension(BlockSelection);
//# sourceMappingURL=block.js.map

@@ -12,9 +12,3 @@ import { BaseSelection } from '../base.js';

}
declare global {
namespace BlockSuite {
interface Selection {
cursor: typeof CursorSelection;
}
}
}
export declare const CursorSelectionExtension: import("../../index.js").ExtensionType;
//# sourceMappingURL=cursor.d.ts.map
import z from 'zod';
import { SelectionExtension } from '../../extension/selection.js';
import { BaseSelection } from '../base.js';

@@ -33,2 +34,3 @@ const CursorSelectionSchema = z.object({

}
export const CursorSelectionExtension = SelectionExtension(CursorSelection);
//# sourceMappingURL=cursor.js.map

@@ -5,10 +5,2 @@ export * from './block.js';

export * from './text.js';
declare global {
namespace BlockSuite {
type SelectionType = keyof Selection;
type SelectionInstance = {
[P in SelectionType]: InstanceType<Selection[P]>;
};
}
}
//# sourceMappingURL=index.d.ts.map

@@ -14,9 +14,3 @@ import { BaseSelection } from '../base.js';

}
declare global {
namespace BlockSuite {
interface Selection {
surface: typeof SurfaceSelection;
}
}
}
export declare const SurfaceSelectionExtension: import("../../index.js").ExtensionType;
//# sourceMappingURL=surface.d.ts.map
import z from 'zod';
import { SelectionExtension } from '../../extension/selection.js';
import { BaseSelection } from '../base.js';

@@ -45,2 +46,3 @@ const SurfaceSelectionSchema = z.object({

}
export const SurfaceSelectionExtension = SelectionExtension(SurfaceSelection);
//# sourceMappingURL=surface.js.map

@@ -29,9 +29,3 @@ import { BaseSelection } from '../base.js';

}
declare global {
namespace BlockSuite {
interface Selection {
text: typeof TextSelection;
}
}
}
export declare const TextSelectionExtension: import("../../index.js").ExtensionType;
//# sourceMappingURL=text.d.ts.map
import z from 'zod';
import { SelectionExtension } from '../../extension/selection.js';
import { BaseSelection } from '../base.js';

@@ -73,2 +74,3 @@ const TextSelectionSchema = z.object({

}
export const TextSelectionExtension = SelectionExtension(TextSelection);
//# sourceMappingURL=text.js.map
{
"name": "@blocksuite/block-std",
"version": "0.17.16",
"version": "0.17.17",
"description": "Std for blocksuite blocks",

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

"dependencies": {
"@blocksuite/global": "0.17.16",
"@blocksuite/inline": "0.17.16",
"@blocksuite/store": "0.17.16",
"@blocksuite/global": "0.17.17",
"@blocksuite/inline": "0.17.17",
"@blocksuite/store": "0.17.17",
"@lit/context": "^1.1.2",

@@ -28,0 +28,0 @@ "@preact/signals-core": "^1.8.0",

import { BlockSuiteError, ErrorCode } from '@blocksuite/global/exceptions';
import { DisposableGroup } from '@blocksuite/global/utils';
import type { BlockComponent } from '../view/index.js';
import { LifeCycleWatcher } from '../extension/index.js';
import { KeymapIdentifier } from '../identifier.js';
import { type BlockComponent, EditorHost } from '../view/index.js';
import {

@@ -270,2 +269,3 @@ type UIEventHandler,

element instanceof HTMLTextAreaElement ||
(element instanceof EditorHost && !element.doc.readonly) ||
(element as HTMLElement).isContentEditable

@@ -272,0 +272,0 @@ );

@@ -8,4 +8,5 @@ export * from './block-view.js';

export * from './lifecycle-watcher.js';
export * from './selection.js';
export * from './service.js';
export * from './service-watcher.js';
export * from './widget-view-map.js';

@@ -7,2 +7,3 @@ import { createIdentifier } from '@blocksuite/global/di';

import type { BlockStdScope } from './scope/index.js';
import type { SelectionConstructor } from './selection/index.js';
import type { BlockViewType, WidgetViewMapType } from './spec/type.js';

@@ -36,1 +37,4 @@

}>('Keymap');
export const SelectionIdentifier =
createIdentifier<SelectionConstructor>('Selection');

@@ -21,3 +21,9 @@ import type { ServiceProvider } from '@blocksuite/global/di';

import { RangeManager } from '../range/index.js';
import { SelectionManager } from '../selection/index.js';
import {
BlockSelectionExtension,
CursorSelectionExtension,
SelectionManager,
SurfaceSelectionExtension,
TextSelectionExtension,
} from '../selection/index.js';
import { ServiceManager } from '../service/index.js';

@@ -41,2 +47,6 @@ import { EditorHost } from '../view/element/index.js';

GfxController,
BlockSelectionExtension,
TextSelectionExtension,
SurfaceSelectionExtension,
CursorSelectionExtension,
];

@@ -43,0 +53,0 @@

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

import type {
BlockSelection,
CursorSelection,
SurfaceSelection,
TextSelection,
} from './variants/index.js';
export * from './base.js';
export * from './manager.js';
export * from './variants/index.js';
declare global {
namespace BlockSuite {
interface Selection {
block: typeof BlockSelection;
cursor: typeof CursorSelection;
surface: typeof SurfaceSelection;
text: typeof TextSelection;
}
type SelectionType = keyof Selection;
type SelectionInstance = {
[P in SelectionType]: InstanceType<Selection[P]>;
};
}
}

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

import { LifeCycleWatcher } from '../extension/index.js';
import {
BlockSelection,
CursorSelection,
SurfaceSelection,
TextSelection,
} from './variants/index.js';
import { SelectionIdentifier } from '../identifier.js';
interface SelectionConstructor {
export interface SelectionConstructor {
type: string;

@@ -137,8 +132,5 @@ // eslint-disable-next-line @typescript-eslint/no-explicit-any

private _setupDefaultSelections() {
this.register([
TextSelection,
BlockSelection,
SurfaceSelection,
CursorSelection,
]);
this.std.provider.getAll(SelectionIdentifier).forEach(ctor => {
this.register(ctor);
});
}

@@ -145,0 +137,0 @@

import z from 'zod';
import { SelectionExtension } from '../../extension/selection.js';
import { BaseSelection } from '../base.js';

@@ -34,8 +35,2 @@

declare global {
namespace BlockSuite {
interface Selection {
block: typeof BlockSelection;
}
}
}
export const BlockSelectionExtension = SelectionExtension(BlockSelection);
import z from 'zod';
import { SelectionExtension } from '../../extension/selection.js';
import { BaseSelection } from '../base.js';

@@ -46,8 +47,2 @@

declare global {
namespace BlockSuite {
interface Selection {
cursor: typeof CursorSelection;
}
}
}
export const CursorSelectionExtension = SelectionExtension(CursorSelection);

@@ -5,11 +5,1 @@ export * from './block.js';

export * from './text.js';
declare global {
namespace BlockSuite {
type SelectionType = keyof Selection;
type SelectionInstance = {
[P in SelectionType]: InstanceType<Selection[P]>;
};
}
}
import z from 'zod';
import { SelectionExtension } from '../../extension/selection.js';
import { BaseSelection } from '../base.js';

@@ -71,8 +72,2 @@

declare global {
namespace BlockSuite {
interface Selection {
surface: typeof SurfaceSelection;
}
}
}
export const SurfaceSelectionExtension = SelectionExtension(SurfaceSelection);
import z from 'zod';
import { SelectionExtension } from '../../extension/selection.js';
import { BaseSelection } from '../base.js';

@@ -116,8 +117,2 @@

declare global {
namespace BlockSuite {
interface Selection {
text: typeof TextSelection;
}
}
}
export const TextSelectionExtension = SelectionExtension(TextSelection);

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

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

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