@parallelworks/tandem-web 0.189.6 → 0.189.8
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/components/Attachments.js +11 -11
- package/components/editorPlugins.js +3 -3
- package/package.json +21 -21
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { attachmentsQuery as e, meQuery as t, workspaceQuery as n } from "../api/queries.js";
|
|
2
|
-
import { attachmentSizes as r,
|
|
2
|
+
import { attachmentSizes as r, insertAttachments as i, mediaURL as a, uploadAttachment as o } from "../lib/attachments.js";
|
|
3
3
|
import { openImageEvent as s } from "./editorPlugins.js";
|
|
4
4
|
import { AttachmentIcon as c, CloseIcon as l, DownloadIcon as u } from "./icons.js";
|
|
5
5
|
import { ErrorText as d, IconButton as f, Modal as p, ModalTitle as m, buttonClasses as h } from "@parallelworks/ui";
|
|
@@ -23,10 +23,10 @@ function A(t, n) {
|
|
|
23
23
|
return j((e) => o(t, n, e), () => r.invalidateQueries({ queryKey: e(t, n).queryKey }));
|
|
24
24
|
}
|
|
25
25
|
function j(e, t) {
|
|
26
|
-
let n = S("issue.attachments"), r = b(), [
|
|
26
|
+
let n = S("issue.attachments"), r = b(), [a, o] = y(0), [s, c] = y(null), l = k();
|
|
27
27
|
return {
|
|
28
|
-
upload: async (
|
|
29
|
-
if (!
|
|
28
|
+
upload: async (a, s, u) => {
|
|
29
|
+
if (!a || s.length === 0) return;
|
|
30
30
|
if (!l) {
|
|
31
31
|
c(n("off", { name: s[0]?.name ?? "" }));
|
|
32
32
|
return;
|
|
@@ -44,9 +44,9 @@ function j(e, t) {
|
|
|
44
44
|
} finally {
|
|
45
45
|
o((e) => e - 1);
|
|
46
46
|
}
|
|
47
|
-
d.length > 0 && !
|
|
47
|
+
d.length > 0 && !a.isDestroyed && i(a, d, u), t?.();
|
|
48
48
|
},
|
|
49
|
-
pending:
|
|
49
|
+
pending: a,
|
|
50
50
|
error: s
|
|
51
51
|
};
|
|
52
52
|
}
|
|
@@ -93,14 +93,14 @@ function P() {
|
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
95
|
function F({ workspace: t, identifier: n }) {
|
|
96
|
-
let
|
|
96
|
+
let i = S("issue.attachments"), o = S("common"), c = P(), { data: d } = D(e(t, n)), [g, v] = y(null);
|
|
97
97
|
_(() => {
|
|
98
98
|
r.set(new Map((d ?? []).map((e) => [e.id, c(e.size)])), new Set((d ?? []).filter((e) => e.video).map((e) => e.id)));
|
|
99
99
|
}, [d]), _(() => () => r.set(/* @__PURE__ */ new Map()), []), _(() => {
|
|
100
100
|
let e = (e) => v(e.detail);
|
|
101
101
|
return document.addEventListener(s, e), () => document.removeEventListener(s, e);
|
|
102
102
|
}, []);
|
|
103
|
-
let b = g ?
|
|
103
|
+
let b = g ? a(g.src) : "";
|
|
104
104
|
return /* @__PURE__ */ E(p, {
|
|
105
105
|
open: g !== null,
|
|
106
106
|
onClose: () => v(null),
|
|
@@ -111,13 +111,13 @@ function F({ workspace: t, identifier: n }) {
|
|
|
111
111
|
children: [
|
|
112
112
|
/* @__PURE__ */ T(m, {
|
|
113
113
|
className: "min-w-0 flex-1 truncate text-sm font-medium",
|
|
114
|
-
children: g?.name ||
|
|
114
|
+
children: g?.name || i("image")
|
|
115
115
|
}),
|
|
116
116
|
/* @__PURE__ */ E("a", {
|
|
117
117
|
href: b,
|
|
118
118
|
download: g?.name ?? "",
|
|
119
119
|
className: h({ size: "sm" }),
|
|
120
|
-
children: [/* @__PURE__ */ T(u, { className: "size-3.5" }),
|
|
120
|
+
children: [/* @__PURE__ */ T(u, { className: "size-3.5" }), i("download")]
|
|
121
121
|
}),
|
|
122
122
|
/* @__PURE__ */ T(f, {
|
|
123
123
|
icon: /* @__PURE__ */ T(l, {}),
|
|
@@ -131,7 +131,7 @@ function F({ workspace: t, identifier: n }) {
|
|
|
131
131
|
className: "flex min-h-0 flex-1 items-center justify-center overflow-auto bg-muted p-4",
|
|
132
132
|
children: g && /* @__PURE__ */ T("img", {
|
|
133
133
|
src: b,
|
|
134
|
-
alt: g.name ||
|
|
134
|
+
alt: g.name || i("image"),
|
|
135
135
|
className: "max-h-[calc(90vh-5rem)] max-w-full object-contain"
|
|
136
136
|
})
|
|
137
137
|
})]
|
|
@@ -221,11 +221,11 @@ var H = S.create({
|
|
|
221
221
|
},
|
|
222
222
|
props: {
|
|
223
223
|
decorations: (e) => z.getState(e),
|
|
224
|
-
handleClickOn: (t, n, r, i
|
|
224
|
+
handleClickOn: (e, t, n, r, i) => n.type.name !== "image" || i.button !== 0 ? !1 : (i.preventDefault(), e.dom.dispatchEvent(new CustomEvent(P, {
|
|
225
225
|
bubbles: !0,
|
|
226
226
|
detail: {
|
|
227
|
-
src:
|
|
228
|
-
name:
|
|
227
|
+
src: n.attrs.src,
|
|
228
|
+
name: n.attrs.alt ?? ""
|
|
229
229
|
}
|
|
230
230
|
})), !0),
|
|
231
231
|
handleClick: (t, n, i) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parallelworks/tandem-web",
|
|
3
|
-
"version": "0.189.
|
|
3
|
+
"version": "0.189.8",
|
|
4
4
|
"description": "Tandem's pages, for a host app to render in its own",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -18,26 +18,26 @@
|
|
|
18
18
|
"@dagrejs/dagre": "3.1.3",
|
|
19
19
|
"@fontsource-variable/public-sans": "^5.3.0",
|
|
20
20
|
"@parallelworks/api-docs": "^0.4.0",
|
|
21
|
-
"@parallelworks/i18n": "^0.3.
|
|
22
|
-
"@parallelworks/problem": "^0.6.
|
|
21
|
+
"@parallelworks/i18n": "^0.3.1",
|
|
22
|
+
"@parallelworks/problem": "^0.6.2",
|
|
23
23
|
"@tanstack/react-query": "^5.107.1",
|
|
24
24
|
"@tanstack/react-virtual": "3.14.26",
|
|
25
|
-
"@tiptap/extension-blockquote": "3.
|
|
26
|
-
"@tiptap/extension-code-block-lowlight": "3.
|
|
27
|
-
"@tiptap/extension-collaboration": "^3.
|
|
28
|
-
"@tiptap/extension-collaboration-caret": "^3.
|
|
29
|
-
"@tiptap/extension-details": "3.
|
|
30
|
-
"@tiptap/extension-drag-handle": "3.
|
|
31
|
-
"@tiptap/extension-drag-handle-react": "3.
|
|
32
|
-
"@tiptap/extension-image": "^3.
|
|
33
|
-
"@tiptap/extension-list": "^3.
|
|
34
|
-
"@tiptap/extension-node-range": "3.
|
|
35
|
-
"@tiptap/extension-table": "3.
|
|
36
|
-
"@tiptap/extensions": "^3.
|
|
37
|
-
"@tiptap/markdown": "^3.
|
|
38
|
-
"@tiptap/pm": "^3.
|
|
39
|
-
"@tiptap/react": "^3.
|
|
40
|
-
"@tiptap/starter-kit": "^3.
|
|
25
|
+
"@tiptap/extension-blockquote": "3.34.0",
|
|
26
|
+
"@tiptap/extension-code-block-lowlight": "3.34.0",
|
|
27
|
+
"@tiptap/extension-collaboration": "^3.34.0",
|
|
28
|
+
"@tiptap/extension-collaboration-caret": "^3.34.0",
|
|
29
|
+
"@tiptap/extension-details": "3.34.0",
|
|
30
|
+
"@tiptap/extension-drag-handle": "3.34.0",
|
|
31
|
+
"@tiptap/extension-drag-handle-react": "3.34.0",
|
|
32
|
+
"@tiptap/extension-image": "^3.34.0",
|
|
33
|
+
"@tiptap/extension-list": "^3.34.0",
|
|
34
|
+
"@tiptap/extension-node-range": "3.34.0",
|
|
35
|
+
"@tiptap/extension-table": "3.34.0",
|
|
36
|
+
"@tiptap/extensions": "^3.34.0",
|
|
37
|
+
"@tiptap/markdown": "^3.34.0",
|
|
38
|
+
"@tiptap/pm": "^3.34.0",
|
|
39
|
+
"@tiptap/react": "^3.34.0",
|
|
40
|
+
"@tiptap/starter-kit": "^3.34.0",
|
|
41
41
|
"@xyflow/react": "12.12.1",
|
|
42
42
|
"highlight.js": "11.12.0",
|
|
43
43
|
"katex": "^0.19.1",
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"yjs": "^13.6.33"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@parallelworks/ui": ">=0.
|
|
52
|
+
"@parallelworks/ui": ">=0.131.0 <1",
|
|
53
53
|
"@tanstack/react-router": "^1.170.0",
|
|
54
54
|
"react": "^19.3.0",
|
|
55
55
|
"react-dom": "^19.3.0",
|
|
56
|
-
"use-intl": "^4.
|
|
56
|
+
"use-intl": "^4.15.0"
|
|
57
57
|
}
|
|
58
58
|
}
|