@eventcatalog/core 2.19.7 → 2.19.9
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/dist/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/{chunk-GHC5YZDP.js → chunk-6YOAJVAK.js} +1 -1
- package/dist/{chunk-3CL5OM5M.js → chunk-TST4Y2ZK.js} +1 -1
- package/dist/{chunk-SBVM6HJV.js → chunk-V6S4JW6E.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.js +3 -3
- package/eventcatalog/src/components/MDX/SchemaViewer/SchemaViewer.astro +23 -14
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-V6S4JW6E.js";
|
|
4
|
+
import "../chunk-TST4Y2ZK.js";
|
|
5
|
+
import "../chunk-6YOAJVAK.js";
|
|
6
6
|
import "../chunk-E7TXTI7G.js";
|
|
7
7
|
export {
|
|
8
8
|
log_build_default as default
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
package/dist/eventcatalog.js
CHANGED
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
} from "./chunk-SHCMAL37.js";
|
|
4
4
|
import {
|
|
5
5
|
log_build_default
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-V6S4JW6E.js";
|
|
7
|
+
import "./chunk-TST4Y2ZK.js";
|
|
8
8
|
import {
|
|
9
9
|
catalogToAstro
|
|
10
10
|
} from "./chunk-WF34R5UT.js";
|
|
11
11
|
import {
|
|
12
12
|
VERSION
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-6YOAJVAK.js";
|
|
14
14
|
import {
|
|
15
15
|
generate
|
|
16
16
|
} from "./chunk-YEQVKHST.js";
|
|
@@ -45,6 +45,7 @@ try {
|
|
|
45
45
|
const schemaPath = path.join(catalog.filePath, schemaViewerProps.file);
|
|
46
46
|
const exists = existsSync(schemaPath);
|
|
47
47
|
let schema;
|
|
48
|
+
let render = true;
|
|
48
49
|
|
|
49
50
|
if (exists) {
|
|
50
51
|
// Load the schema for the component
|
|
@@ -53,6 +54,10 @@ try {
|
|
|
53
54
|
schema = yaml.load(schema);
|
|
54
55
|
} else {
|
|
55
56
|
schema = JSON.parse(schema);
|
|
57
|
+
// Lets JSON schema control if the component should be rendered or not
|
|
58
|
+
if (schema['x-eventcatalog-render-schema-viewer'] !== undefined) {
|
|
59
|
+
render = schema['x-eventcatalog-render-schema-viewer'];
|
|
60
|
+
}
|
|
56
61
|
}
|
|
57
62
|
}
|
|
58
63
|
|
|
@@ -62,6 +67,7 @@ try {
|
|
|
62
67
|
schema,
|
|
63
68
|
schemaPath,
|
|
64
69
|
...schemaViewerProps,
|
|
70
|
+
render,
|
|
65
71
|
};
|
|
66
72
|
});
|
|
67
73
|
|
|
@@ -75,20 +81,23 @@ try {
|
|
|
75
81
|
<section class="space-y-4">
|
|
76
82
|
{
|
|
77
83
|
schemas.length > 0 &&
|
|
78
|
-
schemas.map((schema) =>
|
|
79
|
-
|
|
80
|
-
|
|
84
|
+
schemas.map((schema) => {
|
|
85
|
+
if (!schema.render) return null;
|
|
86
|
+
return (
|
|
87
|
+
<div>
|
|
88
|
+
{schema.exists && <SchemaViewerClient {...schema} client:only="react" />}
|
|
81
89
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
{/* User has tried to load the schema, but it was not found on file system */}
|
|
91
|
+
{!schema.exists && (
|
|
92
|
+
<Admonition type="warning">
|
|
93
|
+
<div>
|
|
94
|
+
<span class="block font-bold">{`<SchemaViewer/>`} failed to load</span>
|
|
95
|
+
<span class="block">Tried to load schema from {schema.schemaPath}, but no schema can be found</span>
|
|
96
|
+
</div>
|
|
97
|
+
</Admonition>
|
|
98
|
+
)}
|
|
99
|
+
</div>
|
|
100
|
+
);
|
|
101
|
+
})
|
|
93
102
|
}
|
|
94
103
|
</section>
|