@fileverse-dev/ddoc 2.1.4-patch-18 → 2.1.4-patch-19

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.
Files changed (2) hide show
  1. package/dist/index.es.js +41 -32
  2. package/package.json +1 -1
package/dist/index.es.js CHANGED
@@ -140184,7 +140184,9 @@ const rF = ({
140184
140184
  (async () => {
140185
140185
  try {
140186
140186
  a(!0);
140187
- const l = await fetch(`${e}?url=${t}`), { metadata: c } = await l.json(), u = {
140187
+ const l = await fetch(
140188
+ `${e}/${encodeURIComponent(t)}`
140189
+ ), { metadata: c } = await l.json(), u = {
140188
140190
  title: c.title,
140189
140191
  description: c.description,
140190
140192
  image: c.image,
@@ -140204,7 +140206,10 @@ const rF = ({
140204
140206
  {
140205
140207
  src: n.image,
140206
140208
  className: "w-[225px] h-[125px] object-contain rounded",
140207
- alt: "Preview"
140209
+ alt: "Preview",
140210
+ onError: (o) => {
140211
+ o.currentTarget.style.display = "none";
140212
+ }
140208
140213
  }
140209
140214
  ),
140210
140215
  /* @__PURE__ */ A.jsxs("div", { className: "flex flex-col gap-2", children: [
@@ -140243,28 +140248,28 @@ const rF = ({
140243
140248
  if (!this.options.metadataProxyUrl)
140244
140249
  return [];
140245
140250
  const t = new Cn("link-preview");
140246
- let e = null, n = null, r = null;
140251
+ let e = null, n = null, r = null, i = null;
140247
140252
  return [
140248
140253
  new dn({
140249
140254
  key: t,
140250
140255
  props: {
140251
140256
  handleDOMEvents: {
140252
- mouseover: (i, a) => {
140253
- const o = a.target.closest("a");
140254
- if (o) {
140255
- const l = o.getAttribute("href");
140256
- if (!l) return !1;
140257
- e || (e = document.createElement("div"), e.className = "hover-link-popup", e.style.position = "absolute", e.style.zIndex = "999", document.body.appendChild(e)), r === o && setTimeout(() => {
140257
+ mouseover: (a, s) => {
140258
+ const l = s.target.closest("a");
140259
+ if (l) {
140260
+ const c = l.getAttribute("href");
140261
+ if (!c) return !1;
140262
+ e || (e = document.createElement("div"), e.className = "hover-link-popup", e.style.position = "absolute", e.style.zIndex = "999", document.body.appendChild(e)), r === l && setTimeout(() => {
140258
140263
  if (e)
140259
140264
  return e.style.display = "block", !1;
140260
- }, 600), r = o;
140261
- const c = o.getBoundingClientRect();
140262
- e.style.left = `${c.left}px`, e.style.top = `${c.bottom + 5}px`, setTimeout(() => {
140265
+ }, 600), r = l;
140266
+ const u = l.getBoundingClientRect();
140267
+ e.style.left = `${u.left}px`, e.style.top = `${u.bottom + 5}px`, setTimeout(() => {
140263
140268
  e && (e.style.display = "block", n || (n = P8(e))), n && n.render(
140264
140269
  /* @__PURE__ */ A.jsx(
140265
140270
  rF,
140266
140271
  {
140267
- link: l,
140272
+ link: c,
140268
140273
  metadataProxyUrl: this.options.metadataProxyUrl
140269
140274
  }
140270
140275
  )
@@ -140273,26 +140278,30 @@ const rF = ({
140273
140278
  }
140274
140279
  return !1;
140275
140280
  },
140276
- mouseout: (i, a) => {
140277
- const s = a.relatedTarget;
140278
- return e && !e.contains(s) && !(s != null && s.closest(".hover-link-popup")) && (e.style.display = "none"), !1;
140281
+ mouseout: (a, s) => {
140282
+ const o = s.relatedTarget;
140283
+ return i && clearTimeout(i), i = setTimeout(() => {
140284
+ e && !e.contains(o) && !(o != null && o.closest(".hover-link-popup")) && (e.style.display = "none");
140285
+ }, 300), !1;
140279
140286
  },
140280
- touchstart: (i, a) => {
140281
- const o = a.target.closest("a");
140282
- if (o) {
140283
- const l = o.getAttribute("href");
140284
- if (!l) return !1;
140285
- e || (e = document.createElement("div"), e.className = "hover-link-popup", e.style.position = "absolute", e.style.zIndex = "999", document.body.appendChild(e)), r = o;
140286
- const c = o.getBoundingClientRect();
140287
- e.style.left = `${c.left}px`, e.style.top = `${c.bottom + 5}px`, e.style.display = "block", n || (n = P8(e)), n.render(
140288
- /* @__PURE__ */ A.jsx(
140289
- rF,
140290
- {
140291
- link: l,
140292
- metadataProxyUrl: this.options.metadataProxyUrl
140293
- }
140294
- )
140295
- );
140287
+ touchstart: (a, s) => {
140288
+ const l = s.target.closest("a");
140289
+ if (l) {
140290
+ const c = l.getAttribute("href");
140291
+ if (!c) return !1;
140292
+ e || (e = document.createElement("div"), e.className = "hover-link-popup", e.style.position = "absolute", e.style.zIndex = "999", document.body.appendChild(e)), r = l;
140293
+ const u = l.getBoundingClientRect();
140294
+ e.style.left = `${u.left}px`, e.style.top = `${u.bottom + 5}px`, setTimeout(() => {
140295
+ e && (e.style.display = "block", n || (n = P8(e)), n.render(
140296
+ /* @__PURE__ */ A.jsx(
140297
+ rF,
140298
+ {
140299
+ link: c,
140300
+ metadataProxyUrl: this.options.metadataProxyUrl
140301
+ }
140302
+ )
140303
+ ));
140304
+ }, 600);
140296
140305
  }
140297
140306
  return !1;
140298
140307
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/ddoc",
3
3
  "private": false,
4
4
  "description": "DDoc",
5
- "version": "2.1.4-patch-18",
5
+ "version": "2.1.4-patch-19",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {