@parallelworks/tandem-web 0.192.1 → 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.
@@ -632,10 +632,6 @@ var e = {
632
632
  agents: "Agents",
633
633
  settings: "Settings",
634
634
  myAccount: "My account",
635
- online: "{count, plural, other {# online}}",
636
- onThisPage: "{count, plural, one {# other on this page} other {# others on this page}}",
637
- oneOnThisPage: "{name} is here · {count, plural, other {# online}}",
638
- othersOnThisPage: "{here} here · {count, plural, other {# online}}",
639
635
  notifications: "Notifications",
640
636
  createTeam: "Create team",
641
637
  createFirstTeam: "Create a team",
@@ -865,7 +861,6 @@ var e = {
865
861
  showInsights: "Show insights",
866
862
  hideInsights: "Hide insights",
867
863
  mine: "My issues",
868
- exportCsv: "Export as CSV",
869
864
  mineScope: "Whose",
870
865
  mineScopes: {
871
866
  assigned: "Assigned",
@@ -937,7 +932,6 @@ var e = {
937
932
  board: "Board"
938
933
  },
939
934
  personIssues: "{name}'s issues",
940
- importCsv: "Import issues from CSV",
941
935
  selectAll: "Select all {count}",
942
936
  loadingMore: "Loading more issues… {loaded, number} so far",
943
937
  loadingCount: "Loading issues… {loaded, number} of {total, number}",
@@ -1567,7 +1561,11 @@ var e = {
1567
1561
  uploadPicture: "Upload a picture"
1568
1562
  },
1569
1563
  createIssueFromActionItem: "Create issue from action item",
1570
- 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"
1571
1569
  },
1572
1570
  docLinks: {
1573
1571
  label: "Link a doc, issue or project",
@@ -3353,6 +3351,16 @@ var e = {
3353
3351
  }
3354
3352
  },
3355
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
+ },
3356
3364
  title: "Import {file}",
3357
3365
  reading: "Reading the file…",
3358
3366
  importing: "Importing…",
@@ -632,10 +632,6 @@ var e = {
632
632
  agents: "Agentes",
633
633
  settings: "Configuración",
634
634
  myAccount: "Mi cuenta",
635
- online: "{count, plural, other {# en línea}}",
636
- onThisPage: "{count, plural, one {# persona más en esta página} other {# personas más en esta página}}",
637
- oneOnThisPage: "{name} está aquí · {count, plural, other {# en línea}}",
638
- othersOnThisPage: "{here} aquí · {count, plural, other {# en línea}}",
639
635
  notifications: "Notificaciones",
640
636
  createTeam: "Crear equipo",
641
637
  createFirstTeam: "Crear un equipo",
@@ -865,7 +861,6 @@ var e = {
865
861
  showInsights: "Mostrar análisis",
866
862
  hideInsights: "Ocultar análisis",
867
863
  mine: "Mis incidencias",
868
- exportCsv: "Exportar como CSV",
869
864
  mineScope: "De quién",
870
865
  mineScopes: {
871
866
  assigned: "Asignadas",
@@ -937,7 +932,6 @@ var e = {
937
932
  board: "Tablero"
938
933
  },
939
934
  personIssues: "Incidencias de {name}",
940
- importCsv: "Importar incidencias desde CSV",
941
935
  selectAll: "Seleccionar las {count}",
942
936
  loadingMore: "Cargando más incidencias… {loaded, number} hasta ahora",
943
937
  loadingCount: "Cargando incidencias… {loaded, number} de {total, number}",
@@ -1567,7 +1561,11 @@ var e = {
1567
1561
  uploadPicture: "Subir una imagen"
1568
1562
  },
1569
1563
  createIssueFromActionItem: "Crear incidencia desde la tarea",
1570
- 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"
1571
1569
  },
1572
1570
  docLinks: {
1573
1571
  label: "Enlazar un documento, incidencia o proyecto",
@@ -3353,6 +3351,16 @@ var e = {
3353
3351
  }
3354
3352
  },
3355
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
+ },
3356
3364
  title: "Importar {file}",
3357
3365
  reading: "Leyendo el archivo…",
3358
3366
  importing: "Importando…",
@@ -632,10 +632,6 @@ var e = {
632
632
  agents: "エージェント",
633
633
  settings: "設定",
634
634
  myAccount: "マイアカウント",
635
- online: "{count, plural, other {#人がオンライン}}",
636
- onThisPage: "{count, plural, other {このページに他#人}}",
637
- oneOnThisPage: "{name}さんがここにいます · {count, plural, other {#人がオンライン}}",
638
- othersOnThisPage: "ここに{here}人 · {count, plural, other {#人がオンライン}}",
639
635
  notifications: "通知",
640
636
  createTeam: "チームを作成",
641
637
  createFirstTeam: "チームを作成",
@@ -865,7 +861,6 @@ var e = {
865
861
  showInsights: "インサイトを表示",
866
862
  hideInsights: "インサイトを隠す",
867
863
  mine: "自分の課題",
868
- exportCsv: "CSV としてエクスポート",
869
864
  mineScope: "対象",
870
865
  mineScopes: {
871
866
  assigned: "担当",
@@ -937,7 +932,6 @@ var e = {
937
932
  board: "ボード"
938
933
  },
939
934
  personIssues: "{name} の課題",
940
- importCsv: "CSV から課題をインポート",
941
935
  selectAll: "{count} 件すべて選択",
942
936
  loadingMore: "さらに課題を読み込んでいます… これまでに {loaded, number} 件",
943
937
  loadingCount: "課題を読み込んでいます… {total, number} 件中 {loaded, number} 件",
@@ -1567,7 +1561,11 @@ var e = {
1567
1561
  uploadPicture: "画像をアップロード"
1568
1562
  },
1569
1563
  createIssueFromActionItem: "アクションアイテムから課題を作成",
1570
- showSubpagesAsCalendar: "サブページをカレンダーで表示"
1564
+ showSubpagesAsCalendar: "サブページをカレンダーで表示",
1565
+ moveToSearch: "ドキュメントを検索",
1566
+ moveToNone: "一致するドキュメントはありません",
1567
+ archivedToast: "「{title}」をアーカイブしました",
1568
+ undo: "元に戻す"
1571
1569
  },
1572
1570
  docLinks: {
1573
1571
  label: "ドキュメント、課題、プロジェクトをリンク",
@@ -3353,6 +3351,16 @@ var e = {
3353
3351
  }
3354
3352
  },
3355
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
+ },
3356
3364
  title: "{file} をインポート",
3357
3365
  reading: "ファイルを読み込んでいます…",
3358
3366
  importing: "インポートしています…",
@@ -632,10 +632,6 @@ var e = {
632
632
  agents: "에이전트",
633
633
  settings: "설정",
634
634
  myAccount: "내 계정",
635
- online: "{count, plural, other {#명 온라인}}",
636
- onThisPage: "{count, plural, other {이 페이지에 다른 #명}}",
637
- oneOnThisPage: "{name} 님이 여기 있음 · {count, plural, other {#명 온라인}}",
638
- othersOnThisPage: "여기 {here}명 · {count, plural, other {#명 온라인}}",
639
635
  notifications: "알림",
640
636
  createTeam: "팀 생성",
641
637
  createFirstTeam: "팀 생성",
@@ -865,7 +861,6 @@ var e = {
865
861
  showInsights: "인사이트 보기",
866
862
  hideInsights: "인사이트 숨기기",
867
863
  mine: "내 이슈",
868
- exportCsv: "CSV로 내보내기",
869
864
  mineScope: "대상",
870
865
  mineScopes: {
871
866
  assigned: "할당됨",
@@ -937,7 +932,6 @@ var e = {
937
932
  board: "보드"
938
933
  },
939
934
  personIssues: "{name}님의 이슈",
940
- importCsv: "CSV에서 이슈 가져오기",
941
935
  selectAll: "{count}개 모두 선택",
942
936
  loadingMore: "이슈를 더 불러오는 중… 지금까지 {loaded, number}개",
943
937
  loadingCount: "이슈를 불러오는 중… {total, number}개 중 {loaded, number}개",
@@ -1567,7 +1561,11 @@ var e = {
1567
1561
  uploadPicture: "그림 업로드"
1568
1562
  },
1569
1563
  createIssueFromActionItem: "작업 항목으로 이슈 만들기",
1570
- showSubpagesAsCalendar: "하위 페이지를 캘린더로 보기"
1564
+ showSubpagesAsCalendar: "하위 페이지를 캘린더로 보기",
1565
+ moveToSearch: "문서 찾기",
1566
+ moveToNone: "일치하는 문서가 없습니다",
1567
+ archivedToast: "“{title}” 보관됨",
1568
+ undo: "실행 취소"
1571
1569
  },
1572
1570
  docLinks: {
1573
1571
  label: "문서, 이슈 또는 프로젝트 링크",
@@ -3353,6 +3351,16 @@ var e = {
3353
3351
  }
3354
3352
  },
3355
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
+ },
3356
3364
  title: "{file} 가져오기",
3357
3365
  reading: "파일을 읽는 중…",
3358
3366
  importing: "가져오는 중…",
@@ -632,10 +632,6 @@ var e = {
632
632
  agents: "代理",
633
633
  settings: "设置",
634
634
  myAccount: "我的账户",
635
- online: "{count, plural, other {# 人在线}}",
636
- onThisPage: "{count, plural, other {此页面还有 # 人}}",
637
- oneOnThisPage: "{name} 在这里 · {count, plural, other {# 人在线}}",
638
- othersOnThisPage: "这里有 {here} 人 · {count, plural, other {# 人在线}}",
639
635
  notifications: "通知",
640
636
  createTeam: "创建团队",
641
637
  createFirstTeam: "创建团队",
@@ -865,7 +861,6 @@ var e = {
865
861
  showInsights: "显示洞察",
866
862
  hideInsights: "隐藏洞察",
867
863
  mine: "我的议题",
868
- exportCsv: "导出为 CSV",
869
864
  mineScope: "范围",
870
865
  mineScopes: {
871
866
  assigned: "分配给我的",
@@ -937,7 +932,6 @@ var e = {
937
932
  board: "看板"
938
933
  },
939
934
  personIssues: "{name} 的议题",
940
- importCsv: "从 CSV 导入议题",
941
935
  selectAll: "全选 {count} 个",
942
936
  loadingMore: "正在加载更多问题… 已加载 {loaded, number} 个",
943
937
  loadingCount: "正在加载问题… 已加载 {loaded, number}/{total, number} 个",
@@ -1567,7 +1561,11 @@ var e = {
1567
1561
  uploadPicture: "上传图片"
1568
1562
  },
1569
1563
  createIssueFromActionItem: "从待办事项创建问题",
1570
- showSubpagesAsCalendar: "以日历显示子页面"
1564
+ showSubpagesAsCalendar: "以日历显示子页面",
1565
+ moveToSearch: "查找文档",
1566
+ moveToNone: "没有匹配的文档",
1567
+ archivedToast: "已归档“{title}”",
1568
+ undo: "撤销"
1571
1569
  },
1572
1570
  docLinks: {
1573
1571
  label: "链接文档、问题或项目",
@@ -3353,6 +3351,16 @@ var e = {
3353
3351
  }
3354
3352
  },
3355
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
+ },
3356
3364
  title: "导入 {file}",
3357
3365
  reading: "正在读取文件…",
3358
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({ trigger: e, icon: t, onPick: n, onUploadFile: r }) {
10
- return /* @__PURE__ */ f(a, {
11
- trigger: e,
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: /* @__PURE__ */ f(h, {
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 }) {
@@ -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 r } from "./DocIcon.js";
4
- import { DocIconPicker as i } from "./DocIconPicker.js";
5
- import { iconImageURL as a } from "./EntityIcon.js";
6
- import { CropDialog as o } from "./ImageUpload.js";
7
- import { Button as s, ErrorText as c, FileButton as l } from "@parallelworks/ui";
8
- import { useRef as u, useState as d } from "react";
9
- import { useErrorMessage as f } from "@parallelworks/problem/react";
10
- import { useTranslations as p } from "use-intl";
11
- import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
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 _ = 2400;
14
- async function v(e) {
15
- let t = await createImageBitmap(e), n = Math.min(1, _ / t.width, _ / t.height), r = document.createElement("canvas");
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 y(r, i) {
19
- let a = p("docs.look"), o = f(), s = n(r), [c, l] = d(!1), [u, m] = d(null);
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), m(null);
24
+ l(!0), d(null);
25
25
  try {
26
- let n = await v(c), a = t(await e.POST("/api/v1/workspaces/{workspace}/images", {
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
- m(a("coverFailed", { reason: o(e) }));
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 b(n, r) {
52
- let i = f(), [a, o] = d(null);
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 x({ workspace: e, doc: t, editable: r }) {
75
- let i = p("docs.look"), o = p("common"), f = n(e), _ = y(e, t), v = u(null), b = u(null), [x, S] = d(!1), [C, w] = d(t.coverPosition), T = a(t.cover ?? "");
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__ */ g("div", {
78
+ return /* @__PURE__ */ _("div", {
79
79
  className: "group/cover relative",
80
80
  children: [
81
- /* @__PURE__ */ h("div", {
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), b.current = {
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 = b.current, n = v.current?.offsetHeight ?? 1;
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
- b.current = null;
95
+ y.current = null;
96
96
  },
97
- children: /* @__PURE__ */ h("img", {
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__ */ h("p", {
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__ */ h("span", {
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__ */ h("div", {
113
- className: `absolute right-4 bottom-3 flex gap-1.5 transition-opacity duration-150 md:right-8 ${x || _.busy ? "" : "opacity-0 group-focus-within/cover:opacity-100 group-hover/cover:opacity-100"}`,
114
- children: x ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(s, {
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: o("cancel")
119
- }), /* @__PURE__ */ h(s, {
118
+ children: a("cancel")
119
+ }), /* @__PURE__ */ g(c, {
120
120
  type: "button",
121
121
  size: "sm",
122
122
  variant: "primary",
123
123
  onClick: () => {
124
- f.setLook.mutate({
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__ */ g(m, { children: [
131
- /* @__PURE__ */ h(l, {
130
+ })] }) : /* @__PURE__ */ _(h, { children: [
131
+ /* @__PURE__ */ g(u, {
132
132
  size: "sm",
133
133
  accept: "image/png,image/jpeg",
134
- onFiles: _.upload,
135
- loading: _.busy,
134
+ onFiles: p.upload,
135
+ loading: p.busy,
136
136
  children: i("changeCover")
137
137
  }),
138
- /* @__PURE__ */ h(s, {
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__ */ h(s, {
146
+ /* @__PURE__ */ g(c, {
147
147
  type: "button",
148
148
  size: "sm",
149
- onClick: () => f.setLook.mutate({
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__ */ h(c, {
157
+ /* @__PURE__ */ g(l, {
158
158
  className: "px-4 md:px-8",
159
- children: _.error
159
+ children: p.error
160
160
  })
161
161
  ]
162
162
  });
163
163
  }
164
- function S({ workspace: e, doc: t, editable: a }) {
165
- let u = p("docs.look"), d = n(e), f = y(e, t), m = t.icon ?? "", _ = (e) => d.setLook.mutate({
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 = b(e, _), x = /* @__PURE__ */ h(r, {
169
- icon: m,
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__ */ g("div", {
173
+ return /* @__PURE__ */ _("div", {
174
174
  className: t.cover ? "-mt-10 md:-mt-12" : "",
175
175
  children: [
176
- m && (a ? /* @__PURE__ */ h(i, {
177
- icon: m,
178
- onPick: _,
176
+ p && (r ? /* @__PURE__ */ g(a, {
177
+ icon: p,
178
+ onPick: h,
179
179
  onUploadFile: v.pick,
180
- trigger: /* @__PURE__ */ h("button", {
180
+ trigger: /* @__PURE__ */ g("button", {
181
181
  type: "button",
182
- "aria-label": u("changeIcon"),
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: x
184
+ children: y
185
185
  })
186
- }) : /* @__PURE__ */ h("span", {
186
+ }) : /* @__PURE__ */ g("span", {
187
187
  className: "relative inline-block p-1",
188
- children: x
188
+ children: y
189
189
  })),
190
- a && (!m || !t.cover) && /* @__PURE__ */ g("div", {
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
- !m && /* @__PURE__ */ h(i, {
193
+ !p && /* @__PURE__ */ g(a, {
194
194
  icon: "",
195
- onPick: _,
195
+ onPick: h,
196
196
  onUploadFile: v.pick,
197
- trigger: /* @__PURE__ */ h(s, {
197
+ trigger: /* @__PURE__ */ g(c, {
198
198
  type: "button",
199
199
  size: "sm",
200
200
  variant: "ghost",
201
- children: u("addIcon")
201
+ children: o("addIcon")
202
202
  })
203
203
  }),
204
- !t.cover && /* @__PURE__ */ h(l, {
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: u("addCover")
210
+ children: o("addCover")
211
211
  }),
212
- /* @__PURE__ */ h(c, {
212
+ /* @__PURE__ */ g(l, {
213
213
  inline: !0,
214
214
  children: f.error
215
215
  })
216
216
  ]
217
217
  }),
218
- v.picked && /* @__PURE__ */ h(o, {
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
- export { x as DocCover, S as DocLookControls, b as useIconUpload };
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 };