diff --git a/tldraw/apps/tldraw-logseq/src/components/ActionBar/ActionBar.tsx b/tldraw/apps/tldraw-logseq/src/components/ActionBar/ActionBar.tsx index ff48e505757..9a999a34670 100644 --- a/tldraw/apps/tldraw-logseq/src/components/ActionBar/ActionBar.tsx +++ b/tldraw/apps/tldraw-logseq/src/components/ActionBar/ActionBar.tsx @@ -41,7 +41,7 @@ export const ActionBar = observer(function ActionBar(): JSX.Element { )} -
+
diff --git a/tldraw/apps/tldraw-logseq/src/components/ContextMenu/ContextMenu.tsx b/tldraw/apps/tldraw-logseq/src/components/ContextMenu/ContextMenu.tsx index 4e0f0d74850..0374485fe38 100644 --- a/tldraw/apps/tldraw-logseq/src/components/ContextMenu/ContextMenu.tsx +++ b/tldraw/apps/tldraw-logseq/src/components/ContextMenu/ContextMenu.tsx @@ -144,38 +144,38 @@ export const ContextMenu = observer(function ContextMenu({ {(app.selectedShapesArray.some(s => s.type === 'group' || app.getParentGroup(s)) || app.selectedShapesArray.length > 1) && !app.readOnly && ( - <> - {app.selectedShapesArray.some(s => s.type === 'group' || app.getParentGroup(s)) && ( - runAndTransition(app.api.unGroup)} - > - - Ungroup -
- - {MOD_KEY} G - -
-
- )} - {app.selectedShapesArray.length > 1 && ( - runAndTransition(app.api.doGroup)} - > - - Group -
- - {MOD_KEY} G - -
-
- )} - - - )} + <> + {app.selectedShapesArray.some(s => s.type === 'group' || app.getParentGroup(s)) && ( + runAndTransition(app.api.unGroup)} + > + + Ungroup +
+ + {MOD_KEY} G + +
+
+ )} + {app.selectedShapesArray.length > 1 && ( + runAndTransition(app.api.doGroup)} + > + + Group +
+ + {MOD_KEY} G + +
+
+ )} + + + )} {app.selectedShapes?.size > 0 && ( <> {!app.readOnly && ( @@ -288,30 +288,32 @@ export const ContextMenu = observer(function ContextMenu({ )} {!app.readOnly && ( <> - - runAndTransition(app.bringToFront)} - > - Move to front -
- - ] - -
-
- runAndTransition(app.sendToBack)} - > - Move to back -
- - [ - -
-
) - )} + + runAndTransition(app.bringToFront)} + > + Move to front +
+ + ] + +
+
+ runAndTransition(app.sendToBack)} + > + Move to back +
+ + [ + +
+
+ ) + + )} {developerMode && ( { - if ([...ids].includes(shapeA) && this.getShapeById(shapeB)?.type === "line") - ids.add(shapeB) + if ([...ids].includes(shapeA) && this.getShapeById(shapeB)?.type === 'line') ids.add(shapeB) } - this.currentPage.shapes + this.currentPage.shapes .flatMap(s => Object.values(s.props.handles ?? {})) .flatMap(h => h.bindingId) .filter(isNonNullable) @@ -391,7 +390,8 @@ export class TLApp< if (toId && fromId) { deleteBinding(toId, fromId) deleteBinding(fromId, toId) - }}) + } + }) const allShapesToDelete = [...ids].map(id => this.getShapeById(id)!) @@ -446,7 +446,7 @@ export class TLApp< } align = (type: AlignType, shapes: S[] = this.selectedShapesArray): this => { - if (shapes.length < 2 || this.readOnly) return this + if (shapes.length < 2 || this.readOnly) return this const boundsForShapes = shapes.map(shape => { const bounds = shape.getBounds() @@ -625,8 +625,7 @@ export class TLApp< } selectTool = (id: string, data: AnyObject = {}) => { - if (!this.readOnly || ['select', 'move'].includes(id) ) - this.transition(id, data) + if (!this.readOnly || ['select', 'move'].includes(id)) this.transition(id, data) } registerTools(tools: TLToolConstructor[]) { diff --git a/tldraw/packages/core/src/lib/TLHistory.ts b/tldraw/packages/core/src/lib/TLHistory.ts index 1e954268ee4..abfd612aa26 100644 --- a/tldraw/packages/core/src/lib/TLHistory.ts +++ b/tldraw/packages/core/src/lib/TLHistory.ts @@ -30,7 +30,7 @@ export class TLHistory { if (this.isPaused || this.creating) return - this.app.notify('persist', {replace}) + this.app.notify('persist', { replace }) } @action undo = () => { diff --git a/tldraw/packages/core/src/lib/tools/TLSelectTool/states/IdleState.ts b/tldraw/packages/core/src/lib/tools/TLSelectTool/states/IdleState.ts index da4624d320c..bc00031c647 100644 --- a/tldraw/packages/core/src/lib/tools/TLSelectTool/states/IdleState.ts +++ b/tldraw/packages/core/src/lib/tools/TLSelectTool/states/IdleState.ts @@ -147,7 +147,11 @@ export class IdleState< const { selectedShapesArray } = this.app switch (e.key) { case 'Enter': { - if (selectedShapesArray.length === 1 && selectedShapesArray[0].canEdit && !this.app.readOnly) { + if ( + selectedShapesArray.length === 1 && + selectedShapesArray[0].canEdit && + !this.app.readOnly + ) { this.tool.transition('editingShape', { type: TLTargetType.Shape, shape: selectedShapesArray[0], diff --git a/tldraw/packages/react/src/hooks/useAppSetup.ts b/tldraw/packages/react/src/hooks/useAppSetup.ts index 627ab29c839..d0ce8c10f44 100644 --- a/tldraw/packages/react/src/hooks/useAppSetup.ts +++ b/tldraw/packages/react/src/hooks/useAppSetup.ts @@ -6,7 +6,9 @@ export function useAppSetup = TL props: TLAppPropsWithoutApp | TLAppPropsWithApp ): R { if ('app' in props) return props.app - const [app] = React.useState(() => new TLReactApp(props.model, props.Shapes, props.Tools, props.readOnly) as R) + const [app] = React.useState( + () => new TLReactApp(props.model, props.Shapes, props.Tools, props.readOnly) as R + ) React.useLayoutEffect(() => { app.initKeyboardShortcuts()