@parallelworks/tandem-web 0.139.0 → 0.139.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.
@@ -1,11 +1,12 @@
1
- import { SharedUI as e } from "./SharedUI.js";
2
- import { Outlet as t } from "@tanstack/react-router";
3
- import { jsx as n } from "react/jsx-runtime";
1
+ import { PageTitle as e } from "../lib/pageTitle.js";
2
+ import { SharedUI as t } from "./SharedUI.js";
3
+ import { Outlet as n } from "@tanstack/react-router";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
4
5
  // src/components/AppRoot.tsx
5
- function r() {
6
- return /* @__PURE__ */ n(e, { children: /* @__PURE__ */ n("div", {
6
+ function a() {
7
+ return /* @__PURE__ */ i(t, { children: [/* @__PURE__ */ r(e, {}), /* @__PURE__ */ r("div", {
7
8
  className: "flex min-h-dvh flex-col",
8
- children: /* @__PURE__ */ n(t, {})
9
- }) });
9
+ children: /* @__PURE__ */ r(n, {})
10
+ })] });
10
11
  }
11
- export { r as default };
12
+ export { a as default };
@@ -5,8 +5,8 @@ import { useTranslations as _ } from "use-intl";
5
5
  import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
6
6
  import { useQuery as x, useSuspenseQuery as S } from "@tanstack/react-query";
7
7
  // src/components/SettingsNav.tsx
8
- var C = "flex h-8 items-center gap-2.5 rounded-md px-2 text-sm text-muted-foreground hover:bg-muted hover:text-foreground", w = { className: "bg-muted !text-foreground font-medium" };
9
- function T() {
8
+ var C = "flex h-8 items-center gap-2.5 rounded-md px-2 text-sm text-muted-foreground hover:bg-muted hover:text-foreground", w = "bg-[var(--theme-sidebar-active-bg,var(--theme-hover))] hover:bg-[var(--theme-sidebar-active-bg,var(--theme-hover))] !text-[var(--theme-sidebar-active-text,var(--theme-app))] font-medium", T = { className: w };
9
+ function E() {
10
10
  let { data: e } = S(n), r = _("settingsNav"), v = e?.mode === "platform", { data: y } = x(t);
11
11
  return [
12
12
  {
@@ -102,8 +102,8 @@ function T() {
102
102
  }
103
103
  ];
104
104
  }
105
- function E({ workspace: t }) {
106
- let n = _("settingsNav"), i = T();
105
+ function D({ workspace: t }) {
106
+ let n = _("settingsNav"), i = E();
107
107
  return /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ b(e, {
108
108
  to: "/$workspace/issues",
109
109
  params: { workspace: t },
@@ -123,7 +123,7 @@ function E({ workspace: t }) {
123
123
  to: n,
124
124
  params: { workspace: t },
125
125
  className: C,
126
- activeProps: w,
126
+ activeProps: T,
127
127
  activeOptions: { exact: !0 },
128
128
  children: [
129
129
  /* @__PURE__ */ y(i, { className: "size-4" }),
@@ -135,4 +135,4 @@ function E({ workspace: t }) {
135
135
  }, n.label))
136
136
  })] });
137
137
  }
138
- export { E as SettingsNav, T as useSettingsPages };
138
+ export { D as SettingsNav, C as navItem, w as navOn, E as useSettingsPages };
@@ -1,5 +1,5 @@
1
- import { usePathname as e } from "../lib/router.js";
2
- import { usePageTitle as t } from "../lib/pageTitle.js";
1
+ import { usePageTitle as e } from "../lib/pageTitle.js";
2
+ import { usePathname as t } from "../lib/router.js";
3
3
  import { useCan as n } from "../lib/roles.js";
4
4
  import { useSettingsPages as r } from "./SettingsNav.js";
5
5
  import { Callout as i, PageHeader as a } from "@parallelworks/ui";
@@ -17,8 +17,8 @@ function f() {
17
17
  set: (t) => n(e(t))
18
18
  };
19
19
  }
20
- function p(t) {
21
- let n = l("settingsNav"), { workspace: i = "" } = o({ strict: !1 }), a = e(), s = r(), c = [{
20
+ function p(e) {
21
+ let n = l("settingsNav"), { workspace: i = "" } = o({ strict: !1 }), a = t(), s = r(), c = [{
22
22
  label: n("label"),
23
23
  href: `/${i}/settings`
24
24
  }], u;
@@ -30,14 +30,14 @@ function p(t) {
30
30
  href: n
31
31
  });
32
32
  }
33
- return u && (c.push({ label: u.group }), u.label !== t && c.push({
33
+ return u && (c.push({ label: u.group }), u.label !== e && c.push({
34
34
  label: u.label,
35
35
  href: u.href
36
- })), c.push({ label: t }), c;
36
+ })), c.push({ label: e }), c;
37
37
  }
38
- function m({ title: e, description: n, wide: r = !1, actions: i, toolbar: o, children: s }) {
39
- let c = p(e);
40
- return t(e, l("workspace")("settings")), /* @__PURE__ */ d("div", {
38
+ function m({ title: t, description: n, wide: r = !1, actions: i, toolbar: o, children: s }) {
39
+ let c = p(t);
40
+ return e(t, l("workspace")("settings")), /* @__PURE__ */ d("div", {
41
41
  className: "flex h-full min-h-0 flex-col",
42
42
  children: [/* @__PURE__ */ u(a, {
43
43
  breadcrumbs: c,
@@ -50,7 +50,7 @@ function m({ title: e, description: n, wide: r = !1, actions: i, toolbar: o, chi
50
50
  children: [
51
51
  /* @__PURE__ */ u("h1", {
52
52
  className: "min-w-0 flex-[1_1_6rem] text-xl font-semibold tracking-tight group-has-[input]/title:basis-auto",
53
- children: e
53
+ children: t
54
54
  }),
55
55
  o && /* @__PURE__ */ u("div", {
56
56
  className: "-my-1.5 ml-auto min-w-0 max-w-full max-sm:group-has-[input]/title:order-last max-sm:group-has-[input]/title:mt-2 max-sm:group-has-[input]/title:mb-0 max-sm:group-has-[input]/title:basis-full",
package/hostedApp.js CHANGED
@@ -1,73 +1,75 @@
1
- import { SharedUI as e } from "./components/SharedUI.js";
2
- import { loadMessages as t, locales as n } from "./_virtual/_virtual_i18n.js";
3
- import { HostProvider as r } from "./lib/host.js";
4
- import { setShownPath as i } from "./lib/listSearch.js";
5
- import { useRouter as a } from "@tanstack/react-router";
6
- import { use as o, useEffect as s, useRef as c } from "react";
7
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
8
- import { LocaleProvider as d, useSetLocale as f } from "@parallelworks/i18n/react";
9
- import { QueryClientProvider as p } from "@tanstack/react-query";
1
+ import { PageTitle as e } from "./lib/pageTitle.js";
2
+ import { SharedUI as t } from "./components/SharedUI.js";
3
+ import { loadMessages as n, locales as r } from "./_virtual/_virtual_i18n.js";
4
+ import { HostProvider as i } from "./lib/host.js";
5
+ import { setShownPath as a } from "./lib/listSearch.js";
6
+ import { useRouter as o } from "@tanstack/react-router";
7
+ import { use as s, useEffect as c, useRef as l } from "react";
8
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
9
+ import { LocaleProvider as f, useSetLocale as p } from "@parallelworks/i18n/react";
10
+ import { QueryClientProvider as m } from "@tanstack/react-query";
10
11
  // src/hostedApp.tsx
11
- function m({ host: t, queryClient: n, children: i }) {
12
- return /* @__PURE__ */ l(r, {
13
- host: t,
14
- children: /* @__PURE__ */ l(v, {
15
- locale: t.locale,
16
- children: /* @__PURE__ */ u(p, {
17
- client: n,
12
+ function h({ host: n, queryClient: r, children: a }) {
13
+ return /* @__PURE__ */ u(i, {
14
+ host: n,
15
+ children: /* @__PURE__ */ u(y, {
16
+ locale: n.locale,
17
+ children: /* @__PURE__ */ d(m, {
18
+ client: r,
18
19
  children: [
19
- /* @__PURE__ */ l(b, {
20
- identity: t.identity,
21
- queryClient: n
20
+ /* @__PURE__ */ u(x, {
21
+ identity: n.identity,
22
+ queryClient: r
22
23
  }),
23
- /* @__PURE__ */ l(x, {}),
24
- /* @__PURE__ */ l(S, {}),
25
- /* @__PURE__ */ l(e, { children: /* @__PURE__ */ l("div", {
24
+ /* @__PURE__ */ u(S, {}),
25
+ /* @__PURE__ */ u(C, {}),
26
+ /* @__PURE__ */ u(e, {}),
27
+ /* @__PURE__ */ u(t, { children: /* @__PURE__ */ u("div", {
26
28
  className: "tandem flex h-full min-h-0 flex-col",
27
- children: i
29
+ children: a
28
30
  }) })
29
31
  ]
30
32
  })
31
33
  })
32
34
  });
33
35
  }
34
- var h = /* @__PURE__ */ new Map();
35
- function g(e) {
36
- let n = h.get(e);
37
- return n || (n = t(e).catch(() => t("en")), h.set(e, n)), n;
36
+ var g = /* @__PURE__ */ new Map();
37
+ function _(e) {
38
+ let t = g.get(e);
39
+ return t || (t = n(e).catch(() => n("en")), g.set(e, t)), t;
38
40
  }
39
- var _ = (e) => n.includes(e) ? e : "en";
40
- function v({ locale: e, children: n }) {
41
- let r = c(_(e)), i = o(g(r.current));
42
- return /* @__PURE__ */ u(d, {
41
+ var v = (e) => r.includes(e) ? e : "en";
42
+ function y({ locale: e, children: t }) {
43
+ let r = l(v(e)), i = s(_(r.current));
44
+ return /* @__PURE__ */ d(f, {
43
45
  initial: {
44
46
  locale: r.current,
45
47
  messages: i
46
48
  },
47
- load: t,
49
+ load: n,
48
50
  fallbackLocale: "en",
49
- children: [/* @__PURE__ */ l(y, { locale: _(e) }), n]
51
+ children: [/* @__PURE__ */ u(b, { locale: v(e) }), t]
50
52
  });
51
53
  }
52
- function y({ locale: e }) {
53
- let t = f();
54
- return s(() => {
54
+ function b({ locale: e }) {
55
+ let t = p();
56
+ return c(() => {
55
57
  t(e);
56
58
  }, [e, t]), null;
57
59
  }
58
- function b({ identity: e, queryClient: t }) {
59
- let n = c(e);
60
- return s(() => {
60
+ function x({ identity: e, queryClient: t }) {
61
+ let n = l(e);
62
+ return c(() => {
61
63
  n.current !== e && t.clear(), n.current = e;
62
64
  }, [e, t]), null;
63
65
  }
64
- function x() {
65
- let e = a();
66
- return s(() => (i(e.state.location.pathname), e.subscribe("onResolved", ({ toLocation: e }) => i(e.pathname))), [e]), null;
67
- }
68
66
  function S() {
69
- return s(() => (document.body.dataset.tandem = "", () => {
67
+ let e = o();
68
+ return c(() => (a(e.state.location.pathname), e.subscribe("onResolved", ({ toLocation: e }) => a(e.pathname))), [e]), null;
69
+ }
70
+ function C() {
71
+ return c(() => (document.body.dataset.tandem = "", () => {
70
72
  delete document.body.dataset.tandem;
71
73
  }), []), null;
72
74
  }
73
- export { m as default };
75
+ export { h as default };
package/lib/pageTitle.js CHANGED
@@ -1,10 +1,22 @@
1
- import { useEffect as e } from "react";
2
- // src/lib/pageTitle.ts
3
- var t = typeof document > "u" ? "" : document.title;
4
- function n(...n) {
5
- let r = [...n.filter((e) => !!e), t].join(" · ");
6
- e(() => (document.title = r, () => {
7
- document.title = t;
8
- }), [r]);
9
- }
10
- export { n as usePageTitle };
1
+ import { useEffect as e, useSyncExternalStore as t } from "react";
2
+ import { jsx as n } from "react/jsx-runtime";
3
+ // src/lib/pageTitle.tsx
4
+ var r, i = /* @__PURE__ */ new Set();
5
+ function a(e) {
6
+ r = e;
7
+ for (let e of i) e();
8
+ }
9
+ function o(e) {
10
+ return i.add(e), () => {
11
+ i.delete(e);
12
+ };
13
+ }
14
+ function s(...t) {
15
+ let n = [...t.filter((e) => !!e), "Tandem"].join(" · ");
16
+ e(() => (a(n), () => a(void 0)), [n]);
17
+ }
18
+ function c() {
19
+ let e = t(o, () => r);
20
+ return e ? /* @__PURE__ */ n("title", { children: e }) : null;
21
+ }
22
+ export { c as PageTitle, s as usePageTitle };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parallelworks/tandem-web",
3
- "version": "0.139.0",
3
+ "version": "0.139.2",
4
4
  "description": "Tandem's pages, for a host app to render in its own",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",