@mujian/js-sdk 0.0.6-beta.14 → 0.0.6-beta.16

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/react.css CHANGED
@@ -42,7 +42,7 @@
42
42
  --SmartThemeBodyColor: #abc6df;
43
43
  --SmartThemeEmColor: #fff;
44
44
  --SmartThemeUnderlineColor: #bce7cf;
45
- --SmartThemeQuoteColor: #6f85fd;
45
+ --SmartThemeQuoteColor: #b983ff;
46
46
  --SmartThemeBlurTintColor: #171717;
47
47
  --SmartThemeChatTintColor: #171717;
48
48
  --SmartThemeUserMesBlurTintColor: #0000004d;
package/dist/react.js CHANGED
@@ -357,7 +357,7 @@ function useHeightObserver() {
357
357
  const MdRendererBase = ({ content })=>{
358
358
  const containerRef = useRef(null);
359
359
  useRef([]);
360
- const iframeIdList = useRef([]);
360
+ const [iframeIdList, setIframeIdList] = useState([]);
361
361
  const { observe, unobserve } = useHeightObserver();
362
362
  useEffect(()=>{
363
363
  let mes = messageFormatting(content);
@@ -365,7 +365,10 @@ const MdRendererBase = ({ content })=>{
365
365
  const code = match.replace("<code>", "").replace("</code>", "");
366
366
  const srcdoc = createSrcContent(unescapeHTML(code));
367
367
  const id = v4();
368
- iframeIdList.current.push(id);
368
+ setIframeIdList([
369
+ ...iframeIdList,
370
+ id
371
+ ]);
369
372
  const escapedSrcdoc = escapeHtmlAttribute(srcdoc);
370
373
  return `
371
374
  <div class="MJ-iframe-container" id="MJ-iframe-container-${id}" style="display:flex;width:100%;height:100%;position:relative;">
@@ -381,8 +384,8 @@ const MdRendererBase = ({ content })=>{
381
384
  content
382
385
  ]);
383
386
  useEffect(()=>{
384
- console.log("iframeIdList", iframeIdList.current);
385
- iframeIdList.current.forEach((id)=>{
387
+ console.log("iframeIdList", iframeIdList);
388
+ iframeIdList.forEach((id)=>{
386
389
  const iframe = document.getElementById("MJ-iframe-" + id);
387
390
  if (!iframe) return;
388
391
  iframe.addEventListener("load", ()=>{
@@ -392,7 +395,7 @@ const MdRendererBase = ({ content })=>{
392
395
  });
393
396
  });
394
397
  return ()=>{
395
- iframeIdList.current.forEach((id)=>{
398
+ iframeIdList.forEach((id)=>{
396
399
  const iframe = document.getElementById("MJ-iframe-" + id);
397
400
  if (!iframe) return;
398
401
  unobserve(iframe);
@@ -404,7 +407,9 @@ const MdRendererBase = ({ content })=>{
404
407
  });
405
408
  };
406
409
  }, [
407
- iframeIdList.current
410
+ iframeIdList,
411
+ observe,
412
+ unobserve
408
413
  ]);
409
414
  return /*#__PURE__*/ jsx("div", {
410
415
  className: "mes_text",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mujian/js-sdk",
3
- "version": "0.0.6-beta.14",
3
+ "version": "0.0.6-beta.16",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {