Bento, the office suite that fits in a file
TypeScript mit-licenseofficeoffice-365office-suiteoffice-toolsoffice365open-sourcepowerpointself-hostedsingle-page-appslidesslideshareslideshowslideshow-galleryslideshow-makerslideshows
slides: Ghost Cut, a move you can see before you paste (#679)
Senthanaa3b6addfa0a
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex a9757d4a..166fe4c3 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -2316,6 +2316,12 @@ jobs:# during a write stays dirty, writes never overlap, the dot goes out# only when the deck on screen is the one on disk.run: node scripts/test-slides-save-browser.mjs+ - name: Ghost Cut in Chromium+ # ⇧⌘X fades the selection by CSS (shadowed elements too) and copies it;+ # a ghost is never selected and the pointer passes through it; Esc+ # restores; paste moves it to the pointer in one undo step, across+ # slides, without two elements sharing an id on one slide.+ run: node scripts/test-slides-ghost-cut-browser.mjsspaces-save-browser:runs-on: ubuntu-latestdiff --git a/CHANGELOG.md b/CHANGELOG.mdindex d1549031..7bea667e 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -11,6 +11,11 @@ pre-1.0.## [Unreleased]+- **Ghost Cut: move elements with ⇧⌘X (Ctrl+Shift+X).** The selection fades+ where it stands instead of disappearing; paste moves it to the pointer — on+ this slide or another — keeping it the same element, in one undoable step.+ Escape puts it back. It is also copied, so pasting in another deck works as+ after ⌘C. Plain ⌘X is unchanged. Thanks to senthan-07 (#679).- **An edit made while the deck is saving is no longer marked saved.** Savingtakes a moment, and an edit made in that moment — by you, or by someone in alive session — used to be shown as saved while the file on disk was stilldiff --git a/scripts/test-slides-ghost-cut-browser.mjs b/scripts/test-slides-ghost-cut-browser.mjsnew file mode 100644index 00000000..52285950--- /dev/null+++ b/scripts/test-slides-ghost-cut-browser.mjs@@ -0,0 +1,178 @@+// SPDX-License-Identifier: MIT+// Copyright (c) 2026 The Bento authors+// Ghost Cut (⇧⌘X / Ctrl+Shift+X) in the packaged editor, with real input.+//+// npm run build:single --prefix slides && node scripts/test-slides-ghost-cut-browser.mjs+//+// WHAT THIS PROVES (#679):+// 1. ⇧⌘X fades the selection where it stands (CSS filter: opacity(.35)) —+// including an element with a shadow, whose own inline `filter` would+// otherwise win — and copies it to the system clipboard;+// 2. a ghost cannot be selected: not by clicking it, not by a marquee;+// 3. Esc puts it back exactly as it was, with no edit made;+// 4. paste MOVES it to the pointer: the same element (same id, still one+// copy), in one undo step;+// 5. pasted on another slide it leaves the first, and if that slide already+// has the id (slides share ids for morph) it takes a fresh one rather+// than making two elements with one id on a slide.+const { chromium } = await import(process.env.PLAYWRIGHT_MODULE || 'playwright')++let checks = 0+let failures = 0+function ok(cond, msg) {+ checks+++ if (!cond) { failures++; console.log(` FAIL ${msg}`) } else console.log(` ok ${msg}`)+}+const MOD = process.platform === 'darwin' ? 'Meta' : 'Control'++const browser = await chromium.launch({ executablePath: process.env.CHROME_PATH, headless: true })+try {+ const ctx = await browser.newContext({ viewport: { width: 1440, height: 1000 } })+ await ctx.route(/^https?:/, (r) => r.abort())+ await ctx.addInitScript(() => {+ window.__clips = []+ const clip = navigator.clipboard ?? {}+ Object.defineProperty(navigator, 'clipboard', {+ configurable: true,+ value: Object.assign(Object.create(Object.getPrototypeOf(clip) ?? Object.prototype), clip, {+ writeText: (t) => { window.__clips.push(String(t)); return Promise.resolve() },+ }),+ })+ })+ const p = await ctx.newPage()+ const errors = []+ p.on('pageerror', (e) => errors.push(e.message))+ await p.goto(new URL('../slides/dist-single/Bento_Slides.bento.html', import.meta.url).href)+ await p.waitForFunction(() => window.bento?.doc && document.querySelector('.ed-stage-scale [data-el-id]'))++ // A deck of our own: slide 1 holds a shadowed box and a plain box; slide 2+ // already holds an element with the plain box's id (the morph idiom).+ await p.evaluate(() => {+ const d = JSON.parse(JSON.stringify(window.bento.doc))+ const box = (id, x, extra = {}) => ({ id, type: 'shape', shape: 'rect', x, y: 200, w: 160, h: 120, rotation: 0, opacity: 1, fill: '#5E7699', ...extra })+ d.slides = [+ { id: 's1', background: '#ffffff', elements: [box('plain', 160), box('shadowed', 520, { shadow: { x: 0, y: 6, blur: 12, color: 'rgba(0,0,0,.4)' } })] },+ { id: 's2', background: '#ffffff', elements: [box('plain', 900)] },+ { id: 's3', background: '#ffffff', elements: [] },+ ]+ window.bento.loadDoc(JSON.stringify(d))+ })+ await p.waitForTimeout(400)++ const node = (id) => p.locator(`.ed-stage-scale [data-el-id="${id}"]`)+ const clickEl = async (id, mod = false) => {+ const b = await node(id).boundingBox()+ if (mod) await p.keyboard.down('Shift')+ await p.mouse.click(b.x + b.width / 2, b.y + b.height / 2)+ if (mod) await p.keyboard.up('Shift')+ await p.waitForTimeout(150)+ }+ const state = () => p.evaluate(() => ({+ slides: window.bento.doc.slides.map((s) => s.elements.map((e) => `${e.id}@${e.x},${e.y}`)),+ }))+ const selected = () => p.evaluate(() => window.bento.selection)+ const ghostCut = async () => { await p.keyboard.press(`${MOD}+Shift+x`); await p.waitForTimeout(200) }+ const paste = async () => {+ const before = JSON.stringify((await state()).slides)+ await p.keyboard.press(`${MOD}+v`)+ await p.waitForTimeout(250)+ if (JSON.stringify((await state()).slides) !== before) return 'keyboard'+ await p.evaluate(() => document.dispatchEvent(new ClipboardEvent('paste', { bubbles: true, clipboardData: new DataTransfer() })))+ await p.waitForTimeout(250)+ return 'event'+ }+ const isGhost = (id) => p.evaluate((i) => {+ const n = document.querySelector(`.ed-stage-scale [data-el-id="${i}"]`)+ return { cls: !!n?.classList.contains('bento-el-ghost-cut'), filter: n ? getComputedStyle(n).filter : '' }+ }, id)++ console.log('\n⇧⌘X fades and copies\n')+ await clickEl('plain')+ await clickEl('shadowed', true)+ await p.evaluate(() => { window.__clips.length = 0 })+ const before = await state()+ await ghostCut()+ const gp = await isGhost('plain'), gs = await isGhost('shadowed')+ ok(gp.cls && gs.cls, 'both selected elements are ghosts')+ ok(/opacity\(0\.35\)/.test(gp.filter) && /opacity\(0\.35\)/.test(gs.filter), `faded by CSS — the shadowed one too (${gs.filter})`)+ const clip = await p.evaluate(() => window.__clips.at(-1) ?? '')+ ok(/"__bento":"clip"/.test(clip) && clip.includes('"plain"') && clip.includes('"shadowed"'), 'and copied to the system clipboard as a Bento payload')+ ok(JSON.stringify((await state()).slides) === JSON.stringify(before.slides), 'nothing in the deck changed yet')++ console.log('\na ghost cannot be selected\n')+ ok((await selected()).length === 0, 'cutting clears the selection')+ await clickEl('plain')+ const selIds = await selected()+ ok(!selIds.includes('plain'), `clicking a ghost does not select it (${selIds.join(',') || 'nothing selected'})`)+ // and the pointer goes straight through it: no double-click into its text,+ // no grabbing it — what is under the pointer is whatever lies beneath+ const through = await p.evaluate(() => {+ const n = document.querySelector('.ed-stage-scale [data-el-id="plain"]')+ const r = n.getBoundingClientRect()+ const hit = document.elementFromPoint(r.left + r.width / 2, r.top + r.height / 2)+ return !n.contains(hit)+ })+ ok(through, 'the pointer passes through a ghost')+ const st = await p.locator('.ed-stage-scale').boundingBox()+ await p.mouse.move(st.x + 4, st.y + 4)+ await p.mouse.down()+ await p.mouse.move(st.x + st.width - 4, st.y + st.height - 4, { steps: 8 })+ await p.mouse.up()+ await p.waitForTimeout(200)+ const afterMarquee = await selected()+ ok(!afterMarquee.includes('plain') && !afterMarquee.includes('shadowed'), `a marquee across the whole slide picks up no ghost (${afterMarquee.join(',') || 'nothing'})`)++ console.log('\nEsc puts it back\n')+ await p.keyboard.press('Escape')+ await p.waitForTimeout(200)+ const ge = await isGhost('plain')+ ok(!ge.cls && !/opacity\(0\.35\)/.test(ge.filter), 'the fade is gone')+ ok(JSON.stringify((await state()).slides) === JSON.stringify(before.slides), 'and the deck is exactly as it was')++ console.log('\npaste moves it, in one undo step\n')+ await clickEl('plain')+ await ghostCut()+ const st2 = await p.locator('.ed-stage-scale').boundingBox()+ const scale = await p.evaluate(() => { const s = document.querySelector('.ed-stage-scale'); return s.getBoundingClientRect().width / window.bento.doc.size.width })+ await p.mouse.move(st2.x + 700 * scale, st2.y + 450 * scale)+ const how = await paste()+ const moved = await state()+ const s1 = moved.slides[0]+ ok(s1.filter((x) => x.startsWith('plain@')).length === 1, `still one "plain" on the slide (${s1.join(' ')})`)+ const pos = s1.find((x) => x.startsWith('plain@'))?.split('@')[1].split(',').map(Number)+ ok(pos && Math.abs(pos[0] - 700) <= 2 && Math.abs(pos[1] - 450) <= 2, `moved to the pointer (${pos}) [${how} paste]`)+ ok(!(await isGhost('plain')).cls, 'and is no longer a ghost')+ await p.keyboard.press('Escape')+ await p.keyboard.press(`${MOD}+z`)+ await p.waitForTimeout(250)+ ok(JSON.stringify((await state()).slides) === JSON.stringify(before.slides), 'one ⌘Z puts it back where it was')++ console.log('\npaste on another slide\n')+ await clickEl('plain')+ await ghostCut()+ const thumb = async (i) => { const b = await p.locator(`.ed-sidebar .ed-thumb[data-index="${i}"]`).boundingBox(); await p.mouse.click(b.x + b.width / 2, b.y + b.height / 2); await p.waitForTimeout(250) }+ await thumb(2)+ await p.mouse.move(st2.x + 100 * scale, st2.y + 100 * scale)+ await paste()+ let x = await state()+ ok(!x.slides[0].some((e) => e.startsWith('plain@')) && x.slides[2].some((e) => e.startsWith('plain@')),+ `it leaves slide 1 and lands on slide 3, keeping its id (${x.slides[2].join(' ')})`)+ await p.keyboard.press('Escape')+ await p.keyboard.press(`${MOD}+z`)+ await p.waitForTimeout(250)+ await thumb(0)+ await clickEl('plain')+ await ghostCut()+ await thumb(1)+ await p.mouse.move(st2.x + 100 * scale, st2.y + 100 * scale)+ await paste()+ x = await state()+ const ids2 = x.slides[1].map((e) => e.split('@')[0])+ ok(ids2.length === 2 && new Set(ids2).size === 2 && ids2.includes('plain'),+ `onto a slide that already has its id: two elements, two ids (${ids2.join(', ')})`)++ ok(errors.length === 0, `no page errors${errors.length ? ': ' + errors.join('; ') : ''}`)+} finally { await browser.close() }++console.log(`\n${checks - failures}/${checks} checks passed`)+process.exit(failures ? 1 : 0)diff --git a/slides/src/editor/canvas.ts b/slides/src/editor/canvas.tsindex c0c5db42..61205922 100644--- a/slides/src/editor/canvas.ts+++ b/slides/src/editor/canvas.ts@@ -53,6 +53,10 @@ export class SlideCanvas {* to stand down for it, or every scroll the zoom makes is snapped back. */private pinching = falseprivate zoomLabel: HTMLElement | null = null+ /** Ghost Cut (⇧⌘X): elements waiting for ⌘V to move them — faded by CSS+ * (.bento-el-ghost-cut) and never selectable. Set through setGhost. */+ ghost: { slideId: string; ids: string[] } | null = null+ private lastPointer: { x: number; y: number } | null = nullprivate editing: HTMLElement | null = null/** The listeners of the CURRENT inline edit (text box or table cell), so* they die with it. Without this a node that was edited, committed with@@ -134,6 +138,7 @@ export class SlideCanvas {this.wheelNavCooldown = now + 400this.onSlideNav(dir)}, { passive: false })+ this.scroller.addEventListener('mousemove', (ev) => { this.lastPointer = { x: ev.clientX, y: ev.clientY } })// Middle-button drag pans. Until now the scrollbars were the only way to// move a zoomed slide, which puts the control at the edge of the screen@@ -595,6 +600,22 @@ export class SlideCanvas {zoomOut() { this.setZoom(this.zoom / 1.25) }zoomReset() { this.setZoom(1) }+ /** Where the pointer last was over the slide, or null if it is off it. */+ pointerOnSlide(): { x: number; y: number } | null {+ const p = this.lastPointer && this.slidePointAt(this.lastPointer.x, this.lastPointer.y)+ const { width, height } = this.store.doc.size+ return p && p.x >= 0 && p.y >= 0 && p.x <= width && p.y <= height ? p : null+ }++ setGhost(ghost: { slideId: string; ids: string[] } | null) {+ this.ghost = ghost+ this.render()+ }++ private isGhost(id: string) {+ return this.ghost?.slideId === this.store.slide.id && this.ghost.ids.includes(id)+ }+private buildZoomBar() {const bar = document.createElement('div')bar.className = 'ed-zoombar'@@ -870,6 +891,9 @@ export class SlideCanvas {if (node.dataset.showOnHover !== active) node.style.display = 'none'}}+ for (const node of next.querySelectorAll<HTMLElement>('[data-el-id]')) {+ if (this.isGhost(node.dataset.elId!)) node.classList.add('bento-el-ghost-cut')+ }this.renderSetBar(sets)if (this.surface) this.surface.replaceWith(next)else this.scaleHost.appendChild(next)@@ -1310,7 +1334,7 @@ export class SlideCanvas {this.selecto.on('selectEnd', (e) => {const ids = (e.selected as HTMLElement[]).map((n) => n.dataset.elId)- .filter((id): id is string => !!id)+ .filter((id): id is string => !!id && !this.isGhost(id)) // a marquee never picks up a ghostthis.store.select(this.expandGroups(ids))if (e.isDragStartEnd) {e.inputEvent.preventDefault()diff --git a/slides/src/editor/editor.ts b/slides/src/editor/editor.tsindex 346a1219..7cdbaaaa 100644--- a/slides/src/editor/editor.ts+++ b/slides/src/editor/editor.ts@@ -2427,6 +2427,29 @@ export class Editor {// --- paste: external objects + cross-deck elements/slides ---------------------+ /** ⌘V after ⇧⌘X: move the ghosted elements to the pointer (or leave them+ * where they are), onto the current slide — one undo step, ids kept. */+ private moveGhost() {+ const g = this.canvas.ghost!+ this.canvas.setGhost(null)+ const source = this.store.doc.slides.find((s) => s.id === g.slideId)+ const moving = source?.elements.filter((e) => g.ids.includes(e.id)) ?? [] // only what still exists+ if (!source || !moving.length) return+ const target = this.store.slide+ const at = this.canvas.pointerOnSlide()+ const dx = at ? at.x - Math.min(...moving.map((e) => e.x)) : 0+ const dy = at ? at.y - Math.min(...moving.map((e) => e.y)) : 0+ this.store.commit(() => {+ for (const el of moving) { el.x = Math.round(el.x + dx); el.y = Math.round(el.y + dy) }+ if (source === target) return+ source.elements = source.elements.filter((e) => !moving.includes(e))+ // slides share ids on purpose (morph); two on ONE slide would collide+ for (const el of moving) if (target.elements.some((e) => e.id === el.id)) el.id = uid(el.type[0])+ target.elements.push(...moving)+ })+ this.store.select(moving.map((e) => e.id))+ }+private wirePaste() {// A dropped .bento.html OPENS as a deck (and adopts a writable handle);// anything else falls through to the existing image/media drop behaviour.@@ -2439,6 +2462,7 @@ export class Editor {if (this.presenting) returnconst a = document.activeElement as HTMLElement | nullif (a && (a.tagName === 'INPUT' || a.tagName === 'TEXTAREA' || a.isContentEditable)) return // text edit owns it+ if (this.canvas.ghost) { ev.preventDefault(); this.moveGhost(); return }const dt = ev.clipboardDataif (!dt) return// 1) an image from the OS clipboard (screenshot, copied picture…)@@ -3002,6 +3026,7 @@ export class Editor {[`${mod}S`, t('Save')],[`${mod}Z · ${mod}⇧Z`, t('Undo · redo')],[`${mod}C · ${mod}V`, t('Copy · paste — elements, or the whole slide when nothing is selected')],+ [`${mod}⇧X`, t('Ghost cut — the selection fades until you paste to move it; Esc cancels')],[`${mod}D`, t('Duplicate selection')],[`${mod}G · ${mod}⇧G`, t('Group · ungroup')],[`${mod}B · ${mod}I · ${mod}U`, t('Bold · italic · underline while editing text')],@@ -3206,7 +3231,20 @@ export class Editor {this.duplicateSelection()return}+ // Ghost Cut: the selection fades where it stands and ⌘V MOVES it (same+ // ids, one undo step); Esc cancels. Also copied, so pasting elsewhere+ // works as after ⌘C. Plain ⌘X is unchanged.+ if (mod && ev.shiftKey && ev.key.toLowerCase() === 'x') {+ ev.preventDefault()+ if (!this.store.selection.length || this.store.readOnly) return+ this.copySelection()+ const ids = [...this.store.selection]+ this.store.select([])+ this.canvas.setGhost({ slideId: this.store.slide.id, ids })+ return+ }if (mod && ev.key.toLowerCase() === 'c') {+ this.canvas.ghost = null // a fresh copy is what ⌘V should paste now// Copy to BOTH the in-app clipboard (fast, same session) and the system// clipboard as a Bento payload (works across decks/tabs). Elements when// any are selected; otherwise the current slide.@@ -3266,6 +3304,7 @@ export class Editor {return}if (ev.key === 'Escape') {+ if (this.canvas.ghost) { this.canvas.setGhost(null); return }if (this.thumbSel.length) this.setThumbSel([])if (this.canvas.isDrawing) this.canvas.cancelDraw()else if (this.canvas.isPathEditing) this.canvas.stopPathEdit(true)diff --git a/slides/src/i18n/de.ts b/slides/src/i18n/de.tsindex b669f27f..db4d3e49 100644--- a/slides/src/i18n/de.ts+++ b/slides/src/i18n/de.ts@@ -480,6 +480,7 @@ export const de: Catalog = {"Editing": "Bearbeiten","Undo · redo": "Rückgängig · Wiederholen","Copy · paste — elements, or the whole slide when nothing is selected": "Kopieren · Einfügen — Elemente oder die ganze Folie, wenn nichts ausgewählt ist",+ "Ghost cut — the selection fades until you paste to move it; Esc cancels": "Geisterschnitt – die Auswahl wird blass, bis Einfügen sie verschiebt; Esc bricht ab","Duplicate selection": "Auswahl duplizieren","Group · ungroup": "Gruppieren · Gruppierung aufheben","Comment mode": "Kommentarmodus",diff --git a/slides/src/i18n/es.ts b/slides/src/i18n/es.tsindex 588c22c2..2d9ad628 100644--- a/slides/src/i18n/es.ts+++ b/slides/src/i18n/es.ts@@ -480,6 +480,7 @@ export const es: Catalog = {"Editing": "Edición","Undo · redo": "Deshacer · rehacer","Copy · paste — elements, or the whole slide when nothing is selected": "Copiar · pegar — elementos, o toda la diapositiva cuando no hay nada seleccionado",+ "Ghost cut — the selection fades until you paste to move it; Esc cancels": "Corte fantasma: la selección se atenúa hasta que pegas para moverla; Esc cancela","Duplicate selection": "Duplicar selección","Group · ungroup": "Agrupar · desagrupar","Comment mode": "Modo comentario",diff --git a/slides/src/i18n/fr.ts b/slides/src/i18n/fr.tsindex 1fe5dcd1..d274bd56 100644--- a/slides/src/i18n/fr.ts+++ b/slides/src/i18n/fr.ts@@ -480,6 +480,7 @@ export const fr: Catalog = {"Editing": "Édition","Undo · redo": "Annuler · rétablir","Copy · paste — elements, or the whole slide when nothing is selected": "Copier · coller — des éléments, ou toute la diapositive si rien n’est sélectionné",+ "Ghost cut — the selection fades until you paste to move it; Esc cancels": "Coupe fantôme : la sélection s’estompe jusqu’à ce que vous colliez pour la déplacer ; Échap annule","Duplicate selection": "Dupliquer la sélection","Group · ungroup": "Grouper · dissocier","Comment mode": "Mode commentaire",diff --git a/slides/src/i18n/it.ts b/slides/src/i18n/it.tsindex 928dc597..98ee5f58 100644--- a/slides/src/i18n/it.ts+++ b/slides/src/i18n/it.ts@@ -480,6 +480,7 @@ export const it: Catalog = {"Editing": "Modifica","Undo · redo": "Annulla · ripeti","Copy · paste — elements, or the whole slide when nothing is selected": "Copia · incolla — elementi, o l'intera diapositiva quando non è selezionato nulla",+ "Ghost cut — the selection fades until you paste to move it; Esc cancels": "Taglio fantasma: la selezione si attenua finché non incolli per spostarla; Esc annulla","Duplicate selection": "Duplica selezione","Group · ungroup": "Raggruppa · separa","Comment mode": "Modalità commento",diff --git a/slides/src/i18n/ja.ts b/slides/src/i18n/ja.tsindex c997801c..f507e94f 100644--- a/slides/src/i18n/ja.ts+++ b/slides/src/i18n/ja.ts@@ -480,6 +480,7 @@ export const ja: Catalog = {"Editing": "編集","Undo · redo": "元に戻す・やり直し","Copy · paste — elements, or the whole slide when nothing is selected": "コピー・貼り付け — 要素、または何も選択していないときはスライド全体",+ "Ghost cut — the selection fades until you paste to move it; Esc cancels": "ゴーストカット — 貼り付けで移動するまで選択範囲を半透明に表示。Esc で取り消し","Duplicate selection": "選択を複製","Group · ungroup": "グループ化・解除","Comment mode": "コメントモード",diff --git a/slides/src/i18n/packed.ts b/slides/src/i18n/packed.tsindex 3087ddd7..aaf16df8 100644--- a/slides/src/i18n/packed.ts+++ b/slides/src/i18n/packed.ts@@ -491,6 +491,7 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"Editing": ["編集","编辑","編輯","Edición","Édition","Bearbeiten","Modifica","Edição"],"Undo · redo": ["元に戻す・やり直し","撤销 · 重做","復原 · 重做","Deshacer · rehacer","Annuler · rétablir","Rückgängig · Wiederholen","Annulla · ripeti","Desfazer · refazer"],"Copy · paste — elements, or the whole slide when nothing is selected": ["コピー・貼り付け — 要素、または何も選択していないときはスライド全体","复制 · 粘贴 — 元素,或在未选中任何内容时复制整张幻灯片","複製 · 貼上 — 元素,或在未選取任何內容時複製整張投影片","Copiar · pegar — elementos, o toda la diapositiva cuando no hay nada seleccionado","Copier · coller — des éléments, ou toute la diapositive si rien n’est sélectionné","Kopieren · Einfügen — Elemente oder die ganze Folie, wenn nichts ausgewählt ist","Copia · incolla — elementi, o l'intera diapositiva quando non è selezionato nulla","Copiar · colar — elementos, ou o slide inteiro quando nada estiver selecionado"],+ "Ghost cut — the selection fades until you paste to move it; Esc cancels": ["ゴーストカット — 貼り付けで移動するまで選択範囲を半透明に表示。Esc で取り消し","幽灵剪切 — 选中内容变为半透明,粘贴时移动;Esc 取消","幽靈剪下 — 選取內容變為半透明,貼上時移動;Esc 取消","Corte fantasma: la selección se atenúa hasta que pegas para moverla; Esc cancela","Coupe fantôme : la sélection s’estompe jusqu’à ce que vous colliez pour la déplacer ; Échap annule","Geisterschnitt – die Auswahl wird blass, bis Einfügen sie verschiebt; Esc bricht ab","Taglio fantasma: la selezione si attenua finché non incolli per spostarla; Esc annulla","Recorte fantasma: a seleção fica esmaecida até você colar para movê-la; Esc cancela"],"Duplicate selection": ["選択を複製","复制所选","複製所選","Duplicar selección","Dupliquer la sélection","Auswahl duplizieren","Duplica selezione","Duplicar seleção"],"Group · ungroup": ["グループ化・解除","成组 · 取消成组","群組 · 取消群組","Agrupar · desagrupar","Grouper · dissocier","Gruppieren · Gruppierung aufheben","Raggruppa · separa","Agrupar · desagrupar"],"Comment mode": ["コメントモード","评论模式","評論模式","Modo comentario","Mode commentaire","Kommentarmodus","Modalità commento","Modo de comentário"],diff --git a/slides/src/i18n/pt.ts b/slides/src/i18n/pt.tsindex f56ff699..33800a23 100644--- a/slides/src/i18n/pt.ts+++ b/slides/src/i18n/pt.ts@@ -472,6 +472,7 @@ export const pt: Catalog = {"Editing": "Edição","Undo · redo": "Desfazer · refazer","Copy · paste — elements, or the whole slide when nothing is selected": "Copiar · colar — elementos, ou o slide inteiro quando nada estiver selecionado",+ "Ghost cut — the selection fades until you paste to move it; Esc cancels": "Recorte fantasma: a seleção fica esmaecida até você colar para movê-la; Esc cancela","Duplicate selection": "Duplicar seleção","Group · ungroup": "Agrupar · desagrupar","Comment mode": "Modo de comentário",diff --git a/slides/src/i18n/zh-Hans.ts b/slides/src/i18n/zh-Hans.tsindex 1785dd2b..8bd8477b 100644--- a/slides/src/i18n/zh-Hans.ts+++ b/slides/src/i18n/zh-Hans.ts@@ -480,6 +480,7 @@ export const zhHans: Catalog = {"Editing": "编辑","Undo · redo": "撤销 · 重做","Copy · paste — elements, or the whole slide when nothing is selected": "复制 · 粘贴 — 元素,或在未选中任何内容时复制整张幻灯片",+ "Ghost cut — the selection fades until you paste to move it; Esc cancels": "幽灵剪切 — 选中内容变为半透明,粘贴时移动;Esc 取消","Duplicate selection": "复制所选","Group · ungroup": "成组 · 取消成组","Comment mode": "评论模式",diff --git a/slides/src/i18n/zh-Hant.ts b/slides/src/i18n/zh-Hant.tsindex 51fc8126..873cfe58 100644--- a/slides/src/i18n/zh-Hant.ts+++ b/slides/src/i18n/zh-Hant.ts@@ -480,6 +480,7 @@ export const zhHant: Catalog = {"Editing": "編輯","Undo · redo": "復原 · 重做","Copy · paste — elements, or the whole slide when nothing is selected": "複製 · 貼上 — 元素,或在未選取任何內容時複製整張投影片",+ "Ghost cut — the selection fades until you paste to move it; Esc cancels": "幽靈剪下 — 選取內容變為半透明,貼上時移動;Esc 取消","Duplicate selection": "複製所選","Group · ungroup": "群組 · 取消群組","Comment mode": "評論模式",diff --git a/slides/src/styles.css b/slides/src/styles.cssindex 9f274831..078022b0 100644--- a/slides/src/styles.css+++ b/slides/src/styles.css@@ -576,6 +576,10 @@ a.ed-btn { text-decoration: none; } /* the update block's "What's new" link is.ed-stage .bento-el { cursor: grab; }.ed-stage .bento-el:active { cursor: grabbing; }+/* Ghost Cut (⇧⌘X): faded where it stands until ⌘V moves it. !important+ because applyElementFrame writes shadows and blur as an inline `filter`,+ which would otherwise win and leave a shadowed element unfaded. */+.ed-stage .bento-el-ghost-cut { filter: opacity(.35) !important; pointer-events: none; }.ed-stage .bento-editing { cursor: text; }.ed-stage .bento-editing .bento-text-inner {cursor: text;