-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GLSP-1029: Introducing accessible tool palette, node and edge creatio…
…n via keyboard (#279) - Introduce tool and handler for Grid and Pointer for node creation - Introduce tool and handler for edge creation with autocomplete feature - Introduce tool and handler zooming via grid Part of eclipse-glsp/glsp#1029
- Loading branch information
1 parent
5435240
commit 9f38884
Showing
35 changed files
with
2,213 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -264,7 +264,7 @@ | |
} | ||
|
||
.search-hidden { | ||
opacity: 0.2; | ||
opacity: 0.4; | ||
} | ||
|
||
.search-highlighted .sprotty-node, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2023 Business Informatics Group (TU Wien) and others. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the Eclipse | ||
* Public License v. 2.0 are satisfied: GNU General Public License, version 2 | ||
* with the GNU Classpath Exception which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
********************************************************************************/ | ||
|
||
.accessibility-tool-palette.tool-palette { | ||
top: 48px; | ||
width: 240px; | ||
} | ||
|
||
.accessibility-tool-palette .header-tools i { | ||
margin-right: 0.5em; | ||
position: relative; | ||
} | ||
|
||
.accessibility-tool-palette .tool-button .key-shortcut, | ||
.accessibility-tool-palette .header-tools .key-shortcut { | ||
display: none; | ||
position: absolute; | ||
|
||
border-radius: 50%; | ||
width: 0.5rem; | ||
height: 0.5rem; | ||
padding: 0.5rem; | ||
|
||
background: #fff; | ||
border: 2px solid #666; | ||
color: black; | ||
text-align: center; | ||
|
||
font: bold 0.8rem Arial, sans-serif; | ||
line-height: 0.5rem; | ||
} | ||
|
||
.accessibility-tool-palette .tool-button .key-shortcut { | ||
left: -2rem; | ||
} | ||
|
||
.accessibility-tool-palette .header-tools .key-shortcut { | ||
top: -2.5rem; | ||
right: -0.3rem; | ||
} | ||
|
||
.accessibility-show-shortcuts:focus-within .header-tools .key-shortcut, | ||
.accessibility-show-shortcuts:focus-within .tool-button .key-shortcut { | ||
display: block; | ||
} | ||
|
||
.accessibility-tool-palette.collapsible-palette { | ||
overflow: visible; | ||
} | ||
|
||
.accessibility-tool-palette.collapsible-palette + .minimize-palette-button { | ||
top: 50px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2023 Business Informatics Group (TU Wien) and others. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the Eclipse | ||
* Public License v. 2.0 are satisfied: GNU General Public License, version 2 | ||
* with the GNU Classpath Exception which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
********************************************************************************/ | ||
|
||
.grid-container { | ||
display: grid; | ||
position: absolute; | ||
top: 0.5rem; | ||
bottom: 0.5rem; | ||
left: 0.5rem; | ||
right: 0.5rem; | ||
grid-template-columns: auto auto auto; | ||
} | ||
|
||
.grid-container:focus { | ||
opacity: 1 !important; | ||
} | ||
|
||
.grid-item { | ||
border: 1px solid rgba(0, 0, 0, 0.6); | ||
padding: 1rem; | ||
/* Fix overlapping borders */ | ||
margin: 0 -1px -1px 0; | ||
} | ||
|
||
.grid-item-number { | ||
border-radius: 50%; | ||
width: 1.5rem; | ||
height: 1.5rem; | ||
padding: 0.5rem; | ||
|
||
background: #fff; | ||
border: 2px solid #666; | ||
color: black; | ||
text-align: center; | ||
|
||
font: bold 1.3rem Arial, sans-serif; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2023 Business Informatics Group (TU Wien) and others. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the Eclipse | ||
* Public License v. 2.0 are satisfied: GNU General Public License, version 2 | ||
* with the GNU Classpath Exception which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
********************************************************************************/ | ||
import { Action, hasStringProp } from '~glsp-sprotty'; | ||
|
||
export interface FocusDomAction extends Action { | ||
kind: typeof FocusDomAction.KIND; | ||
id: string; | ||
} | ||
|
||
export namespace FocusDomAction { | ||
export const KIND = 'focusDomAction'; | ||
|
||
export function is(object: any): object is FocusDomAction { | ||
return Action.hasKind(object, KIND) && hasStringProp(object, 'id'); | ||
} | ||
|
||
export function create(id: string): FocusDomAction { | ||
return { kind: KIND, id }; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
packages/client/src/features/accessibility/edge-autocomplete/action.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2023 Business Informatics Group (TU Wien) and others. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the Eclipse | ||
* Public License v. 2.0 are satisfied: GNU General Public License, version 2 | ||
* with the GNU Classpath Exception which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
********************************************************************************/ | ||
import { Action, hasObjectProp, hasStringProp } from '~glsp-sprotty'; | ||
|
||
export interface SetEdgeTargetSelectionAction extends Action { | ||
kind: typeof SetEdgeTargetSelectionAction.KIND; | ||
elementId: string; | ||
context: string; | ||
} | ||
|
||
export namespace SetEdgeTargetSelectionAction { | ||
export const KIND = 'setEdgeTargetSelectionAction'; | ||
|
||
export function is(object: any): object is SetEdgeTargetSelectionAction { | ||
return Action.hasKind(object, KIND) && hasStringProp(object, 'elementId') && hasObjectProp(object, 'context'); | ||
} | ||
|
||
export function create(elementId: string, context: string): SetEdgeTargetSelectionAction { | ||
return { kind: KIND, elementId, context }; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
packages/client/src/features/accessibility/edge-autocomplete/edge-autocomplete-context.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2023 Business Informatics Group (TU Wien) and others. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the Eclipse | ||
* Public License v. 2.0 are satisfied: GNU General Public License, version 2 | ||
* with the GNU Classpath Exception which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
********************************************************************************/ | ||
|
||
import { TriggerEdgeCreationAction } from '~glsp-sprotty'; | ||
|
||
export interface EdgeAutocompleteContext { | ||
role: 'source' | 'target'; | ||
trigger: TriggerEdgeCreationAction; | ||
sourceId?: string; | ||
targetId?: string; | ||
} |
Oops, something went wrong.