Skip to content

Commit 2c0c782

Browse files
committed
Revert "feat(hub-ui): add seamless iframe presentation"
This reverts commit 28deb2f.
1 parent 39ba2fd commit 2c0c782

15 files changed

Lines changed: 10 additions & 113 deletions

File tree

‎docs/content/1.guide/16.hub.md‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -214,21 +214,6 @@ ctx.docks.register({
214214

215215
Group and members stay independent top-level entries in `devframe:docks`; `defaultChildId` opens on activation. Grouping affects the dock bar, not iframes — to share **one** soft-navigated iframe, give docks a shared `frameId` and mark the anchor with `subTabs` ([Shared-iframe soft navigation](/guide/client-context#shared-iframe-soft-navigation)).
216216

217-
An iframe that should visually share its host's surface can opt into seamless presentation:
218-
219-
```ts
220-
ctx.docks.register({
221-
type: 'iframe',
222-
id: 'embedded-dashboard',
223-
title: 'Dashboard',
224-
icon: 'ph:gauge-duotone',
225-
url: 'http://localhost:4000/',
226-
presentation: 'seamless',
227-
})
228-
```
229-
230-
The reference Hub UI removes its address bar, opaque loading surface, border, background, shadow, and corner radius for that entry. Other viewers may provide an equivalent treatment or retain their default presentation. The embedded document must also use a transparent background if the host surface should remain visible.
231-
232217
### The dual role of `category`
233218

234219
`category` (ordered by `DEFAULT_CATEGORIES_ORDER`, default `'default'`) sets an **ungrouped** entry's outer dock-bar bucket. A **grouped** entry takes its outer bucket from the **group's** `category`, and its own `category` becomes an **in-group sub-category**; a member whose `groupId` never resolves renders top-level under its own `category`.

‎docs/content/1.guide/18.hub-initiate.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ interface DevframeHubUi {
5959

6060
`@devframes/hub-ui`'s `createUi()` is the reference (viewer + floating dock); its `setup(ctx)` publishes config to `ctx.staticConfig.ui` (`ConnectionMeta.configs.ui`):
6161

62-
- **`viewer`** — set to `false` to disable the standalone viewer, or `{ background: 'transparent' }` when its document should visually inherit an embedding page's surface.
6362
- **`branding`** — rebrand the UI (logo, name, primary color).
6463
- **`dockPreferences`** — dock-bar: `categoryOrder`, floating-dock `maxVisibleItems`, first-run `defaultMode` (`'float'`/`'edge'`) and `defaultPosition`.
6564
- **`embeddedVisibility`** — the floating dock's reveal policy:

‎packages/hub-ui/src/client/components/dock/DockEdge.vue‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ const isVertical = computed(() => store.position === 'left' || store.position ==
3434
3535
const groupedEntries = computed(() => context.docks.groupedEntries)
3636
const selectedEntry = computed(() => context.docks.selected)
37-
const isSeamlessIframe = computed(() => selectedEntry.value?.type === 'iframe' && selectedEntry.value.presentation === 'seamless')
3837
const activeGroup = computed(() => getEntryGroup(context.docks.entries, selectedEntry.value))
3938
const hasPanelContent = computed(() => {
4039
const entry = selectedEntry.value
@@ -408,12 +407,8 @@ const dragPreviewStyle = computed<CSSProperties | undefined>(() => {
408407
<template>
409408
<div
410409
id="devframes-edge-panel"
411-
class="color-base overflow-clip z-floating-anchor font-sans text-[15px] box-border"
412-
:class="[
413-
panelLayoutClass,
414-
isSeamlessIframe ? 'bg-transparent border-0 shadow-none' : 'bg-dock-glass border border-base shadow',
415-
{ 'devframes-edge-collapsed': isCollapsed },
416-
]"
410+
class="bg-dock-glass border border-base color-base shadow overflow-clip z-floating-anchor font-sans text-[15px] box-border"
411+
:class="[panelLayoutClass, { 'devframes-edge-collapsed': isCollapsed }]"
417412
:style="panelStyle"
418413
@mousemove="bringUp"
419414
>

‎packages/hub-ui/src/client/components/dock/DockPanel.vue‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ const layout = computed(() => props.layout ?? DEFAULT_DOCK_LAYOUT)
2929
3030
// When the open entry belongs to a group, surface its siblings in a sidebar.
3131
const activeGroup = computed(() => getEntryGroup(context.docks.entries, selected.value))
32-
const isSeamlessIframe = computed(() => selected.value?.type === 'iframe' && selected.value.presentation === 'seamless')
3332
3433
const windowSize = reactive(useWindowSize())
3534
const isHovering = ref(false)
@@ -176,8 +175,7 @@ onMounted(() => {
176175
<div
177176
v-show="context.docks.selected && context.docks.selected.type !== 'action'"
178177
ref="dockPanel"
179-
class="color-base overflow-hidden"
180-
:class="isSeamlessIframe ? 'bg-transparent border-0 rounded-0 shadow-none' : 'bg-dock-glass rounded-lg border border-base shadow'"
178+
class="bg-dock-glass rounded-lg border border-base color-base shadow overflow-hidden"
181179
:style="panelStyle"
182180
@contextmenu="openContextMenu"
183181
>

‎packages/hub-ui/src/client/components/views/ViewIframe.vue‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ const props = defineProps<{
2020
2121
const settings = sharedStateToRef(props.context.docks.settings)
2222
const isEdgeMode = computed(() => props.context.panel.store.mode === 'edge')
23-
const isSeamless = computed(() => props.entry.presentation === 'seamless')
24-
const showAddressBar = computed(() => !isSeamless.value && (settings.value.showIframeAddressBar ?? true))
23+
const showAddressBar = computed(() => settings.value.showIframeAddressBar ?? true)
2524
2625
const ADDRESS_BAR_HEIGHT = 40
2726
@@ -263,11 +262,6 @@ onMounted(() => {
263262
// cosmetic borders differ between edge/float and address-bar states.
264263
watchEffect(() => {
265264
Object.assign(iframe.style, props.iframeStyle)
266-
if (isSeamless.value) {
267-
iframe.style.border = 'none'
268-
iframe.style.borderRadius = '0px'
269-
return
270-
}
271265
if (showAddressBar.value && !isEdgeMode.value) {
272266
iframe.style.borderTopLeftRadius = '0px'
273267
iframe.style.borderTopRightRadius = '0px'
@@ -387,7 +381,7 @@ onUnmounted(() => {
387381
ref="viewFrame"
388382
class="devframes-view-iframe relative w-full h-full flex-1 items-center justify-center"
389383
>
390-
<ViewIframeLoading v-if="showLoadingPlaceholder" :transparent="isSeamless" />
384+
<ViewIframeLoading v-if="showLoadingPlaceholder" />
391385
<ViewAssetsError
392386
v-if="assetsError"
393387
:error="assetsError"

‎packages/hub-ui/src/client/components/views/ViewIframeLoading.stories.ts‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,3 @@ export const Loading: Story = {
2929
setup: () => () => stage(h(ViewIframeLoading)),
3030
}),
3131
}
32-
33-
export const Transparent: Story = {
34-
render: () => ({
35-
setup: () => () => stage(h(ViewIframeLoading, { transparent: true })),
36-
}),
37-
}

‎packages/hub-ui/src/client/components/views/ViewIframeLoading.vue‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
<script setup lang="ts">
2-
defineProps<{
3-
transparent?: boolean
4-
}>()
5-
62
// Placeholder shown while an iframe view loads its content. A blank iframe
73
// paints white during load, so this is only visible once the pane steps aside
84
// (`pane.hide()` in `ViewIframe`) — the same layering trick `ViewAssetsError`
95
// relies on. It covers the initial load and any hard navigation/refresh.
106
</script>
117

128
<template>
13-
<div
14-
class="devframes-view-iframe-loading absolute inset-0 flex flex-col items-center justify-center gap-2"
15-
:class="transparent ? 'bg-transparent' : 'bg-base'"
16-
>
9+
<div class="devframes-view-iframe-loading absolute inset-0 flex flex-col items-center justify-center gap-2 bg-base">
1710
<div class="i-ph:circle-notch-duotone animate-spin text-3xl color-faint" />
1811
<div class="text-sm color-muted">
1912
Loading…

‎packages/hub-ui/src/client/standalone/index.html‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>Devframes</title>
77
<meta name="description" content="Devframes hub" />
8-
<link rel="stylesheet" href="./__hub-ui.css" />
98
<style>
109
html,
1110
body {

‎packages/hub-ui/src/index.test.ts‎

Lines changed: 0 additions & 29 deletions
This file was deleted.

‎packages/hub-ui/src/index.ts‎

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,8 @@ function clientDir(): string {
3333
}
3434

3535
export interface CreateUiOptions {
36-
/**
37-
* Serve the standalone viewer SPA at the hub base. Pass an object to
38-
* customize the viewer surface. Default: `true`.
39-
*/
40-
viewer?: boolean | {
41-
/** Page background used around transparent renderer content. Default: `'default'`. */
42-
background?: 'default' | 'transparent'
43-
}
36+
/** Serve the standalone viewer SPA at the hub base. Default: `true`. */
37+
viewer?: boolean
4438
/** Serve the floating-dock bootstrap at `<base>embedded.js`. Default: `true`. */
4539
embedded?: boolean
4640
/**
@@ -93,23 +87,13 @@ export interface CreateUiOptions {
9387
*/
9488
export function createUi(options: CreateUiOptions = {}): DevframeHubUi {
9589
const client = clientDir()
96-
const viewerBackground = typeof options.viewer === 'object' ? options.viewer.background : undefined
9790
return {
9891
...(options.viewer !== false
9992
? { viewer: { distDir: join(client, 'standalone') } }
10093
: {}),
10194
...(options.embedded !== false
10295
? { embedded: { entry: join(client, 'embedded.js') } }
10396
: {}),
104-
...(options.viewer !== false
105-
? {
106-
assets: {
107-
'__hub-ui.css': () => viewerBackground === 'transparent'
108-
? 'html,body{background:transparent!important}'
109-
: '',
110-
},
111-
}
112-
: {}),
11397
// Publish the reference UI's config through the generic `ctx.staticConfig`
11498
// — it rides the connection handshake to every mounted frame and the
11599
// standalone viewer as `ConnectionMeta.configs.ui`.

0 commit comments

Comments
 (0)