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
898
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.0.0-canary-20241219001505 to 0.0.0-canary-20241220001425

69

CHANGELOG.md
# @blocksuite/block-std
## 0.0.0-canary-20241219001505
## 0.0.0-canary-20241220001425

@@ -9,6 +9,67 @@ ### Patch Changes

- Updated dependencies
- @blocksuite/global@0.0.0-canary-20241219001505
- @blocksuite/inline@0.0.0-canary-20241219001505
- @blocksuite/store@0.0.0-canary-20241219001505
- @blocksuite/global@0.0.0-canary-20241220001425
- @blocksuite/inline@0.0.0-canary-20241220001425
- @blocksuite/store@0.0.0-canary-20241220001425
## 0.19.5
### Patch Changes
- d2a3eb7: Release patch version.
## Feat
- feat: add telemetry event for drop linked doc (#9028)
- feat(blocks): html adapter skip surface block children when doc mode (#9027)
- feat(blocks): add markdown adapter for surface elements (#9017)
## Fix
- fix: padding of toggle button (#9024)
- fix(blocks): remove lit dependency from theme service (#9025)
- fix(blocks): remove lit dependency from theme service (#9023)
- fix: keyboard controller should attach event on document (#8801)
## Chore
- chore: use surface block flavour in adapter (#9022)
- chore(playground): bump pdf-viewer v0.1.1 (#9020)
- Updated dependencies [d2a3eb7]
- @blocksuite/global@0.19.5
- @blocksuite/inline@0.19.5
- @blocksuite/store@0.19.5
## 0.19.4
### Patch Changes
- 8ae61d6: Improves edgeless viewport stability
## Feat
- feat(database): add AddDatabase event tracking to slash menu (#9015)
## Fix
- fix: should show title alias first (#9005)
## Chore
- chore(blocks): add event tracking for attachment upload (#9008)
- chore(blocks): reuse attachment upload method (#9007)
## Refactor
- refactor(std): optimize gfx viewport cache fields (#9014)
## Perf
- perf(edgeless): reduce redundant dom query per render (#9016)
- Updated dependencies [8ae61d6]
- @blocksuite/global@0.19.4
- @blocksuite/inline@0.19.4
- @blocksuite/store@0.19.4
## 0.19.3

@@ -15,0 +76,0 @@

@@ -10,4 +10,5 @@ import { Signal } from '@preact/signals-core';

private _init;
private _listenKeyboard;
dispose(): void;
}
//# sourceMappingURL=keyboard.d.ts.map

21

dist/gfx/keyboard.js

@@ -12,11 +12,10 @@ import { DisposableGroup } from '@blocksuite/global/utils';

_init() {
this._disposable.add(this.std.event.add('keyDown', evt => {
const state = evt.get('keyboardState');
this.shiftKey$.value = state.raw.shiftKey && state.raw.key === 'Shift';
this.spaceKey$.value = state.raw.code === 'Space';
this._disposable.add(this._listenKeyboard('keydown', evt => {
this.shiftKey$.value = evt.shiftKey && evt.key === 'Shift';
this.spaceKey$.value = evt.code === 'Space';
}));
this._disposable.add(this.std.event.add('keyUp', evt => {
const state = evt.get('keyboardState');
this.shiftKey$.value = state.raw.shiftKey && state.raw.key === 'Shift';
if (state.raw.code === 'Space') {
this._disposable.add(this._listenKeyboard('keyup', evt => {
this.shiftKey$.value =
evt.shiftKey && evt.key === 'Shift' ? true : false;
if (evt.code === 'Space') {
this.spaceKey$.value = false;

@@ -26,2 +25,8 @@ }

}
_listenKeyboard(event, callback) {
document.addEventListener(event, callback, false);
return () => {
document.removeEventListener(event, callback, false);
};
}
dispose() {

@@ -28,0 +33,0 @@ this._disposable.dispose();

{
"name": "@blocksuite/block-std",
"version": "0.0.0-canary-20241219001505",
"version": "0.0.0-canary-20241220001425",
"description": "Std for blocksuite blocks",

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

"dependencies": {
"@blocksuite/global": "0.0.0-canary-20241219001505",
"@blocksuite/inline": "0.0.0-canary-20241219001505",
"@blocksuite/store": "0.0.0-canary-20241219001505",
"@blocksuite/global": "0.0.0-canary-20241220001425",
"@blocksuite/inline": "0.0.0-canary-20241220001425",
"@blocksuite/store": "0.0.0-canary-20241220001425",
"@lit/context": "^1.1.2",

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

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

this._disposable.add(
this.std.event.add('keyDown', evt => {
const state = evt.get('keyboardState');
this.shiftKey$.value = state.raw.shiftKey && state.raw.key === 'Shift';
this.spaceKey$.value = state.raw.code === 'Space';
this._listenKeyboard('keydown', evt => {
this.shiftKey$.value = evt.shiftKey && evt.key === 'Shift';
this.spaceKey$.value = evt.code === 'Space';
})

@@ -29,8 +27,7 @@ );

this._disposable.add(
this.std.event.add('keyUp', evt => {
const state = evt.get('keyboardState');
this._listenKeyboard('keyup', evt => {
this.shiftKey$.value =
evt.shiftKey && evt.key === 'Shift' ? true : false;
this.shiftKey$.value = state.raw.shiftKey && state.raw.key === 'Shift';
if (state.raw.code === 'Space') {
if (evt.code === 'Space') {
this.spaceKey$.value = false;

@@ -42,2 +39,13 @@ }

private _listenKeyboard(
event: 'keydown' | 'keyup',
callback: (keyboardEvt: KeyboardEvent) => void
) {
document.addEventListener(event, callback, false);
return () => {
document.removeEventListener(event, callback, false);
};
}
dispose() {

@@ -44,0 +52,0 @@ this._disposable.dispose();

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