changed zoom shortcut to ctrl+up & ctrl+down, savetoPDF to alt+s

This commit is contained in:
Jeff-Emmett 2025-02-25 15:24:41 -05:00
parent 7d6afb6c6b
commit 59e9025336
2 changed files with 10 additions and 89 deletions

View File

@ -97,7 +97,7 @@ export function CustomContextMenu(props: TLUiContextMenuProps) {
id="save-to-pdf"
label="Save Selection as PDF"
icon="file"
kbd="alt+p"
kbd="alt+s"
disabled={!hasSelection}
onSelect={() => saveToPdf(editor)}
/>

View File

@ -147,6 +147,14 @@ export const overrides: TLUiOverrides = {
actions(editor, actions) {
return {
...actions,
"zoom-in": {
...actions["zoom-in"],
kbd: "ctrl+up",
},
"zoom-out": {
...actions["zoom-out"],
kbd: "ctrl+down",
},
zoomToSelection: {
id: "zoom-to-selection",
label: "Zoom to Selection",
@ -187,7 +195,7 @@ export const overrides: TLUiOverrides = {
saveToPdf: {
id: "save-to-pdf",
label: "Save Selection as PDF",
kbd: "alt+p",
kbd: "alt+s",
onSelect: () => {
if (editor.getSelectedShapeIds().length > 0) {
saveToPdf(editor)
@ -267,93 +275,6 @@ export const overrides: TLUiOverrides = {
}
},
},
// TODO: FIX THIS
resizeSelectedUp: {
id: "resize-selected-up",
label: "Resize Up",
kbd: "ctrl+ArrowUp",
onSelect: () => {
const selectedShapes = editor.getSelectedShapes()
if (selectedShapes.length > 0) {
selectedShapes.forEach((shape) => {
const bounds = editor.getShapeGeometry(shape).bounds
editor.updateShape({
id: shape.id,
type: shape.type,
//y: shape.y - 50,
props: {
...shape.props,
h: bounds.height + 50,
},
})
})
}
},
},
resizeSelectedDown: {
id: "resize-selected-down",
label: "Resize Down",
kbd: "ctrl+ArrowDown",
onSelect: () => {
const selectedShapes = editor.getSelectedShapes()
if (selectedShapes.length > 0) {
selectedShapes.forEach((shape) => {
const bounds = editor.getShapeGeometry(shape).bounds
editor.updateShape({
id: shape.id,
type: shape.type,
props: {
...shape.props,
h: bounds.height + 50,
},
})
})
}
},
},
resizeSelectedLeft: {
id: "resize-selected-left",
label: "Resize Left",
kbd: "ctrl+ArrowLeft",
onSelect: () => {
const selectedShapes = editor.getSelectedShapes()
if (selectedShapes.length > 0) {
selectedShapes.forEach((shape) => {
const bounds = editor.getShapeGeometry(shape).bounds
editor.updateShape({
id: shape.id,
type: shape.type,
props: {
...shape.props,
w: bounds.width + 50,
},
})
})
}
},
},
resizeSelectedRight: {
id: "resize-selected-right",
label: "Resize Right",
kbd: "ctrl+ArrowRight",
onSelect: () => {
const selectedShapes = editor.getSelectedShapes()
if (selectedShapes.length > 0) {
selectedShapes.forEach((shape) => {
const bounds = editor.getShapeGeometry(shape).bounds
editor.updateShape({
id: shape.id,
type: shape.type,
props: {
...shape.props,
w: bounds.width + 50,
},
})
})
}
},
},
//TODO: MAKE THIS WORK, ADD USER PERMISSIONING TO JOIN BROADCAST?
broadcastView: {
id: "broadcast-view",