@parallelworks/tandem-web 0.157.0 → 0.158.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 +20 -0
- package/_virtual/_virtual_i18n/es/common.js +20 -0
- package/_virtual/_virtual_i18n/ja/common.js +20 -0
- package/_virtual/_virtual_i18n/ko/common.js +20 -0
- package/_virtual/_virtual_i18n/zh/common.js +20 -0
- package/api/queries.js +30 -2
- package/components/Editor.js +78 -76
- package/components/Figma.js +215 -0
- package/components/LinkCard.js +63 -56
- package/components/SlashMenu.js +2 -0
- package/package.json +1 -1
- package/routes/_workspace/issues/_identifier2.js +167 -162
|
@@ -2340,6 +2340,21 @@ var e = {
|
|
|
2340
2340
|
parent: "Under",
|
|
2341
2341
|
thisDoc: "This doc"
|
|
2342
2342
|
},
|
|
2343
|
+
figma: {
|
|
2344
|
+
site: "Figma",
|
|
2345
|
+
reading: "Reading Figma…",
|
|
2346
|
+
file: "Figma file",
|
|
2347
|
+
edited: "Edited {when}",
|
|
2348
|
+
editedBy: "Edited {when} by {who}",
|
|
2349
|
+
connectToPreview: "Connect your Figma account to see a preview.",
|
|
2350
|
+
connect: "Connect Figma",
|
|
2351
|
+
noAccess: "You can't open this file in Figma",
|
|
2352
|
+
embedAddress: "Link to a Figma file or frame",
|
|
2353
|
+
embed: "Embed",
|
|
2354
|
+
embedTitle: "Figma frame",
|
|
2355
|
+
issueSection: "Design",
|
|
2356
|
+
changed: "Changed since the issue was updated"
|
|
2357
|
+
},
|
|
2343
2358
|
linkCard: {
|
|
2344
2359
|
address: "Address of the page",
|
|
2345
2360
|
make: "Make card",
|
|
@@ -2499,6 +2514,11 @@ var e = {
|
|
|
2499
2514
|
hint: "An equation in the line, in LaTeX",
|
|
2500
2515
|
keywords: "math inline equation latex formula"
|
|
2501
2516
|
},
|
|
2517
|
+
figma: {
|
|
2518
|
+
label: "Figma frame",
|
|
2519
|
+
hint: "A live Figma file or frame",
|
|
2520
|
+
keywords: "figma design frame prototype embed mockup"
|
|
2521
|
+
},
|
|
2502
2522
|
linkCard: {
|
|
2503
2523
|
label: "Link card",
|
|
2504
2524
|
hint: "A link shown with its page's title, description and icon",
|
|
@@ -2340,6 +2340,21 @@ var e = {
|
|
|
2340
2340
|
parent: "Dentro de",
|
|
2341
2341
|
thisDoc: "Este documento"
|
|
2342
2342
|
},
|
|
2343
|
+
figma: {
|
|
2344
|
+
site: "Figma",
|
|
2345
|
+
reading: "Leyendo Figma…",
|
|
2346
|
+
file: "Archivo de Figma",
|
|
2347
|
+
edited: "Editado {when}",
|
|
2348
|
+
editedBy: "Editado {when} por {who}",
|
|
2349
|
+
connectToPreview: "Conecta tu cuenta de Figma para ver una vista previa.",
|
|
2350
|
+
connect: "Conectar Figma",
|
|
2351
|
+
noAccess: "No puedes abrir este archivo en Figma",
|
|
2352
|
+
embedAddress: "Enlace a un archivo o marco de Figma",
|
|
2353
|
+
embed: "Insertar",
|
|
2354
|
+
embedTitle: "Marco de Figma",
|
|
2355
|
+
issueSection: "Diseño",
|
|
2356
|
+
changed: "Cambió desde que se actualizó la incidencia"
|
|
2357
|
+
},
|
|
2343
2358
|
linkCard: {
|
|
2344
2359
|
address: "Dirección de la página",
|
|
2345
2360
|
make: "Crear tarjeta",
|
|
@@ -2499,6 +2514,11 @@ var e = {
|
|
|
2499
2514
|
hint: "Una ecuación dentro del texto, en LaTeX",
|
|
2500
2515
|
keywords: "matemáticas ecuación en línea latex math"
|
|
2501
2516
|
},
|
|
2517
|
+
figma: {
|
|
2518
|
+
label: "Marco de Figma",
|
|
2519
|
+
hint: "Un archivo o marco de Figma en vivo",
|
|
2520
|
+
keywords: "figma diseño marco prototipo insertar maqueta design frame"
|
|
2521
|
+
},
|
|
2502
2522
|
linkCard: {
|
|
2503
2523
|
label: "Tarjeta de enlace",
|
|
2504
2524
|
hint: "Un enlace con el título, la descripción y el icono de su página",
|
|
@@ -2340,6 +2340,21 @@ var e = {
|
|
|
2340
2340
|
parent: "親",
|
|
2341
2341
|
thisDoc: "このドキュメント"
|
|
2342
2342
|
},
|
|
2343
|
+
figma: {
|
|
2344
|
+
site: "Figma",
|
|
2345
|
+
reading: "Figma を読み込み中…",
|
|
2346
|
+
file: "Figma ファイル",
|
|
2347
|
+
edited: "{when}に編集",
|
|
2348
|
+
editedBy: "{when}に {who} が編集",
|
|
2349
|
+
connectToPreview: "プレビューを表示するには Figma アカウントを接続してください。",
|
|
2350
|
+
connect: "Figma を接続",
|
|
2351
|
+
noAccess: "このファイルは Figma で開けません",
|
|
2352
|
+
embedAddress: "Figma のファイルまたはフレームへのリンク",
|
|
2353
|
+
embed: "埋め込む",
|
|
2354
|
+
embedTitle: "Figma フレーム",
|
|
2355
|
+
issueSection: "デザイン",
|
|
2356
|
+
changed: "課題の更新後に変更あり"
|
|
2357
|
+
},
|
|
2343
2358
|
linkCard: {
|
|
2344
2359
|
address: "ページのアドレス",
|
|
2345
2360
|
make: "カードを作成",
|
|
@@ -2499,6 +2514,11 @@ var e = {
|
|
|
2499
2514
|
hint: "行内の数式(LaTeX)",
|
|
2500
2515
|
keywords: "数式 インライン latex math"
|
|
2501
2516
|
},
|
|
2517
|
+
figma: {
|
|
2518
|
+
label: "Figma フレーム",
|
|
2519
|
+
hint: "ライブの Figma ファイルまたはフレーム",
|
|
2520
|
+
keywords: "figma デザイン フレーム プロトタイプ 埋め込み design frame"
|
|
2521
|
+
},
|
|
2502
2522
|
linkCard: {
|
|
2503
2523
|
label: "リンクカード",
|
|
2504
2524
|
hint: "ページのタイトル、説明、アイコン付きのリンク",
|
|
@@ -2340,6 +2340,21 @@ var e = {
|
|
|
2340
2340
|
parent: "상위",
|
|
2341
2341
|
thisDoc: "이 문서"
|
|
2342
2342
|
},
|
|
2343
|
+
figma: {
|
|
2344
|
+
site: "Figma",
|
|
2345
|
+
reading: "Figma 읽는 중…",
|
|
2346
|
+
file: "Figma 파일",
|
|
2347
|
+
edited: "{when} 편집됨",
|
|
2348
|
+
editedBy: "{when} {who}님이 편집함",
|
|
2349
|
+
connectToPreview: "미리보기를 보려면 Figma 계정을 연결하세요.",
|
|
2350
|
+
connect: "Figma 연결",
|
|
2351
|
+
noAccess: "Figma에서 이 파일을 열 수 없습니다",
|
|
2352
|
+
embedAddress: "Figma 파일 또는 프레임 링크",
|
|
2353
|
+
embed: "삽입",
|
|
2354
|
+
embedTitle: "Figma 프레임",
|
|
2355
|
+
issueSection: "디자인",
|
|
2356
|
+
changed: "이슈가 업데이트된 후 변경됨"
|
|
2357
|
+
},
|
|
2343
2358
|
linkCard: {
|
|
2344
2359
|
address: "페이지 주소",
|
|
2345
2360
|
make: "카드 만들기",
|
|
@@ -2499,6 +2514,11 @@ var e = {
|
|
|
2499
2514
|
hint: "줄 안의 수식(LaTeX)",
|
|
2500
2515
|
keywords: "수식 인라인 latex math"
|
|
2501
2516
|
},
|
|
2517
|
+
figma: {
|
|
2518
|
+
label: "Figma 프레임",
|
|
2519
|
+
hint: "실시간 Figma 파일 또는 프레임",
|
|
2520
|
+
keywords: "figma 디자인 프레임 프로토타입 삽입 design frame"
|
|
2521
|
+
},
|
|
2502
2522
|
linkCard: {
|
|
2503
2523
|
label: "링크 카드",
|
|
2504
2524
|
hint: "페이지 제목, 설명, 아이콘이 있는 링크",
|
|
@@ -2340,6 +2340,21 @@ var e = {
|
|
|
2340
2340
|
parent: "上级",
|
|
2341
2341
|
thisDoc: "此文档"
|
|
2342
2342
|
},
|
|
2343
|
+
figma: {
|
|
2344
|
+
site: "Figma",
|
|
2345
|
+
reading: "正在读取 Figma…",
|
|
2346
|
+
file: "Figma 文件",
|
|
2347
|
+
edited: "{when}编辑",
|
|
2348
|
+
editedBy: "{who} 于{when}编辑",
|
|
2349
|
+
connectToPreview: "连接你的 Figma 账号以查看预览。",
|
|
2350
|
+
connect: "连接 Figma",
|
|
2351
|
+
noAccess: "你无法在 Figma 中打开此文件",
|
|
2352
|
+
embedAddress: "Figma 文件或画框的链接",
|
|
2353
|
+
embed: "嵌入",
|
|
2354
|
+
embedTitle: "Figma 画框",
|
|
2355
|
+
issueSection: "设计",
|
|
2356
|
+
changed: "问题更新后有改动"
|
|
2357
|
+
},
|
|
2343
2358
|
linkCard: {
|
|
2344
2359
|
address: "页面地址",
|
|
2345
2360
|
make: "创建卡片",
|
|
@@ -2499,6 +2514,11 @@ var e = {
|
|
|
2499
2514
|
hint: "行内的公式(LaTeX)",
|
|
2500
2515
|
keywords: "公式 行内 数学 latex math"
|
|
2501
2516
|
},
|
|
2517
|
+
figma: {
|
|
2518
|
+
label: "Figma 画框",
|
|
2519
|
+
hint: "实时的 Figma 文件或画框",
|
|
2520
|
+
keywords: "figma 设计 画框 原型 嵌入 design frame"
|
|
2521
|
+
},
|
|
2502
2522
|
linkCard: {
|
|
2503
2523
|
label: "链接卡片",
|
|
2504
2524
|
hint: "显示页面标题、描述和图标的链接",
|
package/api/queries.js
CHANGED
|
@@ -419,7 +419,8 @@ var a = i({
|
|
|
419
419
|
},
|
|
420
420
|
signal: i
|
|
421
421
|
})),
|
|
422
|
-
placeholderData: (e) => e
|
|
422
|
+
placeholderData: (e) => e,
|
|
423
|
+
retry: !1
|
|
423
424
|
}), R = (e) => i({
|
|
424
425
|
queryKey: [
|
|
425
426
|
"workspace",
|
|
@@ -1414,5 +1415,32 @@ var Ke = (e) => i({
|
|
|
1414
1415
|
params: h(e, r),
|
|
1415
1416
|
signal: i
|
|
1416
1417
|
}))
|
|
1418
|
+
}), mt = (e, r) => i({
|
|
1419
|
+
queryKey: [
|
|
1420
|
+
"workspace",
|
|
1421
|
+
e,
|
|
1422
|
+
"issues",
|
|
1423
|
+
r.toUpperCase(),
|
|
1424
|
+
"figma"
|
|
1425
|
+
],
|
|
1426
|
+
queryFn: async ({ signal: i }) => n(await t.GET("/api/v1/workspaces/{workspace}/issues/{identifier}/figma", {
|
|
1427
|
+
params: h(e, r),
|
|
1428
|
+
signal: i
|
|
1429
|
+
}))
|
|
1430
|
+
}), ht = (e, r) => i({
|
|
1431
|
+
queryKey: [
|
|
1432
|
+
"workspace",
|
|
1433
|
+
e,
|
|
1434
|
+
"figma",
|
|
1435
|
+
r
|
|
1436
|
+
],
|
|
1437
|
+
queryFn: async ({ signal: i }) => n(await t.GET("/api/v1/workspaces/{workspace}/figma/preview", {
|
|
1438
|
+
params: {
|
|
1439
|
+
path: { workspace: e },
|
|
1440
|
+
query: { url: r }
|
|
1441
|
+
},
|
|
1442
|
+
signal: i
|
|
1443
|
+
})),
|
|
1444
|
+
staleTime: 12e4
|
|
1417
1445
|
});
|
|
1418
|
-
export { U as agentQuery, H as agentsQuery, Ve as allDecisionsQuery, De as areaThreadQuery, Oe as areasQuery, b as attachmentsQuery, ot as auditLogQuery, $ as availableRepositoriesQuery, it as branchesQuery, et as codeHostAccountsQuery, $e as codeHostQuery, y as commentsQuery, Ee as countsQuery, V as customerRequestsQuery, B as customersQuery, ct as cycleReportQuery, Xe as cyclesQuery, I as dashboardQuery, F as dashboardsQuery, Pe as docBacklinksQuery, me as docCommentsQuery, ae as docDecisionsQuery, ve as docGraphQuery, Me as docIssuesQuery, _e as docQuery, pe as docTemplatesQuery, ge as docVersionQuery, he as docVersionsQuery, fe as docsQuery, x as eventsQuery, se as favoritesQuery, Ge as followQuery, He as githubAccountQuery, We as githubSettingsQuery, A as gitlabQuery, R as groupsQuery, oe as inboxQuery, ft as intercomQuery, ie as issueDecisionsQuery, Ne as issueDocsQuery, pt as issueIntercomQuery, Qe as issueLinksQuery, g as issueQuery, m as issueSearchQuery, dt as issueSentryQuery, d as issueTemplatesQuery, rt as issueZendeskQuery, p as issuesQuery, j as jiraImportQuery, Ie as knowledgeEntryQuery, Re as knowledgeEventsQuery, Ae as knowledgeGraphQuery, Le as knowledgeMentionsQuery, Fe as knowledgeQuery, ne as labelsQuery, M as linearImportQuery, Se as lostSectionsQuery, a as meQuery, we as measuresQuery, u as membersQuery, Be as myAllDecisionsQuery, ze as myDecisionsQuery, z as myModelsQuery, ue as notificationSettingsQuery, le as notificationsQuery, Te as pageLinkQuery, L as panelQuery, q as parallelWorksBucketsQuery, K as parallelWorksQuery, w as peopleQuery, O as permissionsQuery, at as personActivityQuery, re as personCardQuery, k as projectAccessQuery, Je as projectEventsQuery, Q as projectOf, Ye as projectQuery, qe as projectUpdatesQuery, Ke as projectsQuery, o as providersQuery, nt as pullRequestsQuery, de as pushSettingsQuery, v as reactionsQuery, Ze as relatedIssuesQuery, tt as repositoriesQuery, D as rolesQuery, Y as runActivityQuery, Ce as runReadsQuery, J as runnersQuery, X as runsQuery, ut as sentryProjectsQuery, lt as sentryQuery, G as sessionsQuery, ye as shareLinksQuery, xe as sharedDocQuery, be as sharedQuery, N as slackQuery, Ue as ssoQuery, st as statusHistoryQuery, te as statusesQuery, _ as subscriptionQuery, E as teamAccessQuery, S as teamMembersQuery, C as teamRotationQuery, ee as teamsQuery, W as tokensQuery, ke as unfiledQuery, ce as viewsQuery, l as webhooksQuery, T as workspaceAccessQuery, je as workspaceGraphQuery, c as workspaceQuery, P as zendeskQuery };
|
|
1446
|
+
export { U as agentQuery, H as agentsQuery, Ve as allDecisionsQuery, De as areaThreadQuery, Oe as areasQuery, b as attachmentsQuery, ot as auditLogQuery, $ as availableRepositoriesQuery, it as branchesQuery, et as codeHostAccountsQuery, $e as codeHostQuery, y as commentsQuery, Ee as countsQuery, V as customerRequestsQuery, B as customersQuery, ct as cycleReportQuery, Xe as cyclesQuery, I as dashboardQuery, F as dashboardsQuery, Pe as docBacklinksQuery, me as docCommentsQuery, ae as docDecisionsQuery, ve as docGraphQuery, Me as docIssuesQuery, _e as docQuery, pe as docTemplatesQuery, ge as docVersionQuery, he as docVersionsQuery, fe as docsQuery, x as eventsQuery, se as favoritesQuery, ht as figmaPreviewQuery, Ge as followQuery, He as githubAccountQuery, We as githubSettingsQuery, A as gitlabQuery, R as groupsQuery, oe as inboxQuery, ft as intercomQuery, ie as issueDecisionsQuery, Ne as issueDocsQuery, mt as issueFigmaQuery, pt as issueIntercomQuery, Qe as issueLinksQuery, g as issueQuery, m as issueSearchQuery, dt as issueSentryQuery, d as issueTemplatesQuery, rt as issueZendeskQuery, p as issuesQuery, j as jiraImportQuery, Ie as knowledgeEntryQuery, Re as knowledgeEventsQuery, Ae as knowledgeGraphQuery, Le as knowledgeMentionsQuery, Fe as knowledgeQuery, ne as labelsQuery, M as linearImportQuery, Se as lostSectionsQuery, a as meQuery, we as measuresQuery, u as membersQuery, Be as myAllDecisionsQuery, ze as myDecisionsQuery, z as myModelsQuery, ue as notificationSettingsQuery, le as notificationsQuery, Te as pageLinkQuery, L as panelQuery, q as parallelWorksBucketsQuery, K as parallelWorksQuery, w as peopleQuery, O as permissionsQuery, at as personActivityQuery, re as personCardQuery, k as projectAccessQuery, Je as projectEventsQuery, Q as projectOf, Ye as projectQuery, qe as projectUpdatesQuery, Ke as projectsQuery, o as providersQuery, nt as pullRequestsQuery, de as pushSettingsQuery, v as reactionsQuery, Ze as relatedIssuesQuery, tt as repositoriesQuery, D as rolesQuery, Y as runActivityQuery, Ce as runReadsQuery, J as runnersQuery, X as runsQuery, ut as sentryProjectsQuery, lt as sentryQuery, G as sessionsQuery, ye as shareLinksQuery, xe as sharedDocQuery, be as sharedQuery, N as slackQuery, Ue as ssoQuery, st as statusHistoryQuery, te as statusesQuery, _ as subscriptionQuery, E as teamAccessQuery, S as teamMembersQuery, C as teamRotationQuery, ee as teamsQuery, W as tokensQuery, ke as unfiledQuery, ce as viewsQuery, l as webhooksQuery, T as workspaceAccessQuery, je as workspaceGraphQuery, c as workspaceQuery, P as zendeskQuery };
|
package/components/Editor.js
CHANGED
|
@@ -6,86 +6,87 @@ import { DocButton as o } from "./DocButton.js";
|
|
|
6
6
|
import { AttachmentFiles as s, AttachmentImage as c, DocLinkIcons as l, DocLinks as u, IssueMentions as d, KnowledgeTerms as f, LinkedIssues as p, PeopleMentions as m, TeamNames as h } from "./editorPlugins.js";
|
|
7
7
|
import { DocLinkPicker as g } from "./DocLinkPicker.js";
|
|
8
8
|
import { DocViewBlock as _ } from "./DocViewBlock.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import L from "@tiptap/
|
|
25
|
-
import re from "
|
|
26
|
-
import R from "highlight.js/lib/languages/
|
|
27
|
-
import z from "highlight.js/lib/languages/
|
|
28
|
-
import B from "highlight.js/lib/languages/
|
|
29
|
-
import V from "highlight.js/lib/languages/
|
|
30
|
-
import H from "highlight.js/lib/languages/
|
|
31
|
-
import U from "highlight.js/lib/languages/
|
|
32
|
-
import W from "highlight.js/lib/languages/
|
|
33
|
-
import G from "highlight.js/lib/languages/
|
|
34
|
-
import K from "highlight.js/lib/languages/
|
|
35
|
-
import q from "highlight.js/lib/languages/
|
|
36
|
-
import J from "highlight.js/lib/languages/
|
|
37
|
-
import Y from "highlight.js/lib/languages/
|
|
38
|
-
import X from "highlight.js/lib/languages/
|
|
39
|
-
import Z from "highlight.js/lib/languages/
|
|
40
|
-
import ie from "highlight.js/lib/languages/
|
|
41
|
-
import
|
|
9
|
+
import { FigmaEmbedBlock as v } from "./Figma.js";
|
|
10
|
+
import { IssueListBlock as y } from "./IssueListBlock.js";
|
|
11
|
+
import { LinkCard as b } from "./LinkCard.js";
|
|
12
|
+
import { MentionPicker as x } from "./MentionPicker.js";
|
|
13
|
+
import { Diagrams as ee, MathBlock as te, MathInline as ne } from "./mathDiagrams.js";
|
|
14
|
+
import { SlashMenu as S } from "./SlashMenu.js";
|
|
15
|
+
import { SubPages as C } from "./SubPages.js";
|
|
16
|
+
import { MarkdownTable as w } from "./table.js";
|
|
17
|
+
import { useEffect as T, useRef as E } from "react";
|
|
18
|
+
import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
19
|
+
import { CodeBlockLowlight as A } from "@tiptap/extension-code-block-lowlight";
|
|
20
|
+
import { TaskItem as j, TaskList as M } from "@tiptap/extension-list";
|
|
21
|
+
import { TableKit as N } from "@tiptap/extension-table";
|
|
22
|
+
import { Placeholder as P } from "@tiptap/extensions";
|
|
23
|
+
import { Markdown as F } from "@tiptap/markdown";
|
|
24
|
+
import { EditorContent as I, useEditor as L } from "@tiptap/react";
|
|
25
|
+
import re from "@tiptap/starter-kit";
|
|
26
|
+
import R from "highlight.js/lib/languages/bash";
|
|
27
|
+
import z from "highlight.js/lib/languages/css";
|
|
28
|
+
import B from "highlight.js/lib/languages/diff";
|
|
29
|
+
import V from "highlight.js/lib/languages/dockerfile";
|
|
30
|
+
import H from "highlight.js/lib/languages/go";
|
|
31
|
+
import U from "highlight.js/lib/languages/ini";
|
|
32
|
+
import W from "highlight.js/lib/languages/javascript";
|
|
33
|
+
import G from "highlight.js/lib/languages/json";
|
|
34
|
+
import K from "highlight.js/lib/languages/markdown";
|
|
35
|
+
import q from "highlight.js/lib/languages/python";
|
|
36
|
+
import J from "highlight.js/lib/languages/rust";
|
|
37
|
+
import Y from "highlight.js/lib/languages/shell";
|
|
38
|
+
import X from "highlight.js/lib/languages/sql";
|
|
39
|
+
import Z from "highlight.js/lib/languages/typescript";
|
|
40
|
+
import ie from "highlight.js/lib/languages/xml";
|
|
41
|
+
import ae from "highlight.js/lib/languages/yaml";
|
|
42
|
+
import { createLowlight as oe } from "lowlight";
|
|
42
43
|
// src/components/Editor.tsx
|
|
43
|
-
var
|
|
44
|
-
bash:
|
|
45
|
-
css:
|
|
46
|
-
diff:
|
|
47
|
-
dockerfile:
|
|
48
|
-
go:
|
|
49
|
-
ini:
|
|
50
|
-
javascript:
|
|
51
|
-
json:
|
|
52
|
-
markdown:
|
|
53
|
-
python:
|
|
54
|
-
rust:
|
|
55
|
-
shell:
|
|
56
|
-
sql:
|
|
57
|
-
typescript:
|
|
58
|
-
xml:
|
|
59
|
-
yaml:
|
|
44
|
+
var se = oe({
|
|
45
|
+
bash: R,
|
|
46
|
+
css: z,
|
|
47
|
+
diff: B,
|
|
48
|
+
dockerfile: V,
|
|
49
|
+
go: H,
|
|
50
|
+
ini: U,
|
|
51
|
+
javascript: W,
|
|
52
|
+
json: G,
|
|
53
|
+
markdown: K,
|
|
54
|
+
python: q,
|
|
55
|
+
rust: J,
|
|
56
|
+
shell: Y,
|
|
57
|
+
sql: X,
|
|
58
|
+
typescript: Z,
|
|
59
|
+
xml: ie,
|
|
60
|
+
yaml: ae
|
|
60
61
|
});
|
|
61
|
-
function Q({ editable: g = !0, placeholder:
|
|
62
|
+
function Q({ editable: g = !0, placeholder: x = "", collaborative: S = !1 } = {}) {
|
|
62
63
|
return [
|
|
63
|
-
|
|
64
|
+
re.configure({
|
|
64
65
|
link: {
|
|
65
66
|
openOnClick: !g,
|
|
66
67
|
autolink: !0
|
|
67
68
|
},
|
|
68
69
|
codeBlock: !1,
|
|
69
70
|
blockquote: !1,
|
|
70
|
-
...g && !
|
|
71
|
-
...
|
|
71
|
+
...g && !S ? {} : { trailingNode: !1 },
|
|
72
|
+
...S ? { undoRedo: !1 } : {}
|
|
72
73
|
}),
|
|
73
|
-
|
|
74
|
+
A.configure({ lowlight: se }),
|
|
74
75
|
e,
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
M,
|
|
77
|
+
j.configure({ nested: !0 }),
|
|
77
78
|
r,
|
|
78
|
-
|
|
79
|
+
C,
|
|
79
80
|
n,
|
|
80
81
|
t,
|
|
81
82
|
i,
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
N.configure({ table: !1 }),
|
|
84
|
+
w.configure({
|
|
84
85
|
resizable: !1,
|
|
85
86
|
allowTableNodeSelection: !1
|
|
86
87
|
}),
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
P.configure({ placeholder: x }),
|
|
89
|
+
F,
|
|
89
90
|
f,
|
|
90
91
|
u,
|
|
91
92
|
l,
|
|
@@ -97,11 +98,12 @@ function Q({ editable: g = !0, placeholder: y = "", collaborative: x = !1 } = {}
|
|
|
97
98
|
d,
|
|
98
99
|
_,
|
|
99
100
|
o,
|
|
101
|
+
b,
|
|
100
102
|
v,
|
|
101
103
|
ne,
|
|
102
104
|
te,
|
|
103
|
-
b,
|
|
104
105
|
ee,
|
|
106
|
+
y,
|
|
105
107
|
a
|
|
106
108
|
];
|
|
107
109
|
}
|
|
@@ -120,8 +122,8 @@ function $(e) {
|
|
|
120
122
|
}
|
|
121
123
|
};
|
|
122
124
|
}
|
|
123
|
-
function
|
|
124
|
-
let f =
|
|
125
|
+
function ce({ value: e, onChange: t, onSubmit: n, onBlur: r, onFocus: i, placeholder: a, editable: o = !0, autofocus: s = !1, className: c = "", label: l, onFiles: u, onEditor: d }) {
|
|
126
|
+
let f = E({
|
|
125
127
|
onChange: t,
|
|
126
128
|
onSubmit: n,
|
|
127
129
|
onBlur: r,
|
|
@@ -133,9 +135,9 @@ function se({ value: e, onChange: t, onSubmit: n, onBlur: r, onFocus: i, placeho
|
|
|
133
135
|
onBlur: r,
|
|
134
136
|
onFocus: i
|
|
135
137
|
};
|
|
136
|
-
let p =
|
|
138
|
+
let p = E(u);
|
|
137
139
|
p.current = u;
|
|
138
|
-
let m =
|
|
140
|
+
let m = L({
|
|
139
141
|
extensions: Q({
|
|
140
142
|
editable: o,
|
|
141
143
|
placeholder: a ?? ""
|
|
@@ -162,23 +164,23 @@ function se({ value: e, onChange: t, onSubmit: n, onBlur: r, onFocus: i, placeho
|
|
|
162
164
|
onBlur: ({ editor: e }) => f.current.onBlur?.(e.getMarkdown()),
|
|
163
165
|
onFocus: () => f.current.onFocus?.()
|
|
164
166
|
});
|
|
165
|
-
|
|
167
|
+
T(() => {
|
|
166
168
|
m && !m.isFocused && m.getMarkdown() !== e && m.commands.setContent(e, {
|
|
167
169
|
contentType: "markdown",
|
|
168
170
|
emitUpdate: !1
|
|
169
171
|
});
|
|
170
|
-
}, [m, e]),
|
|
172
|
+
}, [m, e]), T(() => {
|
|
171
173
|
m?.setEditable(o);
|
|
172
174
|
}, [m, o]);
|
|
173
|
-
let h =
|
|
174
|
-
return h.current = d,
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
o && /* @__PURE__ */
|
|
177
|
-
o && /* @__PURE__ */
|
|
175
|
+
let h = E(d);
|
|
176
|
+
return h.current = d, T(() => (h.current?.(m), () => h.current?.(null)), [m]), /* @__PURE__ */ k(D, { children: [
|
|
177
|
+
/* @__PURE__ */ O(I, { editor: m }),
|
|
178
|
+
o && /* @__PURE__ */ O(g, { editor: m }),
|
|
179
|
+
o && /* @__PURE__ */ O(S, {
|
|
178
180
|
editor: m,
|
|
179
181
|
onFiles: p
|
|
180
182
|
}),
|
|
181
|
-
o && /* @__PURE__ */
|
|
183
|
+
o && /* @__PURE__ */ O(x, { editor: m })
|
|
182
184
|
] });
|
|
183
185
|
}
|
|
184
|
-
export {
|
|
186
|
+
export { ce as Editor, Q as contentExtensions, $ as fileHandlers };
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { figmaPreviewQuery as e, issueFigmaQuery as t } from "../api/queries.js";
|
|
2
|
+
import { externalUrl as n } from "../lib/externalUrl.js";
|
|
3
|
+
import { useTime as r } from "../lib/time.js";
|
|
4
|
+
import { Card as i, Input as a, buttonClasses as o } from "@parallelworks/ui";
|
|
5
|
+
import { useParams as s } from "@tanstack/react-router";
|
|
6
|
+
import { useState as c } from "react";
|
|
7
|
+
import { useTranslations as l } from "use-intl";
|
|
8
|
+
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
9
|
+
import { useQuery as p } from "@tanstack/react-query";
|
|
10
|
+
import { Node as m, NodeViewWrapper as h, ReactNodeViewRenderer as g, mergeAttributes as _ } from "@tiptap/react";
|
|
11
|
+
// src/components/Figma.tsx
|
|
12
|
+
var v = /^https:\/\/(?:www\.)?figma\.com\/(?:file|design|proto|board|slides)\/[^/\s?#]+/, y = (e) => v.test(e);
|
|
13
|
+
function b(e) {
|
|
14
|
+
return e.nodeName && e.fileName ? `${e.nodeName} · ${e.fileName}` : e.nodeName || e.fileName || "";
|
|
15
|
+
}
|
|
16
|
+
function x({ url: t }) {
|
|
17
|
+
let i = l("figma"), a = r(), { workspace: c = "" } = s({ strict: !1 }), { data: m, isPending: h } = p({
|
|
18
|
+
...e(c, t),
|
|
19
|
+
enabled: !!c
|
|
20
|
+
}), g = m?.design, _ = n(t);
|
|
21
|
+
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f("a", {
|
|
22
|
+
href: _,
|
|
23
|
+
target: "_blank",
|
|
24
|
+
rel: "noreferrer noopener",
|
|
25
|
+
className: "link-card-link",
|
|
26
|
+
"data-card-ui": !0,
|
|
27
|
+
children: [g?.access && g.thumbnail && /* @__PURE__ */ d("img", {
|
|
28
|
+
src: g.thumbnail,
|
|
29
|
+
alt: "",
|
|
30
|
+
className: "h-20 w-32 shrink-0 rounded-sm bg-muted object-contain"
|
|
31
|
+
}), /* @__PURE__ */ f("span", {
|
|
32
|
+
className: "min-w-0 flex-1",
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ d("span", {
|
|
35
|
+
className: "link-card-title",
|
|
36
|
+
children: g?.access ? b(g) : i(h ? "reading" : "file")
|
|
37
|
+
}),
|
|
38
|
+
/* @__PURE__ */ d("span", {
|
|
39
|
+
className: "link-card-description",
|
|
40
|
+
children: g?.access ? g.lastModified && (g.editedBy ? i("editedBy", {
|
|
41
|
+
when: a.relative(g.lastModified),
|
|
42
|
+
who: g.editedBy
|
|
43
|
+
}) : i("edited", { when: a.relative(g.lastModified) })) : m?.enabled && !m.connected ? i("connectToPreview") : m?.connected && g && !g.access ? i("noAccess") : t
|
|
44
|
+
}),
|
|
45
|
+
/* @__PURE__ */ d("span", {
|
|
46
|
+
className: "link-card-site",
|
|
47
|
+
children: /* @__PURE__ */ d("span", {
|
|
48
|
+
className: "truncate",
|
|
49
|
+
children: i("site")
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
})]
|
|
54
|
+
}), m?.enabled && !m.connected && m.linkUrl && /* @__PURE__ */ d("a", {
|
|
55
|
+
"data-card-ui": !0,
|
|
56
|
+
href: m.linkUrl,
|
|
57
|
+
className: `${o({
|
|
58
|
+
variant: "outline",
|
|
59
|
+
size: "sm"
|
|
60
|
+
})} mt-1.5`,
|
|
61
|
+
children: i("connect")
|
|
62
|
+
})] });
|
|
63
|
+
}
|
|
64
|
+
function S(e) {
|
|
65
|
+
return `https://www.figma.com/embed?embed_host=tandem&url=${encodeURIComponent(e)}`;
|
|
66
|
+
}
|
|
67
|
+
var C = /^:::figma[ \t]+(https:\/\/\S+)[ \t]*\n[ \t]*:::[ \t]*(?:\n|$)/, w = m.create({
|
|
68
|
+
name: "figmaEmbed",
|
|
69
|
+
group: "block",
|
|
70
|
+
atom: !0,
|
|
71
|
+
draggable: !0,
|
|
72
|
+
addAttributes: () => ({ url: { default: "" } }),
|
|
73
|
+
parseHTML: () => [{ tag: "div[data-figma-embed]" }],
|
|
74
|
+
renderHTML: ({ node: e, HTMLAttributes: t }) => [
|
|
75
|
+
"div",
|
|
76
|
+
_(t, { "data-figma-embed": "" }),
|
|
77
|
+
[
|
|
78
|
+
"a",
|
|
79
|
+
{ href: e.attrs.url },
|
|
80
|
+
e.attrs.url
|
|
81
|
+
]
|
|
82
|
+
],
|
|
83
|
+
addNodeView: () => g(T, { stopEvent: ({ event: e }) => e.target instanceof Element && !!e.target.closest("[data-embed-ui]") }),
|
|
84
|
+
markdownTokenName: "figmaEmbed",
|
|
85
|
+
markdownTokenizer: {
|
|
86
|
+
name: "figmaEmbed",
|
|
87
|
+
level: "block",
|
|
88
|
+
start: (e) => e.search(/^:::figma/m),
|
|
89
|
+
tokenize: (e) => {
|
|
90
|
+
let t = C.exec(e);
|
|
91
|
+
return t ? {
|
|
92
|
+
type: "figmaEmbed",
|
|
93
|
+
raw: t[0],
|
|
94
|
+
text: t[1] ?? ""
|
|
95
|
+
} : void 0;
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
parseMarkdown: (e, t) => t.createNode("figmaEmbed", { url: e.text ?? "" }),
|
|
99
|
+
renderMarkdown: (e) => `:::figma ${String(e.attrs?.url ?? "")}\n:::`
|
|
100
|
+
});
|
|
101
|
+
function T({ node: e, editor: t, updateAttributes: n }) {
|
|
102
|
+
let r = l("figma"), [i, s] = c(""), u = String(e.attrs.url ?? "");
|
|
103
|
+
return !u || !y(u) ? /* @__PURE__ */ d(h, {
|
|
104
|
+
className: "link-card link-card-empty",
|
|
105
|
+
contentEditable: !1,
|
|
106
|
+
children: /* @__PURE__ */ f("form", {
|
|
107
|
+
"data-embed-ui": !0,
|
|
108
|
+
className: "flex flex-wrap items-center gap-2",
|
|
109
|
+
onSubmit: (e) => {
|
|
110
|
+
e.preventDefault(), y(i.trim()) && n({ url: i.trim() });
|
|
111
|
+
},
|
|
112
|
+
children: [/* @__PURE__ */ d(a, {
|
|
113
|
+
value: i,
|
|
114
|
+
onChange: (e) => s(e.target.value),
|
|
115
|
+
placeholder: "https://www.figma.com/design/…",
|
|
116
|
+
"aria-label": r("embedAddress"),
|
|
117
|
+
className: "min-w-0 flex-1",
|
|
118
|
+
disabled: !t.isEditable
|
|
119
|
+
}), /* @__PURE__ */ d("button", {
|
|
120
|
+
type: "submit",
|
|
121
|
+
className: o({
|
|
122
|
+
variant: "primary",
|
|
123
|
+
size: "sm"
|
|
124
|
+
}),
|
|
125
|
+
disabled: !y(i.trim()),
|
|
126
|
+
children: r("embed")
|
|
127
|
+
})]
|
|
128
|
+
})
|
|
129
|
+
}) : /* @__PURE__ */ d(h, {
|
|
130
|
+
className: "not-prose my-2",
|
|
131
|
+
contentEditable: !1,
|
|
132
|
+
"data-drag-handle": !0,
|
|
133
|
+
children: /* @__PURE__ */ d("div", {
|
|
134
|
+
"data-embed-ui": !0,
|
|
135
|
+
className: "overflow-hidden rounded-md border border-border",
|
|
136
|
+
children: /* @__PURE__ */ d("iframe", {
|
|
137
|
+
title: r("embedTitle"),
|
|
138
|
+
src: S(u),
|
|
139
|
+
className: "block aspect-video w-full",
|
|
140
|
+
allowFullScreen: !0,
|
|
141
|
+
loading: "lazy"
|
|
142
|
+
})
|
|
143
|
+
})
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
function E({ workspace: e, identifier: a }) {
|
|
147
|
+
let o = l("figma"), s = r(), { data: c } = p(t(e, a));
|
|
148
|
+
return !c?.enabled || c.designs.length === 0 ? null : /* @__PURE__ */ f("section", {
|
|
149
|
+
className: "mt-6",
|
|
150
|
+
"aria-label": o("issueSection"),
|
|
151
|
+
children: [
|
|
152
|
+
/* @__PURE__ */ f("h2", {
|
|
153
|
+
className: "text-xs font-medium text-muted-foreground",
|
|
154
|
+
children: [o("issueSection"), /* @__PURE__ */ d("span", {
|
|
155
|
+
className: "ml-1.5",
|
|
156
|
+
children: c.designs.length
|
|
157
|
+
})]
|
|
158
|
+
}),
|
|
159
|
+
!c.connected && /* @__PURE__ */ f("p", {
|
|
160
|
+
className: "mt-1 text-xs text-muted-foreground",
|
|
161
|
+
children: [
|
|
162
|
+
o("connectToPreview"),
|
|
163
|
+
" ",
|
|
164
|
+
c.linkUrl && /* @__PURE__ */ d("a", {
|
|
165
|
+
href: c.linkUrl,
|
|
166
|
+
className: "text-primary hover:underline",
|
|
167
|
+
children: o("connect")
|
|
168
|
+
})
|
|
169
|
+
]
|
|
170
|
+
}),
|
|
171
|
+
/* @__PURE__ */ d(i, {
|
|
172
|
+
size: "fill",
|
|
173
|
+
padding: "none",
|
|
174
|
+
divided: !0,
|
|
175
|
+
interactive: !1,
|
|
176
|
+
render: /* @__PURE__ */ d("ul", {}),
|
|
177
|
+
className: "mt-1",
|
|
178
|
+
children: c.designs.map((e) => /* @__PURE__ */ d("li", {
|
|
179
|
+
className: "hover:bg-muted",
|
|
180
|
+
children: /* @__PURE__ */ f("a", {
|
|
181
|
+
href: n(e.url),
|
|
182
|
+
target: "_blank",
|
|
183
|
+
rel: "noopener noreferrer",
|
|
184
|
+
className: "flex min-w-0 items-center gap-3 px-3 py-2 text-sm",
|
|
185
|
+
children: [
|
|
186
|
+
e.access && e.thumbnail ? /* @__PURE__ */ d("img", {
|
|
187
|
+
src: e.thumbnail,
|
|
188
|
+
alt: "",
|
|
189
|
+
className: "h-10 w-16 shrink-0 rounded-sm bg-muted object-contain"
|
|
190
|
+
}) : /* @__PURE__ */ d("span", { className: "h-10 w-16 shrink-0 rounded-sm bg-muted" }),
|
|
191
|
+
/* @__PURE__ */ f("span", {
|
|
192
|
+
className: "min-w-0 flex-1",
|
|
193
|
+
children: [/* @__PURE__ */ d("span", {
|
|
194
|
+
className: "block truncate",
|
|
195
|
+
children: e.access ? b(e) : c.connected ? o("noAccess") : o("file")
|
|
196
|
+
}), e.access && e.lastModified && /* @__PURE__ */ d("span", {
|
|
197
|
+
className: "block truncate text-xs text-muted-foreground",
|
|
198
|
+
children: e.editedBy ? o("editedBy", {
|
|
199
|
+
when: s.relative(e.lastModified),
|
|
200
|
+
who: e.editedBy
|
|
201
|
+
}) : o("edited", { when: s.relative(e.lastModified) })
|
|
202
|
+
})]
|
|
203
|
+
}),
|
|
204
|
+
e.changed && /* @__PURE__ */ d("span", {
|
|
205
|
+
className: "shrink-0 rounded-sm bg-warning/15 px-1.5 py-0.5 text-xs text-warning",
|
|
206
|
+
children: o("changed")
|
|
207
|
+
})
|
|
208
|
+
]
|
|
209
|
+
})
|
|
210
|
+
}, e.url))
|
|
211
|
+
})
|
|
212
|
+
]
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
export { x as FigmaCard, w as FigmaEmbedBlock, E as IssueDesigns, y as isFigma };
|