@parallelworks/tandem-web 0.179.1 → 0.179.2

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.
@@ -1063,7 +1063,7 @@ var e = {
1063
1063
  download: "Download",
1064
1064
  image: "Attached image"
1065
1065
  },
1066
- copyBranchName: "Copy branch name",
1066
+ branchName: "branch name",
1067
1067
  copiedBranchName: "Copied {name}",
1068
1068
  copyFailed: "Couldn’t copy. Copy it from the issue’s menu instead.",
1069
1069
  restore: "Restore",
@@ -1332,12 +1332,12 @@ var e = {
1332
1332
  formHelp: "Anyone with the link can send a request.",
1333
1333
  needsTriage: "Turn on triage first: requests wait there.",
1334
1334
  link: "Form link",
1335
- copyLink: "Copy form link",
1335
+ formLink: "form link",
1336
1336
  email: "Email",
1337
1337
  emailHelp: "Email to the team's address becomes a request.",
1338
1338
  noDomain: "Email needs the server's intake domain (TANDEM_INTAKE_DOMAIN).",
1339
1339
  address: "Address",
1340
- copyAddress: "Copy address",
1340
+ emailAddress: "address",
1341
1341
  rotate: "New link and address",
1342
1342
  rotateHelp: "The old link and address stop working.",
1343
1343
  rotateButton: "Make new"
@@ -1441,6 +1441,9 @@ var e = {
1441
1441
  rename: "Rename",
1442
1442
  moveTo: "Move to",
1443
1443
  archive: "Archive",
1444
+ archiveConfirm: "Archive “{title}”?",
1445
+ archiveDetail: "It leaves this page and its space. You can restore it from Archived.",
1446
+ moveOut: "Move out of this page",
1444
1447
  restore: "Restore",
1445
1448
  copyKey: "Copy key",
1446
1449
  breadcrumbs: "Doc location",
@@ -1063,7 +1063,7 @@ var e = {
1063
1063
  download: "Descargar",
1064
1064
  image: "Imagen adjunta"
1065
1065
  },
1066
- copyBranchName: "Copiar nombre de la rama",
1066
+ branchName: "nombre de la rama",
1067
1067
  copiedBranchName: "Se copió {name}",
1068
1068
  copyFailed: "No se pudo copiar. Cópialo desde el menú de la incidencia.",
1069
1069
  restore: "Restaurar",
@@ -1332,12 +1332,12 @@ var e = {
1332
1332
  formHelp: "Cualquiera con el enlace puede enviar una solicitud.",
1333
1333
  needsTriage: "Activa primero la clasificación: las solicitudes esperan allí.",
1334
1334
  link: "Enlace del formulario",
1335
- copyLink: "Copiar enlace",
1335
+ formLink: "enlace del formulario",
1336
1336
  email: "Correo",
1337
1337
  emailHelp: "El correo a la dirección del equipo se convierte en solicitud.",
1338
1338
  noDomain: "El correo necesita el dominio de entrada del servidor (TANDEM_INTAKE_DOMAIN).",
1339
1339
  address: "Dirección",
1340
- copyAddress: "Copiar dirección",
1340
+ emailAddress: "dirección",
1341
1341
  rotate: "Enlace y dirección nuevos",
1342
1342
  rotateHelp: "El enlace y la dirección anteriores dejan de funcionar.",
1343
1343
  rotateButton: "Crear nuevos"
@@ -1441,6 +1441,9 @@ var e = {
1441
1441
  rename: "Renombrar",
1442
1442
  moveTo: "Mover a",
1443
1443
  archive: "Archivar",
1444
+ archiveConfirm: "¿Archivar «{title}»?",
1445
+ archiveDetail: "Sale de esta página y de su espacio. Puedes restaurarla desde Archivados.",
1446
+ moveOut: "Sacar de esta página",
1444
1447
  restore: "Restaurar",
1445
1448
  copyKey: "Copiar clave",
1446
1449
  breadcrumbs: "Ubicación del documento",
@@ -1063,7 +1063,7 @@ var e = {
1063
1063
  download: "ダウンロード",
1064
1064
  image: "添付画像"
1065
1065
  },
1066
- copyBranchName: "ブランチ名をコピー",
1066
+ branchName: "ブランチ名",
1067
1067
  copiedBranchName: "{name} をコピーしました",
1068
1068
  copyFailed: "コピーできませんでした。課題のメニューからコピーしてください。",
1069
1069
  restore: "復元",
@@ -1332,12 +1332,12 @@ var e = {
1332
1332
  formHelp: "リンクを知っている人なら誰でも送れます。",
1333
1333
  needsTriage: "先にトリアージを有効にしてください。リクエストはそこで待ちます。",
1334
1334
  link: "フォームのリンク",
1335
- copyLink: "リンクをコピー",
1335
+ formLink: "フォームのリンク",
1336
1336
  email: "メール",
1337
1337
  emailHelp: "チームのアドレスへのメールがリクエストになります。",
1338
1338
  noDomain: "メールにはサーバーの受信ドメイン(TANDEM_INTAKE_DOMAIN)が必要です。",
1339
1339
  address: "アドレス",
1340
- copyAddress: "アドレスをコピー",
1340
+ emailAddress: "アドレス",
1341
1341
  rotate: "新しいリンクとアドレス",
1342
1342
  rotateHelp: "以前のリンクとアドレスは使えなくなります。",
1343
1343
  rotateButton: "新しく作る"
@@ -1441,6 +1441,9 @@ var e = {
1441
1441
  rename: "名前を変更",
1442
1442
  moveTo: "移動先",
1443
1443
  archive: "アーカイブ",
1444
+ archiveConfirm: "「{title}」をアーカイブしますか?",
1445
+ archiveDetail: "このページとスペースから外れます。「アーカイブ済み」から復元できます。",
1446
+ moveOut: "このページから移動",
1444
1447
  restore: "復元",
1445
1448
  copyKey: "キーをコピー",
1446
1449
  breadcrumbs: "ドキュメントの場所",
@@ -1063,7 +1063,7 @@ var e = {
1063
1063
  download: "다운로드",
1064
1064
  image: "첨부된 이미지"
1065
1065
  },
1066
- copyBranchName: "브랜치 이름 복사",
1066
+ branchName: "브랜치 이름",
1067
1067
  copiedBranchName: "{name}을(를) 복사했습니다",
1068
1068
  copyFailed: "복사하지 못했습니다. 대신 이슈 메뉴에서 복사하세요.",
1069
1069
  restore: "복원",
@@ -1332,12 +1332,12 @@ var e = {
1332
1332
  formHelp: "링크가 있는 누구나 요청을 보낼 수 있습니다.",
1333
1333
  needsTriage: "먼저 분류를 켜세요. 요청은 그곳에서 기다립니다.",
1334
1334
  link: "양식 링크",
1335
- copyLink: "링크 복사",
1335
+ formLink: "양식 링크",
1336
1336
  email: "이메일",
1337
1337
  emailHelp: "팀 주소로 온 이메일이 요청이 됩니다.",
1338
1338
  noDomain: "이메일에는 서버의 수신 도메인(TANDEM_INTAKE_DOMAIN)이 필요합니다.",
1339
1339
  address: "주소",
1340
- copyAddress: "주소 복사",
1340
+ emailAddress: "주소",
1341
1341
  rotate: "새 링크와 주소",
1342
1342
  rotateHelp: "이전 링크와 주소는 더 이상 작동하지 않습니다.",
1343
1343
  rotateButton: "새로 만들기"
@@ -1441,6 +1441,9 @@ var e = {
1441
1441
  rename: "이름 바꾸기",
1442
1442
  moveTo: "이동",
1443
1443
  archive: "보관",
1444
+ archiveConfirm: "“{title}”을(를) 보관할까요?",
1445
+ archiveDetail: "이 페이지와 스페이스에서 빠집니다. 보관됨에서 복원할 수 있습니다.",
1446
+ moveOut: "이 페이지에서 꺼내기",
1444
1447
  restore: "복원",
1445
1448
  copyKey: "키 복사",
1446
1449
  breadcrumbs: "문서 위치",
@@ -1063,7 +1063,7 @@ var e = {
1063
1063
  download: "下载",
1064
1064
  image: "附加的图片"
1065
1065
  },
1066
- copyBranchName: "复制分支名称",
1066
+ branchName: "分支名称",
1067
1067
  copiedBranchName: "已复制 {name}",
1068
1068
  copyFailed: "无法复制。请改从议题菜单中复制。",
1069
1069
  restore: "恢复",
@@ -1332,12 +1332,12 @@ var e = {
1332
1332
  formHelp: "拥有链接的任何人都能提交请求。",
1333
1333
  needsTriage: "请先开启分诊:请求会在那里等待。",
1334
1334
  link: "表单链接",
1335
- copyLink: "复制链接",
1335
+ formLink: "表单链接",
1336
1336
  email: "邮件",
1337
1337
  emailHelp: "发到团队地址的邮件会成为请求。",
1338
1338
  noDomain: "邮件需要服务器的接收域名(TANDEM_INTAKE_DOMAIN)。",
1339
1339
  address: "地址",
1340
- copyAddress: "复制地址",
1340
+ emailAddress: "地址",
1341
1341
  rotate: "新的链接和地址",
1342
1342
  rotateHelp: "旧的链接和地址将失效。",
1343
1343
  rotateButton: "重新生成"
@@ -1441,6 +1441,9 @@ var e = {
1441
1441
  rename: "重命名",
1442
1442
  moveTo: "移动到",
1443
1443
  archive: "归档",
1444
+ archiveConfirm: "归档“{title}”?",
1445
+ archiveDetail: "它会离开此页面和所在空间。你可以从“已归档”中恢复。",
1446
+ moveOut: "移出此页面",
1444
1447
  restore: "恢复",
1445
1448
  copyKey: "复制标识",
1446
1449
  breadcrumbs: "文档位置",
@@ -1,29 +1,32 @@
1
- import { docQuery as e, docsQuery as t } from "../api/queries.js";
2
- import { docRef as n } from "../lib/docs.js";
3
- import { Link as r } from "../lib/router.js";
4
- import { DocIcon as i } from "./DocIcon.js";
5
- import { useParams as a } from "@tanstack/react-router";
6
- import { useTranslations as o } from "use-intl";
7
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
8
- import { useQuery as l } from "@tanstack/react-query";
9
- import { Node as u, NodeViewWrapper as d, ReactNodeViewRenderer as f, mergeAttributes as p } from "@tiptap/react";
1
+ import { docQuery as e, docsQuery as t, teamsQuery as n } from "../api/queries.js";
2
+ import { useConfirm as r } from "../lib/confirm.js";
3
+ import { docRef as i, useDocActions as a, useDocMenu as o } from "../lib/docs.js";
4
+ import { Link as s } from "../lib/router.js";
5
+ import { DocIcon as c } from "./DocIcon.js";
6
+ import { useParams as l } from "@tanstack/react-router";
7
+ import { useState as u } from "react";
8
+ import { useTranslations as d } from "use-intl";
9
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
10
+ import { useQuery as m } from "@tanstack/react-query";
11
+ import { MoreButton as h } from "@parallelworks/ui/list";
12
+ import { Node as g, NodeViewWrapper as _, ReactNodeViewRenderer as v, mergeAttributes as y } from "@tiptap/react";
10
13
  // src/components/SubPages.tsx
11
- var m = /^:::subpages[ \t]*\n[ \t]*:::[ \t]*(?:\n|$)/, h = u.create({
14
+ var b = /^:::subpages[ \t]*\n[ \t]*:::[ \t]*(?:\n|$)/, x = g.create({
12
15
  name: "subPages",
13
16
  group: "block",
14
17
  atom: !0,
15
18
  draggable: !0,
16
19
  selectable: !0,
17
20
  parseHTML: () => [{ tag: "div[data-sub-pages]" }],
18
- renderHTML: ({ HTMLAttributes: e }) => ["div", p(e, { "data-sub-pages": "" })],
19
- addNodeView: () => f(g),
21
+ renderHTML: ({ HTMLAttributes: e }) => ["div", y(e, { "data-sub-pages": "" })],
22
+ addNodeView: () => v(S),
20
23
  markdownTokenName: "subPages",
21
24
  markdownTokenizer: {
22
25
  name: "subPages",
23
26
  level: "block",
24
27
  start: (e) => e.search(/^:::subpages/m),
25
28
  tokenize: (e) => {
26
- let t = m.exec(e);
29
+ let t = b.exec(e);
27
30
  return t ? {
28
31
  type: "subPages",
29
32
  raw: t[0]
@@ -33,39 +36,93 @@ var m = /^:::subpages[ \t]*\n[ \t]*:::[ \t]*(?:\n|$)/, h = u.create({
33
36
  parseMarkdown: (e, t) => t.createNode("subPages"),
34
37
  renderMarkdown: () => ":::subpages\n:::"
35
38
  });
36
- function g() {
37
- let u = o("docs"), { workspace: f = "", doc: p = "" } = a({ strict: !1 }), { data: m } = l({
38
- ...e(f, p),
39
- enabled: !!f && !!p
40
- }), { data: h = [] } = l({
41
- ...t(f, { parent: m?.key ?? "" }),
42
- enabled: !!f && !!m
43
- });
44
- return /* @__PURE__ */ c(d, {
39
+ function S({ editor: g }) {
40
+ let v = d("docs"), y = d("common"), { workspace: b = "", doc: x = "" } = l({ strict: !1 }), { data: S } = m({
41
+ ...e(b, x),
42
+ enabled: !!b && !!x
43
+ }), { data: C = [] } = m({
44
+ ...t(b, { parent: S?.key ?? "" }),
45
+ enabled: !!b && !!S
46
+ }), { data: w = [] } = m({
47
+ ...n(b),
48
+ enabled: !!b
49
+ }), T = o(b), E = a(b), { confirm: D, dialog: O } = r(), [k, A] = u(), j = g.isEditable, M = (e) => T(e, { onRename: () => A(e.key) }).flatMap((t) => {
50
+ if (!("label" in t)) return [t];
51
+ if (t.label === v("archive")) return [{
52
+ label: v("archive"),
53
+ destructive: !0,
54
+ onClick: () => {
55
+ D({
56
+ title: v("archiveConfirm", { title: e.title || v("untitled") }),
57
+ description: v("archiveDetail"),
58
+ confirmLabel: v("archive"),
59
+ onConfirm: () => E.archive.mutateAsync(e)
60
+ });
61
+ }
62
+ }];
63
+ if (t.label === v("moveTo")) {
64
+ let n = w.find((t) => t.id === e.teamId)?.key ?? "workspace";
65
+ return [{
66
+ label: v("moveOut"),
67
+ onClick: () => E.move.mutate({
68
+ doc: e,
69
+ space: n
70
+ })
71
+ }, t];
72
+ }
73
+ return [t];
74
+ }), N = (e, t) => {
75
+ A(void 0);
76
+ let n = t.trim();
77
+ n && n !== e.title && E.rename.mutate({
78
+ doc: e,
79
+ title: n
80
+ });
81
+ };
82
+ return /* @__PURE__ */ p(_, {
45
83
  className: "sub-pages",
46
84
  contentEditable: !1,
47
85
  "data-drag-handle": !0,
48
- children: [/* @__PURE__ */ s("p", {
49
- className: "sub-pages-title",
50
- children: u("subPages")
51
- }), h.length === 0 ? /* @__PURE__ */ s("p", {
52
- className: "sub-pages-empty",
53
- children: u("noSubPages")
54
- }) : /* @__PURE__ */ s("ul", { children: h.map((e) => /* @__PURE__ */ s("li", { children: /* @__PURE__ */ c(r, {
55
- to: "/$workspace/docs/$doc",
56
- params: {
57
- workspace: f,
58
- doc: n(e)
59
- },
60
- className: "sub-pages-link",
61
- children: [/* @__PURE__ */ s(i, {
62
- icon: e.icon,
63
- className: "size-4"
64
- }), /* @__PURE__ */ s("span", {
65
- className: "truncate",
66
- children: e.title
67
- })]
68
- }) }, e.key)) })]
86
+ children: [
87
+ /* @__PURE__ */ f("p", {
88
+ className: "sub-pages-title",
89
+ children: v("subPages")
90
+ }),
91
+ C.length === 0 ? /* @__PURE__ */ f("p", {
92
+ className: "sub-pages-empty",
93
+ children: v("noSubPages")
94
+ }) : /* @__PURE__ */ f("ul", { children: C.map((e) => /* @__PURE__ */ p("li", {
95
+ className: "group flex items-center gap-1",
96
+ children: [k === e.key ? /* @__PURE__ */ f("input", {
97
+ autoFocus: !0,
98
+ defaultValue: e.title,
99
+ "aria-label": v("rename"),
100
+ className: "sub-pages-rename",
101
+ onBlur: (t) => N(e, t.currentTarget.value),
102
+ onKeyDown: (t) => {
103
+ t.key === "Enter" && N(e, t.currentTarget.value), t.key === "Escape" && A(void 0);
104
+ }
105
+ }) : /* @__PURE__ */ p(s, {
106
+ to: "/$workspace/docs/$doc",
107
+ params: {
108
+ workspace: b,
109
+ doc: i(e)
110
+ },
111
+ className: "sub-pages-link",
112
+ children: [/* @__PURE__ */ f(c, {
113
+ icon: e.icon,
114
+ className: "size-4"
115
+ }), /* @__PURE__ */ f("span", {
116
+ className: "truncate",
117
+ children: e.title
118
+ })]
119
+ }), j && /* @__PURE__ */ f(h, {
120
+ items: () => M(e),
121
+ label: y("moreActionsFor", { name: e.title || v("untitled") })
122
+ })]
123
+ }, e.key)) }),
124
+ O
125
+ ]
69
126
  });
70
127
  }
71
- export { h as SubPages };
128
+ export { x as SubPages };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parallelworks/tandem-web",
3
- "version": "0.179.1",
3
+ "version": "0.179.2",
4
4
  "description": "Tandem's pages, for a host app to render in its own",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -198,7 +198,7 @@ function j() {
198
198
  "aria-label": g("groupBy"),
199
199
  size: "sm",
200
200
  width: "content"
201
- }) : /* @__PURE__ */ D(C, {
201
+ }) : R.length > 0 && /* @__PURE__ */ D(C, {
202
202
  multiple: !0,
203
203
  value: W.columns ?? R.map((e) => e.id),
204
204
  items: R.map((e) => ({
@@ -175,7 +175,7 @@ function Ft() {
175
175
  }),
176
176
  /* @__PURE__ */ q(ht, {
177
177
  text: Fe(f.identifier, f.title),
178
- label: i("copyBranchName"),
178
+ label: i("branchName"),
179
179
  icon: /* @__PURE__ */ q(se, {}),
180
180
  size: "sm",
181
181
  variant: "ghost",
@@ -259,7 +259,7 @@ function ae({ workspace: n, team: r, isAdmin: a }) {
259
259
  children: v
260
260
  }), /* @__PURE__ */ q(N, {
261
261
  text: v,
262
- label: o("copyLink"),
262
+ label: o("formLink"),
263
263
  size: "sm",
264
264
  variant: "ghost"
265
265
  })]
@@ -287,7 +287,7 @@ function ae({ workspace: n, team: r, isAdmin: a }) {
287
287
  children: y
288
288
  }), /* @__PURE__ */ q(N, {
289
289
  text: y,
290
- label: o("copyAddress"),
290
+ label: o("emailAddress"),
291
291
  size: "sm",
292
292
  variant: "ghost"
293
293
  })]
package/styles.css CHANGED
@@ -572,6 +572,8 @@ body[data-tandem] > :not(:has(.tandem)) {
572
572
  }
573
573
  .prose-issue .sub-pages a.sub-pages-link {
574
574
  display: flex;
575
+ flex: 1;
576
+ min-width: 0;
575
577
  align-items: center;
576
578
  gap: 0.5rem;
577
579
  border: 0;
@@ -586,6 +588,16 @@ body[data-tandem] > :not(:has(.tandem)) {
586
588
  .prose-issue .sub-pages a.sub-pages-link:hover {
587
589
  background: var(--color-muted);
588
590
  }
591
+ /* A sub-page being renamed in its row (SubPages). */
592
+ .prose-issue .sub-pages .sub-pages-rename {
593
+ flex: 1;
594
+ min-width: 0;
595
+ border-radius: 0.375rem;
596
+ border: 1px solid var(--color-border);
597
+ background: var(--color-background);
598
+ padding: 0.25rem 0.5rem;
599
+ font: inherit;
600
+ }
589
601
  /* An issue synced with the one a link goes to, after the link (LinkedIssues). */
590
602
  .prose-issue .linked-issue {
591
603
  display: inline-flex;