mirror of
https://github.com/tauri-apps/tauri-plugin-window.git
synced 2026-02-04 02:41:21 +01:00
Merge v1 into v2 (#468)
Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: FabianLars <fabianlars@fabianlars.de> Co-authored-by: FabianLars <FabianLars@users.noreply.github.com> Co-authored-by: Alexandre Dang <124160233+vdang-crabnebula@users.noreply.github.com> Co-authored-by: Ludea <ludovicw35@hotmail.com> Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com> Co-authored-by: Duke Jones <104690+dukejones@users.noreply.github.com> Co-authored-by: NaokiM03 <37442712+NaokiM03@users.noreply.github.com> Co-authored-by: Thibault <thibault_poisson@orange.fr> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: David Blythe <49919035+writeDavid@users.noreply.github.com> Co-authored-by: Lucas Nogueira <lucas@tauri.studio> fix(stronghold): change wrong argument name for `remove` (#422) fix(window-state): correctly set decoration state if no saved state exists, fixes #421 (#424) fix(stronghold): return null if there is no record (#129) fix(window-state): propagate promise (#435) closes #432 fix(window-state): manual default implentation (#425) fix(window-state): manual default implentation, closes #421 fix(deps): update rust crate iota-crypto to 0.21 (#438) fix readme example (#447) fix: handle recursive directory correctly (#455) fix(deps): update rust crate sqlx to 0.7. plugin-sql msrv is now 1.65 (#464) fix(persisted-scope): separately save asset protocol patterns (#459) fix(deps): update rust crate iota-crypto to 0.22 (#475) fix(deps): update tauri monorepo to v1.4.0 (#482) resolve to v15.1.0 (#489) fix(deps): update rust crate iota-crypto to 0.23 (#495) Committed via a GitHub action: https://github.com/tauri-apps/plugins-workspace/actions/runs/5602434141 Co-authored-by: lucasfernog <lucasfernog@users.noreply.github.com>
This commit is contained in:
@@ -258,7 +258,7 @@ function getAll(): WebviewWindow[] {
|
||||
new WebviewWindow(w.label, {
|
||||
// @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor
|
||||
skip: true,
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -309,7 +309,7 @@ class WebviewWindowHandle {
|
||||
*/
|
||||
async listen<T>(
|
||||
event: EventName,
|
||||
handler: EventCallback<T>
|
||||
handler: EventCallback<T>,
|
||||
): Promise<UnlistenFn> {
|
||||
if (this._handleTauriEvent(event, handler)) {
|
||||
return Promise.resolve(() => {
|
||||
@@ -435,7 +435,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
"plugin:window|inner_position",
|
||||
{
|
||||
label: this.label,
|
||||
}
|
||||
},
|
||||
)
|
||||
.then(({ x, y }) => new PhysicalPosition(x, y));
|
||||
}
|
||||
@@ -458,7 +458,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
"plugin:window|outer_position",
|
||||
{
|
||||
label: this.label,
|
||||
}
|
||||
},
|
||||
)
|
||||
.then(({ x, y }) => new PhysicalPosition(x, y));
|
||||
}
|
||||
@@ -482,7 +482,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
"plugin:window|inner_size",
|
||||
{
|
||||
label: this.label,
|
||||
}
|
||||
},
|
||||
)
|
||||
.then(({ width, height }) => new PhysicalSize(width, height));
|
||||
}
|
||||
@@ -506,7 +506,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
"plugin:window|outer_size",
|
||||
{
|
||||
label: this.label,
|
||||
}
|
||||
},
|
||||
)
|
||||
.then(({ width, height }) => new PhysicalSize(width, height));
|
||||
}
|
||||
@@ -782,7 +782,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* @since 2.0.0
|
||||
*/
|
||||
async requestUserAttention(
|
||||
requestType: UserAttentionType | null
|
||||
requestType: UserAttentionType | null,
|
||||
): Promise<void> {
|
||||
let requestType_ = null;
|
||||
if (requestType) {
|
||||
@@ -1182,7 +1182,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
async setSize(size: LogicalSize | PhysicalSize): Promise<void> {
|
||||
if (!size || (size.type !== "Logical" && size.type !== "Physical")) {
|
||||
throw new Error(
|
||||
"the `size` argument must be either a LogicalSize or a PhysicalSize instance"
|
||||
"the `size` argument must be either a LogicalSize or a PhysicalSize instance",
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1212,11 +1212,11 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* @since 2.0.0
|
||||
*/
|
||||
async setMinSize(
|
||||
size: LogicalSize | PhysicalSize | null | undefined
|
||||
size: LogicalSize | PhysicalSize | null | undefined,
|
||||
): Promise<void> {
|
||||
if (size && size.type !== "Logical" && size.type !== "Physical") {
|
||||
throw new Error(
|
||||
"the `size` argument must be either a LogicalSize or a PhysicalSize instance"
|
||||
"the `size` argument must be either a LogicalSize or a PhysicalSize instance",
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1248,11 +1248,11 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* @since 2.0.0
|
||||
*/
|
||||
async setMaxSize(
|
||||
size: LogicalSize | PhysicalSize | null | undefined
|
||||
size: LogicalSize | PhysicalSize | null | undefined,
|
||||
): Promise<void> {
|
||||
if (size && size.type !== "Logical" && size.type !== "Physical") {
|
||||
throw new Error(
|
||||
"the `size` argument must be either a LogicalSize or a PhysicalSize instance"
|
||||
"the `size` argument must be either a LogicalSize or a PhysicalSize instance",
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1284,14 +1284,14 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* @since 2.0.0
|
||||
*/
|
||||
async setPosition(
|
||||
position: LogicalPosition | PhysicalPosition
|
||||
position: LogicalPosition | PhysicalPosition,
|
||||
): Promise<void> {
|
||||
if (
|
||||
!position ||
|
||||
(position.type !== "Logical" && position.type !== "Physical")
|
||||
) {
|
||||
throw new Error(
|
||||
"the `position` argument must be either a LogicalPosition or a PhysicalPosition instance"
|
||||
"the `position` argument must be either a LogicalPosition or a PhysicalPosition instance",
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1484,14 +1484,14 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* @since 2.0.0
|
||||
*/
|
||||
async setCursorPosition(
|
||||
position: LogicalPosition | PhysicalPosition
|
||||
position: LogicalPosition | PhysicalPosition,
|
||||
): Promise<void> {
|
||||
if (
|
||||
!position ||
|
||||
(position.type !== "Logical" && position.type !== "Physical")
|
||||
) {
|
||||
throw new Error(
|
||||
"the `position` argument must be either a LogicalPosition or a PhysicalPosition instance"
|
||||
"the `position` argument must be either a LogicalPosition or a PhysicalPosition instance",
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1626,7 +1626,7 @@ class WindowManager extends WebviewWindowHandle {
|
||||
*/
|
||||
/* eslint-disable @typescript-eslint/promise-function-async */
|
||||
async onCloseRequested(
|
||||
handler: (event: CloseRequestedEvent) => void | Promise<void>
|
||||
handler: (event: CloseRequestedEvent) => void | Promise<void>,
|
||||
): Promise<UnlistenFn> {
|
||||
return this.listen<null>(TauriEvent.WINDOW_CLOSE_REQUESTED, (event) => {
|
||||
const evt = new CloseRequestedEvent(event);
|
||||
@@ -1663,13 +1663,13 @@ class WindowManager extends WebviewWindowHandle {
|
||||
TauriEvent.WINDOW_FOCUS,
|
||||
(event) => {
|
||||
handler({ ...event, payload: true });
|
||||
}
|
||||
},
|
||||
);
|
||||
const unlistenBlur = await this.listen<PhysicalPosition>(
|
||||
TauriEvent.WINDOW_BLUR,
|
||||
(event) => {
|
||||
handler({ ...event, payload: false });
|
||||
}
|
||||
},
|
||||
);
|
||||
return () => {
|
||||
unlistenFocus();
|
||||
@@ -1701,11 +1701,11 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* @since 2.0.0
|
||||
*/
|
||||
async onScaleChanged(
|
||||
handler: EventCallback<ScaleFactorChanged>
|
||||
handler: EventCallback<ScaleFactorChanged>,
|
||||
): Promise<UnlistenFn> {
|
||||
return this.listen<ScaleFactorChanged>(
|
||||
TauriEvent.WINDOW_SCALE_FACTOR_CHANGED,
|
||||
handler
|
||||
handler,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1760,27 +1760,27 @@ class WindowManager extends WebviewWindowHandle {
|
||||
* @since 2.0.0
|
||||
*/
|
||||
async onFileDropEvent(
|
||||
handler: EventCallback<FileDropEvent>
|
||||
handler: EventCallback<FileDropEvent>,
|
||||
): Promise<UnlistenFn> {
|
||||
const unlistenFileDrop = await this.listen<string[]>(
|
||||
TauriEvent.WINDOW_FILE_DROP,
|
||||
(event) => {
|
||||
handler({ ...event, payload: { type: "drop", paths: event.payload } });
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const unlistenFileHover = await this.listen<string[]>(
|
||||
TauriEvent.WINDOW_FILE_DROP_HOVER,
|
||||
(event) => {
|
||||
handler({ ...event, payload: { type: "hover", paths: event.payload } });
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const unlistenCancel = await this.listen<null>(
|
||||
TauriEvent.WINDOW_FILE_DROP_CANCELLED,
|
||||
(event) => {
|
||||
handler({ ...event, payload: { type: "cancel" } });
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
return () => {
|
||||
@@ -1963,11 +1963,11 @@ if ("__TAURI_METADATA__" in window) {
|
||||
{
|
||||
// @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor
|
||||
skip: true,
|
||||
}
|
||||
},
|
||||
);
|
||||
} else {
|
||||
console.warn(
|
||||
`Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label.\nNote that this is not an issue if running this frontend on a browser instead of a Tauri window.`
|
||||
`Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label.\nNote that this is not an issue if running this frontend on a browser instead of a Tauri window.`,
|
||||
);
|
||||
appWindow = new WebviewWindow("main", {
|
||||
// @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor
|
||||
|
||||
2
node_modules/tslib
generated
vendored
2
node_modules/tslib
generated
vendored
@@ -1 +1 @@
|
||||
../../../node_modules/.pnpm/tslib@2.5.0/node_modules/tslib
|
||||
../../../node_modules/.pnpm/tslib@2.6.0/node_modules/tslib
|
||||
@@ -5,7 +5,7 @@ import { createConfig } from "../../shared/rollup.config.mjs";
|
||||
export default createConfig({
|
||||
input: "guest-js/index.ts",
|
||||
pkg: JSON.parse(
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8")
|
||||
readFileSync(new URL("./package.json", import.meta.url), "utf8"),
|
||||
),
|
||||
external: [/^@tauri-apps\/api/],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user