@parallelworks/tandem-web 0.152.0 → 0.153.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.
@@ -3,195 +3,141 @@ import { api as t, unwrap as n } from "../api/client.js";
3
3
  import { shareLinksQuery as r } from "../api/queries.js";
4
4
  import { openShare as i, useShareTarget as a } from "../lib/share.js";
5
5
  import { useTime as o } from "../lib/time.js";
6
- import { Button as s, CopyButton as c, EmptyState as l, ErrorText as u, Input as d, Modal as f, ModalTitle as p, Select as m, Tooltip as h, useCopy as g } from "@parallelworks/ui";
7
- import { useState as _ } from "react";
8
- import { useErrorMessage as v } from "@parallelworks/problem/react";
9
- import { useTranslations as y } from "use-intl";
10
- import { jsx as b, jsxs as x } from "react/jsx-runtime";
11
- import { useMutation as S, useQuery as C, useQueryClient as w } from "@tanstack/react-query";
6
+ import { Button as s, CopyButton as c, EmptyState as l, ErrorText as u, Input as d, Modal as f, ModalTitle as p } from "@parallelworks/ui";
7
+ import { useState as m } from "react";
8
+ import { useErrorMessage as h } from "@parallelworks/problem/react";
9
+ import { useTranslations as g } from "use-intl";
10
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
11
+ import { useMutation as y, useQuery as b, useQueryClient as x } from "@tanstack/react-query";
12
12
  // src/components/ShareDialog.tsx
13
- function T({ workspace: e }) {
13
+ function S({ workspace: e }) {
14
14
  let t = a();
15
- return t ? /* @__PURE__ */ b(E, {
15
+ return t ? /* @__PURE__ */ _(C, {
16
16
  workspace: e,
17
17
  target: t,
18
18
  onClose: () => i(null)
19
19
  }, JSON.stringify(t)) : null;
20
20
  }
21
- function E({ workspace: i, target: a, onClose: T }) {
22
- let E = y("share"), D = v(), O = o(), k = w(), A = "doc" in a ? { doc: a.doc } : { space: a.space }, j = C(r(i, A)), [M, N] = _("organization"), [P, F] = _(""), I = (t) => e(`/sites/${i}/${t}`), [L, R] = _(), { copy: z } = g(), B = () => k.invalidateQueries({ queryKey: r(i, A).queryKey }), V = S({
21
+ function C({ workspace: i, target: a, onClose: S }) {
22
+ let C = g("share"), w = h(), T = o(), E = x(), D = "doc" in a ? { doc: a.doc } : { space: a.space }, O = b(r(i, D)), [k, A] = m(), j = () => E.invalidateQueries({ queryKey: r(i, D).queryKey }), M = y({
23
23
  mutationFn: async () => n(await t.POST("/api/v1/workspaces/{workspace}/share-links", {
24
24
  params: { path: { workspace: i } },
25
25
  body: {
26
- ...A,
27
- audience: M,
28
- ...M === "anyone" && P.trim() && { site: P.trim() }
26
+ ...D,
27
+ audience: "organization"
29
28
  }
30
29
  })),
31
- onSuccess: (t) => {
32
- R(t.site ? I(t.site) : e(`/share/${t.secret}`)), F("");
33
- },
34
- onSettled: B
35
- }), H = S({
30
+ onSuccess: (t) => A(e(`/share/${t.secret}`)),
31
+ onSettled: j
32
+ }), N = y({
36
33
  mutationFn: async (e) => n(await t.DELETE("/api/v1/workspaces/{workspace}/share-links/{link}", { params: { path: {
37
34
  workspace: i,
38
35
  link: e
39
36
  } } })),
40
- onSettled: B
41
- }), U = [{
42
- value: "organization",
43
- label: E("organization"),
44
- description: E("organizationHint")
45
- }, ...j.data?.publicSharing ? [{
46
- value: "anyone",
47
- label: E("anyone"),
48
- description: E("anyoneHint")
49
- }] : []];
50
- return /* @__PURE__ */ x(f, {
37
+ onSettled: j
38
+ });
39
+ return /* @__PURE__ */ v(f, {
51
40
  open: !0,
52
- onClose: T,
41
+ onClose: S,
53
42
  className: "max-h-[85vh] w-full max-w-lg overflow-y-auto p-5",
54
43
  children: [
55
- /* @__PURE__ */ b(p, {
44
+ /* @__PURE__ */ _(p, {
56
45
  className: "text-sm font-semibold",
57
- children: E("doc" in a ? "titleDoc" : "titleSpace", { title: a.title })
46
+ children: C("doc" in a ? "titleDoc" : "titleSpace", { title: a.title })
58
47
  }),
59
- /* @__PURE__ */ b("p", {
48
+ /* @__PURE__ */ _("p", {
60
49
  className: "mt-1 text-sm text-muted-foreground",
61
- children: E("doc" in a ? "descriptionDoc" : "descriptionSpace")
50
+ children: C("doc" in a ? "descriptionDoc" : "descriptionSpace")
62
51
  }),
63
- /* @__PURE__ */ x("div", {
64
- className: "mt-4 flex items-center gap-2",
65
- children: [/* @__PURE__ */ b(m, {
66
- value: M,
67
- items: U,
68
- onValueChange: N,
69
- "aria-label": E("audience"),
70
- width: "content"
71
- }), /* @__PURE__ */ b(s, {
52
+ /* @__PURE__ */ v("div", {
53
+ className: "mt-4 flex items-center gap-3",
54
+ children: [/* @__PURE__ */ v("p", {
55
+ className: "min-w-0 text-sm",
56
+ children: [C("organization"), /* @__PURE__ */ _("span", {
57
+ className: "block text-xs text-muted-foreground",
58
+ children: C("organizationHint")
59
+ })]
60
+ }), /* @__PURE__ */ _(s, {
72
61
  type: "button",
73
62
  variant: "primary",
74
- onClick: () => V.mutate(),
75
- loading: V.isPending,
63
+ onClick: () => M.mutate(),
64
+ loading: M.isPending,
76
65
  className: "ml-auto",
77
- children: E("create")
66
+ children: C("create")
78
67
  })]
79
68
  }),
80
- M === "anyone" && /* @__PURE__ */ x("label", {
81
- className: "mt-3 block",
82
- children: [
83
- /* @__PURE__ */ b("span", {
84
- className: "text-xs font-medium text-muted-foreground",
85
- children: E("site")
86
- }),
87
- /* @__PURE__ */ x("span", {
88
- className: "mt-1 flex items-center gap-2",
89
- children: [/* @__PURE__ */ b("span", {
90
- className: "shrink-0 font-mono text-xs text-muted-foreground",
91
- children: `/sites/${i}/`
92
- }), /* @__PURE__ */ b("input", {
93
- value: P,
94
- onChange: (e) => F(e.target.value.toLowerCase()),
95
- placeholder: E("siteName"),
96
- "aria-label": E("siteName"),
97
- pattern: "[a-z0-9][a-z0-9-]{0,62}",
98
- className: "h-8 min-w-0 flex-1 rounded-md border border-border bg-background px-2 font-mono text-xs"
99
- })]
100
- }),
101
- /* @__PURE__ */ b("span", {
102
- className: "mt-1 block text-xs text-muted-foreground",
103
- children: E("siteHint")
104
- })
105
- ]
106
- }),
107
- !j.data?.publicSharing && j.data && /* @__PURE__ */ b("p", {
108
- className: "mt-2 text-xs text-muted-foreground",
109
- children: E("anyoneOff")
110
- }),
111
- V.isError && /* @__PURE__ */ b(u, {
69
+ M.isError && /* @__PURE__ */ _(u, {
112
70
  size: "md",
113
71
  className: "mt-2",
114
- children: D(V.error)
72
+ children: w(M.error)
115
73
  }),
116
- L && /* @__PURE__ */ x("div", {
74
+ k && /* @__PURE__ */ v("div", {
117
75
  className: "mt-4 rounded-md border border-border p-3",
118
- children: [/* @__PURE__ */ b("p", {
76
+ children: [/* @__PURE__ */ _("p", {
119
77
  className: "text-xs text-muted-foreground",
120
- children: E(L.includes("/sites/") ? "published" : "onlyNow")
121
- }), /* @__PURE__ */ x("div", {
78
+ children: C("onlyNow")
79
+ }), /* @__PURE__ */ v("div", {
122
80
  className: "mt-2 flex items-center gap-2",
123
- children: [/* @__PURE__ */ b(d, {
81
+ children: [/* @__PURE__ */ _(d, {
124
82
  readOnly: !0,
125
83
  mono: !0,
126
- value: L,
127
- "aria-label": E("link"),
84
+ value: k,
85
+ "aria-label": C("link"),
128
86
  onFocus: (e) => e.currentTarget.select(),
129
87
  className: "min-w-0 flex-1"
130
- }), /* @__PURE__ */ b(c, {
131
- text: L,
132
- label: E("linkNoun"),
88
+ }), /* @__PURE__ */ _(c, {
89
+ text: k,
90
+ label: C("linkNoun"),
133
91
  showLabel: !0,
134
92
  variant: "secondary"
135
93
  })]
136
94
  })]
137
95
  }),
138
- /* @__PURE__ */ b("h3", {
96
+ /* @__PURE__ */ _("h3", {
139
97
  className: "mt-5 text-xs font-medium text-muted-foreground",
140
- children: E("links")
98
+ children: C("links")
141
99
  }),
142
- j.data && j.data.links.length === 0 ? /* @__PURE__ */ b(l, {
100
+ O.data && O.data.links.length === 0 ? /* @__PURE__ */ _(l, {
143
101
  variant: "bare",
144
- title: E("none"),
102
+ title: C("none"),
145
103
  className: "mt-2"
146
- }) : /* @__PURE__ */ b("ul", {
104
+ }) : /* @__PURE__ */ _("ul", {
147
105
  className: "mt-2 divide-y divide-border rounded-md border border-border",
148
- children: j.data?.links.map((e) => /* @__PURE__ */ x("li", {
106
+ children: O.data?.links.map((e) => /* @__PURE__ */ v("li", {
149
107
  className: "flex items-center gap-3 px-3 py-2 text-sm",
150
- children: [/* @__PURE__ */ x("span", {
108
+ children: [/* @__PURE__ */ v("span", {
151
109
  className: "min-w-0 flex-1",
152
- children: [
153
- E(e.audience),
154
- e.site && /* @__PURE__ */ b(h, {
155
- content: E("copy"),
156
- children: /* @__PURE__ */ b("button", {
157
- type: "button",
158
- onClick: () => z(I(e.site ?? ""), { label: E("linkNoun") }),
159
- className: "block max-w-full truncate font-mono text-xs text-primary hover:underline",
160
- children: `/sites/${i}/${e.site}`
161
- })
162
- }),
163
- /* @__PURE__ */ b("span", {
164
- className: "block text-xs text-muted-foreground",
165
- children: E("madeBy", {
166
- name: e.creator,
167
- when: O.relative(e.createdAt)
168
- })
110
+ children: [C("organization"), /* @__PURE__ */ _("span", {
111
+ className: "block text-xs text-muted-foreground",
112
+ children: C("madeBy", {
113
+ name: e.creator,
114
+ when: T.relative(e.createdAt)
169
115
  })
170
- ]
171
- }), /* @__PURE__ */ b(s, {
116
+ })]
117
+ }), /* @__PURE__ */ _(s, {
172
118
  type: "button",
173
119
  variant: "danger-outline",
174
120
  size: "sm",
175
- onClick: () => H.mutate(e.id),
176
- disabled: H.isPending,
177
- children: E("revoke")
121
+ onClick: () => N.mutate(e.id),
122
+ disabled: N.isPending,
123
+ children: C("revoke")
178
124
  })]
179
125
  }, e.id))
180
126
  }),
181
- H.isError && /* @__PURE__ */ b(u, {
127
+ N.isError && /* @__PURE__ */ _(u, {
182
128
  size: "md",
183
129
  className: "mt-2",
184
- children: D(H.error)
130
+ children: w(N.error)
185
131
  }),
186
- /* @__PURE__ */ b("div", {
132
+ /* @__PURE__ */ _("div", {
187
133
  className: "mt-5 flex justify-end",
188
- children: /* @__PURE__ */ b(s, {
134
+ children: /* @__PURE__ */ _(s, {
189
135
  type: "button",
190
- onClick: T,
191
- children: E("done")
136
+ onClick: S,
137
+ children: C("done")
192
138
  })
193
139
  })
194
140
  ]
195
141
  });
196
142
  }
197
- export { T as ShareDialogHost };
143
+ export { S as ShareDialogHost };
@@ -1,57 +1,50 @@
1
1
  import { ApiError as e } from "../api/client.js";
2
2
  import { Link as t, useNavigate as n } from "../lib/router.js";
3
- import { sharedDocQuery as r, sharedQuery as i, siteDocQuery as a, siteQuery as o, siteSearchQuery as s } from "../api/queries.js";
4
- import { docKey as c } from "../lib/docs.js";
5
- import { DocIcon as l } from "./DocIcon.js";
6
- import { Editor as u } from "./Editor.js";
7
- import { Logo as d } from "./Logo.js";
8
- import { DocOutline as f } from "./DocOutline.js";
9
- import { Disclosure as p, SearchInput as m, buttonClasses as h, cx as g } from "@parallelworks/ui";
10
- import { useEffect as _, useMemo as v, useRef as y, useState as b } from "react";
11
- import { useTranslations as x } from "use-intl";
12
- import { jsx as S, jsxs as C } from "react/jsx-runtime";
13
- import { keepPreviousData as w, useQuery as T } from "@tanstack/react-query";
3
+ import { sharedDocQuery as r, sharedQuery as i } from "../api/queries.js";
4
+ import { docKey as a } from "../lib/docs.js";
5
+ import { DocIcon as o } from "./DocIcon.js";
6
+ import { Editor as s } from "./Editor.js";
7
+ import { Logo as c } from "./Logo.js";
8
+ import { DocOutline as l } from "./DocOutline.js";
9
+ import { Disclosure as u, buttonClasses as d, cx as f } from "@parallelworks/ui";
10
+ import { useEffect as p, useMemo as m, useRef as h, useState as g } from "react";
11
+ import { useTranslations as _ } from "use-intl";
12
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
13
+ import { useQuery as b } from "@tanstack/react-query";
14
14
  // src/components/SharedViewer.tsx
15
- function E({ source: s, doc: m }) {
16
- let w = x("shared"), E = n(), D = T("secret" in s ? i(s.secret) : o(s.workspace, s.site)), A = D.data?.docs ?? [], j = m ?? D.data?.root ?? A[0]?.key, M = T({
17
- ..."secret" in s ? r(s.secret, j ?? "") : a(s.workspace, s.site, j ?? ""),
18
- enabled: !!j
19
- }), N = v(() => new Set(A.map((e) => e.key)), [A]), [P, F] = b(null), I = y(null);
20
- _(() => {
21
- j && I.current?.scrollTo({ top: 0 });
22
- }, [j]);
23
- let L = (e) => "secret" in s ? E({
15
+ function x({ source: x, doc: S }) {
16
+ let w = _("shared"), T = n(), E = b(i(x.secret)), D = E.data?.docs ?? [], O = S ?? E.data?.root ?? D[0]?.key, k = b({
17
+ ...r(x.secret, O ?? ""),
18
+ enabled: !!O
19
+ }), A = m(() => new Set(D.map((e) => e.key)), [D]), [j, M] = g(null), N = h(null);
20
+ p(() => {
21
+ O && N.current?.scrollTo({ top: 0 });
22
+ }, [O]);
23
+ let P = (e) => T({
24
24
  to: "/share/$secret",
25
- params: { secret: s.secret },
26
- search: { doc: e }
27
- }) : E({
28
- to: "/sites/$workspace/$site",
29
- params: {
30
- workspace: s.workspace,
31
- site: s.site
32
- },
25
+ params: { secret: x.secret },
33
26
  search: { doc: e }
34
27
  });
35
- if (D.error) {
36
- let n = D.error instanceof e && D.error.status === 401;
37
- return /* @__PURE__ */ S("main", {
28
+ if (E.error) {
29
+ let n = E.error instanceof e && E.error.status === 401;
30
+ return /* @__PURE__ */ v("main", {
38
31
  className: "flex min-h-screen items-center justify-center px-4",
39
- children: /* @__PURE__ */ C("div", {
32
+ children: /* @__PURE__ */ y("div", {
40
33
  className: "w-full max-w-sm",
41
34
  children: [
42
- /* @__PURE__ */ S(d, { className: "mb-10" }),
43
- /* @__PURE__ */ S("h1", {
35
+ /* @__PURE__ */ v(c, { className: "mb-10" }),
36
+ /* @__PURE__ */ v("h1", {
44
37
  className: "text-2xl font-semibold tracking-tight",
45
- children: w(n ? "signInTitle" : "site" in s ? "noSiteTitle" : "goneTitle")
38
+ children: w(n ? "signInTitle" : "goneTitle")
46
39
  }),
47
- /* @__PURE__ */ S("p", {
40
+ /* @__PURE__ */ v("p", {
48
41
  className: "mt-1 text-sm text-muted-foreground",
49
- children: w(n ? "signInDetail" : "site" in s ? "noSiteDetail" : "goneDetail")
42
+ children: w(n ? "signInDetail" : "goneDetail")
50
43
  }),
51
- n && /* @__PURE__ */ S(t, {
44
+ n && /* @__PURE__ */ v(t, {
52
45
  to: "/login",
53
46
  search: { next: window.location.href },
54
- className: g(h({
47
+ className: f(d({
55
48
  variant: "primary",
56
49
  size: "lg"
57
50
  }), "mt-6"),
@@ -61,88 +54,82 @@ function E({ source: s, doc: m }) {
61
54
  })
62
55
  });
63
56
  }
64
- return /* @__PURE__ */ C("div", {
57
+ return /* @__PURE__ */ y("div", {
65
58
  className: "flex h-screen flex-col",
66
59
  children: [
67
- /* @__PURE__ */ C("header", {
60
+ /* @__PURE__ */ y("header", {
68
61
  className: "flex h-12 shrink-0 items-center gap-3 border-b border-border px-4 md:px-5",
69
62
  children: [
70
- /* @__PURE__ */ S(d, { className: "h-5 max-sm:hidden" }),
71
- /* @__PURE__ */ S("span", {
63
+ /* @__PURE__ */ v(c, { className: "h-5 max-sm:hidden" }),
64
+ /* @__PURE__ */ v("span", {
72
65
  className: "truncate text-sm font-semibold",
73
- children: D.data?.title
66
+ children: E.data?.title
74
67
  }),
75
- /* @__PURE__ */ S("span", {
68
+ /* @__PURE__ */ v("span", {
76
69
  className: "truncate text-xs text-muted-foreground max-sm:hidden",
77
- children: D.data && D.data.title !== D.data.workspace && w("from", { workspace: D.data.workspace })
70
+ children: E.data && E.data.title !== E.data.workspace && w("from", { workspace: E.data.workspace })
78
71
  }),
79
- /* @__PURE__ */ C("span", {
80
- className: "ml-auto flex shrink-0 items-center gap-2",
81
- children: ["site" in s && /* @__PURE__ */ S(k, {
82
- source: s,
83
- onOpen: L
84
- }), /* @__PURE__ */ S("span", {
85
- className: "rounded border border-border px-1.5 py-0.5 text-[11px] text-muted-foreground",
86
- children: w("readOnly")
87
- })]
72
+ /* @__PURE__ */ v("span", {
73
+ className: "ml-auto shrink-0 rounded border border-border px-1.5 py-0.5 text-[11px] text-muted-foreground",
74
+ children: w("readOnly")
88
75
  })
89
76
  ]
90
77
  }),
91
- A.length > 1 && /* @__PURE__ */ S(p, {
78
+ D.length > 1 && /* @__PURE__ */ v(u, {
92
79
  className: "shrink-0 border-b border-border px-2 py-1 md:hidden",
93
80
  summaryClassName: "px-2 py-1 text-sm text-muted-foreground",
94
81
  summary: w("docs"),
95
- children: /* @__PURE__ */ S(O, {
96
- docs: A,
82
+ children: /* @__PURE__ */ v(C, {
83
+ docs: D,
97
84
  parent: "",
98
85
  depth: 0,
99
- current: j,
100
- source: s
86
+ current: O,
87
+ source: x
101
88
  })
102
89
  }),
103
- /* @__PURE__ */ C("div", {
90
+ /* @__PURE__ */ y("div", {
104
91
  className: "flex min-h-0 flex-1",
105
- children: [A.length > 1 && /* @__PURE__ */ S("nav", {
92
+ children: [D.length > 1 && /* @__PURE__ */ v("nav", {
106
93
  "aria-label": w("docs"),
107
94
  className: "w-64 shrink-0 overflow-y-auto border-r border-border p-2 max-md:hidden",
108
- children: /* @__PURE__ */ S(O, {
109
- docs: A,
95
+ children: /* @__PURE__ */ v(C, {
96
+ docs: D,
110
97
  parent: "",
111
98
  depth: 0,
112
- current: j,
113
- source: s
99
+ current: O,
100
+ source: x
114
101
  })
115
- }), /* @__PURE__ */ S("main", {
116
- ref: I,
102
+ }), /* @__PURE__ */ v("main", {
103
+ ref: N,
117
104
  className: "min-w-0 flex-1 overflow-y-auto",
118
- children: /* @__PURE__ */ C("div", {
105
+ children: /* @__PURE__ */ y("div", {
119
106
  className: "flex w-full gap-10 px-4 py-6 md:px-8",
120
- children: [/* @__PURE__ */ C("article", {
107
+ children: [/* @__PURE__ */ y("article", {
121
108
  onClickCapture: (e) => {
122
- let t = e.target.closest("a")?.getAttribute("href") ?? "", n = /\/docs\/([A-Za-z0-9-]+)/.exec(t)?.[1], r = n && c(n);
123
- r && N.has(r) && (e.preventDefault(), L(r));
109
+ let t = e.target.closest("a")?.getAttribute("href") ?? "", n = /\/docs\/([A-Za-z0-9-]+)/.exec(t)?.[1], r = n && a(n);
110
+ r && A.has(r) && (e.preventDefault(), P(r));
124
111
  },
125
112
  className: "mx-auto min-w-0 max-w-3xl flex-1 pb-24",
126
113
  children: [
127
- M.data?.icon && /* @__PURE__ */ S(l, {
128
- icon: M.data.icon,
114
+ k.data?.icon && /* @__PURE__ */ v(o, {
115
+ icon: k.data.icon,
129
116
  className: "mb-2 size-12",
130
117
  emojiClassName: "text-4xl"
131
118
  }),
132
- /* @__PURE__ */ S("h1", {
119
+ /* @__PURE__ */ v("h1", {
133
120
  className: "text-2xl font-semibold tracking-tight",
134
- children: M.data?.title
121
+ children: k.data?.title
135
122
  }),
136
- M.data && /* @__PURE__ */ S(u, {
137
- value: M.data.body ?? "",
123
+ k.data && /* @__PURE__ */ v(s, {
124
+ value: k.data.body ?? "",
138
125
  editable: !1,
139
- onEditor: F,
126
+ onEditor: M,
140
127
  className: "mt-4"
141
- }, M.data.key)
128
+ }, k.data.key)
142
129
  ]
143
- }), /* @__PURE__ */ S(f, {
144
- editor: P,
145
- scroller: I
130
+ }), /* @__PURE__ */ v(l, {
131
+ editor: j,
132
+ scroller: N
146
133
  })]
147
134
  })
148
135
  })]
@@ -150,48 +137,38 @@ function E({ source: s, doc: m }) {
150
137
  ]
151
138
  });
152
139
  }
153
- function D({ source: e, doc: n, current: r, children: i }) {
154
- let a = r ? "page" : void 0, o = "flex items-center gap-2 rounded-md py-1 pr-2 text-sm text-muted-foreground hover:bg-muted hover:text-foreground aria-[current=page]:bg-muted aria-[current=page]:font-medium aria-[current=page]:text-foreground";
155
- return "secret" in e ? /* @__PURE__ */ S(t, {
140
+ function S({ source: e, doc: n, current: r, children: i }) {
141
+ let a = r ? "page" : void 0;
142
+ return /* @__PURE__ */ v(t, {
156
143
  to: "/share/$secret",
157
144
  params: { secret: e.secret },
158
145
  search: { doc: n },
159
146
  "aria-current": a,
160
- className: o,
161
- children: i
162
- }) : /* @__PURE__ */ S(t, {
163
- to: "/sites/$workspace/$site",
164
- params: {
165
- workspace: e.workspace,
166
- site: e.site
167
- },
168
- search: { doc: n },
169
- "aria-current": a,
170
- className: o,
147
+ className: "flex items-center gap-2 rounded-md py-1 pr-2 text-sm text-muted-foreground hover:bg-muted hover:text-foreground aria-[current=page]:bg-muted aria-[current=page]:font-medium aria-[current=page]:text-foreground",
171
148
  children: i
172
149
  });
173
150
  }
174
- function O({ docs: e, parent: t, depth: n, current: r, source: i }) {
151
+ function C({ docs: e, parent: t, depth: n, current: r, source: i }) {
175
152
  let a = e.filter((e) => (e.parent ?? "") === t);
176
- return a.length === 0 ? null : /* @__PURE__ */ S("ul", {
153
+ return a.length === 0 ? null : /* @__PURE__ */ v("ul", {
177
154
  className: "space-y-px",
178
- children: a.map((t) => /* @__PURE__ */ C("li", { children: [/* @__PURE__ */ S(D, {
155
+ children: a.map((t) => /* @__PURE__ */ y("li", { children: [/* @__PURE__ */ v(S, {
179
156
  source: i,
180
157
  doc: t.key,
181
158
  current: t.key === r,
182
- children: /* @__PURE__ */ C("span", {
159
+ children: /* @__PURE__ */ y("span", {
183
160
  style: { paddingLeft: `${.5 + n * .75}rem` },
184
161
  className: "flex min-w-0 items-center gap-2",
185
- children: [/* @__PURE__ */ S(l, {
162
+ children: [/* @__PURE__ */ v(o, {
186
163
  icon: t.icon,
187
164
  className: "size-3.5",
188
165
  emojiClassName: "text-xs"
189
- }), /* @__PURE__ */ S("span", {
166
+ }), /* @__PURE__ */ v("span", {
190
167
  className: "truncate",
191
168
  children: t.title
192
169
  })]
193
170
  })
194
- }), /* @__PURE__ */ S(O, {
171
+ }), /* @__PURE__ */ v(C, {
195
172
  docs: e,
196
173
  parent: t.key,
197
174
  depth: n + 1,
@@ -200,54 +177,4 @@ function O({ docs: e, parent: t, depth: n, current: r, source: i }) {
200
177
  })] }, t.key))
201
178
  });
202
179
  }
203
- function k({ source: e, onOpen: t }) {
204
- let n = x("shared"), [r, i] = b(""), [a, o] = b("");
205
- _(() => {
206
- let e = setTimeout(() => o(r.trim()), 200);
207
- return () => clearTimeout(e);
208
- }, [r]);
209
- let { data: c } = T({
210
- ...s(e.workspace, e.site, a),
211
- enabled: a !== "",
212
- placeholderData: w
213
- }), l = a ? c?.docs ?? [] : [];
214
- return /* @__PURE__ */ C("div", {
215
- className: "relative",
216
- children: [/* @__PURE__ */ S(m, {
217
- value: r,
218
- onValueChange: i,
219
- placeholder: n("search"),
220
- label: n("search"),
221
- size: "sm",
222
- className: "w-56 max-sm:w-40"
223
- }), a && /* @__PURE__ */ S("ul", {
224
- "aria-label": n("results"),
225
- className: "absolute right-0 z-20 mt-1 max-h-96 w-96 overflow-y-auto rounded-md border border-border bg-background p-1 shadow-md max-sm:w-72",
226
- children: l.length === 0 ? /* @__PURE__ */ S("li", {
227
- className: "px-2 py-2 text-sm text-muted-foreground",
228
- children: n("noResults")
229
- }) : l.map((e) => /* @__PURE__ */ S("li", { children: /* @__PURE__ */ C("button", {
230
- type: "button",
231
- onClick: () => {
232
- i(""), t(e.key);
233
- },
234
- className: "block w-full rounded px-2 py-1.5 text-left hover:bg-muted",
235
- children: [/* @__PURE__ */ S("span", {
236
- className: "block text-sm font-medium",
237
- children: e.title
238
- }), /* @__PURE__ */ S(A, { text: e.snippet })]
239
- }) }, e.key))
240
- })]
241
- });
242
- }
243
- function A({ text: e }) {
244
- let t = e.split("**");
245
- return /* @__PURE__ */ S("span", {
246
- className: "mt-0.5 line-clamp-2 block text-xs text-muted-foreground",
247
- children: t.map((e, t) => t % 2 == 1 ? /* @__PURE__ */ S("mark", {
248
- className: "bg-transparent font-semibold text-foreground",
249
- children: e
250
- }, t) : /* @__PURE__ */ S("span", { children: e }, t))
251
- });
252
- }
253
- export { E as SharedViewer };
180
+ export { x as SharedViewer };
package/lib/issueList.js CHANGED
@@ -48,7 +48,7 @@ function g(e) {
48
48
  }
49
49
  t.assignee && e.assigneeKind === "agent" && (t.assigneeKind = "agent"), (e.overdue === "true" || e.overdue === !0) && (t.overdue = "true");
50
50
  let i = h(e.order);
51
- i && i !== "updated" && (d.includes(i) || n(i)) && (t.order = i), e.layout === "board" && (t.layout = "board");
51
+ i && i !== "updated" && (d.includes(i) || n(i)) && (t.order = i), e.layout === "board" && (t.layout = "board"), e.scope === "workspace" && (t.scope = "workspace");
52
52
  let a = h(e.group);
53
53
  return a && a !== "status" && (f.includes(a) || n(a)) && (t.group = a), t;
54
54
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parallelworks/tandem-web",
3
- "version": "0.152.0",
3
+ "version": "0.153.0",
4
4
  "description": "Tandem's pages, for a host app to render in its own",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
package/pages/issues.js CHANGED
@@ -209,7 +209,7 @@ function _({ person: e } = {}) {
209
209
  }, []), l(() => {
210
210
  document.getElementById(`row-${V?.id}`)?.scrollIntoView({ block: "nearest" });
211
211
  }, [V]);
212
- let K = w.find((e) => e.key === x.team), q = Ue(v, x, (e) => S(We(x, e), !0), !!y && !x.assignee && !x.creator && !x.saved), _n = Ie(v, { ...o(x, "q", void 0) }), { views: vn, create: yn, update: bn } = Be(v), J = vn.find((e) => Ee(e, x.saved)), { data: xn } = g(te(v)), { data: Sn } = g(re(v)), { data: Cn } = g({
212
+ let K = w.find((e) => e.key === x.team), q = Ue(v, x, (e) => S(We(x, e), !0), !!y && !x.assignee && !x.creator && !x.saved && !x.scope), _n = Ie(v, { ...o(x, "q", void 0) }), { views: vn, create: yn, update: bn } = Be(v), J = vn.find((e) => Ee(e, x.saved)), { data: xn } = g(te(v)), { data: Sn } = g(re(v)), { data: Cn } = g({
213
213
  ...i(v, K?.key ?? ""),
214
214
  enabled: !!K
215
215
  });