@parallelworks/tandem-web 0.175.3 → 0.176.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.
- package/_virtual/_virtual_i18n/en/common.js +16 -2
- package/_virtual/_virtual_i18n/es/common.js +16 -2
- package/_virtual/_virtual_i18n/ja/common.js +16 -2
- package/_virtual/_virtual_i18n/ko/common.js +16 -2
- package/_virtual/_virtual_i18n/zh/common.js +16 -2
- package/components/DocCalendar.js +213 -0
- package/components/DocTable.js +70 -63
- package/components/IssueCode.js +10 -11
- package/lib/docProperties.js +1 -1
- package/package.json +1 -1
- package/routes/_workspace/docs/_doc2.js +155 -140
- package/routes/_workspace/docs/space2._space.js +178 -128
- package/routes/_workspace/issues/_identifier2.js +2 -2
|
@@ -1383,7 +1383,20 @@ var e = {
|
|
|
1383
1383
|
filterBy: "Filter by {property}",
|
|
1384
1384
|
openTable: "Open as table",
|
|
1385
1385
|
embedPick: "Pick a saved view to show",
|
|
1386
|
-
open: "Open"
|
|
1386
|
+
open: "Open",
|
|
1387
|
+
calendar: "Calendar",
|
|
1388
|
+
pickDate: "Add a date property to put docs on the calendar.",
|
|
1389
|
+
meetingTitle: "Meeting notes: {date}",
|
|
1390
|
+
newMeetingOn: "New meeting notes on {date}",
|
|
1391
|
+
today: "Today",
|
|
1392
|
+
previousMonth: "Previous month",
|
|
1393
|
+
nextMonth: "Next month",
|
|
1394
|
+
previousWeek: "Previous week",
|
|
1395
|
+
nextWeek: "Next week",
|
|
1396
|
+
dateProperty: "Date property",
|
|
1397
|
+
dateName: "Date",
|
|
1398
|
+
addDate: "Add a date property",
|
|
1399
|
+
newMeeting: "New meeting notes"
|
|
1387
1400
|
},
|
|
1388
1401
|
docs: {
|
|
1389
1402
|
spaceDefault: "Start new docs in this space from it",
|
|
@@ -1499,7 +1512,8 @@ var e = {
|
|
|
1499
1512
|
upload: "Upload",
|
|
1500
1513
|
uploadHint: "A square picture, cropped like a team’s or project’s icon.",
|
|
1501
1514
|
uploadPicture: "Upload a picture"
|
|
1502
|
-
}
|
|
1515
|
+
},
|
|
1516
|
+
createIssueFromActionItem: "Create issue from action item"
|
|
1503
1517
|
},
|
|
1504
1518
|
docLinks: {
|
|
1505
1519
|
label: "Link a doc, issue or project",
|
|
@@ -1383,7 +1383,20 @@ var e = {
|
|
|
1383
1383
|
filterBy: "Filtrar por {property}",
|
|
1384
1384
|
openTable: "Abrir como tabla",
|
|
1385
1385
|
embedPick: "Elige una vista guardada para mostrar",
|
|
1386
|
-
open: "Abrir"
|
|
1386
|
+
open: "Abrir",
|
|
1387
|
+
calendar: "Calendario",
|
|
1388
|
+
pickDate: "Añade una propiedad de fecha para poner los documentos en el calendario.",
|
|
1389
|
+
meetingTitle: "Notas de reunión: {date}",
|
|
1390
|
+
newMeetingOn: "Nuevas notas de reunión el {date}",
|
|
1391
|
+
today: "Hoy",
|
|
1392
|
+
previousMonth: "Mes anterior",
|
|
1393
|
+
nextMonth: "Mes siguiente",
|
|
1394
|
+
previousWeek: "Semana anterior",
|
|
1395
|
+
nextWeek: "Semana siguiente",
|
|
1396
|
+
dateProperty: "Propiedad de fecha",
|
|
1397
|
+
dateName: "Fecha",
|
|
1398
|
+
addDate: "Añadir una propiedad de fecha",
|
|
1399
|
+
newMeeting: "Nuevas notas de reunión"
|
|
1387
1400
|
},
|
|
1388
1401
|
docs: {
|
|
1389
1402
|
spaceDefault: "Empezar los documentos nuevos de este espacio con ella",
|
|
@@ -1499,7 +1512,8 @@ var e = {
|
|
|
1499
1512
|
upload: "Subir",
|
|
1500
1513
|
uploadHint: "Una imagen cuadrada, recortada como el icono de un equipo o proyecto.",
|
|
1501
1514
|
uploadPicture: "Subir una imagen"
|
|
1502
|
-
}
|
|
1515
|
+
},
|
|
1516
|
+
createIssueFromActionItem: "Crear incidencia desde la tarea"
|
|
1503
1517
|
},
|
|
1504
1518
|
docLinks: {
|
|
1505
1519
|
label: "Enlazar un documento, incidencia o proyecto",
|
|
@@ -1383,7 +1383,20 @@ var e = {
|
|
|
1383
1383
|
filterBy: "{property} で絞り込み",
|
|
1384
1384
|
openTable: "表で開く",
|
|
1385
1385
|
embedPick: "表示する保存済みビューを選択",
|
|
1386
|
-
open: "開く"
|
|
1386
|
+
open: "開く",
|
|
1387
|
+
calendar: "カレンダー",
|
|
1388
|
+
pickDate: "ドキュメントをカレンダーに表示するには日付プロパティを追加してください。",
|
|
1389
|
+
meetingTitle: "議事録: {date}",
|
|
1390
|
+
newMeetingOn: "{date} の議事録を作成",
|
|
1391
|
+
today: "今日",
|
|
1392
|
+
previousMonth: "前の月",
|
|
1393
|
+
nextMonth: "次の月",
|
|
1394
|
+
previousWeek: "前の週",
|
|
1395
|
+
nextWeek: "次の週",
|
|
1396
|
+
dateProperty: "日付プロパティ",
|
|
1397
|
+
dateName: "日付",
|
|
1398
|
+
addDate: "日付プロパティを追加",
|
|
1399
|
+
newMeeting: "議事録を作成"
|
|
1387
1400
|
},
|
|
1388
1401
|
docs: {
|
|
1389
1402
|
spaceDefault: "このスペースの新しいドキュメントに使う",
|
|
@@ -1499,7 +1512,8 @@ var e = {
|
|
|
1499
1512
|
upload: "アップロード",
|
|
1500
1513
|
uploadHint: "チームやプロジェクトのアイコンと同じように切り抜いた正方形の画像。",
|
|
1501
1514
|
uploadPicture: "画像をアップロード"
|
|
1502
|
-
}
|
|
1515
|
+
},
|
|
1516
|
+
createIssueFromActionItem: "アクションアイテムから課題を作成"
|
|
1503
1517
|
},
|
|
1504
1518
|
docLinks: {
|
|
1505
1519
|
label: "ドキュメント、課題、プロジェクトをリンク",
|
|
@@ -1383,7 +1383,20 @@ var e = {
|
|
|
1383
1383
|
filterBy: "{property}(으)로 필터",
|
|
1384
1384
|
openTable: "표로 열기",
|
|
1385
1385
|
embedPick: "보여 줄 저장된 보기를 고르세요",
|
|
1386
|
-
open: "열기"
|
|
1386
|
+
open: "열기",
|
|
1387
|
+
calendar: "캘린더",
|
|
1388
|
+
pickDate: "문서를 캘린더에 표시하려면 날짜 속성을 추가하세요.",
|
|
1389
|
+
meetingTitle: "회의록: {date}",
|
|
1390
|
+
newMeetingOn: "{date} 회의록 만들기",
|
|
1391
|
+
today: "오늘",
|
|
1392
|
+
previousMonth: "이전 달",
|
|
1393
|
+
nextMonth: "다음 달",
|
|
1394
|
+
previousWeek: "이전 주",
|
|
1395
|
+
nextWeek: "다음 주",
|
|
1396
|
+
dateProperty: "날짜 속성",
|
|
1397
|
+
dateName: "날짜",
|
|
1398
|
+
addDate: "날짜 속성 추가",
|
|
1399
|
+
newMeeting: "새 회의록"
|
|
1387
1400
|
},
|
|
1388
1401
|
docs: {
|
|
1389
1402
|
spaceDefault: "이 스페이스의 새 문서에 사용",
|
|
@@ -1499,7 +1512,8 @@ var e = {
|
|
|
1499
1512
|
upload: "업로드",
|
|
1500
1513
|
uploadHint: "팀이나 프로젝트 아이콘처럼 자른 정사각형 그림입니다.",
|
|
1501
1514
|
uploadPicture: "그림 업로드"
|
|
1502
|
-
}
|
|
1515
|
+
},
|
|
1516
|
+
createIssueFromActionItem: "작업 항목으로 이슈 만들기"
|
|
1503
1517
|
},
|
|
1504
1518
|
docLinks: {
|
|
1505
1519
|
label: "문서, 이슈 또는 프로젝트 링크",
|
|
@@ -1383,7 +1383,20 @@ var e = {
|
|
|
1383
1383
|
filterBy: "按{property}筛选",
|
|
1384
1384
|
openTable: "以表格打开",
|
|
1385
1385
|
embedPick: "选择要显示的已保存视图",
|
|
1386
|
-
open: "打开"
|
|
1386
|
+
open: "打开",
|
|
1387
|
+
calendar: "日历",
|
|
1388
|
+
pickDate: "添加日期属性即可在日历上显示文档。",
|
|
1389
|
+
meetingTitle: "会议记录:{date}",
|
|
1390
|
+
newMeetingOn: "在 {date} 新建会议记录",
|
|
1391
|
+
today: "今天",
|
|
1392
|
+
previousMonth: "上个月",
|
|
1393
|
+
nextMonth: "下个月",
|
|
1394
|
+
previousWeek: "上一周",
|
|
1395
|
+
nextWeek: "下一周",
|
|
1396
|
+
dateProperty: "日期属性",
|
|
1397
|
+
dateName: "日期",
|
|
1398
|
+
addDate: "添加日期属性",
|
|
1399
|
+
newMeeting: "新建会议记录"
|
|
1387
1400
|
},
|
|
1388
1401
|
docs: {
|
|
1389
1402
|
spaceDefault: "此空间的新文档从它开始",
|
|
@@ -1499,7 +1512,8 @@ var e = {
|
|
|
1499
1512
|
upload: "上传",
|
|
1500
1513
|
uploadHint: "一张方形图片,像团队或项目图标一样裁剪。",
|
|
1501
1514
|
uploadPicture: "上传图片"
|
|
1502
|
-
}
|
|
1515
|
+
},
|
|
1516
|
+
createIssueFromActionItem: "从待办事项创建问题"
|
|
1503
1517
|
},
|
|
1504
1518
|
docLinks: {
|
|
1505
1519
|
label: "链接文档、问题或项目",
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { api as e, unwrap as t } from "../api/client.js";
|
|
2
|
+
import { docTemplatesQuery as n, teamsQuery as r } from "../api/queries.js";
|
|
3
|
+
import { fromIsoDate as i, isoDate as a } from "../lib/datePhrases.js";
|
|
4
|
+
import { spaceScope as o } from "../lib/docProperties.js";
|
|
5
|
+
import { docRef as s } from "../lib/docs.js";
|
|
6
|
+
import { useCan as c } from "../lib/roles.js";
|
|
7
|
+
import { DocIcon as l } from "./DocIcon.js";
|
|
8
|
+
import { useSpaceDocs as u } from "./DocTable.js";
|
|
9
|
+
import { AddIcon as d, ChevronRightIcon as f } from "./icons.js";
|
|
10
|
+
import { Button as p, cx as m } from "@parallelworks/ui";
|
|
11
|
+
import { Link as h, useNavigate as g } from "@tanstack/react-router";
|
|
12
|
+
import { useMemo as _, useState as v } from "react";
|
|
13
|
+
import { useFormatter as y, useLocale as b, useTranslations as x } from "use-intl";
|
|
14
|
+
import { jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
15
|
+
import { useMutation as w, useQueryClient as T } from "@tanstack/react-query";
|
|
16
|
+
// src/components/DocCalendar.tsx
|
|
17
|
+
var E = (e, t) => new Date(e.getFullYear(), e.getMonth(), e.getDate() + t);
|
|
18
|
+
function D(e) {
|
|
19
|
+
let t = new Intl.Locale(e);
|
|
20
|
+
return (t.getWeekInfo?.().firstDay ?? t.weekInfo?.firstDay ?? 7) % 7;
|
|
21
|
+
}
|
|
22
|
+
var O = (e, t) => E(e, -((e.getDay() - t + 7) % 7));
|
|
23
|
+
function k(i, o, c) {
|
|
24
|
+
let l = x("docViews"), u = y(), d = T(), f = g();
|
|
25
|
+
return w({
|
|
26
|
+
mutationFn: async (s) => {
|
|
27
|
+
let [f, p] = await Promise.all([d.fetchQuery(n(i)), d.fetchQuery(r(i))]), m = o === "workspace" ? "" : p.find((e) => e.key === o)?.id ?? "", h = f.find((e) => e.spaceDefault && (e.teamId ?? "") === m), g = a(s), _ = t(await e.POST("/api/v1/workspaces/{workspace}/docs", {
|
|
28
|
+
params: { path: { workspace: i } },
|
|
29
|
+
body: {
|
|
30
|
+
title: l("meetingTitle", { date: u.dateTime(s, { dateStyle: "medium" }) }),
|
|
31
|
+
template: h?.id ?? "meeting-notes",
|
|
32
|
+
variables: { date: g },
|
|
33
|
+
...o !== "workspace" && { team: o }
|
|
34
|
+
}
|
|
35
|
+
}));
|
|
36
|
+
return c && await e.PATCH("/api/v1/workspaces/{workspace}/docs/{doc}/properties", {
|
|
37
|
+
params: { path: {
|
|
38
|
+
workspace: i,
|
|
39
|
+
doc: _.key
|
|
40
|
+
} },
|
|
41
|
+
body: { values: { [c]: g } }
|
|
42
|
+
}), _;
|
|
43
|
+
},
|
|
44
|
+
onSuccess: (e) => {
|
|
45
|
+
d.invalidateQueries({ queryKey: [
|
|
46
|
+
"workspace",
|
|
47
|
+
i,
|
|
48
|
+
"docs"
|
|
49
|
+
] }), f({
|
|
50
|
+
to: "/$workspace/docs/$doc",
|
|
51
|
+
params: {
|
|
52
|
+
workspace: i,
|
|
53
|
+
doc: s(e)
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function A({ workspace: e, space: t, config: n, query: r = "" }) {
|
|
60
|
+
let g = x("docViews"), w = y(), T = D(b()), A = c(e, "edit_docs", o(t)), { docs: M, props: N, isPending: P } = u(e, t, n), F = r.trim().toLowerCase(), I = F ? M.filter((e) => e.title.toLowerCase().includes(F)) : M, L = N.find((e) => e.id === n.dateProperty && e.kind === "date"), R = k(e, t, L?.id), z = _(() => {
|
|
61
|
+
let e = /* @__PURE__ */ new Date();
|
|
62
|
+
return new Date(e.getFullYear(), e.getMonth(), e.getDate());
|
|
63
|
+
}, []), [B, V] = v(z), H = _(() => {
|
|
64
|
+
let e = /* @__PURE__ */ new Map();
|
|
65
|
+
if (!L) return e;
|
|
66
|
+
for (let t of I) {
|
|
67
|
+
let n = t.properties?.[L.id];
|
|
68
|
+
typeof n == "string" && i(n) && e.set(n, [...e.get(n) ?? [], t]);
|
|
69
|
+
}
|
|
70
|
+
return e;
|
|
71
|
+
}, [I, L]);
|
|
72
|
+
if (P) return /* @__PURE__ */ S("p", {
|
|
73
|
+
className: "p-4 text-sm text-muted-foreground",
|
|
74
|
+
children: g("loading")
|
|
75
|
+
});
|
|
76
|
+
if (!L) return /* @__PURE__ */ S("p", {
|
|
77
|
+
className: "p-4 text-sm text-muted-foreground",
|
|
78
|
+
children: g("pickDate")
|
|
79
|
+
});
|
|
80
|
+
let U = new Date(B.getFullYear(), B.getMonth(), 1), W = O(U, T), G = Math.ceil(((U.getTime() - W.getTime()) / 864e5 + j(U)) / 7), K = Array.from({ length: G * 7 }, (e, t) => E(W, t)), q = O(B, T), J = Array.from({ length: 7 }, (e, t) => E(q, t)), Y = (e) => V((t) => new Date(t.getFullYear(), t.getMonth() + e, Math.min(t.getDate(), 28))), X = (e) => V((t) => E(t, 7 * e)), Z = (t) => /* @__PURE__ */ C(h, {
|
|
81
|
+
to: "/$workspace/docs/$doc",
|
|
82
|
+
params: {
|
|
83
|
+
workspace: e,
|
|
84
|
+
doc: s(t)
|
|
85
|
+
},
|
|
86
|
+
className: "flex min-w-0 items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-xs hover:bg-accent",
|
|
87
|
+
children: [/* @__PURE__ */ S(l, { icon: t.icon }), /* @__PURE__ */ S("span", {
|
|
88
|
+
className: "truncate",
|
|
89
|
+
children: t.title
|
|
90
|
+
})]
|
|
91
|
+
}, t.id), Q = (e) => A && /* @__PURE__ */ S("button", {
|
|
92
|
+
type: "button",
|
|
93
|
+
onClick: () => R.mutate(e),
|
|
94
|
+
disabled: R.isPending,
|
|
95
|
+
"aria-label": g("newMeetingOn", { date: w.dateTime(e, { dateStyle: "medium" }) }),
|
|
96
|
+
className: "rounded px-1 text-xs text-muted-foreground opacity-0 group-hover:opacity-100 max-sm:opacity-100 focus-visible:opacity-100 hover:bg-accent hover:text-foreground",
|
|
97
|
+
children: /* @__PURE__ */ S(d, { className: "size-3.5" })
|
|
98
|
+
});
|
|
99
|
+
return /* @__PURE__ */ C("div", {
|
|
100
|
+
className: "flex flex-col",
|
|
101
|
+
children: [
|
|
102
|
+
/* @__PURE__ */ C("div", {
|
|
103
|
+
className: "flex items-center gap-2 px-4 py-2 md:px-5",
|
|
104
|
+
children: [
|
|
105
|
+
/* @__PURE__ */ S("h2", {
|
|
106
|
+
className: "text-sm font-medium max-sm:hidden",
|
|
107
|
+
children: w.dateTime(U, {
|
|
108
|
+
month: "long",
|
|
109
|
+
year: "numeric"
|
|
110
|
+
})
|
|
111
|
+
}),
|
|
112
|
+
/* @__PURE__ */ S("h2", {
|
|
113
|
+
className: "text-sm font-medium sm:hidden",
|
|
114
|
+
children: w.dateTimeRange(J[0], J[6], { dateStyle: "medium" })
|
|
115
|
+
}),
|
|
116
|
+
/* @__PURE__ */ C("span", {
|
|
117
|
+
className: "ml-auto flex items-center gap-1",
|
|
118
|
+
children: [
|
|
119
|
+
/* @__PURE__ */ S(p, {
|
|
120
|
+
size: "xs",
|
|
121
|
+
variant: "ghost",
|
|
122
|
+
onClick: () => V(z),
|
|
123
|
+
children: g("today")
|
|
124
|
+
}),
|
|
125
|
+
/* @__PURE__ */ C("span", {
|
|
126
|
+
className: "flex gap-1 max-sm:hidden",
|
|
127
|
+
children: [/* @__PURE__ */ S(p, {
|
|
128
|
+
size: "xs",
|
|
129
|
+
variant: "ghost",
|
|
130
|
+
onClick: () => Y(-1),
|
|
131
|
+
"aria-label": g("previousMonth"),
|
|
132
|
+
children: /* @__PURE__ */ S(f, { className: "rotate-180" })
|
|
133
|
+
}), /* @__PURE__ */ S(p, {
|
|
134
|
+
size: "xs",
|
|
135
|
+
variant: "ghost",
|
|
136
|
+
onClick: () => Y(1),
|
|
137
|
+
"aria-label": g("nextMonth"),
|
|
138
|
+
children: /* @__PURE__ */ S(f, {})
|
|
139
|
+
})]
|
|
140
|
+
}),
|
|
141
|
+
/* @__PURE__ */ C("span", {
|
|
142
|
+
className: "flex gap-1 sm:hidden",
|
|
143
|
+
children: [/* @__PURE__ */ S(p, {
|
|
144
|
+
size: "xs",
|
|
145
|
+
variant: "ghost",
|
|
146
|
+
onClick: () => X(-1),
|
|
147
|
+
"aria-label": g("previousWeek"),
|
|
148
|
+
children: /* @__PURE__ */ S(f, { className: "rotate-180" })
|
|
149
|
+
}), /* @__PURE__ */ S(p, {
|
|
150
|
+
size: "xs",
|
|
151
|
+
variant: "ghost",
|
|
152
|
+
onClick: () => X(1),
|
|
153
|
+
"aria-label": g("nextWeek"),
|
|
154
|
+
children: /* @__PURE__ */ S(f, {})
|
|
155
|
+
})]
|
|
156
|
+
})
|
|
157
|
+
]
|
|
158
|
+
})
|
|
159
|
+
]
|
|
160
|
+
}),
|
|
161
|
+
/* @__PURE__ */ C("div", {
|
|
162
|
+
className: "max-sm:hidden",
|
|
163
|
+
children: [/* @__PURE__ */ S("div", {
|
|
164
|
+
className: "grid grid-cols-7 border-y border-border text-xs text-muted-foreground",
|
|
165
|
+
children: K.slice(0, 7).map((e) => /* @__PURE__ */ S("span", {
|
|
166
|
+
className: "px-2 py-1",
|
|
167
|
+
children: w.dateTime(e, { weekday: "short" })
|
|
168
|
+
}, e.getDay()))
|
|
169
|
+
}), /* @__PURE__ */ S("ol", {
|
|
170
|
+
className: "grid grid-cols-7",
|
|
171
|
+
"aria-label": g("calendar"),
|
|
172
|
+
children: K.map((e) => {
|
|
173
|
+
let t = a(e), n = H.get(t) ?? [], r = e.getMonth() === U.getMonth();
|
|
174
|
+
return /* @__PURE__ */ C("li", {
|
|
175
|
+
"aria-label": w.dateTime(e, { dateStyle: "full" }),
|
|
176
|
+
className: m("group flex min-h-24 min-w-0 flex-col gap-1 border-r border-b border-border p-1.5", !r && "bg-muted/30"),
|
|
177
|
+
children: [/* @__PURE__ */ C("span", {
|
|
178
|
+
className: "flex items-center justify-between",
|
|
179
|
+
children: [/* @__PURE__ */ S("span", {
|
|
180
|
+
className: m("flex size-6 items-center justify-center rounded-full text-xs tabular-nums", t === a(z) ? "bg-primary text-primary-foreground" : r ? "" : "text-muted-foreground"),
|
|
181
|
+
children: e.getDate()
|
|
182
|
+
}), Q(e)]
|
|
183
|
+
}), n.map(Z)]
|
|
184
|
+
}, t);
|
|
185
|
+
})
|
|
186
|
+
})]
|
|
187
|
+
}),
|
|
188
|
+
/* @__PURE__ */ S("ol", {
|
|
189
|
+
className: "divide-y divide-border border-y border-border sm:hidden",
|
|
190
|
+
"aria-label": g("calendar"),
|
|
191
|
+
children: J.map((e) => {
|
|
192
|
+
let t = a(e), n = H.get(t) ?? [];
|
|
193
|
+
return /* @__PURE__ */ C("li", {
|
|
194
|
+
className: "group flex flex-col gap-1 px-4 py-2",
|
|
195
|
+
children: [/* @__PURE__ */ C("span", {
|
|
196
|
+
className: "flex items-center justify-between text-xs",
|
|
197
|
+
children: [/* @__PURE__ */ S("span", {
|
|
198
|
+
className: m(t === a(z) ? "font-medium text-primary" : "text-muted-foreground"),
|
|
199
|
+
children: w.dateTime(e, {
|
|
200
|
+
weekday: "long",
|
|
201
|
+
month: "short",
|
|
202
|
+
day: "numeric"
|
|
203
|
+
})
|
|
204
|
+
}), Q(e)]
|
|
205
|
+
}), n.map(Z)]
|
|
206
|
+
}, t);
|
|
207
|
+
})
|
|
208
|
+
})
|
|
209
|
+
]
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
var j = (e) => new Date(e.getFullYear(), e.getMonth() + 1, 0).getDate();
|
|
213
|
+
export { A as DocCalendar, k as useNewMeetingNotes };
|
package/components/DocTable.js
CHANGED
|
@@ -3,24 +3,25 @@ import { docPropertiesQuery as t, spaceScope as n, useDocPropertyActions as r }
|
|
|
3
3
|
import { docRef as i } from "../lib/docs.js";
|
|
4
4
|
import { usePeople as a } from "../lib/people.js";
|
|
5
5
|
import { useCan as o } from "../lib/roles.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
6
|
+
import { DocCalendar as s } from "./DocCalendar.js";
|
|
7
|
+
import { DocIcon as c } from "./DocIcon.js";
|
|
8
|
+
import { usePropertyText as l } from "./DocProperties.js";
|
|
9
|
+
import { cx as u } from "@parallelworks/ui";
|
|
10
|
+
import { Link as d } from "@tanstack/react-router";
|
|
11
|
+
import { useState as f } from "react";
|
|
12
|
+
import { useFormatter as p, useTranslations as m } from "use-intl";
|
|
13
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
14
|
+
import { keepPreviousData as _, useQuery as v } from "@tanstack/react-query";
|
|
14
15
|
// src/components/DocTable.tsx
|
|
15
|
-
var
|
|
16
|
-
function
|
|
17
|
-
let a = Object.entries(i.filters ?? {}).map(([e, t]) => `${e}=${t}`), { data: o = [], isPending: s } =
|
|
16
|
+
var y = (e) => e.kind === "select" || e.kind === "person";
|
|
17
|
+
function b(n, r, i) {
|
|
18
|
+
let a = Object.entries(i.filters ?? {}).map(([e, t]) => `${e}=${t}`), { data: o = [], isPending: s } = v({
|
|
18
19
|
...e(n, {
|
|
19
20
|
...r === "workspace" ? { workspace: !0 } : { team: r },
|
|
20
21
|
...a.length > 0 && { property: a }
|
|
21
22
|
}),
|
|
22
|
-
placeholderData:
|
|
23
|
-
}), { data:
|
|
23
|
+
placeholderData: _
|
|
24
|
+
}), { data: c = [] } = v(t(n, r)), u = l(n), d = i.sort ?? "title", f = c.find((e) => e.id === d), p = (e) => {
|
|
24
25
|
if (d === "updated") return e.updatedAt;
|
|
25
26
|
if (!f) return e.title.toLowerCase();
|
|
26
27
|
let t = e.properties?.[f.id];
|
|
@@ -31,85 +32,91 @@ function y(n, r, i) {
|
|
|
31
32
|
let n = p(e), r = p(t), a = n < r ? -1 : +(n > r);
|
|
32
33
|
return i.desc ? -a : a;
|
|
33
34
|
}),
|
|
34
|
-
props:
|
|
35
|
+
props: c,
|
|
35
36
|
isPending: s
|
|
36
37
|
};
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
-
let
|
|
40
|
-
if (
|
|
39
|
+
function x({ workspace: e, space: t, layout: n, config: r, query: o = "" }) {
|
|
40
|
+
let u = m("docViews"), f = p(), { actorName: _ } = a(e), { docs: v, props: x, isPending: C } = b(e, t, r), w = o.trim().toLowerCase(), T = w ? v.filter((e) => e.title.toLowerCase().includes(w)) : v, E = new Map(v.map((e) => [e.id, e.title])), D = l(e), O = (e, t) => e.properties?.[t.id];
|
|
41
|
+
if (C) return /* @__PURE__ */ h("p", {
|
|
41
42
|
className: "p-4 text-sm text-muted-foreground",
|
|
42
|
-
children:
|
|
43
|
+
children: u("loading")
|
|
44
|
+
});
|
|
45
|
+
if (n === "calendar") return /* @__PURE__ */ h(s, {
|
|
46
|
+
workspace: e,
|
|
47
|
+
space: t,
|
|
48
|
+
config: r,
|
|
49
|
+
query: o
|
|
43
50
|
});
|
|
44
51
|
if (n === "board") {
|
|
45
|
-
let n =
|
|
46
|
-
return n ? /* @__PURE__ */
|
|
52
|
+
let n = x.find((e) => e.id === r.groupBy && y(e));
|
|
53
|
+
return n ? /* @__PURE__ */ h(S, {
|
|
47
54
|
workspace: e,
|
|
48
55
|
space: t,
|
|
49
|
-
docs:
|
|
50
|
-
props:
|
|
56
|
+
docs: T,
|
|
57
|
+
props: x,
|
|
51
58
|
by: n
|
|
52
|
-
}) : /* @__PURE__ */
|
|
59
|
+
}) : /* @__PURE__ */ h("p", {
|
|
53
60
|
className: "p-4 text-sm text-muted-foreground",
|
|
54
|
-
children:
|
|
61
|
+
children: u("pickGroup")
|
|
55
62
|
});
|
|
56
63
|
}
|
|
57
|
-
let
|
|
58
|
-
return
|
|
64
|
+
let k = r.columns ? r.columns.flatMap((e) => x.filter((t) => t.id === e)) : x;
|
|
65
|
+
return T.length === 0 ? /* @__PURE__ */ h("p", {
|
|
59
66
|
className: "p-4 text-sm text-muted-foreground",
|
|
60
|
-
children:
|
|
61
|
-
}) : /* @__PURE__ */
|
|
67
|
+
children: u("none")
|
|
68
|
+
}) : /* @__PURE__ */ h("div", {
|
|
62
69
|
className: "overflow-x-auto",
|
|
63
|
-
children: /* @__PURE__ */
|
|
70
|
+
children: /* @__PURE__ */ g("table", {
|
|
64
71
|
className: "doc-table w-full min-w-max text-sm",
|
|
65
|
-
children: [/* @__PURE__ */
|
|
66
|
-
/* @__PURE__ */
|
|
72
|
+
children: [/* @__PURE__ */ h("thead", { children: /* @__PURE__ */ g("tr", { children: [
|
|
73
|
+
/* @__PURE__ */ h("th", {
|
|
67
74
|
scope: "col",
|
|
68
|
-
children:
|
|
75
|
+
children: u("docTitle")
|
|
69
76
|
}),
|
|
70
|
-
|
|
77
|
+
k.map((e) => /* @__PURE__ */ h("th", {
|
|
71
78
|
scope: "col",
|
|
72
79
|
children: e.name
|
|
73
80
|
}, e.id)),
|
|
74
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ h("th", {
|
|
75
82
|
scope: "col",
|
|
76
|
-
children:
|
|
83
|
+
children: u("author")
|
|
77
84
|
}),
|
|
78
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ h("th", {
|
|
79
86
|
scope: "col",
|
|
80
|
-
children:
|
|
87
|
+
children: u("updated")
|
|
81
88
|
})
|
|
82
|
-
] }) }), /* @__PURE__ */
|
|
83
|
-
/* @__PURE__ */
|
|
89
|
+
] }) }), /* @__PURE__ */ h("tbody", { children: T.map((t) => /* @__PURE__ */ g("tr", { children: [
|
|
90
|
+
/* @__PURE__ */ g("td", { children: [/* @__PURE__ */ g(d, {
|
|
84
91
|
to: "/$workspace/docs/$doc",
|
|
85
92
|
params: {
|
|
86
93
|
workspace: e,
|
|
87
94
|
doc: i(t)
|
|
88
95
|
},
|
|
89
96
|
className: "flex items-center gap-2 font-medium hover:underline",
|
|
90
|
-
children: [/* @__PURE__ */
|
|
97
|
+
children: [/* @__PURE__ */ h(c, { icon: t.icon }), /* @__PURE__ */ h("span", {
|
|
91
98
|
className: "truncate",
|
|
92
99
|
children: t.title
|
|
93
100
|
})]
|
|
94
|
-
}), t.parentId &&
|
|
101
|
+
}), t.parentId && E.has(t.parentId) && /* @__PURE__ */ h("span", {
|
|
95
102
|
className: "ml-6 block truncate text-xs text-muted-foreground",
|
|
96
|
-
children:
|
|
103
|
+
children: u("inParent", { parent: E.get(t.parentId) ?? "" })
|
|
97
104
|
})] }),
|
|
98
|
-
|
|
99
|
-
/* @__PURE__ */
|
|
105
|
+
k.map((e) => /* @__PURE__ */ h("td", { children: D(e, O(t, e)) }, e.id)),
|
|
106
|
+
/* @__PURE__ */ h("td", {
|
|
100
107
|
className: "text-muted-foreground",
|
|
101
|
-
children:
|
|
108
|
+
children: _(t.creator)
|
|
102
109
|
}),
|
|
103
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ h("td", {
|
|
104
111
|
className: "text-muted-foreground",
|
|
105
|
-
children:
|
|
112
|
+
children: f.dateTime(new Date(t.updatedAt), { dateStyle: "medium" })
|
|
106
113
|
})
|
|
107
114
|
] }, t.id)) })]
|
|
108
115
|
})
|
|
109
116
|
});
|
|
110
117
|
}
|
|
111
|
-
function
|
|
112
|
-
let v =
|
|
118
|
+
function S({ workspace: e, space: t, docs: s, props: p, by: _ }) {
|
|
119
|
+
let v = m("docViews"), { members: y } = a(e), b = l(e), x = o(e, "edit_docs", n(t)), S = r(e), [C, w] = f(null), [T, E] = f(null), D = [..._.kind === "select" ? _.options.map((e) => ({
|
|
113
120
|
key: e.id ?? "",
|
|
114
121
|
label: e.name
|
|
115
122
|
})) : y.map((e) => ({
|
|
@@ -121,13 +128,13 @@ function x({ workspace: e, space: t, docs: f, props: g, by: _ }) {
|
|
|
121
128
|
}], O = (e) => {
|
|
122
129
|
let t = e.properties?.[_.id];
|
|
123
130
|
return typeof t == "string" ? t : "";
|
|
124
|
-
}, k = D.filter((e) => _.kind === "select" || e.key === "" ||
|
|
125
|
-
return /* @__PURE__ */
|
|
131
|
+
}, k = D.filter((e) => _.kind === "select" || e.key === "" || s.some((t) => O(t) === e.key)), A = p.filter((e) => e.id !== _.id).slice(0, 2);
|
|
132
|
+
return /* @__PURE__ */ h("ul", {
|
|
126
133
|
className: "flex gap-3 overflow-x-auto p-3",
|
|
127
134
|
"aria-label": v("board"),
|
|
128
135
|
children: k.map((t) => {
|
|
129
|
-
let n =
|
|
130
|
-
return /* @__PURE__ */
|
|
136
|
+
let n = s.filter((e) => O(e) === t.key);
|
|
137
|
+
return /* @__PURE__ */ g("li", {
|
|
131
138
|
"aria-label": t.label,
|
|
132
139
|
onDragOver: (e) => {
|
|
133
140
|
C && (e.preventDefault(), E(t.key));
|
|
@@ -139,37 +146,37 @@ function x({ workspace: e, space: t, docs: f, props: g, by: _ }) {
|
|
|
139
146
|
values: { [_.id]: t.key || null }
|
|
140
147
|
}), w(null), E(null);
|
|
141
148
|
},
|
|
142
|
-
className:
|
|
143
|
-
children: [/* @__PURE__ */
|
|
149
|
+
className: u("flex w-64 shrink-0 flex-col rounded-lg border bg-muted/30", T === t.key ? "border-primary" : "border-border"),
|
|
150
|
+
children: [/* @__PURE__ */ g("p", {
|
|
144
151
|
className: "flex items-center gap-2 px-3 py-2 text-xs font-medium",
|
|
145
|
-
children: [/* @__PURE__ */
|
|
152
|
+
children: [/* @__PURE__ */ h("span", {
|
|
146
153
|
className: "truncate",
|
|
147
154
|
children: t.label
|
|
148
|
-
}), /* @__PURE__ */
|
|
155
|
+
}), /* @__PURE__ */ h("span", {
|
|
149
156
|
className: "text-muted-foreground tabular-nums",
|
|
150
157
|
children: n.length
|
|
151
158
|
})]
|
|
152
|
-
}), /* @__PURE__ */
|
|
159
|
+
}), /* @__PURE__ */ h("ul", {
|
|
153
160
|
className: "flex flex-col gap-2 px-2 pb-2",
|
|
154
|
-
children: n.map((t) => /* @__PURE__ */
|
|
161
|
+
children: n.map((t) => /* @__PURE__ */ g("li", {
|
|
155
162
|
draggable: x,
|
|
156
163
|
onDragStart: () => w(t.key),
|
|
157
164
|
onDragEnd: () => w(null),
|
|
158
165
|
className: "rounded-md border border-border bg-card p-2.5 text-sm shadow-xs",
|
|
159
|
-
children: [/* @__PURE__ */
|
|
166
|
+
children: [/* @__PURE__ */ g(d, {
|
|
160
167
|
to: "/$workspace/docs/$doc",
|
|
161
168
|
params: {
|
|
162
169
|
workspace: e,
|
|
163
170
|
doc: i(t)
|
|
164
171
|
},
|
|
165
172
|
className: "flex items-center gap-2 font-medium hover:underline",
|
|
166
|
-
children: [/* @__PURE__ */
|
|
173
|
+
children: [/* @__PURE__ */ h(c, { icon: t.icon }), /* @__PURE__ */ h("span", {
|
|
167
174
|
className: "truncate",
|
|
168
175
|
children: t.title
|
|
169
176
|
})]
|
|
170
177
|
}), A.map((e) => {
|
|
171
178
|
let n = b(e, t.properties?.[e.id]);
|
|
172
|
-
return n ? /* @__PURE__ */
|
|
179
|
+
return n ? /* @__PURE__ */ g("p", {
|
|
173
180
|
className: "mt-1 truncate text-xs text-muted-foreground",
|
|
174
181
|
children: [
|
|
175
182
|
e.name,
|
|
@@ -184,4 +191,4 @@ function x({ workspace: e, space: t, docs: f, props: g, by: _ }) {
|
|
|
184
191
|
})
|
|
185
192
|
});
|
|
186
193
|
}
|
|
187
|
-
export {
|
|
194
|
+
export { x as DocTable, y as groupable, b as useSpaceDocs };
|
package/components/IssueCode.js
CHANGED
|
@@ -114,18 +114,17 @@ function O({ workspace: O, identifier: k, title: A }) {
|
|
|
114
114
|
className: "size-3.5 text-muted-foreground"
|
|
115
115
|
}),
|
|
116
116
|
/* @__PURE__ */ y("span", {
|
|
117
|
-
className: "min-w-0 flex-1
|
|
118
|
-
children: [
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
})
|
|
117
|
+
className: "flex min-w-0 flex-1 items-baseline gap-1",
|
|
118
|
+
children: [/* @__PURE__ */ v("span", {
|
|
119
|
+
className: "min-w-0 truncate",
|
|
120
|
+
children: e.title
|
|
121
|
+
}), /* @__PURE__ */ v("span", {
|
|
122
|
+
className: "shrink-0 text-muted-foreground",
|
|
123
|
+
children: j("pullRequestRef", {
|
|
124
|
+
repository: e.repository,
|
|
125
|
+
number: D(e)
|
|
127
126
|
})
|
|
128
|
-
]
|
|
127
|
+
})]
|
|
129
128
|
}),
|
|
130
129
|
/* @__PURE__ */ y("span", {
|
|
131
130
|
className: "flex items-center gap-3 text-xs",
|
package/lib/docProperties.js
CHANGED
|
@@ -58,7 +58,7 @@ var a = (e) => e === "workspace" ? void 0 : { team: e }, o = [
|
|
|
58
58
|
});
|
|
59
59
|
function u(e) {
|
|
60
60
|
let t = e ?? {}, n = {};
|
|
61
|
-
if (Array.isArray(t.columns) && (n.columns = t.columns.filter((e) => typeof e == "string")), typeof t.sort == "string" && (n.sort = t.sort), t.desc === !0 && (n.desc = !0), typeof t.groupBy == "string" && (n.groupBy = t.groupBy), t.filters && typeof t.filters == "object") {
|
|
61
|
+
if (Array.isArray(t.columns) && (n.columns = t.columns.filter((e) => typeof e == "string")), typeof t.sort == "string" && (n.sort = t.sort), t.desc === !0 && (n.desc = !0), typeof t.groupBy == "string" && (n.groupBy = t.groupBy), typeof t.dateProperty == "string" && (n.dateProperty = t.dateProperty), t.filters && typeof t.filters == "object") {
|
|
62
62
|
let e = {};
|
|
63
63
|
for (let [n, r] of Object.entries(t.filters)) typeof r == "string" && (e[n] = r);
|
|
64
64
|
Object.keys(e).length > 0 && (n.filters = e);
|