Bento, the office suite that fits in a file
TypeScript mit-licenseofficeoffice-365office-suiteoffice-toolsoffice365open-sourcepowerpointself-hostedsingle-page-appslidesslideshareslideshowslideshow-galleryslideshow-makerslideshows
slides: a picture can be moved and zoomed inside its frame (#319) (#478)
nyblnetc97ca5305141
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex cf7a380f..fafb9a2a 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -1353,6 +1353,14 @@ jobs:# routes the argument. Bare {{date}} stays viewer-locale (#381).run: node scripts/test-slides-fields.ts+ - name: Image crop rig+ # crop.ts: {x, y, scale} → the one CSS mapping every surface uses;+ # the frame can never show empty space; the shape gate admits the+ # field and refuses wrong shapes; one image branch in render.ts;+ # present tweens a crop only when both sides carry one (#319).+ run: |+ slides/node_modules/.bin/esbuild scripts/test-slides-crop.ts --bundle --platform=node --format=esm --outfile="$RUNNER_TEMP/test-slides-crop.mjs"+ node "$RUNNER_TEMP/test-slides-crop.mjs"- name: Photos shrink at insert rig# editor/shrink.ts decisions, DOM-free: photo vs graphic (lossy vs# lossless), the ≥20% keep rule, the 2560 px cap, svg/gif untouched,diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 17c2d936..b7040cf0 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -11,6 +11,15 @@ pre-1.0.## [Unreleased]+- **A picture can be moved and zoomed inside its frame.** Double-click an+ image and the frame becomes a window onto the whole picture: drag to choose+ which part shows, scroll or pinch to zoom in, Enter to keep it, Esc to put+ it back. The Crop section of the image panel has the zoom as a number and a+ way back to the whole picture. The crop is one small optional field on the+ image; a deck opened in an older version shows the cover-fitted picture,+ never a blank frame. Canvas, thumbnails, the show, print and file-manager+ previews all show the same crop, and a morph between two cropped copies of+ a picture glides between them. Asked for in discussion #319 by morreau.- **A pasted photo no longer costs megabytes.** Insert or paste a pictureand it is stored at slide resolution — the long edge capped at 2560 px,crisp on a 4K projector — and photos are re-encoded as JPEG, so a phonediff --git a/scripts/build-modelkeys.mjs b/scripts/build-modelkeys.mjsindex 41b9a4ba..144d6c82 100644--- a/scripts/build-modelkeys.mjs+++ b/scripts/build-modelkeys.mjs@@ -109,6 +109,7 @@ const tables = {tableRow: uniq(keysOf('TableRow')),tableCell: uniq(keysOf('TableCell')),gradient: uniq(keysOf('GradientFill')),+ imageCrop: uniq(keysOf('ImageCrop')),}const lit = (v, indent = ' ') =>diff --git a/scripts/test-slides-crop.ts b/scripts/test-slides-crop.tsnew file mode 100644index 00000000..075b50e9--- /dev/null+++ b/scripts/test-slides-crop.ts@@ -0,0 +1,102 @@+#!/usr/bin/env node+// SPDX-License-Identifier: MIT+// Copyright (c) 2026 The Bento authors+// Image crop rig (discussion #319): the crop → CSS mapping, the shape gate,+// and the one-renderer invariant.+//+// slides/node_modules/.bin/esbuild scripts/test-slides-crop.ts --bundle --platform=node --format=esm --outfile=/tmp/test-slides-crop.mjs+// node /tmp/test-slides-crop.mjs+//+// (bundled: untrusted.ts imports without extensions)+//+// WHAT THIS PROVES. crop.ts turns {x, y, scale} into inline CSS for the <img>+// such that the frame can never show empty space: the img box is never+// smaller than the frame, the offset moves it by exactly the overhang, and+// object-position moves the cover overflow by the same fraction. Absent → no+// crop styles; centred 1× is identity; out-of-range numbers clamp. The shape+// gate admits `crop` with the right types and drops a wrong shape. render.ts+// applies the crop in the ONE element renderer, and the preview/thumbnail+// paths have no image branch of their own, so canvas, thumbnails, present,+// print and the file-manager preview agree.++import { readFileSync } from 'node:fs'+import { join } from 'node:path'+import { normalizeCrop, cropImgStyle, cropWindow, isIdentityCrop, lerpCrop, CROP_MAX_SCALE } from '../slides/src/crop.ts'+import { sanitizeElement } from '../slides/src/untrusted.ts'+import { MODEL_KEYS } from '../slides/src/modelkeys.generated.ts'++let failures = 0+let checks = 0+function ok(cond: boolean, msg: string) {+ checks+++ if (!cond) { failures++; console.log(` FAIL ${msg}`) }+ else console.log(` ok ${msg}`)+}+// bundled rigs run from the repo root (CI does; so does the command above)+const root = process.cwd()+const read = (f: string) => readFileSync(join(root, f), 'utf8')+const css = (s: string) => Object.fromEntries(s.split(';').filter(Boolean).map((kv) => kv.split(':').map((x) => x.trim()) as [string, string]))++console.log('the mapping\n')+ok(normalizeCrop(undefined) === null && normalizeCrop(null) === null, 'absent → null (no crop styles)')+ok(isIdentityCrop({ x: 0.5, y: 0.5, scale: 1 }), 'centred 1× is identity — same picture as no crop')+ok(!isIdentityCrop({ x: 0.5, y: 0.5, scale: 1.01 }) && !isIdentityCrop({ x: 0, y: 0.5, scale: 1 }), 'any zoom or pan is not identity')+let s = css(cropImgStyle({ x: 1, y: 0, scale: 2 }))+ok(s.width === '200%' && s.height === '200%', 'scale 2 → img box 200% of the frame on both axes')+ok(s.left === '-100%' && s.top === '0%', 'x=1 → shifted left by the whole overhang (right edge aligned); y=0 → not shifted')+ok(s['object-position'] === '100% 0%', 'object-position follows the same fractions')+ok(s['object-fit'] === 'cover' && s.position === 'absolute' && s['max-width'] === 'none', 'cover, absolute, no max-width cap')+s = css(cropImgStyle({ x: 0.5, y: 0.5, scale: 1 }))+ok(s.width === '100%' && s.left === '0%' && s.top === '0%' && s['object-position'] === '50% 50%', 'centred 1× → 100% box, no offset, centred cover')+s = css(cropImgStyle({ x: 0.25, y: 0.75, scale: 3 }))+ok(s.left === '-50%' && s.top === '-150%', 'scale 3, x .25 → left −50% (= −(3−1)·.25); y .75 → top −150%')++console.log('\nnever a blank frame\n')+// for every x, y, scale the img box covers the frame [0,1]×[0,1]+let covered = true+for (const scale of [1, 1.5, 2, 4, CROP_MAX_SCALE]) for (const x of [0, 0.3, 0.5, 1]) for (const y of [0, 0.7, 1]) {+ const o = css(cropImgStyle({ x, y, scale }))+ const left = parseFloat(o.left) / 100, top = parseFloat(o.top) / 100, w = parseFloat(o.width) / 100, h = parseFloat(o.height) / 100+ if (left > 1e-9 || top > 1e-9 || left + w < 1 - 1e-9 || top + h < 1 - 1e-9) covered = false+}+ok(covered, 'at every sampled x, y, scale the img box covers the whole frame (left ≤ 0, right ≥ 1, same vertically)')+ok(normalizeCrop({ x: 1.7, y: -2, scale: 0.2 })!.x === 1 && normalizeCrop({ x: 1.7, y: -2, scale: 0.2 })!.y === 0, 'x, y clamp into 0..1')+ok(normalizeCrop({ x: 0.5, y: 0.5, scale: 0.2 })!.scale === 1, 'scale below 1 is treated as 1 (never smaller than the frame)')+ok(normalizeCrop({ x: 0.5, y: 0.5, scale: 99 })!.scale === CROP_MAX_SCALE, `scale clamps at ${CROP_MAX_SCALE}`)+ok(normalizeCrop({ x: NaN, y: Infinity, scale: 'x' as never })!.x === 0.5 && normalizeCrop({ x: NaN, y: Infinity, scale: 'x' as never })!.scale === 1, 'non-numbers fall to the identity values')+const win = cropWindow({ x: 1, y: 0, scale: 2 })+ok(win[0] === 0.5 && win[1] === 0 && win[2] === 0.5 && win[3] === 0.5, 'x=1 y=0 scale=2: the window is the top-right quarter of the picture')+const mid = lerpCrop({ x: 0, y: 0, scale: 1 }, { x: 1, y: 1, scale: 3 }, 0.5)+ok(mid.x === 0.5 && mid.y === 0.5 && mid.scale === 2, 'lerp at p=.5 is the numeric midpoint (morph)')++console.log('\nthe shape gate\n')+const base = { id: 'i1', type: 'image', x: 0, y: 0, w: 100, h: 100, rotation: 0, opacity: 1, src: 'data:image/png;base64,AAAA', fit: 'cover', radius: 0 }+const good = sanitizeElement({ ...base, crop: { x: 1, y: 0, scale: 2 } }) as { crop?: unknown } | null+ok(!!good && JSON.stringify(good.crop) === JSON.stringify({ x: 1, y: 0, scale: 2 }), 'a well-formed crop passes the gate intact')+const noCrop = sanitizeElement(base) as { crop?: unknown } | null+ok(!!noCrop && !('crop' in noCrop), 'no crop → no crop key')+const bad = sanitizeElement({ ...base, crop: { x: 'left', y: 0, scale: 2 } }) as { crop?: unknown } | null+ok(!!bad && bad.crop === undefined, 'a wrong-typed field drops the crop, the element survives')+const missing = sanitizeElement({ ...base, crop: { x: 1, scale: 2 } }) as { crop?: unknown } | null+ok(!!missing && missing.crop === undefined, 'a crop missing a required number is dropped')+const extra = sanitizeElement({ ...base, crop: { x: 1, y: 0, scale: 2, onload: 'x' } }) as { crop?: Record<string, unknown> } | null+ok(!!extra?.crop && !('onload' in extra.crop), 'an unknown key inside crop is stripped')+const oor = sanitizeElement({ ...base, crop: { x: 5, y: 0, scale: 2 } }) as { crop?: unknown } | null+ok(!!oor && oor.crop === undefined, 'an out-of-range number is refused by the gate (crop.ts clamps only what the gate let through)')+ok(JSON.stringify(MODEL_KEYS.imageCrop) === JSON.stringify(['scale', 'x', 'y']), 'modelkeys carries imageCrop = scale, x, y')+ok(MODEL_KEYS.element.image.includes('crop'), 'modelkeys: image elements may carry crop')++console.log('\none renderer\n')+const render = read('slides/src/render.ts')+ok(/case 'image': \{[\s\S]*?if \(el\.crop && !isIdentityCrop\(el\.crop\)\) \{[\s\S]*?img\.style\.cssText = cropImgStyle\(el\.crop\)/.test(render), 'render.ts applies the crop in the single image branch via cropImgStyle')+ok((render.match(/document\.createElement\('img'\)/g) ?? []).length >= 1 && !/case 'image'[\s\S]*case 'image'/.test(render), 'exactly one image branch — thumbnails, present, print and preview all come through it')+ok(!/cropImgStyle|\.crop\b/.test(read('slides/src/preview.ts')), 'preview.ts has no crop code of its own (it staticizes the same render)')+ok(/lerpCrop\(a\.crop!, b\.crop!, state\.p\)/.test(read('slides/src/present.ts')), 'present.ts tweens the crop when both sides carry one')+ok(/a\.crop && b\.crop && !isIdentityCrop\(a\.crop\) && !isIdentityCrop\(b\.crop\)/.test(read('slides/src/present.ts')), '…and only then — one-sided crops snap')+const canvas = read('slides/src/editor/canvas.ts')+ok(/closest<HTMLElement>\('\.bento-el-image'\)[\s\S]*?this\.startCropEdit\(/.test(canvas), 'double-click on a picture enters crop mode')+ok(/this\.cropEditor\?\.active \|\| handled \? \[\] : this\.selectedNodes\(\)/.test(canvas), 'Moveable stands down while cropping')+ok(/private buildCropProps\(el: ImageElement\)/.test(read('slides/src/editor/panels.ts')), 'the image panel has a Crop block')++console.log(`\n${checks - failures}/${checks} checks passed`)+process.exit(failures ? 1 : 0)diff --git a/scripts/test-slides-shrink.ts b/scripts/test-slides-shrink.tsindex c8e9fea2..bef3dfd3 100644--- a/scripts/test-slides-shrink.ts+++ b/scripts/test-slides-shrink.ts@@ -18,7 +18,6 @@import { readFileSync } from 'node:fs'import { fileURLToPath } from 'node:url'import { dirname, join } from 'node:path'-import { execFileSync } from 'node:child_process'import { classify, sampleGrid, fitEdge, worthIt, untouchable, MAX_EDGE, MIN_GAIN, GRAPHIC_COLOURS, GRAPHIC_FLAT, shrinkNote, fmtBytes } from '../slides/src/editor/shrink.ts'let failures = 0@@ -107,9 +106,13 @@ ok(/setShrinkEnabled\(/.test(editor) && /shrinkEnabled\(\)/.test(editor), 'the Aok(/'bento-shrink-photos'/.test(read('slides/src/editor/shrink.ts')), "the preference is localStorage 'bento-shrink-photos'")console.log('\nthe format\n')-let modelDiff = ''-try { modelDiff = execFileSync('git', ['diff', 'origin/main', '--stat', '--', 'slides/src/model.ts'], { cwd: root, encoding: 'utf8' }) } catch { modelDiff = '' }-ok(modelDiff.trim() === '', 'model.ts is untouched — a picture is still a data URI or an asset: key')+// Not a diff against main: on main that reads as "no later PR may touch+// model.ts". The claim is narrower — shrinking adds nothing to the format —+// so the format is asked directly.+const model = read('slides/src/model.ts')+ok(!/shrink|shrunk|recompress/i.test(model), 'model.ts knows nothing of shrinking — a picture is still a data URI or an asset: key')+const imageIface = model.slice(model.indexOf('export interface ImageElement'), model.indexOf('export interface ImageElement') + 1500)+ok(/src: string/.test(imageIface), 'ImageElement.src is the same string it always was')console.log(`\n${checks - failures}/${checks} checks passed`)process.exit(failures ? 1 : 0)diff --git a/slides/src/crop.ts b/slides/src/crop.tsnew file mode 100644index 00000000..0bd02134--- /dev/null+++ b/slides/src/crop.ts@@ -0,0 +1,70 @@+// SPDX-License-Identifier: MIT+// Copyright (c) 2026 The Bento authors+/**+ * Image crop → CSS (discussion #319). One mapping, used by the single+ * renderer for canvas, thumbnails, present, print and the file-manager+ * preview, so a crop looks the same everywhere.+ *+ * The model (model.ts ImageCrop): the picture covers the frame, `scale` ≥ 1+ * enlarges it, `x`/`y` in 0..1 pick which edge the frame aligns to. The CSS:+ * the <img> is `scale × 100%` of the frame on both axes with `object-fit:+ * cover`, offset by `-(scale − 1) × x` of the frame so 0 shows the left/top+ * edge and 1 the right/bottom, and `object-position: x% y%` moves the cover+ * overflow by the same fraction. Both moves use the same number, so the+ * mapping is monotonic and — because the img box is never smaller than the+ * frame and cover never leaves a gap — the frame can never show empty space+ * at any x, y or scale. The frame clips (overflow hidden) and carries the+ * corner radius.+ *+ * Pure: no DOM. scripts/test-slides-crop.ts drives it in node.+ */++import type { ImageCrop } from './model.ts'++export const CROP_MAX_SCALE = 8++/** A crop with every number in range; null for absent. Out-of-range values+ * clamp rather than drop — a hand-edited 1.2 means "the right edge". */+export function normalizeCrop(c: ImageCrop | null | undefined): ImageCrop | null {+ if (!c || typeof c !== 'object') return null+ const n = (v: unknown, lo: number, hi: number, dflt: number) =>+ typeof v === 'number' && Number.isFinite(v) ? Math.min(hi, Math.max(lo, v)) : dflt+ return { x: n(c.x, 0, 1, 0.5), y: n(c.y, 0, 1, 0.5), scale: n(c.scale, 1, CROP_MAX_SCALE, 1) }+}++/** Is this crop the same picture as no crop at all (cover, centred, 1×)? */+export const isIdentityCrop = (c: ImageCrop | null | undefined): boolean => {+ const n = normalizeCrop(c)+ return !n || (n.scale === 1 && n.x === 0.5 && n.y === 0.5)+}++/** Inline style for the <img> inside a frame that carries `crop`. */+export function cropImgStyle(c: ImageCrop): string {+ const n = normalizeCrop(c)!+ const pct = (v: number) => `${Math.round(v * 10000) / 100}%`+ const size = pct(n.scale)+ const off = (v: number) => pct(-(n.scale - 1) * v)+ return `position:absolute;left:${off(n.x)};top:${off(n.y)};width:${size};height:${size};` ++ `object-fit:cover;object-position:${pct(n.x)} ${pct(n.y)};display:block;max-width:none`+}++/**+ * The visible window, as fractions of the enlarged picture's cover box:+ * [left, top, width, height]. What a crop editor draws and what a test can+ * check against pixels — at x=1,y=0,scale=2 the window is the top-right+ * quarter.+ */+export function cropWindow(c: ImageCrop): [number, number, number, number] {+ const n = normalizeCrop(c)!+ const size = 1 / n.scale+ return [(1 - size) * n.x, (1 - size) * n.y, size, size]+}++/** Interpolate two crops (present.ts morph). Absent on either side = no+ * tween: the picture snaps, because there is no honest midpoint between+ * "the whole cover-fitted picture as `fit` says" and a window into it. */+export function lerpCrop(a: ImageCrop, b: ImageCrop, p: number): ImageCrop {+ const A = normalizeCrop(a)!+ const B = normalizeCrop(b)!+ return { x: A.x + (B.x - A.x) * p, y: A.y + (B.y - A.y) * p, scale: A.scale + (B.scale - A.scale) * p }+}diff --git a/slides/src/editor/canvas.ts b/slides/src/editor/canvas.tsindex 7f17b591..237996a6 100644--- a/slides/src/editor/canvas.ts+++ b/slides/src/editor/canvas.ts@@ -14,6 +14,7 @@ import { autoformatAtCaret, clearAutoformat, markdownToHtml, undoAutoformat } frimport { execFormat, hideFormatBar, syncFormatBar } from './richtext'import { PathEditor } from './patheditor'import { LineEditor, isLineLike, setLineEndpoints, setPathAnchors } from './lineedit'+import { CropEditor } from './cropedit'import { BezierEditor, isCurve } from './beziereditor'import { simplifyPoints } from './patheditor'@@ -67,6 +68,7 @@ export class SlideCanvas {private panning = falseprivate pathEditor!: PathEditorprivate lineEditor!: LineEditor+ private cropEditor!: CropEditorprivate bezierEditor!: BezierEditorprivate drawOverlay: HTMLElement | null = nullprivate comments!: CommentsUI@@ -310,8 +312,13 @@ export class SlideCanvas {this.pathEditor.setScaleGetter(() => this.scale)this.lineEditor = new LineEditor(this.scaleHost, store)this.lineEditor.setScaleGetter(() => this.scale)+ this.cropEditor = new CropEditor(this.scaleHost, store, () => this.scale, () => this.syncTargets())this.bezierEditor = new BezierEditor(this.scaleHost, store)this.bezierEditor.setScaleGetter(() => this.scale)+ document.addEventListener('bento:edit-crop', ((ev: CustomEvent) => {+ const id = String(ev.detail?.id ?? '')+ if (id) this.startCropEdit(id)+ }) as EventListener)document.addEventListener('bento:edit-path', ((ev: CustomEvent) => {this.startPathEdit(ev.detail.id)}) as EventListener)@@ -348,7 +355,10 @@ export class SlideCanvas {}if (textEl) { this.startTextEdit(textEl); return }const td = (ev.target as HTMLElement).closest<HTMLElement>('.bento-el-table td[data-c]')- if (td) this.editCellFromTd(td)+ if (td) { this.editCellFromTd(td); return }+ // a picture: double-click opens crop mode (pan + zoom inside the frame)+ const pic = (ev.target as HTMLElement).closest<HTMLElement>('.bento-el-image')+ if (pic?.dataset.elId) this.startCropEdit(pic.dataset.elId)})// Touch has no double-click. Selecto and Moveable preventDefault the touch@@ -396,7 +406,7 @@ export class SlideCanvas {const start = taptap = nullif (!start || ev.touches.length || this.store.readOnly) return- if (this.editing || this.editingCell || this.isPathEditing) return+ if (this.editing || this.editingCell || this.isPathEditing || this.isCropEditing) returnconst t = ev.changedTouches[0]if (!t) returnif (Math.hypot(t.clientX - start.x, t.clientY - start.y) > TAP_SLOP) return@@ -417,6 +427,10 @@ export class SlideCanvas {// so they can be hit-tested directly — but the control box is above// them, hence the whole stack rather than the topmost node.opened = this.editCellUnder(node, t.clientX, t.clientY)+ } else if (node.classList.contains('bento-el-image')) {+ // a picture opens crop mode: a finger pans, two fingers zoom+ this.startCropEdit(id)+ opened = true}// Cancel the tap we consumed. Without this the browser replays it as// mousedown → mouseup → click ~300ms later at the ORIGINAL screen point,@@ -776,6 +790,23 @@ export class SlideCanvas {this.store.select([pick])}+ // --- crop editing (pan + zoom a picture inside its frame) --------------------++ get isCropEditing() { return this.cropEditor.active }++ startCropEdit(elId: string) {+ this.commitTextEdit()+ this.store.select([elId])+ this.cropEditor.start(elId)+ this.syncTargets()+ }++ /** finish crop editing; commit=false puts back what was there on entry */+ stopCropEdit(commit = true) {+ if (commit) this.cropEditor.commit()+ else this.cropEditor.cancel()+ }+// --- motion-path editing ----------------------------------------------------get isPathEditing() {@@ -810,6 +841,7 @@ export class SlideCanvas {if (this.editing) { this.pendingRender = true; return }this.pendingRender = falseif (this.pathEditor?.active) this.pathEditor.cancel() // doc changed under us+ if (this.cropEditor?.active) this.cropEditor.cancel()const slide = this.store.slideconst next = renderSlide(slide, this.store.doc)// hover-reveal slides: preview one set at a time; hidden sets are@@ -934,7 +966,7 @@ export class SlideCanvas {// A single selected line/curve/connector is edited with endpoint handles// (LineEditor), not Moveable's box — grab an end and drag it.const sel = this.store.selectedElements- const one = sel.length === 1 && !this.editing && !this.pathEditor.active ? sel[0] : null+ const one = sel.length === 1 && !this.editing && !this.pathEditor.active && !this.cropEditor?.active ? sel[0] : null// Curves get true bezier handles (BezierEditor); lines and straight polygons// keep endpoint/anchor handles (LineEditor).const curve = !!one && isCurve(one)@@ -943,7 +975,7 @@ export class SlideCanvas {else if (lineLike) { this.lineEditor.attach(one!.id); this.bezierEditor.detach() }else { this.lineEditor.detach(); this.bezierEditor.detach() }const handled = curve || lineLike- const targets = this.editing || this.pathEditor?.active || handled ? [] : this.selectedNodes()+ const targets = this.editing || this.pathEditor?.active || this.cropEditor?.active || handled ? [] : this.selectedNodes()// snap against slide bounds/center and every non-selected elementconst others = this.surface? [this.surface, ...Array.from(this.surface.querySelectorAll<HTMLElement>('.bento-el'))].filter(@@ -1227,6 +1259,13 @@ export class SlideCanvas {e.stop() // the path overlay owns the pointer while editingreturn}+ if (this.cropEditor?.active) {+ // a press on the grey surround ends the crop, like a click outside+ // the frame does on the slide; nothing starts a marquee under it+ this.cropEditor.commit()+ e.stop()+ return+ }if (this.editing) {// editing a table cell: clicking a DIFFERENT cell switches to itif (this.editingCell) {diff --git a/slides/src/editor/cropedit.ts b/slides/src/editor/cropedit.tsnew file mode 100644index 00000000..0d3d9083--- /dev/null+++ b/slides/src/editor/cropedit.ts@@ -0,0 +1,288 @@+// SPDX-License-Identifier: MIT+// Copyright (c) 2026 The Bento authors+/**+ * Crop mode for a picture (discussion #319): double-click an image and the+ * frame becomes a window onto the whole picture. The full picture shows+ * dimmed around the frame; drag pans it, wheel or pinch zooms about the+ * pointer, Enter (or a click outside the frame) commits ONE undo step, Esc+ * puts back what was there on entry. The model is `ImageCrop` (model.ts);+ * the numbers are written live into the element while the gesture runs and+ * the <img> restyled through crop.ts — the same mapping the renderer uses —+ * so what you see while dragging is exactly what commits. Mirrors the path+ * editor's lifecycle (patheditor.ts): start / commit / cancel, `active`,+ * an overlay in the scaled stage, Moveable hidden while it runs.+ */++import type { Store } from '../store'+import type { ImageCrop, ImageElement } from '../model'+import { CROP_MAX_SCALE, cropImgStyle, normalizeCrop } from '../crop'+import { resolveAsset } from '../render'+import { t } from '../i18n'++const clamp = (v: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, v))++export class CropEditor {+ private overlay: HTMLElement | null = null+ private ghost: HTMLImageElement | null = null+ private hint: HTMLElement | null = null+ private elId = ''+ private entry: ImageCrop | undefined+ private crop: ImageCrop = { x: 0.5, y: 0.5, scale: 1 }+ /** the picture's natural size, once known (the ghost needs it) */+ private nat: { w: number; h: number } | null = null+ private pointers = new Map<number, { x: number; y: number }>()+ private pinch: { dist: number; scale: number } | null = null+ private keyHandler = (ev: KeyboardEvent) => {+ if (ev.key === 'Escape') { ev.preventDefault(); ev.stopPropagation(); this.cancel() }+ else if (ev.key === 'Enter') { ev.preventDefault(); ev.stopPropagation(); this.commit() }+ }++ constructor(+ private scaleHost: HTMLElement,+ private store: Store,+ private scaleOf: () => number,+ private onDone: () => void,+ ) {}++ get active() { return !!this.overlay }+ get editingId() { return this.active ? this.elId : null }++ start(elId: string) {+ this.cancel()+ const el = this.store.element(elId)+ if (!el || el.type !== 'image') return+ this.elId = elId+ this.entry = el.crop ? { ...el.crop } : undefined+ this.crop = normalizeCrop(el.crop) ?? { x: 0.5, y: 0.5, scale: 1 }+ this.nat = null++ const { width, height } = this.store.doc.size+ const ov = document.createElement('div')+ ov.className = 'ed-cropedit'+ ov.style.cssText = `position:absolute;left:0;top:0;width:${width}px;height:${height}px;z-index:50;touch-action:none;cursor:grab`+ // the dimmed whole picture, placed by geometry() once the size is known+ const ghost = document.createElement('img')+ ghost.className = 'ed-cropedit-ghost'+ ghost.draggable = false+ ghost.style.cssText = 'position:absolute;opacity:0.45;pointer-events:none;display:none;max-width:none'+ const src = resolveAsset(this.store.doc, el.src)+ ghost.addEventListener('load', () => {+ this.nat = { w: ghost.naturalWidth || 1, h: ghost.naturalHeight || 1 }+ this.draw()+ })+ if (src) ghost.src = src+ ov.appendChild(ghost)+ // the frame outline+ const frame = document.createElement('div')+ frame.className = 'ed-cropedit-frame'+ frame.style.cssText = `position:absolute;left:${el.x}px;top:${el.y}px;width:${el.w}px;height:${el.h}px;` ++ `transform:${el.rotation ? `rotate(${el.rotation}deg)` : 'none'};box-shadow:0 0 0 2px #5B8DEF;pointer-events:none;box-sizing:border-box`+ ov.appendChild(frame)++ ov.addEventListener('pointerdown', (ev) => this.onDown(ev))+ ov.addEventListener('pointermove', (ev) => this.onMove(ev))+ ov.addEventListener('pointerup', (ev) => this.onUp(ev))+ ov.addEventListener('pointercancel', (ev) => this.onUp(ev))+ ov.addEventListener('wheel', (ev) => this.onWheel(ev), { passive: false })+ ov.addEventListener('dblclick', (ev) => { ev.preventDefault(); ev.stopPropagation(); this.commit() })+ document.addEventListener('keydown', this.keyHandler, true)+ this.scaleHost.appendChild(ov)+ this.overlay = ov+ this.ghost = ghost++ this.hint = document.createElement('div')+ this.hint.className = 'ed-setbar ed-pathbar'+ this.hint.innerHTML = `<span class="ed-setbar-label">${t('Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back')}</span>`+ const done = document.createElement('button')+ done.className = 'ed-setchip active'+ done.textContent = t('Done')+ done.addEventListener('click', () => this.commit())+ this.hint.appendChild(done)+ this.scaleHost.closest('.ed-canvas-wrap')?.appendChild(this.hint)+ this.apply()+ this.draw()+ }++ /** One undo step carrying the final numbers; identity = no field. */+ commit() {+ if (!this.overlay) return+ const el = this.store.element(this.elId)+ const final = { ...this.crop }+ const entry = this.entry+ this.teardown()+ if (!el || el.type !== 'image') return+ // put the live element back to what it was, then commit the change once+ if (entry) el.crop = entry; else delete el.crop+ const identity = final.scale === 1 && final.x === 0.5 && final.y === 0.5+ const same = identity ? !entry : !!entry && entry.x === final.x && entry.y === final.y && entry.scale === final.scale+ if (!same) {+ this.store.commit(() => {+ const cur = this.store.element(this.elId)+ if (!cur || cur.type !== 'image') return+ if (identity) delete cur.crop+ else cur.crop = final+ })+ }+ this.onDone()+ }++ /** Esc: what was there on entry comes back; nothing is committed. */+ cancel() {+ if (!this.overlay) return+ const el = this.store.element(this.elId)+ const entry = this.entry+ this.teardown()+ if (el && el.type === 'image') {+ if (entry) el.crop = entry; else delete el.crop+ this.restyle(el)+ }+ this.onDone()+ }++ private teardown() {+ document.removeEventListener('keydown', this.keyHandler, true)+ this.overlay?.remove()+ this.hint?.remove()+ this.overlay = null+ this.ghost = null+ this.hint = null+ this.pointers.clear()+ this.pinch = null+ }++ // --- geometry ---------------------------------------------------------------++ /** The enlarged picture's box in slide px, relative to the frame's top-left. */+ private geometry(el: ImageElement) {+ const nat = this.nat ?? { w: el.w, h: el.h }+ const k = Math.max(el.w / nat.w, el.h / nat.h) * this.crop.scale // cover, then zoom+ const pw = nat.w * k+ const ph = nat.h * k+ return { pw, ph, left: -(pw - el.w) * this.crop.x, top: -(ph - el.h) * this.crop.y }+ }++ private draw() {+ const el = this.store.element(this.elId)+ if (!this.ghost || !el || el.type !== 'image' || !this.nat) return+ const g = this.geometry(el)+ this.ghost.style.display = 'block'+ this.ghost.style.left = `${el.x + g.left}px`+ this.ghost.style.top = `${el.y + g.top}px`+ this.ghost.style.width = `${g.pw}px`+ this.ghost.style.height = `${g.ph}px`+ this.ghost.style.transform = el.rotation ? `rotate(${el.rotation}deg)` : ''+ this.ghost.style.transformOrigin = `${-g.left + el.w / 2}px ${-g.top + el.h / 2}px`+ }++ /** Write the live numbers into the element and restyle its <img>. */+ private apply() {+ const el = this.store.element(this.elId)+ if (!el || el.type !== 'image') return+ el.crop = { ...this.crop }+ this.restyle(el)+ }++ private restyle(el: ImageElement) {+ const node = this.scaleHost.querySelector<HTMLElement>(`.bento-el[data-el-id="${CSS.escape(el.id)}"]`)+ const img = node?.querySelector('img')+ if (!node || !img) return+ const identity = !el.crop || (el.crop.scale === 1 && el.crop.x === 0.5 && el.crop.y === 0.5)+ if (identity) {+ node.style.overflow = ''+ node.style.borderRadius = ''+ img.style.cssText = `width:100%;height:100%;object-fit:${el.fit};border-radius:${el.radius}px;display:block`+ } else {+ node.style.overflow = 'hidden'+ node.style.borderRadius = `${el.radius}px`+ img.style.cssText = cropImgStyle(el.crop!)+ }+ }++ // --- gestures ---------------------------------------------------------------++ private slidePoint(ev: PointerEvent | WheelEvent) {+ const r = this.overlay!.getBoundingClientRect()+ const s = this.scaleOf()+ return { x: (ev.clientX - r.left) / s, y: (ev.clientY - r.top) / s }+ }++ private inFrame(p: { x: number; y: number }, el: ImageElement) {+ return p.x >= el.x && p.x <= el.x + el.w && p.y >= el.y && p.y <= el.y + el.h+ }++ private onDown(ev: PointerEvent) {+ const el = this.store.element(this.elId)+ if (!el || el.type !== 'image' || !this.overlay) return+ const p = this.slidePoint(ev)+ // a click outside the frame is "done" (like clicking away from a text edit)+ if (this.pointers.size === 0 && !this.inFrame(p, el) && ev.pointerType !== 'touch') { this.commit(); return }+ ev.preventDefault()+ this.overlay.setPointerCapture(ev.pointerId)+ this.pointers.set(ev.pointerId, p)+ this.overlay.style.cursor = 'grabbing'+ if (this.pointers.size === 2) {+ const [a, b] = [...this.pointers.values()]+ this.pinch = { dist: Math.hypot(a.x - b.x, a.y - b.y) || 1, scale: this.crop.scale }+ }+ }++ private onMove(ev: PointerEvent) {+ const prev = this.pointers.get(ev.pointerId)+ const el = this.store.element(this.elId)+ if (!prev || !el || el.type !== 'image') return+ const p = this.slidePoint(ev)+ this.pointers.set(ev.pointerId, p)+ if (this.pointers.size === 2 && this.pinch) {+ const [a, b] = [...this.pointers.values()]+ const d = Math.hypot(a.x - b.x, a.y - b.y) || 1+ const mid = { x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 }+ this.zoomTo(el, this.pinch.scale * (d / this.pinch.dist), mid)+ return+ }+ this.pan(el, p.x - prev.x, p.y - prev.y)+ }++ private onUp(ev: PointerEvent) {+ this.pointers.delete(ev.pointerId)+ if (this.pointers.size < 2) this.pinch = null+ if (this.pointers.size === 0 && this.overlay) this.overlay.style.cursor = 'grab'+ }++ private onWheel(ev: WheelEvent) {+ const el = this.store.element(this.elId)+ if (!el || el.type !== 'image') return+ ev.preventDefault()+ ev.stopPropagation()+ const factor = Math.exp(-ev.deltaY * 0.0025)+ this.zoomTo(el, this.crop.scale * factor, this.slidePoint(ev))+ }++ /** Move the picture by (dx, dy) slide px: the frame's edge fractions move+ * the opposite way, by the pan range on each axis. */+ private pan(el: ImageElement, dx: number, dy: number) {+ const g = this.geometry(el)+ const rx = g.pw - el.w+ const ry = g.ph - el.h+ if (rx > 0) this.crop.x = clamp(this.crop.x - dx / rx, 0, 1)+ if (ry > 0) this.crop.y = clamp(this.crop.y - dy / ry, 0, 1)+ this.apply(); this.draw()+ }++ /** Zoom to `scale` keeping the picture point under `at` (slide coords) still. */+ private zoomTo(el: ImageElement, scale: number, at: { x: number; y: number }) {+ const before = this.geometry(el)+ const px = clamp(at.x - el.x, 0, el.w)+ const py = clamp(at.y - el.y, 0, el.h)+ // the picture point under the pointer, as a fraction of the picture+ const u = (px - before.left) / before.pw+ const v = (py - before.top) / before.ph+ this.crop.scale = clamp(scale, 1, CROP_MAX_SCALE)+ const after = this.geometry(el)+ const rx = after.pw - el.w+ const ry = after.ph - el.h+ // solve left = px − u·pw for x: left = −rx·x+ this.crop.x = rx > 0 ? clamp((u * after.pw - px) / rx, 0, 1) : 0.5+ this.crop.y = ry > 0 ? clamp((v * after.ph - py) / ry, 0, 1) : 0.5+ this.apply(); this.draw()+ }+}diff --git a/slides/src/editor/editor.ts b/slides/src/editor/editor.tsindex c03765b9..a6e1c7b7 100644--- a/slides/src/editor/editor.ts+++ b/slides/src/editor/editor.ts@@ -2915,6 +2915,9 @@ export class Editor {return}if (inField) return+ // Crop mode owns the keyboard: Enter/Esc are its (cropedit.ts), and a+ // Delete meant for the picture being cropped must not remove it.+ if (this.canvas.isCropEditing) returnif (!mod && (ev.key === '?' || (ev.key === '/' && ev.shiftKey))) {ev.preventDefault()diff --git a/slides/src/editor/panels.ts b/slides/src/editor/panels.tsindex e0e40fe9..de679b18 100644--- a/slides/src/editor/panels.ts+++ b/slides/src/editor/panels.ts@@ -6,6 +6,7 @@import type { Store } from '../store'import { MEDIA_EMBED_BUDGET, applyChartPalette, defaultChart, internAsset, morphKey, paginates, isWebUrl, tableStyleFor, uid, type ChartElement, type ImageElement, type LineEnding, type MediaElement, type ShapeElement, type Slide, type SlideElement, type TableElement, type TextElement, type TransitionKind, type CodeElement, type BentoDoc, type EmbedElement } from '../model'+import { CROP_MAX_SCALE, normalizeCrop } from '../crop'import { LANGS } from '../../../kernel/src/tokenize.ts'import { resolveAsset } from '../render'import { measureElement } from '../measure'@@ -1840,6 +1841,42 @@ export class PropsPanel {if (on) delete e.keepAspectRatioelse { e.keepAspectRatio = false; e.fit = 'fill' }}, true)))+ this.buildCropProps(el as ImageElement)+ }++ /** Crop (discussion #319): which part of the picture the frame shows. The+ * numbers live in `crop` (model.ts ImageCrop); the canvas edits them by+ * gesture (double-click the picture), this block offers the zoom as a+ * number, the way in, and the way back to the whole picture. */+ private buildCropProps(el: ImageElement) {+ this.section(t('Crop'))+ const hint = document.createElement('p')+ hint.className = 'ed-hint'+ hint.textContent = t('Double-click the picture to move it inside its frame; scroll or pinch to zoom.')+ this.host.appendChild(hint)+ const crop = normalizeCrop(el.crop)+ this.row('Zoom', this.number(Math.round((crop?.scale ?? 1) * 10) / 10, 0.1, (v, fin) =>+ this.mutate(el.id, (e) => {+ const im = e as ImageElement+ const scale = Math.min(CROP_MAX_SCALE, Math.max(1, Number.isFinite(v) ? v : 1))+ const cur = normalizeCrop(im.crop) ?? { x: 0.5, y: 0.5, scale: 1 }+ if (scale === 1 && cur.x === 0.5 && cur.y === 0.5) delete im.crop+ else im.crop = { ...cur, scale }+ }, fin)))+ const edit = document.createElement('button')+ edit.className = 'ed-btn ed-btn-block'+ edit.textContent = t('✎ Edit crop on canvas')+ edit.addEventListener('click', () =>+ document.dispatchEvent(new CustomEvent('bento:edit-crop', { detail: { id: el.id } })))+ this.host.appendChild(edit)+ if (el.crop) {+ const reset = document.createElement('button')+ reset.className = 'ed-btn ed-btn-block'+ reset.textContent = t('Reset crop')+ reset.title = t('Show the whole picture again, the way Fit says')+ reset.addEventListener('click', () => this.mutate(el.id, (e) => { delete (e as ImageElement).crop }, true))+ this.host.appendChild(reset)+ }}private buildMediaProps(el: MediaElement) {diff --git a/slides/src/i18n/de.ts b/slides/src/i18n/de.tsindex f25c2c44..273ca9c1 100644--- a/slides/src/i18n/de.ts+++ b/slides/src/i18n/de.ts@@ -875,6 +875,12 @@ export const de: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "Seitenzahl, Datum, Uhrzeit, Titel und Dokumenteigenschaften — aufgelöst, wenn die Folie gezeigt wird. Datum und Uhrzeit können ein Format festlegen: {{date:M/D/YY}}; das Muster wird im Text bearbeitet.","Text ▸ Field": "Text ▸ Feld","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "Seitenzahl, Datum, Uhrzeit, Titel oder eine Dokumenteigenschaft einfügen; ein Datum kann sein Format festlegen — {{date:M/D/YY}}",+ "Crop": "Zuschnitt",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "Doppelklick auf das Bild, um es im Rahmen zu verschieben; scrollen oder zusammenziehen zum Zoomen.",+ "✎ Edit crop on canvas": "✎ Zuschnitt auf der Leinwand bearbeiten",+ "Reset crop": "Zuschnitt zurücksetzen",+ "Show the whole picture again, the way Fit says": "Wieder das ganze Bild zeigen, so wie „Einpassen“ es vorgibt",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "Zuschnitt — ziehen, um das Bild im Rahmen zu verschieben · scrollen oder zusammenziehen zum Zoomen · Eingabe behält · Esc stellt zurück","Photo stored at {px} px — {before} → {after}": "Foto mit {px} px gespeichert — {before} → {after}","Image stored at {px} px — {before} → {after}": "Bild mit {px} px gespeichert — {before} → {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "Fotos beim Einfügen verkleinern (2560 px; Screenshots und Logos bleiben scharf)",diff --git a/slides/src/i18n/es.ts b/slides/src/i18n/es.tsindex 67c8c265..01de485d 100644--- a/slides/src/i18n/es.ts+++ b/slides/src/i18n/es.ts@@ -875,6 +875,12 @@ export const es: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "Número de página, fecha, hora, título y propiedades del documento: se resuelven al mostrar la diapositiva. La fecha y la hora pueden fijar un formato: {{date:M/D/YY}}; edita el patrón en el texto.","Text ▸ Field": "Texto ▸ Campo","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "Inserta el número de página, la fecha, la hora, el título o una propiedad del documento; una fecha puede fijar su formato: {{date:M/D/YY}}",+ "Crop": "Recorte",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "Haz doble clic en la imagen para moverla dentro de su marco; desplaza o pellizca para ampliar.",+ "✎ Edit crop on canvas": "✎ Editar recorte en el lienzo",+ "Reset crop": "Restablecer recorte",+ "Show the whole picture again, the way Fit says": "Volver a mostrar toda la imagen, como indica Ajuste",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "Recorte: arrastra para mover la imagen dentro del marco · desplaza o pellizca para ampliar · Intro conserva · Esc lo devuelve","Photo stored at {px} px — {before} → {after}": "Foto guardada a {px} px: {before} → {after}","Image stored at {px} px — {before} → {after}": "Imagen guardada a {px} px: {before} → {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "Reducir fotos al insertar (2560 px; capturas y logotipos siguen nítidos)",diff --git a/slides/src/i18n/fr.ts b/slides/src/i18n/fr.tsindex f8486d89..046d242b 100644--- a/slides/src/i18n/fr.ts+++ b/slides/src/i18n/fr.ts@@ -875,6 +875,12 @@ export const fr: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "Numéro de page, date, heure, titre et propriétés du document — résolus à l’affichage de la diapositive. La date et l’heure peuvent fixer un format : {{date:M/D/YY}} ; modifiez le motif dans le texte.","Text ▸ Field": "Texte ▸ Champ","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "Insère le numéro de page, la date, l’heure, le titre ou une propriété du document ; une date peut fixer son format — {{date:M/D/YY}}",+ "Crop": "Recadrage",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "Double-cliquez sur l’image pour la déplacer dans son cadre ; faites défiler ou pincez pour zoomer.",+ "✎ Edit crop on canvas": "✎ Modifier le recadrage sur le canevas",+ "Reset crop": "Réinitialiser le recadrage",+ "Show the whole picture again, the way Fit says": "Afficher de nouveau toute l’image, comme l’indique Ajustement",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "Recadrage — faites glisser pour déplacer l’image dans son cadre · défilement ou pincement pour zoomer · Entrée conserve · Échap remet en place","Photo stored at {px} px — {before} → {after}": "Photo enregistrée à {px} px — {before} → {after}","Image stored at {px} px — {before} → {after}": "Image enregistrée à {px} px — {before} → {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "Réduire les photos à l’insertion (2560 px ; captures et logos restent nets)",diff --git a/slides/src/i18n/it.ts b/slides/src/i18n/it.tsindex 50c1a8e3..b8cf92cc 100644--- a/slides/src/i18n/it.ts+++ b/slides/src/i18n/it.ts@@ -875,6 +875,12 @@ export const it: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "Numero di pagina, data, ora, titolo e proprietà del documento — risolti quando la diapositiva viene mostrata. Data e ora possono fissare un formato: {{date:M/D/YY}}; modifica il modello nel testo.","Text ▸ Field": "Testo ▸ Campo","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "Inserisce numero di pagina, data, ora, titolo o una proprietà del documento; una data può fissare il proprio formato — {{date:M/D/YY}}",+ "Crop": "Ritaglio",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "Fai doppio clic sull’immagine per spostarla nella cornice; scorri o pizzica per ingrandire.",+ "✎ Edit crop on canvas": "✎ Modifica ritaglio sulla tela",+ "Reset crop": "Reimposta ritaglio",+ "Show the whole picture again, the way Fit says": "Mostra di nuovo tutta l’immagine, come indica Adatta",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "Ritaglio — trascina per spostare l’immagine nella cornice · scorri o pizzica per ingrandire · Invio conferma · Esc ripristina","Photo stored at {px} px — {before} → {after}": "Foto salvata a {px} px — {before} → {after}","Image stored at {px} px — {before} → {after}": "Immagine salvata a {px} px — {before} → {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "Riduci le foto all’inserimento (2560 px; screenshot e loghi restano nitidi)",diff --git a/slides/src/i18n/ja.ts b/slides/src/i18n/ja.tsindex 5255c73c..356f1323 100644--- a/slides/src/i18n/ja.ts+++ b/slides/src/i18n/ja.ts@@ -875,6 +875,12 @@ export const ja: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "ページ番号、日付、時刻、タイトル、文書プロパティ — スライド表示時に解決されます。日付と時刻は書式を固定できます: {{date:M/D/YY}}。パターンはテキスト内で編集します。","Text ▸ Field": "テキスト ▸ フィールド","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "ページ番号、日付、時刻、タイトル、文書プロパティを挿入します。日付は書式を固定できます — {{date:M/D/YY}}",+ "Crop": "トリミング",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "画像をダブルクリックして枠内で動かせます。スクロールまたはピンチでズームします。",+ "✎ Edit crop on canvas": "✎ キャンバスでトリミングを編集",+ "Reset crop": "トリミングをリセット",+ "Show the whole picture again, the way Fit says": "「フィット」の指定どおり、画像全体を再び表示します",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "トリミング — ドラッグで枠内の画像を移動 · スクロールまたはピンチでズーム · Enter で確定 · Esc で元に戻す","Photo stored at {px} px — {before} → {after}": "写真を {px} px で保存 — {before} → {after}","Image stored at {px} px — {before} → {after}": "画像を {px} px で保存 — {before} → {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "挿入時に写真を縮小(2560 px、スクリーンショットやロゴは鮮明なまま)",diff --git a/slides/src/i18n/packed.ts b/slides/src/i18n/packed.tsindex 02087f40..cf27e0d5 100644--- a/slides/src/i18n/packed.ts+++ b/slides/src/i18n/packed.ts@@ -881,6 +881,12 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": ["ページ番号、日付、時刻、タイトル、文書プロパティ — スライド表示時に解決されます。日付と時刻は書式を固定できます: {{date:M/D/YY}}。パターンはテキスト内で編集します。","页码、日期、时间、标题和文档属性 — 在显示幻灯片时解析。日期和时间可固定格式:{{date:M/D/YY}};在文本中编辑模式。","頁碼、日期、時間、標題和文件屬性 — 在顯示投影片時解析。日期和時間可固定格式:{{date:M/D/YY}};在文字中編輯樣式。","Número de página, fecha, hora, título y propiedades del documento: se resuelven al mostrar la diapositiva. La fecha y la hora pueden fijar un formato: {{date:M/D/YY}}; edita el patrón en el texto.","Numéro de page, date, heure, titre et propriétés du document — résolus à l’affichage de la diapositive. La date et l’heure peuvent fixer un format : {{date:M/D/YY}} ; modifiez le motif dans le texte.","Seitenzahl, Datum, Uhrzeit, Titel und Dokumenteigenschaften — aufgelöst, wenn die Folie gezeigt wird. Datum und Uhrzeit können ein Format festlegen: {{date:M/D/YY}}; das Muster wird im Text bearbeitet.","Numero di pagina, data, ora, titolo e proprietà del documento — risolti quando la diapositiva viene mostrata. Data e ora possono fissare un formato: {{date:M/D/YY}}; modifica il modello nel testo.","Número da página, data, hora, título e propriedades do documento — resolvidos quando o diapositivo é mostrado. Data e hora podem fixar um formato: {{date:M/D/YY}}; edite o padrão no texto."],"Text ▸ Field": ["テキスト ▸ フィールド","文本 ▸ 字段","文字 ▸ 欄位","Texto ▸ Campo","Texte ▸ Champ","Text ▸ Feld","Testo ▸ Campo","Texto ▸ Campo"],"Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": ["ページ番号、日付、時刻、タイトル、文書プロパティを挿入します。日付は書式を固定できます — {{date:M/D/YY}}","插入页码、日期、时间、标题或文档属性;日期可固定格式 — {{date:M/D/YY}}","插入頁碼、日期、時間、標題或文件屬性;日期可固定格式 — {{date:M/D/YY}}","Inserta el número de página, la fecha, la hora, el título o una propiedad del documento; una fecha puede fijar su formato: {{date:M/D/YY}}","Insère le numéro de page, la date, l’heure, le titre ou une propriété du document ; une date peut fixer son format — {{date:M/D/YY}}","Seitenzahl, Datum, Uhrzeit, Titel oder eine Dokumenteigenschaft einfügen; ein Datum kann sein Format festlegen — {{date:M/D/YY}}","Inserisce numero di pagina, data, ora, titolo o una proprietà del documento; una data può fissare il proprio formato — {{date:M/D/YY}}","Insere o número da página, a data, a hora, o título ou uma propriedade do documento; uma data pode fixar o seu formato — {{date:M/D/YY}}"],+ "Crop": ["トリミング","裁剪","裁切","Recorte","Recadrage","Zuschnitt","Ritaglio","Recorte"],+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": ["画像をダブルクリックして枠内で動かせます。スクロールまたはピンチでズームします。","双击图片可在框内移动它;滚动或捏合可缩放。","按兩下圖片可在框內移動它;捲動或捏合可縮放。","Haz doble clic en la imagen para moverla dentro de su marco; desplaza o pellizca para ampliar.","Double-cliquez sur l’image pour la déplacer dans son cadre ; faites défiler ou pincez pour zoomer.","Doppelklick auf das Bild, um es im Rahmen zu verschieben; scrollen oder zusammenziehen zum Zoomen.","Fai doppio clic sull’immagine per spostarla nella cornice; scorri o pizzica per ingrandire.","Faça duplo clique na imagem para a mover dentro da moldura; desloque ou belisque para ampliar."],+ "✎ Edit crop on canvas": ["✎ キャンバスでトリミングを編集","✎ 在画布上编辑裁剪","✎ 在畫布上編輯裁切","✎ Editar recorte en el lienzo","✎ Modifier le recadrage sur le canevas","✎ Zuschnitt auf der Leinwand bearbeiten","✎ Modifica ritaglio sulla tela","✎ Editar recorte na tela"],+ "Reset crop": ["トリミングをリセット","重置裁剪","重設裁切","Restablecer recorte","Réinitialiser le recadrage","Zuschnitt zurücksetzen","Reimposta ritaglio","Repor recorte"],+ "Show the whole picture again, the way Fit says": ["「フィット」の指定どおり、画像全体を再び表示します","按“适应”方式重新显示整张图片","按「符合」方式重新顯示整張圖片","Volver a mostrar toda la imagen, como indica Ajuste","Afficher de nouveau toute l’image, comme l’indique Ajustement","Wieder das ganze Bild zeigen, so wie „Einpassen“ es vorgibt","Mostra di nuovo tutta l’immagine, come indica Adatta","Mostrar de novo toda a imagem, como indica Ajuste"],+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": ["トリミング — ドラッグで枠内の画像を移動 · スクロールまたはピンチでズーム · Enter で確定 · Esc で元に戻す","裁剪 — 拖动可在框内移动图片 · 滚动或捏合可缩放 · Enter 保留 · Esc 还原","裁切 — 拖曳可在框內移動圖片 · 捲動或捏合可縮放 · Enter 保留 · Esc 還原","Recorte: arrastra para mover la imagen dentro del marco · desplaza o pellizca para ampliar · Intro conserva · Esc lo devuelve","Recadrage — faites glisser pour déplacer l’image dans son cadre · défilement ou pincement pour zoomer · Entrée conserve · Échap remet en place","Zuschnitt — ziehen, um das Bild im Rahmen zu verschieben · scrollen oder zusammenziehen zum Zoomen · Eingabe behält · Esc stellt zurück","Ritaglio — trascina per spostare l’immagine nella cornice · scorri o pizzica per ingrandire · Invio conferma · Esc ripristina","Recorte — arraste para mover a imagem dentro da moldura · desloque ou belisque para ampliar · Enter mantém · Esc repõe"],"Photo stored at {px} px — {before} → {after}": ["写真を {px} px で保存 — {before} → {after}","照片已按 {px} px 存储 — {before} → {after}","照片已以 {px} px 儲存 — {before} → {after}","Foto guardada a {px} px: {before} → {after}","Photo enregistrée à {px} px — {before} → {after}","Foto mit {px} px gespeichert — {before} → {after}","Foto salvata a {px} px — {before} → {after}","Foto guardada a {px} px — {before} → {after}"],"Image stored at {px} px — {before} → {after}": ["画像を {px} px で保存 — {before} → {after}","图片已按 {px} px 存储 — {before} → {after}","圖片已以 {px} px 儲存 — {before} → {after}","Imagen guardada a {px} px: {before} → {after}","Image enregistrée à {px} px — {before} → {after}","Bild mit {px} px gespeichert — {before} → {after}","Immagine salvata a {px} px — {before} → {after}","Imagem guardada a {px} px — {before} → {after}"],"Shrink photos on insert (2560 px, screenshots and logos stay sharp)": ["挿入時に写真を縮小(2560 px、スクリーンショットやロゴは鮮明なまま)","插入时缩小照片(2560 px,截图和徽标保持清晰)","插入時縮小照片(2560 px,截圖與標誌保持清晰)","Reducir fotos al insertar (2560 px; capturas y logotipos siguen nítidos)","Réduire les photos à l’insertion (2560 px ; captures et logos restent nets)","Fotos beim Einfügen verkleinern (2560 px; Screenshots und Logos bleiben scharf)","Riduci le foto all’inserimento (2560 px; screenshot e loghi restano nitidi)","Reduzir fotos ao inserir (2560 px; capturas e logótipos mantêm-se nítidos)"],diff --git a/slides/src/i18n/packs/ar.ts b/slides/src/i18n/packs/ar.tsindex 7db1e2ff..78987751 100644--- a/slides/src/i18n/packs/ar.ts+++ b/slides/src/i18n/packs/ar.ts@@ -895,6 +895,12 @@ export const strings: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "رقم الصفحة والتاريخ والوقت والعنوان وخصائص المستند — تُحلّ عند عرض الشريحة. يمكن للتاريخ والوقت تثبيت تنسيق: {{date:M/D/YY}}؛ حرّر النمط في النص.","Text ▸ Field": "نص ▸ حقل","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "يدرج رقم الصفحة أو التاريخ أو الوقت أو العنوان أو خاصية مستند؛ يمكن للتاريخ تثبيت تنسيقه — {{date:M/D/YY}}",+ "Crop": "اقتصاص",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "انقر نقرًا مزدوجًا على الصورة لتحريكها داخل إطارها؛ مرّر أو قرّب بإصبعين للتكبير.",+ "✎ Edit crop on canvas": "✎ تحرير الاقتصاص على اللوحة",+ "Reset crop": "إعادة تعيين الاقتصاص",+ "Show the whole picture again, the way Fit says": "إظهار الصورة كاملة مجددًا كما تحدد «الملاءمة»",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "اقتصاص — اسحب لتحريك الصورة داخل إطارها · مرّر أو قرّب بإصبعين للتكبير · Enter للإبقاء · Esc للإرجاع","Photo stored at {px} px — {before} → {after}": "حُفظت الصورة الفوتوغرافية بدقة {px} بكسل — {before} ← {after}","Image stored at {px} px — {before} → {after}": "حُفظت الصورة بدقة {px} بكسل — {before} ← {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "تصغير الصور عند الإدراج (2560 بكسل؛ تبقى لقطات الشاشة والشعارات حادة)",diff --git a/slides/src/i18n/packs/bn.ts b/slides/src/i18n/packs/bn.tsindex 2044cfaa..826c1bcf 100644--- a/slides/src/i18n/packs/bn.ts+++ b/slides/src/i18n/packs/bn.ts@@ -898,6 +898,12 @@ export const strings: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "পৃষ্ঠা নম্বর, তারিখ, সময়, শিরোনাম ও নথির বৈশিষ্ট্য — স্লাইড দেখানোর সময় নির্ধারিত হয়। তারিখ ও সময়ের বিন্যাস স্থির করা যায়: {{date:M/D/YY}}; প্যাটার্নটি লেখায় সম্পাদনা করুন।","Text ▸ Field": "লেখা ▸ ফিল্ড","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "পৃষ্ঠা নম্বর, তারিখ, সময়, শিরোনাম বা নথির বৈশিষ্ট্য যোগ করুন; তারিখের বিন্যাস স্থির করা যায় — {{date:M/D/YY}}",+ "Crop": "ক্রপ",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "ফ্রেমের ভেতরে ছবি সরাতে ছবিতে ডাবল-ক্লিক করুন; জুম করতে স্ক্রল বা পিঞ্চ করুন।",+ "✎ Edit crop on canvas": "✎ ক্যানভাসে ক্রপ সম্পাদনা",+ "Reset crop": "ক্রপ রিসেট",+ "Show the whole picture again, the way Fit says": "ফিট যেভাবে বলে, পুরো ছবি আবার দেখান",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "ক্রপ — ফ্রেমের ভেতরে ছবি সরাতে টানুন · জুম করতে স্ক্রল বা পিঞ্চ · Enter রাখে · Esc ফিরিয়ে দেয়","Photo stored at {px} px — {before} → {after}": "ছবি {px} px-এ সংরক্ষিত — {before} → {after}","Image stored at {px} px — {before} → {after}": "চিত্র {px} px-এ সংরক্ষিত — {before} → {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "যোগ করার সময় ছবি ছোট করুন (2560 px; স্ক্রিনশট ও লোগো স্পষ্ট থাকে)",diff --git a/slides/src/i18n/packs/da.ts b/slides/src/i18n/packs/da.tsindex a252eb56..3e04f8fc 100644--- a/slides/src/i18n/packs/da.ts+++ b/slides/src/i18n/packs/da.ts@@ -887,6 +887,12 @@ export const strings: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "Sidetal, dato, klokkeslæt, titel og dokumentegenskaber — udfyldes når diasset vises. Dato og klokkeslæt kan låse et format: {{date:M/D/YY}}; rediger mønsteret i teksten.","Text ▸ Field": "Tekst ▸ Felt","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "Indsæt sidetal, dato, klokkeslæt, titel eller en dokumentegenskab; en dato kan låse sit format — {{date:M/D/YY}}",+ "Crop": "Beskæring",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "Dobbeltklik på billedet for at flytte det inden i rammen; rul eller knib for at zoome.",+ "✎ Edit crop on canvas": "✎ Rediger beskæring på lærredet",+ "Reset crop": "Nulstil beskæring",+ "Show the whole picture again, the way Fit says": "Vis hele billedet igen, sådan som Tilpas angiver",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "Beskæring — træk for at flytte billedet inden i rammen · rul eller knib for at zoome · Enter beholder · Esc sætter tilbage","Photo stored at {px} px — {before} → {after}": "Foto gemt i {px} px — {before} → {after}","Image stored at {px} px — {before} → {after}": "Billede gemt i {px} px — {before} → {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "Formindsk fotos ved indsættelse (2560 px; skærmbilleder og logoer forbliver skarpe)",diff --git a/slides/src/i18n/packs/fa.ts b/slides/src/i18n/packs/fa.tsindex fad7fc57..634c93f5 100644--- a/slides/src/i18n/packs/fa.ts+++ b/slides/src/i18n/packs/fa.ts@@ -891,6 +891,12 @@ export const strings: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "شمارهٔ صفحه، تاریخ، زمان، عنوان و ویژگیهای سند — هنگام نمایش اسلاید جایگزین میشوند. تاریخ و زمان میتوانند قالب را ثابت کنند: {{date:M/D/YY}}؛ الگو را در متن ویرایش کنید.","Text ▸ Field": "متن ▸ فیلد","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "شمارهٔ صفحه، تاریخ، زمان، عنوان یا یک ویژگی سند را درج میکند؛ تاریخ میتواند قالب خود را ثابت کند — {{date:M/D/YY}}",+ "Crop": "برش",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "برای جابهجایی تصویر داخل قابش روی آن دوبار کلیک کنید؛ برای بزرگنمایی پیمایش یا پینچ کنید.",+ "✎ Edit crop on canvas": "✎ ویرایش برش روی بوم",+ "Reset crop": "بازنشانی برش",+ "Show the whole picture again, the way Fit says": "نمایش دوبارهٔ کل تصویر، همانطور که «برازش» میگوید",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "برش — بکشید تا تصویر داخل قاب جابهجا شود · پیمایش یا پینچ برای بزرگنمایی · Enter نگه میدارد · Esc برمیگرداند","Photo stored at {px} px — {before} → {after}": "عکس با {px} پیکسل ذخیره شد — {before} ← {after}","Image stored at {px} px — {before} → {after}": "تصویر با {px} پیکسل ذخیره شد — {before} ← {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "کوچککردن عکسها هنگام درج (۲۵۶۰ پیکسل؛ اسکرینشاتها و لوگوها واضح میمانند)",diff --git a/slides/src/i18n/packs/fi.ts b/slides/src/i18n/packs/fi.tsindex 9454a97f..00f0e2f9 100644--- a/slides/src/i18n/packs/fi.ts+++ b/slides/src/i18n/packs/fi.ts@@ -892,6 +892,12 @@ export const strings: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "Sivunumero, päivämäärä, kellonaika, otsikko ja asiakirjan ominaisuudet — täytetään, kun dia näytetään. Päivämäärä ja kellonaika voivat lukita muodon: {{date:M/D/YY}}; muokkaa kaavaa tekstissä.","Text ▸ Field": "Teksti ▸ Kenttä","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "Lisää sivunumeron, päivämäärän, kellonajan, otsikon tai asiakirjan ominaisuuden; päivämäärä voi lukita muotonsa — {{date:M/D/YY}}",+ "Crop": "Rajaus",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "Kaksoisnapsauta kuvaa siirtääksesi sitä kehyksen sisällä; vieritä tai nipistä zoomataksesi.",+ "✎ Edit crop on canvas": "✎ Muokkaa rajausta kankaalla",+ "Reset crop": "Palauta rajaus",+ "Show the whole picture again, the way Fit says": "Näytä koko kuva taas, kuten Sovitus sanoo",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "Rajaus — vedä siirtääksesi kuvaa kehyksen sisällä · vieritä tai nipistä zoomataksesi · Enter säilyttää · Esc palauttaa","Photo stored at {px} px — {before} → {after}": "Valokuva tallennettu {px} px:nä — {before} → {after}","Image stored at {px} px — {before} → {after}": "Kuva tallennettu {px} px:nä — {before} → {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "Pienennä valokuvat lisättäessä (2560 px; kuvakaappaukset ja logot pysyvät terävinä)",diff --git a/slides/src/i18n/packs/fil.ts b/slides/src/i18n/packs/fil.tsindex 869ee26d..ec3e9b36 100644--- a/slides/src/i18n/packs/fil.ts+++ b/slides/src/i18n/packs/fil.ts@@ -904,6 +904,12 @@ export const strings: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "Numero ng pahina, petsa, oras, pamagat at mga property ng dokumento — nireresolba kapag ipinakita ang slide. Puwedeng itakda ng petsa at oras ang format: {{date:M/D/YY}}; i-edit ang pattern sa teksto.","Text ▸ Field": "Teksto ▸ Field","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "Ilagay ang numero ng pahina, petsa, oras, pamagat o property ng dokumento; puwedeng itakda ng petsa ang format nito — {{date:M/D/YY}}",+ "Crop": "Crop",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "I-double-click ang larawan para ilipat ito sa loob ng frame; mag-scroll o mag-pinch para mag-zoom.",+ "✎ Edit crop on canvas": "✎ I-edit ang crop sa canvas",+ "Reset crop": "I-reset ang crop",+ "Show the whole picture again, the way Fit says": "Ipakitang muli ang buong larawan, ayon sa Fit",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "Crop — i-drag para ilipat ang larawan sa loob ng frame · mag-scroll o mag-pinch para mag-zoom · Enter para panatilihin · Esc para ibalik","Photo stored at {px} px — {before} → {after}": "Naka-store ang larawan sa {px} px — {before} → {after}","Image stored at {px} px — {before} → {after}": "Naka-store ang imahe sa {px} px — {before} → {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "Paliitin ang mga larawan kapag inilagay (2560 px; nananatiling malinaw ang mga screenshot at logo)",diff --git a/slides/src/i18n/packs/he.ts b/slides/src/i18n/packs/he.tsindex f3e8d3ee..f51bc632 100644--- a/slides/src/i18n/packs/he.ts+++ b/slides/src/i18n/packs/he.ts@@ -888,6 +888,12 @@ export const strings: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "מספר עמוד, תאריך, שעה, כותרת ומאפייני המסמך — נפתרים בעת הצגת השקופית. תאריך ושעה יכולים לקבע תבנית: {{date:M/D/YY}}; ערכו את התבנית בטקסט.","Text ▸ Field": "טקסט ▸ שדה","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "הוספת מספר עמוד, תאריך, שעה, כותרת או מאפיין מסמך; תאריך יכול לקבע את התבנית שלו — {{date:M/D/YY}}",+ "Crop": "חיתוך",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "לחצו פעמיים על התמונה כדי להזיז אותה בתוך המסגרת; גללו או צבטו כדי להגדיל.",+ "✎ Edit crop on canvas": "✎ עריכת החיתוך על הקנבס",+ "Reset crop": "איפוס החיתוך",+ "Show the whole picture again, the way Fit says": "להציג שוב את כל התמונה, כפי שההתאמה קובעת",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "חיתוך — גררו כדי להזיז את התמונה בתוך המסגרת · גלילה או צביטה להגדלה · Enter שומר · Esc מחזיר","Photo stored at {px} px — {before} → {after}": "התמונה נשמרה ב-{px} פיקסלים — {before} ← {after}","Image stored at {px} px — {before} → {after}": "התמונה נשמרה ב-{px} פיקסלים — {before} ← {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "הקטנת תמונות בהוספה (2560 פיקסלים; צילומי מסך ולוגואים נשארים חדים)",diff --git a/slides/src/i18n/packs/hi.ts b/slides/src/i18n/packs/hi.tsindex ce8b3f42..bceaee43 100644--- a/slides/src/i18n/packs/hi.ts+++ b/slides/src/i18n/packs/hi.ts@@ -895,6 +895,12 @@ export const strings: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "पृष्ठ संख्या, तारीख़, समय, शीर्षक और दस्तावेज़ गुण — स्लाइड दिखाते समय हल होते हैं। तारीख़ और समय प्रारूप तय कर सकते हैं: {{date:M/D/YY}}; पैटर्न पाठ में संपादित करें।","Text ▸ Field": "पाठ ▸ फ़ील्ड","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "पृष्ठ संख्या, तारीख़, समय, शीर्षक या दस्तावेज़ गुण डालें; तारीख़ अपना प्रारूप तय कर सकती है — {{date:M/D/YY}}",+ "Crop": "क्रॉप",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "चित्र को फ़्रेम के भीतर हिलाने के लिए उस पर डबल-क्लिक करें; ज़ूम के लिए स्क्रॉल या पिंच करें।",+ "✎ Edit crop on canvas": "✎ कैनवास पर क्रॉप संपादित करें",+ "Reset crop": "क्रॉप रीसेट करें",+ "Show the whole picture again, the way Fit says": "पूरा चित्र फिर दिखाएँ, जैसा फ़िट कहता है",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "क्रॉप — फ़्रेम के भीतर चित्र हिलाने के लिए खींचें · ज़ूम के लिए स्क्रॉल या पिंच · Enter रखता है · Esc वापस करता है","Photo stored at {px} px — {before} → {after}": "फ़ोटो {px} px पर संग्रहीत — {before} → {after}","Image stored at {px} px — {before} → {after}": "छवि {px} px पर संग्रहीत — {before} → {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "डालते समय फ़ोटो छोटी करें (2560 px; स्क्रीनशॉट और लोगो साफ़ रहते हैं)",diff --git a/slides/src/i18n/packs/id.ts b/slides/src/i18n/packs/id.tsindex 928fbf63..aaa9be78 100644--- a/slides/src/i18n/packs/id.ts+++ b/slides/src/i18n/packs/id.ts@@ -885,6 +885,12 @@ export const strings: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "Nomor halaman, tanggal, waktu, judul, dan properti dokumen — diisi saat slide ditampilkan. Tanggal dan waktu dapat mengunci format: {{date:M/D/YY}}; edit polanya di teks.","Text ▸ Field": "Teks ▸ Bidang","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "Sisipkan nomor halaman, tanggal, waktu, judul, atau properti dokumen; tanggal dapat mengunci formatnya — {{date:M/D/YY}}",+ "Crop": "Pangkas",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "Klik dua kali gambar untuk menggesernya di dalam bingkai; gulir atau cubit untuk memperbesar.",+ "✎ Edit crop on canvas": "✎ Edit pangkasan di kanvas",+ "Reset crop": "Atur ulang pangkasan",+ "Show the whole picture again, the way Fit says": "Tampilkan lagi seluruh gambar, sesuai Sesuaikan",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "Pangkas — seret untuk menggeser gambar di dalam bingkai · gulir atau cubit untuk memperbesar · Enter menyimpan · Esc mengembalikan","Photo stored at {px} px — {before} → {after}": "Foto disimpan pada {px} px — {before} → {after}","Image stored at {px} px — {before} → {after}": "Gambar disimpan pada {px} px — {before} → {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "Perkecil foto saat disisipkan (2560 px; tangkapan layar dan logo tetap tajam)",diff --git a/slides/src/i18n/packs/ko.ts b/slides/src/i18n/packs/ko.tsindex 1e0757a3..0c3b2cc2 100644--- a/slides/src/i18n/packs/ko.ts+++ b/slides/src/i18n/packs/ko.ts@@ -879,6 +879,12 @@ export const strings: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "페이지 번호, 날짜, 시간, 제목, 문서 속성 — 슬라이드가 표시될 때 채워집니다. 날짜와 시간은 형식을 고정할 수 있습니다: {{date:M/D/YY}}; 패턴은 텍스트에서 편집합니다.","Text ▸ Field": "텍스트 ▸ 필드","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "페이지 번호, 날짜, 시간, 제목 또는 문서 속성을 삽입합니다. 날짜는 형식을 고정할 수 있습니다 — {{date:M/D/YY}}",+ "Crop": "자르기",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "사진을 더블클릭하면 틀 안에서 움직일 수 있습니다. 스크롤하거나 핀치하면 확대됩니다.",+ "✎ Edit crop on canvas": "✎ 캔버스에서 자르기 편집",+ "Reset crop": "자르기 초기화",+ "Show the whole picture again, the way Fit says": "맞춤 설정대로 사진 전체를 다시 표시",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "자르기 — 드래그하면 틀 안에서 사진이 움직입니다 · 스크롤 또는 핀치로 확대 · Enter로 유지 · Esc로 되돌리기","Photo stored at {px} px — {before} → {after}": "사진을 {px} px로 저장 — {before} → {after}","Image stored at {px} px — {before} → {after}": "이미지를 {px} px로 저장 — {before} → {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "삽입할 때 사진 줄이기 (2560 px, 스크린샷과 로고는 선명하게 유지)",diff --git a/slides/src/i18n/packs/ms.ts b/slides/src/i18n/packs/ms.tsindex a9fc6e6c..798f0736 100644--- a/slides/src/i18n/packs/ms.ts+++ b/slides/src/i18n/packs/ms.ts@@ -888,6 +888,12 @@ export const strings: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "Nombor halaman, tarikh, masa, tajuk dan sifat dokumen — diisi apabila slaid dipaparkan. Tarikh dan masa boleh menetapkan format: {{date:M/D/YY}}; sunting coraknya dalam teks.","Text ▸ Field": "Teks ▸ Medan","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "Sisipkan nombor halaman, tarikh, masa, tajuk atau sifat dokumen; tarikh boleh menetapkan formatnya — {{date:M/D/YY}}",+ "Crop": "Pangkas",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "Klik dua kali gambar untuk mengalihkannya dalam bingkai; tatal atau cubit untuk zum.",+ "✎ Edit crop on canvas": "✎ Sunting pangkasan pada kanvas",+ "Reset crop": "Tetapkan semula pangkasan",+ "Show the whole picture again, the way Fit says": "Tunjukkan semula seluruh gambar, seperti yang Muat tetapkan",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "Pangkas — seret untuk mengalihkan gambar dalam bingkai · tatal atau cubit untuk zum · Enter mengekalkan · Esc mengembalikan","Photo stored at {px} px — {before} → {after}": "Foto disimpan pada {px} px — {before} → {after}","Image stored at {px} px — {before} → {after}": "Imej disimpan pada {px} px — {before} → {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "Kecilkan foto semasa menyisipkan (2560 px; tangkapan skrin dan logo kekal tajam)",diff --git a/slides/src/i18n/packs/nb.ts b/slides/src/i18n/packs/nb.tsindex 2218b432..c7a100bd 100644--- a/slides/src/i18n/packs/nb.ts+++ b/slides/src/i18n/packs/nb.ts@@ -889,6 +889,12 @@ export const strings: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "Sidetall, dato, klokkeslett, tittel og dokumentegenskaper — fylles ut når lysbildet vises. Dato og klokkeslett kan låse et format: {{date:M/D/YY}}; rediger mønsteret i teksten.","Text ▸ Field": "Tekst ▸ Felt","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "Sett inn sidetall, dato, klokkeslett, tittel eller en dokumentegenskap; en dato kan låse formatet sitt — {{date:M/D/YY}}",+ "Crop": "Beskjæring",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "Dobbeltklikk på bildet for å flytte det inne i rammen; rull eller knip for å zoome.",+ "✎ Edit crop on canvas": "✎ Rediger beskjæring på lerretet",+ "Reset crop": "Tilbakestill beskjæring",+ "Show the whole picture again, the way Fit says": "Vis hele bildet igjen, slik Tilpass sier",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "Beskjæring — dra for å flytte bildet inne i rammen · rull eller knip for å zoome · Enter beholder · Esc setter tilbake","Photo stored at {px} px — {before} → {after}": "Foto lagret i {px} px — {before} → {after}","Image stored at {px} px — {before} → {after}": "Bilde lagret i {px} px — {before} → {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "Forminsk bilder ved innsetting (2560 px; skjermbilder og logoer forblir skarpe)",diff --git a/slides/src/i18n/packs/nl.ts b/slides/src/i18n/packs/nl.tsindex 9c568209..b5fa3140 100644--- a/slides/src/i18n/packs/nl.ts+++ b/slides/src/i18n/packs/nl.ts@@ -883,6 +883,12 @@ export const strings: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "Paginanummer, datum, tijd, titel en documenteigenschappen — ingevuld zodra de dia wordt getoond. Datum en tijd kunnen een notatie vastzetten: {{date:M/D/YY}}; bewerk het patroon in de tekst.","Text ▸ Field": "Tekst ▸ Veld","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "Voeg paginanummer, datum, tijd, titel of een documenteigenschap in; een datum kan zijn notatie vastzetten — {{date:M/D/YY}}",+ "Crop": "Bijsnijden",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "Dubbelklik op de afbeelding om die binnen het kader te verschuiven; scroll of knijp om te zoomen.",+ "✎ Edit crop on canvas": "✎ Bijsnijden op het canvas bewerken",+ "Reset crop": "Bijsnijden herstellen",+ "Show the whole picture again, the way Fit says": "De hele afbeelding weer tonen, zoals Passend aangeeft",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "Bijsnijden — sleep om de afbeelding binnen het kader te verschuiven · scroll of knijp om te zoomen · Enter behoudt · Esc zet terug","Photo stored at {px} px — {before} → {after}": "Foto opgeslagen op {px} px — {before} → {after}","Image stored at {px} px — {before} → {after}": "Afbeelding opgeslagen op {px} px — {before} → {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "Foto's verkleinen bij invoegen (2560 px; schermafbeeldingen en logo's blijven scherp)",diff --git a/slides/src/i18n/packs/pl.ts b/slides/src/i18n/packs/pl.tsindex ed58b246..a0b98b65 100644--- a/slides/src/i18n/packs/pl.ts+++ b/slides/src/i18n/packs/pl.ts@@ -886,6 +886,12 @@ export const strings: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "Numer strony, data, godzina, tytuł i właściwości dokumentu — uzupełniane przy wyświetleniu slajdu. Data i godzina mogą mieć ustalony format: {{date:M/D/YY}}; wzorzec edytujesz w tekście.","Text ▸ Field": "Tekst ▸ Pole","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "Wstawia numer strony, datę, godzinę, tytuł lub właściwość dokumentu; data może mieć ustalony format — {{date:M/D/YY}}",+ "Crop": "Kadrowanie",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "Kliknij dwukrotnie obraz, aby przesunąć go w ramce; przewiń lub uszczypnij, aby powiększyć.",+ "✎ Edit crop on canvas": "✎ Edytuj kadrowanie na płótnie",+ "Reset crop": "Zresetuj kadrowanie",+ "Show the whole picture again, the way Fit says": "Pokaż znów cały obraz, tak jak określa Dopasowanie",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "Kadrowanie — przeciągnij, aby przesunąć obraz w ramce · przewiń lub uszczypnij, aby powiększyć · Enter zachowuje · Esc przywraca","Photo stored at {px} px — {before} → {after}": "Zdjęcie zapisane w {px} px — {before} → {after}","Image stored at {px} px — {before} → {after}": "Obraz zapisany w {px} px — {before} → {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "Zmniejszaj zdjęcia przy wstawianiu (2560 px; zrzuty ekranu i logo pozostają ostre)",diff --git a/slides/src/i18n/packs/ru.ts b/slides/src/i18n/packs/ru.tsindex 842e3b3d..cde41bcf 100644--- a/slides/src/i18n/packs/ru.ts+++ b/slides/src/i18n/packs/ru.ts@@ -887,6 +887,12 @@ export const strings: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "Номер страницы, дата, время, название и свойства документа — подставляются при показе слайда. Дата и время могут закрепить формат: {{date:M/D/YY}}; шаблон правится в тексте.","Text ▸ Field": "Текст ▸ Поле","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "Вставляет номер страницы, дату, время, название или свойство документа; дата может закрепить свой формат — {{date:M/D/YY}}",+ "Crop": "Кадрирование",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "Дважды щёлкните картинку, чтобы сдвинуть её внутри рамки; прокрутка или щипок — масштаб.",+ "✎ Edit crop on canvas": "✎ Изменить кадрирование на холсте",+ "Reset crop": "Сбросить кадрирование",+ "Show the whole picture again, the way Fit says": "Снова показать всю картинку, как задано в «Подгонке»",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "Кадрирование — тяните, чтобы сдвинуть картинку внутри рамки · прокрутка или щипок — масштаб · Enter сохраняет · Esc возвращает","Photo stored at {px} px — {before} → {after}": "Фото сохранено в {px} px — {before} → {after}","Image stored at {px} px — {before} → {after}": "Изображение сохранено в {px} px — {before} → {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "Уменьшать фото при вставке (2560 px; снимки экрана и логотипы остаются чёткими)",diff --git a/slides/src/i18n/packs/sv.ts b/slides/src/i18n/packs/sv.tsindex 070399be..a4dbb644 100644--- a/slides/src/i18n/packs/sv.ts+++ b/slides/src/i18n/packs/sv.ts@@ -884,6 +884,12 @@ export const strings: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "Sidnummer, datum, tid, titel och dokumentegenskaper — fylls i när bilden visas. Datum och tid kan låsa ett format: {{date:M/D/YY}}; redigera mönstret i texten.","Text ▸ Field": "Text ▸ Fält","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "Infoga sidnummer, datum, tid, titel eller en dokumentegenskap; ett datum kan låsa sitt format — {{date:M/D/YY}}",+ "Crop": "Beskärning",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "Dubbelklicka på bilden för att flytta den inuti ramen; rulla eller nyp för att zooma.",+ "✎ Edit crop on canvas": "✎ Redigera beskärning på arbetsytan",+ "Reset crop": "Återställ beskärning",+ "Show the whole picture again, the way Fit says": "Visa hela bilden igen, så som Anpassa anger",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "Beskärning — dra för att flytta bilden inuti ramen · rulla eller nyp för att zooma · Enter behåller · Esc återställer","Photo stored at {px} px — {before} → {after}": "Foto sparat i {px} px — {before} → {after}","Image stored at {px} px — {before} → {after}": "Bild sparad i {px} px — {before} → {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "Förminska foton vid infogning (2560 px; skärmbilder och logotyper förblir skarpa)",diff --git a/slides/src/i18n/packs/th.ts b/slides/src/i18n/packs/th.tsindex 771e5876..1418c9bd 100644--- a/slides/src/i18n/packs/th.ts+++ b/slides/src/i18n/packs/th.ts@@ -889,6 +889,12 @@ export const strings: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "หมายเลขหน้า วันที่ เวลา ชื่อเรื่อง และคุณสมบัติเอกสาร — เติมค่าเมื่อแสดงสไลด์ วันที่และเวลากำหนดรูปแบบตายตัวได้: {{date:M/D/YY}} แก้ไขรูปแบบในข้อความ","Text ▸ Field": "ข้อความ ▸ ฟิลด์","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "แทรกหมายเลขหน้า วันที่ เวลา ชื่อเรื่อง หรือคุณสมบัติเอกสาร วันที่กำหนดรูปแบบตายตัวได้ — {{date:M/D/YY}}",+ "Crop": "ครอบตัด",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "ดับเบิลคลิกรูปภาพเพื่อเลื่อนภายในกรอบ เลื่อนหรือบีบนิ้วเพื่อซูม",+ "✎ Edit crop on canvas": "✎ แก้ไขการครอบตัดบนผืนผ้าใบ",+ "Reset crop": "รีเซ็ตการครอบตัด",+ "Show the whole picture again, the way Fit says": "แสดงรูปภาพทั้งรูปอีกครั้งตามที่ตั้งค่าพอดี",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "ครอบตัด — ลากเพื่อเลื่อนรูปภาพภายในกรอบ · เลื่อนหรือบีบนิ้วเพื่อซูม · Enter เพื่อเก็บ · Esc เพื่อคืนค่า","Photo stored at {px} px — {before} → {after}": "เก็บภาพถ่ายที่ {px} px — {before} → {after}","Image stored at {px} px — {before} → {after}": "เก็บรูปภาพที่ {px} px — {before} → {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "ย่อภาพถ่ายเมื่อแทรก (2560 px ภาพหน้าจอและโลโก้ยังคมชัด)",diff --git a/slides/src/i18n/packs/tk.ts b/slides/src/i18n/packs/tk.tsindex 593cfdcf..0b7c4f8f 100644--- a/slides/src/i18n/packs/tk.ts+++ b/slides/src/i18n/packs/tk.ts@@ -912,6 +912,12 @@ export const strings: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "Sahypa belgisi, sene, wagt, at we resminama häsiýetleri — slaýd görkezilende doldurylýar. Sene we wagt formaty berkidip bilýär: {{date:M/D/YY}}; nusgany tekstde üýtgediň.","Text ▸ Field": "Tekst ▸ Meýdan","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "Sahypa belgisini, senäni, wagty, ady ýa-da resminama häsiýetini goýýar; sene öz formatyny berkidip bilýär — {{date:M/D/YY}}",+ "Crop": "Kesmek",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "Suraty çarçuwasynyň içinde süýşürmek üçin oňa iki gezek basyň; ulaltmak üçin aýlaň ýa-da gysyň.",+ "✎ Edit crop on canvas": "✎ Kesmegi kanwada üýtgetmek",+ "Reset crop": "Kesmegi yza gaýtar",+ "Show the whole picture again, the way Fit says": "Laýyklamada aýdylyşy ýaly, bütin suraty ýene görkez",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "Kesmek — suraty çarçuwanyň içinde süýşürmek üçin süýräň · ulaltmak üçin aýlaň ýa-da gysyň · Enter saklaýar · Esc yzyna gaýtarýar","Photo stored at {px} px — {before} → {after}": "Surat {px} px-de saklandy — {before} → {after}","Image stored at {px} px — {before} → {after}": "Şekil {px} px-de saklandy — {before} → {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "Goýlanda suratlary kiçelt (2560 px; ekran suratlary we logotipler anyk galýar)",diff --git a/slides/src/i18n/packs/tr.ts b/slides/src/i18n/packs/tr.tsindex 8e46b0ee..937d7d71 100644--- a/slides/src/i18n/packs/tr.ts+++ b/slides/src/i18n/packs/tr.ts@@ -886,6 +886,12 @@ export const strings: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "Sayfa numarası, tarih, saat, başlık ve belge özellikleri — slayt gösterildiğinde çözümlenir. Tarih ve saat bir biçim sabitleyebilir: {{date:M/D/YY}}; deseni metinde düzenleyin.","Text ▸ Field": "Metin ▸ Alan","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "Sayfa numarası, tarih, saat, başlık veya bir belge özelliği ekler; tarih biçimini sabitleyebilir — {{date:M/D/YY}}",+ "Crop": "Kırpma",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "Resmi çerçevesi içinde taşımak için çift tıklayın; yakınlaştırmak için kaydırın veya sıkıştırın.",+ "✎ Edit crop on canvas": "✎ Kırpmayı tuvalde düzenle",+ "Reset crop": "Kırpmayı sıfırla",+ "Show the whole picture again, the way Fit says": "Sığdır ayarının dediği gibi resmin tamamını yeniden göster",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "Kırpma — resmi çerçevesi içinde taşımak için sürükleyin · yakınlaştırmak için kaydırın veya sıkıştırın · Enter korur · Esc geri alır","Photo stored at {px} px — {before} → {after}": "Fotoğraf {px} px olarak kaydedildi — {before} → {after}","Image stored at {px} px — {before} → {after}": "Görsel {px} px olarak kaydedildi — {before} → {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "Eklerken fotoğrafları küçült (2560 px; ekran görüntüleri ve logolar keskin kalır)",diff --git a/slides/src/i18n/packs/uk.ts b/slides/src/i18n/packs/uk.tsindex b28b49a0..d999f1fb 100644--- a/slides/src/i18n/packs/uk.ts+++ b/slides/src/i18n/packs/uk.ts@@ -895,6 +895,12 @@ export const strings: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "Номер сторінки, дата, час, назва та властивості документа — підставляються під час показу слайда. Дата й час можуть закріпити формат: {{date:M/D/YY}}; шаблон редагується в тексті.","Text ▸ Field": "Текст ▸ Поле","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "Вставляє номер сторінки, дату, час, назву або властивість документа; дата може закріпити свій формат — {{date:M/D/YY}}",+ "Crop": "Кадрування",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "Двічі клацніть зображення, щоб зсунути його всередині рамки; прокрутка або щипок — масштаб.",+ "✎ Edit crop on canvas": "✎ Змінити кадрування на полотні",+ "Reset crop": "Скинути кадрування",+ "Show the whole picture again, the way Fit says": "Знову показати все зображення, як задано в «Припасуванні»",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "Кадрування — тягніть, щоб зсунути зображення всередині рамки · прокрутка або щипок — масштаб · Enter зберігає · Esc повертає","Photo stored at {px} px — {before} → {after}": "Фото збережено в {px} px — {before} → {after}","Image stored at {px} px — {before} → {after}": "Зображення збережено в {px} px — {before} → {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "Зменшувати фото під час вставлення (2560 px; знімки екрана й логотипи лишаються чіткими)",diff --git a/slides/src/i18n/packs/ur.ts b/slides/src/i18n/packs/ur.tsindex 909db77a..c459bb70 100644--- a/slides/src/i18n/packs/ur.ts+++ b/slides/src/i18n/packs/ur.ts@@ -905,6 +905,12 @@ export const strings: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "صفحہ نمبر، تاریخ، وقت، عنوان اور دستاویز کی خصوصیات — سلائیڈ دکھاتے وقت حل ہوتی ہیں۔ تاریخ اور وقت فارمیٹ مقرر کر سکتے ہیں: {{date:M/D/YY}}؛ پیٹرن متن میں ترمیم کریں۔","Text ▸ Field": "متن ▸ فیلڈ","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "صفحہ نمبر، تاریخ، وقت، عنوان یا دستاویز کی خصوصیت داخل کریں؛ تاریخ اپنا فارمیٹ مقرر کر سکتی ہے — {{date:M/D/YY}}",+ "Crop": "کراپ",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "تصویر کو فریم کے اندر ہلانے کے لیے اس پر ڈبل کلک کریں؛ زوم کے لیے اسکرول یا پنچ کریں۔",+ "✎ Edit crop on canvas": "✎ کینوس پر کراپ میں ترمیم",+ "Reset crop": "کراپ ری سیٹ کریں",+ "Show the whole picture again, the way Fit says": "پوری تصویر دوبارہ دکھائیں، جیسا فٹ کہتا ہے",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "کراپ — فریم کے اندر تصویر ہلانے کے لیے گھسیٹیں · زوم کے لیے اسکرول یا پنچ · Enter رکھتا ہے · Esc واپس کرتا ہے","Photo stored at {px} px — {before} → {after}": "تصویر {px} px پر محفوظ — {before} → {after}","Image stored at {px} px — {before} → {after}": "امیج {px} px پر محفوظ — {before} → {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "داخل کرتے وقت تصاویر چھوٹی کریں (2560 px؛ اسکرین شاٹ اور لوگو واضح رہتے ہیں)",diff --git a/slides/src/i18n/packs/vi.ts b/slides/src/i18n/packs/vi.tsindex 15cc8aaf..328ea691 100644--- a/slides/src/i18n/packs/vi.ts+++ b/slides/src/i18n/packs/vi.ts@@ -885,6 +885,12 @@ export const strings: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "Số trang, ngày, giờ, tiêu đề và thuộc tính tài liệu — được điền khi hiển thị trang chiếu. Ngày và giờ có thể cố định định dạng: {{date:M/D/YY}}; sửa mẫu ngay trong văn bản.","Text ▸ Field": "Văn bản ▸ Trường","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "Chèn số trang, ngày, giờ, tiêu đề hoặc thuộc tính tài liệu; ngày có thể cố định định dạng — {{date:M/D/YY}}",+ "Crop": "Cắt",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "Nhấp đúp vào hình để di chuyển nó bên trong khung; cuộn hoặc chụm để thu phóng.",+ "✎ Edit crop on canvas": "✎ Sửa vùng cắt trên khung vẽ",+ "Reset crop": "Đặt lại vùng cắt",+ "Show the whole picture again, the way Fit says": "Hiện lại toàn bộ hình, theo cách Vừa khung quy định",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "Cắt — kéo để di chuyển hình bên trong khung · cuộn hoặc chụm để thu phóng · Enter để giữ · Esc để trả lại","Photo stored at {px} px — {before} → {after}": "Ảnh chụp được lưu ở {px} px — {before} → {after}","Image stored at {px} px — {before} → {after}": "Hình được lưu ở {px} px — {before} → {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "Thu nhỏ ảnh khi chèn (2560 px; ảnh chụp màn hình và logo vẫn sắc nét)",diff --git a/slides/src/i18n/pt.ts b/slides/src/i18n/pt.tsindex aacb5101..62b1493d 100644--- a/slides/src/i18n/pt.ts+++ b/slides/src/i18n/pt.ts@@ -873,6 +873,12 @@ export const pt: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "Número da página, data, hora, título e propriedades do documento — resolvidos quando o diapositivo é mostrado. Data e hora podem fixar um formato: {{date:M/D/YY}}; edite o padrão no texto.","Text ▸ Field": "Texto ▸ Campo","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "Insere o número da página, a data, a hora, o título ou uma propriedade do documento; uma data pode fixar o seu formato — {{date:M/D/YY}}",+ "Crop": "Recorte",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "Faça duplo clique na imagem para a mover dentro da moldura; desloque ou belisque para ampliar.",+ "✎ Edit crop on canvas": "✎ Editar recorte na tela",+ "Reset crop": "Repor recorte",+ "Show the whole picture again, the way Fit says": "Mostrar de novo toda a imagem, como indica Ajuste",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "Recorte — arraste para mover a imagem dentro da moldura · desloque ou belisque para ampliar · Enter mantém · Esc repõe","Photo stored at {px} px — {before} → {after}": "Foto guardada a {px} px — {before} → {after}","Image stored at {px} px — {before} → {after}": "Imagem guardada a {px} px — {before} → {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "Reduzir fotos ao inserir (2560 px; capturas e logótipos mantêm-se nítidos)",diff --git a/slides/src/i18n/zh-Hans.ts b/slides/src/i18n/zh-Hans.tsindex ffe108b9..0ed5a382 100644--- a/slides/src/i18n/zh-Hans.ts+++ b/slides/src/i18n/zh-Hans.ts@@ -875,6 +875,12 @@ export const zhHans: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "页码、日期、时间、标题和文档属性 — 在显示幻灯片时解析。日期和时间可固定格式:{{date:M/D/YY}};在文本中编辑模式。","Text ▸ Field": "文本 ▸ 字段","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "插入页码、日期、时间、标题或文档属性;日期可固定格式 — {{date:M/D/YY}}",+ "Crop": "裁剪",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "双击图片可在框内移动它;滚动或捏合可缩放。",+ "✎ Edit crop on canvas": "✎ 在画布上编辑裁剪",+ "Reset crop": "重置裁剪",+ "Show the whole picture again, the way Fit says": "按“适应”方式重新显示整张图片",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "裁剪 — 拖动可在框内移动图片 · 滚动或捏合可缩放 · Enter 保留 · Esc 还原","Photo stored at {px} px — {before} → {after}": "照片已按 {px} px 存储 — {before} → {after}","Image stored at {px} px — {before} → {after}": "图片已按 {px} px 存储 — {before} → {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "插入时缩小照片(2560 px,截图和徽标保持清晰)",diff --git a/slides/src/i18n/zh-Hant.ts b/slides/src/i18n/zh-Hant.tsindex 7761bbf3..18b1c346 100644--- a/slides/src/i18n/zh-Hant.ts+++ b/slides/src/i18n/zh-Hant.ts@@ -875,6 +875,12 @@ export const zhHant: Catalog = {"Page number, date, time, title and the document properties — resolved when the slide is shown. Date and time can pin a format: {{date:M/D/YY}}; edit the pattern in the text.": "頁碼、日期、時間、標題和文件屬性 — 在顯示投影片時解析。日期和時間可固定格式:{{date:M/D/YY}};在文字中編輯樣式。","Text ▸ Field": "文字 ▸ 欄位","Insert the page number, date, time, title or a document property; a date can pin its format — {{date:M/D/YY}}": "插入頁碼、日期、時間、標題或文件屬性;日期可固定格式 — {{date:M/D/YY}}",+ "Crop": "裁切",+ "Double-click the picture to move it inside its frame; scroll or pinch to zoom.": "按兩下圖片可在框內移動它;捲動或捏合可縮放。",+ "✎ Edit crop on canvas": "✎ 在畫布上編輯裁切",+ "Reset crop": "重設裁切",+ "Show the whole picture again, the way Fit says": "按「符合」方式重新顯示整張圖片",+ "Crop — drag to move the picture inside its frame · scroll or pinch to zoom · Enter to keep · Esc to put it back": "裁切 — 拖曳可在框內移動圖片 · 捲動或捏合可縮放 · Enter 保留 · Esc 還原","Photo stored at {px} px — {before} → {after}": "照片已以 {px} px 儲存 — {before} → {after}","Image stored at {px} px — {before} → {after}": "圖片已以 {px} px 儲存 — {before} → {after}","Shrink photos on insert (2560 px, screenshots and logos stay sharp)": "插入時縮小照片(2560 px,截圖與標誌保持清晰)",diff --git a/slides/src/model.ts b/slides/src/model.tsindex ea3d5263..36b52381 100644--- a/slides/src/model.ts+++ b/slides/src/model.ts@@ -241,6 +241,21 @@ export interface ConnectorEnd {side?: 'auto' | 'top' | 'right' | 'bottom' | 'left'}+/**+ * Which part of a picture shows inside its frame (discussion #319). The frame+ * is the element box; the picture is scaled to COVER it, then `scale` (≥ 1)+ * enlarges it further and `x`/`y` (0..1) say which edge of the enlarged+ * picture the frame is aligned to — 0 = left/top, 0.5 = centred, 1 =+ * right/bottom. Absent = the element's `fit` alone, exactly as before, so a+ * shell that predates this field shows the whole cover-fitted picture+ * (centred) and never a blank frame. Rendered with plain CSS (crop.ts).+ */+export interface ImageCrop {+ x: number+ y: number+ scale: number+}+export interface ImageElement extends ElementBase {type: 'image'/** data: URI, or "asset:<key>" referencing doc.assets */@@ -252,6 +267,8 @@ export interface ImageElement extends ElementBase {* can be stretched, and Shift holds the ratio for one drag instead.* Re-locking keeps whatever shape the image has at that moment. */keepAspectRatio?: boolean+ /** pan + zoom inside the frame; absent = `fit` alone (crop.ts) */+ crop?: ImageCrop}export interface SvgElement extends ElementBase {diff --git a/slides/src/modelkeys.generated.ts b/slides/src/modelkeys.generated.tsindex e9a77f5f..a3a4ec1b 100644--- a/slides/src/modelkeys.generated.ts+++ b/slides/src/modelkeys.generated.ts@@ -16,7 +16,7 @@ export const MODEL_KEYS = {"element": {"text": ["align", "backdropFilter", "blend", "blur", "color", "colorGradient", "fontFamily", "fontSize", "fontWeight", "fx", "group", "groupId", "h", "html", "id", "letterSpacing", "lineHeight", "link", "morphId", "opacity", "placeholder", "role", "rotation", "shadow", "showOnHover", "textStroke", "themeRefs", "type", "valign", "w", "x", "y"],"shape": ["backdropFilter", "blend", "blur", "d", "fill", "fillGradient", "from", "fx", "group", "groupId", "h", "id", "lineEnd", "lineStart", "link", "morphId", "opacity", "pathBox", "radius", "role", "rotation", "shadow", "shape", "showOnHover", "stroke", "strokeDash", "strokeStyle", "strokeWidth", "themeRefs", "to", "type", "w", "x", "y"],- "image": ["backdropFilter", "blend", "blur", "fit", "fx", "group", "groupId", "h", "id", "keepAspectRatio", "link", "morphId", "opacity", "radius", "role", "rotation", "shadow", "showOnHover", "src", "themeRefs", "type", "w", "x", "y"],+ "image": ["backdropFilter", "blend", "blur", "crop", "fit", "fx", "group", "groupId", "h", "id", "keepAspectRatio", "link", "morphId", "opacity", "radius", "role", "rotation", "shadow", "showOnHover", "src", "themeRefs", "type", "w", "x", "y"],"svg": ["asset", "backdropFilter", "blend", "blur", "css", "fx", "group", "groupId", "h", "id", "link", "markup", "morphId", "opacity", "role", "rotation", "shadow", "showOnHover", "themeRefs", "type", "w", "x", "y"],"chart": ["backdropFilter", "blend", "blur", "fx", "group", "groupId", "h", "id", "link", "morphId", "opacity", "option", "preset", "role", "rotation", "shadow", "showOnHover", "source", "themeRefs", "type", "w", "x", "y"],"table": ["backdropFilter", "blend", "blur", "columns", "fx", "group", "groupId", "h", "header", "id", "link", "morphId", "opacity", "role", "rotation", "rows", "shadow", "showOnHover", "style", "themeRefs", "type", "w", "x", "y"],@@ -32,6 +32,7 @@ export const MODEL_KEYS = {"tableRow": ["cells"],"tableCell": ["align", "bg", "bold", "color", "html"],"gradient": ["angle", "stops"],+ "imageCrop": ["scale", "x", "y"],} as constexport type ElementKind = keyof typeof MODEL_KEYS.elementdiff --git a/slides/src/present.ts b/slides/src/present.tsindex f4f574e4..c83dc05a 100644--- a/slides/src/present.ts+++ b/slides/src/present.ts@@ -11,6 +11,7 @@ import { chartSnapshotSvg, mountChart } from './charts'import type { BentoDoc, GradientFill, ShapeElement, Slide, SlideElement } from './model'import { morphKey, paginates, inLinearFlow, isWebUrl } from './model'import { applyElementFrame, gradientLineCoords, renderSlide } from './render'+import { cropImgStyle, isIdentityCrop, lerpCrop } from './crop'import { paintSpeaker, setSpeakerWindow, speakerIdleBody, speakerWindow } from './screens'import { ICONS } from './icons'import { t } from './i18n'@@ -2350,6 +2351,22 @@ function runMorph(anim.fromTo(inner, { color: a.color }, { color: b.color, duration: MORPH_DURATION, ease: MORPH_EASE })}}+ // A picture's crop (pan + zoom inside its frame) tweens numerically when+ // BOTH sides carry one — the house style, same as the box above. When only+ // one side has a crop there is no honest midpoint between "the whole+ // cover-fitted picture as `fit` says" and a window into it, so the crop+ // snaps with the slide and only the box morphs (crop.ts lerpCrop).+ if (a.type === 'image' && b.type === 'image' && a.crop && b.crop && !isIdentityCrop(a.crop) && !isIdentityCrop(b.crop)) {+ const img = to.querySelector<HTMLImageElement>('img')+ if (img) {+ const state = { p: 0 }+ anim.to(state, {+ p: 1, duration: MORPH_DURATION, ease: MORPH_EASE,+ onUpdate() { img.style.cssText = cropImgStyle(lerpCrop(a.crop!, b.crop!, state.p)) },+ onComplete() { img.style.cssText = cropImgStyle(b.crop!) },+ })+ }+ }}}diff --git a/slides/src/render.ts b/slides/src/render.tsindex ede53d9d..31e73cdd 100644--- a/slides/src/render.ts+++ b/slides/src/render.ts@@ -10,6 +10,7 @@ import { chartSnapshotSvg } from './charts'import temml from 'temml'import { renderCodeInto } from './code'import { formatDate } from './datefmt'+import { cropImgStyle, isIdentityCrop } from './crop'const SVG_NS = 'http://www.w3.org/2000/svg'@@ -1141,7 +1142,16 @@ export function renderElement(el: SlideElement, doc: BentoDoc, opts: RenderOptsif (imgSrc) img.src = imgSrcelse img.dataset.bentoOffline = '1'img.draggable = false- img.style.cssText = `width:100%;height:100%;object-fit:${el.fit};border-radius:${el.radius}px;display:block`+ if (el.crop && !isIdentityCrop(el.crop)) {+ // A crop: the frame clips and carries the radius; the picture inside+ // is enlarged and offset by the one mapping in crop.ts (canvas,+ // thumbnails, present, print and the preview all come through here).+ node.style.overflow = 'hidden'+ node.style.borderRadius = `${el.radius}px`+ img.style.cssText = cropImgStyle(el.crop)+ } else {+ img.style.cssText = `width:100%;height:100%;object-fit:${el.fit};border-radius:${el.radius}px;display:block`+ }node.appendChild(img)break}diff --git a/slides/src/untrusted.ts b/slides/src/untrusted.tsindex fa3e4b1a..8734bc21 100644--- a/slides/src/untrusted.ts+++ b/slides/src/untrusted.ts@@ -415,6 +415,7 @@ const ELEMENT_CHECKS: Record<string, Check> = {// image / svg / mediasrc: mediaRef, poster: mediaRef, asset: cssValue(),fit: oneOf('contain', 'cover', 'fill'), keepAspectRatio: bool,+ crop: shape(MODEL_KEYS.imageCrop, { x: num(0, 1), y: num(0, 1), scale: num(1, 64) }, ['x', 'y', 'scale']),markup: str(LIMITS.markup), css: str(LIMITS.css),kind: oneOf('video', 'audio'),autoplay: bool, loop: bool, muted: bool, controls: bool,