@ng-desktop/desktop 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type NativeComputeMatch } from '@ng-desktop/platform';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
+
/** Result item paired with its original index and fuzzy relevance score from `NativeComputeService`. */
|
|
3
4
|
export interface NativeScoredItem<T> {
|
|
4
5
|
item: T;
|
|
5
6
|
index: number;
|
|
@@ -38,6 +38,7 @@ export interface NativeCloseRequestEvent {
|
|
|
38
38
|
export declare class NativeDesktopService {
|
|
39
39
|
private readonly bridge;
|
|
40
40
|
private readonly actionHandlers;
|
|
41
|
+
private readonly windowEventMasks;
|
|
41
42
|
readonly theme: WritableSignal<NativeThemeMode>;
|
|
42
43
|
readonly windowGeometry: WritableSignal<NativeWindowGeometry>;
|
|
43
44
|
readonly appMenu: WritableSignal<readonly NativeMenuItem[]>;
|
|
@@ -50,6 +50,7 @@ function parseBridgePayloadObject(raw) {
|
|
|
50
50
|
export class NativeDesktopService {
|
|
51
51
|
bridge = ensureNgNativeBridge();
|
|
52
52
|
actionHandlers = new Map();
|
|
53
|
+
windowEventMasks = new Map();
|
|
53
54
|
theme;
|
|
54
55
|
windowGeometry;
|
|
55
56
|
appMenu;
|
|
@@ -256,7 +257,10 @@ export class NativeDesktopService {
|
|
|
256
257
|
this.setPreventClose(options.preventClose, windowNodeId);
|
|
257
258
|
}
|
|
258
259
|
else {
|
|
259
|
-
this.
|
|
260
|
+
const masks = this.windowEventMasks.get(windowNodeId) ?? new Set();
|
|
261
|
+
masks.add('close-request');
|
|
262
|
+
this.windowEventMasks.set(windowNodeId, masks);
|
|
263
|
+
this.bridge.setAttribute(windowNodeId, 'event-mask', Array.from(masks).join(','));
|
|
260
264
|
}
|
|
261
265
|
const unlisten = this.bridge.listen(windowNodeId, 'close-request', (raw) => {
|
|
262
266
|
const parsed = parseBridgePayloadObject(raw);
|
|
@@ -13,7 +13,7 @@ export class NativeDropTargetDirective {
|
|
|
13
13
|
const elRef = inject(ElementRef);
|
|
14
14
|
const nativeEl = elRef.nativeElement;
|
|
15
15
|
renderer.setAttribute(nativeEl, 'drop-target', 'true');
|
|
16
|
-
this.unlisten = renderer.listen(nativeEl, '
|
|
16
|
+
this.unlisten = renderer.listen(nativeEl, 'drop', (event) => {
|
|
17
17
|
const paths = NativeDropTargetDirective.extractPaths(event);
|
|
18
18
|
if (paths.length > 0) {
|
|
19
19
|
this.fileDrop.emit(paths);
|
|
@@ -51,6 +51,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImpor
|
|
|
51
51
|
type: Directive,
|
|
52
52
|
args: [{
|
|
53
53
|
selector: '[ngNativeDropTarget]',
|
|
54
|
-
standalone: true,
|
|
55
54
|
}]
|
|
56
55
|
}], ctorParameters: () => [], propDecorators: { fileDrop: [{ type: i0.Output, args: ["fileDrop"] }] } });
|
package/fesm2022/fs-service.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Signal } from '@angular/core';
|
|
2
2
|
import { type NativeXdgDirKind } from '@ng-desktop/platform';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
+
/** Reactive file-watch handle backed by OS kernel notifications and an Angular `Signal`. */
|
|
4
5
|
export interface NativeWatchedFileRef<T> {
|
|
5
6
|
readonly path: string;
|
|
6
7
|
readonly value: Signal<T>;
|
package/package.json
CHANGED