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