<commit_before>/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

import 'vs/css!./aria';
import * as nls from 'vs/nls';
import { isMacintosh } from 'vs/base/common/platform';
import * as dom from 'vs/base/browser/dom';

let ariaContainer: HTMLElement;
let alertContainer: HTMLElement;
let statusContainer: HTMLElement;
export function setARIAContainer(parent: HTMLElement) {
	ariaContainer = document.createElement('div');
	ariaContainer.className = 'monaco-aria-container';

	alertContainer = document.createElement('div');
	alertContainer.className = 'monaco-alert';
	alertContainer.setAttribute('role', 'alert');
	alertContainer.setAttribute('aria-atomic', 'true');
	ariaContainer.appendChild(alertContainer);

	statusContainer = document.createElement('div');
	statusContainer.className = 'monaco-status';
	statusContainer.setAttribute('role', 'status');
	statusContainer.setAttribute('aria-atomic', 'true');
	ariaContainer.appendChild(statusContainer);

	parent.appendChild(ariaContainer);
}

/**
 * Given the provided message, will make sure that it is read as alert to screen readers.<commit_msg>aria: use role complemntary for status container<commit_after>/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

import 'vs/css!./aria';
import * as nls from 'vs/nls';
import { isMacintosh } from 'vs/base/common/platform';
import * as dom from 'vs/base/browser/dom';

let ariaContainer: HTMLElement;
let alertContainer: HTMLElement;
let statusContainer: HTMLElement;
export function setARIAContainer(parent: HTMLElement) {
	ariaContainer = document.createElement('div');
	ariaContainer.className = 'monaco-aria-container';

	alertContainer = document.createElement('div');
	alertContainer.className = 'monaco-alert';
	alertContainer.setAttribute('role', 'alert');
	alertContainer.setAttribute('aria-atomic', 'true');
	ariaContainer.appendChild(alertContainer);

	statusContainer = document.createElement('div');
	statusContainer.className = 'monaco-status';
	statusContainer.setAttribute('role', 'complementary');
	statusContainer.setAttribute('aria-live', 'polite');
	statusContainer.setAttribute('aria-atomic', 'true');
	ariaContainer.appendChild(statusContainer);

	parent.appendChild(ariaContainer);
}

/**
 * Given the provided message, will make sure that it is read as alert to screen readers.
{'fraction_non_alphanumeric': 0.23486932599724897, 'fraction_numerical': 0.0, 'mean_word_length': 3.040277777777778, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2538408', 'n_tokens_mistral': 691, 'n_tokens_neox': 707, 'n_words': 187}