@parallelworks/tandem-web 0.188.1 → 0.189.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 +3 -0
- package/_virtual/_virtual_i18n/es/common.js +3 -0
- package/_virtual/_virtual_i18n/ja/common.js +3 -0
- package/_virtual/_virtual_i18n/ko/common.js +3 -0
- package/_virtual/_virtual_i18n/zh/common.js +3 -0
- package/components/HoverCards.js +118 -115
- package/components/SubpageViews.js +335 -270
- package/package.json +1 -1
- package/pages/issues.js +306 -306
- package/routes/_workspace2.js +5 -4
|
@@ -10,19 +10,20 @@ import { usePropertyText as m } from "./DocProperties.js";
|
|
|
10
10
|
import { SeriesMenu as h } from "./DocSeries.js";
|
|
11
11
|
import { Board as g, groupable as _ } from "./DocTable.js";
|
|
12
12
|
import { iconImageURL as v } from "./EntityIcon.js";
|
|
13
|
-
import { AddIcon as y, ArticleIcon as b, BoardIcon as x, CalendarIcon as S, ChevronRightIcon as C, CycleIcon as
|
|
14
|
-
import { Button as
|
|
15
|
-
import { Link as
|
|
16
|
-
import { useMemo as
|
|
17
|
-
import { useErrorMessage as
|
|
18
|
-
import { useFormatter as
|
|
19
|
-
import { Fragment as
|
|
20
|
-
import { useQuery as
|
|
13
|
+
import { AddIcon as y, ArticleIcon as b, BoardIcon as x, CalendarIcon as S, ChevronRightIcon as C, CycleIcon as ee, GridIcon as w, ListViewIcon as T, SettingsIcon as E, SpreadsheetIcon as D, TimelineIcon as O } from "./icons.js";
|
|
14
|
+
import { Button as k, ErrorText as A, Input as te, Popover as j, Select as M, cx as N, useOpenMenu as P } from "@parallelworks/ui";
|
|
15
|
+
import { Link as F, useNavigate as ne } from "@tanstack/react-router";
|
|
16
|
+
import { useMemo as I, useRef as re, useState as ie } from "react";
|
|
17
|
+
import { useErrorMessage as L } from "@parallelworks/problem/react";
|
|
18
|
+
import { useFormatter as R, useLocale as ae, useTranslations as z } from "use-intl";
|
|
19
|
+
import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
|
|
20
|
+
import { keepPreviousData as oe, useQuery as U } from "@tanstack/react-query";
|
|
21
|
+
import { useVirtualizer as se } from "@tanstack/react-virtual";
|
|
21
22
|
// src/components/SubpageViews.tsx
|
|
22
|
-
var
|
|
23
|
+
var W = [
|
|
23
24
|
{
|
|
24
25
|
layout: "table",
|
|
25
|
-
icon:
|
|
26
|
+
icon: D,
|
|
26
27
|
message: "tableView",
|
|
27
28
|
database: !0
|
|
28
29
|
},
|
|
@@ -34,13 +35,13 @@ var q = [
|
|
|
34
35
|
},
|
|
35
36
|
{
|
|
36
37
|
layout: "list",
|
|
37
|
-
icon:
|
|
38
|
+
icon: T,
|
|
38
39
|
message: "listView",
|
|
39
40
|
database: !0
|
|
40
41
|
},
|
|
41
42
|
{
|
|
42
43
|
layout: "timeline",
|
|
43
|
-
icon:
|
|
44
|
+
icon: O,
|
|
44
45
|
message: "timelineView",
|
|
45
46
|
database: !0
|
|
46
47
|
},
|
|
@@ -52,7 +53,7 @@ var q = [
|
|
|
52
53
|
},
|
|
53
54
|
{
|
|
54
55
|
layout: "gallery",
|
|
55
|
-
icon:
|
|
56
|
+
icon: w,
|
|
56
57
|
message: "galleryView",
|
|
57
58
|
database: !0
|
|
58
59
|
},
|
|
@@ -62,55 +63,55 @@ var q = [
|
|
|
62
63
|
message: "feed",
|
|
63
64
|
database: !1
|
|
64
65
|
}
|
|
65
|
-
],
|
|
66
|
-
function
|
|
66
|
+
], G = (e) => W.find((t) => t.layout === e) ?? W[4], K = (e) => e === "calendar" || e === "timeline", q = (e, t) => new Date(e.getFullYear(), e.getMonth(), e.getDate() + t);
|
|
67
|
+
function ce(e) {
|
|
67
68
|
let t = new Intl.Locale(e);
|
|
68
69
|
return (t.getWeekInfo?.().firstDay ?? t.weekInfo?.firstDay ?? 7) % 7;
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
-
let r =
|
|
71
|
+
function le({ workspace: e, doc: t, space: n }) {
|
|
72
|
+
let r = z("subpages"), { data: i = [] } = U(d(e, t.key)), [a, o] = ie(), s = l(e, "edit_docs", n === "workspace" ? void 0 : { team: n }), c = f(e);
|
|
72
73
|
if (i.length === 0) return null;
|
|
73
74
|
let p = i.find((e) => e.id === a) ?? i[0], m = (e) => c.addView.mutate({
|
|
74
75
|
doc: t.key,
|
|
75
|
-
name: r(
|
|
76
|
+
name: r(G(e).message),
|
|
76
77
|
layout: e,
|
|
77
78
|
config: { ...u(p.config) }
|
|
78
79
|
}, { onSuccess: (e) => o(e.id) });
|
|
79
|
-
return /* @__PURE__ */
|
|
80
|
+
return /* @__PURE__ */ H("section", {
|
|
80
81
|
className: "not-prose my-4",
|
|
81
82
|
"aria-label": r("views"),
|
|
82
|
-
children: [/* @__PURE__ */
|
|
83
|
+
children: [/* @__PURE__ */ H("div", {
|
|
83
84
|
className: "flex items-center gap-1 border-b border-border",
|
|
84
85
|
children: [i.map((e) => {
|
|
85
|
-
let t =
|
|
86
|
-
return /* @__PURE__ */
|
|
86
|
+
let t = G(e.layout).icon;
|
|
87
|
+
return /* @__PURE__ */ H("button", {
|
|
87
88
|
type: "button",
|
|
88
89
|
onClick: () => o(e.id),
|
|
89
90
|
"aria-pressed": e.id === p.id,
|
|
90
|
-
className:
|
|
91
|
-
children: [/* @__PURE__ */
|
|
91
|
+
className: N("-mb-px flex items-center gap-1.5 border-b-2 px-2 py-1.5 text-sm", e.id === p.id ? "border-foreground font-medium" : "border-transparent text-muted-foreground hover:text-foreground"),
|
|
92
|
+
children: [/* @__PURE__ */ V(t, { className: "size-4" }), e.name]
|
|
92
93
|
}, e.id);
|
|
93
|
-
}), s && /* @__PURE__ */
|
|
94
|
-
trigger: /* @__PURE__ */
|
|
94
|
+
}), s && /* @__PURE__ */ V(j, {
|
|
95
|
+
trigger: /* @__PURE__ */ V(k, {
|
|
95
96
|
size: "xs",
|
|
96
97
|
variant: "ghost",
|
|
97
98
|
"aria-label": r("addView"),
|
|
98
|
-
children: /* @__PURE__ */
|
|
99
|
+
children: /* @__PURE__ */ V(y, {})
|
|
99
100
|
}),
|
|
100
101
|
align: "start",
|
|
101
102
|
"aria-label": r("addView"),
|
|
102
|
-
children: /* @__PURE__ */
|
|
103
|
+
children: /* @__PURE__ */ V("div", {
|
|
103
104
|
className: "flex flex-col gap-1",
|
|
104
|
-
children:
|
|
105
|
+
children: W.map(({ layout: e, icon: t, message: n }) => /* @__PURE__ */ H(k, {
|
|
105
106
|
size: "sm",
|
|
106
107
|
variant: "ghost",
|
|
107
108
|
className: "justify-start",
|
|
108
109
|
onClick: () => m(e),
|
|
109
|
-
children: [/* @__PURE__ */
|
|
110
|
+
children: [/* @__PURE__ */ V(t, {}), r(n)]
|
|
110
111
|
}, e))
|
|
111
112
|
})
|
|
112
113
|
})]
|
|
113
|
-
}), /* @__PURE__ */
|
|
114
|
+
}), /* @__PURE__ */ V(ue, {
|
|
114
115
|
workspace: e,
|
|
115
116
|
doc: t,
|
|
116
117
|
space: n,
|
|
@@ -119,17 +120,17 @@ function Z({ workspace: e, doc: t, space: n }) {
|
|
|
119
120
|
}, p.id)]
|
|
120
121
|
});
|
|
121
122
|
}
|
|
122
|
-
function
|
|
123
|
-
let d =
|
|
123
|
+
function ue({ workspace: e, doc: a, space: o, view: s, canWrite: l }) {
|
|
124
|
+
let d = z("subpages"), m = L(), v = ne(), b = u(s.config), { data: x = [] } = U(t(e, { parent: a.key })), { data: S = [] } = U(i(e, o)), C = S.find((e) => e.id === b.dateProperty && e.kind === "date"), ee = S.find((e) => e.id === b.groupBy && _(e)), [w, T] = ie(""), E = f(e), D = w.trim().toLowerCase(), O = D ? x.filter((e) => e.title.toLowerCase().includes(D)) : x, M = (e) => {
|
|
124
125
|
let t = C && e.properties?.[C.id];
|
|
125
126
|
return typeof t == "string" && n(t) ? t : void 0;
|
|
126
|
-
},
|
|
127
|
+
}, N = O.filter((e) => !M(e)), P = (t, n) => E.newSubpage.mutate({
|
|
127
128
|
parent: a,
|
|
128
129
|
title: t ? d("titleOn", {
|
|
129
130
|
title: a.title,
|
|
130
131
|
date: t
|
|
131
132
|
}) : d("untitled"),
|
|
132
|
-
template: b.template,
|
|
133
|
+
template: n === void 0 ? b.template : n ?? void 0,
|
|
133
134
|
dateProperty: C?.id,
|
|
134
135
|
date: t
|
|
135
136
|
}, { onSuccess: (t) => v({
|
|
@@ -138,52 +139,52 @@ function ne({ workspace: e, doc: a, space: o, view: s, canWrite: l }) {
|
|
|
138
139
|
workspace: e,
|
|
139
140
|
doc: c(t)
|
|
140
141
|
}
|
|
141
|
-
}) }),
|
|
142
|
-
C &&
|
|
143
|
-
trigger: /* @__PURE__ */
|
|
142
|
+
}) }), I = /* @__PURE__ */ H(B, { children: [
|
|
143
|
+
C && K(s.layout) && /* @__PURE__ */ V(j, {
|
|
144
|
+
trigger: /* @__PURE__ */ V(k, {
|
|
144
145
|
size: "xs",
|
|
145
146
|
variant: "ghost",
|
|
146
|
-
children: d("noDate", { count:
|
|
147
|
+
children: d("noDate", { count: N.length })
|
|
147
148
|
}),
|
|
148
149
|
align: "start",
|
|
149
150
|
className: "max-h-80 w-72 overflow-y-auto",
|
|
150
151
|
"aria-label": d("noDateTitle"),
|
|
151
|
-
children:
|
|
152
|
+
children: N.length === 0 ? /* @__PURE__ */ V("p", {
|
|
152
153
|
className: "text-sm text-muted-foreground",
|
|
153
154
|
children: d("allDated")
|
|
154
|
-
}) : /* @__PURE__ */
|
|
155
|
+
}) : /* @__PURE__ */ V("ul", {
|
|
155
156
|
className: "space-y-1",
|
|
156
|
-
children:
|
|
157
|
+
children: N.map((t) => /* @__PURE__ */ V("li", { children: /* @__PURE__ */ H(F, {
|
|
157
158
|
to: "/$workspace/docs/$doc",
|
|
158
159
|
params: {
|
|
159
160
|
workspace: e,
|
|
160
161
|
doc: c(t)
|
|
161
162
|
},
|
|
162
163
|
className: "flex items-center gap-1.5 truncate text-sm hover:underline",
|
|
163
|
-
children: [/* @__PURE__ */
|
|
164
|
+
children: [/* @__PURE__ */ V(p, { icon: t.icon }), /* @__PURE__ */ V("span", {
|
|
164
165
|
className: "truncate",
|
|
165
166
|
children: t.title
|
|
166
167
|
})]
|
|
167
168
|
}) }, t.id))
|
|
168
169
|
})
|
|
169
170
|
}),
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ V(te, {
|
|
171
172
|
type: "search",
|
|
172
173
|
size: "sm",
|
|
173
|
-
value:
|
|
174
|
-
onChange: (e) =>
|
|
174
|
+
value: w,
|
|
175
|
+
onChange: (e) => T(e.target.value),
|
|
175
176
|
placeholder: d("search"),
|
|
176
177
|
"aria-label": d("search"),
|
|
177
178
|
className: "w-40"
|
|
178
179
|
}),
|
|
179
|
-
l && /* @__PURE__ */
|
|
180
|
-
/* @__PURE__ */
|
|
180
|
+
l && /* @__PURE__ */ H(B, { children: [
|
|
181
|
+
/* @__PURE__ */ V(J, {
|
|
181
182
|
workspace: e,
|
|
182
183
|
space: o,
|
|
183
184
|
view: s,
|
|
184
185
|
config: b
|
|
185
186
|
}),
|
|
186
|
-
C && /* @__PURE__ */
|
|
187
|
+
C && /* @__PURE__ */ V(h, {
|
|
187
188
|
workspace: e,
|
|
188
189
|
space: o,
|
|
189
190
|
dateProperty: C.id,
|
|
@@ -192,69 +193,70 @@ function ne({ workspace: e, doc: a, space: o, view: s, canWrite: l }) {
|
|
|
192
193
|
key: a.key
|
|
193
194
|
}
|
|
194
195
|
}),
|
|
195
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ H(k, {
|
|
196
197
|
size: "xs",
|
|
197
198
|
variant: "primary",
|
|
198
|
-
loading:
|
|
199
|
-
onClick: () =>
|
|
200
|
-
children: [/* @__PURE__ */
|
|
199
|
+
loading: E.newSubpage.isPending,
|
|
200
|
+
onClick: () => P(C ? r(/* @__PURE__ */ new Date()) : void 0),
|
|
201
|
+
children: [/* @__PURE__ */ V(y, {}), d("new")]
|
|
201
202
|
})
|
|
202
203
|
] })
|
|
203
204
|
] });
|
|
204
|
-
return /* @__PURE__ */
|
|
205
|
+
return /* @__PURE__ */ H("div", {
|
|
205
206
|
className: "pt-2",
|
|
206
|
-
children: [
|
|
207
|
+
children: [E.newSubpage.error && /* @__PURE__ */ V(A, { children: m(E.newSubpage.error) }), s.layout === "feed" ? /* @__PURE__ */ V(Q, {
|
|
207
208
|
workspace: e,
|
|
208
|
-
docs:
|
|
209
|
-
dateOf:
|
|
210
|
-
toolbar:
|
|
211
|
-
}) : s.layout === "table" ? /* @__PURE__ */
|
|
209
|
+
docs: O,
|
|
210
|
+
dateOf: M,
|
|
211
|
+
toolbar: I
|
|
212
|
+
}) : s.layout === "table" ? /* @__PURE__ */ V(he, {
|
|
212
213
|
workspace: e,
|
|
213
|
-
docs:
|
|
214
|
+
docs: O,
|
|
214
215
|
props: S,
|
|
215
|
-
toolbar:
|
|
216
|
-
}) : s.layout === "list" ? /* @__PURE__ */
|
|
216
|
+
toolbar: I
|
|
217
|
+
}) : s.layout === "list" ? /* @__PURE__ */ V(ge, {
|
|
217
218
|
workspace: e,
|
|
218
|
-
docs:
|
|
219
|
-
toolbar:
|
|
220
|
-
}) : s.layout === "gallery" ? /* @__PURE__ */
|
|
219
|
+
docs: O,
|
|
220
|
+
toolbar: I
|
|
221
|
+
}) : s.layout === "gallery" ? /* @__PURE__ */ V(_e, {
|
|
221
222
|
workspace: e,
|
|
222
|
-
docs:
|
|
223
|
-
toolbar:
|
|
224
|
-
}) : s.layout === "board" ?
|
|
223
|
+
docs: O,
|
|
224
|
+
toolbar: I
|
|
225
|
+
}) : s.layout === "board" ? ee ? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("div", {
|
|
225
226
|
className: "flex flex-wrap items-center gap-1 py-2",
|
|
226
|
-
children:
|
|
227
|
-
}), /* @__PURE__ */
|
|
227
|
+
children: I
|
|
228
|
+
}), /* @__PURE__ */ V(g, {
|
|
228
229
|
workspace: e,
|
|
229
230
|
space: o,
|
|
230
|
-
docs:
|
|
231
|
+
docs: O,
|
|
231
232
|
props: S,
|
|
232
|
-
by:
|
|
233
|
-
})] }) : /* @__PURE__ */
|
|
233
|
+
by: ee
|
|
234
|
+
})] }) : /* @__PURE__ */ H("div", {
|
|
234
235
|
className: "flex flex-wrap items-center gap-2 py-3 text-sm text-muted-foreground",
|
|
235
|
-
children: [d("pickGroup"), l && /* @__PURE__ */
|
|
236
|
+
children: [d("pickGroup"), l && /* @__PURE__ */ V(J, {
|
|
236
237
|
workspace: e,
|
|
237
238
|
space: o,
|
|
238
239
|
view: s,
|
|
239
240
|
config: b,
|
|
240
241
|
open: !0
|
|
241
242
|
})]
|
|
242
|
-
}) : C ? s.layout === "timeline" ? /* @__PURE__ */
|
|
243
|
+
}) : C ? s.layout === "timeline" ? /* @__PURE__ */ V(ve, {
|
|
243
244
|
workspace: e,
|
|
244
|
-
docs:
|
|
245
|
-
dateOf:
|
|
246
|
-
toolbar:
|
|
247
|
-
}) : /* @__PURE__ */
|
|
245
|
+
docs: O,
|
|
246
|
+
dateOf: M,
|
|
247
|
+
toolbar: I
|
|
248
|
+
}) : /* @__PURE__ */ V(pe, {
|
|
248
249
|
workspace: e,
|
|
249
|
-
docs:
|
|
250
|
-
dateOf:
|
|
251
|
-
toolbar:
|
|
250
|
+
docs: O,
|
|
251
|
+
dateOf: M,
|
|
252
|
+
toolbar: I,
|
|
252
253
|
parent: a,
|
|
253
254
|
space: o,
|
|
254
|
-
|
|
255
|
-
|
|
255
|
+
viewTemplate: b.template,
|
|
256
|
+
onNew: l ? (e, t) => P(e, t) : void 0
|
|
257
|
+
}) : /* @__PURE__ */ H("div", {
|
|
256
258
|
className: "flex flex-wrap items-center gap-2 py-3 text-sm text-muted-foreground",
|
|
257
|
-
children: [s.layout === "timeline" ? d("pickTimelineDate") : d("pickDate"), l && /* @__PURE__ */
|
|
259
|
+
children: [s.layout === "timeline" ? d("pickTimelineDate") : d("pickDate"), l && /* @__PURE__ */ V(J, {
|
|
258
260
|
workspace: e,
|
|
259
261
|
space: o,
|
|
260
262
|
view: s,
|
|
@@ -264,32 +266,32 @@ function ne({ workspace: e, doc: a, space: o, view: s, canWrite: l }) {
|
|
|
264
266
|
})]
|
|
265
267
|
});
|
|
266
268
|
}
|
|
267
|
-
function
|
|
268
|
-
let c =
|
|
269
|
+
function J({ workspace: t, space: n, view: r, config: o, open: s }) {
|
|
270
|
+
let c = z("subpages"), l = L(), u = f(t), d = a(t), { data: p = [] } = U(i(t, n)), { data: m = [] } = U(e(t)), h = p.filter((e) => e.kind === "date"), g = p.filter(_), v = (e) => u.updateView.mutate({
|
|
269
271
|
view: r,
|
|
270
272
|
config: { ...e }
|
|
271
273
|
}), y = "block text-xs font-medium text-muted-foreground";
|
|
272
|
-
return /* @__PURE__ */
|
|
273
|
-
trigger: s ? /* @__PURE__ */
|
|
274
|
+
return /* @__PURE__ */ V(j, {
|
|
275
|
+
trigger: s ? /* @__PURE__ */ V(k, {
|
|
274
276
|
size: "xs",
|
|
275
277
|
children: c("settings")
|
|
276
|
-
}) : /* @__PURE__ */
|
|
278
|
+
}) : /* @__PURE__ */ V(k, {
|
|
277
279
|
size: "xs",
|
|
278
280
|
variant: "ghost",
|
|
279
281
|
"aria-label": c("settings"),
|
|
280
|
-
children: /* @__PURE__ */
|
|
282
|
+
children: /* @__PURE__ */ V(E, {})
|
|
281
283
|
}),
|
|
282
284
|
align: "end",
|
|
283
285
|
className: "w-72",
|
|
284
286
|
"aria-label": c("settings"),
|
|
285
|
-
children: /* @__PURE__ */
|
|
287
|
+
children: /* @__PURE__ */ H("div", {
|
|
286
288
|
className: "space-y-3",
|
|
287
289
|
children: [
|
|
288
|
-
r.layout === "board" && /* @__PURE__ */
|
|
290
|
+
r.layout === "board" && /* @__PURE__ */ H("div", {
|
|
289
291
|
className: y,
|
|
290
|
-
children: [c("groupBy"), /* @__PURE__ */
|
|
292
|
+
children: [c("groupBy"), /* @__PURE__ */ H("div", {
|
|
291
293
|
className: "mt-1 flex items-center gap-2",
|
|
292
|
-
children: [g.length > 0 && /* @__PURE__ */
|
|
294
|
+
children: [g.length > 0 && /* @__PURE__ */ V(M, {
|
|
293
295
|
value: o.groupBy ?? "",
|
|
294
296
|
items: [{
|
|
295
297
|
value: "",
|
|
@@ -304,7 +306,7 @@ function Q({ workspace: t, space: n, view: r, config: o, open: s }) {
|
|
|
304
306
|
}),
|
|
305
307
|
"aria-label": c("groupBy"),
|
|
306
308
|
size: "sm"
|
|
307
|
-
}), /* @__PURE__ */
|
|
309
|
+
}), /* @__PURE__ */ V(k, {
|
|
308
310
|
size: "xs",
|
|
309
311
|
loading: d.create.isPending,
|
|
310
312
|
onClick: async () => {
|
|
@@ -327,11 +329,11 @@ function Q({ workspace: t, space: n, view: r, config: o, open: s }) {
|
|
|
327
329
|
})]
|
|
328
330
|
})]
|
|
329
331
|
}),
|
|
330
|
-
(
|
|
332
|
+
(K(r.layout) || r.layout === "feed") && /* @__PURE__ */ H("div", {
|
|
331
333
|
className: y,
|
|
332
|
-
children: [c("dateProperty"), /* @__PURE__ */
|
|
334
|
+
children: [c("dateProperty"), /* @__PURE__ */ H("div", {
|
|
333
335
|
className: "mt-1 flex items-center gap-2",
|
|
334
|
-
children: [h.length > 0 && /* @__PURE__ */
|
|
336
|
+
children: [h.length > 0 && /* @__PURE__ */ V(M, {
|
|
335
337
|
value: o.dateProperty ?? "",
|
|
336
338
|
items: [{
|
|
337
339
|
value: "",
|
|
@@ -346,7 +348,7 @@ function Q({ workspace: t, space: n, view: r, config: o, open: s }) {
|
|
|
346
348
|
}),
|
|
347
349
|
"aria-label": c("dateProperty"),
|
|
348
350
|
size: "sm"
|
|
349
|
-
}), /* @__PURE__ */
|
|
351
|
+
}), /* @__PURE__ */ V(k, {
|
|
350
352
|
size: "xs",
|
|
351
353
|
loading: d.create.isPending,
|
|
352
354
|
onClick: async () => {
|
|
@@ -364,11 +366,11 @@ function Q({ workspace: t, space: n, view: r, config: o, open: s }) {
|
|
|
364
366
|
})]
|
|
365
367
|
})]
|
|
366
368
|
}),
|
|
367
|
-
/* @__PURE__ */
|
|
369
|
+
/* @__PURE__ */ H("div", {
|
|
368
370
|
className: y,
|
|
369
|
-
children: [c("template"), /* @__PURE__ */
|
|
371
|
+
children: [c("template"), /* @__PURE__ */ V("div", {
|
|
370
372
|
className: "mt-1",
|
|
371
|
-
children: /* @__PURE__ */
|
|
373
|
+
children: /* @__PURE__ */ V(M, {
|
|
372
374
|
value: o.template ?? "",
|
|
373
375
|
items: [{
|
|
374
376
|
value: "",
|
|
@@ -386,8 +388,8 @@ function Q({ workspace: t, space: n, view: r, config: o, open: s }) {
|
|
|
386
388
|
})
|
|
387
389
|
})]
|
|
388
390
|
}),
|
|
389
|
-
(u.updateView.error ?? d.create.error) && /* @__PURE__ */
|
|
390
|
-
/* @__PURE__ */
|
|
391
|
+
(u.updateView.error ?? d.create.error) && /* @__PURE__ */ V(A, { children: l(u.updateView.error ?? d.create.error) }),
|
|
392
|
+
/* @__PURE__ */ V(k, {
|
|
391
393
|
size: "xs",
|
|
392
394
|
variant: "danger",
|
|
393
395
|
onClick: () => u.removeView.mutate(r),
|
|
@@ -397,178 +399,241 @@ function Q({ workspace: t, space: n, view: r, config: o, open: s }) {
|
|
|
397
399
|
})
|
|
398
400
|
});
|
|
399
401
|
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
+
var Y = 128, de = 3, X = 32, Z = 5200, fe = (e, t) => Math.round((Date.UTC(t.getFullYear(), t.getMonth(), t.getDate()) - Date.UTC(e.getFullYear(), e.getMonth(), e.getDate())) / 864e5);
|
|
403
|
+
function pe({ workspace: t, docs: i, dateOf: a, toolbar: l, parent: u, space: d, viewTemplate: f, onNew: m }) {
|
|
404
|
+
let h = z("subpages"), g = R(), _ = ae(), v = ne(), b = P(), x = I(() => /* @__PURE__ */ new Date(), []), S = ce(_), w = I(() => q(x, -((x.getDay() - S + 7) % 7) - Z * 7), [x, S]), T = (e) => Math.floor(fe(w, e) / 7), E = (e) => q(w, e * 7), D = re(null), [O, A] = ie(() => new Date(x.getFullYear(), x.getMonth(), 1)), te = (e, t) => {
|
|
405
|
+
let n = Math.max(0, Math.floor((e + t / 2 - X) / Y)), r = q(E(n), 3);
|
|
406
|
+
return new Date(r.getFullYear(), r.getMonth(), 1);
|
|
407
|
+
}, M = se({
|
|
408
|
+
count: 10401,
|
|
409
|
+
getScrollElement: () => D.current,
|
|
410
|
+
estimateSize: () => Y,
|
|
411
|
+
overscan: 3,
|
|
412
|
+
scrollMargin: X,
|
|
413
|
+
initialOffset: 5199 * Y,
|
|
414
|
+
onChange: (e) => {
|
|
415
|
+
let t = te(e.scrollOffset ?? 0, e.scrollRect?.height ?? 0);
|
|
416
|
+
A((e) => e.getTime() === t.getTime() ? e : t);
|
|
417
|
+
}
|
|
418
|
+
}), L = (e) => {
|
|
419
|
+
A(e), M.scrollToIndex(T(e), { align: "start" });
|
|
420
|
+
}, B = M.getVirtualItems(), W = E(B[0]?.index ?? Z), G = q(E(B[B.length - 1]?.index ?? Z), 6), { data: K = [] } = U({
|
|
421
|
+
...o(t, d, r(new Date(W.getFullYear(), W.getMonth(), 1)), r(new Date(G.getFullYear(), G.getMonth() + 1, 0))),
|
|
422
|
+
placeholderData: oe
|
|
423
|
+
}), le = s(t), { data: ue = [] } = U(e(t)), J = I(() => {
|
|
402
424
|
let e = /* @__PURE__ */ new Map();
|
|
403
|
-
for (let
|
|
404
|
-
let
|
|
405
|
-
|
|
425
|
+
for (let t of i) {
|
|
426
|
+
let n = a(t);
|
|
427
|
+
n && e.set(n, [...e.get(n) ?? [], t]);
|
|
406
428
|
}
|
|
407
429
|
return e;
|
|
408
|
-
}, [
|
|
430
|
+
}, [i, a]), pe = I(() => {
|
|
409
431
|
let e = /* @__PURE__ */ new Map();
|
|
410
|
-
for (let t of
|
|
432
|
+
for (let t of K) if (t.parentId === u.id && !t.stoppedAt) for (let n of t.upcoming ?? []) e.set(n, [...e.get(n) ?? [], t]);
|
|
411
433
|
return e;
|
|
412
|
-
}, [
|
|
434
|
+
}, [K, u.id]), Q = r(x), me = (e) => /* @__PURE__ */ H(F, {
|
|
413
435
|
to: "/$workspace/docs/$doc",
|
|
414
436
|
params: {
|
|
415
|
-
workspace:
|
|
416
|
-
doc: c(
|
|
437
|
+
workspace: t,
|
|
438
|
+
doc: c(e)
|
|
417
439
|
},
|
|
418
440
|
className: "flex min-w-0 items-center gap-1 rounded bg-card px-1.5 py-0.5 text-xs shadow-xs ring-1 ring-border hover:bg-accent",
|
|
419
|
-
children: [/* @__PURE__ */
|
|
441
|
+
children: [/* @__PURE__ */ V(p, { icon: e.icon }), /* @__PURE__ */ V("span", {
|
|
420
442
|
className: "truncate",
|
|
421
|
-
children:
|
|
443
|
+
children: e.title
|
|
422
444
|
})]
|
|
423
|
-
},
|
|
445
|
+
}, e.id), he = (e, n) => /* @__PURE__ */ H("button", {
|
|
424
446
|
type: "button",
|
|
425
|
-
disabled: !
|
|
426
|
-
onClick: () =>
|
|
427
|
-
id:
|
|
447
|
+
disabled: !m || le.makeDoc.isPending,
|
|
448
|
+
onClick: () => le.makeDoc.mutate({
|
|
449
|
+
id: e.id,
|
|
428
450
|
day: n
|
|
429
|
-
}, { onSuccess: (
|
|
451
|
+
}, { onSuccess: (e) => v({
|
|
430
452
|
to: "/$workspace/docs/$doc",
|
|
431
453
|
params: {
|
|
432
|
-
workspace:
|
|
433
|
-
doc: c(
|
|
454
|
+
workspace: t,
|
|
455
|
+
doc: c(e)
|
|
434
456
|
}
|
|
435
457
|
}) }),
|
|
436
|
-
"aria-label":
|
|
458
|
+
"aria-label": h("makeSeriesDoc", { series: e.title }),
|
|
437
459
|
className: "flex min-w-0 items-center gap-1 rounded border border-dashed border-border px-1.5 py-0.5 text-left text-xs text-muted-foreground enabled:hover:border-primary enabled:hover:text-foreground",
|
|
438
|
-
children: [/* @__PURE__ */
|
|
460
|
+
children: [/* @__PURE__ */ V(ee, { className: "size-3 shrink-0" }), /* @__PURE__ */ V("span", {
|
|
439
461
|
className: "truncate",
|
|
440
|
-
children:
|
|
462
|
+
children: e.title
|
|
441
463
|
})]
|
|
442
|
-
}, `${
|
|
464
|
+
}, `${e.id}-${n}`), ge = ue.filter((e) => e.starter || !e.teamId || e.teamId === u.teamId).sort((e, t) => Number(t.id === f) - Number(e.id === f)), _e = (e, t = !1) => m && /* @__PURE__ */ V("button", {
|
|
443
465
|
type: "button",
|
|
444
|
-
onClick: () =>
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
466
|
+
onClick: (t) => b(t, [
|
|
467
|
+
...ge.filter((e) => e.id === f).map((t) => ({
|
|
468
|
+
label: h("fromTemplateDefault", { template: t.title }),
|
|
469
|
+
onClick: () => m(e, t.id)
|
|
470
|
+
})),
|
|
471
|
+
{
|
|
472
|
+
label: h("emptyPage"),
|
|
473
|
+
onClick: () => m(e, null)
|
|
474
|
+
},
|
|
475
|
+
...ge.filter((e) => e.id !== f).map((t) => ({
|
|
476
|
+
label: t.title,
|
|
477
|
+
onClick: () => m(e, t.id)
|
|
478
|
+
}))
|
|
479
|
+
]),
|
|
480
|
+
"aria-label": h("newOn", { date: g.dateTime(n(e), { dateStyle: "medium" }) }),
|
|
481
|
+
className: N("rounded p-0.5 text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:opacity-100", !t && "opacity-0 group-hover:opacity-100"),
|
|
482
|
+
children: /* @__PURE__ */ V(y, { className: "size-3.5" })
|
|
483
|
+
}), $ = (e) => e.getDay() === 0 || e.getDay() === 6, ve = (e) => e.getMonth() === O.getMonth() && e.getFullYear() === O.getFullYear(), ye = (e) => [...(J.get(e) ?? []).map(me), ...(pe.get(e) ?? []).map((t) => he(t, e))], be = Array.from({ length: new Date(O.getFullYear(), O.getMonth() + 1, 0).getDate() }, (e, t) => new Date(O.getFullYear(), O.getMonth(), t + 1)).filter((e) => J.has(r(e)) || pe.has(r(e)) || r(e) === Q);
|
|
484
|
+
return /* @__PURE__ */ H("div", {
|
|
450
485
|
className: "flex flex-col",
|
|
451
486
|
children: [
|
|
452
|
-
/* @__PURE__ */
|
|
487
|
+
/* @__PURE__ */ H("div", {
|
|
453
488
|
className: "flex flex-wrap items-center gap-2 py-2",
|
|
454
489
|
children: [
|
|
455
|
-
/* @__PURE__ */
|
|
456
|
-
className: "text-base font-semibold",
|
|
457
|
-
|
|
490
|
+
/* @__PURE__ */ H("h3", {
|
|
491
|
+
className: "grid text-base font-semibold tabular-nums",
|
|
492
|
+
"aria-live": "polite",
|
|
493
|
+
children: [Array.from({ length: 12 }, (e, t) => g.dateTime(new Date(O.getFullYear(), t, 1), {
|
|
458
494
|
month: "long",
|
|
459
495
|
year: "numeric"
|
|
460
|
-
})
|
|
496
|
+
})).map((e) => /* @__PURE__ */ V("span", {
|
|
497
|
+
"aria-hidden": !0,
|
|
498
|
+
className: "invisible col-start-1 row-start-1",
|
|
499
|
+
children: e
|
|
500
|
+
}, e)), /* @__PURE__ */ V("span", {
|
|
501
|
+
className: "col-start-1 row-start-1",
|
|
502
|
+
children: g.dateTime(O, {
|
|
503
|
+
month: "long",
|
|
504
|
+
year: "numeric"
|
|
505
|
+
})
|
|
506
|
+
})]
|
|
461
507
|
}),
|
|
462
|
-
/* @__PURE__ */
|
|
508
|
+
/* @__PURE__ */ V("span", {
|
|
463
509
|
className: "flex flex-wrap items-center gap-1",
|
|
464
|
-
children:
|
|
510
|
+
children: l
|
|
465
511
|
}),
|
|
466
|
-
/* @__PURE__ */
|
|
512
|
+
/* @__PURE__ */ H("span", {
|
|
467
513
|
className: "ml-auto flex items-center gap-1",
|
|
468
514
|
children: [
|
|
469
|
-
/* @__PURE__ */
|
|
515
|
+
/* @__PURE__ */ V(k, {
|
|
470
516
|
size: "xs",
|
|
471
517
|
variant: "ghost",
|
|
472
|
-
onClick: () =>
|
|
473
|
-
"aria-label":
|
|
474
|
-
children: /* @__PURE__ */
|
|
518
|
+
onClick: () => L(new Date(O.getFullYear(), O.getMonth() - 1, 1)),
|
|
519
|
+
"aria-label": h("previousMonth"),
|
|
520
|
+
children: /* @__PURE__ */ V(C, { className: "rotate-180" })
|
|
475
521
|
}),
|
|
476
|
-
/* @__PURE__ */
|
|
522
|
+
/* @__PURE__ */ V(k, {
|
|
477
523
|
size: "xs",
|
|
478
524
|
variant: "ghost",
|
|
479
|
-
onClick: () =>
|
|
480
|
-
children:
|
|
525
|
+
onClick: () => L(new Date(x.getFullYear(), x.getMonth(), 1)),
|
|
526
|
+
children: h("today")
|
|
481
527
|
}),
|
|
482
|
-
/* @__PURE__ */
|
|
528
|
+
/* @__PURE__ */ V(k, {
|
|
483
529
|
size: "xs",
|
|
484
530
|
variant: "ghost",
|
|
485
|
-
onClick: () =>
|
|
486
|
-
"aria-label":
|
|
487
|
-
children: /* @__PURE__ */
|
|
531
|
+
onClick: () => L(new Date(O.getFullYear(), O.getMonth() + 1, 1)),
|
|
532
|
+
"aria-label": h("nextMonth"),
|
|
533
|
+
children: /* @__PURE__ */ V(C, {})
|
|
488
534
|
})
|
|
489
535
|
]
|
|
490
536
|
})
|
|
491
537
|
]
|
|
492
538
|
}),
|
|
493
|
-
/* @__PURE__ */
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
539
|
+
/* @__PURE__ */ H("div", {
|
|
540
|
+
ref: D,
|
|
541
|
+
className: "h-[min(72vh,760px)] overflow-y-auto rounded-md border border-border max-sm:hidden",
|
|
542
|
+
children: [/* @__PURE__ */ V("div", {
|
|
543
|
+
className: "sticky top-0 z-10 grid grid-cols-7 border-b border-border bg-card text-xs text-muted-foreground",
|
|
544
|
+
style: { height: X },
|
|
545
|
+
children: Array.from({ length: 7 }, (e, t) => q(w, t)).map((e) => /* @__PURE__ */ V("span", {
|
|
546
|
+
className: N("flex items-center px-2", $(e) && "bg-muted/40"),
|
|
547
|
+
children: g.dateTime(e, { weekday: "short" })
|
|
500
548
|
}, e.getDay()))
|
|
501
|
-
}), /* @__PURE__ */
|
|
502
|
-
className: "
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
549
|
+
}), /* @__PURE__ */ V("ol", {
|
|
550
|
+
className: "relative",
|
|
551
|
+
style: { height: M.getTotalSize() - X },
|
|
552
|
+
"aria-label": h("calendarView"),
|
|
553
|
+
children: B.map((e) => /* @__PURE__ */ V("li", {
|
|
554
|
+
className: "absolute inset-x-0",
|
|
555
|
+
style: {
|
|
556
|
+
height: Y,
|
|
557
|
+
transform: `translateY(${e.start - X}px)`
|
|
558
|
+
},
|
|
559
|
+
children: /* @__PURE__ */ V("ol", {
|
|
560
|
+
className: "grid h-full grid-cols-7",
|
|
561
|
+
children: Array.from({ length: 7 }, (t, n) => q(E(e.index), n)).map((e) => {
|
|
562
|
+
let t = r(e), n = ye(t), i = n.length - de;
|
|
563
|
+
return /* @__PURE__ */ H("li", {
|
|
564
|
+
"aria-label": g.dateTime(e, { dateStyle: "full" }),
|
|
565
|
+
className: N("group flex min-w-0 flex-col gap-1 overflow-hidden border-r border-b border-border p-1 last:border-r-0", $(e) && "bg-muted/40", !ve(e) && "text-muted-foreground"),
|
|
566
|
+
children: [
|
|
567
|
+
/* @__PURE__ */ H("span", {
|
|
568
|
+
className: "flex items-center justify-between",
|
|
569
|
+
children: [_e(t), /* @__PURE__ */ V("span", {
|
|
570
|
+
className: N("ml-auto flex h-6 min-w-6 items-center justify-center whitespace-nowrap rounded-full px-1 text-xs tabular-nums", t === Q && "bg-primary font-medium text-primary-foreground", e.getDate() === 1 && t !== Q && "font-medium"),
|
|
571
|
+
children: e.getDate() === 1 ? g.dateTime(e, {
|
|
572
|
+
month: "short",
|
|
573
|
+
day: "numeric"
|
|
574
|
+
}) : e.getDate()
|
|
575
|
+
})]
|
|
576
|
+
}),
|
|
577
|
+
n.slice(0, i > 0 ? 2 : de),
|
|
578
|
+
i > 0 && /* @__PURE__ */ V(j, {
|
|
579
|
+
trigger: /* @__PURE__ */ V("button", {
|
|
580
|
+
type: "button",
|
|
581
|
+
className: "self-start rounded px-1 text-xs text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
582
|
+
children: h("moreOnDay", { count: i + 1 })
|
|
583
|
+
}),
|
|
584
|
+
align: "start",
|
|
585
|
+
className: "max-h-80 w-64 space-y-1 overflow-y-auto",
|
|
586
|
+
"aria-label": g.dateTime(e, { dateStyle: "full" }),
|
|
587
|
+
children: n
|
|
588
|
+
})
|
|
589
|
+
]
|
|
590
|
+
}, t);
|
|
591
|
+
})
|
|
592
|
+
})
|
|
593
|
+
}, e.key))
|
|
525
594
|
})]
|
|
526
595
|
}),
|
|
527
|
-
/* @__PURE__ */
|
|
596
|
+
/* @__PURE__ */ V("ol", {
|
|
528
597
|
className: "divide-y divide-border rounded-md border border-border sm:hidden",
|
|
529
|
-
children:
|
|
598
|
+
children: be.map((e) => {
|
|
530
599
|
let t = r(e);
|
|
531
|
-
return /* @__PURE__ */
|
|
600
|
+
return /* @__PURE__ */ H("li", {
|
|
532
601
|
className: "flex flex-col gap-1 px-3 py-2",
|
|
533
|
-
children: [
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
}),
|
|
545
|
-
(M.get(t) ?? []).map(B),
|
|
546
|
-
(N.get(t) ?? []).map((e) => U(e, t))
|
|
547
|
-
]
|
|
602
|
+
children: [/* @__PURE__ */ H("span", {
|
|
603
|
+
className: "flex items-center justify-between text-xs",
|
|
604
|
+
children: [/* @__PURE__ */ V("span", {
|
|
605
|
+
className: t === Q ? "font-medium text-primary" : "text-muted-foreground",
|
|
606
|
+
children: g.dateTime(e, {
|
|
607
|
+
weekday: "long",
|
|
608
|
+
month: "short",
|
|
609
|
+
day: "numeric"
|
|
610
|
+
})
|
|
611
|
+
}), _e(t, !0)]
|
|
612
|
+
}), ye(t)]
|
|
548
613
|
}, t);
|
|
549
614
|
})
|
|
550
615
|
})
|
|
551
616
|
]
|
|
552
617
|
});
|
|
553
618
|
}
|
|
554
|
-
function
|
|
555
|
-
let a =
|
|
619
|
+
function Q({ workspace: e, docs: t, dateOf: r, toolbar: i }) {
|
|
620
|
+
let a = z("subpages"), o = R(), s = [...t].sort((e, t) => {
|
|
556
621
|
let n = r(e) ?? "", i = r(t) ?? "";
|
|
557
622
|
return n === i ? t.updatedAt < e.updatedAt ? -1 : 1 : n < i ? 1 : -1;
|
|
558
623
|
});
|
|
559
|
-
return /* @__PURE__ */
|
|
624
|
+
return /* @__PURE__ */ H("div", {
|
|
560
625
|
className: "flex flex-col",
|
|
561
|
-
children: [/* @__PURE__ */
|
|
626
|
+
children: [/* @__PURE__ */ V("div", {
|
|
562
627
|
className: "flex flex-wrap items-center gap-1 py-2",
|
|
563
628
|
children: i
|
|
564
|
-
}), s.length === 0 ? /* @__PURE__ */
|
|
629
|
+
}), s.length === 0 ? /* @__PURE__ */ V("p", {
|
|
565
630
|
className: "py-3 text-sm text-muted-foreground",
|
|
566
631
|
children: a("none")
|
|
567
|
-
}) : /* @__PURE__ */
|
|
632
|
+
}) : /* @__PURE__ */ V("ul", {
|
|
568
633
|
className: "divide-y divide-border",
|
|
569
634
|
children: s.map((t) => {
|
|
570
635
|
let i = r(t);
|
|
571
|
-
return /* @__PURE__ */
|
|
636
|
+
return /* @__PURE__ */ V("li", { children: /* @__PURE__ */ H(F, {
|
|
572
637
|
to: "/$workspace/docs/$doc",
|
|
573
638
|
params: {
|
|
574
639
|
workspace: e,
|
|
@@ -576,16 +641,16 @@ function ie({ workspace: e, docs: t, dateOf: r, toolbar: i }) {
|
|
|
576
641
|
},
|
|
577
642
|
className: "flex items-center gap-3 py-2 text-sm hover:bg-accent/40",
|
|
578
643
|
children: [
|
|
579
|
-
/* @__PURE__ */
|
|
644
|
+
/* @__PURE__ */ V("span", {
|
|
580
645
|
className: "w-28 shrink-0 text-xs text-muted-foreground tabular-nums",
|
|
581
646
|
children: i ? o.dateTime(n(i), { dateStyle: "medium" }) : a("undated")
|
|
582
647
|
}),
|
|
583
|
-
/* @__PURE__ */
|
|
584
|
-
/* @__PURE__ */
|
|
648
|
+
/* @__PURE__ */ V(p, { icon: t.icon }),
|
|
649
|
+
/* @__PURE__ */ V("span", {
|
|
585
650
|
className: "min-w-0 flex-1 truncate font-medium",
|
|
586
651
|
children: t.title
|
|
587
652
|
}),
|
|
588
|
-
/* @__PURE__ */
|
|
653
|
+
/* @__PURE__ */ V("span", {
|
|
589
654
|
className: "shrink-0 text-xs text-muted-foreground",
|
|
590
655
|
children: o.relativeTime(new Date(t.updatedAt))
|
|
591
656
|
})
|
|
@@ -595,49 +660,49 @@ function ie({ workspace: e, docs: t, dateOf: r, toolbar: i }) {
|
|
|
595
660
|
})]
|
|
596
661
|
});
|
|
597
662
|
}
|
|
598
|
-
var
|
|
599
|
-
function
|
|
600
|
-
let i =
|
|
601
|
-
return /* @__PURE__ */
|
|
663
|
+
var me = "flex min-w-0 items-center gap-2 font-medium hover:underline";
|
|
664
|
+
function he({ workspace: e, docs: t, props: n, toolbar: r }) {
|
|
665
|
+
let i = z("subpages"), a = z("docViews"), o = R(), s = m(e);
|
|
666
|
+
return /* @__PURE__ */ H("div", {
|
|
602
667
|
className: "flex flex-col",
|
|
603
|
-
children: [/* @__PURE__ */
|
|
668
|
+
children: [/* @__PURE__ */ V("div", {
|
|
604
669
|
className: "flex flex-wrap items-center gap-1 py-2",
|
|
605
670
|
children: r
|
|
606
|
-
}), t.length === 0 ? /* @__PURE__ */
|
|
671
|
+
}), t.length === 0 ? /* @__PURE__ */ V("p", {
|
|
607
672
|
className: "py-3 text-sm text-muted-foreground",
|
|
608
673
|
children: i("none")
|
|
609
|
-
}) : /* @__PURE__ */
|
|
674
|
+
}) : /* @__PURE__ */ V("div", {
|
|
610
675
|
className: "overflow-x-auto",
|
|
611
|
-
children: /* @__PURE__ */
|
|
676
|
+
children: /* @__PURE__ */ H("table", {
|
|
612
677
|
className: "doc-table w-full min-w-max text-sm",
|
|
613
|
-
children: [/* @__PURE__ */
|
|
614
|
-
/* @__PURE__ */
|
|
678
|
+
children: [/* @__PURE__ */ V("thead", { children: /* @__PURE__ */ H("tr", { children: [
|
|
679
|
+
/* @__PURE__ */ V("th", {
|
|
615
680
|
scope: "col",
|
|
616
681
|
children: a("docTitle")
|
|
617
682
|
}),
|
|
618
|
-
n.map((e) => /* @__PURE__ */
|
|
683
|
+
n.map((e) => /* @__PURE__ */ V("th", {
|
|
619
684
|
scope: "col",
|
|
620
685
|
children: e.name
|
|
621
686
|
}, e.id)),
|
|
622
|
-
/* @__PURE__ */
|
|
687
|
+
/* @__PURE__ */ V("th", {
|
|
623
688
|
scope: "col",
|
|
624
689
|
children: a("updated")
|
|
625
690
|
})
|
|
626
|
-
] }) }), /* @__PURE__ */
|
|
627
|
-
/* @__PURE__ */
|
|
691
|
+
] }) }), /* @__PURE__ */ V("tbody", { children: t.map((t) => /* @__PURE__ */ H("tr", { children: [
|
|
692
|
+
/* @__PURE__ */ V("td", { children: /* @__PURE__ */ H(F, {
|
|
628
693
|
to: "/$workspace/docs/$doc",
|
|
629
694
|
params: {
|
|
630
695
|
workspace: e,
|
|
631
696
|
doc: c(t)
|
|
632
697
|
},
|
|
633
|
-
className:
|
|
634
|
-
children: [/* @__PURE__ */
|
|
698
|
+
className: me,
|
|
699
|
+
children: [/* @__PURE__ */ V(p, { icon: t.icon }), /* @__PURE__ */ V("span", {
|
|
635
700
|
className: "truncate",
|
|
636
701
|
children: t.title
|
|
637
702
|
})]
|
|
638
703
|
}) }),
|
|
639
|
-
n.map((e) => /* @__PURE__ */
|
|
640
|
-
/* @__PURE__ */
|
|
704
|
+
n.map((e) => /* @__PURE__ */ V("td", { children: s(e, t.properties?.[e.id]) }, e.id)),
|
|
705
|
+
/* @__PURE__ */ V("td", {
|
|
641
706
|
className: "text-muted-foreground",
|
|
642
707
|
children: o.dateTime(new Date(t.updatedAt), { dateStyle: "medium" })
|
|
643
708
|
})
|
|
@@ -646,19 +711,19 @@ function oe({ workspace: e, docs: t, props: n, toolbar: r }) {
|
|
|
646
711
|
})]
|
|
647
712
|
});
|
|
648
713
|
}
|
|
649
|
-
function
|
|
650
|
-
let r =
|
|
651
|
-
return /* @__PURE__ */
|
|
714
|
+
function ge({ workspace: e, docs: t, toolbar: n }) {
|
|
715
|
+
let r = z("subpages"), i = R();
|
|
716
|
+
return /* @__PURE__ */ H("div", {
|
|
652
717
|
className: "flex flex-col",
|
|
653
|
-
children: [/* @__PURE__ */
|
|
718
|
+
children: [/* @__PURE__ */ V("div", {
|
|
654
719
|
className: "flex flex-wrap items-center gap-1 py-2",
|
|
655
720
|
children: n
|
|
656
|
-
}), t.length === 0 ? /* @__PURE__ */
|
|
721
|
+
}), t.length === 0 ? /* @__PURE__ */ V("p", {
|
|
657
722
|
className: "py-3 text-sm text-muted-foreground",
|
|
658
723
|
children: r("none")
|
|
659
|
-
}) : /* @__PURE__ */
|
|
724
|
+
}) : /* @__PURE__ */ V("ul", {
|
|
660
725
|
className: "divide-y divide-border",
|
|
661
|
-
children: t.map((t) => /* @__PURE__ */
|
|
726
|
+
children: t.map((t) => /* @__PURE__ */ V("li", { children: /* @__PURE__ */ H(F, {
|
|
662
727
|
to: "/$workspace/docs/$doc",
|
|
663
728
|
params: {
|
|
664
729
|
workspace: e,
|
|
@@ -666,12 +731,12 @@ function se({ workspace: e, docs: t, toolbar: n }) {
|
|
|
666
731
|
},
|
|
667
732
|
className: "flex items-center gap-2 py-2 text-sm hover:bg-accent/40",
|
|
668
733
|
children: [
|
|
669
|
-
/* @__PURE__ */
|
|
670
|
-
/* @__PURE__ */
|
|
734
|
+
/* @__PURE__ */ V(p, { icon: t.icon }),
|
|
735
|
+
/* @__PURE__ */ V("span", {
|
|
671
736
|
className: "min-w-0 flex-1 truncate font-medium",
|
|
672
737
|
children: t.title
|
|
673
738
|
}),
|
|
674
|
-
/* @__PURE__ */
|
|
739
|
+
/* @__PURE__ */ V("span", {
|
|
675
740
|
className: "shrink-0 text-xs text-muted-foreground",
|
|
676
741
|
children: i.relativeTime(new Date(t.updatedAt))
|
|
677
742
|
})
|
|
@@ -680,43 +745,43 @@ function se({ workspace: e, docs: t, toolbar: n }) {
|
|
|
680
745
|
})]
|
|
681
746
|
});
|
|
682
747
|
}
|
|
683
|
-
function
|
|
684
|
-
let r =
|
|
685
|
-
return /* @__PURE__ */
|
|
748
|
+
function _e({ workspace: e, docs: t, toolbar: n }) {
|
|
749
|
+
let r = z("subpages");
|
|
750
|
+
return /* @__PURE__ */ H("div", {
|
|
686
751
|
className: "flex flex-col",
|
|
687
|
-
children: [/* @__PURE__ */
|
|
752
|
+
children: [/* @__PURE__ */ V("div", {
|
|
688
753
|
className: "flex flex-wrap items-center gap-1 py-2",
|
|
689
754
|
children: n
|
|
690
|
-
}), t.length === 0 ? /* @__PURE__ */
|
|
755
|
+
}), t.length === 0 ? /* @__PURE__ */ V("p", {
|
|
691
756
|
className: "py-3 text-sm text-muted-foreground",
|
|
692
757
|
children: r("none")
|
|
693
|
-
}) : /* @__PURE__ */
|
|
758
|
+
}) : /* @__PURE__ */ V("ul", {
|
|
694
759
|
className: "grid grid-cols-[repeat(auto-fill,minmax(13rem,1fr))] gap-3",
|
|
695
760
|
"aria-label": r("galleryView"),
|
|
696
761
|
children: t.map((t) => {
|
|
697
762
|
let n = v(t.cover ?? "");
|
|
698
|
-
return /* @__PURE__ */
|
|
763
|
+
return /* @__PURE__ */ V("li", { children: /* @__PURE__ */ H(F, {
|
|
699
764
|
to: "/$workspace/docs/$doc",
|
|
700
765
|
params: {
|
|
701
766
|
workspace: e,
|
|
702
767
|
doc: c(t)
|
|
703
768
|
},
|
|
704
769
|
className: "flex h-full flex-col overflow-hidden rounded-lg border border-border bg-card text-sm hover:border-primary",
|
|
705
|
-
children: [/* @__PURE__ */
|
|
770
|
+
children: [/* @__PURE__ */ V("span", {
|
|
706
771
|
className: "flex h-28 items-center justify-center bg-muted/50",
|
|
707
|
-
children: n ? /* @__PURE__ */
|
|
772
|
+
children: n ? /* @__PURE__ */ V("img", {
|
|
708
773
|
src: n,
|
|
709
774
|
alt: "",
|
|
710
775
|
className: "size-full object-cover",
|
|
711
776
|
style: { objectPosition: `50% ${t.coverPosition ?? 50}%` }
|
|
712
|
-
}) : /* @__PURE__ */
|
|
777
|
+
}) : /* @__PURE__ */ V(p, {
|
|
713
778
|
icon: t.icon,
|
|
714
779
|
className: "size-8",
|
|
715
780
|
emojiClassName: "text-3xl"
|
|
716
781
|
})
|
|
717
|
-
}), /* @__PURE__ */
|
|
782
|
+
}), /* @__PURE__ */ H("span", {
|
|
718
783
|
className: "flex items-center gap-2 px-3 py-2 font-medium",
|
|
719
|
-
children: [n && /* @__PURE__ */
|
|
784
|
+
children: [n && /* @__PURE__ */ V(p, { icon: t.icon }), /* @__PURE__ */ V("span", {
|
|
720
785
|
className: "truncate",
|
|
721
786
|
children: t.title
|
|
722
787
|
})]
|
|
@@ -727,48 +792,48 @@ function ce({ workspace: e, docs: t, toolbar: n }) {
|
|
|
727
792
|
});
|
|
728
793
|
}
|
|
729
794
|
var $ = 32;
|
|
730
|
-
function
|
|
731
|
-
let o =
|
|
795
|
+
function ve({ workspace: e, docs: t, dateOf: i, toolbar: a }) {
|
|
796
|
+
let o = z("subpages"), s = R(), l = I(() => /* @__PURE__ */ new Date(), []), u = t.flatMap((e) => {
|
|
732
797
|
let t = i(e), r = t ? n(t) : void 0;
|
|
733
798
|
return r ? [{
|
|
734
799
|
doc: e,
|
|
735
800
|
date: r
|
|
736
801
|
}] : [];
|
|
737
|
-
}).sort((e, t) => e.date.getTime() - t.date.getTime()), d = u[0]?.date ?? l, f =
|
|
738
|
-
return /* @__PURE__ */
|
|
802
|
+
}).sort((e, t) => e.date.getTime() - t.date.getTime()), d = u[0]?.date ?? l, f = q(new Date(Math.min(d.getTime(), l.getTime())), -3), m = u[u.length - 1]?.date ?? l, h = q(new Date(Math.max(m.getTime(), l.getTime())), 4), g = Math.max(28, Math.round((h.getTime() - f.getTime()) / 864e5) + 1), _ = Array.from({ length: g }, (e, t) => q(f, t)), v = (e) => Math.round((e.getTime() - f.getTime()) / 864e5), y = r(l);
|
|
803
|
+
return /* @__PURE__ */ H("div", {
|
|
739
804
|
className: "flex flex-col",
|
|
740
|
-
children: [/* @__PURE__ */
|
|
805
|
+
children: [/* @__PURE__ */ V("div", {
|
|
741
806
|
className: "flex flex-wrap items-center gap-1 py-2",
|
|
742
807
|
children: a
|
|
743
|
-
}), /* @__PURE__ */
|
|
808
|
+
}), /* @__PURE__ */ V("div", {
|
|
744
809
|
className: "overflow-x-auto rounded-md border border-border",
|
|
745
|
-
children: /* @__PURE__ */
|
|
810
|
+
children: /* @__PURE__ */ H("div", {
|
|
746
811
|
style: { width: g * $ },
|
|
747
812
|
className: "relative",
|
|
748
|
-
children: [/* @__PURE__ */
|
|
813
|
+
children: [/* @__PURE__ */ V("div", {
|
|
749
814
|
className: "flex border-b border-border text-xs text-muted-foreground",
|
|
750
|
-
children: _.map((e) => /* @__PURE__ */
|
|
815
|
+
children: _.map((e) => /* @__PURE__ */ V("span", {
|
|
751
816
|
style: { width: $ },
|
|
752
|
-
className:
|
|
817
|
+
className: N("shrink-0 py-1.5 text-center tabular-nums", (e.getDay() === 0 || e.getDay() === 6) && "bg-muted/40", r(e) === y && "font-semibold text-primary"),
|
|
753
818
|
title: s.dateTime(e, { dateStyle: "full" }),
|
|
754
819
|
children: e.getDate() === 1 || r(e) === r(f) ? s.dateTime(e, {
|
|
755
820
|
month: "short",
|
|
756
821
|
day: "numeric"
|
|
757
822
|
}) : e.getDate()
|
|
758
823
|
}, r(e)))
|
|
759
|
-
}), u.length === 0 ? /* @__PURE__ */
|
|
824
|
+
}), u.length === 0 ? /* @__PURE__ */ V("p", {
|
|
760
825
|
className: "sticky left-0 px-3 py-4 text-sm text-muted-foreground",
|
|
761
826
|
children: o("none")
|
|
762
|
-
}) : /* @__PURE__ */
|
|
827
|
+
}) : /* @__PURE__ */ H("ol", {
|
|
763
828
|
className: "relative py-1",
|
|
764
829
|
"aria-label": o("timelineView"),
|
|
765
|
-
children: [/* @__PURE__ */
|
|
830
|
+
children: [/* @__PURE__ */ V("span", {
|
|
766
831
|
"aria-hidden": !0,
|
|
767
832
|
className: "absolute inset-y-0 w-px bg-primary/50",
|
|
768
833
|
style: { left: v(l) * $ + $ / 2 }
|
|
769
|
-
}), u.map(({ doc: t, date: n }) => /* @__PURE__ */
|
|
834
|
+
}), u.map(({ doc: t, date: n }) => /* @__PURE__ */ V("li", {
|
|
770
835
|
className: "relative h-9",
|
|
771
|
-
children: /* @__PURE__ */
|
|
836
|
+
children: /* @__PURE__ */ H(F, {
|
|
772
837
|
to: "/$workspace/docs/$doc",
|
|
773
838
|
params: {
|
|
774
839
|
workspace: e,
|
|
@@ -777,7 +842,7 @@ function le({ workspace: e, docs: t, dateOf: i, toolbar: a }) {
|
|
|
777
842
|
"aria-label": `${t.title}, ${s.dateTime(n, { dateStyle: "medium" })}`,
|
|
778
843
|
style: { left: v(n) * $ + 2 },
|
|
779
844
|
className: "absolute top-1.5 flex h-6 max-w-72 items-center gap-1 rounded bg-card px-1.5 text-xs shadow-xs ring-1 ring-border hover:bg-accent",
|
|
780
|
-
children: [/* @__PURE__ */
|
|
845
|
+
children: [/* @__PURE__ */ V(p, { icon: t.icon }), /* @__PURE__ */ V("span", {
|
|
781
846
|
className: "truncate",
|
|
782
847
|
children: t.title
|
|
783
848
|
})]
|
|
@@ -788,4 +853,4 @@ function le({ workspace: e, docs: t, dateOf: i, toolbar: a }) {
|
|
|
788
853
|
})]
|
|
789
854
|
});
|
|
790
855
|
}
|
|
791
|
-
export {
|
|
856
|
+
export { le as SubpageViews, W as subpageLayouts };
|