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