Skip to content

Commit 010a4ec

Browse files
committed
Support explicitly specify iframe
1 parent 43ae099 commit 010a4ec

24 files changed

+63
-42
lines changed

smoosense-gui/src/components/gallery/GalleryItemVisual.tsx

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,23 @@ export default function GalleryItemVisual({
7070
)
7171
})()}
7272

73-
{renderType === RenderType.IFrame && (
74-
<iframe
75-
src={proxyedUrl(String(visualValue))}
76-
className="w-full h-full border-0"
77-
title={`Row ${index + 1}`}
78-
style={{ backgroundColor: 'transparent' }}
79-
/>
80-
)}
73+
{renderType === RenderType.IFrame && (() => {
74+
let iframeUrl = String(visualValue)
75+
76+
// Strip iframe+ prefix if present
77+
if (iframeUrl.startsWith('iframe+http://') || iframeUrl.startsWith('iframe+https://')) {
78+
iframeUrl = iframeUrl.replace(/^iframe\+/, '')
79+
}
80+
81+
return (
82+
<iframe
83+
src={proxyedUrl(iframeUrl)}
84+
className="w-full h-full border-0"
85+
title={`Row ${index + 1}`}
86+
style={{ backgroundColor: 'transparent' }}
87+
/>
88+
)
89+
})()}
8190
</div>
8291
)
8392
}

smoosense-gui/src/lib/utils/agGridCellRenderers.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,20 @@ export enum RenderType {
3838
function isUrl(str: string): boolean {
3939
return str.startsWith('http://') ||
4040
str.startsWith('https://') ||
41+
str.startsWith('iframe+http://') ||
42+
str.startsWith('iframe+https://') ||
4143
str.startsWith('s3://') ||
4244
str.startsWith('ftp://') ||
4345
str.startsWith('file://') ||
4446
str.startsWith('./')
4547
}
4648

4749
function inferUrlType(str: string): RenderType {
50+
// Check for iframe+ prefix first
51+
if (str.startsWith('iframe+http://') || str.startsWith('iframe+https://')) {
52+
return RenderType.IFrame
53+
}
54+
4855
// Extract filename from URL for file type detection
4956
const urlParts = str.split('/')
5057
const filename = urlParts[urlParts.length - 1].split('?')[0] // Remove query parameters

smoosense-gui/src/lib/utils/cellRenderers/IFrameCellRenderer.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ interface IFrameCellRendererProps {
1111
const IFrameCellRenderer = memo(function IFrameCellRenderer({
1212
value
1313
}: IFrameCellRendererProps) {
14-
const iframeUrl = String(value).trim()
14+
let iframeUrl = String(value).trim()
15+
16+
// Strip iframe+ prefix if present
17+
if (iframeUrl.startsWith('iframe+http://') || iframeUrl.startsWith('iframe+https://')) {
18+
iframeUrl = iframeUrl.replace(/^iframe\+/, '')
19+
}
1520

1621
// Handle empty or invalid values
1722
if (isNil(value) || value === '' || !iframeUrl) {

smoosense-py/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "smoosense"
3-
version = "0.1.3"
3+
version = "0.1.4"
44
description = "Smoothly make sense of your large multi-modal datasets"
55
readme = "README.md"
66
requires-python = ">=3.9"

smoosense-py/smoosense/statics/404.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

smoosense-py/smoosense/statics/DB.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

smoosense-py/smoosense/statics/DB.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
5:I[29906,[],""]
66
6:I[84526,["265","static/chunks/6dc81886-0d3828b166e5e246.js","933","static/chunks/933-3fa934a1373c1443.js","769","static/chunks/769-38a429028a9a1959.js","496","static/chunks/496-167b672ad715b8e4.js","785","static/chunks/785-6f7a59e8bb062840.js","177","static/chunks/app/layout-d6f40cc585abf459.js"],"ToasterProvider"]
77
7:I[1377,[],"ClientPageRoot"]
8-
8:I[30185,["265","static/chunks/6dc81886-0d3828b166e5e246.js","652","static/chunks/4ec49466-f80a37a142905954.js","346","static/chunks/191d07e0-76e9a3be7a7ac399.js","933","static/chunks/933-3fa934a1373c1443.js","916","static/chunks/916-01ab46af81553d20.js","53","static/chunks/53-c1ea9e1118520cc0.js","990","static/chunks/990-4de2b100275dbb74.js","496","static/chunks/496-167b672ad715b8e4.js","213","static/chunks/213-929cdf2f2ab1ba92.js","73","static/chunks/app/DB/page-7beaf102c4ad1850.js"],"default"]
8+
8:I[30185,["265","static/chunks/6dc81886-0d3828b166e5e246.js","652","static/chunks/4ec49466-f80a37a142905954.js","346","static/chunks/191d07e0-76e9a3be7a7ac399.js","933","static/chunks/933-3fa934a1373c1443.js","916","static/chunks/916-01ab46af81553d20.js","53","static/chunks/53-c1ea9e1118520cc0.js","990","static/chunks/990-4de2b100275dbb74.js","496","static/chunks/496-167b672ad715b8e4.js","213","static/chunks/213-586e17b20bb4930b.js","73","static/chunks/app/DB/page-7beaf102c4ad1850.js"],"default"]
99
b:I[94484,[],"OutletBoundary"]
1010
d:I[78892,[],"AsyncMetadataOutlet"]
1111
f:I[94484,[],"ViewportBoundary"]
@@ -15,7 +15,7 @@ f:I[94484,[],"ViewportBoundary"]
1515
:HL["https://cdn.smoosense.ai/_next/static/media/4cf2300e9c8272f7-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
1616
:HL["https://cdn.smoosense.ai/_next/static/media/93f479601ee12b01-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}]
1717
:HL["https://cdn.smoosense.ai/_next/static/css/68cf0af8ec852d88.css","style"]
18-
0:{"P":null,"b":"Fyc6V-UPaOggPqa4IrJW7","p":"https://cdn.smoosense.ai","c":["","DB"],"i":false,"f":[[["",{"children":["DB",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"https://cdn.smoosense.ai/_next/static/css/68cf0af8ec852d88.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{}],["$","body",null,{"className":"__variable_0d22f4 __variable_a7838a antialiased","children":["$","$L2",null,{"attribute":"class","defaultTheme":"dark","enableSystem":true,"disableTransitionOnChange":true,"children":[["$","$L3",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}],["$","$L6",null,{}]]}]}]]}]]}],{"children":["DB",["$","$1","c",{"children":[null,["$","$L4",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","searchParams":{},"params":{},"promises":["$@9","$@a"]}],null,["$","$Lb",null,{"children":["$Lc",["$","$Ld",null,{"promise":"$@e"}]]}]]}],{},null,false]},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$Lf",null,{"children":"$L10"}],["$","meta",null,{"name":"next-size-adjust","content":""}]],["$","$L11",null,{"children":["$","div",null,{"hidden":true,"children":["$","$12",null,{"fallback":null,"children":"$L13"}]}]}]]}],false]],"m":"$undefined","G":["$14",[]],"s":false,"S":true}
18+
0:{"P":null,"b":"Jkn1QtaJLBq2E2G4g6IbQ","p":"https://cdn.smoosense.ai","c":["","DB"],"i":false,"f":[[["",{"children":["DB",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"https://cdn.smoosense.ai/_next/static/css/68cf0af8ec852d88.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","suppressHydrationWarning":true,"children":[["$","head",null,{}],["$","body",null,{"className":"__variable_0d22f4 __variable_a7838a antialiased","children":["$","$L2",null,{"attribute":"class","defaultTheme":"dark","enableSystem":true,"disableTransitionOnChange":true,"children":[["$","$L3",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}],["$","$L6",null,{}]]}]}]]}]]}],{"children":["DB",["$","$1","c",{"children":[null,["$","$L4",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$L7",null,{"Component":"$8","searchParams":{},"params":{},"promises":["$@9","$@a"]}],null,["$","$Lb",null,{"children":["$Lc",["$","$Ld",null,{"promise":"$@e"}]]}]]}],{},null,false]},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$Lf",null,{"children":"$L10"}],["$","meta",null,{"name":"next-size-adjust","content":""}]],["$","$L11",null,{"children":["$","div",null,{"hidden":true,"children":["$","$12",null,{"fallback":null,"children":"$L13"}]}]}]]}],false]],"m":"$undefined","G":["$14",[]],"s":false,"S":true}
1919
9:{}
2020
a:"$0:f:0:1:2:children:2:children:1:props:children:0:props:params"
2121
10:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]

0 commit comments

Comments
 (0)