|
27 | 27 | :snap-to-grid="true" |
28 | 28 | :snap-grid="[40, 40]" |
29 | 29 | :disable-keyboard-a11y="false" |
30 | | - role="img" |
31 | | - :aria-label="`Workflow diagram with ${positionedNodes.length} stages and ${styledEdges.length} transitions`" |
| 30 | + role="application" |
| 31 | + :aria-label="`Interactive workflow diagram with ${positionedNodes.length} stages and ${styledEdges.length} transitions. Press Tab to navigate between stages and transitions.`" |
| 32 | + aria-describedby="canvas-description" |
32 | 33 | @connect="handleConnect" |
33 | 34 | @pane-click="clearSelection" |
34 | 35 | @edge-click="selectEdge" |
|
55 | 56 | class="toolbar-button custom-controls-button position-absolute z-20" |
56 | 57 | tabindex="0" |
57 | 58 | :style="showMiniMap ? 'bottom: 130px; left: 180px;' : 'bottom: 10px; left: 10px;'" |
58 | | - :aria-label="showMiniMap ? translate('COM_WORKFLOW_GRAPH_MINIMAP_HIDE') : translate('COM_WORKFLOW_GRAPH_MINIMAP_SHOW')" |
59 | | - :title="showMiniMap ? translate('COM_WORKFLOW_GRAPH_MINIMAP_HIDE') : translate('COM_WORKFLOW_GRAPH_MINIMAP_SHOW')" |
60 | | - :aria-pressed="showMiniMap.toString()" |
| 59 | + :aria-label="showMiniMap ? 'Hide Mini Map' : 'Show Mini Map'" |
| 60 | + :title="showMiniMap ? 'Hide Mini Map' : 'Show Mini Map'" |
| 61 | + :aria-pressed="showMiniMap ? 'true' : 'false'" |
61 | 62 | @click="showMiniMap = !showMiniMap" |
62 | 63 | > |
63 | 64 | <span |
@@ -200,6 +201,7 @@ import { generatePositionedNodes, createSpecialNode } from '../../utils/position |
200 | 201 | import { generateStyledEdges } from '../../utils/edges.es6.js'; |
201 | 202 | import { setupGlobalShortcuts } from '../../utils/keyboard-manager.es6.js'; |
202 | 203 | import { debounce } from '../../utils/utils.es6'; |
| 204 | +import AccessibilityFixer from '../../utils/accessibility-fixer.es6.js'; |
203 | 205 |
|
204 | 206 | export default { |
205 | 207 | name: 'WorkflowCanvas', |
@@ -236,6 +238,7 @@ export default { |
236 | 238 | const saveStatus = ref('upToDate'); |
237 | 239 | const currentFocusMode = ref('links'); |
238 | 240 | const previouslyFocusedElement = ref(null); |
| 241 | + const accessibilityFixer = ref(null); |
239 | 242 |
|
240 | 243 | const showMiniMap = ref(true); |
241 | 244 | const workflow = computed(() => store.getters.workflow || {}); |
@@ -273,9 +276,8 @@ export default { |
273 | 276 | ? `${baseUrlwithId}&${extraQuery}` |
274 | 277 | : baseUrlwithId; |
275 | 278 |
|
276 | | - const textHeader = id |
277 | | - ? translate(`COM_WORKFLOW_GRAPH_EDIT_${type.toUpperCase()}`) |
278 | | - : translate(`COM_WORKFLOW_GRAPH_ADD_${type.toUpperCase()}`); |
| 279 | + const safeType = (typeof type === 'string' && type) ? type : ''; |
| 280 | + const textHeader = "hi"; |
279 | 281 |
|
280 | 282 | const dialog = new JoomlaDialog({ |
281 | 283 | popupType: 'iframe', |
@@ -481,6 +483,10 @@ export default { |
481 | 483 | }, |
482 | 484 | }))); |
483 | 485 | onMounted(() => { |
| 486 | + // Initialize accessibility fixer |
| 487 | + accessibilityFixer.value = new AccessibilityFixer(); |
| 488 | + accessibilityFixer.value.init(); |
| 489 | + |
484 | 490 | const detach = setupGlobalShortcuts({ |
485 | 491 | addStage, |
486 | 492 | addTransition, |
@@ -527,7 +533,12 @@ export default { |
527 | 533 | saveNodePosition, |
528 | 534 | store, |
529 | 535 | }); |
530 | | - onUnmounted(detach); |
| 536 | + onUnmounted(() => { |
| 537 | + detach(); |
| 538 | + if (accessibilityFixer.value) { |
| 539 | + accessibilityFixer.value.destroy(); |
| 540 | + } |
| 541 | + }); |
531 | 542 | }); |
532 | 543 |
|
533 | 544 | window.WorkflowGraph.Event.listen('onClickRedoWorkflow', () => { |
|
0 commit comments