@eventcatalog/core 2.0.20 → 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,23 @@
1
1
  # @eventcatalog/core
2
2
 
3
+ ## 2.0.23
4
+
5
+ ### Patch Changes
6
+
7
+ - 66a764c: fix(core: fixed additional ts errors)
8
+
9
+ ## 2.0.22
10
+
11
+ ### Patch Changes
12
+
13
+ - 58a02a1: chore(core): removed console logs
14
+
15
+ ## 2.0.21
16
+
17
+ ### Patch Changes
18
+
19
+ - 22e4b6d: fix(core): fixed issues with styling
20
+
3
21
  ## 2.0.20
4
22
 
5
23
  ### 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.20",
4
+ "version": "2.0.23",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  import AccordionClient from './Accordion'
3
3
  const {...props } = Astro.props;
4
- console.log('props', props )
5
4
  ---
6
5
 
7
6
  <AccordionClient {...props} client:load>
@@ -1,7 +1,4 @@
1
1
  ---
2
- import AccordionClient from './Accordion';
3
- const { ...props } = Astro.props;
4
- console.log('props', props);
5
2
  ---
6
3
 
7
4
  <div class="accordian-group border border-gray-200 rounded-md shadow-sm accordion my-2">
@@ -2,7 +2,6 @@ import { useEffect, useState } from 'react';
2
2
 
3
3
  // @ts-ignore
4
4
  import { JsonSchemaViewer } from '@stoplight/json-schema-viewer';
5
- import styles from './SchemaViewer.module.css';
6
5
 
7
6
  import '@stoplight/mosaic/styles.css';
8
7
  import { createPortal } from 'react-dom';
@@ -49,7 +48,6 @@ const SchemaViewer = ({
49
48
  defaultExpandedDepth={defaultExpandedDepth}
50
49
  renderRootTreeLines={renderRootTreeLines}
51
50
  hideExamples={hideExamples}
52
- className={styles.schemaViewer}
53
51
  />
54
52
  </div>
55
53
  </section>,
@@ -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
 
@@ -31,8 +31,6 @@ export async function getStaticPaths() {
31
31
 
32
32
  const props = Astro.props;
33
33
 
34
- console.log('TEST');
35
-
36
34
  const {
37
35
  data: { id },
38
36
  collection,
@@ -1,25 +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');
13
-
14
- console.log('totalAnchorLinks.length', totalAnchorLinks.length)
16
+ const totalAnchorLinks = navigationElem.querySelectorAll('a');
17
+ const link = navigationElem.querySelector('a');
18
+ const noItems = document.querySelector('.no-items');
15
19
 
16
20
  // Show no-items if there are none
17
- if(totalAnchorLinks.length === 0) {
18
- document.querySelector('.no-items').classList.remove('hidden');
21
+ if (totalAnchorLinks.length === 0 && noItems) {
22
+ noItems.classList.remove('hidden');
19
23
  }
20
24
 
21
25
  // Find the element with the id visualiser-navigation and the first a link in there and click it
22
- if(document.getElementById('visualiser-navigation').querySelector('a')){
23
- document.getElementById('visualiser-navigation').querySelector('a').click();
26
+ if (link) {
27
+ link.click();
24
28
  }
25
- </script>
29
+ }
30
+ </script>
@@ -1,9 +0,0 @@
1
- /* Custom styling for the schema viewer */
2
- .schemaViewer :global(.svg-inline--fa) {
3
- width: 1.25em;
4
- height: 1em;
5
- }
6
-
7
- .schemaViewer p, span {
8
- color: rgb(111, 111, 111) !important;
9
- }