@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
|
@@ -861,7 +861,6 @@ var e = {
|
|
|
861
861
|
showInsights: "Show insights",
|
|
862
862
|
hideInsights: "Hide insights",
|
|
863
863
|
mine: "My issues",
|
|
864
|
-
exportCsv: "Export as CSV",
|
|
865
864
|
mineScope: "Whose",
|
|
866
865
|
mineScopes: {
|
|
867
866
|
assigned: "Assigned",
|
|
@@ -933,7 +932,6 @@ var e = {
|
|
|
933
932
|
board: "Board"
|
|
934
933
|
},
|
|
935
934
|
personIssues: "{name}'s issues",
|
|
936
|
-
importCsv: "Import issues from CSV",
|
|
937
935
|
selectAll: "Select all {count}",
|
|
938
936
|
loadingMore: "Loading more issues… {loaded, number} so far",
|
|
939
937
|
loadingCount: "Loading issues… {loaded, number} of {total, number}",
|
|
@@ -1563,7 +1561,11 @@ var e = {
|
|
|
1563
1561
|
uploadPicture: "Upload a picture"
|
|
1564
1562
|
},
|
|
1565
1563
|
createIssueFromActionItem: "Create issue from action item",
|
|
1566
|
-
showSubpagesAsCalendar: "Show sub-pages as a calendar"
|
|
1564
|
+
showSubpagesAsCalendar: "Show sub-pages as a calendar",
|
|
1565
|
+
moveToSearch: "Find a doc",
|
|
1566
|
+
moveToNone: "No doc matches",
|
|
1567
|
+
archivedToast: "Archived “{title}”",
|
|
1568
|
+
undo: "Undo"
|
|
1567
1569
|
},
|
|
1568
1570
|
docLinks: {
|
|
1569
1571
|
label: "Link a doc, issue or project",
|
|
@@ -3349,6 +3351,16 @@ var e = {
|
|
|
3349
3351
|
}
|
|
3350
3352
|
},
|
|
3351
3353
|
issueImport: {
|
|
3354
|
+
settings: {
|
|
3355
|
+
title: "Import / export",
|
|
3356
|
+
description: "Move this team's issues in and out as CSV files.",
|
|
3357
|
+
export: "Export issues",
|
|
3358
|
+
exportHelp: "Download this team's issues as a CSV file. Archived issues and ones in triage are left out.",
|
|
3359
|
+
exportButton: "Export CSV",
|
|
3360
|
+
import: "Import issues",
|
|
3361
|
+
importHelp: "Add issues from a CSV file. You see what each row becomes before anything is made.",
|
|
3362
|
+
importButton: "Import CSV"
|
|
3363
|
+
},
|
|
3352
3364
|
title: "Import {file}",
|
|
3353
3365
|
reading: "Reading the file…",
|
|
3354
3366
|
importing: "Importing…",
|
|
@@ -861,7 +861,6 @@ var e = {
|
|
|
861
861
|
showInsights: "Mostrar análisis",
|
|
862
862
|
hideInsights: "Ocultar análisis",
|
|
863
863
|
mine: "Mis incidencias",
|
|
864
|
-
exportCsv: "Exportar como CSV",
|
|
865
864
|
mineScope: "De quién",
|
|
866
865
|
mineScopes: {
|
|
867
866
|
assigned: "Asignadas",
|
|
@@ -933,7 +932,6 @@ var e = {
|
|
|
933
932
|
board: "Tablero"
|
|
934
933
|
},
|
|
935
934
|
personIssues: "Incidencias de {name}",
|
|
936
|
-
importCsv: "Importar incidencias desde CSV",
|
|
937
935
|
selectAll: "Seleccionar las {count}",
|
|
938
936
|
loadingMore: "Cargando más incidencias… {loaded, number} hasta ahora",
|
|
939
937
|
loadingCount: "Cargando incidencias… {loaded, number} de {total, number}",
|
|
@@ -1563,7 +1561,11 @@ var e = {
|
|
|
1563
1561
|
uploadPicture: "Subir una imagen"
|
|
1564
1562
|
},
|
|
1565
1563
|
createIssueFromActionItem: "Crear incidencia desde la tarea",
|
|
1566
|
-
showSubpagesAsCalendar: "Mostrar subpáginas como calendario"
|
|
1564
|
+
showSubpagesAsCalendar: "Mostrar subpáginas como calendario",
|
|
1565
|
+
moveToSearch: "Buscar un documento",
|
|
1566
|
+
moveToNone: "Ningún documento coincide",
|
|
1567
|
+
archivedToast: "“{title}” archivado",
|
|
1568
|
+
undo: "Deshacer"
|
|
1567
1569
|
},
|
|
1568
1570
|
docLinks: {
|
|
1569
1571
|
label: "Enlazar un documento, incidencia o proyecto",
|
|
@@ -3349,6 +3351,16 @@ var e = {
|
|
|
3349
3351
|
}
|
|
3350
3352
|
},
|
|
3351
3353
|
issueImport: {
|
|
3354
|
+
settings: {
|
|
3355
|
+
title: "Importar / exportar",
|
|
3356
|
+
description: "Mueve las incidencias de este equipo dentro y fuera como archivos CSV.",
|
|
3357
|
+
export: "Exportar incidencias",
|
|
3358
|
+
exportHelp: "Descarga las incidencias de este equipo como archivo CSV. Se excluyen las archivadas y las que están en clasificación.",
|
|
3359
|
+
exportButton: "Exportar CSV",
|
|
3360
|
+
import: "Importar incidencias",
|
|
3361
|
+
importHelp: "Añade incidencias desde un archivo CSV. Verás en qué se convierte cada fila antes de crear nada.",
|
|
3362
|
+
importButton: "Importar CSV"
|
|
3363
|
+
},
|
|
3352
3364
|
title: "Importar {file}",
|
|
3353
3365
|
reading: "Leyendo el archivo…",
|
|
3354
3366
|
importing: "Importando…",
|
|
@@ -861,7 +861,6 @@ var e = {
|
|
|
861
861
|
showInsights: "インサイトを表示",
|
|
862
862
|
hideInsights: "インサイトを隠す",
|
|
863
863
|
mine: "自分の課題",
|
|
864
|
-
exportCsv: "CSV としてエクスポート",
|
|
865
864
|
mineScope: "対象",
|
|
866
865
|
mineScopes: {
|
|
867
866
|
assigned: "担当",
|
|
@@ -933,7 +932,6 @@ var e = {
|
|
|
933
932
|
board: "ボード"
|
|
934
933
|
},
|
|
935
934
|
personIssues: "{name} の課題",
|
|
936
|
-
importCsv: "CSV から課題をインポート",
|
|
937
935
|
selectAll: "{count} 件すべて選択",
|
|
938
936
|
loadingMore: "さらに課題を読み込んでいます… これまでに {loaded, number} 件",
|
|
939
937
|
loadingCount: "課題を読み込んでいます… {total, number} 件中 {loaded, number} 件",
|
|
@@ -1563,7 +1561,11 @@ var e = {
|
|
|
1563
1561
|
uploadPicture: "画像をアップロード"
|
|
1564
1562
|
},
|
|
1565
1563
|
createIssueFromActionItem: "アクションアイテムから課題を作成",
|
|
1566
|
-
showSubpagesAsCalendar: "サブページをカレンダーで表示"
|
|
1564
|
+
showSubpagesAsCalendar: "サブページをカレンダーで表示",
|
|
1565
|
+
moveToSearch: "ドキュメントを検索",
|
|
1566
|
+
moveToNone: "一致するドキュメントはありません",
|
|
1567
|
+
archivedToast: "「{title}」をアーカイブしました",
|
|
1568
|
+
undo: "元に戻す"
|
|
1567
1569
|
},
|
|
1568
1570
|
docLinks: {
|
|
1569
1571
|
label: "ドキュメント、課題、プロジェクトをリンク",
|
|
@@ -3349,6 +3351,16 @@ var e = {
|
|
|
3349
3351
|
}
|
|
3350
3352
|
},
|
|
3351
3353
|
issueImport: {
|
|
3354
|
+
settings: {
|
|
3355
|
+
title: "インポート / エクスポート",
|
|
3356
|
+
description: "このチームの課題を CSV ファイルで出し入れします。",
|
|
3357
|
+
export: "課題をエクスポート",
|
|
3358
|
+
exportHelp: "このチームの課題を CSV ファイルとしてダウンロードします。アーカイブ済みの課題とトリアージ中の課題は含まれません。",
|
|
3359
|
+
exportButton: "CSV をエクスポート",
|
|
3360
|
+
import: "課題をインポート",
|
|
3361
|
+
importHelp: "CSV ファイルから課題を追加します。作成する前に各行がどうなるかを確認できます。",
|
|
3362
|
+
importButton: "CSV をインポート"
|
|
3363
|
+
},
|
|
3352
3364
|
title: "{file} をインポート",
|
|
3353
3365
|
reading: "ファイルを読み込んでいます…",
|
|
3354
3366
|
importing: "インポートしています…",
|
|
@@ -861,7 +861,6 @@ var e = {
|
|
|
861
861
|
showInsights: "인사이트 보기",
|
|
862
862
|
hideInsights: "인사이트 숨기기",
|
|
863
863
|
mine: "내 이슈",
|
|
864
|
-
exportCsv: "CSV로 내보내기",
|
|
865
864
|
mineScope: "대상",
|
|
866
865
|
mineScopes: {
|
|
867
866
|
assigned: "할당됨",
|
|
@@ -933,7 +932,6 @@ var e = {
|
|
|
933
932
|
board: "보드"
|
|
934
933
|
},
|
|
935
934
|
personIssues: "{name}님의 이슈",
|
|
936
|
-
importCsv: "CSV에서 이슈 가져오기",
|
|
937
935
|
selectAll: "{count}개 모두 선택",
|
|
938
936
|
loadingMore: "이슈를 더 불러오는 중… 지금까지 {loaded, number}개",
|
|
939
937
|
loadingCount: "이슈를 불러오는 중… {total, number}개 중 {loaded, number}개",
|
|
@@ -1563,7 +1561,11 @@ var e = {
|
|
|
1563
1561
|
uploadPicture: "그림 업로드"
|
|
1564
1562
|
},
|
|
1565
1563
|
createIssueFromActionItem: "작업 항목으로 이슈 만들기",
|
|
1566
|
-
showSubpagesAsCalendar: "하위 페이지를 캘린더로 보기"
|
|
1564
|
+
showSubpagesAsCalendar: "하위 페이지를 캘린더로 보기",
|
|
1565
|
+
moveToSearch: "문서 찾기",
|
|
1566
|
+
moveToNone: "일치하는 문서가 없습니다",
|
|
1567
|
+
archivedToast: "“{title}” 보관됨",
|
|
1568
|
+
undo: "실행 취소"
|
|
1567
1569
|
},
|
|
1568
1570
|
docLinks: {
|
|
1569
1571
|
label: "문서, 이슈 또는 프로젝트 링크",
|
|
@@ -3349,6 +3351,16 @@ var e = {
|
|
|
3349
3351
|
}
|
|
3350
3352
|
},
|
|
3351
3353
|
issueImport: {
|
|
3354
|
+
settings: {
|
|
3355
|
+
title: "가져오기 / 내보내기",
|
|
3356
|
+
description: "이 팀의 이슈를 CSV 파일로 가져오거나 내보냅니다.",
|
|
3357
|
+
export: "이슈 내보내기",
|
|
3358
|
+
exportHelp: "이 팀의 이슈를 CSV 파일로 다운로드합니다. 보관된 이슈와 분류 중인 이슈는 제외됩니다.",
|
|
3359
|
+
exportButton: "CSV 내보내기",
|
|
3360
|
+
import: "이슈 가져오기",
|
|
3361
|
+
importHelp: "CSV 파일에서 이슈를 추가합니다. 만들기 전에 각 행이 어떻게 되는지 확인할 수 있습니다.",
|
|
3362
|
+
importButton: "CSV 가져오기"
|
|
3363
|
+
},
|
|
3352
3364
|
title: "{file} 가져오기",
|
|
3353
3365
|
reading: "파일을 읽는 중…",
|
|
3354
3366
|
importing: "가져오는 중…",
|
|
@@ -861,7 +861,6 @@ var e = {
|
|
|
861
861
|
showInsights: "显示洞察",
|
|
862
862
|
hideInsights: "隐藏洞察",
|
|
863
863
|
mine: "我的议题",
|
|
864
|
-
exportCsv: "导出为 CSV",
|
|
865
864
|
mineScope: "范围",
|
|
866
865
|
mineScopes: {
|
|
867
866
|
assigned: "分配给我的",
|
|
@@ -933,7 +932,6 @@ var e = {
|
|
|
933
932
|
board: "看板"
|
|
934
933
|
},
|
|
935
934
|
personIssues: "{name} 的议题",
|
|
936
|
-
importCsv: "从 CSV 导入议题",
|
|
937
935
|
selectAll: "全选 {count} 个",
|
|
938
936
|
loadingMore: "正在加载更多问题… 已加载 {loaded, number} 个",
|
|
939
937
|
loadingCount: "正在加载问题… 已加载 {loaded, number}/{total, number} 个",
|
|
@@ -1563,7 +1561,11 @@ var e = {
|
|
|
1563
1561
|
uploadPicture: "上传图片"
|
|
1564
1562
|
},
|
|
1565
1563
|
createIssueFromActionItem: "从待办事项创建问题",
|
|
1566
|
-
showSubpagesAsCalendar: "以日历显示子页面"
|
|
1564
|
+
showSubpagesAsCalendar: "以日历显示子页面",
|
|
1565
|
+
moveToSearch: "查找文档",
|
|
1566
|
+
moveToNone: "没有匹配的文档",
|
|
1567
|
+
archivedToast: "已归档“{title}”",
|
|
1568
|
+
undo: "撤销"
|
|
1567
1569
|
},
|
|
1568
1570
|
docLinks: {
|
|
1569
1571
|
label: "链接文档、问题或项目",
|
|
@@ -3349,6 +3351,16 @@ var e = {
|
|
|
3349
3351
|
}
|
|
3350
3352
|
},
|
|
3351
3353
|
issueImport: {
|
|
3354
|
+
settings: {
|
|
3355
|
+
title: "导入 / 导出",
|
|
3356
|
+
description: "以 CSV 文件导入或导出此团队的议题。",
|
|
3357
|
+
export: "导出议题",
|
|
3358
|
+
exportHelp: "将此团队的议题下载为 CSV 文件。已归档和分拣中的议题不包含在内。",
|
|
3359
|
+
exportButton: "导出 CSV",
|
|
3360
|
+
import: "导入议题",
|
|
3361
|
+
importHelp: "从 CSV 文件添加议题。创建之前会先显示每一行将变成什么。",
|
|
3362
|
+
importButton: "导入 CSV"
|
|
3363
|
+
},
|
|
3352
3364
|
title: "导入 {file}",
|
|
3353
3365
|
reading: "正在读取文件…",
|
|
3354
3366
|
importing: "正在导入…",
|
|
@@ -6,17 +6,26 @@ import { useState as l } from "react";
|
|
|
6
6
|
import { useTranslations as u } from "use-intl";
|
|
7
7
|
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
8
8
|
// src/components/DocIconPicker.tsx
|
|
9
|
-
function m({
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
function m({ icon: e, onPick: t, onUploadFile: n, ...r }) {
|
|
10
|
+
let i = /* @__PURE__ */ f(h, {
|
|
11
|
+
icon: e,
|
|
12
|
+
onPick: t,
|
|
13
|
+
onUploadFile: n
|
|
14
|
+
});
|
|
15
|
+
return "trigger" in r ? /* @__PURE__ */ f(a, {
|
|
16
|
+
trigger: r.trigger,
|
|
17
|
+
align: "start",
|
|
18
|
+
className: "w-80",
|
|
19
|
+
initialFocus: "first-control",
|
|
20
|
+
children: i
|
|
21
|
+
}) : /* @__PURE__ */ f(a, {
|
|
22
|
+
at: r.at,
|
|
23
|
+
open: !0,
|
|
24
|
+
onOpenChange: (e) => !e && r.onClose(),
|
|
12
25
|
align: "start",
|
|
13
26
|
className: "w-80",
|
|
14
27
|
initialFocus: "first-control",
|
|
15
|
-
children:
|
|
16
|
-
icon: t,
|
|
17
|
-
onPick: n,
|
|
18
|
-
onUploadFile: r
|
|
19
|
-
})
|
|
28
|
+
children: i
|
|
20
29
|
});
|
|
21
30
|
}
|
|
22
31
|
function h({ icon: a, onPick: m, onUploadFile: h }) {
|
package/components/DocLook.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { api as e, unwrap as t } from "../api/client.js";
|
|
2
|
-
import { useDocActions as n } from "../lib/docs.js";
|
|
3
|
-
import { DocIcon as
|
|
4
|
-
import { DocIconPicker as
|
|
5
|
-
import { iconImageURL as
|
|
6
|
-
import { CropDialog as
|
|
7
|
-
import { Button as
|
|
8
|
-
import { useRef as
|
|
9
|
-
import { useErrorMessage as
|
|
10
|
-
import { useTranslations as
|
|
11
|
-
import { Fragment as
|
|
2
|
+
import { useDocActions as n, useIconRequest as r } from "../lib/docs.js";
|
|
3
|
+
import { DocIcon as i } from "./DocIcon.js";
|
|
4
|
+
import { DocIconPicker as a } from "./DocIconPicker.js";
|
|
5
|
+
import { iconImageURL as o } from "./EntityIcon.js";
|
|
6
|
+
import { CropDialog as s } from "./ImageUpload.js";
|
|
7
|
+
import { Button as c, ErrorText as l, FileButton as u } from "@parallelworks/ui";
|
|
8
|
+
import { useRef as d, useState as f } from "react";
|
|
9
|
+
import { useErrorMessage as p } from "@parallelworks/problem/react";
|
|
10
|
+
import { useTranslations as m } from "use-intl";
|
|
11
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
12
12
|
// src/components/DocLook.tsx
|
|
13
|
-
var
|
|
14
|
-
async function
|
|
15
|
-
let t = await createImageBitmap(e), n = Math.min(1,
|
|
13
|
+
var v = 2400;
|
|
14
|
+
async function y(e) {
|
|
15
|
+
let t = await createImageBitmap(e), n = Math.min(1, v / t.width, v / t.height), r = document.createElement("canvas");
|
|
16
16
|
return r.width = Math.round(t.width * n), r.height = Math.round(t.height * n), r.getContext("2d")?.drawImage(t, 0, 0, r.width, r.height), t.close(), new Promise((e, t) => r.toBlob((n) => n ? e(n) : t(/* @__PURE__ */ Error("encode")), "image/jpeg", .85));
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
let a =
|
|
18
|
+
function b(r, i) {
|
|
19
|
+
let a = m("docs.look"), o = p(), s = n(r), [c, l] = f(!1), [u, d] = f(null);
|
|
20
20
|
return {
|
|
21
21
|
upload: async (n) => {
|
|
22
22
|
let c = n[0];
|
|
23
23
|
if (c) {
|
|
24
|
-
l(!0),
|
|
24
|
+
l(!0), d(null);
|
|
25
25
|
try {
|
|
26
|
-
let n = await
|
|
26
|
+
let n = await y(c), a = t(await e.POST("/api/v1/workspaces/{workspace}/images", {
|
|
27
27
|
params: {
|
|
28
28
|
path: { workspace: r },
|
|
29
29
|
query: { kind: "cover" }
|
|
@@ -38,7 +38,7 @@ function y(r, i) {
|
|
|
38
38
|
coverPosition: 50
|
|
39
39
|
});
|
|
40
40
|
} catch (e) {
|
|
41
|
-
|
|
41
|
+
d(a("coverFailed", { reason: o(e) }));
|
|
42
42
|
} finally {
|
|
43
43
|
l(!1);
|
|
44
44
|
}
|
|
@@ -48,8 +48,8 @@ function y(r, i) {
|
|
|
48
48
|
error: u
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
let i =
|
|
51
|
+
function x(n, r) {
|
|
52
|
+
let i = p(), [a, o] = f(null);
|
|
53
53
|
return {
|
|
54
54
|
picked: a,
|
|
55
55
|
pick: (e) => {
|
|
@@ -71,30 +71,30 @@ function b(n, r) {
|
|
|
71
71
|
clear: () => o(null)
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
let i =
|
|
74
|
+
function S({ workspace: e, doc: t, editable: r }) {
|
|
75
|
+
let i = m("docs.look"), a = m("common"), s = n(e), p = b(e, t), v = d(null), y = d(null), [x, S] = f(!1), [C, w] = f(t.coverPosition), T = o(t.cover ?? "");
|
|
76
76
|
if (!T) return null;
|
|
77
77
|
let E = x ? C : t.coverPosition;
|
|
78
|
-
return /* @__PURE__ */
|
|
78
|
+
return /* @__PURE__ */ _("div", {
|
|
79
79
|
className: "group/cover relative",
|
|
80
80
|
children: [
|
|
81
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ g("div", {
|
|
82
82
|
ref: v,
|
|
83
83
|
className: `h-40 w-full overflow-hidden bg-muted md:h-56 ${x ? "cursor-grab touch-none active:cursor-grabbing" : ""}`,
|
|
84
84
|
onPointerDown: (e) => {
|
|
85
|
-
x && (e.currentTarget.setPointerCapture(e.pointerId),
|
|
85
|
+
x && (e.currentTarget.setPointerCapture(e.pointerId), y.current = {
|
|
86
86
|
y: e.clientY,
|
|
87
87
|
from: C
|
|
88
88
|
});
|
|
89
89
|
},
|
|
90
90
|
onPointerMove: (e) => {
|
|
91
|
-
let t =
|
|
91
|
+
let t = y.current, n = v.current?.offsetHeight ?? 1;
|
|
92
92
|
t && w(Math.round(Math.min(100, Math.max(0, t.from - (e.clientY - t.y) / n * 100))));
|
|
93
93
|
},
|
|
94
94
|
onPointerUp: () => {
|
|
95
|
-
|
|
95
|
+
y.current = null;
|
|
96
96
|
},
|
|
97
|
-
children: /* @__PURE__ */
|
|
97
|
+
children: /* @__PURE__ */ g("img", {
|
|
98
98
|
src: T,
|
|
99
99
|
alt: "",
|
|
100
100
|
draggable: !1,
|
|
@@ -102,40 +102,40 @@ function x({ workspace: e, doc: t, editable: r }) {
|
|
|
102
102
|
style: { objectPosition: `50% ${E}%` }
|
|
103
103
|
})
|
|
104
104
|
}),
|
|
105
|
-
x && /* @__PURE__ */
|
|
105
|
+
x && /* @__PURE__ */ g("p", {
|
|
106
106
|
className: "pointer-events-none absolute inset-x-0 top-1/2 -translate-y-1/2 text-center",
|
|
107
|
-
children: /* @__PURE__ */
|
|
107
|
+
children: /* @__PURE__ */ g("span", {
|
|
108
108
|
className: "rounded-md bg-background/85 px-2 py-1 text-xs",
|
|
109
109
|
children: i("dragToReposition")
|
|
110
110
|
})
|
|
111
111
|
}),
|
|
112
|
-
r && /* @__PURE__ */
|
|
113
|
-
className: `absolute right-4 bottom-3 flex gap-1.5 transition-opacity duration-150 md:right-8 ${x ||
|
|
114
|
-
children: x ? /* @__PURE__ */
|
|
112
|
+
r && /* @__PURE__ */ g("div", {
|
|
113
|
+
className: `absolute right-4 bottom-3 flex gap-1.5 transition-opacity duration-150 md:right-8 ${x || p.busy ? "" : "opacity-0 group-focus-within/cover:opacity-100 group-hover/cover:opacity-100"}`,
|
|
114
|
+
children: x ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(c, {
|
|
115
115
|
type: "button",
|
|
116
116
|
size: "sm",
|
|
117
117
|
onClick: () => S(!1),
|
|
118
|
-
children:
|
|
119
|
-
}), /* @__PURE__ */
|
|
118
|
+
children: a("cancel")
|
|
119
|
+
}), /* @__PURE__ */ g(c, {
|
|
120
120
|
type: "button",
|
|
121
121
|
size: "sm",
|
|
122
122
|
variant: "primary",
|
|
123
123
|
onClick: () => {
|
|
124
|
-
|
|
124
|
+
s.setLook.mutate({
|
|
125
125
|
doc: t,
|
|
126
126
|
coverPosition: C
|
|
127
127
|
}), S(!1);
|
|
128
128
|
},
|
|
129
129
|
children: i("savePosition")
|
|
130
|
-
})] }) : /* @__PURE__ */
|
|
131
|
-
/* @__PURE__ */
|
|
130
|
+
})] }) : /* @__PURE__ */ _(h, { children: [
|
|
131
|
+
/* @__PURE__ */ g(u, {
|
|
132
132
|
size: "sm",
|
|
133
133
|
accept: "image/png,image/jpeg",
|
|
134
|
-
onFiles:
|
|
135
|
-
loading:
|
|
134
|
+
onFiles: p.upload,
|
|
135
|
+
loading: p.busy,
|
|
136
136
|
children: i("changeCover")
|
|
137
137
|
}),
|
|
138
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ g(c, {
|
|
139
139
|
type: "button",
|
|
140
140
|
size: "sm",
|
|
141
141
|
onClick: () => {
|
|
@@ -143,10 +143,10 @@ function x({ workspace: e, doc: t, editable: r }) {
|
|
|
143
143
|
},
|
|
144
144
|
children: i("reposition")
|
|
145
145
|
}),
|
|
146
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ g(c, {
|
|
147
147
|
type: "button",
|
|
148
148
|
size: "sm",
|
|
149
|
-
onClick: () =>
|
|
149
|
+
onClick: () => s.setLook.mutate({
|
|
150
150
|
doc: t,
|
|
151
151
|
cover: ""
|
|
152
152
|
}),
|
|
@@ -154,68 +154,68 @@ function x({ workspace: e, doc: t, editable: r }) {
|
|
|
154
154
|
})
|
|
155
155
|
] })
|
|
156
156
|
}),
|
|
157
|
-
/* @__PURE__ */
|
|
157
|
+
/* @__PURE__ */ g(l, {
|
|
158
158
|
className: "px-4 md:px-8",
|
|
159
|
-
children:
|
|
159
|
+
children: p.error
|
|
160
160
|
})
|
|
161
161
|
]
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
|
-
function
|
|
165
|
-
let
|
|
164
|
+
function C({ workspace: e, doc: t, editable: r }) {
|
|
165
|
+
let o = m("docs.look"), d = n(e), f = b(e, t), p = t.icon ?? "", h = (e) => d.setLook.mutate({
|
|
166
166
|
doc: t,
|
|
167
167
|
icon: e
|
|
168
|
-
}), v =
|
|
169
|
-
icon:
|
|
168
|
+
}), v = x(e, h), y = /* @__PURE__ */ g(i, {
|
|
169
|
+
icon: p,
|
|
170
170
|
className: "size-14",
|
|
171
171
|
emojiClassName: "text-5xl"
|
|
172
172
|
});
|
|
173
|
-
return /* @__PURE__ */
|
|
173
|
+
return /* @__PURE__ */ _("div", {
|
|
174
174
|
className: t.cover ? "-mt-10 md:-mt-12" : "",
|
|
175
175
|
children: [
|
|
176
|
-
|
|
177
|
-
icon:
|
|
178
|
-
onPick:
|
|
176
|
+
p && (r ? /* @__PURE__ */ g(a, {
|
|
177
|
+
icon: p,
|
|
178
|
+
onPick: h,
|
|
179
179
|
onUploadFile: v.pick,
|
|
180
|
-
trigger: /* @__PURE__ */
|
|
180
|
+
trigger: /* @__PURE__ */ g("button", {
|
|
181
181
|
type: "button",
|
|
182
|
-
"aria-label":
|
|
182
|
+
"aria-label": o("changeIcon"),
|
|
183
183
|
className: "relative rounded-lg p-1 hover:bg-muted focus-visible:outline-2 focus-visible:outline-primary",
|
|
184
|
-
children:
|
|
184
|
+
children: y
|
|
185
185
|
})
|
|
186
|
-
}) : /* @__PURE__ */
|
|
186
|
+
}) : /* @__PURE__ */ g("span", {
|
|
187
187
|
className: "relative inline-block p-1",
|
|
188
|
-
children:
|
|
188
|
+
children: y
|
|
189
189
|
})),
|
|
190
|
-
|
|
190
|
+
r && (!p || !t.cover) && /* @__PURE__ */ _("div", {
|
|
191
191
|
className: "flex h-8 items-center gap-1 opacity-0 transition-opacity duration-150 group-hover/doc:opacity-100 focus-within:opacity-100 has-[[aria-expanded=true]]:opacity-100 max-md:opacity-100",
|
|
192
192
|
children: [
|
|
193
|
-
!
|
|
193
|
+
!p && /* @__PURE__ */ g(a, {
|
|
194
194
|
icon: "",
|
|
195
|
-
onPick:
|
|
195
|
+
onPick: h,
|
|
196
196
|
onUploadFile: v.pick,
|
|
197
|
-
trigger: /* @__PURE__ */
|
|
197
|
+
trigger: /* @__PURE__ */ g(c, {
|
|
198
198
|
type: "button",
|
|
199
199
|
size: "sm",
|
|
200
200
|
variant: "ghost",
|
|
201
|
-
children:
|
|
201
|
+
children: o("addIcon")
|
|
202
202
|
})
|
|
203
203
|
}),
|
|
204
|
-
!t.cover && /* @__PURE__ */
|
|
204
|
+
!t.cover && /* @__PURE__ */ g(u, {
|
|
205
205
|
size: "sm",
|
|
206
206
|
variant: "ghost",
|
|
207
207
|
accept: "image/png,image/jpeg",
|
|
208
208
|
onFiles: f.upload,
|
|
209
209
|
loading: f.busy,
|
|
210
|
-
children:
|
|
210
|
+
children: o("addCover")
|
|
211
211
|
}),
|
|
212
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ g(l, {
|
|
213
213
|
inline: !0,
|
|
214
214
|
children: f.error
|
|
215
215
|
})
|
|
216
216
|
]
|
|
217
217
|
}),
|
|
218
|
-
v.picked && /* @__PURE__ */
|
|
218
|
+
v.picked && /* @__PURE__ */ g(s, {
|
|
219
219
|
image: v.picked,
|
|
220
220
|
name: t.title,
|
|
221
221
|
onSave: v.save,
|
|
@@ -224,4 +224,29 @@ function S({ workspace: e, doc: t, editable: a }) {
|
|
|
224
224
|
]
|
|
225
225
|
});
|
|
226
226
|
}
|
|
227
|
-
|
|
227
|
+
function w({ workspace: e }) {
|
|
228
|
+
let [t, i] = r(), o = n(e), [c, l] = f(null), u = x(e, (e) => c && o.setLook.mutate({
|
|
229
|
+
doc: c,
|
|
230
|
+
icon: e
|
|
231
|
+
}));
|
|
232
|
+
return /* @__PURE__ */ _(h, { children: [t && /* @__PURE__ */ g(a, {
|
|
233
|
+
at: t.at,
|
|
234
|
+
onClose: i,
|
|
235
|
+
icon: t.doc.icon ?? "",
|
|
236
|
+
onPick: (e) => o.setLook.mutate({
|
|
237
|
+
doc: t.doc,
|
|
238
|
+
icon: e
|
|
239
|
+
}),
|
|
240
|
+
onUploadFile: (e) => {
|
|
241
|
+
l(t.doc), u.pick(e);
|
|
242
|
+
}
|
|
243
|
+
}), c && u.picked && /* @__PURE__ */ g(s, {
|
|
244
|
+
image: u.picked,
|
|
245
|
+
name: c.title,
|
|
246
|
+
onSave: u.save,
|
|
247
|
+
onClose: () => {
|
|
248
|
+
u.clear(), l(null);
|
|
249
|
+
}
|
|
250
|
+
})] });
|
|
251
|
+
}
|
|
252
|
+
export { S as DocCover, C as DocLookControls, w as DocMenuHost, x as useIconUpload };
|