@blocksuite/block-std
Advanced tools
Comparing version 0.0.0-canary-20241219001505 to 0.0.0-canary-20241220001425
# @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 |
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1566400
22340
+ Added@blocksuite/global@0.0.0-canary-20241220001425(transitive)
+ Added@blocksuite/inline@0.0.0-canary-20241220001425(transitive)
+ Added@blocksuite/store@0.0.0-canary-20241220001425(transitive)
+ Added@blocksuite/sync@0.0.0-canary-20241220001425(transitive)
- Removed@blocksuite/global@0.0.0-canary-20241219001505(transitive)
- Removed@blocksuite/inline@0.0.0-canary-20241219001505(transitive)
- Removed@blocksuite/store@0.0.0-canary-20241219001505(transitive)
- Removed@blocksuite/sync@0.0.0-canary-20241219001505(transitive)