@happeouikit/content-renderer 3.2.19 → 3.2.20

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/dist/index.es.js CHANGED
@@ -5163,66 +5163,79 @@ const ni = ai(), ii = new RegExp(rt, "gi"), ui = new RegExp(
5163
5163
  const N = () => {
5164
5164
  if (!T.current || !t)
5165
5165
  return;
5166
- const a = T.current.querySelectorAll("h1, h2, h3, h4, h5, h6") || [];
5167
- a.length > 0 && a.forEach((d) => {
5168
- const { textContent: o = "" } = d;
5169
- (o || "").length > 0 && (d.id = d.id || kt(
5170
- (o || "").toLowerCase().replace(/\s/g, "-")
5166
+ const d = T.current.querySelectorAll("h1, h2, h3, h4, h5, h6") || [];
5167
+ d.length > 0 && d.forEach((o) => {
5168
+ const { textContent: f = "" } = o;
5169
+ (f || "").length > 0 && (o.id = o.id || kt(
5170
+ (f || "").toLowerCase().replace(/\s/g, "-")
5171
5171
  ));
5172
- }), q((d) => [...d, ...a]);
5172
+ }), q((o) => [...o, ...d]);
5173
5173
  }, z = () => {
5174
5174
  if (!T.current || !g)
5175
5175
  return;
5176
- const a = T.current.querySelectorAll("a") || [];
5177
- if (a.length > 0) {
5178
- const d = window.origin;
5179
- a.forEach((o) => {
5180
- const { href: f } = o;
5181
- f.startsWith(d) ? delete o.target : o.target = "_blank";
5176
+ const d = T.current.querySelectorAll("a") || [];
5177
+ if (d.length > 0) {
5178
+ const o = window.origin;
5179
+ d.forEach((f) => {
5180
+ const { href: c } = f;
5181
+ c.startsWith(o) ? delete f.target : f.target = "_blank";
5182
5182
  });
5183
5183
  }
5184
5184
  }, H = () => {
5185
- T.current && (T.current.querySelectorAll("a") || []).forEach((a) => {
5186
- const { href: d } = a;
5187
- d.startsWith("mailto:") && (a.target = "_blank");
5185
+ T.current && (T.current.querySelectorAll("a") || []).forEach((d) => {
5186
+ const { href: o } = d;
5187
+ o.startsWith("mailto:") && (d.target = "_blank");
5188
5188
  });
5189
5189
  }, O = () => {
5190
5190
  if (!T.current)
5191
5191
  return;
5192
- const a = T.current.querySelectorAll(
5192
+ const d = T.current.querySelectorAll(
5193
5193
  yt
5194
5194
  );
5195
- a.length > 0 && (_r.isDefined("highlightjs") || (fi(), _r([...Yn, ...Xn], "highlightjs")), _r.ready("highlightjs", () => {
5195
+ d.length > 0 && (_r.isDefined("highlightjs") || (fi(), _r([...Yn, ...Xn], "highlightjs")), _r.ready("highlightjs", () => {
5196
5196
  window.hljs.configure({
5197
5197
  languages: Jn,
5198
5198
  useBr: !0
5199
- }), a.forEach((d) => {
5200
- const o = d.innerText, f = document.createElement(Zn), c = Qt(o);
5201
- f.textContent = c, d.innerHTML = "", d.appendChild(f), window.hljs.highlightBlock(d);
5202
- }), q((d) => [...d, ...a]);
5199
+ }), d.forEach((o) => {
5200
+ const f = o.innerText, c = document.createElement(Zn), h = Qt(f);
5201
+ c.textContent = h, o.innerHTML = "", o.appendChild(c), window.hljs.highlightBlock(o);
5202
+ }), q((o) => [...o, ...d]);
5203
5203
  }));
5204
5204
  }, r = () => {
5205
- D.length !== 0 && D.forEach(({ domainToReplace: a, domainToReplaceWith: d }) => {
5205
+ D.length !== 0 && D.forEach(({ domainToReplace: d, domainToReplaceWith: o }) => {
5206
5206
  if (!T.current)
5207
5207
  return;
5208
- const o = T.current.querySelectorAll("a") || [];
5209
- o.length > 0 && o.forEach((f) => {
5208
+ const f = T.current.querySelectorAll("a") || [];
5209
+ f.length > 0 && f.forEach((c) => {
5210
5210
  try {
5211
- const { href: c } = f, h = new URL(c), { hostname: A } = h;
5212
- if (A !== a || h.pathname === "/")
5211
+ const { href: h } = c, A = new URL(h), { hostname: _ } = A;
5212
+ if (_ !== d || A.pathname === "/")
5213
5213
  return;
5214
- if (d === "") {
5215
- const _ = `${h.pathname}${h.search}${h.hash}`;
5216
- f.href = _;
5214
+ if (o === "") {
5215
+ const y = `${A.pathname}${A.search}${A.hash}`;
5216
+ c.href = y;
5217
5217
  } else
5218
- f.href = c.replace(a, d);
5218
+ c.href = h.replace(d, o);
5219
5219
  } catch {
5220
5220
  }
5221
5221
  });
5222
5222
  });
5223
+ }, n = () => {
5224
+ if (!T.current)
5225
+ return;
5226
+ T.current.querySelectorAll("iframe").forEach((o) => {
5227
+ var f, c;
5228
+ if (!((c = (f = o.allow) == null ? void 0 : f.includes) != null && c.call(f, "autoplay"))) {
5229
+ if (!o.allow) {
5230
+ o.allow = "autoplay";
5231
+ return;
5232
+ }
5233
+ o.allow = o.allow + " autoplay";
5234
+ }
5235
+ });
5223
5236
  };
5224
5237
  s && L(), requestAnimationFrame(() => {
5225
- N(), z(), H(), O(), r();
5238
+ N(), z(), H(), O(), r(), n();
5226
5239
  }), E.current = !0;
5227
5240
  }, [
5228
5241
  T,