@eventcatalog/core 2.0.22 → 2.0.23

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @eventcatalog/core
2
2
 
3
+ ## 2.0.23
4
+
5
+ ### Patch Changes
6
+
7
+ - 66a764c: fix(core: fixed additional ts errors)
8
+
3
9
  ## 2.0.22
4
10
 
5
11
  ### Patch Changes
package/global.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ declare global {
2
+ interface Window {
3
+ eventcatalog: any;
4
+ }
5
+ }
6
+
7
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eventcatalog/core",
3
3
  "type": "module",
4
- "version": "2.0.22",
4
+ "version": "2.0.23",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -180,6 +180,7 @@ const badges = [
180
180
  // Fix to pass information to componets that are client side only
181
181
  // and require catalog information
182
182
  window.eventcatalog = {};
183
+ // @ts-ignore
183
184
  window.eventcatalog[`${props.collection}-${props.data.id}`] = props.catalog;
184
185
  </script>
185
186
 
@@ -1,23 +1,30 @@
1
1
  ---
2
- import Layout from '../../layouts/VisualiserLayout.astro'
2
+ import Layout from '../../layouts/VisualiserLayout.astro';
3
3
  ---
4
4
 
5
5
  <Layout>
6
- <div class="hidden no-items py-56 text-center -ml-52 text-gray-400">No data loaded into your catalog. Please add some data to your to see visuals.</div>
6
+ <div class="hidden no-items py-56 text-center -ml-52 text-gray-400">
7
+ No data loaded into your catalog. Please add some data to your to see visuals.
8
+ </div>
7
9
  </Layout>
8
10
 
9
11
  <script is:inline>
12
+ const navigationElem = document.getElementById('visualiser-navigation');
10
13
 
14
+ if (navigationElem) {
11
15
  // Find the total anchor links
12
- const totalAnchorLinks = document.getElementById('visualiser-navigation').querySelectorAll('a');
16
+ const totalAnchorLinks = navigationElem.querySelectorAll('a');
17
+ const link = navigationElem.querySelector('a');
18
+ const noItems = document.querySelector('.no-items');
13
19
 
14
20
  // Show no-items if there are none
15
- if(totalAnchorLinks.length === 0) {
16
- document.querySelector('.no-items').classList.remove('hidden');
21
+ if (totalAnchorLinks.length === 0 && noItems) {
22
+ noItems.classList.remove('hidden');
17
23
  }
18
24
 
19
25
  // Find the element with the id visualiser-navigation and the first a link in there and click it
20
- if(document.getElementById('visualiser-navigation').querySelector('a')){
21
- document.getElementById('visualiser-navigation').querySelector('a').click();
26
+ if (link) {
27
+ link.click();
22
28
  }
23
- </script>
29
+ }
30
+ </script>