@reddb-io/ui 0.3.0 → 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 (121) hide show
  1. package/build/_app/immutable/assets/0.BWZTMKZW.css +1 -0
  2. package/build/_app/immutable/assets/AnalyticsView.BLAJezw4.css +1 -0
  3. package/build/_app/immutable/assets/{Workspace.CvP5De7i.css → Workspace.DM2E1WiF.css} +1 -1
  4. package/build/_app/immutable/chunks/{C9rXzYLu.js → B-yl15ta.js} +1 -1
  5. package/build/_app/immutable/chunks/B5euRbKa.js +1 -0
  6. package/build/_app/immutable/chunks/BRIMmWzq.js +1 -0
  7. package/build/_app/immutable/chunks/BgOTHNR5.js +1 -0
  8. package/build/_app/immutable/chunks/Bgb6fHGb.js +18 -0
  9. package/build/_app/immutable/chunks/Btd6PFkC.js +1 -0
  10. package/build/_app/immutable/chunks/C-kqMbRi.js +1 -0
  11. package/build/_app/immutable/chunks/C3SGj6Qd.js +2 -0
  12. package/build/_app/immutable/chunks/{C278awGv.js → C7kf23SQ.js} +1 -1
  13. package/build/_app/immutable/chunks/CGFL56WJ.js +1 -0
  14. package/build/_app/immutable/chunks/CHvQYbpl.js +1 -0
  15. package/build/_app/immutable/chunks/CO7K4bD2.js +1164 -0
  16. package/build/_app/immutable/chunks/CP65IkJc.js +1 -0
  17. package/build/_app/immutable/chunks/CxnvJShw.js +404 -0
  18. package/build/_app/immutable/chunks/D02PB2u7.js +1 -0
  19. package/build/_app/immutable/chunks/DCJ0QyYH.js +1 -0
  20. package/build/_app/immutable/chunks/DN7v3Tar.js +2 -0
  21. package/build/_app/immutable/chunks/DRlh90Cv.js +1 -0
  22. package/build/_app/immutable/entry/app.BeX4Tmu5.js +2 -0
  23. package/build/_app/immutable/entry/start.D7y1MZex.js +1 -0
  24. package/build/_app/immutable/nodes/0.C0e5KQVb.js +2 -0
  25. package/build/_app/immutable/nodes/1.ceiVuZbB.js +1 -0
  26. package/build/_app/immutable/nodes/10.DeFqKRR2.js +96 -0
  27. package/build/_app/immutable/nodes/12.CzMvqoYS.js +3 -0
  28. package/build/_app/immutable/nodes/14.CAG5_cGP.js +1 -0
  29. package/build/_app/immutable/nodes/15.CRDBqbiH.js +60 -0
  30. package/build/_app/immutable/nodes/8.CAG5_cGP.js +1 -0
  31. package/build/_app/version.json +1 -1
  32. package/build/index.html +18 -15
  33. package/dist/embed/AnalyticsView-SKyGxeAx.js +23337 -0
  34. package/dist/embed/AnalyticsView-SKyGxeAx.js.map +1 -0
  35. package/dist/embed/RedUiEmbedRoot-BzVzGAFK.js +31960 -0
  36. package/dist/embed/RedUiEmbedRoot-BzVzGAFK.js.map +1 -0
  37. package/dist/embed/event-BvRbkLjD.js +46 -0
  38. package/dist/embed/event-BvRbkLjD.js.map +1 -0
  39. package/dist/embed/index-0hA141D2.js +85 -0
  40. package/dist/embed/index-0hA141D2.js.map +1 -0
  41. package/dist/embed/index-BVxMkfHe.js +8 -0
  42. package/dist/embed/index-BVxMkfHe.js.map +1 -0
  43. package/dist/embed/index-BY6fc1oQ.js +856 -0
  44. package/dist/embed/index-BY6fc1oQ.js.map +1 -0
  45. package/dist/embed/index-client-BHUUkI8H.js +3304 -0
  46. package/dist/embed/index-client-BHUUkI8H.js.map +1 -0
  47. package/dist/embed/index.js +1 -1
  48. package/dist/embed/{sigma.esm-D5yoExsH.js → sigma.esm-BawyGZ3s.js} +2 -2
  49. package/dist/embed/{sigma.esm-D5yoExsH.js.map → sigma.esm-BawyGZ3s.js.map} +1 -1
  50. package/dist/embed/window-ZR8_mM8o.js +1889 -0
  51. package/dist/embed/window-ZR8_mM8o.js.map +1 -0
  52. package/package.json +7 -3
  53. package/src/app.css +86 -20
  54. package/src/lib/AnalyticsView.svelte +209 -0
  55. package/src/lib/AskView.svelte +255 -0
  56. package/src/lib/ClusterView.svelte +415 -95
  57. package/src/lib/CommandPalette.svelte +2 -0
  58. package/src/lib/ConnectDropdown.svelte +60 -3
  59. package/src/lib/DevConsole.svelte +155 -0
  60. package/src/lib/ErrorBoundary.fixture.svelte +11 -0
  61. package/src/lib/ErrorBoundary.fixtures.svelte.ts +5 -0
  62. package/src/lib/ErrorBoundary.svelte +78 -0
  63. package/src/lib/ErrorBoundaryCrashChild.fixture.svelte +9 -0
  64. package/src/lib/GlobalProgressBar.svelte +9 -0
  65. package/src/lib/LoadingOverlay.svelte +109 -0
  66. package/src/lib/MetricChart.svelte +85 -0
  67. package/src/lib/QueryEditor.svelte +48 -7
  68. package/src/lib/ResultsPane.svelte +76 -8
  69. package/src/lib/SchemaTree.svelte +25 -1
  70. package/src/lib/SecurityView.svelte +176 -65
  71. package/src/lib/SettingsView.svelte +1111 -254
  72. package/src/lib/StatusBar.svelte +19 -1
  73. package/src/lib/Topbar.svelte +29 -1
  74. package/src/lib/Workspace.svelte +136 -5
  75. package/src/lib/activity.svelte.ts +44 -35
  76. package/src/lib/collection-preview.ts +14 -0
  77. package/src/lib/connections.svelte.ts +167 -4
  78. package/src/lib/embed/RedUiEmbedRoot.svelte +13 -8
  79. package/src/lib/embed/index.ts +34 -1
  80. package/src/lib/index.ts +10 -0
  81. package/src/lib/loading.svelte.ts +142 -0
  82. package/src/lib/permission-gate.ts +120 -0
  83. package/src/lib/policies.ts +136 -0
  84. package/src/lib/query-tabs.svelte.ts +132 -53
  85. package/src/lib/reddb/analytics.ts +208 -0
  86. package/src/lib/reddb/ask.ts +123 -0
  87. package/src/lib/reddb/client.ts +292 -73
  88. package/src/lib/reddb/cluster-status.ts +306 -0
  89. package/src/lib/reddb/desktop-error.ts +89 -0
  90. package/src/lib/reddb/dev-console.ts +186 -0
  91. package/src/lib/reddb/index.ts +5 -0
  92. package/src/lib/reddb/local-url-provider.ts +28 -1
  93. package/src/lib/reddb/redwire-ws-spike.ts +590 -0
  94. package/src/lib/reddb/tauri-encrypted-store.ts +4 -9
  95. package/src/lib/router.svelte.ts +12 -0
  96. package/src/lib/settings-authoring-client.ts +336 -0
  97. package/src/lib/settings-sections.ts +292 -196
  98. package/src/lib/tabs.svelte.ts +5 -0
  99. package/src/lib/workspace-session.ts +81 -0
  100. package/build/_app/immutable/assets/0.DQDLkSdR.css +0 -1
  101. package/build/_app/immutable/chunks/65XjEwaF.js +0 -367
  102. package/build/_app/immutable/chunks/BGcIe2ep.js +0 -2
  103. package/build/_app/immutable/chunks/BjFADNkA.js +0 -992
  104. package/build/_app/immutable/chunks/BrvvOVaJ.js +0 -1
  105. package/build/_app/immutable/chunks/D9CTkMjK.js +0 -1
  106. package/build/_app/immutable/chunks/oiO4RLqp.js +0 -1
  107. package/build/_app/immutable/chunks/pDJnDxXM.js +0 -1
  108. package/build/_app/immutable/entry/app.DdaMXHAv.js +0 -2
  109. package/build/_app/immutable/entry/start.-MLBtQXB.js +0 -1
  110. package/build/_app/immutable/nodes/0.Ysoz3Y3h.js +0 -1
  111. package/build/_app/immutable/nodes/1.C2jbGTOJ.js +0 -1
  112. package/build/_app/immutable/nodes/12.DQG5zpEx.js +0 -60
  113. package/build/_app/immutable/nodes/8.CrHI4F9p.js +0 -134
  114. package/dist/embed/RedUiEmbedRoot-BwFUA5X-.js +0 -28624
  115. package/dist/embed/RedUiEmbedRoot-BwFUA5X-.js.map +0 -1
  116. package/dist/embed/index-DGhgtnaK.js +0 -577
  117. package/dist/embed/index-DGhgtnaK.js.map +0 -1
  118. package/dist/embed/index-client-ItCEU64C.js +0 -3087
  119. package/dist/embed/index-client-ItCEU64C.js.map +0 -1
  120. /package/build/_app/immutable/assets/{12.Dblyk0Kr.css → 15.Dblyk0Kr.css} +0 -0
  121. /package/build/_app/immutable/nodes/{10.CAG5_cGP.js → 13.CAG5_cGP.js} +0 -0
@@ -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,85 @@
1
+ import { invoke as d } from "./core-QuRYvMt8.js";
2
+ const u = "Request cancelled";
3
+ async function k(R, e) {
4
+ const t = e == null ? void 0 : e.signal;
5
+ if (t != null && t.aborted)
6
+ throw new Error(u);
7
+ const v = e == null ? void 0 : e.maxRedirections, E = e == null ? void 0 : e.connectTimeout, A = e == null ? void 0 : e.proxy, g = e == null ? void 0 : e.danger;
8
+ e && (delete e.maxRedirections, delete e.connectTimeout, delete e.proxy, delete e.danger);
9
+ const o = e != null && e.headers ? e.headers instanceof Headers ? e.headers : new Headers(e.headers) : new Headers(), c = new Request(R, e), f = await c.arrayBuffer(), x = f.byteLength !== 0 ? Array.from(new Uint8Array(f)) : null;
10
+ for (const [r, a] of c.headers)
11
+ o.get(r) || o.set(r, a);
12
+ const H = (o instanceof Headers ? Array.from(o.entries()) : Array.isArray(o) ? o : Object.entries(o)).map(([r, a]) => [
13
+ r,
14
+ // we need to ensure we have all header values as strings
15
+ // eslint-disable-next-line
16
+ typeof a == "string" ? a : a.toString()
17
+ ]);
18
+ if (t != null && t.aborted)
19
+ throw new Error(u);
20
+ const h = await d("plugin:http|fetch", {
21
+ clientConfig: {
22
+ method: c.method,
23
+ url: c.url,
24
+ headers: H,
25
+ data: x,
26
+ maxRedirections: v,
27
+ connectTimeout: E,
28
+ proxy: A,
29
+ danger: g
30
+ }
31
+ }), y = () => d("plugin:http|fetch_cancel", { rid: h });
32
+ if (t != null && t.aborted)
33
+ throw y(), new Error(u);
34
+ t == null || t.addEventListener("abort", () => void y());
35
+ const { status: p, statusText: _, url: b, headers: w, rid: m } = await d("plugin:http|fetch_send", {
36
+ rid: h
37
+ }), l = () => d("plugin:http|fetch_cancel_body", { rid: m }), L = async (r) => {
38
+ let a;
39
+ try {
40
+ a = await d("plugin:http|fetch_read_body", {
41
+ rid: m
42
+ });
43
+ } catch (T) {
44
+ r.error(T), l();
45
+ return;
46
+ }
47
+ const n = new Uint8Array(a), C = n[n.byteLength - 1], P = n.slice(0, n.byteLength - 1);
48
+ if (C === 1) {
49
+ r.close();
50
+ return;
51
+ }
52
+ r.enqueue(P);
53
+ }, O = [101, 103, 204, 205, 304].includes(p) ? null : new ReadableStream({
54
+ start: (r) => {
55
+ t == null || t.addEventListener("abort", () => {
56
+ r.error(u), l();
57
+ });
58
+ },
59
+ pull: (r) => L(r),
60
+ cancel: () => {
61
+ l();
62
+ }
63
+ }), s = new Response(O, {
64
+ status: p,
65
+ statusText: _
66
+ });
67
+ Object.defineProperty(s, "url", { value: b, writable: !1 }), Object.defineProperty(s, "headers", {
68
+ value: new Headers(w),
69
+ writable: !1
70
+ });
71
+ const j = s.clone.bind(s);
72
+ return Object.defineProperty(s, "clone", {
73
+ value: () => {
74
+ const r = j();
75
+ return Object.defineProperty(r, "url", { value: b, writable: !1 }), Object.defineProperty(r, "headers", {
76
+ value: new Headers(w),
77
+ writable: !1
78
+ }), r;
79
+ }
80
+ }), s;
81
+ }
82
+ export {
83
+ k as fetch
84
+ };
85
+ //# sourceMappingURL=index-0hA141D2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-0hA141D2.js","sources":["../../../../node_modules/.pnpm/@tauri-apps+plugin-http@2.5.9/node_modules/@tauri-apps/plugin-http/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 * Make HTTP requests with the Rust backend.\n *\n * ## Security\n *\n * This API has a scope configuration that forces you to restrict the URLs that can be accessed using glob patterns.\n *\n * For instance, this scope configuration only allows making HTTP requests to all subdomains for `tauri.app` except for `https://private.tauri.app`:\n * ```json\n * {\n * \"permissions\": [\n * {\n * \"identifier\": \"http:default\",\n * \"allow\": [{ \"url\": \"https://*.tauri.app\" }],\n * \"deny\": [{ \"url\": \"https://private.tauri.app\" }]\n * }\n * ]\n * }\n * ```\n * Trying to execute any API with a URL not configured on the scope results in a promise rejection due to denied access.\n *\n * @module\n */\nconst ERROR_REQUEST_CANCELLED = 'Request cancelled';\n/**\n * Fetch a resource from the network. It returns a `Promise` that resolves to the\n * `Response` to that `Request`, whether it is successful or not.\n *\n * @example\n * ```typescript\n * const response = await fetch(\"http://my.json.host/data.json\");\n * console.log(response.status); // e.g. 200\n * console.log(response.statusText); // e.g. \"OK\"\n * const jsonData = await response.json();\n * ```\n *\n * @since 2.0.0\n */\nasync function fetch(input, init) {\n // Optimistically check for abort signal and avoid doing any work\n const signal = init?.signal;\n if (signal?.aborted) {\n throw new Error(ERROR_REQUEST_CANCELLED);\n }\n const maxRedirections = init?.maxRedirections;\n const connectTimeout = init?.connectTimeout;\n const proxy = init?.proxy;\n const danger = init?.danger;\n // Remove these fields before creating the request\n if (init) {\n delete init.maxRedirections;\n delete init.connectTimeout;\n delete init.proxy;\n delete init.danger;\n }\n const headers = init?.headers\n ? init.headers instanceof Headers\n ? init.headers\n : new Headers(init.headers)\n : new Headers();\n const req = new Request(input, init);\n const buffer = await req.arrayBuffer();\n const data = buffer.byteLength !== 0 ? Array.from(new Uint8Array(buffer)) : null;\n // append new headers created by the browser `Request` implementation,\n // if not already declared by the caller of this function\n for (const [key, value] of req.headers) {\n if (!headers.get(key)) {\n headers.set(key, value);\n }\n }\n const headersArray = headers instanceof Headers\n ? Array.from(headers.entries())\n : Array.isArray(headers)\n ? headers\n : Object.entries(headers);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const mappedHeaders = headersArray.map(([name, val]) => [\n name,\n // we need to ensure we have all header values as strings\n // eslint-disable-next-line\n typeof val === 'string' ? val : val.toString()\n ]);\n // Optimistically check for abort signal and avoid doing any work on the Rust side\n if (signal?.aborted) {\n throw new Error(ERROR_REQUEST_CANCELLED);\n }\n const rid = await invoke('plugin:http|fetch', {\n clientConfig: {\n method: req.method,\n url: req.url,\n headers: mappedHeaders,\n data,\n maxRedirections,\n connectTimeout,\n proxy,\n danger\n }\n });\n const abort = () => invoke('plugin:http|fetch_cancel', { rid });\n // Optimistically check for abort signal\n // and avoid doing any work after doing intial work on the Rust side\n if (signal?.aborted) {\n // we don't care about the result of this proimse\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n abort();\n throw new Error(ERROR_REQUEST_CANCELLED);\n }\n signal?.addEventListener('abort', () => void abort());\n const { status, statusText, url, headers: responseHeaders, rid: responseRid } = await invoke('plugin:http|fetch_send', {\n rid\n });\n const dropBody = () => {\n return invoke('plugin:http|fetch_cancel_body', { rid: responseRid });\n };\n const readChunk = async (controller) => {\n let data;\n try {\n data = await invoke('plugin:http|fetch_read_body', {\n rid: responseRid\n });\n }\n catch (e) {\n // close the stream if an error occurs\n // and drop the body on Rust side\n controller.error(e);\n void dropBody();\n return;\n }\n const dataUint8 = new Uint8Array(data);\n const lastByte = dataUint8[dataUint8.byteLength - 1];\n const actualData = dataUint8.slice(0, dataUint8.byteLength - 1);\n // close when the signal to close (last byte is 1) is sent from the IPC.\n if (lastByte === 1) {\n controller.close();\n return;\n }\n controller.enqueue(actualData);\n };\n // no body for 101, 103, 204, 205 and 304\n // see https://fetch.spec.whatwg.org/#null-body-status\n const body = [101, 103, 204, 205, 304].includes(status)\n ? null\n : new ReadableStream({\n start: (controller) => {\n // listen for abort events to cancel reading\n signal?.addEventListener('abort', () => {\n controller.error(ERROR_REQUEST_CANCELLED);\n void dropBody();\n });\n },\n pull: (controller) => readChunk(controller),\n cancel: () => {\n // Ensure body resources are released on stream cancellation\n void dropBody();\n }\n });\n const res = new Response(body, {\n status,\n statusText\n });\n // `Response.url` cannot be set via the constructor, so we define it manually\n Object.defineProperty(res, 'url', { value: url, writable: false });\n // Expose `set-cookie` via `response.headers` (and `getSetCookie()` where\n // supported). This is not Fetch-spec compliant for network responses in\n // browsers, where `set-cookie` is treated as a forbidden response\n // header and is generally not readable from JavaScript.\n Object.defineProperty(res, 'headers', {\n value: new Headers(responseHeaders),\n writable: false\n });\n // Patch clone() per-instance so cloning preserves the overridden properties\n const originalClone = res.clone.bind(res);\n Object.defineProperty(res, 'clone', {\n value: () => {\n const cloned = originalClone();\n Object.defineProperty(cloned, 'url', { value: url, writable: false });\n Object.defineProperty(cloned, 'headers', {\n value: new Headers(responseHeaders),\n writable: false\n });\n return cloned;\n }\n });\n return res;\n}\n\nexport { fetch };\n"],"names":["ERROR_REQUEST_CANCELLED","fetch","input","init","signal","maxRedirections","connectTimeout","proxy","danger","headers","req","buffer","data","key","value","mappedHeaders","name","val","rid","invoke","abort","status","statusText","url","responseHeaders","responseRid","dropBody","readChunk","controller","e","dataUint8","lastByte","actualData","body","res","originalClone","cloned"],"mappings":"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","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]}