@open-resource-discovery/metadata-renderer 1.0.1 → 1.1.1
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/README.md +1 -0
- package/dist/a2a/index.d.ts +1 -1
- package/dist/a2a.js +1 -1
- package/dist/asyncApi/asyncapi-browser.d.ts +10 -0
- package/dist/asyncApi/customAttributes/attributeLink.d.ts +1 -1
- package/dist/asyncApi/index.d.ts +2 -1
- package/dist/asyncapi.js +1 -1
- package/dist/chunks/{a2a-B5lkgqLU.js → a2a-BfdUdobQ.js} +1 -1
- package/dist/chunks/{asyncApi-DtAXW7IY.js → asyncApi-B7WZqXRI.js} +6 -4
- package/dist/chunks/{csn-3ek2O4d6.js → csn-CIBA2ds5.js} +52 -20
- package/dist/chunks/{mcp-qA5sYRAN.js → mcp-Yb3SHisP.js} +1 -1
- package/dist/chunks/{openApi-BTb5yzun.js → openApi-D0QJn2Gd.js} +33 -5
- package/dist/chunks/overlay-CO0o6FYy.js +41 -0
- package/dist/chunks/{utils-BC3WF3-9.js → utils-BLQCpHkJ.js} +2 -0
- package/dist/core/ShadowRoot.d.ts +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/utils.d.ts +1 -1
- package/dist/csn/customAttributes/postProcess.d.ts +1 -0
- package/dist/csn/customAttributes/postProcess.test.d.ts +1 -0
- package/dist/csn/index.d.ts +1 -1
- package/dist/csn.js +1 -1
- package/dist/entries/overlay.d.ts +2 -0
- package/dist/index.css +6815 -2141
- package/dist/index.d.ts +2 -0
- package/dist/index.js +21 -16
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp.js +1 -1
- package/dist/openApi/customAttributes/attributeLink.d.ts +1 -1
- package/dist/openApi/index.d.ts +1 -1
- package/dist/openApi/styles.d.ts +1 -1
- package/dist/openApi/utils/sidebarHeight.d.ts +13 -0
- package/dist/openApi/utils/sidebarHeight.test.d.ts +1 -0
- package/dist/openapi.js +1 -1
- package/dist/overlay/index.d.ts +7 -0
- package/dist/overlay.js +2 -0
- package/dist/styles.d.ts +1 -0
- package/dist/styles.js +1 -0
- package/dist/vendor.d.ts +1 -0
- package/package.json +30 -20
package/README.md
CHANGED
|
@@ -17,6 +17,7 @@ React components that render metadata documents of various types consistently.
|
|
|
17
17
|
- [AsyncAPI](https://asyncapi.com/) 2.x / 3.x (JSON or YAML) — via [@asyncapi/react-component](https://github.com/asyncapi/asyncapi-react)
|
|
18
18
|
- [A2A Agent Cards](https://a2a-protocol.org/latest/specification/) — via [@open-resource-discovery/a2a-editor](https://www.npmjs.com/package/@open-resource-discovery/a2a-editor)
|
|
19
19
|
- [MCP Server Cards](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2127) — via [@open-resource-discovery/mcp-server-card-ui](https://www.npmjs.com/package/@open-resource-discovery/mcp-server-card-ui)
|
|
20
|
+
- [ORD Overlay](https://open-resource-discovery.org/) — via [@open-resource-discovery/overlay-editor](https://www.npmjs.com/package/@open-resource-discovery/overlay-editor)
|
|
20
21
|
|
|
21
22
|
More formats will be added over time. See the [Support](https://open-resource-discovery.github.io/metadata-renderer/docs/Supported) page for the current list.
|
|
22
23
|
|
package/dist/a2a/index.d.ts
CHANGED
|
@@ -6,4 +6,4 @@ export type A2ARendererProps = {
|
|
|
6
6
|
className?: string;
|
|
7
7
|
theme?: RendererTheme;
|
|
8
8
|
};
|
|
9
|
-
export declare function A2ARenderer({ content, showValidation, showConnection, className, theme, }: A2ARendererProps): import(
|
|
9
|
+
export declare function A2ARenderer({ content, showValidation, showConnection, className, theme, }: A2ARendererProps): import('react').JSX.Element;
|
package/dist/a2a.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as A2ARenderer } from "./chunks/a2a-
|
|
1
|
+
import { t as A2ARenderer } from "./chunks/a2a-BfdUdobQ.js";
|
|
2
2
|
export { A2ARenderer };
|
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
declare module '@asyncapi/react-component/browser/index.js' {
|
|
2
2
|
export { default } from '@asyncapi/react-component';
|
|
3
3
|
}
|
|
4
|
+
|
|
5
|
+
// The `PluginSlot` enum is defined in this dependency-free leaf module. We import
|
|
6
|
+
// the runtime value from here (not from the package root) because the root entry
|
|
7
|
+
// pulls in @asyncapi/parser -> @asyncapi/avro-schema-parser -> avsc, which needs
|
|
8
|
+
// Node builtins and breaks browser consumers. The browser component's plugin
|
|
9
|
+
// system keys on the same string values (INFO = "info"). Types are re-exported
|
|
10
|
+
// from the package root and are erased at build time.
|
|
11
|
+
declare module '@asyncapi/react-component/lib/esm/types.js' {
|
|
12
|
+
export { PluginSlot } from '@asyncapi/react-component';
|
|
13
|
+
}
|
package/dist/asyncApi/index.d.ts
CHANGED
|
@@ -8,4 +8,5 @@ export type AsyncApiRendererProps = {
|
|
|
8
8
|
className?: string;
|
|
9
9
|
theme?: RendererTheme;
|
|
10
10
|
};
|
|
11
|
-
export declare function
|
|
11
|
+
export declare function buildAsyncApiThemeStyle(id: string, theme: RendererTheme): string;
|
|
12
|
+
export declare function AsyncApiRenderer({ content, config, customAttributes, className, theme }: AsyncApiRendererProps): import('react').JSX.Element;
|
package/dist/asyncapi.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as AsyncApiRenderer } from "./chunks/asyncApi-
|
|
1
|
+
import { t as AsyncApiRenderer } from "./chunks/asyncApi-B7WZqXRI.js";
|
|
2
2
|
export { AsyncApiRenderer };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { i as loadObject } from "./utils-
|
|
1
|
+
import { i as loadObject } from "./utils-BLQCpHkJ.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import { createElement, useId, useMemo } from "react";
|
|
4
4
|
import Markdown from "react-markdown";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import AsyncApiComponent from "@asyncapi/react-component/browser/index.js";
|
|
7
|
-
import { PluginSlot } from "@asyncapi/react-component";
|
|
7
|
+
import { PluginSlot } from "@asyncapi/react-component/lib/esm/types.js";
|
|
8
8
|
//#region src/lib/asyncApi/customAttributes/context.ts
|
|
9
9
|
var asyncApiContext = {
|
|
10
10
|
version: "",
|
|
@@ -311,7 +311,8 @@ function buildRootExtensionsPlugin(configs) {
|
|
|
311
311
|
const config = asyncApiContext.configs.find((c) => c.extensions?.[key]) ?? asyncApiContext.configs.find((c) => c.prefixStartsWith && key.startsWith(c.prefixStartsWith)) ?? configs[0];
|
|
312
312
|
if (!config) return [];
|
|
313
313
|
const def = config.extensions?.[key];
|
|
314
|
-
|
|
314
|
+
const fieldComponent = buildAsyncApiGenericRenderer(key, def, config);
|
|
315
|
+
return [createElement(fieldComponent, {
|
|
315
316
|
key,
|
|
316
317
|
propertyName: key,
|
|
317
318
|
propertyValue: value,
|
|
@@ -447,7 +448,7 @@ function buildAsyncApiThemeStyle(id, theme) {
|
|
|
447
448
|
if (accentFg) rules.push(`${scope} .text-gray-200, ${scope} .examples .text-gray-600 { color: ${accentFg} !important; } `);
|
|
448
449
|
if (fg) rules.push(`${scope} .text-gray-800, ${scope} .text-gray-900 { color: ${fg} !important; }`);
|
|
449
450
|
if (border) rules.push(`${scope} .border { border-color: ${border}; }`, `${scope} .border-b { border-bottom-color: ${border}; }`, `${scope} .border-gray-400 { border-color: ${border} !important; }`);
|
|
450
|
-
if (borderRadius) rules.push(`${scope} .rounded, ${scope} .prose pre
|
|
451
|
+
if (borderRadius) rules.push(`${scope} .rounded, ${scope} .prose pre { border-radius: ${borderRadius}px; }`, `@media (min-width: 1536px) {\n${scope} .\\32 xl\\:rounded { border-radius: ${borderRadius}px; }\n}`, `${scope} .rounded:not(.inline-block) { overflow: hidden; }`, `${scope} .rounded-tl-none { border-top-left-radius: 0px; }`);
|
|
451
452
|
return rules.join("\n");
|
|
452
453
|
}
|
|
453
454
|
function AsyncApiRenderer({ content, config, customAttributes, className, theme }) {
|
|
@@ -490,6 +491,7 @@ function AsyncApiRenderer({ content, config, customAttributes, className, theme
|
|
|
490
491
|
isEnabled && /* @__PURE__ */ jsx("style", { children: styles_default }),
|
|
491
492
|
/* @__PURE__ */ jsx("style", { children: layoutStyle }),
|
|
492
493
|
isEnabled && /* @__PURE__ */ jsx("style", { children: `[data-renderer-id="${id}"] #introduction .hidden { display: block !important; }` }),
|
|
494
|
+
!isEnabled && /* @__PURE__ */ jsx("style", { children: `[data-renderer-id="${id}"] :is(#operations, #messages) div:has(> .flex.py-2 span.Extensions) { display: none; }` }),
|
|
493
495
|
/* @__PURE__ */ jsx(AsyncApiComponent, {
|
|
494
496
|
schema: content,
|
|
495
497
|
config: effectiveConfig,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as loadObject } from "./utils-
|
|
1
|
+
import { i as loadObject } from "./utils-BLQCpHkJ.js";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { generateHtml } from "@sap/csn-interop-renderer";
|
|
@@ -254,35 +254,67 @@ function replaceNodeRun(parentNode, startNode, endNode, replacementHtml) {
|
|
|
254
254
|
cur = next;
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
+
function matchAnnotationRun(node, next) {
|
|
258
|
+
if (node.nodeType !== Node.TEXT_NODE) return null;
|
|
259
|
+
const text = (node.textContent ?? "").replace(/^\s+/, "");
|
|
260
|
+
const match = /^@([\w.]+):\s*$/.exec(text);
|
|
261
|
+
if (!match) return null;
|
|
262
|
+
if (!next || next.nodeType !== Node.ELEMENT_NODE) return null;
|
|
263
|
+
const el = next;
|
|
264
|
+
let codeEl = null;
|
|
265
|
+
if (el.tagName === "CODE") codeEl = el;
|
|
266
|
+
else if (el.tagName === "A") codeEl = el.querySelector("code");
|
|
267
|
+
if (!codeEl) return null;
|
|
268
|
+
return {
|
|
269
|
+
key: `@${match[1]}`,
|
|
270
|
+
valueNode: next,
|
|
271
|
+
codeEl
|
|
272
|
+
};
|
|
273
|
+
}
|
|
257
274
|
function collectAnnotationPairs(td, renderers) {
|
|
258
275
|
const pairs = [];
|
|
259
276
|
const childNodes = Array.from(td.childNodes);
|
|
260
277
|
for (let i = 0; i < childNodes.length - 1; i++) {
|
|
261
|
-
const
|
|
262
|
-
if (
|
|
263
|
-
const
|
|
264
|
-
const match = /^@([\w.]+):\s*$/.exec(text);
|
|
265
|
-
if (!match) continue;
|
|
266
|
-
const key = `@${match[1]}`;
|
|
267
|
-
const entry = renderers.get(key);
|
|
278
|
+
const run = matchAnnotationRun(childNodes[i], childNodes[i + 1]);
|
|
279
|
+
if (!run) continue;
|
|
280
|
+
const entry = renderers.get(run.key);
|
|
268
281
|
if (!entry) continue;
|
|
269
|
-
const valueNode = childNodes[i + 1];
|
|
270
|
-
if (!valueNode || valueNode.nodeType !== Node.ELEMENT_NODE) continue;
|
|
271
|
-
const el = valueNode;
|
|
272
|
-
let codeEl = null;
|
|
273
|
-
if (el.tagName === "CODE") codeEl = el;
|
|
274
|
-
else if (el.tagName === "A") codeEl = el.querySelector("code");
|
|
275
|
-
if (!codeEl) continue;
|
|
276
282
|
pairs.push({
|
|
277
|
-
textNode:
|
|
278
|
-
valueNode,
|
|
279
|
-
codeEl,
|
|
280
|
-
key,
|
|
283
|
+
textNode: childNodes[i],
|
|
284
|
+
valueNode: run.valueNode,
|
|
285
|
+
codeEl: run.codeEl,
|
|
286
|
+
key: run.key,
|
|
281
287
|
entry
|
|
282
288
|
});
|
|
283
289
|
}
|
|
284
290
|
return pairs;
|
|
285
291
|
}
|
|
292
|
+
function precedingBr(textNode) {
|
|
293
|
+
let prev = textNode.previousSibling;
|
|
294
|
+
if (prev && prev.nodeType === Node.TEXT_NODE && !(prev.textContent ?? "").trim()) prev = prev.previousSibling;
|
|
295
|
+
return prev && prev.nodeType === Node.ELEMENT_NODE && prev.tagName === "BR" ? prev : null;
|
|
296
|
+
}
|
|
297
|
+
function stripAllAnnotations(html) {
|
|
298
|
+
const domDoc = new DOMParser().parseFromString(html, "text/html");
|
|
299
|
+
for (const container of Array.from(domDoc.querySelectorAll("td, p"))) {
|
|
300
|
+
const childNodes = Array.from(container.childNodes);
|
|
301
|
+
const runs = [];
|
|
302
|
+
for (let i = 0; i < childNodes.length - 1; i++) {
|
|
303
|
+
const run = matchAnnotationRun(childNodes[i], childNodes[i + 1]);
|
|
304
|
+
if (!run) continue;
|
|
305
|
+
runs.push({
|
|
306
|
+
textNode: childNodes[i],
|
|
307
|
+
valueNode: run.valueNode,
|
|
308
|
+
br: precedingBr(childNodes[i])
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
for (const { textNode, valueNode, br } of runs) {
|
|
312
|
+
replaceNodeRun(container, textNode, valueNode, "");
|
|
313
|
+
if (br && br.parentNode === container) container.removeChild(br);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
return domDoc.body.innerHTML;
|
|
317
|
+
}
|
|
286
318
|
function applyAnnotationRenderers(html, configs, doc) {
|
|
287
319
|
const renderers = /* @__PURE__ */ new Map();
|
|
288
320
|
for (const config of configs) {
|
|
@@ -349,7 +381,7 @@ function CsnRenderer({ content, config, customAttributes, className, theme }) {
|
|
|
349
381
|
}
|
|
350
382
|
};
|
|
351
383
|
generateHtml(parsed, rendererConfig).then((html) => {
|
|
352
|
-
const processed = isEnabled ? applyAnnotationRenderers(html, activeConfigs, parsedDoc) : html;
|
|
384
|
+
const processed = isEnabled ? applyAnnotationRenderers(html, activeConfigs, parsedDoc) : stripAllAnnotations(html);
|
|
353
385
|
if (!cancelled) setState({
|
|
354
386
|
kind: "ready",
|
|
355
387
|
html: processed
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as loadObject } from "./utils-
|
|
1
|
+
import { i as loadObject } from "./utils-BLQCpHkJ.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import { createElement, useEffect, useId, useMemo, useRef } from "react";
|
|
4
4
|
import { ApiReferenceReact } from "@scalar/api-reference-react";
|
|
@@ -522,6 +522,26 @@ function buildScalarThemeStyles(id, theme) {
|
|
|
522
522
|
})()].filter(Boolean).join("\n\n");
|
|
523
523
|
}
|
|
524
524
|
//#endregion
|
|
525
|
+
//#region src/lib/openApi/utils/sidebarHeight.ts
|
|
526
|
+
/**
|
|
527
|
+
* Nearest ancestor a `position: sticky` descendant sticks within — one that clips or scrolls
|
|
528
|
+
* vertically — or `null` when that is the document itself.
|
|
529
|
+
*/
|
|
530
|
+
function findScrollParent(el) {
|
|
531
|
+
for (let node = el.parentElement; node && node !== document.body; node = node.parentElement) if (/^(auto|scroll|overlay|hidden)$/.test(getComputedStyle(node).overflowY)) return node;
|
|
532
|
+
return null;
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* Height for Scalar's sticky sidebar (`--scalar-container-height`, see `styles.ts`): the renderer's
|
|
536
|
+
* own box, but never taller than what is visible of it — the nearest scroll container and the
|
|
537
|
+
* viewport. In a host that bounds the box this is just the box; in one that doesn't, the box is as
|
|
538
|
+
* tall as Scalar's layout, which is as tall as the sidebar, so measuring the box alone would let the
|
|
539
|
+
* height grow and never shrink back to the content.
|
|
540
|
+
*/
|
|
541
|
+
function sidebarHeight(containerHeight, scrollPortHeight, viewportHeight) {
|
|
542
|
+
return Math.min(containerHeight, scrollPortHeight ?? Infinity, viewportHeight);
|
|
543
|
+
}
|
|
544
|
+
//#endregion
|
|
525
545
|
//#region src/lib/openApi/styles.ts
|
|
526
546
|
var styles_default = `
|
|
527
547
|
.sap-api-container {
|
|
@@ -711,7 +731,8 @@ a:hover {
|
|
|
711
731
|
}
|
|
712
732
|
|
|
713
733
|
/* Override Scalar's sidebar height variable so the <aside> uses our measured container height
|
|
714
|
-
instead of Scalar's default 100dvh (which breaks when embedded in Docusaurus/non-fullscreen).
|
|
734
|
+
instead of Scalar's default 100dvh (which breaks when embedded in Docusaurus/non-fullscreen).
|
|
735
|
+
The measurement is capped at the visible height — see utils/sidebarHeight.ts. */
|
|
715
736
|
.scalar-app {
|
|
716
737
|
--refs-sidebar-height: calc(var(--scalar-container-height, 100dvh) - var(--refs-header-height, 0px));
|
|
717
738
|
}
|
|
@@ -727,13 +748,20 @@ function OpenApiRenderer({ content, customAttributes, className, theme }) {
|
|
|
727
748
|
useEffect(() => {
|
|
728
749
|
const el = containerRef.current;
|
|
729
750
|
if (!el) return;
|
|
730
|
-
const
|
|
731
|
-
|
|
732
|
-
|
|
751
|
+
const scrollPort = findScrollParent(el);
|
|
752
|
+
const update = () => {
|
|
753
|
+
const height = sidebarHeight(el.clientHeight, scrollPort?.clientHeight ?? null, window.innerHeight);
|
|
754
|
+
el.style.setProperty("--scalar-container-height", `${height}px`);
|
|
755
|
+
};
|
|
756
|
+
const ro = new ResizeObserver(update);
|
|
733
757
|
ro.observe(el);
|
|
758
|
+
if (scrollPort) ro.observe(scrollPort);
|
|
759
|
+
window.addEventListener("resize", update);
|
|
734
760
|
return () => {
|
|
735
761
|
ro.disconnect();
|
|
762
|
+
window.removeEventListener("resize", update);
|
|
736
763
|
if (window.location.hash) history.replaceState(null, "", window.location.pathname + window.location.search);
|
|
764
|
+
document.body.classList.remove("light-mode", "dark-mode");
|
|
737
765
|
};
|
|
738
766
|
}, []);
|
|
739
767
|
const customAttributesKey = useMemo(() => {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { t as buildShadcnThemeStyle } from "./utils-BLQCpHkJ.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { useEffect, useId } from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { OverlayCardView, useOverlayStore, useTheme } from "@open-resource-discovery/overlay-editor/card-view";
|
|
6
|
+
//#region src/lib/overlay/index.tsx
|
|
7
|
+
function OverlayRenderer({ content, className, theme }) {
|
|
8
|
+
const id = useId();
|
|
9
|
+
const { setTheme } = useTheme();
|
|
10
|
+
const isDark = className?.split(/\s+/).includes("dark") ?? false;
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
useOverlayStore.getState().setRawJson(content);
|
|
13
|
+
}, [content]);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
setTheme(isDark ? "dark" : "light");
|
|
16
|
+
}, [isDark, setTheme]);
|
|
17
|
+
const themeStyle = theme ? buildShadcnThemeStyle("overlay-root", id, theme) : null;
|
|
18
|
+
const footerThemeStyle = theme ? buildShadcnThemeStyle("overlay-sidebar-footer-mobile", id, theme) : null;
|
|
19
|
+
const scopedStyles = `
|
|
20
|
+
${`[data-renderer-id="${id}"] .overlay-root`} code {
|
|
21
|
+
color: var(--ord-code-fg, var(--ord-foreground, #24292f));
|
|
22
|
+
background-color: var(--ord-code-bg, var(--ord-muted, #f6f8fa));
|
|
23
|
+
}
|
|
24
|
+
[data-renderer-id="${id}"] .overlay-sidebar-footer-mobile {
|
|
25
|
+
background: var(--ord-background);
|
|
26
|
+
color: var(--ord-muted-foreground);
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
30
|
+
"data-renderer-id": id,
|
|
31
|
+
className: "h-full",
|
|
32
|
+
children: [
|
|
33
|
+
/* @__PURE__ */ jsx("style", { children: scopedStyles }),
|
|
34
|
+
themeStyle && /* @__PURE__ */ jsx("style", { children: themeStyle }),
|
|
35
|
+
footerThemeStyle && /* @__PURE__ */ jsx("style", { children: footerThemeStyle }),
|
|
36
|
+
/* @__PURE__ */ jsx(OverlayCardView, {})
|
|
37
|
+
]
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
export { OverlayRenderer as t };
|
|
@@ -25,6 +25,7 @@ function detectMetaType(content) {
|
|
|
25
25
|
if (typeof o.csnInteropEffective === "string") return "csn";
|
|
26
26
|
if (typeof o.openapi === "string" || typeof o.swagger === "string") return "openapi";
|
|
27
27
|
if (typeof o.asyncapi === "string") return "asyncapi";
|
|
28
|
+
if (typeof o.ordOverlay === "string" && Array.isArray(o.patches)) return "overlay";
|
|
28
29
|
if (Array.isArray(o.supportedProtocolVersions)) return "mcp";
|
|
29
30
|
if (typeof o.capabilities === "object" && o.capabilities !== null && Array.isArray(o.skills)) return "a2a";
|
|
30
31
|
return "unknown";
|
|
@@ -38,6 +39,7 @@ function extractVersion(type, content) {
|
|
|
38
39
|
if (typeof o.swagger === "string") return "2.0";
|
|
39
40
|
return "";
|
|
40
41
|
case "asyncapi": return typeof o.asyncapi === "string" ? o.asyncapi : "";
|
|
42
|
+
case "overlay": return typeof o.ordOverlay === "string" ? o.ordOverlay : "";
|
|
41
43
|
case "a2a":
|
|
42
44
|
if (typeof o.protocolVersion === "string") return o.protocolVersion;
|
|
43
45
|
if (Array.isArray(o.supportedInterfaces) && o.supportedInterfaces.length > 0) {
|
|
@@ -3,4 +3,4 @@ export type ShadowRootProps = {
|
|
|
3
3
|
styles?: string;
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
};
|
|
6
|
-
export declare function ShadowRoot({ styles, children }: ShadowRootProps): import(
|
|
6
|
+
export declare function ShadowRoot({ styles, children }: ShadowRootProps): import('react').JSX.Element;
|
package/dist/core/index.d.ts
CHANGED
|
@@ -8,4 +8,4 @@ export type MetadataRendererProps = {
|
|
|
8
8
|
className?: string;
|
|
9
9
|
theme?: RendererTheme;
|
|
10
10
|
};
|
|
11
|
-
export declare function MetadataRenderer({ content, renderers, options, type, className, theme }: MetadataRendererProps): import(
|
|
11
|
+
export declare function MetadataRenderer({ content, renderers, options, type, className, theme }: MetadataRendererProps): import('react').JSX.Element;
|
package/dist/core/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RendererTheme } from '../types';
|
|
2
|
-
export type MetaType = 'csn' | 'openapi' | 'asyncapi' | 'a2a' | 'mcp' | 'unknown';
|
|
2
|
+
export type MetaType = 'csn' | 'openapi' | 'asyncapi' | 'overlay' | 'a2a' | 'mcp' | 'unknown';
|
|
3
3
|
export declare function loadObject(content: string): undefined | object;
|
|
4
4
|
export declare function detectMetaType(content: string): MetaType;
|
|
5
5
|
export declare function extractVersion(type: MetaType, content: string): string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CsnCustomAttributesConfig } from './types';
|
|
2
2
|
type Rec = Record<string, unknown>;
|
|
3
3
|
export declare function discoverAnnotationKeys(doc: Rec, prefix: string): string[];
|
|
4
|
+
export declare function stripAllAnnotations(html: string): string;
|
|
4
5
|
export declare function applyAnnotationRenderers(html: string, configs: CsnCustomAttributesConfig[], doc: Rec | null): string;
|
|
5
6
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/csn/index.d.ts
CHANGED
|
@@ -8,4 +8,4 @@ export type CsnRendererProps = {
|
|
|
8
8
|
className?: string;
|
|
9
9
|
theme?: RendererTheme;
|
|
10
10
|
};
|
|
11
|
-
export declare function CsnRenderer({ content, config, customAttributes, className, theme }: CsnRendererProps): import(
|
|
11
|
+
export declare function CsnRenderer({ content, config, customAttributes, className, theme }: CsnRendererProps): import('react').JSX.Element;
|
package/dist/csn.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as CsnRenderer } from "./chunks/csn-
|
|
1
|
+
import { t as CsnRenderer } from "./chunks/csn-CIBA2ds5.js";
|
|
2
2
|
export { CsnRenderer };
|