@parallelworks/tandem-web 0.189.7 → 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.
@@ -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, attachmentURL as i, insertAttachments as a, uploadAttachment as o } from "../lib/attachments.js";
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(), [i, o] = y(0), [s, c] = y(null), l = k();
26
+ let n = S("issue.attachments"), r = b(), [a, o] = y(0), [s, c] = y(null), l = k();
27
27
  return {
28
- upload: async (i, s, u) => {
29
- if (!i || s.length === 0) return;
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 && !i.isDestroyed && a(i, d, u), t?.();
47
+ d.length > 0 && !a.isDestroyed && i(a, d, u), t?.();
48
48
  },
49
- pending: i,
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 a = S("issue.attachments"), o = S("common"), c = P(), { data: d } = D(e(t, n)), [g, v] = y(null);
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 ? i(g.src) : "";
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 || a("image")
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" }), a("download")]
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 || a("image"),
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, a) => r.type.name !== "image" || !e(r.attrs.src) ? !1 : (a.preventDefault(), t.dom.dispatchEvent(new CustomEvent(P, {
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: r.attrs.src,
228
- name: r.attrs.alt ?? ""
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.7",
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",