@bycrux/editor 0.7.2 → 0.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bycrux/editor",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,4 +1,5 @@
1
1
  import { useEffect, useRef, useState, type ReactNode } from 'react'
2
+ import { createPortal } from 'react-dom'
2
3
  import type { EditorAdapter, Project } from '../types'
3
4
 
4
5
  interface CarouselRenderModalProps {
@@ -108,8 +109,10 @@ export default function CarouselRenderModal({ projectId, adapter, slidesCount, r
108
109
 
109
110
  // ── Done state — gallery + zip download ─────────────────────────────────
110
111
  if (status === 'done' && outputDir) {
111
- return (
112
- <div className="fixed inset-0 z-50 flex items-center justify-center bg-black/90 backdrop-blur-md">
112
+ // Portal to document.body (see RenderModal): a transformed host ancestor
113
+ // would otherwise trap this `fixed` overlay and center the panel off-screen.
114
+ return createPortal(
115
+ <div className="fixed inset-0 z-50 flex items-center justify-center bg-black">
113
116
  <div className="w-[96vw] h-[96vh] bg-[var(--editor-bg)] border border-[var(--editor-border)] rounded-2xl shadow-2xl flex overflow-hidden">
114
117
 
115
118
  {/* Left — slide gallery */}
@@ -135,7 +138,7 @@ export default function CarouselRenderModal({ projectId, adapter, slidesCount, r
135
138
  className="block w-full h-auto"
136
139
  style={{ aspectRatio: `${resolution[0]} / ${resolution[1]}` }}
137
140
  />
138
- <div className="absolute bottom-0 left-0 right-0 px-2 py-1.5 bg-black/70 backdrop-blur-sm text-[11px] text-[var(--editor-text)] font-mono flex justify-between">
141
+ <div className="absolute bottom-0 left-0 right-0 px-2 py-1.5 bg-black text-[11px] text-[var(--editor-text)] font-mono flex justify-between">
139
142
  <span>#{String(i + 1).padStart(2, '0')}</span>
140
143
  <span className="text-[var(--editor-text)]/60">{file}</span>
141
144
  </div>
@@ -172,13 +175,14 @@ export default function CarouselRenderModal({ projectId, adapter, slidesCount, r
172
175
  </div>
173
176
  </div>
174
177
  </div>
175
- </div>
178
+ </div>,
179
+ document.body,
176
180
  )
177
181
  }
178
182
 
179
183
  // ── Running / error state — log readout ─────────────────────────────────
180
- return (
181
- <div className="fixed inset-0 z-50 flex items-center justify-center bg-black/70 backdrop-blur-sm">
184
+ return createPortal(
185
+ <div className="fixed inset-0 z-50 flex items-center justify-center bg-black">
182
186
  <div className="w-full max-w-3xl bg-[var(--editor-surface)] border border-[var(--editor-border)] rounded-xl shadow-2xl flex flex-col overflow-hidden">
183
187
 
184
188
  <div className="flex items-center justify-between px-5 py-4 border-b border-[var(--editor-border)]">
@@ -238,6 +242,7 @@ export default function CarouselRenderModal({ projectId, adapter, slidesCount, r
238
242
  )}
239
243
  </div>
240
244
  </div>
241
- </div>
245
+ </div>,
246
+ document.body,
242
247
  )
243
248
  }
@@ -1,4 +1,5 @@
1
1
  import { useEffect, useRef, useState } from 'react'
2
+ import { createPortal } from 'react-dom'
2
3
  import type { EditorAdapter, Project } from '../types'
3
4
  import type { Captions } from '../schema'
4
5
 
@@ -105,8 +106,10 @@ export default function CaptionRegenModal<P extends Project = Project>({ project
105
106
  onClose()
106
107
  }
107
108
 
108
- return (
109
- <div className="fixed inset-0 z-50 flex items-center justify-center bg-black/70 backdrop-blur-sm">
109
+ // Portal to document.body so a transformed host ancestor can't trap this
110
+ // `fixed` overlay and push the panel off-screen (see RenderModal).
111
+ return createPortal(
112
+ <div className="fixed inset-0 z-50 flex items-center justify-center bg-black">
110
113
  <div className="w-full max-w-3xl bg-[var(--editor-surface)] border border-[var(--editor-border)] rounded-xl shadow-2xl flex flex-col overflow-hidden">
111
114
 
112
115
  {/* Header */}
@@ -172,6 +175,7 @@ export default function CaptionRegenModal<P extends Project = Project>({ project
172
175
  )}
173
176
  </div>
174
177
  </div>
175
- </div>
178
+ </div>,
179
+ document.body,
176
180
  )
177
181
  }
@@ -1,4 +1,5 @@
1
1
  import { useEffect, useRef, useState, type ReactNode } from 'react'
2
+ import { createPortal } from 'react-dom'
2
3
  import type { EditorAdapter, Project } from '../types'
3
4
 
4
5
  interface RenderModalProps<P extends Project = Project> {
@@ -131,8 +132,12 @@ export default function RenderModal<P extends Project = Project>({ projectId, ad
131
132
  }
132
133
 
133
134
  if (status === 'done' && outputPath) {
134
- return (
135
- <div className="fixed inset-0 z-50 flex items-center justify-center bg-black/90 backdrop-blur-md">
135
+ // Portal to document.body: a transformed/filtered host ancestor (e.g. the
136
+ // Los Parceros app-shell wrapper) would otherwise become the containing
137
+ // block for this `fixed` overlay, sizing it to the scrolled page height and
138
+ // centering the panel off-screen below the fold.
139
+ return createPortal(
140
+ <div className="fixed inset-0 z-50 flex items-center justify-center bg-black">
136
141
  <div className="w-[96vw] h-[96vh] bg-[var(--editor-surface)] border border-[var(--editor-border)] rounded-2xl shadow-2xl flex overflow-hidden">
137
142
 
138
143
  {/* Left — video */}
@@ -179,12 +184,13 @@ export default function RenderModal<P extends Project = Project>({ projectId, ad
179
184
  </div>
180
185
  </div>
181
186
  </div>
182
- </div>
187
+ </div>,
188
+ document.body,
183
189
  )
184
190
  }
185
191
 
186
- return (
187
- <div className="fixed inset-0 z-50 flex items-center justify-center bg-black/70 backdrop-blur-sm">
192
+ return createPortal(
193
+ <div className="fixed inset-0 z-50 flex items-center justify-center bg-black">
188
194
  <div className="w-full max-w-3xl bg-[var(--editor-surface)] border border-[var(--editor-border)] rounded-xl shadow-2xl flex flex-col overflow-hidden">
189
195
 
190
196
  {/* Header */}
@@ -247,6 +253,7 @@ export default function RenderModal<P extends Project = Project>({ projectId, ad
247
253
  )}
248
254
  </div>
249
255
  </div>
250
- </div>
256
+ </div>,
257
+ document.body,
251
258
  )
252
259
  }