@reddb-io/ui 0.3.1 → 0.3.3
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.
- package/build/_app/immutable/assets/0.CEQwbG0J.css +1 -0
- package/build/_app/immutable/chunks/C-kqMbRi.js +1 -0
- package/build/_app/immutable/chunks/{CLBx21Hz.js → C3SGj6Qd.js} +2 -2
- package/build/_app/immutable/chunks/{DV9PDoM3.js → C9pP73gT.js} +1 -1
- package/build/_app/immutable/chunks/{CJFJ501n.js → CEBul73-.js} +1 -1
- package/build/_app/immutable/chunks/CHvQYbpl.js +1 -0
- package/build/_app/immutable/chunks/{8zg2gJwV.js → CXuFZWQe.js} +1 -1
- package/build/_app/immutable/chunks/CgIoFKBK.js +1 -0
- package/build/_app/immutable/chunks/D02PB2u7.js +1 -0
- package/build/_app/immutable/chunks/D6XJvoMn.js +404 -0
- package/build/_app/immutable/chunks/DLDgyIn5.js +1164 -0
- package/build/_app/immutable/chunks/{Bq4DTWK2.js → DN7v3Tar.js} +1 -1
- package/build/_app/immutable/entry/{app.BDog2y0J.js → app.BBk9O_OI.js} +2 -2
- package/build/_app/immutable/entry/start.C9qfj9ex.js +1 -0
- package/build/_app/immutable/nodes/0.BBf1ZyjL.js +2 -0
- package/build/_app/immutable/nodes/1.BmVeJAGw.js +1 -0
- package/build/_app/immutable/nodes/{10.D_FCLs0Z.js → 10.DZmZgLvj.js} +1 -1
- package/build/_app/immutable/nodes/{12.DPE6v6Zf.js → 12.CzMvqoYS.js} +2 -2
- package/build/_app/immutable/nodes/15.CRwZaU1B.js +60 -0
- package/build/_app/version.json +1 -1
- package/build/index.html +13 -13
- package/dist/embed/{AnalyticsView-D8z1Nsed.js → AnalyticsView-BWwvQS2I.js} +849 -849
- package/dist/embed/{AnalyticsView-D8z1Nsed.js.map → AnalyticsView-BWwvQS2I.js.map} +1 -1
- package/dist/embed/RedUiEmbedRoot-DAB-6DEr.js +35587 -0
- package/dist/embed/RedUiEmbedRoot-DAB-6DEr.js.map +1 -0
- package/dist/embed/event-BvRbkLjD.js +46 -0
- package/dist/embed/event-BvRbkLjD.js.map +1 -0
- package/dist/embed/index-BVxMkfHe.js +8 -0
- package/dist/embed/index-BVxMkfHe.js.map +1 -0
- package/dist/embed/index-Bgo4yw4C.js +856 -0
- package/dist/embed/index-Bgo4yw4C.js.map +1 -0
- package/dist/embed/{index-client-BeiP-va5.js → index-client-BHUUkI8H.js} +121 -120
- package/dist/embed/{index-client-BeiP-va5.js.map → index-client-BHUUkI8H.js.map} +1 -1
- package/dist/embed/index.js +1 -1
- package/dist/embed/{sigma.esm-qqKBpvin.js → sigma.esm-BOgYLguI.js} +2 -2
- package/dist/embed/{sigma.esm-qqKBpvin.js.map → sigma.esm-BOgYLguI.js.map} +1 -1
- package/dist/embed/window-ZR8_mM8o.js +1889 -0
- package/dist/embed/window-ZR8_mM8o.js.map +1 -0
- package/package.json +5 -3
- package/src/app.css +5 -0
- package/src/lib/ConnectDropdown.svelte +60 -3
- package/src/lib/DevConsole.svelte +155 -0
- package/src/lib/ErrorBoundary.fixture.svelte +11 -0
- package/src/lib/ErrorBoundary.fixtures.svelte.ts +5 -0
- package/src/lib/ErrorBoundary.svelte +78 -0
- package/src/lib/ErrorBoundaryCrashChild.fixture.svelte +9 -0
- package/src/lib/LoadingOverlay.svelte +109 -0
- package/src/lib/StatusBar.svelte +19 -1
- package/src/lib/Workspace.svelte +118 -2
- package/src/lib/connections.svelte.ts +95 -1
- package/src/lib/embed/RedUiEmbedRoot.svelte +13 -8
- package/src/lib/embed/index.ts +34 -1
- package/src/lib/index.ts +7 -0
- package/src/lib/loading.svelte.ts +142 -0
- package/src/lib/reddb/client.ts +133 -15
- package/src/lib/reddb/desktop-error.ts +89 -0
- package/src/lib/reddb/dev-console.ts +186 -0
- package/src/lib/reddb/index.ts +2 -0
- package/src/lib/reddb/local-url-provider.ts +4 -8
- package/src/lib/reddb/tauri-encrypted-store.ts +4 -9
- package/src/lib/tabs.svelte.ts +5 -0
- package/src/lib/workspace-session.ts +81 -0
- package/build/_app/immutable/assets/0.DgbuWrJy.css +0 -1
- package/build/_app/immutable/chunks/85-Fh5Zp.js +0 -404
- package/build/_app/immutable/chunks/CnD4hwxC.js +0 -1106
- package/build/_app/immutable/chunks/DQCYUNtS.js +0 -1
- package/build/_app/immutable/entry/start.D1J45dq5.js +0 -1
- package/build/_app/immutable/nodes/0.BTrC4th2.js +0 -1
- package/build/_app/immutable/nodes/1.Ds1Tbjsm.js +0 -1
- package/build/_app/immutable/nodes/15.CcJlZGxa.js +0 -60
- package/dist/embed/RedUiEmbedRoot-CtqTd_FG.js +0 -31302
- package/dist/embed/RedUiEmbedRoot-CtqTd_FG.js.map +0 -1
- package/dist/embed/index-w1Qo_uW0.js +0 -677
- package/dist/embed/index-w1Qo_uW0.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"window-ZR8_mM8o.js","sources":["../../../../node_modules/.pnpm/@tauri-apps+api@2.11.0/node_modules/@tauri-apps/api/dpi.js","../../../../node_modules/.pnpm/@tauri-apps+api@2.11.0/node_modules/@tauri-apps/api/image.js","../../../../node_modules/.pnpm/@tauri-apps+api@2.11.0/node_modules/@tauri-apps/api/window.js"],"sourcesContent":["import { SERIALIZE_TO_IPC_FN } from './core.js';\n\n// Copyright 2019-2024 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/**\n * A size represented in logical pixels.\n * Logical pixels are scaled according to the window's DPI scale.\n * Most browser APIs (i.e. `MouseEvent`'s `clientX`) will return logical pixels.\n *\n * For logical-pixel-based position, see {@linkcode LogicalPosition}.\n *\n * @since 2.0.0\n */\nclass LogicalSize {\n constructor(...args) {\n this.type = 'Logical';\n if (args.length === 1) {\n if ('Logical' in args[0]) {\n this.width = args[0].Logical.width;\n this.height = args[0].Logical.height;\n }\n else {\n this.width = args[0].width;\n this.height = args[0].height;\n }\n }\n else {\n this.width = args[0];\n this.height = args[1];\n }\n }\n /**\n * Converts the logical size to a physical one.\n * @example\n * ```typescript\n * import { LogicalSize } from '@tauri-apps/api/dpi';\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n *\n * const appWindow = getCurrentWindow();\n * const factor = await appWindow.scaleFactor();\n * const size = new LogicalSize(400, 500);\n * const physical = size.toPhysical(factor);\n * ```\n *\n * @since 2.0.0\n */\n toPhysical(scaleFactor) {\n return new PhysicalSize(this.width * scaleFactor, this.height * scaleFactor);\n }\n [SERIALIZE_TO_IPC_FN]() {\n return {\n width: this.width,\n height: this.height\n };\n }\n toJSON() {\n // eslint-disable-next-line security/detect-object-injection\n return this[SERIALIZE_TO_IPC_FN]();\n }\n}\n/**\n * A size represented in physical pixels.\n *\n * Physical pixels represent actual screen pixels, and are DPI-independent.\n * For high-DPI windows, this means that any point in the window on the screen\n * will have a different position in logical pixels {@linkcode LogicalSize}.\n *\n * For physical-pixel-based position, see {@linkcode PhysicalPosition}.\n *\n * @since 2.0.0\n */\nclass PhysicalSize {\n constructor(...args) {\n this.type = 'Physical';\n if (args.length === 1) {\n if ('Physical' in args[0]) {\n this.width = args[0].Physical.width;\n this.height = args[0].Physical.height;\n }\n else {\n this.width = args[0].width;\n this.height = args[0].height;\n }\n }\n else {\n this.width = args[0];\n this.height = args[1];\n }\n }\n /**\n * Converts the physical size to a logical one.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const appWindow = getCurrentWindow();\n * const factor = await appWindow.scaleFactor();\n * const size = await appWindow.innerSize(); // PhysicalSize\n * const logical = size.toLogical(factor);\n * ```\n */\n toLogical(scaleFactor) {\n return new LogicalSize(this.width / scaleFactor, this.height / scaleFactor);\n }\n [SERIALIZE_TO_IPC_FN]() {\n return {\n width: this.width,\n height: this.height\n };\n }\n toJSON() {\n // eslint-disable-next-line security/detect-object-injection\n return this[SERIALIZE_TO_IPC_FN]();\n }\n}\n/**\n * A size represented either in physical or in logical pixels.\n *\n * This type is basically a union type of {@linkcode LogicalSize} and {@linkcode PhysicalSize}\n * but comes in handy when using `tauri::Size` in Rust as an argument to a command, as this class\n * automatically serializes into a valid format so it can be deserialized correctly into `tauri::Size`\n *\n * So instead of\n * ```typescript\n * import { invoke } from '@tauri-apps/api/core';\n * import { LogicalSize, PhysicalSize } from '@tauri-apps/api/dpi';\n *\n * const size: LogicalSize | PhysicalSize = someFunction(); // where someFunction returns either LogicalSize or PhysicalSize\n * const validSize = size instanceof LogicalSize\n * ? { Logical: { width: size.width, height: size.height } }\n * : { Physical: { width: size.width, height: size.height } }\n * await invoke(\"do_something_with_size\", { size: validSize });\n * ```\n *\n * You can just use {@linkcode Size}\n * ```typescript\n * import { invoke } from '@tauri-apps/api/core';\n * import { LogicalSize, PhysicalSize, Size } from '@tauri-apps/api/dpi';\n *\n * const size: LogicalSize | PhysicalSize = someFunction(); // where someFunction returns either LogicalSize or PhysicalSize\n * const validSize = new Size(size);\n * await invoke(\"do_something_with_size\", { size: validSize });\n * ```\n *\n * @since 2.1.0\n */\nclass Size {\n constructor(size) {\n this.size = size;\n }\n toLogical(scaleFactor) {\n return this.size instanceof LogicalSize\n ? this.size\n : this.size.toLogical(scaleFactor);\n }\n toPhysical(scaleFactor) {\n return this.size instanceof PhysicalSize\n ? this.size\n : this.size.toPhysical(scaleFactor);\n }\n [SERIALIZE_TO_IPC_FN]() {\n return {\n [`${this.size.type}`]: {\n width: this.size.width,\n height: this.size.height\n }\n };\n }\n toJSON() {\n // eslint-disable-next-line security/detect-object-injection\n return this[SERIALIZE_TO_IPC_FN]();\n }\n}\n/**\n * A position represented in logical pixels.\n * For an explanation of what logical pixels are, see description of {@linkcode LogicalSize}.\n *\n * @since 2.0.0\n */\nclass LogicalPosition {\n constructor(...args) {\n this.type = 'Logical';\n if (args.length === 1) {\n if ('Logical' in args[0]) {\n this.x = args[0].Logical.x;\n this.y = args[0].Logical.y;\n }\n else {\n this.x = args[0].x;\n this.y = args[0].y;\n }\n }\n else {\n this.x = args[0];\n this.y = args[1];\n }\n }\n /**\n * Converts the logical position to a physical one.\n * @example\n * ```typescript\n * import { LogicalPosition } from '@tauri-apps/api/dpi';\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n *\n * const appWindow = getCurrentWindow();\n * const factor = await appWindow.scaleFactor();\n * const position = new LogicalPosition(400, 500);\n * const physical = position.toPhysical(factor);\n * ```\n *\n * @since 2.0.0\n */\n toPhysical(scaleFactor) {\n return new PhysicalPosition(this.x * scaleFactor, this.y * scaleFactor);\n }\n [SERIALIZE_TO_IPC_FN]() {\n return {\n x: this.x,\n y: this.y\n };\n }\n toJSON() {\n // eslint-disable-next-line security/detect-object-injection\n return this[SERIALIZE_TO_IPC_FN]();\n }\n}\n/**\n * A position represented in physical pixels.\n *\n * For an explanation of what physical pixels are, see description of {@linkcode PhysicalSize}.\n *\n * @since 2.0.0\n */\nclass PhysicalPosition {\n constructor(...args) {\n this.type = 'Physical';\n if (args.length === 1) {\n if ('Physical' in args[0]) {\n this.x = args[0].Physical.x;\n this.y = args[0].Physical.y;\n }\n else {\n this.x = args[0].x;\n this.y = args[0].y;\n }\n }\n else {\n this.x = args[0];\n this.y = args[1];\n }\n }\n /**\n * Converts the physical position to a logical one.\n * @example\n * ```typescript\n * import { PhysicalPosition } from '@tauri-apps/api/dpi';\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n *\n * const appWindow = getCurrentWindow();\n * const factor = await appWindow.scaleFactor();\n * const position = new PhysicalPosition(400, 500);\n * const physical = position.toLogical(factor);\n * ```\n *\n * @since 2.0.0\n */\n toLogical(scaleFactor) {\n return new LogicalPosition(this.x / scaleFactor, this.y / scaleFactor);\n }\n [SERIALIZE_TO_IPC_FN]() {\n return {\n x: this.x,\n y: this.y\n };\n }\n toJSON() {\n // eslint-disable-next-line security/detect-object-injection\n return this[SERIALIZE_TO_IPC_FN]();\n }\n}\n/**\n * A position represented either in physical or in logical pixels.\n *\n * This type is basically a union type of {@linkcode LogicalSize} and {@linkcode PhysicalSize}\n * but comes in handy when using `tauri::Position` in Rust as an argument to a command, as this class\n * automatically serializes into a valid format so it can be deserialized correctly into `tauri::Position`\n *\n * So instead of\n * ```typescript\n * import { invoke } from '@tauri-apps/api/core';\n * import { LogicalPosition, PhysicalPosition } from '@tauri-apps/api/dpi';\n *\n * const position: LogicalPosition | PhysicalPosition = someFunction(); // where someFunction returns either LogicalPosition or PhysicalPosition\n * const validPosition = position instanceof LogicalPosition\n * ? { Logical: { x: position.x, y: position.y } }\n * : { Physical: { x: position.x, y: position.y } }\n * await invoke(\"do_something_with_position\", { position: validPosition });\n * ```\n *\n * You can just use {@linkcode Position}\n * ```typescript\n * import { invoke } from '@tauri-apps/api/core';\n * import { LogicalPosition, PhysicalPosition, Position } from '@tauri-apps/api/dpi';\n *\n * const position: LogicalPosition | PhysicalPosition = someFunction(); // where someFunction returns either LogicalPosition or PhysicalPosition\n * const validPosition = new Position(position);\n * await invoke(\"do_something_with_position\", { position: validPosition });\n * ```\n *\n * @since 2.1.0\n */\nclass Position {\n constructor(position) {\n this.position = position;\n }\n toLogical(scaleFactor) {\n return this.position instanceof LogicalPosition\n ? this.position\n : this.position.toLogical(scaleFactor);\n }\n toPhysical(scaleFactor) {\n return this.position instanceof PhysicalPosition\n ? this.position\n : this.position.toPhysical(scaleFactor);\n }\n [SERIALIZE_TO_IPC_FN]() {\n return {\n [`${this.position.type}`]: {\n x: this.position.x,\n y: this.position.y\n }\n };\n }\n toJSON() {\n // eslint-disable-next-line security/detect-object-injection\n return this[SERIALIZE_TO_IPC_FN]();\n }\n}\n\nexport { LogicalPosition, LogicalSize, PhysicalPosition, PhysicalSize, Position, Size };\n","import { Resource, invoke } from './core.js';\n\n// Copyright 2019-2024 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/** An RGBA Image in row-major order from top to bottom. */\nclass Image extends Resource {\n /**\n * Creates an Image from a resource ID. For internal use only.\n *\n * @ignore\n */\n constructor(rid) {\n super(rid);\n }\n /** Creates a new Image using RGBA data, in row-major order from top to bottom, and with specified width and height. */\n static async new(rgba, width, height) {\n return invoke('plugin:image|new', {\n rgba: transformImage(rgba),\n width,\n height\n }).then((rid) => new Image(rid));\n }\n /**\n * Creates a new image using the provided bytes by inferring the file format.\n * If the format is known, prefer [@link Image.fromPngBytes] or [@link Image.fromIcoBytes].\n *\n * Only `ico` and `png` are supported (based on activated feature flag).\n *\n * Note that you need the `image-ico` or `image-png` Cargo features to use this API.\n * To enable it, change your Cargo.toml file:\n * ```toml\n * [dependencies]\n * tauri = { version = \"...\", features = [\"...\", \"image-png\"] }\n * ```\n */\n static async fromBytes(bytes) {\n return invoke('plugin:image|from_bytes', {\n bytes: transformImage(bytes)\n }).then((rid) => new Image(rid));\n }\n /**\n * Creates a new image using the provided path.\n *\n * Only `ico` and `png` are supported (based on activated feature flag).\n *\n * Note that you need the `image-ico` or `image-png` Cargo features to use this API.\n * To enable it, change your Cargo.toml file:\n * ```toml\n * [dependencies]\n * tauri = { version = \"...\", features = [\"...\", \"image-png\"] }\n * ```\n */\n static async fromPath(path) {\n return invoke('plugin:image|from_path', { path }).then((rid) => new Image(rid));\n }\n /** Returns the RGBA data for this image, in row-major order from top to bottom. */\n async rgba() {\n return invoke('plugin:image|rgba', {\n rid: this.rid\n }).then((buffer) => new Uint8Array(buffer));\n }\n /** Returns the size of this image. */\n async size() {\n return invoke('plugin:image|size', { rid: this.rid });\n }\n}\n/**\n * Transforms image from various types into a type acceptable by Rust.\n *\n * See [tauri::image::JsImage](https://docs.rs/tauri/2/tauri/image/enum.JsImage.html) for more information.\n * Note the API signature is not stable and might change.\n */\nfunction transformImage(image) {\n const ret = image == null\n ? null\n : typeof image === 'string'\n ? image\n : image instanceof Image\n ? image.rid\n : image;\n return ret;\n}\n\nexport { Image, transformImage };\n","import { PhysicalPosition, PhysicalSize, Size, Position } from './dpi.js';\nexport { LogicalPosition, LogicalSize } from './dpi.js';\nimport { listen, once, emit, emitTo, TauriEvent } from './event.js';\nimport { invoke } from './core.js';\nimport { transformImage } from './image.js';\n\n// Copyright 2019-2024 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/**\n * Provides APIs to create windows, communicate with other windows and manipulate the current window.\n *\n * #### Window events\n *\n * Events can be listened to using {@link Window.listen}:\n * ```typescript\n * import { getCurrentWindow } from \"@tauri-apps/api/window\";\n * getCurrentWindow().listen(\"my-window-event\", ({ event, payload }) => { });\n * ```\n *\n * @module\n */\n/**\n * Attention type to request on a window.\n *\n * @since 1.0.0\n */\nvar UserAttentionType;\n(function (UserAttentionType) {\n /**\n * #### Platform-specific\n * - **macOS:** Bounces the dock icon until the application is in focus.\n * - **Windows:** Flashes both the window and the taskbar button until the application is in focus.\n */\n UserAttentionType[UserAttentionType[\"Critical\"] = 1] = \"Critical\";\n /**\n * #### Platform-specific\n * - **macOS:** Bounces the dock icon once.\n * - **Windows:** Flashes the taskbar button until the application is in focus.\n */\n UserAttentionType[UserAttentionType[\"Informational\"] = 2] = \"Informational\";\n})(UserAttentionType || (UserAttentionType = {}));\nclass CloseRequestedEvent {\n constructor(event) {\n this._preventDefault = false;\n this.event = event.event;\n this.id = event.id;\n }\n preventDefault() {\n this._preventDefault = true;\n }\n isPreventDefault() {\n return this._preventDefault;\n }\n}\nvar ProgressBarStatus;\n(function (ProgressBarStatus) {\n /**\n * Hide progress bar.\n */\n ProgressBarStatus[\"None\"] = \"none\";\n /**\n * Normal state.\n */\n ProgressBarStatus[\"Normal\"] = \"normal\";\n /**\n * Indeterminate state. **Treated as Normal on Linux and macOS**\n */\n ProgressBarStatus[\"Indeterminate\"] = \"indeterminate\";\n /**\n * Paused state. **Treated as Normal on Linux**\n */\n ProgressBarStatus[\"Paused\"] = \"paused\";\n /**\n * Error state. **Treated as Normal on linux**\n */\n ProgressBarStatus[\"Error\"] = \"error\";\n})(ProgressBarStatus || (ProgressBarStatus = {}));\n/**\n * Get an instance of `Window` for the current window.\n *\n * @since 1.0.0\n */\nfunction getCurrentWindow() {\n return new Window(window.__TAURI_INTERNALS__.metadata.currentWindow.label, {\n // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor\n skip: true\n });\n}\n/**\n * Gets a list of instances of `Window` for all available windows.\n *\n * @since 1.0.0\n */\nasync function getAllWindows() {\n return invoke('plugin:window|get_all_windows').then((windows) => windows.map((w) => new Window(w, {\n // @ts-expect-error `skip` is not defined in the public API but it is handled by the constructor\n skip: true\n })));\n}\n/** @ignore */\n// events that are emitted right here instead of by the created window\nconst localTauriEvents = ['tauri://created', 'tauri://error'];\n/**\n * Create new window or get a handle to an existing one.\n *\n * Windows are identified by a *label* a unique identifier that can be used to reference it later.\n * It may only contain alphanumeric characters `a-zA-Z` plus the following special characters `-`, `/`, `:` and `_`.\n *\n * @example\n * ```typescript\n * import { Window } from \"@tauri-apps/api/window\"\n *\n * const appWindow = new Window('theUniqueLabel');\n *\n * appWindow.once('tauri://created', function () {\n * // window successfully created\n * });\n * appWindow.once('tauri://error', function (e) {\n * // an error happened creating the window\n * });\n *\n * // emit an event to the backend\n * await appWindow.emit(\"some-event\", \"data\");\n * // listen to an event from the backend\n * const unlisten = await appWindow.listen(\"event-name\", e => {});\n * unlisten();\n * ```\n *\n * @since 2.0.0\n */\nclass Window {\n /**\n * Creates a new Window.\n * @example\n * ```typescript\n * import { Window } from '@tauri-apps/api/window';\n * const appWindow = new Window('my-label');\n * appWindow.once('tauri://created', function () {\n * // window successfully created\n * });\n * appWindow.once('tauri://error', function (e) {\n * // an error happened creating the window\n * });\n * ```\n *\n * @param label The unique window label. Must be alphanumeric: `a-zA-Z-/:_`.\n * @returns The {@link Window} instance to communicate with the window.\n */\n constructor(label, options = {}) {\n var _a;\n this.label = label;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n this.listeners = Object.create(null);\n // @ts-expect-error `skip` is not a public API so it is not defined in WindowOptions\n if (!(options === null || options === void 0 ? void 0 : options.skip)) {\n invoke('plugin:window|create', {\n options: {\n ...options,\n parent: typeof options.parent === 'string'\n ? options.parent\n : (_a = options.parent) === null || _a === void 0 ? void 0 : _a.label,\n label\n }\n })\n .then(async () => this.emit('tauri://created'))\n .catch(async (e) => this.emit('tauri://error', e));\n }\n }\n /**\n * Gets the Window associated with the given label.\n * @example\n * ```typescript\n * import { Window } from '@tauri-apps/api/window';\n * const mainWindow = Window.getByLabel('main');\n * ```\n *\n * @param label The window label.\n * @returns The Window instance to communicate with the window or null if the window doesn't exist.\n */\n static async getByLabel(label) {\n var _a;\n return (_a = (await getAllWindows()).find((w) => w.label === label)) !== null && _a !== void 0 ? _a : null;\n }\n /**\n * Get an instance of `Window` for the current window.\n */\n static getCurrent() {\n return getCurrentWindow();\n }\n /**\n * Gets a list of instances of `Window` for all available windows.\n */\n static async getAll() {\n return getAllWindows();\n }\n /**\n * Gets the focused window.\n * @example\n * ```typescript\n * import { Window } from '@tauri-apps/api/window';\n * const focusedWindow = Window.getFocusedWindow();\n * ```\n *\n * @returns The Window instance or `undefined` if there is not any focused window.\n */\n static async getFocusedWindow() {\n for (const w of await getAllWindows()) {\n if (await w.isFocused()) {\n return w;\n }\n }\n return null;\n }\n /**\n * Listen to an emitted event on this window.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const unlisten = await getCurrentWindow().listen<string>('state-changed', (event) => {\n * console.log(`Got error: ${payload}`);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param handler Event handler.\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async listen(event, handler) {\n if (this._handleTauriEvent(event, handler)) {\n return () => {\n // eslint-disable-next-line security/detect-object-injection\n const listeners = this.listeners[event];\n listeners.splice(listeners.indexOf(handler), 1);\n };\n }\n return listen(event, handler, {\n target: { kind: 'Window', label: this.label }\n });\n }\n /**\n * Listen to an emitted event on this window only once.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const unlisten = await getCurrentWindow().once<null>('initialized', (event) => {\n * console.log(`Window initialized!`);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param handler Event handler.\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async once(event, handler) {\n if (this._handleTauriEvent(event, handler)) {\n return () => {\n // eslint-disable-next-line security/detect-object-injection\n const listeners = this.listeners[event];\n listeners.splice(listeners.indexOf(handler), 1);\n };\n }\n return once(event, handler, {\n target: { kind: 'Window', label: this.label }\n });\n }\n /**\n * Emits an event to all {@link EventTarget|targets}.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().emit('window-loaded', { loggedIn: true, token: 'authToken' });\n * ```\n *\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param payload Event payload.\n */\n async emit(event, payload) {\n if (localTauriEvents.includes(event)) {\n // eslint-disable-next-line\n for (const handler of this.listeners[event] || []) {\n handler({\n event,\n id: -1,\n payload\n });\n }\n return;\n }\n return emit(event, payload);\n }\n /**\n * Emits an event to all {@link EventTarget|targets} matching the given target.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().emit('main', 'window-loaded', { loggedIn: true, token: 'authToken' });\n * ```\n * @param target Label of the target Window/Webview/WebviewWindow or raw {@link EventTarget} object.\n * @param event Event name. Must include only alphanumeric characters, `-`, `/`, `:` and `_`.\n * @param payload Event payload.\n */\n async emitTo(target, event, payload) {\n if (localTauriEvents.includes(event)) {\n // eslint-disable-next-line security/detect-object-injection\n for (const handler of this.listeners[event] || []) {\n handler({\n event,\n id: -1,\n payload\n });\n }\n return;\n }\n return emitTo(target, event, payload);\n }\n /** @ignore */\n _handleTauriEvent(event, handler) {\n if (localTauriEvents.includes(event)) {\n if (!(event in this.listeners)) {\n // eslint-disable-next-line\n this.listeners[event] = [handler];\n }\n else {\n // eslint-disable-next-line\n this.listeners[event].push(handler);\n }\n return true;\n }\n return false;\n }\n // Getters\n /**\n * The scale factor that can be used to map physical pixels to logical pixels.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const factor = await getCurrentWindow().scaleFactor();\n * ```\n *\n * @returns The window's monitor scale factor.\n */\n async scaleFactor() {\n return invoke('plugin:window|scale_factor', {\n label: this.label\n });\n }\n /**\n * The position of the top-left hand corner of the window's client area relative to the top-left hand corner of the desktop.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const position = await getCurrentWindow().innerPosition();\n * ```\n *\n * @returns The window's inner position.\n */\n async innerPosition() {\n return invoke('plugin:window|inner_position', {\n label: this.label\n }).then((p) => new PhysicalPosition(p));\n }\n /**\n * The position of the top-left hand corner of the window relative to the top-left hand corner of the desktop.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const position = await getCurrentWindow().outerPosition();\n * ```\n *\n * @returns The window's outer position.\n */\n async outerPosition() {\n return invoke('plugin:window|outer_position', {\n label: this.label\n }).then((p) => new PhysicalPosition(p));\n }\n /**\n * The physical size of the window's client area.\n * The client area is the content of the window, excluding the title bar and borders.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const size = await getCurrentWindow().innerSize();\n * ```\n *\n * @returns The window's inner size.\n */\n async innerSize() {\n return invoke('plugin:window|inner_size', {\n label: this.label\n }).then((s) => new PhysicalSize(s));\n }\n /**\n * The physical size of the entire window.\n * These dimensions include the title bar and borders. If you don't want that (and you usually don't), use inner_size instead.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const size = await getCurrentWindow().outerSize();\n * ```\n *\n * @returns The window's outer size.\n */\n async outerSize() {\n return invoke('plugin:window|outer_size', {\n label: this.label\n }).then((s) => new PhysicalSize(s));\n }\n /**\n * Gets the window's current fullscreen state.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const fullscreen = await getCurrentWindow().isFullscreen();\n * ```\n *\n * @returns Whether the window is in fullscreen mode or not.\n */\n async isFullscreen() {\n return invoke('plugin:window|is_fullscreen', {\n label: this.label\n });\n }\n /**\n * Gets the window's current minimized state.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const minimized = await getCurrentWindow().isMinimized();\n * ```\n */\n async isMinimized() {\n return invoke('plugin:window|is_minimized', {\n label: this.label\n });\n }\n /**\n * Gets the window's current maximized state.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const maximized = await getCurrentWindow().isMaximized();\n * ```\n *\n * @returns Whether the window is maximized or not.\n */\n async isMaximized() {\n return invoke('plugin:window|is_maximized', {\n label: this.label\n });\n }\n /**\n * Gets the window's current focus state.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const focused = await getCurrentWindow().isFocused();\n * ```\n *\n * @returns Whether the window is focused or not.\n */\n async isFocused() {\n return invoke('plugin:window|is_focused', {\n label: this.label\n });\n }\n /**\n * Gets the window's current decorated state.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const decorated = await getCurrentWindow().isDecorated();\n * ```\n *\n * @returns Whether the window is decorated or not.\n */\n async isDecorated() {\n return invoke('plugin:window|is_decorated', {\n label: this.label\n });\n }\n /**\n * Gets the window's current resizable state.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const resizable = await getCurrentWindow().isResizable();\n * ```\n *\n * @returns Whether the window is resizable or not.\n */\n async isResizable() {\n return invoke('plugin:window|is_resizable', {\n label: this.label\n });\n }\n /**\n * Gets the window's native maximize button state.\n *\n * #### Platform-specific\n *\n * - **Linux / iOS / Android:** Unsupported.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const maximizable = await getCurrentWindow().isMaximizable();\n * ```\n *\n * @returns Whether the window's native maximize button is enabled or not.\n */\n async isMaximizable() {\n return invoke('plugin:window|is_maximizable', {\n label: this.label\n });\n }\n /**\n * Gets the window's native minimize button state.\n *\n * #### Platform-specific\n *\n * - **Linux / iOS / Android:** Unsupported.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const minimizable = await getCurrentWindow().isMinimizable();\n * ```\n *\n * @returns Whether the window's native minimize button is enabled or not.\n */\n async isMinimizable() {\n return invoke('plugin:window|is_minimizable', {\n label: this.label\n });\n }\n /**\n * Gets the window's native close button state.\n *\n * #### Platform-specific\n *\n * - **iOS / Android:** Unsupported.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const closable = await getCurrentWindow().isClosable();\n * ```\n *\n * @returns Whether the window's native close button is enabled or not.\n */\n async isClosable() {\n return invoke('plugin:window|is_closable', {\n label: this.label\n });\n }\n /**\n * Gets the window's current visible state.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const visible = await getCurrentWindow().isVisible();\n * ```\n *\n * @returns Whether the window is visible or not.\n */\n async isVisible() {\n return invoke('plugin:window|is_visible', {\n label: this.label\n });\n }\n /**\n * Gets the window's current title.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const title = await getCurrentWindow().title();\n * ```\n */\n async title() {\n return invoke('plugin:window|title', {\n label: this.label\n });\n }\n /**\n * Gets the window's current theme.\n *\n * #### Platform-specific\n *\n * - **macOS:** Theme was introduced on macOS 10.14. Returns `light` on macOS 10.13 and below.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const theme = await getCurrentWindow().theme();\n * ```\n *\n * @returns The window theme.\n */\n async theme() {\n return invoke('plugin:window|theme', {\n label: this.label\n });\n }\n /**\n * Whether the window is configured to be always on top of other windows or not.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * const alwaysOnTop = await getCurrentWindow().isAlwaysOnTop();\n * ```\n *\n * @returns Whether the window is visible or not.\n */\n async isAlwaysOnTop() {\n return invoke('plugin:window|is_always_on_top', {\n label: this.label\n });\n }\n async activityName() {\n return invoke('plugin:window|activity_name', {\n label: this.label\n });\n }\n async sceneIdentifier() {\n return invoke('plugin:window|scene_identifier', {\n label: this.label\n });\n }\n // Setters\n /**\n * Centers the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().center();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async center() {\n return invoke('plugin:window|center', {\n label: this.label\n });\n }\n /**\n * Requests user attention to the window, this has no effect if the application\n * is already focused. How requesting for user attention manifests is platform dependent,\n * see `UserAttentionType` for details.\n *\n * Providing `null` will unset the request for user attention. Unsetting the request for\n * user attention might not be done automatically by the WM when the window receives input.\n *\n * #### Platform-specific\n *\n * - **macOS:** `null` has no effect.\n * - **Linux:** Urgency levels have the same effect.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().requestUserAttention();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async requestUserAttention(requestType) {\n let requestType_ = null;\n if (requestType) {\n if (requestType === UserAttentionType.Critical) {\n requestType_ = { type: 'Critical' };\n }\n else {\n requestType_ = { type: 'Informational' };\n }\n }\n return invoke('plugin:window|request_user_attention', {\n label: this.label,\n value: requestType_\n });\n }\n /**\n * Updates the window resizable flag.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setResizable(false);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setResizable(resizable) {\n return invoke('plugin:window|set_resizable', {\n label: this.label,\n value: resizable\n });\n }\n /**\n * Enable or disable the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setEnabled(false);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n *\n * @since 2.0.0\n */\n async setEnabled(enabled) {\n return invoke('plugin:window|set_enabled', {\n label: this.label,\n value: enabled\n });\n }\n /**\n * Whether the window is enabled or disabled.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setEnabled(false);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n *\n * @since 2.0.0\n */\n async isEnabled() {\n return invoke('plugin:window|is_enabled', {\n label: this.label\n });\n }\n /**\n * Sets whether the window's native maximize button is enabled or not.\n * If resizable is set to false, this setting is ignored.\n *\n * #### Platform-specific\n *\n * - **macOS:** Disables the \"zoom\" button in the window titlebar, which is also used to enter fullscreen mode.\n * - **Linux / iOS / Android:** Unsupported.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setMaximizable(false);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setMaximizable(maximizable) {\n return invoke('plugin:window|set_maximizable', {\n label: this.label,\n value: maximizable\n });\n }\n /**\n * Sets whether the window's native minimize button is enabled or not.\n *\n * #### Platform-specific\n *\n * - **Linux / iOS / Android:** Unsupported.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setMinimizable(false);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setMinimizable(minimizable) {\n return invoke('plugin:window|set_minimizable', {\n label: this.label,\n value: minimizable\n });\n }\n /**\n * Sets whether the window's native close button is enabled or not.\n *\n * #### Platform-specific\n *\n * - **Linux:** GTK+ will do its best to convince the window manager not to show a close button. Depending on the system, this function may not have any effect when called on a window that is already visible\n * - **iOS / Android:** Unsupported.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setClosable(false);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setClosable(closable) {\n return invoke('plugin:window|set_closable', {\n label: this.label,\n value: closable\n });\n }\n /**\n * Sets the window title.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setTitle('Tauri');\n * ```\n *\n * @param title The new title\n * @returns A promise indicating the success or failure of the operation.\n */\n async setTitle(title) {\n return invoke('plugin:window|set_title', {\n label: this.label,\n value: title\n });\n }\n /**\n * Maximizes the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().maximize();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async maximize() {\n return invoke('plugin:window|maximize', {\n label: this.label\n });\n }\n /**\n * Unmaximizes the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().unmaximize();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async unmaximize() {\n return invoke('plugin:window|unmaximize', {\n label: this.label\n });\n }\n /**\n * Toggles the window maximized state.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().toggleMaximize();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async toggleMaximize() {\n return invoke('plugin:window|toggle_maximize', {\n label: this.label\n });\n }\n /**\n * Minimizes the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().minimize();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async minimize() {\n return invoke('plugin:window|minimize', {\n label: this.label\n });\n }\n /**\n * Unminimizes the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().unminimize();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async unminimize() {\n return invoke('plugin:window|unminimize', {\n label: this.label\n });\n }\n /**\n * Sets the window visibility to true.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().show();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async show() {\n return invoke('plugin:window|show', {\n label: this.label\n });\n }\n /**\n * Sets the window visibility to false.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().hide();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async hide() {\n return invoke('plugin:window|hide', {\n label: this.label\n });\n }\n /**\n * Closes the window.\n *\n * Note this emits a closeRequested event so you can intercept it. To force window close, use {@link Window.destroy}.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().close();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async close() {\n return invoke('plugin:window|close', {\n label: this.label\n });\n }\n /**\n * Destroys the window. Behaves like {@link Window.close} but forces the window close instead of emitting a closeRequested event.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().destroy();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async destroy() {\n return invoke('plugin:window|destroy', {\n label: this.label\n });\n }\n /**\n * Whether the window should have borders and bars.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setDecorations(false);\n * ```\n *\n * @param decorations Whether the window should have borders and bars.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setDecorations(decorations) {\n return invoke('plugin:window|set_decorations', {\n label: this.label,\n value: decorations\n });\n }\n /**\n * Whether or not the window should have shadow.\n *\n * #### Platform-specific\n *\n * - **Windows:**\n * - `false` has no effect on decorated window, shadows are always ON.\n * - `true` will make undecorated window have a 1px white border,\n * and on Windows 11, it will have a rounded corners.\n * - **Linux:** Unsupported.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setShadow(false);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setShadow(enable) {\n return invoke('plugin:window|set_shadow', {\n label: this.label,\n value: enable\n });\n }\n /**\n * Set window effects.\n */\n async setEffects(effects) {\n return invoke('plugin:window|set_effects', {\n label: this.label,\n value: effects\n });\n }\n /**\n * Clear any applied effects if possible.\n */\n async clearEffects() {\n return invoke('plugin:window|set_effects', {\n label: this.label,\n value: null\n });\n }\n /**\n * Whether the window should always be on top of other windows.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setAlwaysOnTop(true);\n * ```\n *\n * @param alwaysOnTop Whether the window should always be on top of other windows or not.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setAlwaysOnTop(alwaysOnTop) {\n return invoke('plugin:window|set_always_on_top', {\n label: this.label,\n value: alwaysOnTop\n });\n }\n /**\n * Whether the window should always be below other windows.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setAlwaysOnBottom(true);\n * ```\n *\n * @param alwaysOnBottom Whether the window should always be below other windows or not.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setAlwaysOnBottom(alwaysOnBottom) {\n return invoke('plugin:window|set_always_on_bottom', {\n label: this.label,\n value: alwaysOnBottom\n });\n }\n /**\n * Prevents the window contents from being captured by other apps.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setContentProtected(true);\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setContentProtected(protected_) {\n return invoke('plugin:window|set_content_protected', {\n label: this.label,\n value: protected_\n });\n }\n /**\n * Resizes the window with a new inner size.\n * @example\n * ```typescript\n * import { getCurrentWindow, LogicalSize } from '@tauri-apps/api/window';\n * await getCurrentWindow().setSize(new LogicalSize(600, 500));\n * ```\n *\n * @param size The logical or physical inner size.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setSize(size) {\n return invoke('plugin:window|set_size', {\n label: this.label,\n value: size instanceof Size ? size : new Size(size)\n });\n }\n /**\n * Sets the window minimum inner size. If the `size` argument is not provided, the constraint is unset.\n * @example\n * ```typescript\n * import { getCurrentWindow, PhysicalSize } from '@tauri-apps/api/window';\n * await getCurrentWindow().setMinSize(new PhysicalSize(600, 500));\n * ```\n *\n * @param size The logical or physical inner size, or `null` to unset the constraint.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setMinSize(size) {\n return invoke('plugin:window|set_min_size', {\n label: this.label,\n value: size instanceof Size ? size : size ? new Size(size) : null\n });\n }\n /**\n * Sets the window maximum inner size. If the `size` argument is undefined, the constraint is unset.\n * @example\n * ```typescript\n * import { getCurrentWindow, LogicalSize } from '@tauri-apps/api/window';\n * await getCurrentWindow().setMaxSize(new LogicalSize(600, 500));\n * ```\n *\n * @param size The logical or physical inner size, or `null` to unset the constraint.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setMaxSize(size) {\n return invoke('plugin:window|set_max_size', {\n label: this.label,\n value: size instanceof Size ? size : size ? new Size(size) : null\n });\n }\n /**\n * Sets the window inner size constraints.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setSizeConstraints({ minWidth: 300 });\n * ```\n *\n * @param constraints The logical or physical inner size, or `null` to unset the constraint.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setSizeConstraints(constraints) {\n function logical(pixel) {\n return pixel ? { Logical: pixel } : null;\n }\n return invoke('plugin:window|set_size_constraints', {\n label: this.label,\n value: {\n minWidth: logical(constraints === null || constraints === void 0 ? void 0 : constraints.minWidth),\n minHeight: logical(constraints === null || constraints === void 0 ? void 0 : constraints.minHeight),\n maxWidth: logical(constraints === null || constraints === void 0 ? void 0 : constraints.maxWidth),\n maxHeight: logical(constraints === null || constraints === void 0 ? void 0 : constraints.maxHeight)\n }\n });\n }\n /**\n * Sets the window outer position.\n * @example\n * ```typescript\n * import { getCurrentWindow, LogicalPosition } from '@tauri-apps/api/window';\n * await getCurrentWindow().setPosition(new LogicalPosition(600, 500));\n * ```\n *\n * @param position The new position, in logical or physical pixels.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setPosition(position) {\n return invoke('plugin:window|set_position', {\n label: this.label,\n value: position instanceof Position ? position : new Position(position)\n });\n }\n /**\n * Sets the window fullscreen state.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setFullscreen(true);\n * ```\n *\n * @param fullscreen Whether the window should go to fullscreen or not.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setFullscreen(fullscreen) {\n return invoke('plugin:window|set_fullscreen', {\n label: this.label,\n value: fullscreen\n });\n }\n /**\n * On macOS, Toggles a fullscreen mode that doesn’t require a new macOS space. Returns a boolean indicating whether the transition was successful (this won’t work if the window was already in the native fullscreen).\n * This is how fullscreen used to work on macOS in versions before Lion. And allows the user to have a fullscreen window without using another space or taking control over the entire monitor.\n *\n * On other platforms, this is the same as {@link Window.setFullscreen}.\n *\n * @param fullscreen Whether the window should go to simple fullscreen or not.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setSimpleFullscreen(fullscreen) {\n return invoke('plugin:window|set_simple_fullscreen', {\n label: this.label,\n value: fullscreen\n });\n }\n /**\n * Bring the window to front and focus.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setFocus();\n * ```\n *\n * @returns A promise indicating the success or failure of the operation.\n */\n async setFocus() {\n return invoke('plugin:window|set_focus', {\n label: this.label\n });\n }\n /**\n * Sets whether the window can be focused.\n *\n * #### Platform-specific\n *\n * - **macOS**: If the window is already focused, it is not possible to unfocus it after calling `set_focusable(false)`.\n * In this case, you might consider calling {@link Window.setFocus} but it will move the window to the back i.e. at the bottom in terms of z-order.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setFocusable(true);\n * ```\n *\n * @param focusable Whether the window can be focused.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setFocusable(focusable) {\n return invoke('plugin:window|set_focusable', {\n label: this.label,\n value: focusable\n });\n }\n /**\n * Sets the window icon.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setIcon('/tauri/awesome.png');\n * ```\n *\n * Note that you may need the `image-ico` or `image-png` Cargo features to use this API.\n * To enable it, change your Cargo.toml file:\n * ```toml\n * [dependencies]\n * tauri = { version = \"...\", features = [\"...\", \"image-png\"] }\n * ```\n *\n * @param icon Icon bytes or path to the icon file.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setIcon(icon) {\n return invoke('plugin:window|set_icon', {\n label: this.label,\n value: transformImage(icon)\n });\n }\n /**\n * Whether the window icon should be hidden from the taskbar or not.\n *\n * #### Platform-specific\n *\n * - **macOS:** Unsupported.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setSkipTaskbar(true);\n * ```\n *\n * @param skip true to hide window icon, false to show it.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setSkipTaskbar(skip) {\n return invoke('plugin:window|set_skip_taskbar', {\n label: this.label,\n value: skip\n });\n }\n /**\n * Grabs the cursor, preventing it from leaving the window.\n *\n * There's no guarantee that the cursor will be hidden. You should\n * hide it by yourself if you want so.\n *\n * #### Platform-specific\n *\n * - **Linux:** Unsupported.\n * - **macOS:** This locks the cursor in a fixed location, which looks visually awkward.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setCursorGrab(true);\n * ```\n *\n * @param grab `true` to grab the cursor icon, `false` to release it.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setCursorGrab(grab) {\n return invoke('plugin:window|set_cursor_grab', {\n label: this.label,\n value: grab\n });\n }\n /**\n * Modifies the cursor's visibility.\n *\n * #### Platform-specific\n *\n * - **Windows:** The cursor is only hidden within the confines of the window.\n * - **macOS:** The cursor is hidden as long as the window has input focus, even if the cursor is\n * outside of the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setCursorVisible(false);\n * ```\n *\n * @param visible If `false`, this will hide the cursor. If `true`, this will show the cursor.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setCursorVisible(visible) {\n return invoke('plugin:window|set_cursor_visible', {\n label: this.label,\n value: visible\n });\n }\n /**\n * Modifies the cursor icon of the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setCursorIcon('help');\n * ```\n *\n * @param icon The new cursor icon.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setCursorIcon(icon) {\n return invoke('plugin:window|set_cursor_icon', {\n label: this.label,\n value: icon\n });\n }\n /**\n * Sets the window background color.\n *\n * #### Platform-specific:\n *\n * - **Windows:** alpha channel is ignored.\n * - **iOS / Android:** Unsupported.\n *\n * @returns A promise indicating the success or failure of the operation.\n *\n * @since 2.1.0\n */\n async setBackgroundColor(color) {\n return invoke('plugin:window|set_background_color', { color });\n }\n /**\n * Changes the position of the cursor in window coordinates.\n * @example\n * ```typescript\n * import { getCurrentWindow, LogicalPosition } from '@tauri-apps/api/window';\n * await getCurrentWindow().setCursorPosition(new LogicalPosition(600, 300));\n * ```\n *\n * @param position The new cursor position.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setCursorPosition(position) {\n return invoke('plugin:window|set_cursor_position', {\n label: this.label,\n value: position instanceof Position ? position : new Position(position)\n });\n }\n /**\n * Changes the cursor events behavior.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setIgnoreCursorEvents(true);\n * ```\n *\n * @param ignore `true` to ignore the cursor events; `false` to process them as usual.\n * @returns A promise indicating the success or failure of the operation.\n */\n async setIgnoreCursorEvents(ignore) {\n return invoke('plugin:window|set_ignore_cursor_events', {\n label: this.label,\n value: ignore\n });\n }\n /**\n * Starts dragging the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().startDragging();\n * ```\n *\n * @return A promise indicating the success or failure of the operation.\n */\n async startDragging() {\n return invoke('plugin:window|start_dragging', {\n label: this.label\n });\n }\n /**\n * Starts resize-dragging the window.\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().startResizeDragging();\n * ```\n *\n * @return A promise indicating the success or failure of the operation.\n */\n async startResizeDragging(direction) {\n return invoke('plugin:window|start_resize_dragging', {\n label: this.label,\n value: direction\n });\n }\n /**\n * Sets the badge count. It is app wide and not specific to this window.\n *\n * #### Platform-specific\n *\n * - **Windows**: Unsupported. Use @{linkcode Window.setOverlayIcon} instead.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setBadgeCount(5);\n * ```\n *\n * @param count The badge count. Use `undefined` to remove the badge.\n * @return A promise indicating the success or failure of the operation.\n */\n async setBadgeCount(count) {\n return invoke('plugin:window|set_badge_count', {\n label: this.label,\n value: count\n });\n }\n /**\n * Sets the badge cont **macOS only**.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setBadgeLabel(\"Hello\");\n * ```\n *\n * @param label The badge label. Use `undefined` to remove the badge.\n * @return A promise indicating the success or failure of the operation.\n */\n async setBadgeLabel(label) {\n return invoke('plugin:window|set_badge_label', {\n label: this.label,\n value: label\n });\n }\n /**\n * Sets the overlay icon. **Windows only**\n * The overlay icon can be set for every window.\n *\n *\n * Note that you may need the `image-ico` or `image-png` Cargo features to use this API.\n * To enable it, change your Cargo.toml file:\n *\n * ```toml\n * [dependencies]\n * tauri = { version = \"...\", features = [\"...\", \"image-png\"] }\n * ```\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from '@tauri-apps/api/window';\n * await getCurrentWindow().setOverlayIcon(\"/tauri/awesome.png\");\n * ```\n *\n * @param icon Icon bytes or path to the icon file. Use `undefined` to remove the overlay icon.\n * @return A promise indicating the success or failure of the operation.\n */\n async setOverlayIcon(icon) {\n return invoke('plugin:window|set_overlay_icon', {\n label: this.label,\n value: icon ? transformImage(icon) : undefined\n });\n }\n /**\n * Sets the taskbar progress state.\n *\n * #### Platform-specific\n *\n * - **Linux / macOS**: Progress bar is app-wide and not specific to this window.\n * - **Linux**: Only supported desktop environments with `libunity` (e.g. GNOME).\n *\n * @example\n * ```typescript\n * import { getCurrentWindow, ProgressBarStatus } from '@tauri-apps/api/window';\n * await getCurrentWindow().setProgressBar({\n * status: ProgressBarStatus.Normal,\n * progress: 50,\n * });\n * ```\n *\n * @return A promise indicating the success or failure of the operation.\n */\n async setProgressBar(state) {\n return invoke('plugin:window|set_progress_bar', {\n label: this.label,\n value: state\n });\n }\n /**\n * Sets whether the window should be visible on all workspaces or virtual desktops.\n *\n * #### Platform-specific\n *\n * - **Windows / iOS / Android:** Unsupported.\n *\n * @since 2.0.0\n */\n async setVisibleOnAllWorkspaces(visible) {\n return invoke('plugin:window|set_visible_on_all_workspaces', {\n label: this.label,\n value: visible\n });\n }\n /**\n * Sets the title bar style. **macOS only**.\n *\n * @since 2.0.0\n */\n async setTitleBarStyle(style) {\n return invoke('plugin:window|set_title_bar_style', {\n label: this.label,\n value: style\n });\n }\n /**\n * Set window theme, pass in `null` or `undefined` to follow system theme\n *\n * #### Platform-specific\n *\n * - **Linux / macOS**: Theme is app-wide and not specific to this window.\n * - **iOS / Android:** Unsupported.\n *\n * @since 2.0.0\n */\n async setTheme(theme) {\n return invoke('plugin:window|set_theme', {\n label: this.label,\n value: theme\n });\n }\n // Listeners\n /**\n * Listen to window resize.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from \"@tauri-apps/api/window\";\n * const unlisten = await getCurrentWindow().onResized(({ payload: size }) => {\n * console.log('Window resized', size);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async onResized(handler) {\n return this.listen(TauriEvent.WINDOW_RESIZED, (e) => {\n e.payload = new PhysicalSize(e.payload);\n handler(e);\n });\n }\n /**\n * Listen to window move.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from \"@tauri-apps/api/window\";\n * const unlisten = await getCurrentWindow().onMoved(({ payload: position }) => {\n * console.log('Window moved', position);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async onMoved(handler) {\n return this.listen(TauriEvent.WINDOW_MOVED, (e) => {\n e.payload = new PhysicalPosition(e.payload);\n handler(e);\n });\n }\n /**\n * Listen to window close requested. Emitted when the user requests to closes the window.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from \"@tauri-apps/api/window\";\n * import { confirm } from '@tauri-apps/api/dialog';\n * const unlisten = await getCurrentWindow().onCloseRequested(async (event) => {\n * const confirmed = await confirm('Are you sure?');\n * if (!confirmed) {\n * // user did not confirm closing the window; let's prevent it\n * event.preventDefault();\n * }\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async onCloseRequested(handler) {\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n return this.listen(TauriEvent.WINDOW_CLOSE_REQUESTED, async (event) => {\n const evt = new CloseRequestedEvent(event);\n await handler(evt);\n if (!evt.isPreventDefault()) {\n await this.destroy();\n }\n });\n }\n /**\n * Listen to a file drop event.\n * The listener is triggered when the user hovers the selected files on the webview,\n * drops the files or cancels the operation.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from \"@tauri-apps/api/webview\";\n * const unlisten = await getCurrentWindow().onDragDropEvent((event) => {\n * if (event.payload.type === 'over') {\n * console.log('User hovering', event.payload.position);\n * } else if (event.payload.type === 'drop') {\n * console.log('User dropped', event.payload.paths);\n * } else {\n * console.log('File drop cancelled');\n * }\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async onDragDropEvent(handler) {\n const unlistenDrag = await this.listen(TauriEvent.DRAG_ENTER, (event) => {\n handler({\n ...event,\n payload: {\n type: 'enter',\n paths: event.payload.paths,\n position: new PhysicalPosition(event.payload.position)\n }\n });\n });\n const unlistenDragOver = await this.listen(TauriEvent.DRAG_OVER, (event) => {\n handler({\n ...event,\n payload: {\n type: 'over',\n position: new PhysicalPosition(event.payload.position)\n }\n });\n });\n const unlistenDrop = await this.listen(TauriEvent.DRAG_DROP, (event) => {\n handler({\n ...event,\n payload: {\n type: 'drop',\n paths: event.payload.paths,\n position: new PhysicalPosition(event.payload.position)\n }\n });\n });\n const unlistenCancel = await this.listen(TauriEvent.DRAG_LEAVE, (event) => {\n handler({ ...event, payload: { type: 'leave' } });\n });\n return () => {\n unlistenDrag();\n unlistenDrop();\n unlistenDragOver();\n unlistenCancel();\n };\n }\n /**\n * Listen to window focus change.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from \"@tauri-apps/api/window\";\n * const unlisten = await getCurrentWindow().onFocusChanged(({ payload: focused }) => {\n * console.log('Focus changed, window is focused? ' + focused);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async onFocusChanged(handler) {\n const unlistenFocus = await this.listen(TauriEvent.WINDOW_FOCUS, (event) => {\n handler({ ...event, payload: true });\n });\n const unlistenBlur = await this.listen(TauriEvent.WINDOW_BLUR, (event) => {\n handler({ ...event, payload: false });\n });\n return () => {\n unlistenFocus();\n unlistenBlur();\n };\n }\n /**\n * Listen to window scale change. Emitted when the window's scale factor has changed.\n * The following user actions can cause DPI changes:\n * - Changing the display's resolution.\n * - Changing the display's scale factor (e.g. in Control Panel on Windows).\n * - Moving the window to a display with a different scale factor.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from \"@tauri-apps/api/window\";\n * const unlisten = await getCurrentWindow().onScaleChanged(({ payload }) => {\n * console.log('Scale changed', payload.scaleFactor, payload.size);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async onScaleChanged(handler) {\n return this.listen(TauriEvent.WINDOW_SCALE_FACTOR_CHANGED, handler);\n }\n /**\n * Listen to the system theme change.\n *\n * @example\n * ```typescript\n * import { getCurrentWindow } from \"@tauri-apps/api/window\";\n * const unlisten = await getCurrentWindow().onThemeChanged(({ payload: theme }) => {\n * console.log('New theme: ' + theme);\n * });\n *\n * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted\n * unlisten();\n * ```\n *\n * @returns A promise resolving to a function to unlisten to the event.\n * Note that removing the listener is required if your listener goes out of scope e.g. the component is unmounted.\n */\n async onThemeChanged(handler) {\n return this.listen(TauriEvent.WINDOW_THEME_CHANGED, handler);\n }\n}\n/**\n * Background throttling policy\n *\n * @since 2.0.0\n */\nvar BackgroundThrottlingPolicy;\n(function (BackgroundThrottlingPolicy) {\n BackgroundThrottlingPolicy[\"Disabled\"] = \"disabled\";\n BackgroundThrottlingPolicy[\"Throttle\"] = \"throttle\";\n BackgroundThrottlingPolicy[\"Suspend\"] = \"suspend\";\n})(BackgroundThrottlingPolicy || (BackgroundThrottlingPolicy = {}));\n/**\n * The scrollbar style to use in the webview.\n *\n * ## Platform-specific\n *\n * **Windows**: This option must be given the same value for all webviews.\n *\n * @since 2.8.0\n */\nvar ScrollBarStyle;\n(function (ScrollBarStyle) {\n /**\n * The default scrollbar style for the webview.\n */\n ScrollBarStyle[\"Default\"] = \"default\";\n /**\n * Fluent UI style overlay scrollbars. **Windows Only**\n *\n * Requires WebView2 Runtime version 125.0.2535.41 or higher, does nothing on older versions,\n * see https://learn.microsoft.com/en-us/microsoft-edge/webview2/release-notes/?tabs=dotnetcsharp#10253541\n */\n ScrollBarStyle[\"FluentOverlay\"] = \"fluentOverlay\";\n})(ScrollBarStyle || (ScrollBarStyle = {}));\n/**\n * Platform-specific window effects\n *\n * @since 2.0.0\n */\nvar Effect;\n(function (Effect) {\n /**\n * A default material appropriate for the view's effectiveAppearance. **macOS 10.14-**\n *\n * @deprecated since macOS 10.14. You should instead choose an appropriate semantic material.\n */\n Effect[\"AppearanceBased\"] = \"appearanceBased\";\n /**\n * **macOS 10.14-**\n *\n * @deprecated since macOS 10.14. Use a semantic material instead.\n */\n Effect[\"Light\"] = \"light\";\n /**\n * **macOS 10.14-**\n *\n * @deprecated since macOS 10.14. Use a semantic material instead.\n */\n Effect[\"Dark\"] = \"dark\";\n /**\n * **macOS 10.14-**\n *\n * @deprecated since macOS 10.14. Use a semantic material instead.\n */\n Effect[\"MediumLight\"] = \"mediumLight\";\n /**\n * **macOS 10.14-**\n *\n * @deprecated since macOS 10.14. Use a semantic material instead.\n */\n Effect[\"UltraDark\"] = \"ultraDark\";\n /**\n * **macOS 10.10+**\n */\n Effect[\"Titlebar\"] = \"titlebar\";\n /**\n * **macOS 10.10+**\n */\n Effect[\"Selection\"] = \"selection\";\n /**\n * **macOS 10.11+**\n */\n Effect[\"Menu\"] = \"menu\";\n /**\n * **macOS 10.11+**\n */\n Effect[\"Popover\"] = \"popover\";\n /**\n * **macOS 10.11+**\n */\n Effect[\"Sidebar\"] = \"sidebar\";\n /**\n * **macOS 10.14+**\n */\n Effect[\"HeaderView\"] = \"headerView\";\n /**\n * **macOS 10.14+**\n */\n Effect[\"Sheet\"] = \"sheet\";\n /**\n * **macOS 10.14+**\n */\n Effect[\"WindowBackground\"] = \"windowBackground\";\n /**\n * **macOS 10.14+**\n */\n Effect[\"HudWindow\"] = \"hudWindow\";\n /**\n * **macOS 10.14+**\n */\n Effect[\"FullScreenUI\"] = \"fullScreenUI\";\n /**\n * **macOS 10.14+**\n */\n Effect[\"Tooltip\"] = \"tooltip\";\n /**\n * **macOS 10.14+**\n */\n Effect[\"ContentBackground\"] = \"contentBackground\";\n /**\n * **macOS 10.14+**\n */\n Effect[\"UnderWindowBackground\"] = \"underWindowBackground\";\n /**\n * **macOS 10.14+**\n */\n Effect[\"UnderPageBackground\"] = \"underPageBackground\";\n /**\n * **Windows 11 Only**\n */\n Effect[\"Mica\"] = \"mica\";\n /**\n * **Windows 7/10/11(22H1) Only**\n *\n * #### Notes\n *\n * This effect has bad performance when resizing/dragging the window on Windows 11 build 22621.\n */\n Effect[\"Blur\"] = \"blur\";\n /**\n * **Windows 10/11**\n *\n * #### Notes\n *\n * This effect has bad performance when resizing/dragging the window on Windows 10 v1903+ and Windows 11 build 22000.\n */\n Effect[\"Acrylic\"] = \"acrylic\";\n /**\n * Tabbed effect that matches the system dark preference **Windows 11 Only**\n */\n Effect[\"Tabbed\"] = \"tabbed\";\n /**\n * Tabbed effect with dark mode but only if dark mode is enabled on the system **Windows 11 Only**\n */\n Effect[\"TabbedDark\"] = \"tabbedDark\";\n /**\n * Tabbed effect with light mode **Windows 11 Only**\n */\n Effect[\"TabbedLight\"] = \"tabbedLight\";\n})(Effect || (Effect = {}));\n/**\n * Window effect state **macOS only**\n *\n * @see https://developer.apple.com/documentation/appkit/nsvisualeffectview/state\n *\n * @since 2.0.0\n */\nvar EffectState;\n(function (EffectState) {\n /**\n * Make window effect state follow the window's active state **macOS only**\n */\n EffectState[\"FollowsWindowActiveState\"] = \"followsWindowActiveState\";\n /**\n * Make window effect state always active **macOS only**\n */\n EffectState[\"Active\"] = \"active\";\n /**\n * Make window effect state always inactive **macOS only**\n */\n EffectState[\"Inactive\"] = \"inactive\";\n})(EffectState || (EffectState = {}));\nfunction mapMonitor(m) {\n return m === null\n ? null\n : {\n name: m.name,\n scaleFactor: m.scaleFactor,\n position: new PhysicalPosition(m.position),\n size: new PhysicalSize(m.size),\n workArea: {\n position: new PhysicalPosition(m.workArea.position),\n size: new PhysicalSize(m.workArea.size)\n }\n };\n}\n/**\n * Returns the monitor on which the window currently resides.\n * Returns `null` if current monitor can't be detected.\n * @example\n * ```typescript\n * import { currentMonitor } from '@tauri-apps/api/window';\n * const monitor = await currentMonitor();\n * ```\n *\n * @since 1.0.0\n */\nasync function currentMonitor() {\n return invoke('plugin:window|current_monitor').then(mapMonitor);\n}\n/**\n * Returns the primary monitor of the system.\n * Returns `null` if it can't identify any monitor as a primary one.\n * @example\n * ```typescript\n * import { primaryMonitor } from '@tauri-apps/api/window';\n * const monitor = await primaryMonitor();\n * ```\n *\n * @since 1.0.0\n */\nasync function primaryMonitor() {\n return invoke('plugin:window|primary_monitor').then(mapMonitor);\n}\n/**\n * Returns the monitor that contains the given point. Returns `null` if can't find any.\n * @example\n * ```typescript\n * import { monitorFromPoint } from '@tauri-apps/api/window';\n * const monitor = await monitorFromPoint(100.0, 200.0);\n * ```\n *\n * @since 1.0.0\n */\nasync function monitorFromPoint(x, y) {\n return invoke('plugin:window|monitor_from_point', {\n x,\n y\n }).then(mapMonitor);\n}\n/**\n * Returns the list of all the monitors available on the system.\n * @example\n * ```typescript\n * import { availableMonitors } from '@tauri-apps/api/window';\n * const monitors = await availableMonitors();\n * ```\n *\n * @since 1.0.0\n */\nasync function availableMonitors() {\n return invoke('plugin:window|available_monitors').then((ms) => ms.map(mapMonitor));\n}\n/**\n * Get the cursor position relative to the top-left hand corner of the desktop.\n *\n * Note that the top-left hand corner of the desktop is not necessarily the same as the screen.\n * If the user uses a desktop with multiple monitors,\n * the top-left hand corner of the desktop is the top-left hand corner of the main monitor on Windows and macOS\n * or the top-left of the leftmost monitor on X11.\n *\n * The coordinates can be negative if the top-left hand corner of the window is outside of the visible screen region.\n */\nasync function cursorPosition() {\n return invoke('plugin:window|cursor_position').then((v) => new PhysicalPosition(v));\n}\n\nexport { CloseRequestedEvent, Effect, EffectState, PhysicalPosition, PhysicalSize, ProgressBarStatus, UserAttentionType, Window, availableMonitors, currentMonitor, cursorPosition, getAllWindows, getCurrentWindow, monitorFromPoint, primaryMonitor };\n"],"names":["LogicalSize","args","scaleFactor","PhysicalSize","SERIALIZE_TO_IPC_FN","Size","size","LogicalPosition","PhysicalPosition","Position","position","Image","Resource","rid","rgba","width","height","invoke","transformImage","bytes","path","buffer","image","UserAttentionType","CloseRequestedEvent","event","ProgressBarStatus","getCurrentWindow","Window","getAllWindows","windows","w","localTauriEvents","label","options","_a","e","handler","listeners","listen","once","payload","emit","target","emitTo","p","s","requestType","requestType_","resizable","enabled","maximizable","minimizable","closable","title","decorations","enable","effects","alwaysOnTop","alwaysOnBottom","protected_","constraints","logical","pixel","fullscreen","focusable","icon","skip","grab","visible","color","ignore","direction","count","state","style","theme","TauriEvent","evt","unlistenDrag","unlistenDragOver","unlistenDrop","unlistenCancel","unlistenFocus","unlistenBlur","BackgroundThrottlingPolicy","ScrollBarStyle","Effect","EffectState"],"mappings":";;AAcA,MAAMA,EAAY;AAAA,EACd,eAAeC,GAAM;AACjB,SAAK,OAAO,WACRA,EAAK,WAAW,IACZ,aAAaA,EAAK,CAAC,KACnB,KAAK,QAAQA,EAAK,CAAC,EAAE,QAAQ,OAC7B,KAAK,SAASA,EAAK,CAAC,EAAE,QAAQ,WAG9B,KAAK,QAAQA,EAAK,CAAC,EAAE,OACrB,KAAK,SAASA,EAAK,CAAC,EAAE,WAI1B,KAAK,QAAQA,EAAK,CAAC,GACnB,KAAK,SAASA,EAAK,CAAC;AAAA,EAE5B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBA,WAA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GAAGA,MAAgBA,IAAc,CAAA,EAAG;","x_google_ignoreList":[0,1,2]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reddb-io/ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "RedDB UI components and standalone web application.",
|
|
6
6
|
"type": "module",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"@sigma/edge-curve": "^3.1.0",
|
|
52
52
|
"@sigma/node-border": "^3.0.0",
|
|
53
53
|
"@tauri-apps/api": "^2.5.0",
|
|
54
|
+
"@tauri-apps/plugin-dialog": "^2.5.0",
|
|
54
55
|
"@tauri-apps/plugin-http": "^2.5.9",
|
|
55
56
|
"@xyflow/svelte": "^1.2.0",
|
|
56
57
|
"bits-ui": "^2.18.1",
|
|
@@ -63,8 +64,8 @@
|
|
|
63
64
|
"sigma": "^3.0.3",
|
|
64
65
|
"tailwind-merge": "^3.6.0",
|
|
65
66
|
"tailwind-variants": "^2.1.0",
|
|
66
|
-
"@reddb-io/ui-kit": "0.3.
|
|
67
|
-
"@reddb-io/ui-mcp": "0.3.
|
|
67
|
+
"@reddb-io/ui-kit": "0.3.3",
|
|
68
|
+
"@reddb-io/ui-mcp": "0.3.3"
|
|
68
69
|
},
|
|
69
70
|
"devDependencies": {
|
|
70
71
|
"@sveltejs/adapter-static": "^3.0.8",
|
|
@@ -72,6 +73,7 @@
|
|
|
72
73
|
"@sveltejs/vite-plugin-svelte": "^5.0.3",
|
|
73
74
|
"@tailwindcss/vite": "^4.3.0",
|
|
74
75
|
"@types/node": "^25.9.1",
|
|
76
|
+
"happy-dom": "^20.10.6",
|
|
75
77
|
"svelte": "^5.20.0",
|
|
76
78
|
"svelte-check": "^4.1.4",
|
|
77
79
|
"tailwindcss": "^4.3.0",
|
package/src/app.css
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
@import "tailwindcss";
|
|
2
|
+
/* DS 2026.08 (ds-sync pin): brand tokens + Theme Layer + vendored Kit sources. */
|
|
3
|
+
@import "../../../vendor/ds/tokens/tokens.css";
|
|
4
|
+
@import "../../../vendor/ds/tokens/density-comfortable.css";
|
|
5
|
+
@import "../../../vendor/ds/theme/theme.css";
|
|
6
|
+
@source "../../../vendor/ds/kits";
|
|
2
7
|
@import "@fontsource-variable/inter";
|
|
3
8
|
@import "@fontsource-variable/jetbrains-mono";
|
|
4
9
|
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { onMount } from 'svelte'
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
connection,
|
|
5
|
+
makeCustomConnection,
|
|
6
|
+
openDatabaseFile,
|
|
7
|
+
unreachableConnectHint,
|
|
8
|
+
} from './connections.svelte'
|
|
9
|
+
import {
|
|
10
|
+
Zap,
|
|
11
|
+
Loader2,
|
|
12
|
+
AlertCircle,
|
|
13
|
+
CheckCircle2,
|
|
14
|
+
Clock,
|
|
15
|
+
X,
|
|
16
|
+
Plug,
|
|
17
|
+
ChevronDown,
|
|
18
|
+
FolderOpen,
|
|
19
|
+
} from 'lucide-svelte'
|
|
5
20
|
|
|
6
21
|
const DEFAULT_URL = 'red://localhost'
|
|
7
22
|
|
|
@@ -29,7 +44,11 @@
|
|
|
29
44
|
// opaque transport-unsupported error from the client.
|
|
30
45
|
if (!connection.canReach(cleaned)) {
|
|
31
46
|
status = 'error'
|
|
32
|
-
|
|
47
|
+
// A file:// target on the web gets an honest, actionable explanation
|
|
48
|
+
// (#123) instead of the generic transport-unsupported line.
|
|
49
|
+
error =
|
|
50
|
+
unreachableConnectHint(cleaned) ??
|
|
51
|
+
`This app can't reach that transport here — supported: ${supportedHint}`
|
|
33
52
|
return
|
|
34
53
|
}
|
|
35
54
|
status = 'probing'
|
|
@@ -51,6 +70,27 @@
|
|
|
51
70
|
attempt(url)
|
|
52
71
|
}
|
|
53
72
|
|
|
73
|
+
// Desktop-only "Open database file…" flow (#123): the native OS picker feeds
|
|
74
|
+
// the chosen .rdb into the existing file:// connect path. Hidden on the web
|
|
75
|
+
// Surface, where there is no picker (file:// is unreachable there).
|
|
76
|
+
async function openFile() {
|
|
77
|
+
status = 'probing'
|
|
78
|
+
error = null
|
|
79
|
+
rtt = null
|
|
80
|
+
const res = await openDatabaseFile()
|
|
81
|
+
if (res.ok) {
|
|
82
|
+
status = 'ok'
|
|
83
|
+
rtt = connection.probe.rtt_ms ?? null
|
|
84
|
+
url = connection.active.url
|
|
85
|
+
setTimeout(() => (open = false), 350)
|
|
86
|
+
} else if (res.cancelled) {
|
|
87
|
+
status = 'idle'
|
|
88
|
+
} else {
|
|
89
|
+
status = 'error'
|
|
90
|
+
error = res.reason ?? 'unreachable'
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
54
94
|
function fmtRel(ms: number) {
|
|
55
95
|
const d = Date.now() - ms
|
|
56
96
|
if (d < 60_000) return 'just now'
|
|
@@ -110,6 +150,10 @@
|
|
|
110
150
|
const reachableHistory = $derived(
|
|
111
151
|
connection.history.filter((h) => !h.url || connection.canReach(h.url)),
|
|
112
152
|
)
|
|
153
|
+
|
|
154
|
+
// Native file open is only reachable on a Surface that can speak the unix /
|
|
155
|
+
// embedded-file transport (the Tauri desktop shell) (#123).
|
|
156
|
+
const canOpenFile = $derived(connection.supportedTransports.includes('unix'))
|
|
113
157
|
</script>
|
|
114
158
|
|
|
115
159
|
<div class="relative">
|
|
@@ -176,6 +220,19 @@
|
|
|
176
220
|
</div>
|
|
177
221
|
</form>
|
|
178
222
|
|
|
223
|
+
{#if canOpenFile}
|
|
224
|
+
<button
|
|
225
|
+
type="button"
|
|
226
|
+
onclick={openFile}
|
|
227
|
+
disabled={status === 'probing'}
|
|
228
|
+
title="Open a local .rdb database file"
|
|
229
|
+
class="mt-1 w-full h-9 bg-bg-2 border border-line-2 text-fg-1 font-medium rounded-md cursor-pointer transition-colors hover:border-line-3 hover:text-fg-0 disabled:opacity-40 disabled:cursor-not-allowed flex items-center justify-center gap-2 text-[13px]"
|
|
230
|
+
>
|
|
231
|
+
<FolderOpen class="size-3.5 text-fg-3" />
|
|
232
|
+
Open database file…
|
|
233
|
+
</button>
|
|
234
|
+
{/if}
|
|
235
|
+
|
|
179
236
|
{#if reachableHistory.length > 0}
|
|
180
237
|
<div class="mt-3 pt-3 border-t border-line-1">
|
|
181
238
|
<div class="flex items-center gap-1.5 mb-2">
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// Instrumented developer console panel (#128). A collapsible, bottom-docked
|
|
3
|
+
// log of every query and HTTP call the client made — verb, target, duration,
|
|
4
|
+
// row count — copyable and secret-free. It bridges the framework-agnostic
|
|
5
|
+
// `devConsole` store (deliberately rune-free so the data layer can log
|
|
6
|
+
// without importing Svelte) into reactivity by subscribing and mirroring the
|
|
7
|
+
// snapshot into `$state`.
|
|
8
|
+
//
|
|
9
|
+
// It never steals the accent: status is carried by ok/danger dots and the
|
|
10
|
+
// panel chrome uses the neutral surface ramp, so the one-accent-per-screen
|
|
11
|
+
// rule (design principle #6) holds even while the console is open.
|
|
12
|
+
import { devConsole as defaultStore, type ConsoleEntry } from '#reddb'
|
|
13
|
+
import { X, Copy, Trash2, Check } from 'lucide-svelte'
|
|
14
|
+
|
|
15
|
+
let {
|
|
16
|
+
store = defaultStore,
|
|
17
|
+
open: openProp = false,
|
|
18
|
+
}: {
|
|
19
|
+
store?: typeof defaultStore
|
|
20
|
+
open?: boolean
|
|
21
|
+
} = $props()
|
|
22
|
+
|
|
23
|
+
// Seed the panel's open state from the prop once; thereafter it's toggled
|
|
24
|
+
// locally by the shell event and the close button.
|
|
25
|
+
// svelte-ignore state_referenced_locally
|
|
26
|
+
let open = $state(openProp)
|
|
27
|
+
let entries = $state<readonly ConsoleEntry[]>([])
|
|
28
|
+
let copiedId = $state<number | null>(null)
|
|
29
|
+
|
|
30
|
+
// Bridge the rune-free store into reactivity: subscribe once, mirror every
|
|
31
|
+
// snapshot into local `$state`. The subscribe fires immediately, so the
|
|
32
|
+
// panel paints the current log on mount.
|
|
33
|
+
$effect(() => store.subscribe((snap) => (entries = snap)))
|
|
34
|
+
|
|
35
|
+
// Toggle from anywhere in the shell (the StatusBar button dispatches this).
|
|
36
|
+
$effect(() => {
|
|
37
|
+
const toggle = () => (open = !open)
|
|
38
|
+
window.addEventListener('red:toggle-dev-console', toggle)
|
|
39
|
+
return () => window.removeEventListener('red:toggle-dev-console', toggle)
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
// Newest first — an operator reads the most recent call at the top.
|
|
43
|
+
const ordered = $derived([...entries].reverse())
|
|
44
|
+
|
|
45
|
+
async function copy(text: string, id: number) {
|
|
46
|
+
try {
|
|
47
|
+
await navigator.clipboard?.writeText(text)
|
|
48
|
+
copiedId = id
|
|
49
|
+
setTimeout(() => {
|
|
50
|
+
if (copiedId === id) copiedId = null
|
|
51
|
+
}, 1200)
|
|
52
|
+
} catch {
|
|
53
|
+
// Clipboard denied (insecure context / permissions) — silently no-op.
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function entryText(e: ConsoleEntry): string {
|
|
58
|
+
const head = `${e.verb} ${e.target} → ${e.ok ? (e.status ?? 'ok') : 'error'} · ${e.durationMs}ms${
|
|
59
|
+
e.rowCount === undefined ? '' : ` · ${e.rowCount} rows`
|
|
60
|
+
}`
|
|
61
|
+
const parts = [head]
|
|
62
|
+
if (e.payload) parts.push(e.payload)
|
|
63
|
+
if (e.error) parts.push(e.error)
|
|
64
|
+
return parts.join('\n')
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function fmtDuration(ms: number): string {
|
|
68
|
+
return ms >= 1000 ? `${(ms / 1000).toFixed(1)}s` : `${ms}ms`
|
|
69
|
+
}
|
|
70
|
+
</script>
|
|
71
|
+
|
|
72
|
+
{#if open}
|
|
73
|
+
<div
|
|
74
|
+
class="fixed inset-x-0 bottom-0 z-[9990] flex max-h-[45vh] flex-col border-t border-line-2 bg-bg-1 shadow-2xl"
|
|
75
|
+
role="log"
|
|
76
|
+
aria-label="Developer console"
|
|
77
|
+
data-testid="dev-console"
|
|
78
|
+
>
|
|
79
|
+
<div class="flex items-center justify-between gap-3 border-b border-line-1 bg-bg-2/60 px-3 py-1.5">
|
|
80
|
+
<div class="flex items-center gap-2 font-mono text-[11px] text-fg-2">
|
|
81
|
+
<span class="uppercase tracking-wider text-fg-1">Console</span>
|
|
82
|
+
<span class="text-fg-3" data-testid="dev-console-count">{entries.length} calls</span>
|
|
83
|
+
</div>
|
|
84
|
+
<div class="flex items-center gap-1">
|
|
85
|
+
<button
|
|
86
|
+
type="button"
|
|
87
|
+
onclick={() => store.clear()}
|
|
88
|
+
title="Clear console"
|
|
89
|
+
aria-label="Clear console"
|
|
90
|
+
class="inline-flex items-center gap-1 rounded px-1.5 py-0.5 font-mono text-[11px] text-fg-3 hover:bg-bg-3/60 hover:text-fg-1 transition-colors"
|
|
91
|
+
>
|
|
92
|
+
<Trash2 class="size-3" />
|
|
93
|
+
Clear
|
|
94
|
+
</button>
|
|
95
|
+
<button
|
|
96
|
+
type="button"
|
|
97
|
+
onclick={() => (open = false)}
|
|
98
|
+
title="Close console"
|
|
99
|
+
aria-label="Close console"
|
|
100
|
+
class="inline-flex items-center rounded p-0.5 text-fg-3 hover:bg-bg-3/60 hover:text-fg-1 transition-colors"
|
|
101
|
+
>
|
|
102
|
+
<X class="size-3.5" />
|
|
103
|
+
</button>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<div class="min-h-0 flex-1 overflow-y-auto">
|
|
108
|
+
{#if ordered.length === 0}
|
|
109
|
+
<div class="grid h-24 place-items-center font-mono text-[12px] text-fg-3">
|
|
110
|
+
No calls yet — the client hasn't asked the database anything.
|
|
111
|
+
</div>
|
|
112
|
+
{:else}
|
|
113
|
+
<ul class="divide-y divide-line-1/60">
|
|
114
|
+
{#each ordered as entry (entry.id)}
|
|
115
|
+
<li class="group flex items-start gap-2 px-3 py-1.5 font-mono text-[11px] hover:bg-bg-2/40" data-testid="dev-console-entry">
|
|
116
|
+
<span
|
|
117
|
+
class="mt-[5px] h-1.5 w-1.5 shrink-0 rounded-full"
|
|
118
|
+
class:bg-ok={entry.ok}
|
|
119
|
+
class:bg-danger={!entry.ok}
|
|
120
|
+
aria-hidden="true"
|
|
121
|
+
></span>
|
|
122
|
+
<span class="w-11 shrink-0 uppercase text-fg-2">{entry.verb}</span>
|
|
123
|
+
<span class="min-w-0 flex-1">
|
|
124
|
+
<span class="text-fg-1">{entry.target}</span>
|
|
125
|
+
{#if entry.payload}
|
|
126
|
+
<span class="ml-1 text-fg-3 break-all">{entry.payload.replace(/\s+/g, ' ').slice(0, 120)}</span>
|
|
127
|
+
{/if}
|
|
128
|
+
{#if entry.error}
|
|
129
|
+
<span class="ml-1 text-danger break-all">— {entry.error}</span>
|
|
130
|
+
{/if}
|
|
131
|
+
</span>
|
|
132
|
+
{#if entry.rowCount !== undefined}
|
|
133
|
+
<span class="shrink-0 tabular-nums text-fg-3" title="rows returned">{entry.rowCount}r</span>
|
|
134
|
+
{/if}
|
|
135
|
+
<span class="w-12 shrink-0 text-right tabular-nums text-fg-2" title="duration">{fmtDuration(entry.durationMs)}</span>
|
|
136
|
+
<button
|
|
137
|
+
type="button"
|
|
138
|
+
onclick={() => copy(entryText(entry), entry.id)}
|
|
139
|
+
title="Copy entry"
|
|
140
|
+
aria-label="Copy entry"
|
|
141
|
+
class="shrink-0 rounded p-0.5 text-fg-3 opacity-0 transition-opacity hover:bg-bg-3/60 hover:text-fg-1 group-hover:opacity-100 focus:opacity-100"
|
|
142
|
+
>
|
|
143
|
+
{#if copiedId === entry.id}
|
|
144
|
+
<Check class="size-3 text-ok" />
|
|
145
|
+
{:else}
|
|
146
|
+
<Copy class="size-3" />
|
|
147
|
+
{/if}
|
|
148
|
+
</button>
|
|
149
|
+
</li>
|
|
150
|
+
{/each}
|
|
151
|
+
</ul>
|
|
152
|
+
{/if}
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
{/if}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// Test-only harness: wraps the crash child in the real ErrorBoundary exactly
|
|
3
|
+
// as the Workspace root does, so the regression test exercises the shipped
|
|
4
|
+
// boundary rather than a stand-in.
|
|
5
|
+
import ErrorBoundary from './ErrorBoundary.svelte'
|
|
6
|
+
import CrashChild from './ErrorBoundaryCrashChild.fixture.svelte'
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<ErrorBoundary>
|
|
10
|
+
<CrashChild />
|
|
11
|
+
</ErrorBoundary>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Test-only reactive control for the ErrorBoundary regression test. Kept in a
|
|
2
|
+
// `.svelte.ts` module so the `$state` rune is compiled. The crash child reads
|
|
3
|
+
// `crashCtrl.crash` at (re)creation time, so flipping it before a boundary
|
|
4
|
+
// reset models a transient fault that has since cleared.
|
|
5
|
+
export const crashCtrl = $state({ crash: true, message: 'render-crash-test' })
|