reifyui 0.13.7 → 0.13.9
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/index.cjs +674 -518
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +435 -279
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/auth/AuthForm.jsx +17 -2
- package/src/auth/GoogleButton.jsx +26 -6
- package/src/auth/MicrosoftButton.jsx +128 -0
- package/src/auth/client.js +9 -0
- package/src/index.js +2 -1
package/dist/index.js
CHANGED
|
@@ -1832,6 +1832,11 @@ async function googleSignIn(credential) {
|
|
|
1832
1832
|
setSession(s);
|
|
1833
1833
|
return s;
|
|
1834
1834
|
}
|
|
1835
|
+
async function microsoftSignIn(credential) {
|
|
1836
|
+
const s = toSession(await authPost("/v1/auth/microsoft", { credential, product: _cfg.product }));
|
|
1837
|
+
setSession(s);
|
|
1838
|
+
return s;
|
|
1839
|
+
}
|
|
1835
1840
|
async function requestPasswordReset(email) {
|
|
1836
1841
|
await fetch(`${_cfg.engine}/v1/auth/request-password-reset`, {
|
|
1837
1842
|
method: "POST",
|
|
@@ -1897,13 +1902,13 @@ async function fetchBalance() {
|
|
|
1897
1902
|
}
|
|
1898
1903
|
|
|
1899
1904
|
// src/auth/AuthForm.jsx
|
|
1900
|
-
import { useState as
|
|
1905
|
+
import { useState as useState9 } from "react";
|
|
1901
1906
|
|
|
1902
1907
|
// src/auth/GoogleButton.jsx
|
|
1903
1908
|
import { useEffect as useEffect6, useRef as useRef6, useState as useState7 } from "react";
|
|
1904
1909
|
import { Fragment as Fragment6, jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1905
1910
|
var CLIENT_ID = "247853836408-ojk91u8901hdlbkevid4fohmrfdot17l.apps.googleusercontent.com";
|
|
1906
|
-
function GoogleButton({ onCredential, onError }) {
|
|
1911
|
+
function GoogleButton({ onCredential, onError, divider = true }) {
|
|
1907
1912
|
const ref = useRef6(null);
|
|
1908
1913
|
const [failed, setFailed] = useState7(false);
|
|
1909
1914
|
const cb = useRef6({ onCredential, onError });
|
|
@@ -1912,6 +1917,24 @@ function GoogleButton({ onCredential, onError }) {
|
|
|
1912
1917
|
if (!CLIENT_ID || !ref.current) return void 0;
|
|
1913
1918
|
const SRC = "https://accounts.google.com/gsi/client";
|
|
1914
1919
|
let done = false;
|
|
1920
|
+
let drawn = 0;
|
|
1921
|
+
let observer = null;
|
|
1922
|
+
const draw = () => {
|
|
1923
|
+
const g = window.google;
|
|
1924
|
+
if (!g?.accounts?.id || !ref.current) return;
|
|
1925
|
+
const box = ref.current.getBoundingClientRect().width || 320;
|
|
1926
|
+
const width = Math.round(Math.max(200, Math.min(400, box)));
|
|
1927
|
+
if (Math.abs(width - drawn) < 2) return;
|
|
1928
|
+
drawn = width;
|
|
1929
|
+
ref.current.innerHTML = "";
|
|
1930
|
+
g.accounts.id.renderButton(ref.current, {
|
|
1931
|
+
theme: "outline",
|
|
1932
|
+
size: "large",
|
|
1933
|
+
shape: "pill",
|
|
1934
|
+
text: "continue_with",
|
|
1935
|
+
width
|
|
1936
|
+
});
|
|
1937
|
+
};
|
|
1915
1938
|
const render = () => {
|
|
1916
1939
|
if (done) return;
|
|
1917
1940
|
const g = window.google;
|
|
@@ -1925,14 +1948,16 @@ function GoogleButton({ onCredential, onError }) {
|
|
|
1925
1948
|
else cb.current.onError?.("Google sign in was cancelled.");
|
|
1926
1949
|
}
|
|
1927
1950
|
});
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1951
|
+
draw();
|
|
1952
|
+
if (typeof ResizeObserver === "function") {
|
|
1953
|
+
observer = new ResizeObserver(() => {
|
|
1954
|
+
try {
|
|
1955
|
+
draw();
|
|
1956
|
+
} catch {
|
|
1957
|
+
}
|
|
1958
|
+
});
|
|
1959
|
+
observer.observe(ref.current);
|
|
1960
|
+
}
|
|
1936
1961
|
} catch {
|
|
1937
1962
|
setFailed(true);
|
|
1938
1963
|
}
|
|
@@ -1956,27 +1981,141 @@ function GoogleButton({ onCredential, onError }) {
|
|
|
1956
1981
|
return () => {
|
|
1957
1982
|
s?.removeEventListener("load", render);
|
|
1958
1983
|
window.clearTimeout(check);
|
|
1984
|
+
observer?.disconnect();
|
|
1959
1985
|
};
|
|
1960
1986
|
}, []);
|
|
1961
1987
|
if (!CLIENT_ID || failed) return null;
|
|
1962
1988
|
return /* @__PURE__ */ jsxs8(Fragment6, { children: [
|
|
1963
|
-
/* @__PURE__ */ jsx9("div", { className: "auth-or", children: /* @__PURE__ */ jsx9("span", { children: "or" }) }),
|
|
1989
|
+
divider && /* @__PURE__ */ jsx9("div", { className: "auth-or", children: /* @__PURE__ */ jsx9("span", { children: "or" }) }),
|
|
1964
1990
|
/* @__PURE__ */ jsx9("div", { ref, className: "auth-gwrap" })
|
|
1965
1991
|
] });
|
|
1966
1992
|
}
|
|
1967
1993
|
var GOOGLE_ENABLED = !!CLIENT_ID;
|
|
1968
1994
|
|
|
1995
|
+
// src/auth/MicrosoftButton.jsx
|
|
1996
|
+
import { useRef as useRef7, useState as useState8 } from "react";
|
|
1997
|
+
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1998
|
+
var CLIENT_ID2 = "cb5c1b6e-aca8-48dd-9da9-31320de30b73";
|
|
1999
|
+
var AUTHORIZE = "https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize";
|
|
2000
|
+
var RETURN_PATH = "/auth/microsoft";
|
|
2001
|
+
var GIVE_UP_MS = 5 * 60 * 1e3;
|
|
2002
|
+
var MICROSOFT_ENABLED = !!CLIENT_ID2;
|
|
2003
|
+
function randomHex(bytes = 16) {
|
|
2004
|
+
const a = new Uint8Array(bytes);
|
|
2005
|
+
crypto.getRandomValues(a);
|
|
2006
|
+
return Array.from(a, (b) => b.toString(16).padStart(2, "0")).join("");
|
|
2007
|
+
}
|
|
2008
|
+
function jwtClaims(token) {
|
|
2009
|
+
try {
|
|
2010
|
+
const part = token.split(".")[1].replace(/-/g, "+").replace(/_/g, "/");
|
|
2011
|
+
const bin = atob(part + "=".repeat((4 - part.length % 4) % 4));
|
|
2012
|
+
return JSON.parse(new TextDecoder().decode(Uint8Array.from(bin, (c) => c.charCodeAt(0))));
|
|
2013
|
+
} catch {
|
|
2014
|
+
return {};
|
|
2015
|
+
}
|
|
2016
|
+
}
|
|
2017
|
+
function microsoftIdToken() {
|
|
2018
|
+
return new Promise((resolve, reject) => {
|
|
2019
|
+
const state = randomHex();
|
|
2020
|
+
const nonce = randomHex();
|
|
2021
|
+
const back = `${window.location.origin}${RETURN_PATH}`;
|
|
2022
|
+
const url = `${AUTHORIZE}?${new URLSearchParams({
|
|
2023
|
+
client_id: CLIENT_ID2,
|
|
2024
|
+
response_type: "id_token",
|
|
2025
|
+
redirect_uri: back,
|
|
2026
|
+
scope: "openid profile email",
|
|
2027
|
+
response_mode: "fragment",
|
|
2028
|
+
state,
|
|
2029
|
+
nonce,
|
|
2030
|
+
prompt: "select_account"
|
|
2031
|
+
})}`;
|
|
2032
|
+
const w = 480;
|
|
2033
|
+
const h = 640;
|
|
2034
|
+
const left = Math.max(0, window.screenX + (window.outerWidth - w) / 2);
|
|
2035
|
+
const top = Math.max(0, window.screenY + (window.outerHeight - h) / 2);
|
|
2036
|
+
const popup = window.open(url, "microsoft-sign-in", `width=${w},height=${h},left=${left},top=${top}`);
|
|
2037
|
+
if (!popup) {
|
|
2038
|
+
reject(new Error("Allow pop-ups for this site to sign in with Microsoft."));
|
|
2039
|
+
return;
|
|
2040
|
+
}
|
|
2041
|
+
const started = Date.now();
|
|
2042
|
+
const timer = window.setInterval(() => {
|
|
2043
|
+
if (popup.closed) {
|
|
2044
|
+
window.clearInterval(timer);
|
|
2045
|
+
reject(new Error("Microsoft sign in was cancelled."));
|
|
2046
|
+
return;
|
|
2047
|
+
}
|
|
2048
|
+
if (Date.now() - started > GIVE_UP_MS) {
|
|
2049
|
+
window.clearInterval(timer);
|
|
2050
|
+
popup.close();
|
|
2051
|
+
reject(new Error("Microsoft sign in took too long. Try again."));
|
|
2052
|
+
return;
|
|
2053
|
+
}
|
|
2054
|
+
let href = "";
|
|
2055
|
+
try {
|
|
2056
|
+
href = popup.location.href;
|
|
2057
|
+
} catch {
|
|
2058
|
+
return;
|
|
2059
|
+
}
|
|
2060
|
+
if (!href.startsWith(back)) return;
|
|
2061
|
+
window.clearInterval(timer);
|
|
2062
|
+
const params = new URLSearchParams(popup.location.hash.replace(/^#/, ""));
|
|
2063
|
+
popup.close();
|
|
2064
|
+
if (params.get("error")) {
|
|
2065
|
+
const why = (params.get("error_description") || "").split(/\r?\n/)[0].replace(/^AADSTS\d+:\s*/, "");
|
|
2066
|
+
reject(new Error(why || "Microsoft sign in did not complete."));
|
|
2067
|
+
return;
|
|
2068
|
+
}
|
|
2069
|
+
const token = params.get("id_token") || "";
|
|
2070
|
+
if (!token || params.get("state") !== state || jwtClaims(token).nonce !== nonce) {
|
|
2071
|
+
reject(new Error("Microsoft sign in could not be confirmed. Try again."));
|
|
2072
|
+
return;
|
|
2073
|
+
}
|
|
2074
|
+
resolve(token);
|
|
2075
|
+
}, 300);
|
|
2076
|
+
});
|
|
2077
|
+
}
|
|
2078
|
+
function MicrosoftLogo() {
|
|
2079
|
+
return /* @__PURE__ */ jsxs9("svg", { width: "18", height: "18", viewBox: "0 0 21 21", "aria-hidden": "true", children: [
|
|
2080
|
+
/* @__PURE__ */ jsx10("rect", { x: "1", y: "1", width: "9", height: "9", fill: "#F25022" }),
|
|
2081
|
+
/* @__PURE__ */ jsx10("rect", { x: "11", y: "1", width: "9", height: "9", fill: "#7FBA00" }),
|
|
2082
|
+
/* @__PURE__ */ jsx10("rect", { x: "1", y: "11", width: "9", height: "9", fill: "#00A4EF" }),
|
|
2083
|
+
/* @__PURE__ */ jsx10("rect", { x: "11", y: "11", width: "9", height: "9", fill: "#FFB900" })
|
|
2084
|
+
] });
|
|
2085
|
+
}
|
|
2086
|
+
function MicrosoftButton({ onCredential, onError, disabled }) {
|
|
2087
|
+
const [waiting, setWaiting] = useState8(false);
|
|
2088
|
+
const cb = useRef7({ onCredential, onError });
|
|
2089
|
+
cb.current = { onCredential, onError };
|
|
2090
|
+
if (!CLIENT_ID2) return null;
|
|
2091
|
+
async function start() {
|
|
2092
|
+
setWaiting(true);
|
|
2093
|
+
try {
|
|
2094
|
+
const token = await microsoftIdToken();
|
|
2095
|
+
await cb.current.onCredential(token);
|
|
2096
|
+
} catch (ex) {
|
|
2097
|
+
cb.current.onError?.(ex instanceof Error ? ex.message : "Microsoft sign in failed.");
|
|
2098
|
+
} finally {
|
|
2099
|
+
setWaiting(false);
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2102
|
+
return /* @__PURE__ */ jsx10("div", { className: "auth-mswrap", children: /* @__PURE__ */ jsxs9("button", { type: "button", className: "auth-msbtn", onClick: start, disabled: disabled || waiting, children: [
|
|
2103
|
+
/* @__PURE__ */ jsx10(MicrosoftLogo, {}),
|
|
2104
|
+
/* @__PURE__ */ jsx10("span", { children: waiting ? "Waiting for Microsoft..." : "Sign in with Microsoft" })
|
|
2105
|
+
] }) });
|
|
2106
|
+
}
|
|
2107
|
+
|
|
1969
2108
|
// src/auth/AuthForm.jsx
|
|
1970
|
-
import { Fragment as Fragment7, jsx as
|
|
2109
|
+
import { Fragment as Fragment7, jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1971
2110
|
function AuthForm({ onDone, subtitle: subtitle2, brand = null, productName = "" }) {
|
|
1972
|
-
const [mode, setMode] =
|
|
1973
|
-
const [email, setEmail] =
|
|
1974
|
-
const [password, setPassword] =
|
|
1975
|
-
const [name, setName] =
|
|
1976
|
-
const [err, setErr] =
|
|
1977
|
-
const [busy, setBusy] =
|
|
1978
|
-
const [choices, setChoices] =
|
|
1979
|
-
const [resetSent, setResetSent] =
|
|
2111
|
+
const [mode, setMode] = useState9("signin");
|
|
2112
|
+
const [email, setEmail] = useState9("");
|
|
2113
|
+
const [password, setPassword] = useState9("");
|
|
2114
|
+
const [name, setName] = useState9("");
|
|
2115
|
+
const [err, setErr] = useState9("");
|
|
2116
|
+
const [busy, setBusy] = useState9(false);
|
|
2117
|
+
const [choices, setChoices] = useState9(null);
|
|
2118
|
+
const [resetSent, setResetSent] = useState9(false);
|
|
1980
2119
|
async function enter(orgId) {
|
|
1981
2120
|
const session = await switchOrg(orgId);
|
|
1982
2121
|
onDone(session);
|
|
@@ -2005,6 +2144,17 @@ function AuthForm({ onDone, subtitle: subtitle2, brand = null, productName = ""
|
|
|
2005
2144
|
setBusy(false);
|
|
2006
2145
|
}
|
|
2007
2146
|
}
|
|
2147
|
+
async function onMicrosoft(credential) {
|
|
2148
|
+
setErr("");
|
|
2149
|
+
setBusy(true);
|
|
2150
|
+
try {
|
|
2151
|
+
await afterAuth(await microsoftSignIn(credential));
|
|
2152
|
+
} catch (ex) {
|
|
2153
|
+
setErr(ex instanceof Error ? ex.message : "Microsoft sign in failed.");
|
|
2154
|
+
} finally {
|
|
2155
|
+
setBusy(false);
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2008
2158
|
async function onGoogle(credential) {
|
|
2009
2159
|
setErr("");
|
|
2010
2160
|
setBusy(true);
|
|
@@ -2017,10 +2167,10 @@ function AuthForm({ onDone, subtitle: subtitle2, brand = null, productName = ""
|
|
|
2017
2167
|
}
|
|
2018
2168
|
}
|
|
2019
2169
|
if (choices) {
|
|
2020
|
-
return /* @__PURE__ */
|
|
2021
|
-
/* @__PURE__ */
|
|
2022
|
-
/* @__PURE__ */
|
|
2023
|
-
/* @__PURE__ */
|
|
2170
|
+
return /* @__PURE__ */ jsxs10("div", { children: [
|
|
2171
|
+
/* @__PURE__ */ jsx11("div", { className: "logo", children: brand }),
|
|
2172
|
+
/* @__PURE__ */ jsx11("h1", { children: "Choose workspace" }),
|
|
2173
|
+
/* @__PURE__ */ jsx11("div", { className: "org-list", children: choices.map((o) => /* @__PURE__ */ jsx11(
|
|
2024
2174
|
"button",
|
|
2025
2175
|
{
|
|
2026
2176
|
type: "button",
|
|
@@ -2038,20 +2188,20 @@ function AuthForm({ onDone, subtitle: subtitle2, brand = null, productName = ""
|
|
|
2038
2188
|
},
|
|
2039
2189
|
o.id
|
|
2040
2190
|
)) }),
|
|
2041
|
-
err && /* @__PURE__ */
|
|
2191
|
+
err && /* @__PURE__ */ jsx11("div", { className: "auth-err", children: err })
|
|
2042
2192
|
] });
|
|
2043
2193
|
}
|
|
2044
|
-
return /* @__PURE__ */
|
|
2045
|
-
/* @__PURE__ */
|
|
2046
|
-
/* @__PURE__ */
|
|
2047
|
-
/* @__PURE__ */
|
|
2048
|
-
mode === "forgot" ? resetSent ? /* @__PURE__ */
|
|
2049
|
-
/* @__PURE__ */
|
|
2194
|
+
return /* @__PURE__ */ jsxs10("form", { onSubmit: submit, children: [
|
|
2195
|
+
/* @__PURE__ */ jsx11("div", { className: "logo", children: brand }),
|
|
2196
|
+
/* @__PURE__ */ jsx11("h1", { children: mode === "register" ? "Create your account" : mode === "forgot" ? "Reset password" : "Sign in" }),
|
|
2197
|
+
/* @__PURE__ */ jsx11("p", { className: "sub", children: mode === "register" ? "Get started in seconds." : mode === "forgot" ? "We will email you a reset link." : subtitle2 || "Welcome back." }),
|
|
2198
|
+
mode === "forgot" ? resetSent ? /* @__PURE__ */ jsxs10(Fragment7, { children: [
|
|
2199
|
+
/* @__PURE__ */ jsxs10("div", { className: "auth-note", children: [
|
|
2050
2200
|
"If an account exists for ",
|
|
2051
|
-
/* @__PURE__ */
|
|
2201
|
+
/* @__PURE__ */ jsx11("b", { children: email.trim() }),
|
|
2052
2202
|
", a password reset link is on its way. It is valid for 1 hour."
|
|
2053
2203
|
] }),
|
|
2054
|
-
/* @__PURE__ */
|
|
2204
|
+
/* @__PURE__ */ jsx11(
|
|
2055
2205
|
"button",
|
|
2056
2206
|
{
|
|
2057
2207
|
type: "button",
|
|
@@ -2065,36 +2215,36 @@ function AuthForm({ onDone, subtitle: subtitle2, brand = null, productName = ""
|
|
|
2065
2215
|
children: "Back to sign in"
|
|
2066
2216
|
}
|
|
2067
2217
|
)
|
|
2068
|
-
] }) : /* @__PURE__ */
|
|
2069
|
-
/* @__PURE__ */
|
|
2070
|
-
/* @__PURE__ */
|
|
2071
|
-
/* @__PURE__ */
|
|
2218
|
+
] }) : /* @__PURE__ */ jsxs10(Fragment7, { children: [
|
|
2219
|
+
/* @__PURE__ */ jsxs10("div", { className: "field", children: [
|
|
2220
|
+
/* @__PURE__ */ jsx11("label", { children: "Email" }),
|
|
2221
|
+
/* @__PURE__ */ jsx11("input", { className: "input", type: "email", value: email, onChange: (e) => setEmail(e.target.value), autoFocus: true, required: true, autoComplete: "email" })
|
|
2072
2222
|
] }),
|
|
2073
|
-
err && /* @__PURE__ */
|
|
2074
|
-
/* @__PURE__ */
|
|
2075
|
-
/* @__PURE__ */
|
|
2223
|
+
err && /* @__PURE__ */ jsx11("div", { className: "auth-err", children: err }),
|
|
2224
|
+
/* @__PURE__ */ jsx11("button", { type: "submit", className: "btn primary lg", style: { width: "100%", marginTop: 8 }, disabled: busy, children: busy ? "Please wait..." : "Send reset link" }),
|
|
2225
|
+
/* @__PURE__ */ jsx11("p", { className: "auth-switch", children: /* @__PURE__ */ jsx11("button", { type: "button", onClick: () => {
|
|
2076
2226
|
setErr("");
|
|
2077
2227
|
setMode("signin");
|
|
2078
2228
|
}, children: "Back to sign in" }) })
|
|
2079
|
-
] }) : /* @__PURE__ */
|
|
2080
|
-
mode === "register" && /* @__PURE__ */
|
|
2081
|
-
/* @__PURE__ */
|
|
2082
|
-
/* @__PURE__ */
|
|
2229
|
+
] }) : /* @__PURE__ */ jsxs10(Fragment7, { children: [
|
|
2230
|
+
mode === "register" && /* @__PURE__ */ jsxs10("div", { className: "field", children: [
|
|
2231
|
+
/* @__PURE__ */ jsx11("label", { children: "Name" }),
|
|
2232
|
+
/* @__PURE__ */ jsx11("input", { className: "input", value: name, onChange: (e) => setName(e.target.value), autoComplete: "name", placeholder: "Jane Doe" })
|
|
2083
2233
|
] }),
|
|
2084
|
-
/* @__PURE__ */
|
|
2085
|
-
/* @__PURE__ */
|
|
2086
|
-
/* @__PURE__ */
|
|
2234
|
+
/* @__PURE__ */ jsxs10("div", { className: "field", children: [
|
|
2235
|
+
/* @__PURE__ */ jsx11("label", { children: "Email" }),
|
|
2236
|
+
/* @__PURE__ */ jsx11("input", { className: "input", type: "email", value: email, onChange: (e) => setEmail(e.target.value), autoFocus: true, required: true, autoComplete: "email" })
|
|
2087
2237
|
] }),
|
|
2088
|
-
/* @__PURE__ */
|
|
2089
|
-
/* @__PURE__ */
|
|
2090
|
-
/* @__PURE__ */
|
|
2091
|
-
mode === "signin" && /* @__PURE__ */
|
|
2238
|
+
/* @__PURE__ */ jsxs10("div", { className: "field", children: [
|
|
2239
|
+
/* @__PURE__ */ jsxs10("div", { className: "field-row", children: [
|
|
2240
|
+
/* @__PURE__ */ jsx11("label", { children: "Password" }),
|
|
2241
|
+
mode === "signin" && /* @__PURE__ */ jsx11("button", { type: "button", className: "link-sm", onClick: () => {
|
|
2092
2242
|
setErr("");
|
|
2093
2243
|
setResetSent(false);
|
|
2094
2244
|
setMode("forgot");
|
|
2095
2245
|
}, children: "Forgot password?" })
|
|
2096
2246
|
] }),
|
|
2097
|
-
/* @__PURE__ */
|
|
2247
|
+
/* @__PURE__ */ jsx11(
|
|
2098
2248
|
"input",
|
|
2099
2249
|
{
|
|
2100
2250
|
className: "input",
|
|
@@ -2107,13 +2257,15 @@ function AuthForm({ onDone, subtitle: subtitle2, brand = null, productName = ""
|
|
|
2107
2257
|
}
|
|
2108
2258
|
)
|
|
2109
2259
|
] }),
|
|
2110
|
-
err && /* @__PURE__ */
|
|
2111
|
-
/* @__PURE__ */
|
|
2112
|
-
GOOGLE_ENABLED && /* @__PURE__ */
|
|
2113
|
-
/* @__PURE__ */
|
|
2260
|
+
err && /* @__PURE__ */ jsx11("div", { className: "auth-err", children: err }),
|
|
2261
|
+
/* @__PURE__ */ jsx11("button", { type: "submit", className: "btn primary lg", style: { width: "100%", marginTop: 8 }, disabled: busy, children: busy ? "Please wait..." : mode === "register" ? "Create account" : "Sign in" }),
|
|
2262
|
+
(GOOGLE_ENABLED || MICROSOFT_ENABLED) && /* @__PURE__ */ jsx11("div", { className: "auth-or", children: /* @__PURE__ */ jsx11("span", { children: "or" }) }),
|
|
2263
|
+
GOOGLE_ENABLED && /* @__PURE__ */ jsx11(GoogleButton, { onCredential: onGoogle, onError: setErr, divider: false }),
|
|
2264
|
+
MICROSOFT_ENABLED && /* @__PURE__ */ jsx11(MicrosoftButton, { onCredential: onMicrosoft, onError: setErr, disabled: busy }),
|
|
2265
|
+
/* @__PURE__ */ jsxs10("p", { className: "auth-switch", children: [
|
|
2114
2266
|
mode === "register" ? "Already have an account?" : `New to ${productName || "the product"}?`,
|
|
2115
2267
|
" ",
|
|
2116
|
-
/* @__PURE__ */
|
|
2268
|
+
/* @__PURE__ */ jsx11("button", { type: "button", onClick: () => {
|
|
2117
2269
|
setErr("");
|
|
2118
2270
|
setMode(mode === "register" ? "signin" : "register");
|
|
2119
2271
|
}, children: mode === "register" ? "Sign in" : "Create one" })
|
|
@@ -2123,8 +2275,8 @@ function AuthForm({ onDone, subtitle: subtitle2, brand = null, productName = ""
|
|
|
2123
2275
|
}
|
|
2124
2276
|
|
|
2125
2277
|
// src/components/FileTypeIcon.jsx
|
|
2126
|
-
import { useEffect as useEffect7, useState as
|
|
2127
|
-
import { jsx as
|
|
2278
|
+
import { useEffect as useEffect7, useState as useState10 } from "react";
|
|
2279
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
2128
2280
|
function extOf(name) {
|
|
2129
2281
|
const m = String(name || "").toLowerCase().match(/\.([a-z0-9]+)$/);
|
|
2130
2282
|
return m ? m[1] : "";
|
|
@@ -2132,7 +2284,7 @@ function extOf(name) {
|
|
|
2132
2284
|
var mod = null;
|
|
2133
2285
|
var tried = false;
|
|
2134
2286
|
function FileTypeIcon({ name, size = 36 }) {
|
|
2135
|
-
const [, force] =
|
|
2287
|
+
const [, force] = useState10(0);
|
|
2136
2288
|
const ext = extOf(name);
|
|
2137
2289
|
useEffect7(() => {
|
|
2138
2290
|
if (tried || mod) return;
|
|
@@ -2145,15 +2297,15 @@ function FileTypeIcon({ name, size = 36 }) {
|
|
|
2145
2297
|
}, []);
|
|
2146
2298
|
const box = { width: size, height: Math.round(size * 1.16), display: "inline-block", flex: "0 0 auto" };
|
|
2147
2299
|
if (!mod) {
|
|
2148
|
-
return /* @__PURE__ */
|
|
2300
|
+
return /* @__PURE__ */ jsx12("span", { className: "uic-fileglyph", style: box, "aria-hidden": "true", children: /* @__PURE__ */ jsx12("span", { className: "uic-fileglyph-ext", children: (ext || "file").slice(0, 4) }) });
|
|
2149
2301
|
}
|
|
2150
2302
|
const { FileIcon, defaultStyles } = mod;
|
|
2151
2303
|
const style = defaultStyles?.[ext] || {};
|
|
2152
|
-
return /* @__PURE__ */
|
|
2304
|
+
return /* @__PURE__ */ jsx12("span", { style: box, children: /* @__PURE__ */ jsx12(FileIcon, { extension: ext || void 0, ...style }) });
|
|
2153
2305
|
}
|
|
2154
2306
|
|
|
2155
2307
|
// src/components/FileCard.jsx
|
|
2156
|
-
import { jsx as
|
|
2308
|
+
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2157
2309
|
function subtitle(name, origin, bytes) {
|
|
2158
2310
|
const parts = [(extOf(name) || "file").toUpperCase()];
|
|
2159
2311
|
if (origin) parts.push(origin);
|
|
@@ -2171,7 +2323,7 @@ function FileCard({ name, origin = "output", bytes, onPreview, onDownload, class
|
|
|
2171
2323
|
e.stopPropagation();
|
|
2172
2324
|
onPreview();
|
|
2173
2325
|
} : void 0;
|
|
2174
|
-
return /* @__PURE__ */
|
|
2326
|
+
return /* @__PURE__ */ jsxs11(
|
|
2175
2327
|
"div",
|
|
2176
2328
|
{
|
|
2177
2329
|
className: "uic-filecard" + (open ? " is-clickable" : "") + (className ? " " + className : ""),
|
|
@@ -2186,12 +2338,12 @@ function FileCard({ name, origin = "output", bytes, onPreview, onDownload, class
|
|
|
2186
2338
|
} : void 0,
|
|
2187
2339
|
title: name,
|
|
2188
2340
|
children: [
|
|
2189
|
-
/* @__PURE__ */
|
|
2190
|
-
/* @__PURE__ */
|
|
2191
|
-
/* @__PURE__ */
|
|
2192
|
-
/* @__PURE__ */
|
|
2341
|
+
/* @__PURE__ */ jsx13("span", { className: "uic-filecard-ic", children: /* @__PURE__ */ jsx13(FileTypeIcon, { name, size: 32 }) }),
|
|
2342
|
+
/* @__PURE__ */ jsxs11("span", { className: "uic-filecard-meta", children: [
|
|
2343
|
+
/* @__PURE__ */ jsx13("span", { className: "uic-filecard-name", children: name }),
|
|
2344
|
+
/* @__PURE__ */ jsx13("span", { className: "uic-filecard-sub", children: subtitle(name, origin, bytes) })
|
|
2193
2345
|
] }),
|
|
2194
|
-
onDownload && /* @__PURE__ */
|
|
2346
|
+
onDownload && /* @__PURE__ */ jsx13(
|
|
2195
2347
|
"button",
|
|
2196
2348
|
{
|
|
2197
2349
|
type: "button",
|
|
@@ -2202,18 +2354,18 @@ function FileCard({ name, origin = "output", bytes, onPreview, onDownload, class
|
|
|
2202
2354
|
e.stopPropagation();
|
|
2203
2355
|
onDownload();
|
|
2204
2356
|
},
|
|
2205
|
-
children: /* @__PURE__ */
|
|
2357
|
+
children: /* @__PURE__ */ jsx13(IcDownload, { size: 18 })
|
|
2206
2358
|
}
|
|
2207
2359
|
),
|
|
2208
|
-
onPreview && /* @__PURE__ */
|
|
2360
|
+
onPreview && /* @__PURE__ */ jsx13("button", { type: "button", className: "uic-filecard-open", "aria-label": `Preview ${name}`, onClick: open, children: "Preview" })
|
|
2209
2361
|
]
|
|
2210
2362
|
}
|
|
2211
2363
|
);
|
|
2212
2364
|
}
|
|
2213
2365
|
|
|
2214
2366
|
// src/components/FilePreview.jsx
|
|
2215
|
-
import { useEffect as useEffect8, useState as
|
|
2216
|
-
import { jsx as
|
|
2367
|
+
import { useEffect as useEffect8, useState as useState11 } from "react";
|
|
2368
|
+
import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2217
2369
|
var LANG = {
|
|
2218
2370
|
js: "javascript",
|
|
2219
2371
|
mjs: "javascript",
|
|
@@ -2294,11 +2446,11 @@ function delimitedToRows(text, sep) {
|
|
|
2294
2446
|
});
|
|
2295
2447
|
}
|
|
2296
2448
|
function Grid({ rows }) {
|
|
2297
|
-
if (!rows?.length) return /* @__PURE__ */
|
|
2449
|
+
if (!rows?.length) return /* @__PURE__ */ jsx14("div", { className: "uic-fp-empty", children: "This file is empty." });
|
|
2298
2450
|
const [head, ...body] = rows;
|
|
2299
|
-
return /* @__PURE__ */
|
|
2300
|
-
/* @__PURE__ */
|
|
2301
|
-
/* @__PURE__ */
|
|
2451
|
+
return /* @__PURE__ */ jsx14("div", { className: "uic-fp-sheet", children: /* @__PURE__ */ jsxs12("table", { children: [
|
|
2452
|
+
/* @__PURE__ */ jsx14("thead", { children: /* @__PURE__ */ jsx14("tr", { children: head.map((c, i) => /* @__PURE__ */ jsx14("th", { children: c }, i)) }) }),
|
|
2453
|
+
/* @__PURE__ */ jsx14("tbody", { children: body.map((r, i) => /* @__PURE__ */ jsx14("tr", { children: r.map((c, j) => /* @__PURE__ */ jsx14("td", { children: c }, j)) }, i)) })
|
|
2302
2454
|
] }) });
|
|
2303
2455
|
}
|
|
2304
2456
|
var defaultDownload = (url, name) => {
|
|
@@ -2321,9 +2473,9 @@ function FilePreview({
|
|
|
2321
2473
|
title
|
|
2322
2474
|
}) {
|
|
2323
2475
|
const { url, name } = file || {};
|
|
2324
|
-
const [st, setSt] =
|
|
2325
|
-
const [tab, setTab] =
|
|
2326
|
-
const [view, setView] =
|
|
2476
|
+
const [st, setSt] = useState11({ kind: "loading" });
|
|
2477
|
+
const [tab, setTab] = useState11(0);
|
|
2478
|
+
const [view, setView] = useState11("preview");
|
|
2327
2479
|
useEffect8(() => {
|
|
2328
2480
|
if (!url) return void 0;
|
|
2329
2481
|
let alive = true;
|
|
@@ -2387,11 +2539,11 @@ function FilePreview({
|
|
|
2387
2539
|
};
|
|
2388
2540
|
}, [url, name, fetchFile, officePdfUrl, parseWorkbook]);
|
|
2389
2541
|
const download = () => onDownload ? onDownload(url, name) : defaultDownload(url, name);
|
|
2390
|
-
return /* @__PURE__ */
|
|
2391
|
-
/* @__PURE__ */
|
|
2392
|
-
/* @__PURE__ */
|
|
2393
|
-
/* @__PURE__ */
|
|
2394
|
-
st.kind === "html" && /* @__PURE__ */
|
|
2542
|
+
return /* @__PURE__ */ jsxs12("aside", { className: "uic-fp", "aria-label": title || `Preview of ${name}`, children: [
|
|
2543
|
+
/* @__PURE__ */ jsxs12("header", { className: "uic-fp-head", children: [
|
|
2544
|
+
/* @__PURE__ */ jsx14("span", { className: "uic-fp-ic", children: /* @__PURE__ */ jsx14(FileTypeIcon, { name, size: 20 }) }),
|
|
2545
|
+
/* @__PURE__ */ jsx14("span", { className: "uic-fp-name", title: name, children: name }),
|
|
2546
|
+
st.kind === "html" && /* @__PURE__ */ jsx14("div", { className: "uic-fp-seg", role: "tablist", "aria-label": "Show the page or its source", children: [["preview", "Preview"], ["source", "Source"]].map(([id, label]) => /* @__PURE__ */ jsx14(
|
|
2395
2547
|
"button",
|
|
2396
2548
|
{
|
|
2397
2549
|
type: "button",
|
|
@@ -2403,7 +2555,7 @@ function FilePreview({
|
|
|
2403
2555
|
},
|
|
2404
2556
|
id
|
|
2405
2557
|
)) }),
|
|
2406
|
-
/* @__PURE__ */
|
|
2558
|
+
/* @__PURE__ */ jsx14(
|
|
2407
2559
|
"button",
|
|
2408
2560
|
{
|
|
2409
2561
|
type: "button",
|
|
@@ -2411,10 +2563,10 @@ function FilePreview({
|
|
|
2411
2563
|
"aria-label": `Download ${name}`,
|
|
2412
2564
|
title: "Download",
|
|
2413
2565
|
onClick: download,
|
|
2414
|
-
children: /* @__PURE__ */
|
|
2566
|
+
children: /* @__PURE__ */ jsx14(IcDownload, {})
|
|
2415
2567
|
}
|
|
2416
2568
|
),
|
|
2417
|
-
onClose && /* @__PURE__ */
|
|
2569
|
+
onClose && /* @__PURE__ */ jsx14(
|
|
2418
2570
|
"button",
|
|
2419
2571
|
{
|
|
2420
2572
|
type: "button",
|
|
@@ -2422,26 +2574,26 @@ function FilePreview({
|
|
|
2422
2574
|
"aria-label": "Close preview",
|
|
2423
2575
|
title: "Close",
|
|
2424
2576
|
onClick: onClose,
|
|
2425
|
-
children: /* @__PURE__ */
|
|
2577
|
+
children: /* @__PURE__ */ jsx14(IcX, { size: 18 })
|
|
2426
2578
|
}
|
|
2427
2579
|
)
|
|
2428
2580
|
] }),
|
|
2429
|
-
/* @__PURE__ */
|
|
2430
|
-
st.kind === "loading" && /* @__PURE__ */
|
|
2431
|
-
st.kind === "image" && st.objUrl && /* @__PURE__ */
|
|
2432
|
-
st.kind === "pdf" && st.objUrl && /* @__PURE__ */
|
|
2433
|
-
st.kind === "video" && st.objUrl && /* @__PURE__ */
|
|
2434
|
-
st.kind === "audio" && st.objUrl && /* @__PURE__ */
|
|
2435
|
-
st.kind === "markdown" && /* @__PURE__ */
|
|
2436
|
-
st.kind === "code" && /* @__PURE__ */
|
|
2437
|
-
st.kind === "html" && view === "source" && /* @__PURE__ */
|
|
2581
|
+
/* @__PURE__ */ jsxs12("div", { className: "uic-fp-body", children: [
|
|
2582
|
+
st.kind === "loading" && /* @__PURE__ */ jsx14("div", { className: "uic-fp-pad", children: /* @__PURE__ */ jsx14("span", { className: "uic-skel uic-fp-skel" }) }),
|
|
2583
|
+
st.kind === "image" && st.objUrl && /* @__PURE__ */ jsx14("div", { className: "uic-fp-center", children: /* @__PURE__ */ jsx14("img", { className: "uic-fp-img", src: st.objUrl, alt: name }) }),
|
|
2584
|
+
st.kind === "pdf" && st.objUrl && /* @__PURE__ */ jsx14("iframe", { className: "uic-fp-frame", src: st.objUrl, title: name }),
|
|
2585
|
+
st.kind === "video" && st.objUrl && /* @__PURE__ */ jsx14("div", { className: "uic-fp-center", children: /* @__PURE__ */ jsx14("video", { className: "uic-fp-media", src: st.objUrl, controls: true }) }),
|
|
2586
|
+
st.kind === "audio" && st.objUrl && /* @__PURE__ */ jsx14("div", { className: "uic-fp-center", children: /* @__PURE__ */ jsx14("audio", { src: st.objUrl, controls: true }) }),
|
|
2587
|
+
st.kind === "markdown" && /* @__PURE__ */ jsx14("div", { className: "uic-fp-doc", children: renderMarkdown ? renderMarkdown(st.text || "") : /* @__PURE__ */ jsx14("pre", { className: "uic-fp-pre", children: st.text }) }),
|
|
2588
|
+
st.kind === "code" && /* @__PURE__ */ jsx14(CodeBlock, { code: st.text || "", language: LANG[extOf(name)] || "plaintext" }),
|
|
2589
|
+
st.kind === "html" && view === "source" && /* @__PURE__ */ jsx14(CodeBlock, { code: st.text || "", language: "xml" }),
|
|
2438
2590
|
st.kind === "html" && view === "preview" && // The page runs in its own origin with scripts only: a mockup's own script and styles
|
|
2439
2591
|
// work, and nothing in it can read the host page, its cookies or its storage.
|
|
2440
|
-
/* @__PURE__ */
|
|
2441
|
-
st.kind === "csv" && /* @__PURE__ */
|
|
2442
|
-
st.kind === "sheet" && st.sheets && /* @__PURE__ */
|
|
2443
|
-
st.sheets[tab]?.filled ? /* @__PURE__ */
|
|
2444
|
-
/* @__PURE__ */
|
|
2592
|
+
/* @__PURE__ */ jsx14("iframe", { className: "uic-fp-frame", title: name, sandbox: "allow-scripts", srcDoc: st.text || "" }),
|
|
2593
|
+
st.kind === "csv" && /* @__PURE__ */ jsx14(Grid, { rows: st.rows }),
|
|
2594
|
+
st.kind === "sheet" && st.sheets && /* @__PURE__ */ jsxs12("div", { className: "uic-fp-xlsx", children: [
|
|
2595
|
+
st.sheets[tab]?.filled ? /* @__PURE__ */ jsx14(Grid, { rows: st.sheets[tab].rows }) : /* @__PURE__ */ jsx14("div", { className: "uic-fp-empty", children: "This sheet is empty." }),
|
|
2596
|
+
/* @__PURE__ */ jsx14("div", { className: "uic-fp-tabs", children: st.sheets.map((s, i) => /* @__PURE__ */ jsx14(
|
|
2445
2597
|
"button",
|
|
2446
2598
|
{
|
|
2447
2599
|
type: "button",
|
|
@@ -2453,10 +2605,10 @@ function FilePreview({
|
|
|
2453
2605
|
s.name + i
|
|
2454
2606
|
)) })
|
|
2455
2607
|
] }),
|
|
2456
|
-
st.kind === "binary" && /* @__PURE__ */
|
|
2457
|
-
/* @__PURE__ */
|
|
2458
|
-
/* @__PURE__ */
|
|
2459
|
-
/* @__PURE__ */
|
|
2608
|
+
st.kind === "binary" && /* @__PURE__ */ jsx14("div", { className: "uic-fp-center", children: /* @__PURE__ */ jsxs12("div", { className: "uic-fp-fallback", children: [
|
|
2609
|
+
/* @__PURE__ */ jsx14(FileTypeIcon, { name, size: 56 }),
|
|
2610
|
+
/* @__PURE__ */ jsx14("p", { children: st.error || "No inline preview for this file type." }),
|
|
2611
|
+
/* @__PURE__ */ jsx14("button", { type: "button", className: "uic-fp-dl", onClick: download, children: "Download" })
|
|
2460
2612
|
] }) })
|
|
2461
2613
|
] })
|
|
2462
2614
|
] });
|
|
@@ -2464,29 +2616,29 @@ function FilePreview({
|
|
|
2464
2616
|
|
|
2465
2617
|
// src/components/form.jsx
|
|
2466
2618
|
import { useId as useId2 } from "react";
|
|
2467
|
-
import { jsx as
|
|
2619
|
+
import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2468
2620
|
function Field({ label, hint, error, htmlFor, required, children, className = "" }) {
|
|
2469
|
-
return /* @__PURE__ */
|
|
2470
|
-
label && /* @__PURE__ */
|
|
2621
|
+
return /* @__PURE__ */ jsxs13("div", { className: "uic-field" + (error ? " is-error" : "") + (className ? " " + className : ""), children: [
|
|
2622
|
+
label && /* @__PURE__ */ jsxs13("label", { className: "uic-field-label", htmlFor, children: [
|
|
2471
2623
|
label,
|
|
2472
|
-
required && /* @__PURE__ */
|
|
2624
|
+
required && /* @__PURE__ */ jsx15("span", { className: "uic-field-req", "aria-hidden": "true", children: "*" })
|
|
2473
2625
|
] }),
|
|
2474
2626
|
children,
|
|
2475
|
-
error ? /* @__PURE__ */
|
|
2627
|
+
error ? /* @__PURE__ */ jsx15("p", { className: "uic-field-err", children: error }) : hint ? /* @__PURE__ */ jsx15("p", { className: "uic-field-hint", children: hint }) : null
|
|
2476
2628
|
] });
|
|
2477
2629
|
}
|
|
2478
2630
|
function withField(Control) {
|
|
2479
2631
|
return function Fielded({ label, hint, error, required, id, className, ...rest }) {
|
|
2480
2632
|
const auto = useId2();
|
|
2481
2633
|
const inputId = id || auto;
|
|
2482
|
-
return /* @__PURE__ */
|
|
2634
|
+
return /* @__PURE__ */ jsx15(Field, { label, hint, error, required, htmlFor: inputId, className, children: /* @__PURE__ */ jsx15(Control, { id: inputId, invalid: !!error, required, ...rest }) });
|
|
2483
2635
|
};
|
|
2484
2636
|
}
|
|
2485
2637
|
function BareInput({ invalid, ...rest }) {
|
|
2486
|
-
return /* @__PURE__ */
|
|
2638
|
+
return /* @__PURE__ */ jsx15("input", { className: "uic-input" + (invalid ? " is-error" : ""), "aria-invalid": invalid || void 0, ...rest });
|
|
2487
2639
|
}
|
|
2488
2640
|
function BareTextarea({ invalid, rows = 4, ...rest }) {
|
|
2489
|
-
return /* @__PURE__ */
|
|
2641
|
+
return /* @__PURE__ */ jsx15(
|
|
2490
2642
|
"textarea",
|
|
2491
2643
|
{
|
|
2492
2644
|
className: "uic-input uic-textarea" + (invalid ? " is-error" : ""),
|
|
@@ -2497,43 +2649,43 @@ function BareTextarea({ invalid, rows = 4, ...rest }) {
|
|
|
2497
2649
|
);
|
|
2498
2650
|
}
|
|
2499
2651
|
function BareSelect({ invalid, options = [], placeholder, ...rest }) {
|
|
2500
|
-
return /* @__PURE__ */
|
|
2501
|
-
/* @__PURE__ */
|
|
2652
|
+
return /* @__PURE__ */ jsxs13("span", { className: "uic-select-wrap", children: [
|
|
2653
|
+
/* @__PURE__ */ jsxs13(
|
|
2502
2654
|
"select",
|
|
2503
2655
|
{
|
|
2504
2656
|
className: "uic-input uic-select" + (invalid ? " is-error" : ""),
|
|
2505
2657
|
"aria-invalid": invalid || void 0,
|
|
2506
2658
|
...rest,
|
|
2507
2659
|
children: [
|
|
2508
|
-
placeholder && /* @__PURE__ */
|
|
2660
|
+
placeholder && /* @__PURE__ */ jsx15("option", { value: "", children: placeholder }),
|
|
2509
2661
|
options.map((o) => {
|
|
2510
2662
|
const opt = typeof o === "string" ? { value: o, label: o } : o;
|
|
2511
|
-
return /* @__PURE__ */
|
|
2663
|
+
return /* @__PURE__ */ jsx15("option", { value: opt.value, disabled: opt.disabled, children: opt.label }, opt.value);
|
|
2512
2664
|
})
|
|
2513
2665
|
]
|
|
2514
2666
|
}
|
|
2515
2667
|
),
|
|
2516
|
-
/* @__PURE__ */
|
|
2668
|
+
/* @__PURE__ */ jsx15("span", { className: "uic-select-chev", "aria-hidden": "true", children: /* @__PURE__ */ jsx15(Chevron, { dir: "down", size: 14 }) })
|
|
2517
2669
|
] });
|
|
2518
2670
|
}
|
|
2519
2671
|
var Input = withField(BareInput);
|
|
2520
2672
|
var Textarea = withField(BareTextarea);
|
|
2521
2673
|
var Select = withField(BareSelect);
|
|
2522
2674
|
function FormActions({ children, align = "end", className = "" }) {
|
|
2523
|
-
return /* @__PURE__ */
|
|
2675
|
+
return /* @__PURE__ */ jsx15("div", { className: `uic-form-actions is-${align}${className ? " " + className : ""}`, children });
|
|
2524
2676
|
}
|
|
2525
2677
|
function Button({ variant = "default", size = "md", type = "button", className = "", ...rest }) {
|
|
2526
|
-
return /* @__PURE__ */
|
|
2678
|
+
return /* @__PURE__ */ jsx15("button", { type, className: `uic-btn is-${variant} is-${size}${className ? " " + className : ""}`, ...rest });
|
|
2527
2679
|
}
|
|
2528
2680
|
|
|
2529
2681
|
// src/components/Carousel.jsx
|
|
2530
|
-
import React7, { useCallback as useCallback5, useEffect as useEffect9, useRef as
|
|
2531
|
-
import { jsx as
|
|
2682
|
+
import React7, { useCallback as useCallback5, useEffect as useEffect9, useRef as useRef8, useState as useState12 } from "react";
|
|
2683
|
+
import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2532
2684
|
var EDGE = 2;
|
|
2533
2685
|
function Carousel(props) {
|
|
2534
2686
|
const { label, step, children, classNames = {} } = props;
|
|
2535
|
-
const ref =
|
|
2536
|
-
const [edges, setEdges] =
|
|
2687
|
+
const ref = useRef8(null);
|
|
2688
|
+
const [edges, setEdges] = useState12({ start: true, end: true, overflow: false });
|
|
2537
2689
|
const measure = useCallback5(() => {
|
|
2538
2690
|
const el = ref.current;
|
|
2539
2691
|
if (!el) return;
|
|
@@ -2558,8 +2710,8 @@ function Carousel(props) {
|
|
|
2558
2710
|
if (!el) return;
|
|
2559
2711
|
el.scrollBy({ left: dir * (step || Math.round(el.clientWidth * 0.9)), behavior: "smooth" });
|
|
2560
2712
|
};
|
|
2561
|
-
return /* @__PURE__ */
|
|
2562
|
-
edges.overflow ? /* @__PURE__ */
|
|
2713
|
+
return /* @__PURE__ */ jsxs14("div", { className: ["uic-carousel-wrap", classNames.root || ""].filter(Boolean).join(" "), children: [
|
|
2714
|
+
edges.overflow ? /* @__PURE__ */ jsx16(
|
|
2563
2715
|
"button",
|
|
2564
2716
|
{
|
|
2565
2717
|
type: "button",
|
|
@@ -2567,10 +2719,10 @@ function Carousel(props) {
|
|
|
2567
2719
|
onClick: () => scroll(-1),
|
|
2568
2720
|
disabled: edges.start,
|
|
2569
2721
|
"aria-label": `Scroll ${label} left`,
|
|
2570
|
-
children: /* @__PURE__ */
|
|
2722
|
+
children: /* @__PURE__ */ jsx16(Chevron, { dir: "left" })
|
|
2571
2723
|
}
|
|
2572
2724
|
) : null,
|
|
2573
|
-
/* @__PURE__ */
|
|
2725
|
+
/* @__PURE__ */ jsx16(
|
|
2574
2726
|
"div",
|
|
2575
2727
|
{
|
|
2576
2728
|
className: ["uic-carousel", classNames.viewport || ""].filter(Boolean).join(" "),
|
|
@@ -2581,7 +2733,7 @@ function Carousel(props) {
|
|
|
2581
2733
|
children
|
|
2582
2734
|
}
|
|
2583
2735
|
),
|
|
2584
|
-
edges.overflow ? /* @__PURE__ */
|
|
2736
|
+
edges.overflow ? /* @__PURE__ */ jsx16(
|
|
2585
2737
|
"button",
|
|
2586
2738
|
{
|
|
2587
2739
|
type: "button",
|
|
@@ -2589,7 +2741,7 @@ function Carousel(props) {
|
|
|
2589
2741
|
onClick: () => scroll(1),
|
|
2590
2742
|
disabled: edges.end,
|
|
2591
2743
|
"aria-label": `Scroll ${label} right`,
|
|
2592
|
-
children: /* @__PURE__ */
|
|
2744
|
+
children: /* @__PURE__ */ jsx16(Chevron, { dir: "right" })
|
|
2593
2745
|
}
|
|
2594
2746
|
) : null
|
|
2595
2747
|
] });
|
|
@@ -2597,34 +2749,34 @@ function Carousel(props) {
|
|
|
2597
2749
|
|
|
2598
2750
|
// src/components/Card.jsx
|
|
2599
2751
|
import React8 from "react";
|
|
2600
|
-
import { jsx as
|
|
2752
|
+
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2601
2753
|
function Card(props) {
|
|
2602
2754
|
const { art, title, subtitle: subtitle2, onClick, selected = false, overlay, actions, classNames = {} } = props;
|
|
2603
|
-
const foot = /* @__PURE__ */
|
|
2604
|
-
/* @__PURE__ */
|
|
2605
|
-
subtitle2 ? /* @__PURE__ */
|
|
2755
|
+
const foot = /* @__PURE__ */ jsxs15("span", { className: "uic-card-foot", children: [
|
|
2756
|
+
/* @__PURE__ */ jsx17("span", { className: "uic-card-name", children: title }),
|
|
2757
|
+
subtitle2 ? /* @__PURE__ */ jsx17("span", { className: "uic-card-sub", children: subtitle2 }) : null
|
|
2606
2758
|
] });
|
|
2607
|
-
return /* @__PURE__ */
|
|
2608
|
-
onClick ? /* @__PURE__ */
|
|
2609
|
-
/* @__PURE__ */
|
|
2759
|
+
return /* @__PURE__ */ jsxs15("div", { className: ["uic-card", selected ? "is-selected" : "", classNames.root || ""].filter(Boolean).join(" "), children: [
|
|
2760
|
+
onClick ? /* @__PURE__ */ jsxs15("button", { type: "button", className: "uic-card-main", onClick, "aria-pressed": selected || void 0, children: [
|
|
2761
|
+
/* @__PURE__ */ jsx17("span", { className: "uic-card-art", children: art }),
|
|
2610
2762
|
foot
|
|
2611
|
-
] }) : /* @__PURE__ */
|
|
2612
|
-
/* @__PURE__ */
|
|
2763
|
+
] }) : /* @__PURE__ */ jsxs15("div", { className: "uic-card-main", children: [
|
|
2764
|
+
/* @__PURE__ */ jsx17("span", { className: "uic-card-art", children: art }),
|
|
2613
2765
|
foot
|
|
2614
2766
|
] }),
|
|
2615
|
-
overlay ? /* @__PURE__ */
|
|
2616
|
-
actions ? /* @__PURE__ */
|
|
2767
|
+
overlay ? /* @__PURE__ */ jsx17("div", { className: "uic-card-overlay", children: overlay }) : null,
|
|
2768
|
+
actions ? /* @__PURE__ */ jsx17("div", { className: "uic-card-actions", children: actions }) : null
|
|
2617
2769
|
] });
|
|
2618
2770
|
}
|
|
2619
2771
|
|
|
2620
2772
|
// src/components/SearchField.jsx
|
|
2621
2773
|
import React9 from "react";
|
|
2622
|
-
import { jsx as
|
|
2774
|
+
import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2623
2775
|
function SearchField(props) {
|
|
2624
2776
|
const { value, onChange, placeholder, clearLabel = "Clear search", className } = props;
|
|
2625
|
-
return /* @__PURE__ */
|
|
2626
|
-
/* @__PURE__ */
|
|
2627
|
-
/* @__PURE__ */
|
|
2777
|
+
return /* @__PURE__ */ jsxs16("label", { className: ["uic-search", className || ""].filter(Boolean).join(" "), children: [
|
|
2778
|
+
/* @__PURE__ */ jsx18("span", { className: "uic-search-ic", "aria-hidden": "true", children: /* @__PURE__ */ jsx18(IcSearch, {}) }),
|
|
2779
|
+
/* @__PURE__ */ jsx18(
|
|
2628
2780
|
"input",
|
|
2629
2781
|
{
|
|
2630
2782
|
type: "search",
|
|
@@ -2634,14 +2786,14 @@ function SearchField(props) {
|
|
|
2634
2786
|
onChange: (e) => onChange(e.target.value)
|
|
2635
2787
|
}
|
|
2636
2788
|
),
|
|
2637
|
-
value ? /* @__PURE__ */
|
|
2789
|
+
value ? /* @__PURE__ */ jsx18("button", { type: "button", className: "uic-search-x", "aria-label": clearLabel, onClick: () => onChange(""), children: /* @__PURE__ */ jsx18(IcX, { size: 12 }) }) : null
|
|
2638
2790
|
] });
|
|
2639
2791
|
}
|
|
2640
2792
|
|
|
2641
2793
|
// src/components/CascadeMenu.jsx
|
|
2642
|
-
import React10, { Fragment as Fragment8, useCallback as useCallback6, useEffect as useEffect10, useMemo as useMemo3, useRef as
|
|
2643
|
-
import { jsx as
|
|
2644
|
-
var Tick = () => /* @__PURE__ */
|
|
2794
|
+
import React10, { Fragment as Fragment8, useCallback as useCallback6, useEffect as useEffect10, useMemo as useMemo3, useRef as useRef9, useState as useState13 } from "react";
|
|
2795
|
+
import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2796
|
+
var Tick = () => /* @__PURE__ */ jsx19(Svg, { s: 14, children: /* @__PURE__ */ jsx19("path", { d: "M20 6 9 17l-5-5" }) });
|
|
2645
2797
|
var FILTER_PAST = 8;
|
|
2646
2798
|
var itemsOf = (groups) => groups.flatMap((g) => g.items);
|
|
2647
2799
|
function CascadeMenu(props) {
|
|
@@ -2665,11 +2817,11 @@ function CascadeMenu(props) {
|
|
|
2665
2817
|
className,
|
|
2666
2818
|
value
|
|
2667
2819
|
} = props;
|
|
2668
|
-
const rootRef =
|
|
2669
|
-
const [q, setQ] =
|
|
2670
|
-
const [activeId, setActiveId] =
|
|
2671
|
-
const [stage, setStage] =
|
|
2672
|
-
const [stacked, setStacked] =
|
|
2820
|
+
const rootRef = useRef9(null);
|
|
2821
|
+
const [q, setQ] = useState13("");
|
|
2822
|
+
const [activeId, setActiveId] = useState13(null);
|
|
2823
|
+
const [stage, setStage] = useState13("items");
|
|
2824
|
+
const [stacked, setStacked] = useState13(false);
|
|
2673
2825
|
const visible = useMemo3(() => {
|
|
2674
2826
|
const needle = q.trim().toLowerCase();
|
|
2675
2827
|
if (!needle) return groups.filter((g) => g.items.length > 0);
|
|
@@ -2745,7 +2897,7 @@ function CascadeMenu(props) {
|
|
|
2745
2897
|
};
|
|
2746
2898
|
const showItems = !stacked || stage === "items";
|
|
2747
2899
|
const showOptions = !stacked || stage === "options";
|
|
2748
|
-
return /* @__PURE__ */
|
|
2900
|
+
return /* @__PURE__ */ jsx19(
|
|
2749
2901
|
Popover,
|
|
2750
2902
|
{
|
|
2751
2903
|
open,
|
|
@@ -2755,15 +2907,15 @@ function CascadeMenu(props) {
|
|
|
2755
2907
|
width: stacked ? 320 : width,
|
|
2756
2908
|
minHeight: 260,
|
|
2757
2909
|
className: ["uic-cascade-pop", className || ""].filter(Boolean).join(" "),
|
|
2758
|
-
children: /* @__PURE__ */
|
|
2759
|
-
showItems && /* @__PURE__ */
|
|
2760
|
-
showFilter ? /* @__PURE__ */
|
|
2761
|
-
/* @__PURE__ */
|
|
2762
|
-
visible.map((g, gi) => /* @__PURE__ */
|
|
2763
|
-
g.label ? /* @__PURE__ */
|
|
2910
|
+
children: /* @__PURE__ */ jsxs17("div", { ref: rootRef, className: "uic-cascade" + (stacked ? " is-stacked" : ""), onKeyDown: onKey, children: [
|
|
2911
|
+
showItems && /* @__PURE__ */ jsxs17("div", { className: "uic-cascade-col uic-cascade-items", children: [
|
|
2912
|
+
showFilter ? /* @__PURE__ */ jsx19(SearchField, { className: "uic-cascade-filter", value: q, onChange: setQ, placeholder: filterPlaceholder }) : null,
|
|
2913
|
+
/* @__PURE__ */ jsxs17("div", { className: "uic-pop-list", children: [
|
|
2914
|
+
visible.map((g, gi) => /* @__PURE__ */ jsxs17(Fragment8, { children: [
|
|
2915
|
+
g.label ? /* @__PURE__ */ jsx19("div", { className: "uic-cascade-group", children: g.label }) : null,
|
|
2764
2916
|
g.items.map((it) => {
|
|
2765
2917
|
const on = active?.id === it.id;
|
|
2766
|
-
return /* @__PURE__ */
|
|
2918
|
+
return /* @__PURE__ */ jsxs17(
|
|
2767
2919
|
"button",
|
|
2768
2920
|
{
|
|
2769
2921
|
type: "button",
|
|
@@ -2776,22 +2928,22 @@ function CascadeMenu(props) {
|
|
|
2776
2928
|
enterOptions();
|
|
2777
2929
|
},
|
|
2778
2930
|
children: [
|
|
2779
|
-
it.icon ? /* @__PURE__ */
|
|
2780
|
-
/* @__PURE__ */
|
|
2781
|
-
it.note ? /* @__PURE__ */
|
|
2782
|
-
/* @__PURE__ */
|
|
2931
|
+
it.icon ? /* @__PURE__ */ jsx19("span", { className: "uic-cascade-ic", "aria-hidden": "true", children: it.icon }) : null,
|
|
2932
|
+
/* @__PURE__ */ jsx19("span", { className: "uic-chip-t", children: it.label }),
|
|
2933
|
+
it.note ? /* @__PURE__ */ jsx19("span", { className: "uic-cascade-note", children: it.note }) : null,
|
|
2934
|
+
/* @__PURE__ */ jsx19("span", { className: "uic-cascade-chev", "aria-hidden": "true", children: /* @__PURE__ */ jsx19(Chevron, { dir: "right", size: 14 }) })
|
|
2783
2935
|
]
|
|
2784
2936
|
},
|
|
2785
2937
|
it.id
|
|
2786
2938
|
);
|
|
2787
2939
|
})
|
|
2788
2940
|
] }, g.label || gi)),
|
|
2789
|
-
flat.length === 0 ? /* @__PURE__ */
|
|
2941
|
+
flat.length === 0 ? /* @__PURE__ */ jsx19("div", { className: "uic-pop-note", children: emptyText }) : null
|
|
2790
2942
|
] })
|
|
2791
2943
|
] }),
|
|
2792
|
-
showOptions && /* @__PURE__ */
|
|
2793
|
-
/* @__PURE__ */
|
|
2794
|
-
stacked ? /* @__PURE__ */
|
|
2944
|
+
showOptions && /* @__PURE__ */ jsxs17("div", { className: "uic-cascade-col uic-cascade-options", role: "group", "aria-label": optionsLabel, children: [
|
|
2945
|
+
/* @__PURE__ */ jsxs17("div", { className: "uic-cascade-head", children: [
|
|
2946
|
+
stacked ? /* @__PURE__ */ jsx19(
|
|
2795
2947
|
"button",
|
|
2796
2948
|
{
|
|
2797
2949
|
type: "button",
|
|
@@ -2801,16 +2953,16 @@ function CascadeMenu(props) {
|
|
|
2801
2953
|
setStage("items");
|
|
2802
2954
|
requestAnimationFrame(() => focusIn("items", flat.indexOf(active)));
|
|
2803
2955
|
},
|
|
2804
|
-
children: /* @__PURE__ */
|
|
2956
|
+
children: /* @__PURE__ */ jsx19(Chevron, { dir: "left", size: 14 })
|
|
2805
2957
|
}
|
|
2806
2958
|
) : null,
|
|
2807
|
-
active?.icon ? /* @__PURE__ */
|
|
2808
|
-
/* @__PURE__ */
|
|
2959
|
+
active?.icon ? /* @__PURE__ */ jsx19("span", { className: "uic-cascade-ic", "aria-hidden": "true", children: active.icon }) : null,
|
|
2960
|
+
/* @__PURE__ */ jsx19("span", { className: "uic-chip-t", children: active ? active.label : "" })
|
|
2809
2961
|
] }),
|
|
2810
|
-
/* @__PURE__ */
|
|
2962
|
+
/* @__PURE__ */ jsxs17("div", { className: "uic-pop-list", children: [
|
|
2811
2963
|
options.map((o) => {
|
|
2812
2964
|
const on = !!value && active?.id === value.item && o.id === value.option;
|
|
2813
|
-
return /* @__PURE__ */
|
|
2965
|
+
return /* @__PURE__ */ jsxs17(
|
|
2814
2966
|
"button",
|
|
2815
2967
|
{
|
|
2816
2968
|
type: "button",
|
|
@@ -2819,16 +2971,16 @@ function CascadeMenu(props) {
|
|
|
2819
2971
|
disabled: !!o.disabled,
|
|
2820
2972
|
onClick: () => onPick?.(active, o),
|
|
2821
2973
|
children: [
|
|
2822
|
-
value ? /* @__PURE__ */
|
|
2823
|
-
/* @__PURE__ */
|
|
2824
|
-
o.note ? /* @__PURE__ */
|
|
2974
|
+
value ? /* @__PURE__ */ jsx19("span", { className: "uic-pop-check", "aria-hidden": "true", children: on ? /* @__PURE__ */ jsx19(Tick, {}) : null }) : null,
|
|
2975
|
+
/* @__PURE__ */ jsx19("span", { className: "uic-chip-t", children: o.label }),
|
|
2976
|
+
o.note ? /* @__PURE__ */ jsx19("span", { className: "uic-cascade-note", children: o.note }) : null,
|
|
2825
2977
|
o.badge || null
|
|
2826
2978
|
]
|
|
2827
2979
|
},
|
|
2828
2980
|
o.id
|
|
2829
2981
|
);
|
|
2830
2982
|
}),
|
|
2831
|
-
active && options.length === 0 ? /* @__PURE__ */
|
|
2983
|
+
active && options.length === 0 ? /* @__PURE__ */ jsx19("div", { className: "uic-pop-note", children: noOptionsText }) : null
|
|
2832
2984
|
] }),
|
|
2833
2985
|
optionsFooter || null
|
|
2834
2986
|
] })
|
|
@@ -2838,13 +2990,13 @@ function CascadeMenu(props) {
|
|
|
2838
2990
|
}
|
|
2839
2991
|
|
|
2840
2992
|
// src/hooks/useTypewriter.js
|
|
2841
|
-
import { useEffect as useEffect11, useRef as
|
|
2993
|
+
import { useEffect as useEffect11, useRef as useRef10, useState as useState14 } from "react";
|
|
2842
2994
|
var CHAR_MS = 26;
|
|
2843
2995
|
var HOLD_MS = 2600;
|
|
2844
2996
|
function useTypewriter(phrases, { active = true } = {}) {
|
|
2845
2997
|
const list = phrases && phrases.length ? phrases : [""];
|
|
2846
|
-
const [text, setText] =
|
|
2847
|
-
const listRef =
|
|
2998
|
+
const [text, setText] = useState14(list[0]);
|
|
2999
|
+
const listRef = useRef10(list);
|
|
2848
3000
|
listRef.current = list;
|
|
2849
3001
|
useEffect11(() => {
|
|
2850
3002
|
if (!active) return void 0;
|
|
@@ -2877,7 +3029,7 @@ function useTypewriter(phrases, { active = true } = {}) {
|
|
|
2877
3029
|
}
|
|
2878
3030
|
|
|
2879
3031
|
// src/components/Panel.jsx
|
|
2880
|
-
import { jsx as
|
|
3032
|
+
import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2881
3033
|
function Panel(props) {
|
|
2882
3034
|
const {
|
|
2883
3035
|
title,
|
|
@@ -2899,43 +3051,43 @@ function Panel(props) {
|
|
|
2899
3051
|
classNames = {},
|
|
2900
3052
|
children
|
|
2901
3053
|
} = props;
|
|
2902
|
-
const body = loading ? /* @__PURE__ */
|
|
2903
|
-
/* @__PURE__ */
|
|
2904
|
-
/* @__PURE__ */
|
|
2905
|
-
/* @__PURE__ */
|
|
2906
|
-
/* @__PURE__ */
|
|
2907
|
-
] }) : error ? /* @__PURE__ */
|
|
2908
|
-
/* @__PURE__ */
|
|
2909
|
-
/* @__PURE__ */
|
|
2910
|
-
errorDetail ? /* @__PURE__ */
|
|
2911
|
-
/* @__PURE__ */
|
|
2912
|
-
/* @__PURE__ */
|
|
3054
|
+
const body = loading ? /* @__PURE__ */ jsxs18("div", { className: "uic-panel-load", children: [
|
|
3055
|
+
/* @__PURE__ */ jsx20("span", { className: "uic-panel-load-bar" }),
|
|
3056
|
+
/* @__PURE__ */ jsx20("span", { className: "uic-panel-load-bar" }),
|
|
3057
|
+
/* @__PURE__ */ jsx20("span", { className: "uic-panel-load-bar" }),
|
|
3058
|
+
/* @__PURE__ */ jsx20("span", { className: "uic-sr", children: loadingLabel })
|
|
3059
|
+
] }) : error ? /* @__PURE__ */ jsxs18("div", { className: "uic-panel-fail", children: [
|
|
3060
|
+
/* @__PURE__ */ jsx20("p", { className: "uic-panel-fail-t", children: errorTitle }),
|
|
3061
|
+
/* @__PURE__ */ jsx20("pre", { className: "uic-panel-fail-m", children: error }),
|
|
3062
|
+
errorDetail ? /* @__PURE__ */ jsxs18("details", { className: "uic-panel-fail-d", children: [
|
|
3063
|
+
/* @__PURE__ */ jsx20("summary", { children: detailLabel }),
|
|
3064
|
+
/* @__PURE__ */ jsx20("div", { className: "uic-panel-fail-dd", children: errorDetail })
|
|
2913
3065
|
] }) : null,
|
|
2914
|
-
onRetry ? /* @__PURE__ */
|
|
3066
|
+
onRetry ? /* @__PURE__ */ jsx20("div", { className: "uic-panel-fail-act", children: /* @__PURE__ */ jsx20(Button, { size: "sm", onClick: onRetry, children: retryLabel }) }) : null
|
|
2915
3067
|
] }) : children;
|
|
2916
|
-
return /* @__PURE__ */
|
|
3068
|
+
return /* @__PURE__ */ jsxs18(
|
|
2917
3069
|
"section",
|
|
2918
3070
|
{
|
|
2919
3071
|
className: ["uic-panel", className, classNames.root || ""].filter(Boolean).join(" "),
|
|
2920
3072
|
"aria-busy": loading || busy || void 0,
|
|
2921
3073
|
children: [
|
|
2922
|
-
/* @__PURE__ */
|
|
2923
|
-
/* @__PURE__ */
|
|
2924
|
-
title ? /* @__PURE__ */
|
|
2925
|
-
meta ? /* @__PURE__ */
|
|
3074
|
+
/* @__PURE__ */ jsxs18("header", { className: ["uic-panel-head", classNames.head || ""].filter(Boolean).join(" "), children: [
|
|
3075
|
+
/* @__PURE__ */ jsxs18("div", { className: "uic-panel-titles", children: [
|
|
3076
|
+
title ? /* @__PURE__ */ jsx20(Heading, { className: "uic-panel-title", children: title }) : null,
|
|
3077
|
+
meta ? /* @__PURE__ */ jsx20("p", { className: "uic-panel-meta", children: meta }) : null
|
|
2926
3078
|
] }),
|
|
2927
|
-
actions ? /* @__PURE__ */
|
|
3079
|
+
actions ? /* @__PURE__ */ jsx20("div", { className: "uic-panel-acts", children: actions }) : null
|
|
2928
3080
|
] }),
|
|
2929
|
-
busy ? /* @__PURE__ */
|
|
2930
|
-
/* @__PURE__ */
|
|
2931
|
-
footer ? /* @__PURE__ */
|
|
3081
|
+
busy ? /* @__PURE__ */ jsx20("div", { className: "uic-panel-busy", role: "status", "aria-label": busyLabel }) : null,
|
|
3082
|
+
/* @__PURE__ */ jsx20("div", { className: ["uic-panel-body", classNames.body || ""].filter(Boolean).join(" "), children: body }),
|
|
3083
|
+
footer ? /* @__PURE__ */ jsx20("footer", { className: "uic-panel-foot", children: footer }) : null
|
|
2932
3084
|
]
|
|
2933
3085
|
}
|
|
2934
3086
|
);
|
|
2935
3087
|
}
|
|
2936
3088
|
|
|
2937
3089
|
// src/grid/PanelGrid.jsx
|
|
2938
|
-
import React11, { useCallback as useCallback7, useEffect as useEffect12, useLayoutEffect, useMemo as useMemo4, useRef as
|
|
3090
|
+
import React11, { useCallback as useCallback7, useEffect as useEffect12, useLayoutEffect, useMemo as useMemo4, useRef as useRef11, useState as useState15 } from "react";
|
|
2939
3091
|
|
|
2940
3092
|
// src/grid/layout.js
|
|
2941
3093
|
function sortLayout(layout2) {
|
|
@@ -3008,10 +3160,10 @@ function sameLayout(a, b) {
|
|
|
3008
3160
|
}
|
|
3009
3161
|
|
|
3010
3162
|
// src/grid/PanelGrid.jsx
|
|
3011
|
-
import { jsx as
|
|
3163
|
+
import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3012
3164
|
function useMeasuredWidth() {
|
|
3013
|
-
const ref =
|
|
3014
|
-
const [width, setWidth] =
|
|
3165
|
+
const ref = useRef11(null);
|
|
3166
|
+
const [width, setWidth] = useState15(0);
|
|
3015
3167
|
useLayoutEffect(() => {
|
|
3016
3168
|
const el = ref.current;
|
|
3017
3169
|
if (!el) return void 0;
|
|
@@ -3039,9 +3191,9 @@ function PanelGrid(props) {
|
|
|
3039
3191
|
className = ""
|
|
3040
3192
|
} = props;
|
|
3041
3193
|
const [wrapRef, width] = useMeasuredWidth();
|
|
3042
|
-
const [drag, setDrag] =
|
|
3043
|
-
const dragRef =
|
|
3044
|
-
const swallowClick =
|
|
3194
|
+
const [drag, setDrag] = useState15(null);
|
|
3195
|
+
const dragRef = useRef11(null);
|
|
3196
|
+
const swallowClick = useRef11(false);
|
|
3045
3197
|
const stacked = width > 0 && width < stackAt;
|
|
3046
3198
|
const arrangeable = editable && !stacked;
|
|
3047
3199
|
const live = drag ? drag.preview : layout2;
|
|
@@ -3064,7 +3216,7 @@ function PanelGrid(props) {
|
|
|
3064
3216
|
const commit = useCallback7((next) => {
|
|
3065
3217
|
if (onLayoutChange && !sameLayout(next, layout2)) onLayoutChange(next);
|
|
3066
3218
|
}, [onLayoutChange, layout2]);
|
|
3067
|
-
const detach =
|
|
3219
|
+
const detach = useRef11(null);
|
|
3068
3220
|
useEffect12(() => () => detach.current?.(), []);
|
|
3069
3221
|
const start = (id, mode) => (e) => {
|
|
3070
3222
|
if (!arrangeable || e.button !== 0) return;
|
|
@@ -3130,7 +3282,7 @@ function PanelGrid(props) {
|
|
|
3130
3282
|
const byId = new Map(live.map((it) => [it.i, it]));
|
|
3131
3283
|
const ghost = drag && drag.mode === "move" && byId.has(drag.id) ? boxOf(byId.get(drag.id)) : null;
|
|
3132
3284
|
const cls = ["uic-pg", arrangeable ? "is-editable" : "", stacked ? "is-stacked" : "", className].filter(Boolean).join(" ");
|
|
3133
|
-
return /* @__PURE__ */
|
|
3285
|
+
return /* @__PURE__ */ jsxs19(
|
|
3134
3286
|
"div",
|
|
3135
3287
|
{
|
|
3136
3288
|
ref: wrapRef,
|
|
@@ -3141,7 +3293,7 @@ function PanelGrid(props) {
|
|
|
3141
3293
|
swallowClick.current = false;
|
|
3142
3294
|
},
|
|
3143
3295
|
children: [
|
|
3144
|
-
ghost ? /* @__PURE__ */
|
|
3296
|
+
ghost ? /* @__PURE__ */ jsx21("div", { className: "uic-pg-ghost", "aria-hidden": "true", style: ghost }) : null,
|
|
3145
3297
|
width > 0 && React11.Children.map(children, (child) => {
|
|
3146
3298
|
if (!React11.isValidElement(child) || child.key == null) return null;
|
|
3147
3299
|
const id = String(child.key).replace(/^\.\$/, "");
|
|
@@ -3149,7 +3301,7 @@ function PanelGrid(props) {
|
|
|
3149
3301
|
if (!it) return null;
|
|
3150
3302
|
const moving = drag && drag.id === id;
|
|
3151
3303
|
const offset = moving && drag.mode === "move" ? { transform: `translate(${drag.dx}px, ${drag.dy}px)` } : null;
|
|
3152
|
-
return /* @__PURE__ */
|
|
3304
|
+
return /* @__PURE__ */ jsxs19(
|
|
3153
3305
|
"div",
|
|
3154
3306
|
{
|
|
3155
3307
|
className: "uic-pg-item" + (moving ? " is-moving" : ""),
|
|
@@ -3157,7 +3309,7 @@ function PanelGrid(props) {
|
|
|
3157
3309
|
onPointerDown: arrangeable ? start(id, "move") : void 0,
|
|
3158
3310
|
children: [
|
|
3159
3311
|
child,
|
|
3160
|
-
arrangeable && !it.static ? /* @__PURE__ */
|
|
3312
|
+
arrangeable && !it.static ? /* @__PURE__ */ jsx21(
|
|
3161
3313
|
"button",
|
|
3162
3314
|
{
|
|
3163
3315
|
type: "button",
|
|
@@ -3165,7 +3317,7 @@ function PanelGrid(props) {
|
|
|
3165
3317
|
"aria-label": resizeLabel ? resizeLabel(id) : "Resize panel. Arrow keys resize it; shift with arrow keys moves it past its neighbours.",
|
|
3166
3318
|
onPointerDown: start(id, "resize"),
|
|
3167
3319
|
onKeyDown: onHandleKey(id),
|
|
3168
|
-
children: /* @__PURE__ */
|
|
3320
|
+
children: /* @__PURE__ */ jsx21("svg", { width: "10", height: "10", viewBox: "0 0 10 10", "aria-hidden": "true", children: /* @__PURE__ */ jsx21("path", { d: "M9 1v8H1", fill: "none", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round" }) })
|
|
3169
3321
|
}
|
|
3170
3322
|
) : null
|
|
3171
3323
|
]
|
|
@@ -3182,8 +3334,8 @@ function packLayout(layout2, cols = 12) {
|
|
|
3182
3334
|
}
|
|
3183
3335
|
|
|
3184
3336
|
// src/timeline/Timeline.jsx
|
|
3185
|
-
import { useCallback as useCallback8, useEffect as useEffect13, useLayoutEffect as useLayoutEffect2, useMemo as useMemo5, useRef as
|
|
3186
|
-
import { Fragment as Fragment9, jsx as
|
|
3337
|
+
import { useCallback as useCallback8, useEffect as useEffect13, useLayoutEffect as useLayoutEffect2, useMemo as useMemo5, useRef as useRef12, useState as useState16 } from "react";
|
|
3338
|
+
import { Fragment as Fragment9, jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3187
3339
|
var TL_MIN_PPS = 4;
|
|
3188
3340
|
var TL_MAX_PPS = 400;
|
|
3189
3341
|
var TL_DEFAULT_PPS = 26;
|
|
@@ -3272,20 +3424,20 @@ function Timeline({
|
|
|
3272
3424
|
emptyLabel = "Nothing here yet.",
|
|
3273
3425
|
className = ""
|
|
3274
3426
|
}) {
|
|
3275
|
-
const scroller =
|
|
3276
|
-
const innerRef =
|
|
3277
|
-
const [pps, setPps] =
|
|
3427
|
+
const scroller = useRef12(null);
|
|
3428
|
+
const innerRef = useRef12(null);
|
|
3429
|
+
const [pps, setPps] = useState16(() => {
|
|
3278
3430
|
if (zoomStorageKey && typeof window !== "undefined") {
|
|
3279
3431
|
const n = parseFloat(window.localStorage.getItem(zoomStorageKey) || "");
|
|
3280
3432
|
if (Number.isFinite(n)) return clamp(n, TL_MIN_PPS, TL_MAX_PPS);
|
|
3281
3433
|
}
|
|
3282
3434
|
return TL_DEFAULT_PPS;
|
|
3283
3435
|
});
|
|
3284
|
-
const [snapping, setSnapping] =
|
|
3285
|
-
const gesture =
|
|
3286
|
-
const [drag, setDrag] =
|
|
3287
|
-
const anchor =
|
|
3288
|
-
const [dropAt, setDropAt] =
|
|
3436
|
+
const [snapping, setSnapping] = useState16(() => snapStorageKey && typeof window !== "undefined" ? window.localStorage.getItem(snapStorageKey) !== "0" : true);
|
|
3437
|
+
const gesture = useRef12(null);
|
|
3438
|
+
const [drag, setDrag] = useState16(null);
|
|
3439
|
+
const anchor = useRef12(null);
|
|
3440
|
+
const [dropAt, setDropAt] = useState16(null);
|
|
3289
3441
|
const rows = useMemo5(
|
|
3290
3442
|
() => tracks.map((t) => ({
|
|
3291
3443
|
...t,
|
|
@@ -3336,7 +3488,7 @@ function Timeline({
|
|
|
3336
3488
|
if (scroller.current) scroller.current.scrollLeft = 0;
|
|
3337
3489
|
}
|
|
3338
3490
|
}, [fitPps, contentSeconds]);
|
|
3339
|
-
const fitted =
|
|
3491
|
+
const fitted = useRef12(false);
|
|
3340
3492
|
useLayoutEffect2(() => {
|
|
3341
3493
|
if (fitted.current || !(contentSeconds > 0)) return;
|
|
3342
3494
|
if (zoomStorageKey && typeof window !== "undefined" && window.localStorage.getItem(zoomStorageKey)) {
|
|
@@ -3466,9 +3618,9 @@ function Timeline({
|
|
|
3466
3618
|
const laneW = Math.max(contentSeconds * pps + 140, 320);
|
|
3467
3619
|
const ticks = [];
|
|
3468
3620
|
for (let t = 0; t <= contentSeconds + major; t += major) ticks.push(t);
|
|
3469
|
-
return /* @__PURE__ */
|
|
3470
|
-
/* @__PURE__ */
|
|
3471
|
-
onSplit && /* @__PURE__ */
|
|
3621
|
+
return /* @__PURE__ */ jsxs20("div", { className: `rui-tl ${className}`, onKeyDown, tabIndex: 0, children: [
|
|
3622
|
+
/* @__PURE__ */ jsxs20("div", { className: "rui-tl-bar", children: [
|
|
3623
|
+
onSplit && /* @__PURE__ */ jsxs20(
|
|
3472
3624
|
"button",
|
|
3473
3625
|
{
|
|
3474
3626
|
type: "button",
|
|
@@ -3477,7 +3629,7 @@ function Timeline({
|
|
|
3477
3629
|
disabled: !splitTarget,
|
|
3478
3630
|
title: splitTarget ? "Split at the playhead (B)" : "Move the playhead inside a clip to split it",
|
|
3479
3631
|
children: [
|
|
3480
|
-
/* @__PURE__ */
|
|
3632
|
+
/* @__PURE__ */ jsxs20(
|
|
3481
3633
|
"svg",
|
|
3482
3634
|
{
|
|
3483
3635
|
width: "13",
|
|
@@ -3489,19 +3641,19 @@ function Timeline({
|
|
|
3489
3641
|
strokeLinecap: "round",
|
|
3490
3642
|
"aria-hidden": "true",
|
|
3491
3643
|
children: [
|
|
3492
|
-
/* @__PURE__ */
|
|
3493
|
-
/* @__PURE__ */
|
|
3494
|
-
/* @__PURE__ */
|
|
3495
|
-
/* @__PURE__ */
|
|
3496
|
-
/* @__PURE__ */
|
|
3644
|
+
/* @__PURE__ */ jsx22("circle", { cx: "6", cy: "6", r: "3" }),
|
|
3645
|
+
/* @__PURE__ */ jsx22("circle", { cx: "6", cy: "18", r: "3" }),
|
|
3646
|
+
/* @__PURE__ */ jsx22("line", { x1: "20", y1: "4", x2: "8.12", y2: "15.88" }),
|
|
3647
|
+
/* @__PURE__ */ jsx22("line", { x1: "14.47", y1: "14.48", x2: "20", y2: "20" }),
|
|
3648
|
+
/* @__PURE__ */ jsx22("line", { x1: "8.12", y1: "8.12", x2: "12", y2: "12" })
|
|
3497
3649
|
]
|
|
3498
3650
|
}
|
|
3499
3651
|
),
|
|
3500
|
-
/* @__PURE__ */
|
|
3652
|
+
/* @__PURE__ */ jsx22("span", { children: "Split" })
|
|
3501
3653
|
]
|
|
3502
3654
|
}
|
|
3503
3655
|
),
|
|
3504
|
-
onDeleteClip && /* @__PURE__ */
|
|
3656
|
+
onDeleteClip && /* @__PURE__ */ jsx22(
|
|
3505
3657
|
"button",
|
|
3506
3658
|
{
|
|
3507
3659
|
type: "button",
|
|
@@ -3512,7 +3664,7 @@ function Timeline({
|
|
|
3512
3664
|
children: "Remove"
|
|
3513
3665
|
}
|
|
3514
3666
|
),
|
|
3515
|
-
/* @__PURE__ */
|
|
3667
|
+
/* @__PURE__ */ jsx22(
|
|
3516
3668
|
"button",
|
|
3517
3669
|
{
|
|
3518
3670
|
type: "button",
|
|
@@ -3523,9 +3675,9 @@ function Timeline({
|
|
|
3523
3675
|
children: "Snap"
|
|
3524
3676
|
}
|
|
3525
3677
|
),
|
|
3526
|
-
/* @__PURE__ */
|
|
3527
|
-
/* @__PURE__ */
|
|
3528
|
-
/* @__PURE__ */
|
|
3678
|
+
/* @__PURE__ */ jsx22("span", { className: "rui-tl-time", "aria-label": "Playhead position", children: exactLabel(currentTime) }),
|
|
3679
|
+
/* @__PURE__ */ jsx22("span", { className: "rui-tl-spacer" }),
|
|
3680
|
+
/* @__PURE__ */ jsx22(
|
|
3529
3681
|
"button",
|
|
3530
3682
|
{
|
|
3531
3683
|
type: "button",
|
|
@@ -3537,7 +3689,7 @@ function Timeline({
|
|
|
3537
3689
|
children: "\u2212"
|
|
3538
3690
|
}
|
|
3539
3691
|
),
|
|
3540
|
-
/* @__PURE__ */
|
|
3692
|
+
/* @__PURE__ */ jsx22(
|
|
3541
3693
|
"button",
|
|
3542
3694
|
{
|
|
3543
3695
|
type: "button",
|
|
@@ -3549,7 +3701,7 @@ function Timeline({
|
|
|
3549
3701
|
children: "+"
|
|
3550
3702
|
}
|
|
3551
3703
|
),
|
|
3552
|
-
/* @__PURE__ */
|
|
3704
|
+
/* @__PURE__ */ jsx22(
|
|
3553
3705
|
"button",
|
|
3554
3706
|
{
|
|
3555
3707
|
type: "button",
|
|
@@ -3561,10 +3713,10 @@ function Timeline({
|
|
|
3561
3713
|
}
|
|
3562
3714
|
)
|
|
3563
3715
|
] }),
|
|
3564
|
-
/* @__PURE__ */
|
|
3565
|
-
/* @__PURE__ */
|
|
3566
|
-
/* @__PURE__ */
|
|
3567
|
-
/* @__PURE__ */
|
|
3716
|
+
/* @__PURE__ */ jsx22("div", { className: "rui-tl-scroll", ref: scroller, children: /* @__PURE__ */ jsxs20("div", { className: "rui-tl-inner", ref: innerRef, style: { width: TL_HEAD_W + laneW }, children: [
|
|
3717
|
+
/* @__PURE__ */ jsxs20("div", { className: "rui-tl-row rui-tl-rulerrow", children: [
|
|
3718
|
+
/* @__PURE__ */ jsx22("div", { className: "rui-tl-head rui-tl-rulerhead", "aria-hidden": "true" }),
|
|
3719
|
+
/* @__PURE__ */ jsx22(
|
|
3568
3720
|
"div",
|
|
3569
3721
|
{
|
|
3570
3722
|
className: "rui-tl-ruler",
|
|
@@ -3593,17 +3745,17 @@ function Timeline({
|
|
|
3593
3745
|
onSeek(currentTime + step);
|
|
3594
3746
|
}
|
|
3595
3747
|
} : void 0,
|
|
3596
|
-
children: ticks.map((t) => /* @__PURE__ */
|
|
3748
|
+
children: ticks.map((t) => /* @__PURE__ */ jsx22("span", { className: "rui-tl-ticklbl", style: { left: t * pps }, children: tickLabel(t, major) }, t))
|
|
3597
3749
|
}
|
|
3598
3750
|
)
|
|
3599
3751
|
] }),
|
|
3600
|
-
rows.length === 0 && /* @__PURE__ */
|
|
3601
|
-
rows.map((track) => /* @__PURE__ */
|
|
3602
|
-
/* @__PURE__ */
|
|
3752
|
+
rows.length === 0 && /* @__PURE__ */ jsx22("p", { className: "rui-tl-empty", children: emptyLabel }),
|
|
3753
|
+
rows.map((track) => /* @__PURE__ */ jsxs20("div", { className: "rui-tl-row", children: [
|
|
3754
|
+
/* @__PURE__ */ jsxs20("div", { className: "rui-tl-head", title: track.title || track.label, children: [
|
|
3603
3755
|
track.icon,
|
|
3604
|
-
/* @__PURE__ */
|
|
3756
|
+
/* @__PURE__ */ jsx22("span", { className: "rui-tl-headlbl", children: track.label })
|
|
3605
3757
|
] }),
|
|
3606
|
-
/* @__PURE__ */
|
|
3758
|
+
/* @__PURE__ */ jsxs20(
|
|
3607
3759
|
"div",
|
|
3608
3760
|
{
|
|
3609
3761
|
className: "rui-tl-lane" + (dropAt?.trackId === track.id ? " is-dropping" : ""),
|
|
@@ -3634,8 +3786,8 @@ function Timeline({
|
|
|
3634
3786
|
onDropClip(payload, { trackId: track.id, seconds: t, index });
|
|
3635
3787
|
} : void 0,
|
|
3636
3788
|
children: [
|
|
3637
|
-
track.laid.length === 0 && track.emptyLabel && /* @__PURE__ */
|
|
3638
|
-
track.laid.map((l) => /* @__PURE__ */
|
|
3789
|
+
track.laid.length === 0 && track.emptyLabel && /* @__PURE__ */ jsx22("p", { className: "rui-tl-laneempty", children: track.emptyLabel }),
|
|
3790
|
+
track.laid.map((l) => /* @__PURE__ */ jsx22(
|
|
3639
3791
|
Clip,
|
|
3640
3792
|
{
|
|
3641
3793
|
l,
|
|
@@ -3651,7 +3803,7 @@ function Timeline({
|
|
|
3651
3803
|
},
|
|
3652
3804
|
l.clip.id ?? l.i
|
|
3653
3805
|
)),
|
|
3654
|
-
dropAt?.trackId === track.id && /* @__PURE__ */
|
|
3806
|
+
dropAt?.trackId === track.id && /* @__PURE__ */ jsx22(
|
|
3655
3807
|
"span",
|
|
3656
3808
|
{
|
|
3657
3809
|
className: "rui-tl-dropmark",
|
|
@@ -3659,7 +3811,7 @@ function Timeline({
|
|
|
3659
3811
|
"aria-hidden": "true"
|
|
3660
3812
|
}
|
|
3661
3813
|
),
|
|
3662
|
-
laneAppend && /* @__PURE__ */
|
|
3814
|
+
laneAppend && /* @__PURE__ */ jsx22(
|
|
3663
3815
|
"span",
|
|
3664
3816
|
{
|
|
3665
3817
|
className: "rui-tl-append",
|
|
@@ -3671,9 +3823,9 @@ function Timeline({
|
|
|
3671
3823
|
}
|
|
3672
3824
|
)
|
|
3673
3825
|
] }, track.id)),
|
|
3674
|
-
onDropClip && newLaneLabel && /* @__PURE__ */
|
|
3675
|
-
/* @__PURE__ */
|
|
3676
|
-
/* @__PURE__ */
|
|
3826
|
+
onDropClip && newLaneLabel && /* @__PURE__ */ jsxs20("div", { className: "rui-tl-row", children: [
|
|
3827
|
+
/* @__PURE__ */ jsx22("div", { className: "rui-tl-head rui-tl-newhead", "aria-hidden": "true" }),
|
|
3828
|
+
/* @__PURE__ */ jsx22(
|
|
3677
3829
|
"div",
|
|
3678
3830
|
{
|
|
3679
3831
|
className: "rui-tl-newlane" + (dropAt?.trackId === null ? " is-dropping" : ""),
|
|
@@ -3695,11 +3847,11 @@ function Timeline({
|
|
|
3695
3847
|
e.preventDefault();
|
|
3696
3848
|
onDropClip(payload, { trackId: null, seconds: timeAt(e.clientX), index: 0 });
|
|
3697
3849
|
},
|
|
3698
|
-
children: /* @__PURE__ */
|
|
3850
|
+
children: /* @__PURE__ */ jsx22("span", { className: "rui-tl-newlbl", children: newLaneLabel })
|
|
3699
3851
|
}
|
|
3700
3852
|
)
|
|
3701
3853
|
] }),
|
|
3702
|
-
drag?.guide != null && /* @__PURE__ */
|
|
3854
|
+
drag?.guide != null && /* @__PURE__ */ jsx22(
|
|
3703
3855
|
"div",
|
|
3704
3856
|
{
|
|
3705
3857
|
className: "rui-tl-guide",
|
|
@@ -3707,16 +3859,16 @@ function Timeline({
|
|
|
3707
3859
|
"aria-hidden": "true"
|
|
3708
3860
|
}
|
|
3709
3861
|
),
|
|
3710
|
-
Number.isFinite(currentTime) && /* @__PURE__ */
|
|
3862
|
+
Number.isFinite(currentTime) && /* @__PURE__ */ jsx22(
|
|
3711
3863
|
"div",
|
|
3712
3864
|
{
|
|
3713
3865
|
className: "rui-tl-playhead",
|
|
3714
3866
|
style: { left: TL_HEAD_W + currentTime * pps },
|
|
3715
3867
|
"aria-hidden": "true",
|
|
3716
|
-
children: /* @__PURE__ */
|
|
3868
|
+
children: /* @__PURE__ */ jsx22("span", { className: "rui-tl-playhead-grip" })
|
|
3717
3869
|
}
|
|
3718
3870
|
),
|
|
3719
|
-
drag?.annotation && /* @__PURE__ */
|
|
3871
|
+
drag?.annotation && /* @__PURE__ */ jsx22("div", { className: "rui-tl-annot", style: { left: TL_HEAD_W + (drag.annotAt || 0) * pps }, children: drag.annotation })
|
|
3720
3872
|
] }) })
|
|
3721
3873
|
] });
|
|
3722
3874
|
}
|
|
@@ -3792,7 +3944,7 @@ function Clip({
|
|
|
3792
3944
|
click: onSelect
|
|
3793
3945
|
});
|
|
3794
3946
|
};
|
|
3795
|
-
return /* @__PURE__ */
|
|
3947
|
+
return /* @__PURE__ */ jsxs20(
|
|
3796
3948
|
"article",
|
|
3797
3949
|
{
|
|
3798
3950
|
className: "rui-tl-clip" + (clip.state ? ` is-${clip.state}` : "") + (known ? "" : " is-unmeasured") + (selected ? " is-selected" : "") + (live ? " is-live" : ""),
|
|
@@ -3807,10 +3959,10 @@ function Clip({
|
|
|
3807
3959
|
}
|
|
3808
3960
|
},
|
|
3809
3961
|
children: [
|
|
3810
|
-
clip.poster ? /* @__PURE__ */
|
|
3962
|
+
clip.poster ? /* @__PURE__ */ jsx22("span", { className: "rui-tl-strip", style: {
|
|
3811
3963
|
backgroundImage: `url("${String(clip.poster).replace(/"/g, '\\"')}")`,
|
|
3812
3964
|
backgroundSize: `${tileW}px 100%`
|
|
3813
|
-
} }) : clip.video ? /* @__PURE__ */
|
|
3965
|
+
} }) : clip.video ? /* @__PURE__ */ jsx22(
|
|
3814
3966
|
"video",
|
|
3815
3967
|
{
|
|
3816
3968
|
className: "rui-tl-frame",
|
|
@@ -3821,12 +3973,12 @@ function Clip({
|
|
|
3821
3973
|
tabIndex: -1,
|
|
3822
3974
|
"aria-hidden": "true"
|
|
3823
3975
|
}
|
|
3824
|
-
) : /* @__PURE__ */
|
|
3825
|
-
clip.badge && /* @__PURE__ */
|
|
3826
|
-
known && width > 46 && /* @__PURE__ */
|
|
3827
|
-
clip.label && width > 104 && /* @__PURE__ */
|
|
3828
|
-
onTrim && known && /* @__PURE__ */
|
|
3829
|
-
/* @__PURE__ */
|
|
3976
|
+
) : /* @__PURE__ */ jsx22("span", { className: "rui-tl-blank", "aria-hidden": "true", children: clip.glyph }),
|
|
3977
|
+
clip.badge && /* @__PURE__ */ jsx22("span", { className: "rui-tl-badge", children: clip.badge }),
|
|
3978
|
+
known && width > 46 && /* @__PURE__ */ jsx22("span", { className: "rui-tl-dur", children: durationLabel(clip.duration) }),
|
|
3979
|
+
clip.label && width > 104 && /* @__PURE__ */ jsx22("span", { className: "rui-tl-name", children: clip.label }),
|
|
3980
|
+
onTrim && known && /* @__PURE__ */ jsxs20(Fragment9, { children: [
|
|
3981
|
+
/* @__PURE__ */ jsx22(
|
|
3830
3982
|
"span",
|
|
3831
3983
|
{
|
|
3832
3984
|
className: "rui-tl-trim l",
|
|
@@ -3835,7 +3987,7 @@ function Clip({
|
|
|
3835
3987
|
"aria-label": `Trim the start of ${clip.label || "this clip"}`
|
|
3836
3988
|
}
|
|
3837
3989
|
),
|
|
3838
|
-
/* @__PURE__ */
|
|
3990
|
+
/* @__PURE__ */ jsx22(
|
|
3839
3991
|
"span",
|
|
3840
3992
|
{
|
|
3841
3993
|
className: "rui-tl-trim r",
|
|
@@ -3892,8 +4044,10 @@ export {
|
|
|
3892
4044
|
IcTool,
|
|
3893
4045
|
IcX,
|
|
3894
4046
|
Input,
|
|
4047
|
+
MICROSOFT_ENABLED,
|
|
3895
4048
|
MentionInput,
|
|
3896
4049
|
MentionText,
|
|
4050
|
+
MicrosoftButton,
|
|
3897
4051
|
Modal,
|
|
3898
4052
|
PaneResizer,
|
|
3899
4053
|
Panel,
|
|
@@ -3936,6 +4090,8 @@ export {
|
|
|
3936
4090
|
logout,
|
|
3937
4091
|
majorTickStep,
|
|
3938
4092
|
mentionModel_exports as mention,
|
|
4093
|
+
microsoftIdToken,
|
|
4094
|
+
microsoftSignIn,
|
|
3939
4095
|
packLayout,
|
|
3940
4096
|
parseArgs,
|
|
3941
4097
|
prettyJson,
|