openapi-explorer 0.8.268 → 0.8.270

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openapi-explorer",
3
- "version": "0.8.268",
3
+ "version": "0.8.270",
4
4
  "description": "OpenAPI Explorer - API viewer with dynamically generated components, documentation, and interaction console",
5
5
  "author": "Rhosys Developers <developers@rhosys.ch>",
6
6
  "repository": {
@@ -703,8 +703,9 @@ export default class OpenApiExplorer extends LitElement {
703
703
 
704
704
  let repeatedElementIndex;
705
705
  if (navEl.dataset.contentId === 'section') {
706
- const assignedNodes = this.shadowRoot.querySelector('slot.custom-nav-section').assignedNodes();
707
- repeatedElementIndex = [].findIndex.call(assignedNodes, (slot) => slot === event.target);
706
+ const navSectionSlot = this.shadowRoot.querySelector('slot.custom-nav-section');
707
+ const assignedNodes = navSectionSlot && navSectionSlot.assignedNodes();
708
+ repeatedElementIndex = assignedNodes && [].findIndex.call(assignedNodes, (slot) => slot === event.target);
708
709
  }
709
710
  this.isIntersectionObserverActive = false;
710
711
  this.scrollTo(navEl.dataset.contentId, true, scrollNavItemToView, repeatedElementIndex);
@@ -760,8 +761,9 @@ export default class OpenApiExplorer extends LitElement {
760
761
  // Update NavBar View and Styles
761
762
  let newNavEl = this.shadowRoot.getElementById(`link-${elementId}`);
762
763
  if (elementId === 'section') {
763
- const assignedNodes = this.shadowRoot.querySelector('slot.custom-nav-section').assignedNodes();
764
- newNavEl = assignedNodes[repeatedElementIndex || 0];
764
+ const navSectionSlot = this.shadowRoot.querySelector('slot.custom-nav-section');
765
+ const assignedNodes = navSectionSlot && navSectionSlot.assignedNodes();
766
+ newNavEl = assignedNodes && assignedNodes[repeatedElementIndex || 0];
765
767
  }
766
768
 
767
769
  if (!newNavEl) {
@@ -776,7 +778,9 @@ export default class OpenApiExplorer extends LitElement {
776
778
  if (oldNavEl) {
777
779
  oldNavEl.classList.remove('active');
778
780
  }
779
- this.shadowRoot.querySelector('slot.custom-nav-section').assignedNodes().filter((n, nodeIndex) => nodeIndex !== repeatedElementIndex).forEach((node) => {
781
+ const navSectionSlot = this.shadowRoot.querySelector('slot.custom-nav-section');
782
+ const assignedNodes = navSectionSlot && navSectionSlot.assignedNodes();
783
+ (assignedNodes || []).filter((n, nodeIndex) => nodeIndex !== repeatedElementIndex).forEach((node) => {
780
784
  node.classList.remove('active');
781
785
  });
782
786
  newNavEl.classList.add('active'); // must add the class after scrolling