@hanzo/dev 4.2.1 → 4.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/{BinaryViewer-BCDMNW2g.js → BinaryViewer-CeQaKnXQ.js} +3 -3
  2. package/dist/{ChatMarkdown-BUidXqSs.js → ChatMarkdown-DqKVAYd6.js} +9 -9
  3. package/dist/{DiffCommentAnnotation-2HD5qiyt.js → DiffCommentAnnotation-CCtanhmq.js} +4 -4
  4. package/dist/{DiffFileTree-CuWvI5hS.js → DiffFileTree-BhEDIwzm.js} +3 -3
  5. package/dist/{DiffPanel-Z2QVmBzu.js → DiffPanel-BPZ6Ru_G.js} +11 -11
  6. package/dist/{DiffWorkerPoolProvider-CEfiCIGR.js → DiffWorkerPoolProvider-8Qh-Y5iP.js} +1 -1
  7. package/dist/{DocumentPages-glImt2JO.js → DocumentPages-MN1xyIRb.js} +1 -1
  8. package/dist/{ExpandedImageDialog-iqO3LiIj.js → ExpandedImageDialog-tCY2TFXU.js} +2 -2
  9. package/dist/{FileExplorerPane-GwnRmXEh.js → FileExplorerPane-BgJw-BA4.js} +1 -1
  10. package/dist/{FilePreviewPanel-CXWpTlfI.js → FilePreviewPanel-DHteid8j.js} +17 -17
  11. package/dist/{FontFilePreview-CDydHOXg.js → FontFilePreview-COxgoDy5.js} +1 -1
  12. package/dist/{FontViewer-DDt9C5Cb.js → FontViewer-jxARaj1f.js} +1 -1
  13. package/dist/{HanzoConnectAccountPages-_sfrtw9j.js → HanzoConnectAccountPages-BM2mB27b.js} +1 -1
  14. package/dist/{HanzoConnectSidebarSignIn-coFQvyRw.js → HanzoConnectSidebarSignIn-BSOkKAjH.js} +1 -1
  15. package/dist/{LargeTextViewer-D3RklYQB.js → LargeTextViewer-BX5-yWcy.js} +1 -1
  16. package/dist/{MermaidFilePreview-BmPdNxW5.js → MermaidFilePreview-BqB2exZU.js} +1 -1
  17. package/dist/{MermaidViewer-BlKTevTF.js → MermaidViewer-B0WYx1jk.js} +1 -1
  18. package/dist/{NotebookPreview-C0gSEyeO.js → NotebookPreview-B_7pSd7A.js} +3 -3
  19. package/dist/{OfficeFilePreview-Ago_DWEt.js → OfficeFilePreview-BJsNoaju.js} +1 -1
  20. package/dist/{OfficeViewer-DBRqtLet.js → OfficeViewer-TgdFnOtV.js} +1 -1
  21. package/dist/{OpenInPicker-DD_h7VLv.js → OpenInPicker-B3gPcFs6.js} +14 -14
  22. package/dist/{OpenXmlOfficeViewer-B4dxjpba.js → OpenXmlOfficeViewer-C18a0NFP.js} +1 -1
  23. package/dist/{PreviewFaviconIcon-BwYKB-3e.js → PreviewFaviconIcon-Dzjf4QXZ.js} +3 -3
  24. package/dist/{PreviewImage-6UU-M6_B.js → PreviewImage-Ct8eWJb8.js} +1 -1
  25. package/dist/{PreviewImageContent-D-00K-A9.js → PreviewImageContent-Dd8dzt9u.js} +1 -1
  26. package/dist/{PreviewPanel-CiuHdDv8.js → PreviewPanel-BnsoHObW.js} +5 -5
  27. package/dist/{ProviderAuthTerminal-pQXIfodT.js → ProviderAuthTerminal-CYalqlUB.js} +1 -1
  28. package/dist/{PullRequestCodeTab-Cqfh5eN2.js → PullRequestCodeTab-Jt9jdq55.js} +10 -10
  29. package/dist/{PullRequestReviewAnnotation-B4Lp8Ktf.js → PullRequestReviewAnnotation-xg3n0doV.js} +5 -5
  30. package/dist/{ReadOnlySourcePreview-7xXUUySV.js → ReadOnlySourcePreview-BYlRPbKI.js} +4 -4
  31. package/dist/{RelativeTime-B_yprjav.js → RelativeTime-DQhoNsWZ.js} +1 -1
  32. package/dist/{ThreadTerminalDrawer-DCgE3ojz.js → ThreadTerminalDrawer-Cf4l2axO.js} +4 -4
  33. package/dist/{browserLinkTarget-BbVlDQYx.js → browserLinkTarget-CCzAioAu.js} +2 -2
  34. package/dist/{changedFileKind-DrjqPCpz.js → changedFileKind-OIp-fuQd.js} +2 -2
  35. package/dist/core.d.ts +38 -0
  36. package/dist/core.js +1 -1
  37. package/dist/{decodeImagePreview-ZtWU3urU.js → decodeImagePreview-DbkSuh7q.js} +1 -1
  38. package/dist/{embed-CPWZKyIW.js → embed-CzXFS50X.js} +32227 -31944
  39. package/dist/{fileContextMenu-DW94DZj4.js → fileContextMenu-hdALQktP.js} +2 -2
  40. package/dist/{fileExplorerLabel-Cfz-3q1U.js → fileExplorerLabel-DMdkA7jY.js} +2 -2
  41. package/dist/{readBinaryPreview-CjZdBNVR.js → readBinaryPreview-DgDAUfzQ.js} +1 -1
  42. package/dist/{threadSearch-CrtCof6n.js → threadSearch-sHEENLiT.js} +1 -1
  43. package/dist/{useFileMetadata-PesehDX0.js → useFileMetadata-ChvPTfBY.js} +1 -1
  44. package/dist/{useNextRenderData-CNhjWfP0.js → useNextRenderData-Jm142a1q.js} +1 -1
  45. package/dist/{useSettings-B_MtcTyD.js → useSettings-Due4XCTB.js} +1 -1
  46. package/dist/{useTextFieldSpeech-B1wCgLPO.js → useTextFieldSpeech-XN9r-f-r.js} +3 -3
  47. package/dist/useTheme-B9hvAuzL.js +411 -0
  48. package/package.json +17 -17
  49. package/dist/useTheme-WlXpQRKG.js +0 -376
@@ -1,376 +0,0 @@
1
- import { pp as e } from "./utils-DtKQl-D3.js";
2
- import { cd as t, ff as n, hd as r, kd as i, nf as a, rb as o, wd as s } from "./keybindings-D0pBlT1k.js";
3
- import { F as c, H as l, I as u, L as ee, T as d, b as f, c as te, i as p, k as ne, l as re, n as m, o as h, r as ie, w as ae, x as g } from "./themePalette-C-GtwwqV.js";
4
- import "./errors-D8_Zn8KN.js";
5
- import { useSyncExternalStore as _ } from "react";
6
- import { c as oe } from "react/compiler-runtime";
7
- // src/hooks/useTheme.ts
8
- var v = "hanzodev:theme", y = "(prefers-color-scheme: dark)", b = {
9
- theme: "dark",
10
- resolvedTheme: "dark",
11
- systemDark: !0,
12
- followSystem: !1,
13
- appearanceMode: "dark",
14
- themeHalves: null
15
- };
16
- function se() {
17
- return x();
18
- }
19
- function ce() {
20
- return typeof window > "u" ? {} : S();
21
- }
22
- function x() {
23
- if (typeof window > "u") return null;
24
- try {
25
- return ne(window.localStorage.getItem(p));
26
- } catch {
27
- return null;
28
- }
29
- }
30
- function S() {
31
- try {
32
- let e = JSON.parse(window.localStorage.getItem("hanzodev:theme-halves:v1") ?? "null");
33
- if (typeof e != "object" || !e) return {};
34
- let t = {};
35
- for (let n of ["light", "dark"]) {
36
- let r = e[n];
37
- typeof r == "string" && (t[n] = r);
38
- }
39
- return t;
40
- } catch {
41
- return {};
42
- }
43
- }
44
- function C(e) {
45
- return `${e?.light ?? ""}|${e?.dark ?? ""}`;
46
- }
47
- var w = "theme-color", le = `meta[name="${w}"][data-dynamic-theme-color="true"]`, T = class extends i()("ThemeStorageError", {
48
- operation: r(["read", "write"]),
49
- storageKey: s,
50
- theme: n(h),
51
- cause: t()
52
- }) {
53
- get message() {
54
- return `Failed to ${this.operation} theme preference for ${this.storageKey}.`;
55
- }
56
- }, E = a(T), D = class extends i()("DesktopThemeSyncError", {
57
- theme: h,
58
- cause: t()
59
- }) {
60
- get message() {
61
- return `Failed to sync the ${this.theme} theme to the desktop shell.`;
62
- }
63
- }, ue = a(D), O = [], k = null, A = !0, j = null, M = null, N = null;
64
- function P() {
65
- A = !0;
66
- for (let e of O) e();
67
- }
68
- function F() {
69
- return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(y).matches;
70
- }
71
- function de(e) {
72
- if (typeof window > "u") return e === "system";
73
- try {
74
- let e = window.localStorage.getItem(ie);
75
- if (e === "true") return !0;
76
- if (e === "false") return !1;
77
- } catch {}
78
- return e === "system";
79
- }
80
- function fe(e) {
81
- return e === "light" || e === "dark" || e === "system";
82
- }
83
- function I(e) {
84
- if (typeof window < "u") try {
85
- let e = window.localStorage.getItem(m);
86
- if (fe(e)) return e;
87
- } catch {}
88
- return de(e) ? "system" : f(e) ?? "light";
89
- }
90
- function L(e) {
91
- if (typeof window < "u") try {
92
- window.localStorage.setItem(m, e);
93
- } catch (e) {
94
- throw new T({
95
- operation: "write",
96
- storageKey: m,
97
- cause: e
98
- });
99
- }
100
- }
101
- function R() {
102
- if (typeof window > "u") return b.theme;
103
- let e;
104
- try {
105
- e = window.localStorage.getItem(v);
106
- } catch (e) {
107
- throw new T({
108
- operation: "read",
109
- storageKey: v,
110
- cause: e
111
- });
112
- }
113
- return e !== null && d(e) ? re(e) : b.theme;
114
- }
115
- function pe(e) {
116
- if (typeof window < "u") try {
117
- window.localStorage.setItem(v, e), N = null;
118
- } catch (t) {
119
- throw new T({
120
- operation: "write",
121
- storageKey: v,
122
- theme: e,
123
- cause: t
124
- });
125
- }
126
- }
127
- function z() {
128
- if (N !== null) return b.theme;
129
- try {
130
- return R();
131
- } catch (t) {
132
- let n = E(t) ? t : new T({
133
- operation: "read",
134
- storageKey: v,
135
- cause: t
136
- });
137
- return N = n, console.error(n.message, {
138
- operation: n.operation,
139
- storageKey: n.storageKey,
140
- ...e(n)
141
- }), b.theme;
142
- }
143
- }
144
- function me() {
145
- let e = document.querySelector(le);
146
- return e || (e = document.createElement("meta"), e.name = w, e.setAttribute("data-dynamic-theme-color", "true"), document.head.append(e), e);
147
- }
148
- function B(e) {
149
- let t = e?.trim().toLowerCase();
150
- return !t || t === "transparent" || t === "rgba(0, 0, 0, 0)" || t === "rgba(0 0 0 / 0)" ? null : e?.trim() ?? null;
151
- }
152
- function he() {
153
- return document.querySelector("main[data-slot='sidebar-inset']") ?? document.querySelector("[data-slot='sidebar-inner']") ?? document.body;
154
- }
155
- function V() {
156
- if (typeof document > "u" || typeof getComputedStyle > "u") return;
157
- let e = getComputedStyle(document.documentElement), t = document.documentElement.dataset.themeId ? B(e.getPropertyValue("--app-chrome-background")) : null, n = B(getComputedStyle(he()).backgroundColor), r = B(getComputedStyle(document.body).backgroundColor), i = t ?? n ?? r;
158
- if (!i) return;
159
- document.documentElement.style.backgroundColor = i, document.body.style.backgroundColor = i;
160
- let a = document.querySelectorAll(`meta[name="${w}"]`);
161
- if (a.length === 0) me().setAttribute("content", i);
162
- else for (let e of a) e.setAttribute("content", i);
163
- }
164
- function H(e, { suppressTransitions: t = !1, preservePreview: n = !0 } = {}) {
165
- if (typeof document > "u" || typeof window > "u" || n && document.documentElement.dataset?.themeId === "__preview") return;
166
- let r = I(e), i = r === "system", a = i ? F() : !1, o = x();
167
- if (M?.theme === e && M.systemDark === a && M.followSystem === i && M.appearanceMode === r && C(M.themeHalves) === C(o)) {
168
- U(e, i, r);
169
- return;
170
- }
171
- t && document.documentElement.classList.add("no-transitions");
172
- let s = u(e, a, i, r, o);
173
- te(ee(e, o, s), s), document.documentElement.classList.toggle("dark", s === "dark"), M = {
174
- theme: e,
175
- systemDark: a,
176
- followSystem: i,
177
- appearanceMode: r,
178
- themeHalves: o
179
- }, V(), U(e, i, r), t && (document.documentElement.offsetHeight, requestAnimationFrame(() => {
180
- document.documentElement.classList.remove("no-transitions");
181
- }));
182
- }
183
- async function ge(e, t, n, r, i = x()) {
184
- try {
185
- await e.setTheme(c(t, n, r, i));
186
- } catch (e) {
187
- throw new D({
188
- theme: t,
189
- cause: e
190
- });
191
- }
192
- }
193
- function U(t, n, r) {
194
- if (typeof window > "u") return;
195
- let i = window.desktopBridge, a = x(), o = c(t, n, r, a);
196
- i && typeof i.setTheme == "function" && j !== o && (j = o, ge(i, t, n, r, a).catch((n) => {
197
- let r = ue(n) ? n : new D({
198
- theme: t,
199
- cause: n
200
- });
201
- console.error(r.message, {
202
- theme: r.theme,
203
- ...e(r)
204
- }), j === o && (j = null);
205
- }));
206
- }
207
- typeof document < "u" && typeof window < "u" && H(z());
208
- function W() {
209
- if (typeof window > "u") return b;
210
- if (!A && k) return k;
211
- A = !1;
212
- let e = z(), t = I(e), n = t === "system", r = n ? F() : !1, i = x(), a = u(e, r, n, t, i);
213
- return k && k.theme === e && k.resolvedTheme === a && k.systemDark === r && k.followSystem === n && k.appearanceMode === t && C(k.themeHalves) === C(i) || (k = {
214
- theme: e,
215
- resolvedTheme: a,
216
- systemDark: r,
217
- followSystem: n,
218
- appearanceMode: t,
219
- themeHalves: i
220
- }), k;
221
- }
222
- function G() {
223
- return b;
224
- }
225
- function K() {
226
- let e = z();
227
- I(e) === "system" && H(e, { suppressTransitions: !0 }), P();
228
- }
229
- function q(e) {
230
- e.key === v ? (N = null, H(z(), { suppressTransitions: !0 }), P()) : e.key === "hanzodev:theme-follow-system" || e.key === "hanzodev:theme-appearance-mode" || e.key === "hanzodev:theme-halves:v1" ? (H(z(), { suppressTransitions: !0 }), P()) : (e.key === "hanzodev:themes:v1" || e.key === null) && (e.key === null && (N = null), ae(), M = null, H(z(), { suppressTransitions: !0 }), P());
231
- }
232
- var J = null;
233
- function Y(e) {
234
- if (typeof window > "u") return () => {};
235
- if (O.push(e), !J) {
236
- let e = typeof window.matchMedia == "function" ? window.matchMedia(y) : null;
237
- e?.addEventListener("change", K), window.addEventListener("storage", q), J = () => {
238
- e?.removeEventListener("change", K), window.removeEventListener("storage", q);
239
- };
240
- }
241
- return () => {
242
- O = O.filter((t) => t !== e), O.length === 0 && (J?.(), J = null);
243
- };
244
- }
245
- function _e() {
246
- return W();
247
- }
248
- function ve(e) {
249
- let t = Y(e), n = l(e);
250
- return () => {
251
- t(), n();
252
- };
253
- }
254
- function ye() {
255
- return g() ?? W().resolvedTheme;
256
- }
257
- function be() {
258
- let { resolvedTheme: e } = _(Y, W, G);
259
- return _(l, g, xe) ?? e;
260
- }
261
- function xe() {
262
- return null;
263
- }
264
- function X(t) {
265
- if (typeof window > "u") return !1;
266
- try {
267
- o(z(), I, L);
268
- let e = window.localStorage.getItem(p);
269
- window.localStorage.removeItem(p);
270
- try {
271
- pe(t);
272
- } catch (t) {
273
- if (e !== null) try {
274
- window.localStorage.setItem(p, e);
275
- } catch {}
276
- throw t;
277
- }
278
- } catch (n) {
279
- let r = E(n) ? n : new T({
280
- operation: "write",
281
- storageKey: v,
282
- theme: t,
283
- cause: n
284
- });
285
- return console.error(r.message, {
286
- operation: r.operation,
287
- storageKey: r.storageKey,
288
- theme: t,
289
- ...e(r)
290
- }), !1;
291
- }
292
- return H(t, { suppressTransitions: !0 }), P(), !0;
293
- }
294
- function Z(t) {
295
- if (typeof window > "u") return !1;
296
- try {
297
- L(t);
298
- } catch (t) {
299
- let n = E(t) ? t : new T({
300
- operation: "write",
301
- storageKey: m,
302
- cause: t
303
- });
304
- return console.error(n.message, {
305
- operation: n.operation,
306
- storageKey: n.storageKey,
307
- ...e(n)
308
- }), !1;
309
- }
310
- return N = null, H(z(), { suppressTransitions: !0 }), P(), !0;
311
- }
312
- function Q(t, n) {
313
- if (typeof window > "u") return !1;
314
- try {
315
- let e = { ...S() };
316
- n === null ? delete e[t] : e[t] = n, e.light === void 0 && e.dark === void 0 ? window.localStorage.removeItem(p) : window.localStorage.setItem(p, JSON.stringify(e));
317
- } catch (t) {
318
- let n = new T({
319
- operation: "write",
320
- storageKey: p,
321
- cause: t
322
- });
323
- return console.error(n.message, {
324
- operation: n.operation,
325
- storageKey: n.storageKey,
326
- ...e(n)
327
- }), !1;
328
- }
329
- return H(z(), { suppressTransitions: !0 }), P(), !0;
330
- }
331
- function Se() {
332
- if (typeof window > "u") return !1;
333
- try {
334
- window.localStorage.removeItem(p);
335
- } catch (t) {
336
- let n = new T({
337
- operation: "write",
338
- storageKey: p,
339
- cause: t
340
- });
341
- return console.error(n.message, {
342
- operation: n.operation,
343
- storageKey: n.storageKey,
344
- ...e(n)
345
- }), !1;
346
- }
347
- return H(z(), { suppressTransitions: !0 }), P(), !0;
348
- }
349
- function $({ preservePreview: e = !1 } = {}) {
350
- typeof window < "u" && (M = null, H(z(), {
351
- suppressTransitions: !0,
352
- preservePreview: e
353
- }), P());
354
- }
355
- function Ce() {
356
- let e = oe(9), t = _(Y, W, G), { theme: n, resolvedTheme: r } = t, i;
357
- e[0] === n ? i = e[1] : (i = (e) => {
358
- let t = I(n);
359
- return Z(e ? "system" : t === "system" ? f(n) ?? "light" : t);
360
- }, e[0] = n, e[1] = i);
361
- let a = i, o;
362
- return e[2] !== r || e[3] !== a || e[4] !== t.appearanceMode || e[5] !== t.followSystem || e[6] !== t.themeHalves || e[7] !== n ? (o = {
363
- theme: n,
364
- setTheme: X,
365
- setAppearanceMode: Z,
366
- setFollowSystem: a,
367
- setThemeHalf: Q,
368
- clearThemeHalves: Se,
369
- refreshTheme: $,
370
- followSystem: t.followSystem,
371
- appearanceMode: t.appearanceMode,
372
- resolvedTheme: r,
373
- themeHalves: t.themeHalves
374
- }, e[2] = r, e[3] = a, e[4] = t.appearanceMode, e[5] = t.followSystem, e[6] = t.themeHalves, e[7] = n, e[8] = o) : o = e[8], o;
375
- }
376
- export { ce as a, Z as c, V as d, be as f, se as i, X as l, _e as n, R as o, Ce as p, I as r, $ as s, ye as t, ve as u };