@parallelworks/tandem-web 0.178.1 → 0.179.0

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,23 +1,22 @@
1
- import { kinds as e, statuses as t } from "./graph.js";
2
- import { rememberSearch as n } from "../../lib/listSearch.js";
3
- import { redirect as r } from "../../lib/router.js";
4
- import { createFileRoute as i, lazyFn as a, lazyRouteComponent as o } from "@tanstack/react-router";
1
+ import { kinds as e } from "./graph.js";
2
+ import { rememberSearch as t } from "../../lib/listSearch.js";
3
+ import { redirect as n } from "../../lib/router.js";
4
+ import { createFileRoute as r, lazyFn as i, lazyRouteComponent as a } from "@tanstack/react-router";
5
5
  // src/routes/$workspace/graph.tsx
6
- var s = () => import("./graph3.js"), c = () => import("./graph4.js"), l = (e, t) => {
6
+ var o = () => import("./graph3.js"), s = () => import("./graph4.js"), c = (e, t) => {
7
7
  let n = (Array.isArray(e) ? e : typeof e == "string" ? e.split(",") : []).filter((e) => t.includes(e));
8
8
  return n.length ? n : void 0;
9
- }, u = i("/$workspace/graph")({
10
- validateSearch: (n) => {
11
- let r = l(n.kind, e), i = l(n.status, t);
9
+ }, l = r("/$workspace/graph")({
10
+ validateSearch: (t) => {
11
+ let n = c(t.kind, e);
12
12
  return {
13
- ...typeof n.space == "string" && { space: n.space },
14
- ...r && { kind: r },
15
- ...i && { status: i }
13
+ ...typeof t.space == "string" && { space: t.space },
14
+ ...n && { kind: n }
16
15
  };
17
16
  },
18
- beforeLoad: ({ params: e, search: t, location: i, preload: a }) => {
19
- let o = n(i.pathname, t, a);
20
- if (o) throw r({
17
+ beforeLoad: ({ params: e, search: r, location: i, preload: a }) => {
18
+ let o = t(i.pathname, r, a);
19
+ if (o) throw n({
21
20
  to: "/$workspace/graph",
22
21
  params: e,
23
22
  search: o,
@@ -25,7 +24,7 @@ var s = () => import("./graph3.js"), c = () => import("./graph4.js"), l = (e, t)
25
24
  });
26
25
  },
27
26
  loaderDeps: ({ search: e }) => e,
28
- loader: a(c, "loader"),
29
- component: o(s, "component")
27
+ loader: i(s, "loader"),
28
+ component: a(o, "component")
30
29
  });
31
- export { u as Route };
30
+ export { l as Route };
@@ -1,113 +1,101 @@
1
- import { kinds as e, statuses as t } from "./graph.js";
2
- import { teamsQuery as n, workspaceGraphQuery as r, workspaceQuery as i } from "../../api/queries.js";
3
- import { GraphDrawing as a, GraphList as o } from "../../components/Graph.js";
4
- import { usePageTitle as s } from "../../lib/pageTitle.js";
5
- import { Route as c } from "./graph2.js";
6
- import { Disclosure as l, EmptyState as u, ToggleGroup as d } from "@parallelworks/ui";
7
- import { useEffect as f, useRef as p, useState as m } from "react";
8
- import { useTranslations as h } from "use-intl";
9
- import { jsx as g, jsxs as _ } from "react/jsx-runtime";
10
- import { useQuery as v, useSuspenseQuery as y } from "@tanstack/react-query";
1
+ import { kinds as e } from "./graph.js";
2
+ import { teamsQuery as t, workspaceGraphQuery as n, workspaceQuery as r } from "../../api/queries.js";
3
+ import { GraphDrawing as i, GraphList as a } from "../../components/Graph.js";
4
+ import { usePageTitle as o } from "../../lib/pageTitle.js";
5
+ import { Route as s } from "./graph2.js";
6
+ import { Disclosure as c, EmptyState as l, ToggleGroup as u } from "@parallelworks/ui";
7
+ import { useEffect as d, useRef as f, useState as p } from "react";
8
+ import { useTranslations as m } from "use-intl";
9
+ import { jsx as h, jsxs as g } from "react/jsx-runtime";
10
+ import { useQuery as _, useSuspenseQuery as v } from "@tanstack/react-query";
11
11
  // src/routes/$workspace/graph.tsx?tsr-split=component
12
- function b() {
13
- let b = h("graphPage");
14
- s(b("title"));
15
- let x = h("graph"), S = h("knowledge.status"), { workspace: C } = c.useParams(), w = c.useSearch(), T = c.useNavigate(), { data: E } = y(n(C)), { data: D } = y(i(C)), { data: O } = v(r(C, w)), k = (e) => T({
12
+ function y() {
13
+ let y = m("graphPage");
14
+ o(y("title"));
15
+ let b = m("graph"), { workspace: x } = s.useParams(), S = s.useSearch(), C = s.useNavigate(), { data: w } = v(t(x)), { data: T } = v(r(x)), { data: E } = _(n(x, S)), D = (e) => C({
16
16
  search: (t) => ({
17
17
  ...t,
18
18
  ...e
19
19
  }),
20
20
  replace: !0
21
- }), A = p(null), [j, M] = m(800);
22
- f(() => {
23
- let e = A.current;
21
+ }), O = f(null), [k, A] = p(800);
22
+ d(() => {
23
+ let e = O.current;
24
24
  if (!e) return;
25
- let t = new ResizeObserver(([e]) => e && M(Math.floor(e.contentRect.width)));
25
+ let t = new ResizeObserver(([e]) => e && A(Math.floor(e.contentRect.width)));
26
26
  return t.observe(e), () => t.disconnect();
27
27
  }, []);
28
- let N = O?.nodes ?? [], P = {
29
- doc: x("docs"),
30
- issue: x("issues"),
31
- entry: x("entries")
28
+ let j = E?.nodes ?? [], M = {
29
+ doc: b("docs"),
30
+ issue: b("issues"),
31
+ entry: b("entries")
32
32
  };
33
- return /* @__PURE__ */ _("div", {
33
+ return /* @__PURE__ */ g("div", {
34
34
  className: "flex h-full flex-col",
35
35
  children: [
36
- /* @__PURE__ */ _("header", {
36
+ /* @__PURE__ */ g("header", {
37
37
  className: "flex h-12 shrink-0 items-center gap-3 border-b border-border px-4 md:px-5",
38
- children: [/* @__PURE__ */ g("h1", {
38
+ children: [/* @__PURE__ */ h("h1", {
39
39
  className: "text-sm font-semibold",
40
- children: b("title")
41
- }), /* @__PURE__ */ g("span", {
40
+ children: y("title")
41
+ }), /* @__PURE__ */ h("span", {
42
42
  className: "text-xs text-muted-foreground",
43
- children: b("count", { count: N.length })
43
+ children: y("count", { count: j.length })
44
44
  })]
45
45
  }),
46
- /* @__PURE__ */ _("div", {
46
+ /* @__PURE__ */ g("div", {
47
47
  className: "flex shrink-0 flex-wrap gap-x-4 gap-y-2 border-b border-border px-4 py-2 md:px-5",
48
- children: [
49
- /* @__PURE__ */ g(d, {
50
- label: b("space"),
51
- multiple: !1,
52
- all: !0,
53
- options: [{
54
- value: "workspace",
55
- label: D.name
56
- }, ...E.filter((e) => !e.archivedAt).map((e) => ({
57
- value: e.key,
58
- label: e.name
59
- }))],
60
- value: w.space ? [w.space] : [],
61
- onValueChange: ([e]) => k({ space: e })
62
- }),
63
- /* @__PURE__ */ g(d, {
64
- label: b("kind"),
65
- options: e.map((e) => ({
66
- value: e,
67
- label: P[e]
68
- })),
69
- value: w.kind ?? [],
70
- onValueChange: (e) => k({ kind: e.length ? e : void 0 })
71
- }),
72
- (!w.kind || w.kind.includes("entry")) && /* @__PURE__ */ g(d, {
73
- label: b("status"),
74
- options: t.map((e) => ({
75
- value: e,
76
- label: S(e)
77
- })),
78
- value: w.status ?? [],
79
- onValueChange: (e) => k({ status: e.length ? e : void 0 })
80
- })
81
- ]
48
+ children: [/* @__PURE__ */ h(u, {
49
+ label: y("space"),
50
+ multiple: !1,
51
+ all: !0,
52
+ options: [{
53
+ value: "workspace",
54
+ label: T.name
55
+ }, ...w.filter((e) => !e.archivedAt).map((e) => ({
56
+ value: e.key,
57
+ label: e.name
58
+ }))],
59
+ value: S.space ? [S.space] : [],
60
+ onValueChange: ([e]) => D({ space: e })
61
+ }), /* @__PURE__ */ h(u, {
62
+ label: y("kind"),
63
+ options: e.map((e) => ({
64
+ value: e,
65
+ label: M[e]
66
+ })),
67
+ value: S.kind ?? [],
68
+ onValueChange: (e) => D({ kind: e.length ? e : void 0 })
69
+ })]
82
70
  }),
83
- /* @__PURE__ */ g("div", {
71
+ /* @__PURE__ */ h("div", {
84
72
  className: "min-h-0 flex-1 overflow-y-auto",
85
- children: /* @__PURE__ */ _("div", {
86
- ref: A,
73
+ children: /* @__PURE__ */ g("div", {
74
+ ref: O,
87
75
  className: "px-4 md:px-5",
88
76
  children: [
89
- O && N.length === 0 ? /* @__PURE__ */ g(u, {
77
+ E && j.length === 0 ? /* @__PURE__ */ h(l, {
90
78
  variant: "plain",
91
- title: b("empty")
92
- }) : O && /* @__PURE__ */ g(a, {
93
- workspace: C,
94
- nodes: N,
95
- edges: O.edges,
96
- width: j,
79
+ title: y("empty")
80
+ }) : E && /* @__PURE__ */ h(i, {
81
+ workspace: x,
82
+ nodes: j,
83
+ edges: E.edges,
84
+ width: k,
97
85
  height: "calc(100dvh - 11rem)"
98
86
  }),
99
- O?.truncated && /* @__PURE__ */ g("p", {
87
+ E?.truncated && /* @__PURE__ */ h("p", {
100
88
  className: "px-2 pt-2 text-xs text-muted-foreground",
101
- children: b("truncated")
89
+ children: y("truncated")
102
90
  }),
103
- N.length > 0 && /* @__PURE__ */ g(l, {
91
+ j.length > 0 && /* @__PURE__ */ h(c, {
104
92
  className: "mt-4 mb-8",
105
93
  summaryClassName: "px-2 text-sm text-muted-foreground hover:text-foreground",
106
- summary: b("asList", { count: N.length }),
107
- children: /* @__PURE__ */ g(o, {
108
- workspace: C,
109
- nodes: N,
110
- label: b("title")
94
+ summary: y("asList", { count: j.length }),
95
+ children: /* @__PURE__ */ h(a, {
96
+ workspace: x,
97
+ nodes: j,
98
+ label: y("title")
111
99
  })
112
100
  })
113
101
  ]
@@ -116,4 +104,4 @@ function b() {
116
104
  ]
117
105
  });
118
106
  }
119
- export { b as component };
107
+ export { y as component };