Skip to content

armgit / bento

Public Imported from GitHub
0

Bento, the office suite that fits in a file

slides: an image can keep or drop its aspect ratio; the properties panel keeps its scroll position (#372)

Li Wei2dafe7169a8b
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index ae568bec..0a7618a3 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1353,6 +1353,13 @@ jobs:
# routes the argument. Bare {{date}} stays viewer-locale (#381).
run: node scripts/test-slides-fields.ts
+ - name: Image aspect-ratio lock rig
+ # keepAspectRatio (#372): absent = locked, so old files resize as
+ # before; Shift is the one-drag exception either way; re-locking
+ # deletes the field and keeps the current shape; unlocking sets
+ # fit:'fill'. Also holds the set-aside parts of #372 out of the tree.
+ run: node scripts/test-slides-aspect-lock.ts
+
- name: Web links and bullets rig
# A link is one thing in four places — isWebUrl — and every surface
# that lets a URL in or out asks it: the shape gate, the text
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e36d671b..2f681280 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,17 @@ pre-1.0.
## [Unreleased]
+- **An image can drop its aspect ratio, and the properties panel stays
+ where you left it.** Contributed by 1eevy (#372). Images gain a *Keep
+ aspect ratio* switch in the Fit & corners section, on by default: turn it
+ off and width and height resize independently (the image stretches to
+ fill); Shift is the one-drag exception in either direction, as it always
+ was. Turning it back on keeps the shape the image has at that moment. And
+ changing a control near the bottom of the properties panel no longer throws
+ the panel back to the top. The same PR proposed editable template pages
+ with locked furniture and a save-time asset compactor; the compactor's job
+ landed as #447/#476, and locked furniture is a design question for a
+ discussion rather than a change to how layouts work.
- **A date can pin its format, and fields are one click away.** `{{date}}`
and `{{time}}` have resolved in text since 0.9.12, but they followed the
viewer's locale — an author could not say M/D/YY and have every viewer see
diff --git a/scripts/test-slides-aspect-lock.ts b/scripts/test-slides-aspect-lock.ts
new file mode 100644
index 00000000..051d7311
--- /dev/null
+++ b/scripts/test-slides-aspect-lock.ts
@@ -0,0 +1,69 @@
+#!/usr/bin/env node
+// SPDX-License-Identifier: MIT
+// Copyright (c) 2026 The Bento authors
+// Image aspect-ratio lock (#372): `keepAspectRatio` on an image element.
+//
+// node scripts/test-slides-aspect-lock.ts
+//
+// WHAT THIS PROVES. The field is additive — absent means locked, which is
+// what every image did before, so old files resize exactly as they did. The
+// canvas reads the element's own setting and Shift is the one-drag exception
+// in either direction; the panel toggle deletes the field when re-locking
+// (never writes `true`) and sets fit:'fill' when unlocking so a stretch is
+// visible; the shape gate lets the key through; and the parts of #372 that
+// were set aside (template locking, asset compaction, a kernel hook) are not
+// in the tree.
+
+import { readFileSync, existsSync } from 'node:fs'
+import { fileURLToPath } from 'node:url'
+import { dirname, join } from 'node:path'
+
+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}`)
+}
+const root = join(dirname(fileURLToPath(import.meta.url)), '..')
+const read = (f: string) => readFileSync(join(root, f), 'utf8')
+
+console.log('the model\n')
+const model = read('slides/src/model.ts')
+const image = model.slice(model.indexOf('export interface ImageElement'), model.indexOf('export interface SvgElement'))
+ok(/keepAspectRatio\?: boolean/.test(image), 'ImageElement.keepAspectRatio is optional — absent is a valid, meaningful value')
+ok(/[Aa]bsent or true/.test(image), 'the doc comment says absent = locked')
+ok(/keepAspectRatio: bool/.test(read('slides/src/untrusted.ts')), 'the shape gate admits the key as a boolean (an untrusted file keeps its setting)')
+ok(/keepAspectRatio/.test(read('slides/src/modelkeys.generated.ts')), 'the generated model keys carry it (validate() will not flag it as unknown)')
+
+console.log('\nthe canvas\n')
+const canvas = read('slides/src/editor/canvas.ts')
+const sync = canvas.slice(canvas.indexOf('const syncKeepRatio ='), canvas.indexOf("mv.on('resizeStart'"))
+ok(/el\?\.type === 'image' && el\.keepAspectRatio !== false/.test(sync), 'locked = an image whose field is absent or true')
+ok(/inputEvent\?\.shiftKey \? !locked : locked/.test(sync), 'Shift inverts the element\'s own setting — frees a locked image, holds an unlocked one')
+ok(/syncKeepRatio\(e\.inputEvent as MouseEvent, e\.target as HTMLElement\)/.test(canvas.slice(canvas.indexOf("mv.on('resizeStart'"), canvas.indexOf("mv.on('resizeGroupStart'"))), 'resizeStart and resize both pass the target so the element is looked up')
+// non-image elements: locked is false, so want = shiftKey — exactly the old rule
+ok(/const locked = el\?\.type === 'image'/.test(sync), 'a shape or text box is never "locked": Shift keeps the ratio, as before')
+
+console.log('\nthe panel\n')
+const panels = read('slides/src/editor/panels.ts')
+const img = panels.slice(panels.indexOf('private buildImageProps'), panels.indexOf('private buildImageProps') + 2500)
+ok(/this\.row\('Keep aspect ratio', this\.toggle\(\(el as ImageElement\)\.keepAspectRatio !== false/.test(img), 'the toggle reads absent as on')
+ok(/if \(on\) delete e\.keepAspectRatio/.test(img), 're-locking DELETES the field — never writes true, so a re-locked file equals an untouched one')
+ok(/else \{ e\.keepAspectRatio = false; e\.fit = 'fill' \}/.test(img), 'unlocking writes false and fit:\'fill\' so the stretch shows')
+ok(!/e\.w =|e\.h =/.test(img.slice(img.indexOf("'Keep aspect ratio'"))), 'the toggle never moves or resizes the frame — re-locking keeps the current shape')
+ok(/'Keep aspect ratio': '/.test(panels), 'the row has a tooltip')
+
+console.log('\nthe panel keeps its scroll\n')
+const rebuild = panels.slice(panels.indexOf('private rebuild(force = false)'), panels.indexOf('CLOSED_BY_DEFAULT'))
+ok(/const scrollTop = force \? 0 : this\.host\.scrollTop/.test(rebuild), 'a doc edit remembers the scroll; a selection/slide switch (force) starts at the top')
+ok(/this\.applyAccordion\(\)\s*\n\s*this\.host\.scrollTop = scrollTop/.test(rebuild), 'the scroll is restored after the accordion runs (which can change the height)')
+
+console.log('\nwhat was set aside stays out\n')
+for (const f of ['slides/src/model.ts', 'slides/src/render.ts', 'slides/src/editor/canvas.ts', 'slides/src/editor/editor.ts', 'slides/src/editor/panels.ts', 'slides/src/main.ts', 'kernel/src/save.ts', 'slides/src/styles.css']) {
+ ok(!/templateLocked|templateEditOf|compactDocumentAssets|registerSerializePrepare/.test(read(f)), `${f} carries none of the set-aside parts`)
+}
+ok(!existsSync(join(root, 'slides/src/compact-assets.ts')), 'compact-assets.ts does not exist (#447/#476 own asset pruning)')
+
+console.log(`\n${checks - failures}/${checks} checks passed`)
+process.exit(failures ? 1 : 0)
diff --git a/slides/src/editor/canvas.ts b/slides/src/editor/canvas.ts
index bbe839c8..7f17b591 100644
--- a/slides/src/editor/canvas.ts
+++ b/slides/src/editor/canvas.ts
@@ -1110,16 +1110,21 @@ export class SlideCanvas {
target.style.top = `${top}px`
}
}
- const syncKeepRatio = (inputEvent: MouseEvent | undefined) => {
- const want = !!inputEvent?.shiftKey
+ // Shift keeps the ratio — except for an image, whose own setting is the
+ // default and Shift is the one-drag exception either way: a locked image
+ // (keepAspectRatio absent/true) is freed by Shift, an unlocked one held.
+ const syncKeepRatio = (inputEvent: MouseEvent | undefined, target: HTMLElement) => {
+ const el = target.dataset.elId ? this.store.element(target.dataset.elId) : undefined
+ const locked = el?.type === 'image' && el.keepAspectRatio !== false
+ const want = inputEvent?.shiftKey ? !locked : locked
if (mv.keepRatio !== want) mv.keepRatio = want
}
mv.on('resizeStart', (e) => {
- syncKeepRatio(e.inputEvent as MouseEvent)
+ syncKeepRatio(e.inputEvent as MouseEvent, e.target as HTMLElement)
noteResizeStart(e.target as HTMLElement)
})
mv.on('resize', (e) => {
- syncKeepRatio(e.inputEvent as MouseEvent)
+ syncKeepRatio(e.inputEvent as MouseEvent, e.target as HTMLElement)
applyResize(e.target as HTMLElement, e.width, e.height, e.drag.left, e.drag.top, e.inputEvent as MouseEvent)
})
mv.on('resizeGroupStart', (e) => e.events.forEach((ev) => noteResizeStart(ev.target as HTMLElement)))
diff --git a/slides/src/editor/panels.ts b/slides/src/editor/panels.ts
index 51c1fb37..6eb26c9e 100644
--- a/slides/src/editor/panels.ts
+++ b/slides/src/editor/panels.ts
@@ -5,7 +5,7 @@
// into a single undo checkpoint.
import type { Store } from '../store'
-import { MEDIA_EMBED_BUDGET, applyChartPalette, defaultChart, internAsset, morphKey, paginates, isWebUrl, tableStyleFor, uid, type ChartElement, 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 { 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 { LANGS } from '../../../kernel/src/tokenize.ts'
import { resolveAsset } from '../render'
import { measureElement } from '../measure'
@@ -84,6 +84,7 @@ const ROW_TIPS: Record<string, string> = {
'Start tip': 'Decoration at the line’s start — arrow, dot or bar',
'End tip': 'Decoration at the line’s end — arrow, dot or bar',
'Corner radius': 'How rounded the corners are, in pixels',
+ 'Keep aspect ratio': 'On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches',
'Type': 'Chart type — switching bar⇄pie animates the data across',
'Legend': 'Show the series legend above the chart',
'Second axis': 'Adds a right-hand value axis — assign series to it in the list below',
@@ -191,12 +192,18 @@ export class PropsPanel {
}
this.stale = false
this.burst = false
+ // A doc edit rebuilds the same inspector in place: keep its scroll so a
+ // control near the bottom does not throw the panel back to the top on
+ // every change. A selection or slide switch (force) starts the new
+ // inspector at the top, which is where a different subject belongs.
+ const scrollTop = force ? 0 : this.host.scrollTop
this.host.innerHTML = ''
const els = this.store.selectedElements
if (els.length === 0) this.buildSlidePanel()
else if (els.length === 1) this.buildElementPanel(els[0])
else this.buildMultiPanel(els)
this.applyAccordion()
+ this.host.scrollTop = scrollTop
}
/** Collapsed by default until the user opens them (persisted per title). */
@@ -1781,6 +1788,17 @@ export class PropsPanel {
this.mutate(el.id, (e) => { (e as any).fit = v }, true)))
this.row('Corner radius', this.number((el as any).radius, 1, (v, fin) =>
this.mutate(el.id, (e) => { (e as any).radius = Math.max(v, 0) }, fin)))
+ // Off = width and height resize independently. Unlocking also sets
+ // fit:'fill' so the stretch is what the reader sees — contain/cover would
+ // letterbox the distortion away. Re-locking deletes the field (absent =
+ // locked, the format's default) and keeps the CURRENT shape: the next
+ // resize starts from whatever ratio the frame has now.
+ this.row('Keep aspect ratio', this.toggle((el as ImageElement).keepAspectRatio !== false, (on) =>
+ this.mutate(el.id, (e) => {
+ if (e.type !== 'image') return
+ if (on) delete e.keepAspectRatio
+ else { e.keepAspectRatio = false; e.fit = 'fill' }
+ }, true)))
}
private buildMediaProps(el: MediaElement) {
diff --git a/slides/src/i18n/de.ts b/slides/src/i18n/de.ts
index ef9d361d..506b769f 100644
--- a/slides/src/i18n/de.ts
+++ b/slides/src/i18n/de.ts
@@ -875,4 +875,6 @@ 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}}",
+ "Keep aspect ratio": "Seitenverhältnis beibehalten",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "An: Größenänderung behält die Proportionen des Bildes (Umschalt gibt sie für einen Zug frei). Aus: Breite und Höhe ändern sich unabhängig und das Bild wird gestreckt",
}
diff --git a/slides/src/i18n/es.ts b/slides/src/i18n/es.ts
index 6d8b59aa..3703dc2c 100644
--- a/slides/src/i18n/es.ts
+++ b/slides/src/i18n/es.ts
@@ -875,4 +875,6 @@ 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}}",
+ "Keep aspect ratio": "Mantener la proporción",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "Activado: al redimensionar se conservan las proporciones de la imagen (Mayús las libera durante un arrastre). Desactivado: ancho y alto cambian por separado y la imagen se estira",
}
diff --git a/slides/src/i18n/fr.ts b/slides/src/i18n/fr.ts
index bd4e518f..4acd5f90 100644
--- a/slides/src/i18n/fr.ts
+++ b/slides/src/i18n/fr.ts
@@ -875,4 +875,6 @@ 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}}",
+ "Keep aspect ratio": "Conserver les proportions",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "Activé : le redimensionnement conserve les proportions de l’image (Maj les libère le temps d’un glissement). Désactivé : largeur et hauteur changent séparément et l’image s’étire",
}
diff --git a/slides/src/i18n/it.ts b/slides/src/i18n/it.ts
index b47692bf..0f498a33 100644
--- a/slides/src/i18n/it.ts
+++ b/slides/src/i18n/it.ts
@@ -875,4 +875,6 @@ 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}}",
+ "Keep aspect ratio": "Mantieni le proporzioni",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "Attivo: il ridimensionamento conserva le proporzioni dell’immagine (Maiusc le libera per un trascinamento). Disattivo: larghezza e altezza cambiano separatamente e l’immagine si deforma",
}
diff --git a/slides/src/i18n/ja.ts b/slides/src/i18n/ja.ts
index bb77df7b..1f673e3a 100644
--- a/slides/src/i18n/ja.ts
+++ b/slides/src/i18n/ja.ts
@@ -875,4 +875,6 @@ 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}}",
+ "Keep aspect ratio": "縦横比を保つ",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "オン: サイズ変更で画像の比率を保ちます(Shift で一回のドラッグだけ解除)。オフ: 幅と高さを別々に変えられ、画像は引き伸ばされます",
}
diff --git a/slides/src/i18n/packed.ts b/slides/src/i18n/packed.ts
index f4c14095..426812f0 100644
--- a/slides/src/i18n/packed.ts
+++ b/slides/src/i18n/packed.ts
@@ -881,4 +881,6 @@ 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}}"],
+ "Keep aspect ratio": ["縦横比を保つ","保持宽高比","保持長寬比","Mantener la proporción","Conserver les proportions","Seitenverhältnis beibehalten","Mantieni le proporzioni","Manter proporções"],
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": ["オン: サイズ変更で画像の比率を保ちます(Shift で一回のドラッグだけ解除)。オフ: 幅と高さを別々に変えられ、画像は引き伸ばされます","开:调整大小时保持图片比例(按住 Shift 可临时解除一次拖动)。关:宽和高各自变化,图片会被拉伸","開:調整大小時保持圖片比例(按住 Shift 可暫時解除一次拖曳)。關:寬和高各自變化,圖片會被拉伸","Activado: al redimensionar se conservan las proporciones de la imagen (Mayús las libera durante un arrastre). Desactivado: ancho y alto cambian por separado y la imagen se estira","Activé : le redimensionnement conserve les proportions de l’image (Maj les libère le temps d’un glissement). Désactivé : largeur et hauteur changent séparément et l’image s’étire","An: Größenänderung behält die Proportionen des Bildes (Umschalt gibt sie für einen Zug frei). Aus: Breite und Höhe ändern sich unabhängig und das Bild wird gestreckt","Attivo: il ridimensionamento conserva le proporzioni dell’immagine (Maiusc le libera per un trascinamento). Disattivo: larghezza e altezza cambiano separatamente e l’immagine si deforma","Ligado: redimensionar mantém as proporções da imagem (Shift liberta-as durante um arrasto). Desligado: largura e altura mudam separadamente e a imagem estica"],
}
diff --git a/slides/src/i18n/packs/ar.ts b/slides/src/i18n/packs/ar.ts
index 4664f426..63973ca6 100644
--- a/slides/src/i18n/packs/ar.ts
+++ b/slides/src/i18n/packs/ar.ts
@@ -895,4 +895,6 @@ 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}}",
+ "Keep aspect ratio": "الحفاظ على نسبة الأبعاد",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "مفعّل: يحافظ تغيير الحجم على نسب الصورة (Shift يحرّرها لسحبة واحدة). معطّل: يتغير العرض والارتفاع باستقلال وتتمدد الصورة",
}
diff --git a/slides/src/i18n/packs/bn.ts b/slides/src/i18n/packs/bn.ts
index 2266a336..127eceb9 100644
--- a/slides/src/i18n/packs/bn.ts
+++ b/slides/src/i18n/packs/bn.ts
@@ -898,4 +898,6 @@ 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}}",
+ "Keep aspect ratio": "অনুপাত বজায় রাখুন",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "চালু: আকার বদলালে ছবির অনুপাত বজায় থাকে (Shift এক টানের জন্য মুক্ত করে)। বন্ধ: প্রস্থ ও উচ্চতা আলাদাভাবে বদলায় এবং ছবি টেনে বড় হয়",
}
diff --git a/slides/src/i18n/packs/da.ts b/slides/src/i18n/packs/da.ts
index 17bbf8e7..fddbdde2 100644
--- a/slides/src/i18n/packs/da.ts
+++ b/slides/src/i18n/packs/da.ts
@@ -887,4 +887,6 @@ 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}}",
+ "Keep aspect ratio": "Bevar størrelsesforhold",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "Til: ændring af størrelse bevarer billedets proportioner (Skift frigiver dem for ét træk). Fra: bredde og højde ændres uafhængigt, og billedet strækkes",
}
diff --git a/slides/src/i18n/packs/fa.ts b/slides/src/i18n/packs/fa.ts
index 6b58b17b..0e870be7 100644
--- a/slides/src/i18n/packs/fa.ts
+++ b/slides/src/i18n/packs/fa.ts
@@ -891,4 +891,6 @@ 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}}",
+ "Keep aspect ratio": "حفظ نسبت ابعاد",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "روشن: تغییر اندازه نسبت تصویر را حفظ می‌کند (Shift آن را برای یک کشیدن آزاد می‌کند). خاموش: عرض و ارتفاع مستقل تغییر می‌کنند و تصویر کشیده می‌شود",
}
diff --git a/slides/src/i18n/packs/fi.ts b/slides/src/i18n/packs/fi.ts
index 00e7a1d2..d977525d 100644
--- a/slides/src/i18n/packs/fi.ts
+++ b/slides/src/i18n/packs/fi.ts
@@ -892,4 +892,6 @@ 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}}",
+ "Keep aspect ratio": "Säilytä kuvasuhde",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "Päällä: koon muutos säilyttää kuvan mittasuhteet (Vaihto vapauttaa ne yhden vedon ajaksi). Pois: leveys ja korkeus muuttuvat erikseen ja kuva venyy",
}
diff --git a/slides/src/i18n/packs/fil.ts b/slides/src/i18n/packs/fil.ts
index 95e106dc..8b183918 100644
--- a/slides/src/i18n/packs/fil.ts
+++ b/slides/src/i18n/packs/fil.ts
@@ -904,4 +904,6 @@ 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}}",
+ "Keep aspect ratio": "Panatilihin ang aspect ratio",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "Naka-on: pinapanatili ng pag-resize ang proporsyon ng larawan (pinapalaya ito ng Shift sa isang drag). Naka-off: hiwalay na nagbabago ang lapad at taas at nababanat ang larawan",
}
diff --git a/slides/src/i18n/packs/he.ts b/slides/src/i18n/packs/he.ts
index 3848dd1d..cf54f707 100644
--- a/slides/src/i18n/packs/he.ts
+++ b/slides/src/i18n/packs/he.ts
@@ -888,4 +888,6 @@ 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}}",
+ "Keep aspect ratio": "שמירה על יחס גובה-רוחב",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "פעיל: שינוי גודל שומר על הפרופורציות של התמונה (Shift משחרר אותן לגרירה אחת). כבוי: רוחב וגובה משתנים בנפרד והתמונה נמתחת",
}
diff --git a/slides/src/i18n/packs/hi.ts b/slides/src/i18n/packs/hi.ts
index 822eddb1..eb312789 100644
--- a/slides/src/i18n/packs/hi.ts
+++ b/slides/src/i18n/packs/hi.ts
@@ -895,4 +895,6 @@ 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}}",
+ "Keep aspect ratio": "अनुपात बनाए रखें",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "चालू: आकार बदलने पर छवि का अनुपात बना रहता है (Shift एक खिंचाव के लिए मुक्त करता है)। बंद: चौड़ाई और ऊँचाई अलग-अलग बदलती हैं और छवि खिंचती है",
}
diff --git a/slides/src/i18n/packs/id.ts b/slides/src/i18n/packs/id.ts
index af245666..0e723aa2 100644
--- a/slides/src/i18n/packs/id.ts
+++ b/slides/src/i18n/packs/id.ts
@@ -885,4 +885,6 @@ 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}}",
+ "Keep aspect ratio": "Pertahankan rasio aspek",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "Aktif: mengubah ukuran mempertahankan proporsi gambar (Shift membebaskannya untuk satu seretan). Nonaktif: lebar dan tinggi berubah terpisah dan gambar meregang",
}
diff --git a/slides/src/i18n/packs/ko.ts b/slides/src/i18n/packs/ko.ts
index 3076aa92..a24d961c 100644
--- a/slides/src/i18n/packs/ko.ts
+++ b/slides/src/i18n/packs/ko.ts
@@ -879,4 +879,6 @@ 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}}",
+ "Keep aspect ratio": "가로세로 비율 유지",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "켜짐: 크기를 조절해도 이미지 비율이 유지됩니다 (Shift로 한 번의 드래그만 해제). 꺼짐: 너비와 높이가 따로 바뀌고 이미지가 늘어납니다",
}
diff --git a/slides/src/i18n/packs/ms.ts b/slides/src/i18n/packs/ms.ts
index c5a02b90..5b7db907 100644
--- a/slides/src/i18n/packs/ms.ts
+++ b/slides/src/i18n/packs/ms.ts
@@ -888,4 +888,6 @@ 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}}",
+ "Keep aspect ratio": "Kekalkan nisbah aspek",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "Hidup: mengubah saiz mengekalkan kadaran imej (Shift membebaskannya untuk satu seretan). Mati: lebar dan tinggi berubah secara berasingan dan imej meregang",
}
diff --git a/slides/src/i18n/packs/nb.ts b/slides/src/i18n/packs/nb.ts
index 4976ffe1..cc461a2e 100644
--- a/slides/src/i18n/packs/nb.ts
+++ b/slides/src/i18n/packs/nb.ts
@@ -889,4 +889,6 @@ 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}}",
+ "Keep aspect ratio": "Behold størrelsesforhold",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "På: endring av størrelse beholder bildets proporsjoner (Skift frigjør dem for ett drag). Av: bredde og høyde endres uavhengig, og bildet strekkes",
}
diff --git a/slides/src/i18n/packs/nl.ts b/slides/src/i18n/packs/nl.ts
index 241b3836..b0b49434 100644
--- a/slides/src/i18n/packs/nl.ts
+++ b/slides/src/i18n/packs/nl.ts
@@ -883,4 +883,6 @@ 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}}",
+ "Keep aspect ratio": "Verhouding behouden",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "Aan: bij het schalen blijven de verhoudingen van de afbeelding behouden (Shift geeft ze vrij voor één sleep). Uit: breedte en hoogte veranderen los van elkaar en de afbeelding rekt uit",
}
diff --git a/slides/src/i18n/packs/pl.ts b/slides/src/i18n/packs/pl.ts
index e7f76ca8..99eec6b3 100644
--- a/slides/src/i18n/packs/pl.ts
+++ b/slides/src/i18n/packs/pl.ts
@@ -886,4 +886,6 @@ 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}}",
+ "Keep aspect ratio": "Zachowaj proporcje",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "Włączone: zmiana rozmiaru zachowuje proporcje obrazu (Shift zwalnia je na jedno przeciągnięcie). Wyłączone: szerokość i wysokość zmieniają się niezależnie, a obraz się rozciąga",
}
diff --git a/slides/src/i18n/packs/ru.ts b/slides/src/i18n/packs/ru.ts
index b6eecce7..418bbe73 100644
--- a/slides/src/i18n/packs/ru.ts
+++ b/slides/src/i18n/packs/ru.ts
@@ -887,4 +887,6 @@ 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}}",
+ "Keep aspect ratio": "Сохранять пропорции",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "Вкл.: изменение размера сохраняет пропорции изображения (Shift освобождает их на одно перетаскивание). Выкл.: ширина и высота меняются независимо, изображение растягивается",
}
diff --git a/slides/src/i18n/packs/sv.ts b/slides/src/i18n/packs/sv.ts
index e138451d..995c5751 100644
--- a/slides/src/i18n/packs/sv.ts
+++ b/slides/src/i18n/packs/sv.ts
@@ -884,4 +884,6 @@ 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}}",
+ "Keep aspect ratio": "Behåll proportioner",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "På: storleksändring behåller bildens proportioner (Skift frigör dem för ett drag). Av: bredd och höjd ändras oberoende och bilden töjs",
}
diff --git a/slides/src/i18n/packs/th.ts b/slides/src/i18n/packs/th.ts
index 21cb7c75..4a868542 100644
--- a/slides/src/i18n/packs/th.ts
+++ b/slides/src/i18n/packs/th.ts
@@ -889,4 +889,6 @@ 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}}",
+ "Keep aspect ratio": "คงอัตราส่วนภาพ",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "เปิด: การปรับขนาดคงสัดส่วนของภาพ (กด Shift เพื่อปลดชั่วคราวหนึ่งครั้ง) ปิด: ความกว้างและความสูงเปลี่ยนแยกกัน ภาพจะถูกยืด",
}
diff --git a/slides/src/i18n/packs/tk.ts b/slides/src/i18n/packs/tk.ts
index ed611a0d..0a801c53 100644
--- a/slides/src/i18n/packs/tk.ts
+++ b/slides/src/i18n/packs/tk.ts
@@ -912,4 +912,6 @@ 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}}",
+ "Keep aspect ratio": "Taraplaryň gatnaşygyny sakla",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "Açyk: ölçeg üýtgedilende suratyň gatnaşygy saklanýar (Shift bir süýremek üçin boşadýar). Ýapyk: ini we beýikligi aýratyn üýtgeýär we surat çekilýär",
}
diff --git a/slides/src/i18n/packs/tr.ts b/slides/src/i18n/packs/tr.ts
index d226e5d1..fcb01512 100644
--- a/slides/src/i18n/packs/tr.ts
+++ b/slides/src/i18n/packs/tr.ts
@@ -886,4 +886,6 @@ 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}}",
+ "Keep aspect ratio": "En-boy oranını koru",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "Açık: yeniden boyutlandırma görselin oranını korur (Shift bir sürükleme için serbest bırakır). Kapalı: genişlik ve yükseklik bağımsız değişir ve görsel esner",
}
diff --git a/slides/src/i18n/packs/uk.ts b/slides/src/i18n/packs/uk.ts
index e896f66c..ab28925a 100644
--- a/slides/src/i18n/packs/uk.ts
+++ b/slides/src/i18n/packs/uk.ts
@@ -895,4 +895,6 @@ 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}}",
+ "Keep aspect ratio": "Зберігати пропорції",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "Увімк.: зміна розміру зберігає пропорції зображення (Shift звільняє їх на одне перетягування). Вимк.: ширина й висота змінюються незалежно, зображення розтягується",
}
diff --git a/slides/src/i18n/packs/ur.ts b/slides/src/i18n/packs/ur.ts
index 6e5c2623..79decb77 100644
--- a/slides/src/i18n/packs/ur.ts
+++ b/slides/src/i18n/packs/ur.ts
@@ -905,4 +905,6 @@ 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}}",
+ "Keep aspect ratio": "پہلو تناسب برقرار رکھیں",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "آن: سائز بدلنے پر تصویر کا تناسب برقرار رہتا ہے (Shift ایک ڈریگ کے لیے آزاد کرتا ہے)۔ آف: چوڑائی اور اونچائی الگ الگ بدلتی ہیں اور تصویر کھنچ جاتی ہے",
}
diff --git a/slides/src/i18n/packs/vi.ts b/slides/src/i18n/packs/vi.ts
index 5acfd4d6..faa58d0b 100644
--- a/slides/src/i18n/packs/vi.ts
+++ b/slides/src/i18n/packs/vi.ts
@@ -885,4 +885,6 @@ 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}}",
+ "Keep aspect ratio": "Giữ tỷ lệ khung hình",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "Bật: đổi kích thước giữ nguyên tỷ lệ ảnh (Shift bỏ giữ trong một lần kéo). Tắt: chiều rộng và chiều cao đổi độc lập và ảnh bị kéo giãn",
}
diff --git a/slides/src/i18n/pt.ts b/slides/src/i18n/pt.ts
index 1c3a524b..d0fdafe4 100644
--- a/slides/src/i18n/pt.ts
+++ b/slides/src/i18n/pt.ts
@@ -873,4 +873,6 @@ 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}}",
+ "Keep aspect ratio": "Manter proporções",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "Ligado: redimensionar mantém as proporções da imagem (Shift liberta-as durante um arrasto). Desligado: largura e altura mudam separadamente e a imagem estica",
}
diff --git a/slides/src/i18n/zh-Hans.ts b/slides/src/i18n/zh-Hans.ts
index 48cad1bc..9f87f280 100644
--- a/slides/src/i18n/zh-Hans.ts
+++ b/slides/src/i18n/zh-Hans.ts
@@ -875,4 +875,6 @@ 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}}",
+ "Keep aspect ratio": "保持宽高比",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "开:调整大小时保持图片比例(按住 Shift 可临时解除一次拖动)。关:宽和高各自变化,图片会被拉伸",
}
diff --git a/slides/src/i18n/zh-Hant.ts b/slides/src/i18n/zh-Hant.ts
index 51180167..9e76eb1d 100644
--- a/slides/src/i18n/zh-Hant.ts
+++ b/slides/src/i18n/zh-Hant.ts
@@ -875,4 +875,6 @@ 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}}",
+ "Keep aspect ratio": "保持長寬比",
+ "On: a resize keeps the image’s proportions (Shift frees it for one drag). Off: width and height move independently and the image stretches": "開:調整大小時保持圖片比例(按住 Shift 可暫時解除一次拖曳)。關:寬和高各自變化,圖片會被拉伸",
}
diff --git a/slides/src/model.ts b/slides/src/model.ts
index 6071cfbd..ea3d5263 100644
--- a/slides/src/model.ts
+++ b/slides/src/model.ts
@@ -247,6 +247,11 @@ export interface ImageElement extends ElementBase {
src: string
fit: 'contain' | 'cover' | 'fill'
radius: number
+ /** Absent or true: a resize keeps the image's proportions (Shift frees it
+ * for one drag). false: width and height move independently — the frame
+ * 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
}
export interface SvgElement extends ElementBase {
diff --git a/slides/src/modelkeys.generated.ts b/slides/src/modelkeys.generated.ts
index b7f0e782..e9a77f5f 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", "link", "morphId", "opacity", "radius", "role", "rotation", "shadow", "showOnHover", "src", "themeRefs", "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"],
"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"],
diff --git a/slides/src/untrusted.ts b/slides/src/untrusted.ts
index c16dd02c..fa3e4b1a 100644
--- a/slides/src/untrusted.ts
+++ b/slides/src/untrusted.ts
@@ -414,7 +414,7 @@ const ELEMENT_CHECKS: Record<string, Check> = {
from: connectorEnd, to: connectorEnd,
// image / svg / media
src: mediaRef, poster: mediaRef, asset: cssValue(),
- fit: oneOf('contain', 'cover', 'fill'),
+ fit: oneOf('contain', 'cover', 'fill'), keepAspectRatio: bool,
markup: str(LIMITS.markup), css: str(LIMITS.css),
kind: oneOf('video', 'audio'),
autoplay: bool, loop: bool, muted: bool, controls: bool,