@apolitical/component-library 4.1.10-ac.0 → 4.1.10-ac.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.
package/index.mjs CHANGED
@@ -23371,20 +23371,38 @@ const cw = ({
23371
23371
  return s ? `<a href="/profiles/${s.id}" class="mentioned-user">@${s.data.name}</a>` : a;
23372
23372
  })), r;
23373
23373
  };
23374
- const mw = 3e3, pw = ({ url: e }) => {
23375
- const t = de(), [n, r] = he(!1);
23374
+ const mw = 3e3, pw = ({ pathname: e }) => {
23375
+ const t = de(), [n, r] = he({
23376
+ isOpen: !1,
23377
+ isCopied: !1
23378
+ });
23376
23379
  return /* @__PURE__ */ d.jsx(d.Fragment, { children: /* @__PURE__ */ d.jsxs("li", { children: [
23377
- /* @__PURE__ */ d.jsx(tr, { isOpen: n, styling: { hasPointer: "bottom", extraPadding: !1 }, children: t.formatMessage({ id: "discussion_share_copy_link_success" }) }),
23380
+ /* @__PURE__ */ d.jsx(
23381
+ tr,
23382
+ {
23383
+ className: Z("tooltip-share-link", {
23384
+ "tooltip-share-link-copied": n.isCopied
23385
+ }),
23386
+ isOpen: n.isOpen,
23387
+ styling: { hasPointer: "bottom", extraPadding: !1 },
23388
+ children: n.isCopied ? t.formatMessage({ id: "discussion_share_copy_link_success" }) : t.formatMessage({ id: "discussion_share_copy_link" })
23389
+ }
23390
+ ),
23378
23391
  /* @__PURE__ */ d.jsx(
23379
23392
  Ia,
23380
23393
  {
23381
23394
  icon: { icon: "share_copy-link" },
23395
+ onMouseOver: () => r({ ...n, isOpen: !0 }),
23396
+ onFocus: () => r({ ...n, isOpen: !0 }),
23397
+ onMouseOut: () => r({ isOpen: !1, isCopied: !1 }),
23398
+ onBlur: () => r({ isOpen: !1, isCopied: !1 }),
23382
23399
  onClick: () => {
23383
- navigator.clipboard.writeText(e).then(() => {
23384
- r(!0), setTimeout(() => r(!1), mw);
23400
+ navigator.clipboard.writeText(`${window.location.origin}${e}`).then(() => {
23401
+ r({ isOpen: !0, isCopied: !0 }), setTimeout(() => {
23402
+ r({ isOpen: !1, isCopied: !1 });
23403
+ }, mw);
23385
23404
  });
23386
- },
23387
- children: t.formatMessage({ id: "discussion_share_copy_link" })
23405
+ }
23388
23406
  }
23389
23407
  )
23390
23408
  ] }) });
@@ -23675,7 +23693,7 @@ const mw = 3e3, pw = ({ url: e }) => {
23675
23693
  children: v.formatMessage({ id: `${Vt}reply` })
23676
23694
  }
23677
23695
  ) }),
23678
- ((h == null ? void 0 : h.post) || (h == null ? void 0 : h.comments)) && /* @__PURE__ */ d.jsx(d.Fragment, { children: /* @__PURE__ */ d.jsx(pw, { url: h.post || h.comments || "" }) }),
23696
+ ((h == null ? void 0 : h.post) || (h == null ? void 0 : h.comments)) && /* @__PURE__ */ d.jsx(d.Fragment, { children: /* @__PURE__ */ d.jsx(pw, { pathname: h.post || h.comments || "" }) }),
23679
23697
  /* @__PURE__ */ d.jsx(
23680
23698
  UC,
23681
23699
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apolitical/component-library",
3
- "version": "4.1.10-ac.0",
3
+ "version": "4.1.10-ac.2",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {