@parallelworks/tandem-web 0.192.0 → 0.192.1
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 +17 -2
- package/_virtual/_virtual_i18n/es/common.js +17 -2
- package/_virtual/_virtual_i18n/ja/common.js +17 -2
- package/_virtual/_virtual_i18n/ko/common.js +17 -2
- package/_virtual/_virtual_i18n/zh/common.js +17 -2
- package/components/DocProperties.js +1 -1
- package/components/NewPageModal.js +374 -0
- package/components/SubpageViews.js +273 -277
- package/lib/calendarMonth.js +6 -0
- package/package.json +1 -1
|
@@ -4141,14 +4141,29 @@ var e = {
|
|
|
4141
4141
|
removeView: "Remove view",
|
|
4142
4142
|
makeSeriesDoc: "Make the {series} notes for this day",
|
|
4143
4143
|
newOn: "New sub-page on {date}",
|
|
4144
|
-
emptyPage: "Empty page",
|
|
4145
|
-
fromTemplateDefault: "{template} (default)",
|
|
4146
4144
|
moreOnDay: "{count} more",
|
|
4147
4145
|
previousMonth: "Previous month",
|
|
4148
4146
|
today: "Today",
|
|
4149
4147
|
nextMonth: "Next month",
|
|
4150
4148
|
none: "No sub-pages yet.",
|
|
4151
4149
|
undated: "No date"
|
|
4150
|
+
},
|
|
4151
|
+
newPage: {
|
|
4152
|
+
title: "New page",
|
|
4153
|
+
titleLabel: "Page title",
|
|
4154
|
+
openFull: "Open as a full page",
|
|
4155
|
+
share: "Share",
|
|
4156
|
+
copyLink: "Copy link",
|
|
4157
|
+
linkCopied: "Link copied",
|
|
4158
|
+
more: "More",
|
|
4159
|
+
properties: "Properties",
|
|
4160
|
+
discussions: "Discussions",
|
|
4161
|
+
addComment: "Add a comment…",
|
|
4162
|
+
templates: "Templates",
|
|
4163
|
+
hint: "Press Enter to continue with an empty page, or pick a template (use ↑ and ↓ to select)",
|
|
4164
|
+
empty: "Empty",
|
|
4165
|
+
newTemplate: "New template",
|
|
4166
|
+
newTemplateTitle: "New template"
|
|
4152
4167
|
}
|
|
4153
4168
|
};
|
|
4154
4169
|
export { e as default };
|
|
@@ -4141,14 +4141,29 @@ var e = {
|
|
|
4141
4141
|
removeView: "Quitar vista",
|
|
4142
4142
|
makeSeriesDoc: "Crear las notas de {series} de este día",
|
|
4143
4143
|
newOn: "Nueva subpágina el {date}",
|
|
4144
|
-
emptyPage: "Página vacía",
|
|
4145
|
-
fromTemplateDefault: "{template} (predeterminada)",
|
|
4146
4144
|
moreOnDay: "{count} más",
|
|
4147
4145
|
previousMonth: "Mes anterior",
|
|
4148
4146
|
today: "Hoy",
|
|
4149
4147
|
nextMonth: "Mes siguiente",
|
|
4150
4148
|
none: "Aún no hay subpáginas.",
|
|
4151
4149
|
undated: "Sin fecha"
|
|
4150
|
+
},
|
|
4151
|
+
newPage: {
|
|
4152
|
+
title: "Página nueva",
|
|
4153
|
+
titleLabel: "Título de la página",
|
|
4154
|
+
openFull: "Abrir como página completa",
|
|
4155
|
+
share: "Compartir",
|
|
4156
|
+
copyLink: "Copiar enlace",
|
|
4157
|
+
linkCopied: "Enlace copiado",
|
|
4158
|
+
more: "Más",
|
|
4159
|
+
properties: "Propiedades",
|
|
4160
|
+
discussions: "Conversaciones",
|
|
4161
|
+
addComment: "Añade un comentario…",
|
|
4162
|
+
templates: "Plantillas",
|
|
4163
|
+
hint: "Pulsa Intro para seguir con una página vacía, o elige una plantilla (usa ↑ y ↓ para seleccionar)",
|
|
4164
|
+
empty: "Vacía",
|
|
4165
|
+
newTemplate: "Nueva plantilla",
|
|
4166
|
+
newTemplateTitle: "Nueva plantilla"
|
|
4152
4167
|
}
|
|
4153
4168
|
};
|
|
4154
4169
|
export { e as default };
|
|
@@ -4141,14 +4141,29 @@ var e = {
|
|
|
4141
4141
|
removeView: "ビューを削除",
|
|
4142
4142
|
makeSeriesDoc: "この日の {series} のノートを作成",
|
|
4143
4143
|
newOn: "{date} の新しいサブページ",
|
|
4144
|
-
emptyPage: "空のページ",
|
|
4145
|
-
fromTemplateDefault: "{template}(既定)",
|
|
4146
4144
|
moreOnDay: "他 {count} 件",
|
|
4147
4145
|
previousMonth: "前の月",
|
|
4148
4146
|
today: "今日",
|
|
4149
4147
|
nextMonth: "次の月",
|
|
4150
4148
|
none: "サブページはまだありません。",
|
|
4151
4149
|
undated: "日付なし"
|
|
4150
|
+
},
|
|
4151
|
+
newPage: {
|
|
4152
|
+
title: "新しいページ",
|
|
4153
|
+
titleLabel: "ページのタイトル",
|
|
4154
|
+
openFull: "フルページで開く",
|
|
4155
|
+
share: "共有",
|
|
4156
|
+
copyLink: "リンクをコピー",
|
|
4157
|
+
linkCopied: "リンクをコピーしました",
|
|
4158
|
+
more: "その他",
|
|
4159
|
+
properties: "プロパティ",
|
|
4160
|
+
discussions: "ディスカッション",
|
|
4161
|
+
addComment: "コメントを追加…",
|
|
4162
|
+
templates: "テンプレート",
|
|
4163
|
+
hint: "Enter で空のページのまま続けるか、テンプレートを選択します(↑ と ↓ で選択)",
|
|
4164
|
+
empty: "空",
|
|
4165
|
+
newTemplate: "新しいテンプレート",
|
|
4166
|
+
newTemplateTitle: "新しいテンプレート"
|
|
4152
4167
|
}
|
|
4153
4168
|
};
|
|
4154
4169
|
export { e as default };
|
|
@@ -4141,14 +4141,29 @@ var e = {
|
|
|
4141
4141
|
removeView: "보기 삭제",
|
|
4142
4142
|
makeSeriesDoc: "이 날의 {series} 노트 만들기",
|
|
4143
4143
|
newOn: "{date}에 새 하위 페이지",
|
|
4144
|
-
emptyPage: "빈 페이지",
|
|
4145
|
-
fromTemplateDefault: "{template} (기본)",
|
|
4146
4144
|
moreOnDay: "{count}개 더",
|
|
4147
4145
|
previousMonth: "이전 달",
|
|
4148
4146
|
today: "오늘",
|
|
4149
4147
|
nextMonth: "다음 달",
|
|
4150
4148
|
none: "아직 하위 페이지가 없습니다.",
|
|
4151
4149
|
undated: "날짜 없음"
|
|
4150
|
+
},
|
|
4151
|
+
newPage: {
|
|
4152
|
+
title: "새 페이지",
|
|
4153
|
+
titleLabel: "페이지 제목",
|
|
4154
|
+
openFull: "전체 페이지로 열기",
|
|
4155
|
+
share: "공유",
|
|
4156
|
+
copyLink: "링크 복사",
|
|
4157
|
+
linkCopied: "링크를 복사했습니다",
|
|
4158
|
+
more: "더 보기",
|
|
4159
|
+
properties: "속성",
|
|
4160
|
+
discussions: "토론",
|
|
4161
|
+
addComment: "댓글 추가…",
|
|
4162
|
+
templates: "템플릿",
|
|
4163
|
+
hint: "Enter를 눌러 빈 페이지로 계속하거나 템플릿을 고르세요(↑와 ↓로 선택)",
|
|
4164
|
+
empty: "비어 있음",
|
|
4165
|
+
newTemplate: "새 템플릿",
|
|
4166
|
+
newTemplateTitle: "새 템플릿"
|
|
4152
4167
|
}
|
|
4153
4168
|
};
|
|
4154
4169
|
export { e as default };
|
|
@@ -4141,14 +4141,29 @@ var e = {
|
|
|
4141
4141
|
removeView: "删除视图",
|
|
4142
4142
|
makeSeriesDoc: "创建这一天的 {series} 记录",
|
|
4143
4143
|
newOn: "在 {date} 新建子页面",
|
|
4144
|
-
emptyPage: "空白页面",
|
|
4145
|
-
fromTemplateDefault: "{template}(默认)",
|
|
4146
4144
|
moreOnDay: "还有 {count} 篇",
|
|
4147
4145
|
previousMonth: "上个月",
|
|
4148
4146
|
today: "今天",
|
|
4149
4147
|
nextMonth: "下个月",
|
|
4150
4148
|
none: "还没有子页面。",
|
|
4151
4149
|
undated: "无日期"
|
|
4150
|
+
},
|
|
4151
|
+
newPage: {
|
|
4152
|
+
title: "新页面",
|
|
4153
|
+
titleLabel: "页面标题",
|
|
4154
|
+
openFull: "以完整页面打开",
|
|
4155
|
+
share: "共享",
|
|
4156
|
+
copyLink: "复制链接",
|
|
4157
|
+
linkCopied: "已复制链接",
|
|
4158
|
+
more: "更多",
|
|
4159
|
+
properties: "属性",
|
|
4160
|
+
discussions: "讨论",
|
|
4161
|
+
addComment: "添加评论…",
|
|
4162
|
+
templates: "模板",
|
|
4163
|
+
hint: "按 Enter 继续使用空白页,或选择一个模板(用 ↑ 和 ↓ 选择)",
|
|
4164
|
+
empty: "空",
|
|
4165
|
+
newTemplate: "新建模板",
|
|
4166
|
+
newTemplateTitle: "新建模板"
|
|
4152
4167
|
}
|
|
4153
4168
|
};
|
|
4154
4169
|
export { e as default };
|
|
@@ -340,4 +340,4 @@ function N({ workspace: e, space: t, property: r, onDone: a, onRemove: o }) {
|
|
|
340
340
|
]
|
|
341
341
|
});
|
|
342
342
|
}
|
|
343
|
-
export { O as DocProperties, A as PropertyField, D as usePropertyText };
|
|
343
|
+
export { M as AddProperty, O as DocProperties, A as PropertyField, D as usePropertyText };
|
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import { api as e, unwrap as t } from "../api/client.js";
|
|
2
|
+
import { docCommentsQuery as n, docTemplatesQuery as r } from "../api/queries.js";
|
|
3
|
+
import { fromIsoDate as i } from "../lib/datePhrases.js";
|
|
4
|
+
import { docPropertiesQuery as a, spaceScope as o } from "../lib/docProperties.js";
|
|
5
|
+
import { docSeriesQuery as ee } from "../lib/docSeries.js";
|
|
6
|
+
import { docRef as s, docURL as te, useDocMenu as ne } from "../lib/docs.js";
|
|
7
|
+
import { usePeople as re } from "../lib/people.js";
|
|
8
|
+
import { useCan as ie } from "../lib/roles.js";
|
|
9
|
+
import { openShare as ae } from "../lib/share.js";
|
|
10
|
+
import { AddProperty as oe, PropertyField as se } from "./DocProperties.js";
|
|
11
|
+
import { Editor as c } from "./Editor.js";
|
|
12
|
+
import { FavoriteStar as l } from "./FavoriteStar.js";
|
|
13
|
+
import { AddIcon as ce, ExpandIcon as le, FileTextIcon as ue, LinkIcon as de } from "./icons.js";
|
|
14
|
+
import { Button as fe, ErrorText as pe, IconButton as u, Modal as me, cx as he, toast as ge, useOpenMenu as _e } from "@parallelworks/ui";
|
|
15
|
+
import { useNavigate as ve } from "@tanstack/react-router";
|
|
16
|
+
import { useEffect as ye, useRef as d, useState as f } from "react";
|
|
17
|
+
import { useErrorMessage as be } from "@parallelworks/problem/react";
|
|
18
|
+
import { useFormatter as xe, useTranslations as p } from "use-intl";
|
|
19
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
20
|
+
import { useMutation as g, useQuery as _, useQueryClient as Se } from "@tanstack/react-query";
|
|
21
|
+
import { MoreIcon as Ce, ShareIcon as we } from "@parallelworks/ui/icons";
|
|
22
|
+
// src/components/NewPageModal.tsx
|
|
23
|
+
var Te = 400;
|
|
24
|
+
function v({ workspace: v, parent: y, space: b, day: x, dateProperty: S, viewTemplate: C, onClose: w }) {
|
|
25
|
+
let T = p("newPage"), E = p("subpages"), D = xe(), O = be(), k = Se(), A = ve(), Ee = _e(), De = ne(v), { nameOf: Oe } = re(v), ke = ie(v, "manage_labels", o(b)), { data: Ae = [] } = _(a(v, b)), { data: je = [] } = _(r(v)), { data: Me = [] } = _(ee(v, b, x, x)), [j, M] = f(), N = d(void 0), [P, Ne] = f(""), F = d(""), [I, Pe] = f(S ? { [S]: x } : {}), L = d(I), [R, Fe] = f(!1), [z, B] = f(-1), [V, H] = f(""), [U, Ie] = f(), { data: Le = [] } = _({
|
|
26
|
+
...n(v, j?.key ?? ""),
|
|
27
|
+
enabled: !!j
|
|
28
|
+
}), W = () => k.invalidateQueries({ queryKey: [
|
|
29
|
+
"workspace",
|
|
30
|
+
v,
|
|
31
|
+
"docs"
|
|
32
|
+
] }), G = (e) => ({ path: {
|
|
33
|
+
workspace: v,
|
|
34
|
+
doc: e
|
|
35
|
+
} }), K = { date: D.dateTime(i(x), { dateStyle: "long" }) }, q = [
|
|
36
|
+
...je.filter((e) => e.starter || !e.teamId || e.teamId === y.teamId).sort((e, t) => Number(t.id === C) - Number(e.id === C)).map((e) => ({
|
|
37
|
+
kind: "template",
|
|
38
|
+
id: e.id,
|
|
39
|
+
label: e.title
|
|
40
|
+
})),
|
|
41
|
+
...Me.filter((e) => e.parentId === y.id && !e.stoppedAt && e.template).map((e) => ({
|
|
42
|
+
kind: "series",
|
|
43
|
+
series: e,
|
|
44
|
+
label: e.title
|
|
45
|
+
})),
|
|
46
|
+
{
|
|
47
|
+
kind: "empty",
|
|
48
|
+
label: T("empty")
|
|
49
|
+
}
|
|
50
|
+
], J = (e) => j ? Promise.resolve(j) : (N.current ??= Re(e).then((e) => (M(e), W(), e), (e) => {
|
|
51
|
+
throw N.current = void 0, e;
|
|
52
|
+
}), N.current), Re = async (n) => {
|
|
53
|
+
let r = P.trim();
|
|
54
|
+
F.current = r;
|
|
55
|
+
let i;
|
|
56
|
+
if (n?.kind === "series" && n.series.upcoming?.includes(x)) i = t(await e.POST("/api/v1/workspaces/{workspace}/doc-series/{series}/docs", {
|
|
57
|
+
params: { path: {
|
|
58
|
+
workspace: v,
|
|
59
|
+
series: n.series.id
|
|
60
|
+
} },
|
|
61
|
+
body: { day: x }
|
|
62
|
+
})), r && (i = t(await e.PATCH("/api/v1/workspaces/{workspace}/docs/{doc}", {
|
|
63
|
+
params: G(i.key),
|
|
64
|
+
body: { title: r }
|
|
65
|
+
})));
|
|
66
|
+
else {
|
|
67
|
+
let a = n?.kind === "template" ? n.id : n?.kind === "series" ? n.series.template : void 0, o = n?.kind === "series" ? n.series.title : E("untitled");
|
|
68
|
+
i = t(await e.POST("/api/v1/workspaces/{workspace}/docs", {
|
|
69
|
+
params: { path: { workspace: v } },
|
|
70
|
+
body: {
|
|
71
|
+
parent: y.key,
|
|
72
|
+
...r || n?.kind !== "template" ? { title: r || o } : {},
|
|
73
|
+
...a && {
|
|
74
|
+
template: a,
|
|
75
|
+
variables: K
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
let a = Object.fromEntries(Object.entries(L.current).filter(([, e]) => e != null && e !== ""));
|
|
81
|
+
if (Object.keys(a).length > 0) {
|
|
82
|
+
let { properties: n } = t(await e.PATCH("/api/v1/workspaces/{workspace}/docs/{doc}/properties", {
|
|
83
|
+
params: G(i.key),
|
|
84
|
+
body: { values: a }
|
|
85
|
+
}));
|
|
86
|
+
i = {
|
|
87
|
+
...i,
|
|
88
|
+
properties: n
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
return i;
|
|
92
|
+
}, Y = (e) => e.catch((e) => {
|
|
93
|
+
Ie(e);
|
|
94
|
+
});
|
|
95
|
+
ye(() => {
|
|
96
|
+
let n = P.trim();
|
|
97
|
+
if (n === F.current) return;
|
|
98
|
+
let r = setTimeout(() => {
|
|
99
|
+
(n || j) && Y(J().then(async (r) => {
|
|
100
|
+
n !== F.current && (F.current = n, M(t(await e.PATCH("/api/v1/workspaces/{workspace}/docs/{doc}", {
|
|
101
|
+
params: G(r.key),
|
|
102
|
+
body: { title: n || E("untitled") }
|
|
103
|
+
}))), W());
|
|
104
|
+
}));
|
|
105
|
+
}, Te);
|
|
106
|
+
return () => clearTimeout(r);
|
|
107
|
+
});
|
|
108
|
+
let X = (n) => {
|
|
109
|
+
Fe(!0), B(-1), Y((async () => {
|
|
110
|
+
if (!j && !N.current) {
|
|
111
|
+
await J(n);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
let r = await J(), i = n.kind === "template" ? n.id : n.kind === "series" ? n.series.template : void 0;
|
|
115
|
+
if (!i) return;
|
|
116
|
+
let a = t(await e.PATCH("/api/v1/workspaces/{workspace}/docs/{doc}", {
|
|
117
|
+
params: G(r.key),
|
|
118
|
+
body: {
|
|
119
|
+
startFrom: i,
|
|
120
|
+
variables: K
|
|
121
|
+
}
|
|
122
|
+
}));
|
|
123
|
+
F.current && a.title !== F.current && (a = t(await e.PATCH("/api/v1/workspaces/{workspace}/docs/{doc}", {
|
|
124
|
+
params: G(r.key),
|
|
125
|
+
body: { title: F.current }
|
|
126
|
+
}))), M(a), W();
|
|
127
|
+
})());
|
|
128
|
+
}, ze = (n, r) => {
|
|
129
|
+
L.current = {
|
|
130
|
+
...L.current,
|
|
131
|
+
[n]: r
|
|
132
|
+
}, Pe(L.current), Y((async () => {
|
|
133
|
+
if (!j && !N.current) {
|
|
134
|
+
await J();
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
let i = await J(), { properties: a } = t(await e.PATCH("/api/v1/workspaces/{workspace}/docs/{doc}/properties", {
|
|
138
|
+
params: G(i.key),
|
|
139
|
+
body: { values: { [n]: r } }
|
|
140
|
+
}));
|
|
141
|
+
M((e) => e ? {
|
|
142
|
+
...e,
|
|
143
|
+
properties: a
|
|
144
|
+
} : {
|
|
145
|
+
...i,
|
|
146
|
+
properties: a
|
|
147
|
+
}), W();
|
|
148
|
+
})());
|
|
149
|
+
}, Be = (r) => {
|
|
150
|
+
r.preventDefault();
|
|
151
|
+
let i = V.trim();
|
|
152
|
+
i && (H(""), Y(J().then(async (r) => {
|
|
153
|
+
t(await e.POST("/api/v1/workspaces/{workspace}/docs/{doc}/comments", {
|
|
154
|
+
params: G(r.key),
|
|
155
|
+
body: { body: i }
|
|
156
|
+
})), await k.invalidateQueries({ queryKey: n(v, r.key).queryKey });
|
|
157
|
+
})));
|
|
158
|
+
}, Ve = () => {
|
|
159
|
+
let t = P.trim();
|
|
160
|
+
t && t !== F.current && J().then(async (n) => {
|
|
161
|
+
t !== F.current && (await e.PATCH("/api/v1/workspaces/{workspace}/docs/{doc}", {
|
|
162
|
+
params: G(n.key),
|
|
163
|
+
body: { title: t }
|
|
164
|
+
}), W());
|
|
165
|
+
}), w();
|
|
166
|
+
}, Z = (e) => () => {
|
|
167
|
+
Y(J().then(e));
|
|
168
|
+
}, Q = Z((e) => {
|
|
169
|
+
w(), A({
|
|
170
|
+
to: "/$workspace/docs/$doc",
|
|
171
|
+
params: {
|
|
172
|
+
workspace: v,
|
|
173
|
+
doc: s(e)
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
}), He = Z((e) => ae({
|
|
177
|
+
doc: e.key,
|
|
178
|
+
title: e.title
|
|
179
|
+
})), Ue = Z((e) => {
|
|
180
|
+
navigator.clipboard.writeText(te(v, e)).then(() => ge.success(T("linkCopied")));
|
|
181
|
+
}), $ = g({
|
|
182
|
+
mutationFn: async () => {
|
|
183
|
+
let n = t(await e.POST("/api/v1/workspaces/{workspace}/docs", {
|
|
184
|
+
params: { path: { workspace: v } },
|
|
185
|
+
body: {
|
|
186
|
+
title: T("newTemplateTitle"),
|
|
187
|
+
...b !== "workspace" && { team: b }
|
|
188
|
+
}
|
|
189
|
+
}));
|
|
190
|
+
return t(await e.PATCH("/api/v1/workspaces/{workspace}/docs/{doc}", {
|
|
191
|
+
params: G(n.key),
|
|
192
|
+
body: { template: !0 }
|
|
193
|
+
}));
|
|
194
|
+
},
|
|
195
|
+
onSuccess: (e) => {
|
|
196
|
+
W(), w(), A({
|
|
197
|
+
to: "/$workspace/docs/$doc",
|
|
198
|
+
params: {
|
|
199
|
+
workspace: v,
|
|
200
|
+
doc: s(e)
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
}), We = (e) => {
|
|
205
|
+
if (R) e.key === "Enter" && e.preventDefault();
|
|
206
|
+
else if (e.key === "ArrowDown") e.preventDefault(), B((e) => Math.min(e + 1, q.length - 1));
|
|
207
|
+
else if (e.key === "ArrowUp") e.preventDefault(), B((e) => Math.max(e - 1, -1));
|
|
208
|
+
else if (e.key === "Enter") {
|
|
209
|
+
e.preventDefault();
|
|
210
|
+
let t = q[z] ?? q[q.length - 1];
|
|
211
|
+
t && X(t);
|
|
212
|
+
}
|
|
213
|
+
}, Ge = {
|
|
214
|
+
...I,
|
|
215
|
+
...j?.properties ?? {}
|
|
216
|
+
};
|
|
217
|
+
return /* @__PURE__ */ h(me, {
|
|
218
|
+
open: !0,
|
|
219
|
+
onClose: Ve,
|
|
220
|
+
align: "center",
|
|
221
|
+
"aria-label": P.trim() || T("title"),
|
|
222
|
+
className: "flex max-h-[85vh] w-[min(900px,calc(100vw-2rem))] flex-col overflow-hidden",
|
|
223
|
+
children: [/* @__PURE__ */ h("div", {
|
|
224
|
+
className: "flex h-11 shrink-0 items-center gap-1 border-b border-border px-3",
|
|
225
|
+
children: [/* @__PURE__ */ m(u, {
|
|
226
|
+
size: "sm",
|
|
227
|
+
variant: "ghost",
|
|
228
|
+
icon: /* @__PURE__ */ m(le, {}),
|
|
229
|
+
label: T("openFull"),
|
|
230
|
+
onClick: Q
|
|
231
|
+
}), /* @__PURE__ */ h("span", {
|
|
232
|
+
className: "ml-auto flex items-center gap-1",
|
|
233
|
+
children: [
|
|
234
|
+
/* @__PURE__ */ m(fe, {
|
|
235
|
+
size: "sm",
|
|
236
|
+
variant: "ghost",
|
|
237
|
+
icon: /* @__PURE__ */ m(we, {}),
|
|
238
|
+
onClick: He,
|
|
239
|
+
children: T("share")
|
|
240
|
+
}),
|
|
241
|
+
/* @__PURE__ */ m(u, {
|
|
242
|
+
size: "sm",
|
|
243
|
+
variant: "ghost",
|
|
244
|
+
icon: /* @__PURE__ */ m(de, {}),
|
|
245
|
+
label: T("copyLink"),
|
|
246
|
+
onClick: Ue
|
|
247
|
+
}),
|
|
248
|
+
j && /* @__PURE__ */ m(l, {
|
|
249
|
+
workspace: v,
|
|
250
|
+
kind: "doc",
|
|
251
|
+
target: j.id
|
|
252
|
+
}),
|
|
253
|
+
/* @__PURE__ */ m(u, {
|
|
254
|
+
size: "sm",
|
|
255
|
+
variant: "ghost",
|
|
256
|
+
icon: /* @__PURE__ */ m(Ce, {}),
|
|
257
|
+
label: T("more"),
|
|
258
|
+
disabled: !j,
|
|
259
|
+
onClick: (e) => j && Ee(e.currentTarget, De(j))
|
|
260
|
+
})
|
|
261
|
+
]
|
|
262
|
+
})]
|
|
263
|
+
}), /* @__PURE__ */ h("div", {
|
|
264
|
+
className: "min-h-0 flex-1 overflow-y-auto px-10 pt-8 pb-6 max-sm:px-5",
|
|
265
|
+
children: [
|
|
266
|
+
/* @__PURE__ */ m("textarea", {
|
|
267
|
+
autoFocus: !0,
|
|
268
|
+
rows: 1,
|
|
269
|
+
value: P,
|
|
270
|
+
onChange: (e) => Ne(e.target.value.replace(/\n/g, "")),
|
|
271
|
+
onKeyDown: We,
|
|
272
|
+
placeholder: T("title"),
|
|
273
|
+
"aria-label": T("titleLabel"),
|
|
274
|
+
className: "w-full resize-none bg-transparent text-3xl font-bold outline-none placeholder:text-muted-foreground/60"
|
|
275
|
+
}),
|
|
276
|
+
/* @__PURE__ */ h("section", {
|
|
277
|
+
"aria-label": T("properties"),
|
|
278
|
+
className: "mt-3 space-y-0.5 text-sm",
|
|
279
|
+
children: [Ae.map((e) => /* @__PURE__ */ h("div", {
|
|
280
|
+
className: "flex min-h-8 items-center gap-2",
|
|
281
|
+
children: [/* @__PURE__ */ m("span", {
|
|
282
|
+
className: "w-36 shrink-0 truncate text-muted-foreground",
|
|
283
|
+
children: e.name
|
|
284
|
+
}), /* @__PURE__ */ m("div", {
|
|
285
|
+
className: "min-w-0 flex-1",
|
|
286
|
+
children: /* @__PURE__ */ m(se, {
|
|
287
|
+
workspace: v,
|
|
288
|
+
property: e,
|
|
289
|
+
value: Ge[e.id],
|
|
290
|
+
editable: !0,
|
|
291
|
+
onChange: (t) => ze(e.id, t)
|
|
292
|
+
})
|
|
293
|
+
})]
|
|
294
|
+
}, e.id)), ke && /* @__PURE__ */ m(oe, {
|
|
295
|
+
workspace: v,
|
|
296
|
+
space: b,
|
|
297
|
+
unset: [],
|
|
298
|
+
admin: !0,
|
|
299
|
+
onPick: () => {}
|
|
300
|
+
})]
|
|
301
|
+
}),
|
|
302
|
+
j?.body?.trim() && /* @__PURE__ */ m("div", {
|
|
303
|
+
className: "mt-6 border-t border-border pt-4",
|
|
304
|
+
children: /* @__PURE__ */ m(c, {
|
|
305
|
+
value: j.body,
|
|
306
|
+
editable: !1
|
|
307
|
+
})
|
|
308
|
+
}),
|
|
309
|
+
/* @__PURE__ */ h("section", {
|
|
310
|
+
"aria-label": T("discussions"),
|
|
311
|
+
className: "mt-6",
|
|
312
|
+
children: [
|
|
313
|
+
/* @__PURE__ */ m("h3", {
|
|
314
|
+
className: "mb-2 text-sm font-medium text-muted-foreground",
|
|
315
|
+
children: T("discussions")
|
|
316
|
+
}),
|
|
317
|
+
Le.filter((e) => !e.parentId && !e.deletedAt).map((e) => /* @__PURE__ */ h("p", {
|
|
318
|
+
className: "mb-1 text-sm",
|
|
319
|
+
children: [
|
|
320
|
+
/* @__PURE__ */ m("span", {
|
|
321
|
+
className: "font-medium",
|
|
322
|
+
children: Oe(e.author.kind, e.author.handle)
|
|
323
|
+
}),
|
|
324
|
+
" ",
|
|
325
|
+
e.body
|
|
326
|
+
]
|
|
327
|
+
}, e.id)),
|
|
328
|
+
/* @__PURE__ */ m("form", {
|
|
329
|
+
onSubmit: Be,
|
|
330
|
+
children: /* @__PURE__ */ m("input", {
|
|
331
|
+
value: V,
|
|
332
|
+
onChange: (e) => H(e.target.value),
|
|
333
|
+
placeholder: T("addComment"),
|
|
334
|
+
"aria-label": T("addComment"),
|
|
335
|
+
className: "h-9 w-full rounded-md bg-transparent px-2 text-sm outline-none placeholder:text-muted-foreground hover:bg-muted focus:bg-muted"
|
|
336
|
+
})
|
|
337
|
+
})
|
|
338
|
+
]
|
|
339
|
+
}),
|
|
340
|
+
!R && /* @__PURE__ */ h("section", {
|
|
341
|
+
"aria-label": T("templates"),
|
|
342
|
+
className: "mt-6 border-t border-border pt-4",
|
|
343
|
+
children: [/* @__PURE__ */ m("p", {
|
|
344
|
+
className: "mb-2 text-sm text-muted-foreground",
|
|
345
|
+
children: T("hint")
|
|
346
|
+
}), /* @__PURE__ */ h("ul", {
|
|
347
|
+
className: "space-y-0.5",
|
|
348
|
+
children: [q.map((e, t) => /* @__PURE__ */ m("li", { children: /* @__PURE__ */ h("button", {
|
|
349
|
+
type: "button",
|
|
350
|
+
"aria-current": t === z || void 0,
|
|
351
|
+
onMouseEnter: () => B(t),
|
|
352
|
+
onClick: () => X(e),
|
|
353
|
+
className: he("flex h-8 w-full items-center gap-2 rounded-md px-2 text-left text-sm", t === z ? "bg-muted" : "hover:bg-muted"),
|
|
354
|
+
children: [/* @__PURE__ */ m(ue, { className: "size-4 shrink-0 text-muted-foreground" }), /* @__PURE__ */ m("span", {
|
|
355
|
+
className: "truncate",
|
|
356
|
+
children: e.label
|
|
357
|
+
})]
|
|
358
|
+
}) }, e.kind === "template" ? e.id : e.kind === "series" ? e.series.id : "empty")), /* @__PURE__ */ m("li", { children: /* @__PURE__ */ h("button", {
|
|
359
|
+
type: "button",
|
|
360
|
+
onClick: () => $.mutate(),
|
|
361
|
+
className: "flex h-8 w-full items-center gap-2 rounded-md px-2 text-left text-sm text-muted-foreground hover:bg-muted",
|
|
362
|
+
children: [/* @__PURE__ */ m(ce, { className: "size-4 shrink-0" }), T("newTemplate")]
|
|
363
|
+
}) })]
|
|
364
|
+
})]
|
|
365
|
+
}),
|
|
366
|
+
(U || $.error) && /* @__PURE__ */ m(pe, {
|
|
367
|
+
className: "mt-3",
|
|
368
|
+
children: O(U ?? $.error)
|
|
369
|
+
})
|
|
370
|
+
]
|
|
371
|
+
})]
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
export { v as NewPageModal };
|