@reddb-io/ui 0.3.1 → 0.3.2

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.
Files changed (71) hide show
  1. package/build/_app/immutable/assets/0.BWZTMKZW.css +1 -0
  2. package/build/_app/immutable/chunks/{8zg2gJwV.js → B-yl15ta.js} +1 -1
  3. package/build/_app/immutable/chunks/{CJFJ501n.js → Bgb6fHGb.js} +1 -1
  4. package/build/_app/immutable/chunks/C-kqMbRi.js +1 -0
  5. package/build/_app/immutable/chunks/{CLBx21Hz.js → C3SGj6Qd.js} +2 -2
  6. package/build/_app/immutable/chunks/{DV9PDoM3.js → C7kf23SQ.js} +1 -1
  7. package/build/_app/immutable/chunks/CHvQYbpl.js +1 -0
  8. package/build/_app/immutable/chunks/CO7K4bD2.js +1164 -0
  9. package/build/_app/immutable/chunks/CP65IkJc.js +1 -0
  10. package/build/_app/immutable/chunks/CxnvJShw.js +404 -0
  11. package/build/_app/immutable/chunks/D02PB2u7.js +1 -0
  12. package/build/_app/immutable/chunks/{Bq4DTWK2.js → DN7v3Tar.js} +1 -1
  13. package/build/_app/immutable/entry/{app.BDog2y0J.js → app.BeX4Tmu5.js} +2 -2
  14. package/build/_app/immutable/entry/start.D7y1MZex.js +1 -0
  15. package/build/_app/immutable/nodes/0.C0e5KQVb.js +2 -0
  16. package/build/_app/immutable/nodes/1.ceiVuZbB.js +1 -0
  17. package/build/_app/immutable/nodes/{10.D_FCLs0Z.js → 10.DeFqKRR2.js} +2 -2
  18. package/build/_app/immutable/nodes/{12.DPE6v6Zf.js → 12.CzMvqoYS.js} +2 -2
  19. package/build/_app/immutable/nodes/{15.CcJlZGxa.js → 15.CRDBqbiH.js} +1 -1
  20. package/build/_app/version.json +1 -1
  21. package/build/index.html +13 -13
  22. package/dist/embed/{AnalyticsView-D8z1Nsed.js → AnalyticsView-SKyGxeAx.js} +849 -849
  23. package/dist/embed/{AnalyticsView-D8z1Nsed.js.map → AnalyticsView-SKyGxeAx.js.map} +1 -1
  24. package/dist/embed/{RedUiEmbedRoot-CtqTd_FG.js → RedUiEmbedRoot-BzVzGAFK.js} +13945 -13287
  25. package/dist/embed/RedUiEmbedRoot-BzVzGAFK.js.map +1 -0
  26. package/dist/embed/event-BvRbkLjD.js +46 -0
  27. package/dist/embed/event-BvRbkLjD.js.map +1 -0
  28. package/dist/embed/index-BVxMkfHe.js +8 -0
  29. package/dist/embed/index-BVxMkfHe.js.map +1 -0
  30. package/dist/embed/index-BY6fc1oQ.js +856 -0
  31. package/dist/embed/index-BY6fc1oQ.js.map +1 -0
  32. package/dist/embed/{index-client-BeiP-va5.js → index-client-BHUUkI8H.js} +121 -120
  33. package/dist/embed/{index-client-BeiP-va5.js.map → index-client-BHUUkI8H.js.map} +1 -1
  34. package/dist/embed/index.js +1 -1
  35. package/dist/embed/{sigma.esm-qqKBpvin.js → sigma.esm-BawyGZ3s.js} +2 -2
  36. package/dist/embed/{sigma.esm-qqKBpvin.js.map → sigma.esm-BawyGZ3s.js.map} +1 -1
  37. package/dist/embed/window-ZR8_mM8o.js +1889 -0
  38. package/dist/embed/window-ZR8_mM8o.js.map +1 -0
  39. package/package.json +5 -3
  40. package/src/lib/ConnectDropdown.svelte +60 -3
  41. package/src/lib/DevConsole.svelte +155 -0
  42. package/src/lib/ErrorBoundary.fixture.svelte +11 -0
  43. package/src/lib/ErrorBoundary.fixtures.svelte.ts +5 -0
  44. package/src/lib/ErrorBoundary.svelte +78 -0
  45. package/src/lib/ErrorBoundaryCrashChild.fixture.svelte +9 -0
  46. package/src/lib/LoadingOverlay.svelte +109 -0
  47. package/src/lib/StatusBar.svelte +19 -1
  48. package/src/lib/Workspace.svelte +118 -2
  49. package/src/lib/connections.svelte.ts +95 -1
  50. package/src/lib/embed/RedUiEmbedRoot.svelte +13 -8
  51. package/src/lib/embed/index.ts +34 -1
  52. package/src/lib/index.ts +7 -0
  53. package/src/lib/loading.svelte.ts +142 -0
  54. package/src/lib/reddb/client.ts +133 -15
  55. package/src/lib/reddb/desktop-error.ts +89 -0
  56. package/src/lib/reddb/dev-console.ts +186 -0
  57. package/src/lib/reddb/index.ts +2 -0
  58. package/src/lib/reddb/local-url-provider.ts +4 -8
  59. package/src/lib/reddb/tauri-encrypted-store.ts +4 -9
  60. package/src/lib/tabs.svelte.ts +5 -0
  61. package/src/lib/workspace-session.ts +81 -0
  62. package/build/_app/immutable/assets/0.DgbuWrJy.css +0 -1
  63. package/build/_app/immutable/chunks/85-Fh5Zp.js +0 -404
  64. package/build/_app/immutable/chunks/CnD4hwxC.js +0 -1106
  65. package/build/_app/immutable/chunks/DQCYUNtS.js +0 -1
  66. package/build/_app/immutable/entry/start.D1J45dq5.js +0 -1
  67. package/build/_app/immutable/nodes/0.BTrC4th2.js +0 -1
  68. package/build/_app/immutable/nodes/1.Ds1Tbjsm.js +0 -1
  69. package/dist/embed/RedUiEmbedRoot-CtqTd_FG.js.map +0 -1
  70. package/dist/embed/index-w1Qo_uW0.js +0 -677
  71. package/dist/embed/index-w1Qo_uW0.js.map +0 -1
@@ -0,0 +1,46 @@
1
+ import { invoke as n, transformCallback as d } from "./core-QuRYvMt8.js";
2
+ var i;
3
+ (function(e) {
4
+ e.WINDOW_RESIZED = "tauri://resize", e.WINDOW_MOVED = "tauri://move", e.WINDOW_CLOSE_REQUESTED = "tauri://close-requested", e.WINDOW_DESTROYED = "tauri://destroyed", e.WINDOW_FOCUS = "tauri://focus", e.WINDOW_BLUR = "tauri://blur", e.WINDOW_SCALE_FACTOR_CHANGED = "tauri://scale-change", e.WINDOW_THEME_CHANGED = "tauri://theme-changed", e.WINDOW_CREATED = "tauri://window-created", e.WINDOW_SUSPENDED = "tauri://suspended", e.WINDOW_RESUMED = "tauri://resumed", e.WEBVIEW_CREATED = "tauri://webview-created", e.DRAG_ENTER = "tauri://drag-enter", e.DRAG_OVER = "tauri://drag-over", e.DRAG_DROP = "tauri://drag-drop", e.DRAG_LEAVE = "tauri://drag-leave";
5
+ })(i || (i = {}));
6
+ async function _(e, r) {
7
+ window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(e, r), await n("plugin:event|unlisten", {
8
+ event: e,
9
+ eventId: r
10
+ });
11
+ }
12
+ async function u(e, r, t) {
13
+ var a;
14
+ const l = typeof (t == null ? void 0 : t.target) == "string" ? { kind: "AnyLabel", label: t.target } : (a = t == null ? void 0 : t.target) !== null && a !== void 0 ? a : { kind: "Any" };
15
+ return n("plugin:event|listen", {
16
+ event: e,
17
+ target: l,
18
+ handler: d(r)
19
+ }).then((D) => async () => _(e, D));
20
+ }
21
+ async function c(e, r, t) {
22
+ return u(e, (a) => {
23
+ _(e, a.id), r(a);
24
+ }, t);
25
+ }
26
+ async function o(e, r) {
27
+ await n("plugin:event|emit", {
28
+ event: e,
29
+ payload: r
30
+ });
31
+ }
32
+ async function s(e, r, t) {
33
+ await n("plugin:event|emit_to", {
34
+ target: typeof e == "string" ? { kind: "AnyLabel", label: e } : e,
35
+ event: r,
36
+ payload: t
37
+ });
38
+ }
39
+ export {
40
+ i as TauriEvent,
41
+ o as emit,
42
+ s as emitTo,
43
+ u as listen,
44
+ c as once
45
+ };
46
+ //# sourceMappingURL=event-BvRbkLjD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-BvRbkLjD.js","sources":["../../../../node_modules/.pnpm/@tauri-apps+api@2.11.0/node_modules/@tauri-apps/api/event.js"],"sourcesContent":["import { invoke, transformCallback } 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 * The event system allows you to emit events to the backend and listen to events from it.\n *\n * This package is also accessible with `window.__TAURI__.event` when [`app.withGlobalTauri`](https://v2.tauri.app/reference/config/#withglobaltauri) in `tauri.conf.json` is set to `true`.\n * @module\n */\n/**\n * @since 1.1.0\n */\nvar TauriEvent;\n(function (TauriEvent) {\n TauriEvent[\"WINDOW_RESIZED\"] = \"tauri://resize\";\n TauriEvent[\"WINDOW_MOVED\"] = \"tauri://move\";\n TauriEvent[\"WINDOW_CLOSE_REQUESTED\"] = \"tauri://close-requested\";\n TauriEvent[\"WINDOW_DESTROYED\"] = \"tauri://destroyed\";\n TauriEvent[\"WINDOW_FOCUS\"] = \"tauri://focus\";\n TauriEvent[\"WINDOW_BLUR\"] = \"tauri://blur\";\n TauriEvent[\"WINDOW_SCALE_FACTOR_CHANGED\"] = \"tauri://scale-change\";\n TauriEvent[\"WINDOW_THEME_CHANGED\"] = \"tauri://theme-changed\";\n TauriEvent[\"WINDOW_CREATED\"] = \"tauri://window-created\";\n TauriEvent[\"WINDOW_SUSPENDED\"] = \"tauri://suspended\";\n TauriEvent[\"WINDOW_RESUMED\"] = \"tauri://resumed\";\n TauriEvent[\"WEBVIEW_CREATED\"] = \"tauri://webview-created\";\n TauriEvent[\"DRAG_ENTER\"] = \"tauri://drag-enter\";\n TauriEvent[\"DRAG_OVER\"] = \"tauri://drag-over\";\n TauriEvent[\"DRAG_DROP\"] = \"tauri://drag-drop\";\n TauriEvent[\"DRAG_LEAVE\"] = \"tauri://drag-leave\";\n})(TauriEvent || (TauriEvent = {}));\n/**\n * Unregister the event listener associated with the given name and id.\n *\n * @ignore\n * @param event The event name\n * @param eventId Event identifier\n * @returns\n */\nasync function _unlisten(event, eventId) {\n window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(event, eventId);\n await invoke('plugin:event|unlisten', {\n event,\n eventId\n });\n}\n/**\n * Listen to an emitted event to any {@link EventTarget|target}.\n *\n * @example\n * ```typescript\n * import { listen } from '@tauri-apps/api/event';\n * const unlisten = await listen<string>('error', (event) => {\n * console.log(`Got error, payload: ${event.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 callback.\n * @param options Event listening options.\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 * @since 1.0.0\n */\nasync function listen(event, handler, options) {\n var _a;\n const target = typeof (options === null || options === void 0 ? void 0 : options.target) === 'string'\n ? { kind: 'AnyLabel', label: options.target }\n : ((_a = options === null || options === void 0 ? void 0 : options.target) !== null && _a !== void 0 ? _a : { kind: 'Any' });\n return invoke('plugin:event|listen', {\n event,\n target,\n handler: transformCallback(handler)\n }).then((eventId) => {\n return async () => _unlisten(event, eventId);\n });\n}\n/**\n * Listens once to an emitted event to any {@link EventTarget|target}.\n *\n * @example\n * ```typescript\n * import { once } from '@tauri-apps/api/event';\n * interface LoadedPayload {\n * loggedIn: boolean,\n * token: string\n * }\n * const unlisten = await once<LoadedPayload>('loaded', (event) => {\n * console.log(`App is loaded, loggedIn: ${event.payload.loggedIn}, token: ${event.payload.token}`);\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 callback.\n * @param options Event listening options.\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 * @since 1.0.0\n */\nasync function once(event, handler, options) {\n return listen(event, (eventData) => {\n void _unlisten(event, eventData.id);\n handler(eventData);\n }, options);\n}\n/**\n * Emits an event to all {@link EventTarget|targets}.\n *\n * @example\n * ```typescript\n * import { emit } from '@tauri-apps/api/event';\n * await emit('frontend-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 * @since 1.0.0\n */\nasync function emit(event, payload) {\n await invoke('plugin:event|emit', {\n event,\n payload\n });\n}\n/**\n * Emits an event to all {@link EventTarget|targets} matching the given target.\n *\n * @example\n * ```typescript\n * import { emitTo } from '@tauri-apps/api/event';\n * await emitTo('main', 'frontend-loaded', { loggedIn: true, token: 'authToken' });\n * ```\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 * @since 2.0.0\n */\nasync function emitTo(target, event, payload) {\n const eventTarget = typeof target === 'string' ? { kind: 'AnyLabel', label: target } : target;\n await invoke('plugin:event|emit_to', {\n target: eventTarget,\n event,\n payload\n });\n}\n\nexport { TauriEvent, emit, emitTo, listen, once };\n"],"names":["TauriEvent","_unlisten","event","eventId","invoke","listen","handler","options","_a","target","transformCallback","once","eventData","emit","payload","emitTo"],"mappings":";AAcG,IAACA;AAAA,CACH,SAAUA,GAAY;AACnB,EAAAA,EAAW,iBAAoB,kBAC/BA,EAAW,eAAkB,gBAC7BA,EAAW,yBAA4B,2BACvCA,EAAW,mBAAsB,qBACjCA,EAAW,eAAkB,iBAC7BA,EAAW,cAAiB,gBAC5BA,EAAW,8BAAiC,wBAC5CA,EAAW,uBAA0B,yBACrCA,EAAW,iBAAoB,0BAC/BA,EAAW,mBAAsB,qBACjCA,EAAW,iBAAoB,mBAC/BA,EAAW,kBAAqB,2BAChCA,EAAW,aAAgB,sBAC3BA,EAAW,YAAe,qBAC1BA,EAAW,YAAe,qBAC1BA,EAAW,aAAgB;AAC/B,GAAGA,MAAeA,IAAa,CAAA,EAAG;AASlC,eAAeC,EAAUC,GAAOC,GAAS;AACrC,SAAO,iCAAiC,mBAAmBD,GAAOC,CAAO,GACzE,MAAMC,EAAO,yBAAyB;AAAA,IAClC,OAAAF;AAAA,IACA,SAAAC;AAAA,EACR,CAAK;AACL;AAuBA,eAAeE,EAAOH,GAAOI,GAASC,GAAS;AAC3C,MAAIC;AACJ,QAAMC,IAAS,QAAQF,KAAY,OAA6B,SAASA,EAAQ,WAAY,WACvF,EAAE,MAAM,YAAY,OAAOA,EAAQ,OAAM,KACvCC,IAAKD,KAAY,OAA6B,SAASA,EAAQ,YAAY,QAAQC,MAAO,SAASA,IAAK,EAAE,MAAM;AACxH,SAAOJ,EAAO,uBAAuB;AAAA,IACjC,OAAAF;AAAA,IACA,QAAAO;AAAA,IACA,SAASC,EAAkBJ,CAAO;AAAA,EAC1C,CAAK,EAAE,KAAK,CAACH,MACE,YAAYF,EAAUC,GAAOC,CAAO,CAC9C;AACL;AA2BA,eAAeQ,EAAKT,GAAOI,GAASC,GAAS;AACzC,SAAOF,EAAOH,GAAO,CAACU,MAAc;AAChC,IAAKX,EAAUC,GAAOU,EAAU,EAAE,GAClCN,EAAQM,CAAS;AAAA,EACrB,GAAGL,CAAO;AACd;AAeA,eAAeM,EAAKX,GAAOY,GAAS;AAChC,QAAMV,EAAO,qBAAqB;AAAA,IAC9B,OAAAF;AAAA,IACA,SAAAY;AAAA,EACR,CAAK;AACL;AAgBA,eAAeC,EAAON,GAAQP,GAAOY,GAAS;AAE1C,QAAMV,EAAO,wBAAwB;AAAA,IACjC,QAFgB,OAAOK,KAAW,WAAW,EAAE,MAAM,YAAY,OAAOA,EAAM,IAAKA;AAAA,IAGnF,OAAAP;AAAA,IACA,SAAAY;AAAA,EACR,CAAK;AACL;","x_google_ignoreList":[0]}
@@ -0,0 +1,8 @@
1
+ import { invoke as n } from "./core-QuRYvMt8.js";
2
+ async function r(e = {}) {
3
+ return typeof e == "object" && Object.freeze(e), await n("plugin:dialog|open", { options: e });
4
+ }
5
+ export {
6
+ r as open
7
+ };
8
+ //# sourceMappingURL=index-BVxMkfHe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-BVxMkfHe.js","sources":["../../../../node_modules/.pnpm/@tauri-apps+plugin-dialog@2.7.1/node_modules/@tauri-apps/plugin-dialog/dist-js/index.js"],"sourcesContent":["import { invoke } from '@tauri-apps/api/core';\n\n// Copyright 2019-2023 Tauri Programme within The Commons Conservancy\n// SPDX-License-Identifier: Apache-2.0\n// SPDX-License-Identifier: MIT\n/**\n * Internal function to convert the buttons to the Rust type.\n */\nfunction buttonsToRust(buttons) {\n if (buttons === undefined) {\n return undefined;\n }\n if (typeof buttons === 'string') {\n return buttons;\n }\n else if ('ok' in buttons && 'cancel' in buttons) {\n return { OkCancelCustom: [buttons.ok, buttons.cancel] };\n }\n else if ('yes' in buttons && 'no' in buttons && 'cancel' in buttons) {\n return {\n YesNoCancelCustom: [buttons.yes, buttons.no, buttons.cancel]\n };\n }\n else if ('ok' in buttons) {\n return { OkCustom: buttons.ok };\n }\n return undefined;\n}\n/**\n * Open a file/directory selection dialog.\n *\n * The selected paths are added to the filesystem and asset protocol scopes.\n * When security is more important than the easy of use of this API,\n * prefer writing a dedicated command instead.\n *\n * Note that the scope change is not persisted, so the values are cleared when the application is restarted.\n * You can save it to the filesystem using [tauri-plugin-persisted-scope](https://github.com/tauri-apps/tauri-plugin-persisted-scope).\n * @example\n * ```typescript\n * import { open } from '@tauri-apps/plugin-dialog';\n * // Open a selection dialog for image files\n * const selected = await open({\n * multiple: true,\n * filters: [{\n * name: 'Image',\n * extensions: ['png', 'jpeg']\n * }]\n * });\n * if (Array.isArray(selected)) {\n * // user selected multiple files\n * } else if (selected === null) {\n * // user cancelled the selection\n * } else {\n * // user selected a single file\n * }\n * ```\n *\n * @example\n * ```typescript\n * import { open } from '@tauri-apps/plugin-dialog';\n * import { appDir } from '@tauri-apps/api/path';\n * // Open a selection dialog for directories\n * const selected = await open({\n * directory: true,\n * multiple: true,\n * defaultPath: await appDir(),\n * });\n * if (Array.isArray(selected)) {\n * // user selected multiple directories\n * } else if (selected === null) {\n * // user cancelled the selection\n * } else {\n * // user selected a single directory\n * }\n * ```\n *\n * @returns A promise resolving to the selected path(s)\n *\n * @since 2.0.0\n */\nasync function open(options = {}) {\n if (typeof options === 'object') {\n Object.freeze(options);\n }\n return await invoke('plugin:dialog|open', { options });\n}\n/**\n * Open a file/directory save dialog.\n *\n * The selected path is added to the filesystem and asset protocol scopes.\n * When security is more important than the easy of use of this API,\n * prefer writing a dedicated command instead.\n *\n * Note that the scope change is not persisted, so the values are cleared when the application is restarted.\n * You can save it to the filesystem using [tauri-plugin-persisted-scope](https://github.com/tauri-apps/tauri-plugin-persisted-scope).\n * @example\n * ```typescript\n * import { save } from '@tauri-apps/plugin-dialog';\n * const filePath = await save({\n * filters: [{\n * name: 'Image',\n * extensions: ['png', 'jpeg']\n * }]\n * });\n * ```\n *\n * @returns A promise resolving to the selected path.\n *\n * @since 2.0.0\n */\nasync function save(options = {}) {\n if (typeof options === 'object') {\n Object.freeze(options);\n }\n return await invoke('plugin:dialog|save', { options });\n}\nasync function messageCommand(message, options) {\n return await invoke('plugin:dialog|message', {\n message,\n title: options?.title,\n kind: options?.kind,\n buttons: buttonsToRust(options?.buttons)\n });\n}\n/**\n * Shows a message dialog with an `Ok` button.\n * @example\n * ```typescript\n * import { message } from '@tauri-apps/plugin-dialog';\n * await message('Tauri is awesome', 'Tauri');\n * await message('File not found', { title: 'Tauri', kind: 'error' });\n * ```\n *\n * @param message The message to show.\n * @param options The dialog's options. If a string, it represents the dialog title.\n *\n * @returns A promise indicating the success or failure of the operation.\n *\n * @since 2.0.0\n *\n */\nasync function message(message, options) {\n const opts = typeof options === 'string' ? { title: options } : options;\n if (opts && !opts.buttons && opts.okLabel) {\n opts.buttons = { ok: opts.okLabel };\n }\n return messageCommand(message, opts);\n}\n/**\n * Shows a question dialog with `Yes` and `No` buttons.\n *\n * Convenient wrapper for `await message('msg', { buttons: 'YesNo' }) === 'Yes'`\n *\n * @example\n * ```typescript\n * import { ask } from '@tauri-apps/plugin-dialog';\n * const yes = await ask('Are you sure?', 'Tauri');\n * const yes2 = await ask('This action cannot be reverted. Are you sure?', { title: 'Tauri', kind: 'warning' });\n * ```\n *\n * @param message The message to show.\n * @param options The dialog's options. If a string, it represents the dialog title.\n *\n * @returns A promise resolving to a boolean indicating whether `Yes` was clicked or not.\n *\n * @since 2.0.0\n */\nasync function ask(message, options) {\n const opts = typeof options === 'string' ? { title: options } : options;\n const customButtons = opts?.okLabel || opts?.cancelLabel;\n const okLabel = opts?.okLabel ?? 'Yes';\n return ((await messageCommand(message, {\n title: opts?.title,\n kind: opts?.kind,\n buttons: customButtons\n ? { ok: okLabel, cancel: opts.cancelLabel ?? 'No' }\n : 'YesNo'\n })) === okLabel);\n}\n/**\n * Shows a question dialog with `Ok` and `Cancel` buttons.\n *\n * Convenient wrapper for `await message('msg', { buttons: 'OkCancel' }) === 'Ok'`\n *\n * @example\n * ```typescript\n * import { confirm } from '@tauri-apps/plugin-dialog';\n * const confirmed = await confirm('Are you sure?', 'Tauri');\n * const confirmed2 = await confirm('This action cannot be reverted. Are you sure?', { title: 'Tauri', kind: 'warning' });\n * ```\n *\n * @param message The message to show.\n * @param options The dialog's options. If a string, it represents the dialog title.\n *\n * @returns A promise resolving to a boolean indicating whether `Ok` was clicked or not.\n *\n * @since 2.0.0\n */\nasync function confirm(message, options) {\n const opts = typeof options === 'string' ? { title: options } : options;\n const customButtons = opts?.okLabel || opts?.cancelLabel;\n const okLabel = opts?.okLabel ?? 'Ok';\n return ((await messageCommand(message, {\n title: opts?.title,\n kind: opts?.kind,\n buttons: customButtons\n ? { ok: okLabel, cancel: opts.cancelLabel ?? 'Cancel' }\n : 'OkCancel'\n })) === okLabel);\n}\n\nexport { ask, confirm, message, open, save };\n"],"names":["open","options","invoke"],"mappings":";AAgFA,eAAeA,EAAKC,IAAU,IAAI;AAC9B,SAAI,OAAOA,KAAY,YACnB,OAAO,OAAOA,CAAO,GAElB,MAAMC,EAAO,sBAAsB,EAAE,SAAAD,EAAO,CAAE;AACzD;","x_google_ignoreList":[0]}