@marimo-team/frontend 0.17.3 → 0.17.4
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/assets/{CellStatus-C3bK7-wN.js → CellStatus-c0SAQ-F-.js} +1 -1
- package/dist/assets/{ConsoleOutput-DWvKgTax.js → ConsoleOutput-CDSftFlX.js} +1 -1
- package/dist/assets/{MarimoErrorOutput-BgZFHyAp.js → MarimoErrorOutput-BMyX5A6l.js} +1 -1
- package/dist/assets/{Output-C8n2C1Pu.js → Output-pZgeySyq.js} +1 -1
- package/dist/assets/RenderHTML-BUSbsjNK.js +1 -0
- package/dist/assets/{add-cell-with-ai-Bwg9bH8i.js → add-cell-with-ai-D5ovEhXx.js} +1 -1
- package/dist/assets/{add-database-form-dbmUeWp4.js → add-database-form-p8983nDn.js} +1 -1
- package/dist/assets/{add-missing-import-qki9bte9.js → add-missing-import-BwGZ98W0.js} +1 -1
- package/dist/assets/{agent-panel-Dhy20Enr.js → agent-panel-B5iI79QW.js} +1 -1
- package/dist/assets/{app-config-button-CYwoclvk.js → app-config-button-BFmqvqPu.js} +1 -1
- package/dist/assets/{cell-actions-c22Lh_IO.js → cell-actions-Cc2JYtcT.js} +1 -1
- package/dist/assets/{cell-editor-GZrtvFJW.js → cell-editor-DJ46IITP.js} +1 -1
- package/dist/assets/{cell-link-sTcnY1Ng.js → cell-link-DFNTDaPd.js} +1 -1
- package/dist/assets/{cells-ChcCEAp9.js → cells-DNq9ng4B.js} +3 -5
- package/dist/assets/{chat-components-2Txp_uWE.js → chat-components-BJMCzZRK.js} +1 -1
- package/dist/assets/{chat-panel-B-aSH1sh.js → chat-panel-DajnoQHz.js} +1 -1
- package/dist/assets/{client-DphVxIGq.js → client-B0dO9skM.js} +1 -1
- package/dist/assets/{column-preview-CXzpLY8T.js → column-preview-BiiXdwvw.js} +1 -1
- package/dist/assets/{command-palette-DisdRO5p.js → command-palette-DbfvqoOB.js} +1 -1
- package/dist/assets/{common-D0IIv-_3.js → common-U0RDob8X.js} +1 -1
- package/dist/assets/{datasources-panel-6PT8Bek6.js → datasources-panel-Bo6UM72J.js} +1 -1
- package/dist/assets/{dependency-graph-panel-6gaUZ9_z.js → dependency-graph-panel-DcOypoYV.js} +1 -1
- package/dist/assets/{documentation-panel-CuORNaIe.js → documentation-panel-BPa77v-x.js} +1 -1
- package/dist/assets/{edit-page-CF6ZT6DW.js → edit-page-CYfYSIzk.js} +3 -3
- package/dist/assets/{error-panel-DsYYzWCa.js → error-panel-C4Dh4_Gz.js} +1 -1
- package/dist/assets/{file-explorer-panel-CPZ1gNhJ.js → file-explorer-panel-BTjjB1ys.js} +1 -1
- package/dist/assets/{floating-outline-BjOLeg9Q.js → floating-outline-DwAgRZTh.js} +1 -1
- package/dist/assets/{focus-BrbV9nqw.js → focus-BwMl5m5_.js} +1 -1
- package/dist/assets/{form-BogImzlM.js → form-CQCzdh1o.js} +1 -1
- package/dist/assets/{form-wmMKGeHm.js → form-D69llIWP.js} +1 -1
- package/dist/assets/{home-page-XcjCdiYR.js → home-page-F1w05vyJ.js} +1 -1
- package/dist/assets/{index-B6c28rYm.css → index-BmcO-QYJ.css} +1 -1
- package/dist/assets/{index-BXJ0L2ZN.js → index-q8eVuDDk.js} +3 -3
- package/dist/assets/{kiosk-mode-DW0KYuDo.js → kiosk-mode-Dd1ooBaF.js} +1 -1
- package/dist/assets/{layout-CNCmZJQH.js → layout-C8ytLSQd.js} +1 -1
- package/dist/assets/{logs-panel-KRi5a3Yd.js → logs-panel-C8ChYhO8.js} +1 -1
- package/dist/assets/{mode-47luhzpx.js → mode-BWw7rz82.js} +1 -1
- package/dist/assets/{name-cell-input-iv2D5yrk.js → name-cell-input-F8bM4E5e.js} +1 -1
- package/dist/assets/{outline-panel-CwQOW3hr.js → outline-panel-QjRV3Zps.js} +1 -1
- package/dist/assets/{packages-panel-bIuFo_yZ.js → packages-panel-_yihtFbB.js} +1 -1
- package/dist/assets/{readonly-python-code-DOMir81o.js → readonly-python-code-gmO6162d.js} +1 -1
- package/dist/assets/{run-page-DcyDyVAW.js → run-page-BsulC5PQ.js} +1 -1
- package/dist/assets/{scratchpad-panel-6URLLQyW.js → scratchpad-panel-A9G8o9jf.js} +1 -1
- package/dist/assets/{snippets-panel-DQjHx5dH.js → snippets-panel-C6FwSaZz.js} +1 -1
- package/dist/assets/{state-OU5IKSGK.js → state-C7T5AXo0.js} +1 -1
- package/dist/assets/{state-Ds5BCDZt.js → state-CIEHjRfF.js} +1 -1
- package/dist/assets/{storage-CCZ0kBEN.js → storage-CmIwledL.js} +1 -1
- package/dist/assets/{tracing-DlcXZDiG.js → tracing-Cq1z4XC3.js} +1 -1
- package/dist/assets/{tracing-panel-BNZEX5NU.js → tracing-panel-Mt1B8lhs.js} +2 -2
- package/dist/assets/{types-XAhA2qP3.js → types-UoG2cq5J.js} +1 -1
- package/dist/assets/{useAddCell-CG6KWlO3.js → useAddCell-xX3fIjF2.js} +1 -1
- package/dist/assets/{useCellActionButton-DFWFWfvs.js → useCellActionButton-jH-t2BrR.js} +1 -1
- package/dist/assets/{useDeleteCell-BPNrZc-g.js → useDeleteCell-CJ4WX9R2.js} +1 -1
- package/dist/assets/{useNotebookActions-DhHVJ3q5.js → useNotebookActions-Cf9b-Ef9.js} +1 -1
- package/dist/assets/{useRunCells-BmIxLPpn.js → useRunCells-DjmsNJ7r.js} +1 -1
- package/dist/assets/{useSplitCell-CDjHCs8K.js → useSplitCell-ueztloAj.js} +1 -1
- package/dist/assets/{utilities.esm-B_umFSka.js → utilities.esm-D8HYU14D.js} +1 -1
- package/dist/assets/{variable-panel-E1eImuWQ.js → variable-panel-DAhAueP9.js} +1 -1
- package/dist/index.html +24 -24
- package/package.json +1 -1
- package/src/css/md.css +6 -0
- package/src/plugins/core/__test__/sanitize.test.ts +27 -0
- package/src/plugins/core/sanitize.ts +1 -1
- package/dist/assets/RenderHTML-DockW4fh.js +0 -1
|
@@ -75,7 +75,7 @@ export function sanitizeHtml(html: string) {
|
|
|
75
75
|
// glue elements like style, script or others to document.body and prevent unintuitive browser behavior in several edge-cases
|
|
76
76
|
FORCE_BODY: true,
|
|
77
77
|
CUSTOM_ELEMENT_HANDLING: {
|
|
78
|
-
tagNameCheck: /^marimo-[A-Za-z][\w-]
|
|
78
|
+
tagNameCheck: /^(marimo-[A-Za-z][\w-]*|iconify-icon)$/,
|
|
79
79
|
attributeNameCheck: /^[A-Za-z][\w-]*$/,
|
|
80
80
|
},
|
|
81
81
|
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as p}from"./chunk-DZLz74EQ.js";import{c as S,d as j}from"./jotai-BTnrNcC1.js";import{t as _}from"./react-BcIddLXZ.js";import{br as u,yr as w}from"./cells-ChcCEAp9.js";import{t as y}from"./compiler-runtime-Cr9loedd.js";import{t as N}from"./jsx-runtime-mwDPpfh_.js";import{t as R}from"./mode-47luhzpx.js";import{t as z}from"./usePress-C2JVmCUi.js";import{t as k}from"./copy-icon-Ckew1l1_.js";import{t as A}from"./purify.es-CmG1k0Cr.js";import{t as C}from"./useRunCells-BmIxLPpn.js";var H=p(y(),1),m=p(_(),1),s=p(N(),1);const M=e=>{let t=(0,H.c)(16),r,a,i;t[0]===e?(r=t[1],a=t[2],i=t[3]):({href:a,children:r,...i}=e,t[0]=e,t[1]=r,t[2]=a,t[3]=i);let o=(0,m.useRef)(null),l;t[4]===a?l=t[5]:(l=()=>{let h=new URL(globalThis.location.href);h.hash=a,globalThis.history.pushState({},"",h.toString());let x=a.slice(1),v=document.getElementById(x);v&&v.scrollIntoView({behavior:"smooth",block:"start"})},t[4]=a,t[5]=l);let n=l,c;t[6]===n?c=t[7]:(c={onPress:()=>{n()}},t[6]=n,t[7]=c);let{pressProps:g}=z(c),f;t[8]===n?f=t[9]:(f=h=>{h.preventDefault(),n()},t[8]=n,t[9]=f);let E=f,d;return t[10]!==r||t[11]!==E||t[12]!==a||t[13]!==g||t[14]!==i?(d=(0,s.jsx)("a",{ref:o,href:a,...g,onClick:E,...i,children:r}),t[10]=r,t[11]=E,t[12]=a,t[13]=g,t[14]=i,t[15]=d):d=t[15],d};var T=j(e=>{if(e(C))return!1;let t=!0;try{t=R()==="read"}catch{return!0}return!t});function F(){return S(T)}var b="data-temp-href-target";A.addHook("beforeSanitizeAttributes",e=>{e.tagName==="A"&&(e.hasAttribute("target")||e.setAttribute("target","_self"),e.hasAttribute("target")&&e.setAttribute(b,e.getAttribute("target")||""))}),A.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&e.hasAttribute(b)&&(e.setAttribute("target",e.getAttribute(b)||""),e.removeAttribute(b),e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener"))});function L(e){return A.sanitize(e,{USE_PROFILES:{html:!0,svg:!0,mathMl:!0},FORCE_BODY:!0,CUSTOM_ELEMENT_HANDLING:{tagNameCheck:/^marimo-[A-Za-z][\w-]*$/,attributeNameCheck:/^[A-Za-z][\w-]*$/}})}var O=p(y(),1),I=e=>{if(e instanceof u.Element&&!/^[A-Za-z][\w-]*$/.test(e.name))return m.createElement(m.Fragment)},D=(e,t)=>{if(t instanceof u.Element&&t.name==="body"){if((0,m.isValidElement)(e)&&"props"in e){let r=e.props.children;return(0,s.jsx)(s.Fragment,{children:r})}return}},V=(e,t)=>{if(t instanceof u.Element&&t.name==="html"){if((0,m.isValidElement)(e)&&"props"in e){let r=e.props.children;return(0,s.jsx)(s.Fragment,{children:r})}return}},W=e=>{if(e instanceof u.Element&&e.attribs&&e.name==="iframe"){let t=document.createElement("iframe");return Object.entries(e.attribs).forEach(([r,a])=>{r.startsWith('"')&&r.endsWith('"')&&(r=r.slice(1,-1)),t.setAttribute(r,a)}),(0,s.jsx)("div",{dangerouslySetInnerHTML:{__html:t.outerHTML}})}},$=e=>{if(e instanceof u.Element&&e.name==="script"){let t=e.attribs.src;if(!t)return;if(!document.querySelector(`script[src="${t}"]`)){let r=document.createElement("script");r.src=t,document.head.append(r)}return(0,s.jsx)(s.Fragment,{})}},P=(e,t)=>{if(t instanceof u.Element&&t.name==="a"){let r=t.attribs.href;if(r!=null&&r.startsWith("#")&&!r.startsWith("#code/")){let a=null;return(0,m.isValidElement)(e)&&"props"in e&&(a=e.props.children),(0,s.jsx)(M,{href:r,...t.attribs,children:a})}}},U=(e,t,r)=>{var a,i;if(t instanceof u.Element&&t.name==="div"&&((i=(a=t.attribs)==null?void 0:a.class)!=null&&i.includes("codehilite")))return(0,s.jsx)(Z,{children:e},r)},Z=e=>{let t=(0,O.c)(3),{children:r}=e,a=(0,m.useRef)(null),i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,s.jsx)(k,{tooltip:!1,className:"p-1",value:()=>{var n;let l=(n=a.current)==null?void 0:n.firstChild;return l&&l.textContent||""}})}),t[0]=i):i=t[0];let o;return t[1]===r?o=t[2]:(o=(0,s.jsxs)("div",{className:"relative group codehilite-wrapper",ref:a,children:[r,i]}),t[1]=r,t[2]=o),o};const B=({html:e,additionalReplacements:t=[],alwaysSanitizeHtml:r=!0})=>(0,s.jsx)(q,{html:e,alwaysSanitizeHtml:r,additionalReplacements:t});var q=({html:e,additionalReplacements:t=[],alwaysSanitizeHtml:r})=>{let a=F();return G({html:(0,m.useMemo)(()=>r||a?L(e):e,[e,r,a]),additionalReplacements:t})};function G({html:e,additionalReplacements:t=[]}){let r=[I,W,$,...t],a=[U,P,D,V];return w(e,{replace:(i,o)=>{for(let l of r){let n=l(i,o);if(n)return n}return i},transform:(i,o,l)=>{for(let n of a){let c=n(i,o,l);if(c)return c}return i}})}export{B as t};
|