@brightspace-ui/core 3.194.0 → 3.194.2

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.
@@ -367,6 +367,10 @@ export const ListItemDragDropMixin = superclass => class extends superclass {
367
367
  this.dropNested = false;
368
368
  }
369
369
 
370
+ get dropDisabled() {
371
+ return this._dropNestedOnly && !this.dropNested;
372
+ }
373
+
370
374
  connectedCallback() {
371
375
  super.connectedCallback();
372
376
  if (!this.key) {
@@ -393,10 +397,6 @@ export const ListItemDragDropMixin = superclass => class extends superclass {
393
397
  if (this.shadowRoot) this.shadowRoot.querySelector(`#${this._itemDragId}`).activateKeyboardMode();
394
398
  }
395
399
 
396
- get #disabledDrop() {
397
- return this._dropNestedOnly && !this.dropNested;
398
- }
399
-
400
400
  _annoucePositionChange(dragTargetKey, dropTargetKey, dropLocation) {
401
401
  /** Dispatched when a draggable list item's position changes in the list. See [Event Details: d2l-list-item-position-change](#event-details%3A-d2l-list-item-position-change). */
402
402
  this.dispatchEvent(new CustomEvent('d2l-list-item-position-change', {
@@ -551,7 +551,7 @@ export const ListItemDragDropMixin = superclass => class extends superclass {
551
551
  this.dragging = false;
552
552
 
553
553
  // check the dropEffect in case the user cancelled by Escape while dragging ('none' set by browser)
554
- if (!this.#disabledDrop && e.dataTransfer.dropEffect !== 'none' && dragState.shouldDrop(e.timeStamp)) {
554
+ if (!dragState.dropTarget?.dropDisabled && e.dataTransfer.dropEffect !== 'none' && dragState.shouldDrop(e.timeStamp)) {
555
555
 
556
556
  const dropTargetList = findComposedAncestor(dragState.dropTarget, node => node.tagName === 'D2L-LIST');
557
557
  const shouldDispatchPositionChange = !dragState.dragTargets.find(dragTarget => {
@@ -615,7 +615,7 @@ export const ListItemDragDropMixin = superclass => class extends superclass {
615
615
  }
616
616
 
617
617
  _onDragOver(e) {
618
- if (!this.key || this.#disabledDrop) return;
618
+ if (!this.key || this.dropDisabled) return;
619
619
  const dragState = getDragState();
620
620
  dragState.updateTime(e.timeStamp);
621
621
  e.preventDefault();
@@ -903,7 +903,7 @@ export const ListItemDragDropMixin = superclass => class extends superclass {
903
903
  }
904
904
 
905
905
  #onDropEnterHelper(e, isTopHalf, isMiddle) {
906
- if (this.#disabledDrop) return;
906
+ if (this.dropDisabled) return;
907
907
  e.dataTransfer.dropEffect = 'move';
908
908
 
909
909
  let location;
@@ -171,10 +171,10 @@ const getHeadingFocusStyles = (selector) => {
171
171
  /**
172
172
  * A private helper method that should not be used by general consumers
173
173
  */
174
- export const _generateHeading1Styles = (selector) => {
174
+ export const _generateHeading1Styles = (selector, includeFocus = false) => {
175
175
  if (!_isValidCssSelector(selector)) return;
176
176
 
177
- const focusStyles = getHeadingFocusStyles(selector);
177
+ const focusStyles = includeFocus ? getHeadingFocusStyles(selector) : unsafeCSS('');
178
178
  selector = unsafeCSS(selector);
179
179
  return css`
180
180
  ${selector} {
@@ -194,7 +194,7 @@ export const _generateHeading1Styles = (selector) => {
194
194
  `;
195
195
  };
196
196
  export const heading1Styles = css`
197
- ${_generateHeading1Styles('.d2l-heading-1')}
197
+ ${_generateHeading1Styles('.d2l-heading-1', true)}
198
198
  :host([skeleton]) .d2l-heading-1.d2l-skeletize {
199
199
  height: 2.4rem;
200
200
  overflow: hidden;
@@ -217,10 +217,10 @@ export const heading1Styles = css`
217
217
  /**
218
218
  * A private helper method that should not be used by general consumers
219
219
  */
220
- export const _generateHeading2Styles = (selector) => {
220
+ export const _generateHeading2Styles = (selector, includeFocus = false) => {
221
221
  if (!_isValidCssSelector(selector)) return;
222
222
 
223
- const focusStyles = getHeadingFocusStyles(selector);
223
+ const focusStyles = includeFocus ? getHeadingFocusStyles(selector) : unsafeCSS('');
224
224
  selector = unsafeCSS(selector);
225
225
  return css`
226
226
  ${selector} {
@@ -241,7 +241,7 @@ export const _generateHeading2Styles = (selector) => {
241
241
  `;
242
242
  };
243
243
  export const heading2Styles = css`
244
- ${_generateHeading2Styles('.d2l-heading-2')}
244
+ ${_generateHeading2Styles('.d2l-heading-2', true)}
245
245
  :host([skeleton]) .d2l-heading-2.d2l-skeletize {
246
246
  height: 1.8rem;
247
247
  overflow: hidden;
@@ -264,10 +264,10 @@ export const heading2Styles = css`
264
264
  /**
265
265
  * A private helper method that should not be used by general consumers
266
266
  */
267
- export const _generateHeading3Styles = (selector) => {
267
+ export const _generateHeading3Styles = (selector, includeFocus = false) => {
268
268
  if (!_isValidCssSelector(selector)) return;
269
269
 
270
- const focusStyles = getHeadingFocusStyles(selector);
270
+ const focusStyles = includeFocus ? getHeadingFocusStyles(selector) : unsafeCSS('');
271
271
  selector = unsafeCSS(selector);
272
272
  return css`
273
273
  ${selector} {
@@ -287,7 +287,7 @@ export const _generateHeading3Styles = (selector) => {
287
287
  `;
288
288
  };
289
289
  export const heading3Styles = css`
290
- ${_generateHeading3Styles('.d2l-heading-3')}
290
+ ${_generateHeading3Styles('.d2l-heading-3', true)}
291
291
  :host([skeleton]) .d2l-heading-3.d2l-skeletize {
292
292
  height: 1.5rem;
293
293
  overflow: hidden;
@@ -310,10 +310,10 @@ export const heading3Styles = css`
310
310
  /**
311
311
  * A private helper method that should not be used by general consumers
312
312
  */
313
- export const _generateHeading4Styles = (selector) => {
313
+ export const _generateHeading4Styles = (selector, includeFocus = false) => {
314
314
  if (!_isValidCssSelector(selector)) return;
315
315
 
316
- const focusStyles = getHeadingFocusStyles(selector);
316
+ const focusStyles = includeFocus ? getHeadingFocusStyles(selector) : unsafeCSS('');
317
317
  selector = unsafeCSS(selector);
318
318
  return css`
319
319
  ${selector} {
@@ -326,7 +326,7 @@ export const _generateHeading4Styles = (selector) => {
326
326
  `;
327
327
  };
328
328
  export const heading4Styles = css`
329
- ${_generateHeading4Styles('.d2l-heading-4')}
329
+ ${_generateHeading4Styles('.d2l-heading-4', true)}
330
330
  :host([skeleton]) .d2l-heading-4.d2l-skeletize {
331
331
  height: 1.2rem;
332
332
  overflow: hidden;
@@ -20,10 +20,10 @@ if (!document.head.querySelector('#d2l-typography-font-face')) {
20
20
  ${_generateBodyCompactStyles('.d2l-typography .d2l-body-compact', false)}
21
21
  ${_generateBodySmallStyles('.d2l-typography .d2l-body-small', false)}
22
22
  ${_generateLabelStyles('.d2l-typography .d2l-label-text', false)}
23
- ${_generateHeading1Styles('.d2l-typography .d2l-heading-1')}
24
- ${_generateHeading2Styles('.d2l-typography .d2l-heading-2')}
25
- ${_generateHeading3Styles('.d2l-typography .d2l-heading-3')}
26
- ${_generateHeading4Styles('.d2l-typography .d2l-heading-4')}
23
+ ${_generateHeading1Styles('.d2l-typography .d2l-heading-1', true)}
24
+ ${_generateHeading2Styles('.d2l-typography .d2l-heading-2', true)}
25
+ ${_generateHeading3Styles('.d2l-typography .d2l-heading-3', true)}
26
+ ${_generateHeading4Styles('.d2l-typography .d2l-heading-4', true)}
27
27
  ${_generateBlockquoteStyles('.d2l-typography .d2l-blockquote')}
28
28
  `;
29
29
  document.head.appendChild(style);
@@ -9145,6 +9145,9 @@
9145
9145
  "description": "**Selection:** Value to identify item if selectable",
9146
9146
  "type": "string"
9147
9147
  },
9148
+ {
9149
+ "name": "dropDisabled"
9150
+ },
9148
9151
  {
9149
9152
  "name": "draggable",
9150
9153
  "attribute": "draggable",
@@ -9555,6 +9558,9 @@
9555
9558
  "description": "**Selection:** Value to identify item if selectable",
9556
9559
  "type": "string"
9557
9560
  },
9561
+ {
9562
+ "name": "dropDisabled"
9563
+ },
9558
9564
  {
9559
9565
  "name": "draggable",
9560
9566
  "attribute": "draggable",
@@ -10107,6 +10113,9 @@
10107
10113
  "description": "**Selection:** Value to identify item if selectable",
10108
10114
  "type": "string"
10109
10115
  },
10116
+ {
10117
+ "name": "dropDisabled"
10118
+ },
10110
10119
  {
10111
10120
  "name": "draggable",
10112
10121
  "attribute": "draggable",
@@ -10456,6 +10465,9 @@
10456
10465
  "description": "**Selection:** Value to identify item if selectable",
10457
10466
  "type": "string"
10458
10467
  },
10468
+ {
10469
+ "name": "dropDisabled"
10470
+ },
10459
10471
  {
10460
10472
  "name": "draggable",
10461
10473
  "attribute": "draggable",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.194.0",
3
+ "version": "3.194.2",
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",