@burdenoff/fe-libs 2026.1118.13 → 2026.1119.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.
- package/dist/chrome/globalSearch/AdvancedFiltersPanel.js +128 -127
- package/dist/chrome/notificationCenter/NotificationFilters.js +45 -44
- package/dist/connections/CredentialStorageSelector.js +135 -134
- package/dist/connections/SharePanels.js +70 -69
- package/dist/credentials/AuthMethodSelector.js +33 -32
- package/dist/credentials/SchemaForm.js +96 -95
- package/dist/shared/assistant/avatar/live/LiveAvatarSettingsFields.js +74 -73
- package/dist/shared/assistant/ui/AssistantLanguageMenu.d.ts +2 -0
- package/dist/shared/assistant/ui/AssistantLanguageMenu.js +41 -40
- package/dist/shared/assistant/ui/AssistantReplyLanguageSelector.d.ts +3 -1
- package/dist/shared/assistant/ui/AssistantReplyLanguageSelector.js +26 -25
- package/dist/shared/assistant/ui/composer/AssistantLanguageSelector.d.ts +3 -1
- package/dist/shared/assistant/ui/composer/AssistantLanguageSelector.js +22 -21
- package/dist/shared/assistant/ui/composer/AssistantVoiceGraceSelector.d.ts +2 -1
- package/dist/shared/assistant/ui/composer/AssistantVoiceGraceSelector.js +17 -16
- package/dist/shared/assistant/ui/composer/AssistantVoiceSelector.d.ts +3 -1
- package/dist/shared/assistant/ui/composer/AssistantVoiceSelector.js +22 -21
- package/dist/shared/pages/searchPage/FiltersPanel.js +129 -128
- package/dist/shared/pages/searchPage/SearchToolbar.js +24 -23
- package/dist/shared/providers/AppShellProvider.d.ts +8 -0
- package/dist/shared/providers/AppShellProvider.js +199 -193
- package/dist/shared/providers/shell/ThemeProvider.d.ts +6 -1
- package/dist/shared/providers/shell/ThemeProvider.js +65 -62
- package/dist/shared/providers/shell/themedNativeControls.d.ts +25 -0
- package/dist/shared/providers/shell/themedNativeControls.js +13 -0
- package/dist/sharing/ShareDialog.js +33 -32
- package/dist/storage/StorageFolderPicker.js +50 -49
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/themed-select-context.d.ts +9 -0
- package/dist/ui/themed-select-context.js +15 -0
- package/dist/ui/themed-select-menu.d.ts +10 -0
- package/dist/ui/themed-select-menu.js +70 -0
- package/dist/ui/themed-select-options.d.ts +42 -0
- package/dist/ui/themed-select-options.js +88 -0
- package/dist/ui/themed-select-state.d.ts +43 -0
- package/dist/ui/themed-select-state.js +73 -0
- package/dist/ui/themed-select.d.ts +7 -0
- package/dist/ui/themed-select.js +176 -0
- package/dist/ui.js +31 -29
- package/package.json +1 -1
- package/src/shared/tokens/tokens.css +100 -0
|
@@ -74,8 +74,13 @@ export interface ThemeProviderProps {
|
|
|
74
74
|
defaultTypography?: Typography;
|
|
75
75
|
defaultGlass?: GlassIntensity;
|
|
76
76
|
storageKey?: string;
|
|
77
|
+
/**
|
|
78
|
+
* BOFF-15413: scrollbars, select menus and the other controls the browser draws
|
|
79
|
+
* follow this theme instead of the OS (`themedNativeControls.ts`). Off by default.
|
|
80
|
+
*/
|
|
81
|
+
themedNativeControls?: boolean;
|
|
77
82
|
}
|
|
78
|
-
export declare function ThemeProvider({ children, defaultMode, defaultBrand, defaultDensity, defaultTypography, defaultGlass, storageKey, }: ThemeProviderProps): import('react').JSX.Element;
|
|
83
|
+
export declare function ThemeProvider({ children, defaultMode, defaultBrand, defaultDensity, defaultTypography, defaultGlass, storageKey, themedNativeControls, }: ThemeProviderProps): import('react').JSX.Element;
|
|
79
84
|
export declare function useTheme(): ThemeContextValue;
|
|
80
85
|
/**
|
|
81
86
|
* The theme, or null outside a ThemeProvider — for a surface that must work
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { desktopSetTheme as e } from "../../native/desktop.js";
|
|
2
2
|
import { brandAttribute as t } from "./brandAttribute.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { applyThemedNativeControls as n } from "./themedNativeControls.js";
|
|
4
|
+
import { createContext as r, use as i, useCallback as a, useEffect as o, useMemo as s, useState as c } from "react";
|
|
5
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
5
6
|
// src/shared/providers/shell/ThemeProvider.tsx
|
|
6
|
-
var
|
|
7
|
+
var u = /* @__PURE__ */ new Set([
|
|
7
8
|
"dark",
|
|
8
9
|
"forest",
|
|
9
10
|
"ocean",
|
|
10
11
|
"sunset",
|
|
11
12
|
"high-contrast"
|
|
12
|
-
]),
|
|
13
|
+
]), d = [
|
|
13
14
|
{
|
|
14
15
|
value: "light",
|
|
15
16
|
label: "Light",
|
|
@@ -40,8 +41,8 @@ var c = /* @__PURE__ */ new Set([
|
|
|
40
41
|
label: "High Contrast",
|
|
41
42
|
family: "dark"
|
|
42
43
|
}
|
|
43
|
-
],
|
|
44
|
-
function
|
|
44
|
+
], ee = (e) => u.has(e) ? "dark" : "light";
|
|
45
|
+
function f(e) {
|
|
45
46
|
let t = /^#?([0-9a-f]{6})$/i.exec(e.trim());
|
|
46
47
|
if (!t) return null;
|
|
47
48
|
let n = parseInt(t[1], 16), r = [
|
|
@@ -54,8 +55,8 @@ function d(e) {
|
|
|
54
55
|
});
|
|
55
56
|
return .2126 * r[0] + .7152 * r[1] + .0722 * r[2];
|
|
56
57
|
}
|
|
57
|
-
var
|
|
58
|
-
function
|
|
58
|
+
var p = (e) => f(e) ?? 0, m = (e) => p(e) > .45;
|
|
59
|
+
function h(e, t) {
|
|
59
60
|
if (typeof window > "u") return t;
|
|
60
61
|
try {
|
|
61
62
|
let n = localStorage.getItem(e);
|
|
@@ -64,28 +65,30 @@ function m(e, t) {
|
|
|
64
65
|
return t;
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
|
-
var
|
|
68
|
-
function
|
|
69
|
-
let
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
var g = r(null);
|
|
69
|
+
function _({ children: r, defaultMode: i = "system", defaultBrand: u = "default", defaultDensity: d = "comfortable", defaultTypography: p = "default", defaultGlass: _ = "full", storageKey: v = "burdenoff-theme", themedNativeControls: y = !1 }) {
|
|
70
|
+
let b = (e, t) => typeof window > "u" ? t : localStorage.getItem(`${v}-${e}`) || t, [x, te] = c(() => b("mode", i)), [S, ne] = c(() => b("brand", u)), [re, ie] = c(() => b("density", d)), [C, w] = c(() => b("typography", p)), [T, E] = c(() => b("glass", _)), [D, O] = c(() => b("reduce-motion", "") === "1"), [k, A] = c(() => h(`${v}-custom-list`, [])), [j, M] = c(() => b("active-custom", "") || null), N = s(() => x === "custom" ? k.find((e) => e.id === j) ?? null : null, [
|
|
71
|
+
x,
|
|
72
|
+
k,
|
|
72
73
|
j
|
|
73
|
-
]), [P, F] =
|
|
74
|
-
|
|
75
|
-
if (
|
|
74
|
+
]), [P, F] = c(() => x === "custom" ? "light" : x === "system" ? typeof window > "u" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : x);
|
|
75
|
+
o(() => {
|
|
76
|
+
if (x === "system") {
|
|
76
77
|
let e = window.matchMedia("(prefers-color-scheme: dark)"), t = (e) => F(e.matches ? "dark" : "light");
|
|
77
78
|
return e.addEventListener("change", t), F(e.matches ? "dark" : "light"), () => e.removeEventListener("change", t);
|
|
78
79
|
}
|
|
79
|
-
F(
|
|
80
|
-
}, [
|
|
81
|
-
let I =
|
|
82
|
-
|
|
80
|
+
F(x === "custom" ? N?.base ?? "light" : x);
|
|
81
|
+
}, [x, N]);
|
|
82
|
+
let I = ee(P), L = N?.density ?? re, R = N?.typography ?? C, z = N?.glass ?? T, B = N?.reduceMotion ?? D;
|
|
83
|
+
o(() => {
|
|
84
|
+
if (y) return n(document, I);
|
|
85
|
+
}, [y, I]), o(() => {
|
|
83
86
|
let n = document.documentElement;
|
|
84
|
-
if (n.setAttribute("data-theme", P), n.setAttribute("data-brand", t(
|
|
87
|
+
if (n.setAttribute("data-theme", P), n.setAttribute("data-brand", t(S)), n.setAttribute("data-density", L), n.setAttribute("data-typography", R), n.setAttribute("data-glass", z), n.toggleAttribute("data-reduce-motion", B), I === "dark" ? n.classList.add("dark") : n.classList.remove("dark"), N) {
|
|
85
88
|
let e = N.accent;
|
|
86
|
-
n.setAttribute("data-accent", "custom"),
|
|
87
|
-
let t =
|
|
88
|
-
t === null ? n.style.removeProperty("--custom-accent-luminance") : n.style.setProperty("--custom-accent-luminance", t.toFixed(4)), n.style.setProperty("--color-action-primary-bg", e), n.style.setProperty("--color-action-primary-bgHover", `color-mix(in oklab, ${e} 84%, black)`), n.style.setProperty("--color-action-primary-bgActive", `color-mix(in oklab, ${e} 70%, black)`), n.style.setProperty("--color-action-primary-text",
|
|
89
|
+
n.setAttribute("data-accent", "custom"), m(e) ? n.setAttribute("data-accent-label", "dark") : n.removeAttribute("data-accent-label");
|
|
90
|
+
let t = f(e);
|
|
91
|
+
t === null ? n.style.removeProperty("--custom-accent-luminance") : n.style.setProperty("--custom-accent-luminance", t.toFixed(4)), n.style.setProperty("--color-action-primary-bg", e), n.style.setProperty("--color-action-primary-bgHover", `color-mix(in oklab, ${e} 84%, black)`), n.style.setProperty("--color-action-primary-bgActive", `color-mix(in oklab, ${e} 70%, black)`), n.style.setProperty("--color-action-primary-text", m(e) ? "#0a0a0a" : "#ffffff");
|
|
89
92
|
} else n.removeAttribute("data-accent"), n.removeAttribute("data-accent-label"), n.style.removeProperty("--custom-accent-luminance"), n.style.removeProperty("--color-action-primary-bg"), n.style.removeProperty("--color-action-primary-bgHover"), n.style.removeProperty("--color-action-primary-bgActive"), n.style.removeProperty("--color-action-primary-text");
|
|
90
93
|
let r = () => {
|
|
91
94
|
let t = getComputedStyle(n).getPropertyValue("--color-bg-canvas").trim();
|
|
@@ -102,53 +105,53 @@ function g({ children: n, defaultMode: r = "system", defaultBrand: c = "default"
|
|
|
102
105
|
}, [
|
|
103
106
|
P,
|
|
104
107
|
I,
|
|
105
|
-
|
|
108
|
+
S,
|
|
106
109
|
L,
|
|
107
110
|
R,
|
|
108
111
|
z,
|
|
109
112
|
B,
|
|
110
113
|
N
|
|
111
114
|
]);
|
|
112
|
-
let V =
|
|
113
|
-
|
|
114
|
-
}, [V]), U =
|
|
115
|
-
|
|
116
|
-
}, [V]), W =
|
|
117
|
-
|
|
118
|
-
}, [V]), G =
|
|
119
|
-
|
|
120
|
-
}, [V]), K =
|
|
121
|
-
|
|
122
|
-
}, [V]), q =
|
|
123
|
-
|
|
124
|
-
}, [V]), J =
|
|
125
|
-
|
|
126
|
-
}, [
|
|
115
|
+
let V = a((e, t) => localStorage.setItem(`${v}-${e}`, t), [v]), H = a((e) => {
|
|
116
|
+
te(e), V("mode", e);
|
|
117
|
+
}, [V]), U = a((e) => {
|
|
118
|
+
ne(e), V("brand", e);
|
|
119
|
+
}, [V]), W = a((e) => {
|
|
120
|
+
ie(e), V("density", e);
|
|
121
|
+
}, [V]), G = a((e) => {
|
|
122
|
+
w(e), V("typography", e);
|
|
123
|
+
}, [V]), K = a((e) => {
|
|
124
|
+
E(e), V("glass", e);
|
|
125
|
+
}, [V]), q = a((e) => {
|
|
126
|
+
O(e), V("reduce-motion", e ? "1" : "0");
|
|
127
|
+
}, [V]), J = a((e) => {
|
|
128
|
+
A(e), localStorage.setItem(`${v}-custom-list`, JSON.stringify(e));
|
|
129
|
+
}, [v]), Y = a((e) => {
|
|
127
130
|
let t = typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : `ct-${Date.now()}-${Math.floor(performance.now())}`, n = {
|
|
128
131
|
...e,
|
|
129
132
|
id: t
|
|
130
133
|
};
|
|
131
|
-
return J([...
|
|
132
|
-
}, [
|
|
133
|
-
J(
|
|
134
|
+
return J([...k, n]), n;
|
|
135
|
+
}, [k, J]), X = a((e, t) => {
|
|
136
|
+
J(k.map((n) => n.id === e ? {
|
|
134
137
|
...n,
|
|
135
138
|
...t
|
|
136
139
|
} : n));
|
|
137
|
-
}, [
|
|
138
|
-
J(
|
|
140
|
+
}, [k, J]), Z = a((e) => {
|
|
141
|
+
J(k.filter((t) => t.id !== e)), j === e && (M(null), V("active-custom", ""), H("system"));
|
|
139
142
|
}, [
|
|
140
|
-
|
|
143
|
+
k,
|
|
141
144
|
J,
|
|
142
145
|
j,
|
|
143
146
|
V,
|
|
144
147
|
H
|
|
145
|
-
]), Q =
|
|
148
|
+
]), Q = a((e) => {
|
|
146
149
|
M(e), V("active-custom", e), H("custom");
|
|
147
|
-
}, [V, H]), $ =
|
|
150
|
+
}, [V, H]), $ = a(() => {
|
|
148
151
|
H(I === "light" ? "dark" : "light");
|
|
149
|
-
}, [I, H]),
|
|
150
|
-
mode:
|
|
151
|
-
brand:
|
|
152
|
+
}, [I, H]), ae = s(() => ({
|
|
153
|
+
mode: x,
|
|
154
|
+
brand: S,
|
|
152
155
|
density: L,
|
|
153
156
|
typography: R,
|
|
154
157
|
glass: z,
|
|
@@ -161,7 +164,7 @@ function g({ children: n, defaultMode: r = "system", defaultBrand: c = "default"
|
|
|
161
164
|
setTypography: G,
|
|
162
165
|
setGlass: K,
|
|
163
166
|
setReduceMotion: q,
|
|
164
|
-
customThemes:
|
|
167
|
+
customThemes: k,
|
|
165
168
|
activeCustomId: j,
|
|
166
169
|
createCustomTheme: Y,
|
|
167
170
|
updateCustomTheme: X,
|
|
@@ -170,8 +173,8 @@ function g({ children: n, defaultMode: r = "system", defaultBrand: c = "default"
|
|
|
170
173
|
colorMode: I,
|
|
171
174
|
toggleColorMode: $
|
|
172
175
|
}), [
|
|
173
|
-
y,
|
|
174
176
|
x,
|
|
177
|
+
S,
|
|
175
178
|
L,
|
|
176
179
|
R,
|
|
177
180
|
z,
|
|
@@ -184,7 +187,7 @@ function g({ children: n, defaultMode: r = "system", defaultBrand: c = "default"
|
|
|
184
187
|
G,
|
|
185
188
|
K,
|
|
186
189
|
q,
|
|
187
|
-
|
|
190
|
+
k,
|
|
188
191
|
j,
|
|
189
192
|
Y,
|
|
190
193
|
X,
|
|
@@ -192,17 +195,17 @@ function g({ children: n, defaultMode: r = "system", defaultBrand: c = "default"
|
|
|
192
195
|
Q,
|
|
193
196
|
$
|
|
194
197
|
]);
|
|
195
|
-
return /* @__PURE__ */
|
|
196
|
-
value:
|
|
197
|
-
children:
|
|
198
|
+
return /* @__PURE__ */ l(g.Provider, {
|
|
199
|
+
value: ae,
|
|
200
|
+
children: r
|
|
198
201
|
});
|
|
199
202
|
}
|
|
200
|
-
function
|
|
201
|
-
let e =
|
|
203
|
+
function v() {
|
|
204
|
+
let e = i(g);
|
|
202
205
|
if (!e) throw Error("useTheme must be used within a ThemeProvider");
|
|
203
206
|
return e;
|
|
204
207
|
}
|
|
205
|
-
function
|
|
206
|
-
return
|
|
208
|
+
function y() {
|
|
209
|
+
return i(g);
|
|
207
210
|
}
|
|
208
|
-
export {
|
|
211
|
+
export { d as THEME_OPTIONS, _ as ThemeProvider, v as useTheme, y as useThemeOrNull };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Native controls follow the app's theme, not the OS (BOFF-15413). Opt-in:
|
|
3
|
+
* `AppShellConfig.themedNativeControls` → `ThemeProvider themedNativeControls`.
|
|
4
|
+
*
|
|
5
|
+
* Why: an app that declares `<meta name="color-scheme" content="dark light">`
|
|
6
|
+
* (FluidGrids does, for its dark first paint) never told the browser which of the two
|
|
7
|
+
* it is in, so everything the browser draws itself followed the OS: on a Mac in Dark
|
|
8
|
+
* mode, a FluidGrids page in Light got dark scrollbars and a dark system menu for every
|
|
9
|
+
* `<select>`. Controls styled `color-scheme: normal` (Tailwind `scheme-normal`, the
|
|
10
|
+
* fleet's native selects) read the meta, not the page, so only narrowing the meta to
|
|
11
|
+
* the theme reaches them; the rest inherit `color-scheme` from `<html>`.
|
|
12
|
+
*
|
|
13
|
+
* While on:
|
|
14
|
+
* - `<html data-native-controls="themed">`: the stylesheet hook (`tokens.css`) for
|
|
15
|
+
* `color-scheme` per theme and the one theme-aware scrollbar.
|
|
16
|
+
* - `<meta name="color-scheme">` says the theme's scheme only (`light` or `dark`);
|
|
17
|
+
* created when the page has none. Turning it off puts the meta back as it was.
|
|
18
|
+
*/
|
|
19
|
+
export declare const NATIVE_CONTROLS_ATTRIBUTE = "data-native-controls";
|
|
20
|
+
export declare const NATIVE_CONTROLS_THEMED = "themed";
|
|
21
|
+
/**
|
|
22
|
+
* Applies the opt-in for `scheme` and returns the undo: the attribute removed and the
|
|
23
|
+
* meta restored (or removed, when this added it).
|
|
24
|
+
*/
|
|
25
|
+
export declare function applyThemedNativeControls(doc: Document, scheme: 'light' | 'dark'): () => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// src/shared/providers/shell/themedNativeControls.ts
|
|
2
|
+
var e = "data-native-controls", t = "themed";
|
|
3
|
+
function n(n, r) {
|
|
4
|
+
let i = n.documentElement;
|
|
5
|
+
i.setAttribute(e, t);
|
|
6
|
+
let a = n.head.querySelector("meta[name=\"color-scheme\"]"), o = !a, s = a?.getAttribute("content") ?? null;
|
|
7
|
+
a || (a = n.createElement("meta"), a.setAttribute("name", "color-scheme"), n.head.appendChild(a)), a.setAttribute("content", r);
|
|
8
|
+
let c = a;
|
|
9
|
+
return () => {
|
|
10
|
+
i.removeAttribute(e), o ? c.remove() : s === null ? c.removeAttribute("content") : c.setAttribute("content", s);
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export { e as NATIVE_CONTROLS_ATTRIBUTE, t as NATIVE_CONTROLS_THEMED, n as applyThemedNativeControls };
|
|
@@ -3,13 +3,14 @@ import { Button as i } from "../ui/button.js";
|
|
|
3
3
|
import { Input as a } from "../ui/input.js";
|
|
4
4
|
import { Label as o } from "../ui/label.js";
|
|
5
5
|
import { Textarea as ee } from "../ui/textarea.js";
|
|
6
|
-
import { cn as
|
|
7
|
-
import { MemberPicker as
|
|
8
|
-
import { PermissionSelect as
|
|
9
|
-
import { SharedWithList as
|
|
10
|
-
import { copyTextToClipboard as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
6
|
+
import { cn as te } from "../lib/utils.js";
|
|
7
|
+
import { MemberPicker as ne } from "./MemberPicker.js";
|
|
8
|
+
import { PermissionSelect as s } from "./PermissionSelect.js";
|
|
9
|
+
import { SharedWithList as c } from "./SharedWithList.js";
|
|
10
|
+
import { copyTextToClipboard as re, normalizeShareUrl as ie } from "./shareUrl.js";
|
|
11
|
+
import { ThemedSelect as l } from "../ui/themed-select.js";
|
|
12
|
+
import { useEffect as ae, useMemo as u, useState as d } from "react";
|
|
13
|
+
import { Check as f, Copy as p, Globe as m, Link2 as h, Lock as g, Users as _ } from "lucide-react";
|
|
13
14
|
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
14
15
|
// src/sharing/ShareDialog.tsx
|
|
15
16
|
var b = [
|
|
@@ -46,20 +47,20 @@ function S(e) {
|
|
|
46
47
|
return e[0] ?? "VIEWER";
|
|
47
48
|
}
|
|
48
49
|
var C = ({ resource: C, controller: w, open: T, onOpenChange: E, workspaceId: D, authToken: O, apiGatewayUrl: k }) => {
|
|
49
|
-
let { capabilities: A } = w, j = !!C.vibeId && A.supportsVibeShare, M =
|
|
50
|
+
let { capabilities: A } = w, j = !!C.vibeId && A.supportsVibeShare, M = u(() => {
|
|
50
51
|
let e = ["private"];
|
|
51
52
|
return A.supportsUsers && e.push("users"), j && e.push("vibe"), A.supportsLink && e.push("link"), e;
|
|
52
53
|
}, [
|
|
53
54
|
A.supportsUsers,
|
|
54
55
|
A.supportsLink,
|
|
55
56
|
j
|
|
56
|
-
]), N =
|
|
57
|
-
|
|
57
|
+
]), N = u(() => A.supportsUsers ? "users" : M[0] ?? "private", [M, A.supportsUsers]), [P, F] = d(N), [I, L] = d(null), [R, oe] = d(S(A.roles)), [z, B] = d(""), [V, H] = d("never"), [U, W] = d(!1), [G, K] = d(S(A.roles)), [q, se] = d("never"), [J, Y] = d(null), [X, Z] = d(!1), [Q, $] = d(!1);
|
|
58
|
+
ae(() => {
|
|
58
59
|
T ? (F(N), w.refetch()) : (L(null), B(""), Y(null), Z(!1));
|
|
59
60
|
}, [T, N]);
|
|
60
|
-
let
|
|
61
|
+
let ce = (e) => {
|
|
61
62
|
F(e), e === "private" ? w.setVisibility?.("PRIVATE") : e === "vibe" && w.setVisibility?.("SHARED_WITH_VIBE");
|
|
62
|
-
},
|
|
63
|
+
}, le = async () => {
|
|
63
64
|
if (I?.email) {
|
|
64
65
|
W(!0);
|
|
65
66
|
try {
|
|
@@ -73,7 +74,7 @@ var C = ({ resource: C, controller: w, open: T, onOpenChange: E, workspaceId: D,
|
|
|
73
74
|
W(!1);
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
|
-
},
|
|
77
|
+
}, ue = async () => {
|
|
77
78
|
if (w.createLinkShare) {
|
|
78
79
|
$(!0);
|
|
79
80
|
try {
|
|
@@ -81,14 +82,14 @@ var C = ({ resource: C, controller: w, open: T, onOpenChange: E, workspaceId: D,
|
|
|
81
82
|
role: G,
|
|
82
83
|
expiresAt: A.supportsExpiry ? x(b.find((e) => e.value === q)?.hours ?? null) ?? null : null
|
|
83
84
|
});
|
|
84
|
-
Y(
|
|
85
|
+
Y(ie(e.shareUrl)), w.refetch();
|
|
85
86
|
} finally {
|
|
86
87
|
$(!1);
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
|
-
},
|
|
90
|
-
J && await
|
|
91
|
-
},
|
|
90
|
+
}, de = async () => {
|
|
91
|
+
J && await re(J).then(() => !0, () => !1) && (Z(!0), setTimeout(() => Z(!1), 2e3));
|
|
92
|
+
}, fe = {
|
|
92
93
|
private: {
|
|
93
94
|
label: "Private",
|
|
94
95
|
icon: g,
|
|
@@ -127,14 +128,14 @@ var C = ({ resource: C, controller: w, open: T, onOpenChange: E, workspaceId: D,
|
|
|
127
128
|
role: "tablist",
|
|
128
129
|
"aria-label": "Sharing visibility",
|
|
129
130
|
children: M.map((e) => {
|
|
130
|
-
let t =
|
|
131
|
+
let t = fe[e], n = t.icon, r = P === e;
|
|
131
132
|
return /* @__PURE__ */ y("button", {
|
|
132
133
|
type: "button",
|
|
133
134
|
role: "tab",
|
|
134
135
|
"aria-selected": r,
|
|
135
136
|
"data-testid": t.testId,
|
|
136
|
-
onClick: () =>
|
|
137
|
-
className:
|
|
137
|
+
onClick: () => ce(e),
|
|
138
|
+
className: te("inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium transition-colors", r ? "bg-bg-surface text-text-primary shadow-sm" : "text-text-secondary hover:text-text-primary"),
|
|
138
139
|
children: [/* @__PURE__ */ v(n, { className: "size-4" }), t.label]
|
|
139
140
|
}, e);
|
|
140
141
|
})
|
|
@@ -156,7 +157,7 @@ var C = ({ resource: C, controller: w, open: T, onOpenChange: E, workspaceId: D,
|
|
|
156
157
|
P === "users" ? /* @__PURE__ */ y("div", {
|
|
157
158
|
className: "space-y-4",
|
|
158
159
|
children: [
|
|
159
|
-
/* @__PURE__ */ v(
|
|
160
|
+
/* @__PURE__ */ v(ne, {
|
|
160
161
|
workspaceId: D ?? "",
|
|
161
162
|
authToken: O,
|
|
162
163
|
apiGatewayUrl: k,
|
|
@@ -174,10 +175,10 @@ var C = ({ resource: C, controller: w, open: T, onOpenChange: E, workspaceId: D,
|
|
|
174
175
|
children: [/* @__PURE__ */ v(o, {
|
|
175
176
|
htmlFor: "share-role",
|
|
176
177
|
children: "Permission"
|
|
177
|
-
}), /* @__PURE__ */ v(
|
|
178
|
+
}), /* @__PURE__ */ v(s, {
|
|
178
179
|
value: R,
|
|
179
180
|
roles: A.roles,
|
|
180
|
-
onChange:
|
|
181
|
+
onChange: oe
|
|
181
182
|
})]
|
|
182
183
|
}),
|
|
183
184
|
A.supportsExpiry ? /* @__PURE__ */ y("div", {
|
|
@@ -185,7 +186,7 @@ var C = ({ resource: C, controller: w, open: T, onOpenChange: E, workspaceId: D,
|
|
|
185
186
|
children: [/* @__PURE__ */ v(o, {
|
|
186
187
|
htmlFor: "share-user-expiry",
|
|
187
188
|
children: "Access expires"
|
|
188
|
-
}), /* @__PURE__ */ v(
|
|
189
|
+
}), /* @__PURE__ */ v(l, {
|
|
189
190
|
id: "share-user-expiry",
|
|
190
191
|
value: V,
|
|
191
192
|
onChange: (e) => H(e.target.value),
|
|
@@ -215,7 +216,7 @@ var C = ({ resource: C, controller: w, open: T, onOpenChange: E, workspaceId: D,
|
|
|
215
216
|
"data-testid": "share-invite-submit",
|
|
216
217
|
disabled: !I?.email || U,
|
|
217
218
|
onClick: () => {
|
|
218
|
-
|
|
219
|
+
le();
|
|
219
220
|
},
|
|
220
221
|
className: "w-full",
|
|
221
222
|
children: U ? "Sharing…" : "Share"
|
|
@@ -252,7 +253,7 @@ var C = ({ resource: C, controller: w, open: T, onOpenChange: E, workspaceId: D,
|
|
|
252
253
|
children: [/* @__PURE__ */ v(o, {
|
|
253
254
|
htmlFor: "share-link-role",
|
|
254
255
|
children: "Permission"
|
|
255
|
-
}), /* @__PURE__ */ v(
|
|
256
|
+
}), /* @__PURE__ */ v(s, {
|
|
256
257
|
value: G,
|
|
257
258
|
roles: A.roles,
|
|
258
259
|
onChange: K,
|
|
@@ -264,10 +265,10 @@ var C = ({ resource: C, controller: w, open: T, onOpenChange: E, workspaceId: D,
|
|
|
264
265
|
children: [/* @__PURE__ */ v(o, {
|
|
265
266
|
htmlFor: "share-link-expiry",
|
|
266
267
|
children: "Link expires"
|
|
267
|
-
}), /* @__PURE__ */ v(
|
|
268
|
+
}), /* @__PURE__ */ v(l, {
|
|
268
269
|
id: "share-link-expiry",
|
|
269
270
|
value: q,
|
|
270
|
-
onChange: (e) =>
|
|
271
|
+
onChange: (e) => se(e.target.value),
|
|
271
272
|
"data-testid": "share-link-expiry",
|
|
272
273
|
className: "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark focus:outline-none focus:ring-2 focus:ring-action-primary-bg [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
273
274
|
children: b.map((e) => /* @__PURE__ */ v("option", {
|
|
@@ -287,16 +288,16 @@ var C = ({ resource: C, controller: w, open: T, onOpenChange: E, workspaceId: D,
|
|
|
287
288
|
type: "button",
|
|
288
289
|
"data-testid": "share-copy-link",
|
|
289
290
|
onClick: () => {
|
|
290
|
-
|
|
291
|
+
de();
|
|
291
292
|
},
|
|
292
|
-
children: [v(X ?
|
|
293
|
+
children: [v(X ? f : p, { className: "size-4" }), X ? "Copied" : "Copy"]
|
|
293
294
|
})]
|
|
294
295
|
}) : /* @__PURE__ */ y(i, {
|
|
295
296
|
type: "button",
|
|
296
297
|
"data-testid": "share-create-link",
|
|
297
298
|
disabled: Q || !w.createLinkShare,
|
|
298
299
|
onClick: () => {
|
|
299
|
-
|
|
300
|
+
ue();
|
|
300
301
|
},
|
|
301
302
|
className: "w-full",
|
|
302
303
|
children: [/* @__PURE__ */ v(h, { className: "size-4" }), Q ? "Creating…" : "Create link"]
|
|
@@ -305,7 +306,7 @@ var C = ({ resource: C, controller: w, open: T, onOpenChange: E, workspaceId: D,
|
|
|
305
306
|
}) : null
|
|
306
307
|
]
|
|
307
308
|
}),
|
|
308
|
-
/* @__PURE__ */ v(
|
|
309
|
+
/* @__PURE__ */ v(c, {
|
|
309
310
|
controller: w,
|
|
310
311
|
workspaceId: D,
|
|
311
312
|
authToken: O,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { ThemedSelect as e } from "../ui/themed-select.js";
|
|
2
|
+
import { useEffect as t, useState as n } from "react";
|
|
3
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
|
+
import { gql as a } from "@apollo/client";
|
|
5
|
+
import { useApolloClient as o } from "@apollo/client/react";
|
|
5
6
|
// src/storage/StorageFolderPicker.tsx
|
|
6
|
-
var
|
|
7
|
+
var s = a`
|
|
7
8
|
query StorageFolderPicker_ListFolders($context: ContextInput!, $parentId: ID) {
|
|
8
9
|
listFiles(context: $context, parentId: $parentId, kind: FOLDER) {
|
|
9
10
|
items {
|
|
@@ -14,7 +15,7 @@ var o = i`
|
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
|
-
`,
|
|
18
|
+
`, c = a`
|
|
18
19
|
mutation StorageFolderPicker_CreateFolder($input: CreateFolderInput!) {
|
|
19
20
|
createFolder(input: $input) {
|
|
20
21
|
id
|
|
@@ -24,112 +25,112 @@ var o = i`
|
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
`;
|
|
27
|
-
function
|
|
28
|
-
let
|
|
29
|
-
return
|
|
28
|
+
function l({ workspaceId: a, value: l, onChange: u, operations: d, initialParentId: f, disabled: p }) {
|
|
29
|
+
let m = o(), [h, g] = n(null), [_, v] = n(!1), [y, b] = n(""), [x, S] = n(null), C = d?.list ?? s, w = d?.create ?? c;
|
|
30
|
+
return t(() => {
|
|
30
31
|
let e = !1;
|
|
31
|
-
return
|
|
32
|
-
query:
|
|
32
|
+
return g(null), S(null), m.query({
|
|
33
|
+
query: C,
|
|
33
34
|
variables: {
|
|
34
|
-
context: { workspaceId:
|
|
35
|
-
parentId:
|
|
35
|
+
context: { workspaceId: a },
|
|
36
|
+
parentId: f ?? null
|
|
36
37
|
},
|
|
37
38
|
fetchPolicy: "network-only"
|
|
38
39
|
}).then((t) => {
|
|
39
40
|
if (e) return;
|
|
40
41
|
let n = t.data?.listFiles?.items ?? [];
|
|
41
|
-
|
|
42
|
+
g(n.map(({ __typename: e, ...t }) => t));
|
|
42
43
|
}).catch((t) => {
|
|
43
|
-
e ||
|
|
44
|
+
e || S(t instanceof Error ? t.message : String(t));
|
|
44
45
|
}), () => {
|
|
45
46
|
e = !0;
|
|
46
47
|
};
|
|
47
48
|
}, [
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
]), /* @__PURE__ */
|
|
49
|
+
m,
|
|
50
|
+
C,
|
|
51
|
+
a,
|
|
52
|
+
f
|
|
53
|
+
]), /* @__PURE__ */ i("div", {
|
|
53
54
|
className: "space-y-2",
|
|
54
55
|
children: [
|
|
55
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ r("label", {
|
|
56
57
|
className: "block text-xs font-medium text-text-secondary",
|
|
57
58
|
children: "Save to folder"
|
|
58
59
|
}),
|
|
59
|
-
|
|
60
|
+
x && /* @__PURE__ */ r("p", {
|
|
60
61
|
className: "text-xs text-status-error-text",
|
|
61
|
-
children:
|
|
62
|
+
children: x
|
|
62
63
|
}),
|
|
63
|
-
|
|
64
|
+
h == null ? /* @__PURE__ */ r("p", {
|
|
64
65
|
className: "text-xs text-text-tertiary",
|
|
65
66
|
children: "Loading folders…"
|
|
66
|
-
}) :
|
|
67
|
+
}) : h.length === 0 ? /* @__PURE__ */ r("p", {
|
|
67
68
|
className: "text-xs text-text-tertiary",
|
|
68
69
|
children: "No folders yet — create one."
|
|
69
|
-
}) : /* @__PURE__ */
|
|
70
|
-
disabled:
|
|
71
|
-
value:
|
|
70
|
+
}) : /* @__PURE__ */ i(e, {
|
|
71
|
+
disabled: p,
|
|
72
|
+
value: l?.id ?? "",
|
|
72
73
|
onChange: (e) => {
|
|
73
|
-
|
|
74
|
+
u(h.find((t) => t.id === e.target.value) ?? null);
|
|
74
75
|
},
|
|
75
76
|
className: "w-full rounded-md border border-border-subtle bg-bg-surface text-text-primary px-2 py-1.5 text-sm scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
76
77
|
"aria-label": "Folder",
|
|
77
|
-
children: [/* @__PURE__ */
|
|
78
|
+
children: [/* @__PURE__ */ r("option", {
|
|
78
79
|
value: "",
|
|
79
80
|
children: "— Pick a folder —"
|
|
80
|
-
}),
|
|
81
|
+
}), h.map((e) => /* @__PURE__ */ r("option", {
|
|
81
82
|
value: e.id,
|
|
82
83
|
children: e.path
|
|
83
84
|
}, e.id))]
|
|
84
85
|
}),
|
|
85
|
-
|
|
86
|
+
_ ? /* @__PURE__ */ i("div", {
|
|
86
87
|
className: "flex items-center gap-2",
|
|
87
88
|
children: [
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ r("input", {
|
|
89
90
|
type: "text",
|
|
90
|
-
value:
|
|
91
|
-
onChange: (e) =>
|
|
91
|
+
value: y,
|
|
92
|
+
onChange: (e) => b(e.target.value),
|
|
92
93
|
placeholder: "New folder name",
|
|
93
94
|
className: "flex-1 rounded-md border border-border-subtle bg-bg-surface px-2 py-1.5 text-sm"
|
|
94
95
|
}),
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ r("button", {
|
|
96
97
|
type: "button",
|
|
97
98
|
onClick: async () => {
|
|
98
|
-
let e =
|
|
99
|
+
let e = y.trim();
|
|
99
100
|
if (e) try {
|
|
100
|
-
let t = (await
|
|
101
|
-
mutation:
|
|
101
|
+
let t = (await m.mutate({
|
|
102
|
+
mutation: w,
|
|
102
103
|
variables: { input: {
|
|
103
104
|
name: e,
|
|
104
|
-
parentId:
|
|
105
|
-
context: { workspaceId:
|
|
105
|
+
parentId: f ?? null,
|
|
106
|
+
context: { workspaceId: a }
|
|
106
107
|
} }
|
|
107
108
|
})).data?.createFolder;
|
|
108
|
-
t && (
|
|
109
|
+
t && (g((e) => e ? [...e, t] : [t]), b(""), v(!1), u(t));
|
|
109
110
|
} catch (e) {
|
|
110
|
-
|
|
111
|
+
S(e instanceof Error ? e.message : String(e));
|
|
111
112
|
}
|
|
112
113
|
},
|
|
113
114
|
className: "rounded-md bg-status-info-bg-default px-2.5 py-1.5 text-xs text-status-info-text-inverse",
|
|
114
115
|
children: "Create"
|
|
115
116
|
}),
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
+
/* @__PURE__ */ r("button", {
|
|
117
118
|
type: "button",
|
|
118
119
|
onClick: () => {
|
|
119
|
-
|
|
120
|
+
v(!1), b("");
|
|
120
121
|
},
|
|
121
122
|
className: "rounded-md border border-border-subtle px-2.5 py-1.5 text-xs text-text-secondary",
|
|
122
123
|
children: "Cancel"
|
|
123
124
|
})
|
|
124
125
|
]
|
|
125
|
-
}) : /* @__PURE__ */
|
|
126
|
+
}) : /* @__PURE__ */ r("button", {
|
|
126
127
|
type: "button",
|
|
127
|
-
onClick: () =>
|
|
128
|
-
disabled:
|
|
128
|
+
onClick: () => v(!0),
|
|
129
|
+
disabled: p,
|
|
129
130
|
className: "text-xs text-status-info-text hover:underline disabled:opacity-50",
|
|
130
131
|
children: "+ New folder"
|
|
131
132
|
})
|
|
132
133
|
]
|
|
133
134
|
});
|
|
134
135
|
}
|
|
135
|
-
export {
|
|
136
|
+
export { l as StorageFolderPicker };
|