asyncapi-viewer 2.0.0

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 ADDED
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "asyncapi-viewer",
3
+ "version": "2.0.0",
4
+ "description": "Renders AsyncAPI 2 and 3 documents as a web component: <asyncapi-viewer src=\"...\">",
5
+ "keywords": [
6
+ "asyncapi",
7
+ "web-component",
8
+ "documentation",
9
+ "event-driven",
10
+ "api",
11
+ "lit"
12
+ ],
13
+ "license": "MIT",
14
+ "homepage": "https://weesho-lapara.github.io/asyncapi-viewer/",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/Weesho-Lapara/asyncapi-viewer.git",
18
+ "directory": "viewer"
19
+ },
20
+ "bugs": "https://github.com/Weesho-Lapara/asyncapi-viewer/issues",
21
+ "type": "module",
22
+ "sideEffects": true,
23
+ "files": [
24
+ "dist",
25
+ "theme",
26
+ "README.md"
27
+ ],
28
+ "main": "./dist/asyncapi-viewer.js",
29
+ "module": "./dist/asyncapi-viewer.js",
30
+ "exports": {
31
+ ".": "./dist/asyncapi-viewer.js",
32
+ "./iife": "./dist/asyncapi-viewer.iife.js",
33
+ "./theme/asyncapi-theme.css": "./theme/asyncapi-theme.css"
34
+ },
35
+ "publishConfig": {
36
+ "access": "public"
37
+ },
38
+ "scripts": {
39
+ "dev": "vite",
40
+ "build": "vite build",
41
+ "typecheck": "tsc --noEmit",
42
+ "lint": "eslint .",
43
+ "check": "npm run typecheck && npm run lint",
44
+ "test": "vitest run",
45
+ "test:watch": "vitest",
46
+ "coverage": "tsx scripts/coverage.ts",
47
+ "e2e": "playwright test",
48
+ "e2e:install": "playwright install --with-deps",
49
+ "sync-examples": "tsx scripts/sync-spec-examples.ts"
50
+ },
51
+ "dependencies": {
52
+ "lit": "^3.3.0",
53
+ "markdown-it": "^15.0.2",
54
+ "yaml": "^2.9.1"
55
+ },
56
+ "devDependencies": {
57
+ "@axe-core/playwright": "^4.13.0",
58
+ "@eslint/js": "^10.0.0",
59
+ "@playwright/test": "^1.63.0",
60
+ "@types/markdown-it": "^14.2.0",
61
+ "@types/node": "^22.20.4",
62
+ "eslint": "^10.0.0",
63
+ "tsx": "^4.23.15",
64
+ "typescript": "^5.9.0",
65
+ "typescript-eslint": "^8.70.0",
66
+ "vite": "^8.0.0",
67
+ "vitest": "^5.0.0"
68
+ },
69
+ "engines": {
70
+ "node": ">=22"
71
+ }
72
+ }
@@ -0,0 +1,53 @@
1
+ /* asyncapi-theme.css: copy this file, change the values, load it after the viewer script.
2
+ Only the two accents and the optional logo are needed; everything else is derived.
3
+ Advanced variables (fonts, radius, example width, neutral tokens) are listed in the
4
+ Customising page of the documentation. */
5
+ asyncapi-viewer {
6
+ --asyncapi-primary: #2944C9; /* send operations, links, highlights */
7
+ --asyncapi-secondary: #B84E1A; /* receive operations, required labels */
8
+ /* --asyncapi-logo: url("/assets/logo.svg"); optional; use a site-absolute path */
9
+ /* --asyncapi-logo-dark: url("/assets/logo-dark.svg"); optional */
10
+ }
11
+
12
+ /* Match a Material for MkDocs palette instead (opt-in, see ROADMAP amendment 12):
13
+ asyncapi-viewer {
14
+ --asyncapi-primary: var(--md-primary-fg-color);
15
+ --asyncapi-font-body: var(--md-text-font-family);
16
+ --asyncapi-font-mono: var(--md-code-font-family);
17
+ }
18
+ */
19
+
20
+ /* Fonts. The defaults are the typefaces Swagger UI uses, so both viewers look alike on one
21
+ site, but the viewer never loads web fonts itself (CSP, privacy, offline builds): without
22
+ them on the page the system fallbacks apply. To get the design fonts, load them once in the
23
+ page, for example from Google Fonts:
24
+
25
+ <link rel="preconnect" href="https://fonts.googleapis.com">
26
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
27
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600&family=Titillium+Web:wght@600&family=Source+Code+Pro:wght@400;500&display=swap">
28
+
29
+ (MkDocs: extra_css or the theme's font settings; a self-hosted @font-face works the same.) */
30
+
31
+ /* Advanced variables, all optional. Values shown are the defaults.
32
+ asyncapi-viewer {
33
+ --asyncapi-send: var(--asyncapi-primary); send and request badges
34
+ --asyncapi-receive: var(--asyncapi-secondary); receive and reply badges
35
+ --asyncapi-font-heading: 'Titillium Web', ui-sans-serif, system-ui, sans-serif;
36
+ --asyncapi-font-body: 'Open Sans', ui-sans-serif, system-ui, sans-serif;
37
+ --asyncapi-font-mono: 'Source Code Pro', ui-monospace, SFMono-Regular, Menlo, monospace;
38
+ --asyncapi-radius: 10px;
39
+ --asyncapi-example-width: 452px; clamped between 360px and 560px
40
+ --asyncapi-example-bg: #12141A; the example panel, both themes
41
+ --asyncapi-bg: #F6F5F1; page background (dark: #0F1115)
42
+ --asyncapi-surface: #FFFFFF; cards, header (dark: #161920)
43
+ --asyncapi-sidebar: #EFEDE7; sidebar (dark: #12151A)
44
+ --asyncapi-head: #F8F7F3; table and tree toolbars (dark: #1B1F27)
45
+ --asyncapi-ink: #17191F; main text (dark: #ECEDEF)
46
+ --asyncapi-ink-2: #3A3E48; secondary text (dark: #C4C8D0)
47
+ --asyncapi-muted: #5E626D; labels, meta (dark: #959BA7)
48
+ --asyncapi-line: #E3E0D8; borders (dark: #262A33)
49
+ --asyncapi-line-2: #C9C5BA; tree guide lines (dark: #3A404C)
50
+ }
51
+ Scope a value to one mode with the attribute the viewer reflects:
52
+ asyncapi-viewer[resolved-theme="dark"] { --asyncapi-bg: #000; }
53
+ */