@brightspace-ui/core 2.77.1 → 2.77.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,7 +3,6 @@ import { css, html, LitElement } from 'lit';
|
|
|
3
3
|
import { cssEscape, getComposedChildren, getComposedParent, isVisible } from '../../helpers/dom.js';
|
|
4
4
|
import { getUniqueId } from '../../helpers/uniqueId.js';
|
|
5
5
|
|
|
6
|
-
export const BACKDROP_ROLE = 'data-d2l-backdrop-role';
|
|
7
6
|
const BACKDROP_HIDDEN = 'data-d2l-backdrop-hidden';
|
|
8
7
|
const BACKDROP_ARIA_HIDDEN = 'data-d2l-backdrop-aria-hidden';
|
|
9
8
|
|
|
@@ -68,7 +67,8 @@ class Backdrop extends LitElement {
|
|
|
68
67
|
transition: none;
|
|
69
68
|
}
|
|
70
69
|
@media (prefers-reduced-motion: reduce) {
|
|
71
|
-
:host
|
|
70
|
+
:host,
|
|
71
|
+
:host([slow-transition]) {
|
|
72
72
|
transition: none;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -162,20 +162,13 @@ function hideAccessible(target) {
|
|
|
162
162
|
if (path.indexOf(child) !== -1) continue;
|
|
163
163
|
if (child.hasAttribute(BACKDROP_HIDDEN)) continue;
|
|
164
164
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
child.setAttribute('role', 'presentation');
|
|
168
|
-
|
|
169
|
-
if (child.nodeName === 'FORM' || child.nodeName === 'A') {
|
|
170
|
-
const ariaHidden = child.getAttribute('aria-hidden');
|
|
171
|
-
if (ariaHidden) child.setAttribute(BACKDROP_ARIA_HIDDEN, ariaHidden);
|
|
172
|
-
child.setAttribute('aria-hidden', 'true');
|
|
165
|
+
if (child.hasAttribute('aria-hidden')) {
|
|
166
|
+
child.setAttribute(BACKDROP_ARIA_HIDDEN, child.getAttribute('aria-hidden'));
|
|
173
167
|
}
|
|
168
|
+
child.setAttribute('aria-hidden', 'true');
|
|
174
169
|
|
|
175
170
|
child.setAttribute(BACKDROP_HIDDEN, BACKDROP_HIDDEN);
|
|
176
171
|
hiddenElements.push(child);
|
|
177
|
-
|
|
178
|
-
hideAccessibleChildren(child);
|
|
179
172
|
}
|
|
180
173
|
};
|
|
181
174
|
|
|
@@ -204,21 +197,11 @@ export function preventBodyScroll() {
|
|
|
204
197
|
function showAccessible(elems) {
|
|
205
198
|
for (let i = 0; i < elems.length; i++) {
|
|
206
199
|
const elem = elems[i];
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
elem.
|
|
210
|
-
elem.removeAttribute(BACKDROP_ROLE);
|
|
200
|
+
if (elem.hasAttribute(BACKDROP_ARIA_HIDDEN)) {
|
|
201
|
+
elem.setAttribute('aria-hidden', elem.getAttribute(BACKDROP_ARIA_HIDDEN));
|
|
202
|
+
elem.removeAttribute(BACKDROP_ARIA_HIDDEN);
|
|
211
203
|
} else {
|
|
212
|
-
elem.removeAttribute('
|
|
213
|
-
}
|
|
214
|
-
if (elem.nodeName === 'FORM' || elem.nodeName === 'A') {
|
|
215
|
-
const ariaHidden = elem.getAttribute(BACKDROP_ARIA_HIDDEN);
|
|
216
|
-
if (ariaHidden) {
|
|
217
|
-
elem.setAttribute('aria-hidden', ariaHidden);
|
|
218
|
-
elem.removeAttribute(BACKDROP_ARIA_HIDDEN);
|
|
219
|
-
} else {
|
|
220
|
-
elem.removeAttribute('aria-hidden');
|
|
221
|
-
}
|
|
204
|
+
elem.removeAttribute('aria-hidden');
|
|
222
205
|
}
|
|
223
206
|
elem.removeAttribute(BACKDROP_HIDDEN);
|
|
224
207
|
}
|
|
@@ -5,6 +5,7 @@ import { classMap } from 'lit/directives/class-map.js';
|
|
|
5
5
|
import { createHtmlBlockRenderer as createMathRenderer } from '../../helpers/mathjax.js';
|
|
6
6
|
import { HtmlAttributeObserverController } from '../../controllers/attributeObserver/htmlAttributeObserverController.js';
|
|
7
7
|
import { requestInstance } from '../../mixins/provider-mixin.js';
|
|
8
|
+
import { RtlMixin } from '../../mixins/rtl-mixin.js';
|
|
8
9
|
|
|
9
10
|
export const htmlBlockContentStyles = css`
|
|
10
11
|
.d2l-html-block-rendered {
|
|
@@ -130,7 +131,7 @@ const getRenderers = async() => {
|
|
|
130
131
|
* A component for displaying user-authored HTML.
|
|
131
132
|
* @slot - Provide your user-authored HTML
|
|
132
133
|
*/
|
|
133
|
-
class HtmlBlock extends LitElement {
|
|
134
|
+
class HtmlBlock extends RtlMixin(LitElement) {
|
|
134
135
|
|
|
135
136
|
static get properties() {
|
|
136
137
|
return {
|
|
@@ -163,7 +164,7 @@ class HtmlBlock extends LitElement {
|
|
|
163
164
|
:host {
|
|
164
165
|
display: block;
|
|
165
166
|
overflow-wrap: break-word;
|
|
166
|
-
text-align:
|
|
167
|
+
text-align: left;
|
|
167
168
|
}
|
|
168
169
|
:host([inline]),
|
|
169
170
|
:host([inline]) .d2l-html-block-rendered {
|
|
@@ -177,6 +178,9 @@ class HtmlBlock extends LitElement {
|
|
|
177
178
|
:host([no-deferred-rendering]) slot {
|
|
178
179
|
display: contents;
|
|
179
180
|
}
|
|
181
|
+
:host([dir="rtl"]) {
|
|
182
|
+
text-align: right;
|
|
183
|
+
}
|
|
180
184
|
`];
|
|
181
185
|
}
|
|
182
186
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/core",
|
|
3
|
-
"version": "2.77.
|
|
3
|
+
"version": "2.77.3",
|
|
4
4
|
"description": "A collection of accessible, free, open-source web components for building Brightspace applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": "https://github.com/BrightspaceUI/core.git",
|