apiuikit 0.2.1 → 0.5.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.
Files changed (77) hide show
  1. package/README.md +47 -3
  2. package/dist/LinkedInExtension-6xekO5bX.cjs +1 -0
  3. package/dist/LinkedInExtension-BL-4T9tt.js +21 -0
  4. package/dist/LogoExtension-BOYrY_RE.cjs +1 -0
  5. package/dist/LogoExtension-HOlSsQf-.js +27 -0
  6. package/dist/XExtension-GyRtdHLL.js +23 -0
  7. package/dist/XExtension-jAiATfg-.cjs +1 -0
  8. package/dist/apiuikit.cjs.js +1 -1
  9. package/dist/apiuikit.css +1 -1
  10. package/dist/apiuikit.es.js +16 -9
  11. package/dist/components/Bindings.d.ts +3 -1
  12. package/dist/components/InfoMetadata.d.ts +7 -1
  13. package/dist/components/Navigation.d.ts +11 -4
  14. package/dist/components/RenderExtensions.d.ts +15 -0
  15. package/dist/components/SearchPanel.d.ts +9 -0
  16. package/dist/components/schema/SchemaNode.d.ts +10 -1
  17. package/dist/components/schema/SchemaTab.d.ts +8 -1
  18. package/dist/components/schema/SchemaTree.d.ts +5 -1
  19. package/dist/components/schema/SchemaTreeRow.d.ts +2 -1
  20. package/dist/components/tests/Authorization.test.d.ts +1 -0
  21. package/dist/components/tests/RenderExtensions.test.d.ts +1 -0
  22. package/dist/config/config.d.ts +3 -0
  23. package/dist/containers/AsyncAPI/AsyncAPI.d.ts +12 -6
  24. package/dist/containers/AsyncAPI/AsyncAPIDocumentProvider.d.ts +12 -0
  25. package/dist/containers/AsyncAPI/AsyncAPIRenderer.d.ts +9 -0
  26. package/dist/containers/AsyncAPI/tests/searchHighlight.test.d.ts +1 -0
  27. package/dist/containers/Messages/MessageDetails.d.ts +3 -1
  28. package/dist/containers/Messages/Messages.d.ts +3 -1
  29. package/dist/containers/Operation/Operation.d.ts +3 -1
  30. package/dist/containers/Operation/Operations.d.ts +3 -1
  31. package/dist/containers/Schema/Schemas.d.ts +6 -1
  32. package/dist/containers/Server/Server.d.ts +8 -1
  33. package/dist/containers/Server/Servers.d.ts +7 -3
  34. package/dist/contexts/useSpec.d.ts +2 -0
  35. package/dist/helpers/protobuf/lazyProtoToJsonSchema.d.ts +14 -0
  36. package/dist/helpers/schemaFormat.d.ts +3 -0
  37. package/dist/helpers/searchIndex.d.ts +18 -0
  38. package/dist/helpers/textHighlight.d.ts +2 -0
  39. package/dist/hooks/useSpecSearch.d.ts +13 -0
  40. package/dist/icons/Search.d.ts +3 -0
  41. package/dist/icons/Server.d.ts +4 -3
  42. package/dist/index-BG6colCU.js +11473 -0
  43. package/dist/{index-DqcOEYz_.cjs → index-BcNlIoEF.cjs} +1 -1
  44. package/dist/index-Bmw7IyyF.cjs +73 -0
  45. package/dist/{index-yG3rYT_D.js → index-CEf0X0H_.js} +1 -1
  46. package/dist/index.d.ts +2 -0
  47. package/dist/protoToJsonSchema-BcqPKXqK.js +6174 -0
  48. package/dist/protoToJsonSchema-C43lKcgx.cjs +83 -0
  49. package/dist/protobufSchemaParser-BQVXzHsQ.js +55 -0
  50. package/dist/protobufSchemaParser-sEw46uRx.cjs +1 -0
  51. package/dist/public/sections.d.ts +45 -0
  52. package/dist/public/tests/sections.test.d.ts +1 -0
  53. package/dist/stories/AsyncAPI.stories.d.ts +6 -0
  54. package/dist/stories/AsyncAPIRenderer.stories.d.ts +6 -0
  55. package/dist/stories/Authorization.stories.d.ts +13 -0
  56. package/dist/stories/Bindings.stories.d.ts +12 -0
  57. package/dist/stories/ChannelAddress.stories.d.ts +13 -0
  58. package/dist/stories/CodeBlock.stories.d.ts +11 -0
  59. package/dist/stories/Examples.stories.d.ts +11 -0
  60. package/dist/stories/Information.stories.d.ts +1 -0
  61. package/dist/stories/Message.stories.d.ts +11 -0
  62. package/dist/stories/Messages.stories.d.ts +11 -0
  63. package/dist/stories/Operation.stories.d.ts +10 -0
  64. package/dist/stories/Operations.stories.d.ts +16 -0
  65. package/dist/stories/SchemaTab.stories.d.ts +12 -0
  66. package/dist/stories/SchemaTree.stories.d.ts +1 -0
  67. package/dist/stories/SearchPanel.stories.d.ts +16 -0
  68. package/dist/stories/Server.stories.d.ts +4 -1
  69. package/dist/stories/TabToggle.stories.d.ts +10 -0
  70. package/dist/stories/Tabs.stories.d.ts +11 -0
  71. package/dist/stories/documentContextDecorator.d.ts +25 -0
  72. package/dist/stories/noCanvasDocsPage.d.ts +9 -0
  73. package/package.json +5 -4
  74. package/dist/index-BYmrdiVi.cjs +0 -155
  75. package/dist/index-DfH4J5EL.js +0 -15436
  76. package/dist/stories/Button.d.ts +0 -14
  77. package/dist/stories/Button.stories.d.ts +0 -23
@@ -0,0 +1,11 @@
1
+ import { StoryObj } from '@storybook/react';
2
+ import { Examples } from '../components/Examples';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof Examples;
6
+ decorators: ((Story: import('react').ComponentType) => import("react").JSX.Element)[];
7
+ };
8
+ export default meta;
9
+ type Story = StoryObj<typeof meta>;
10
+ export declare const Default: Story;
11
+ export declare const WithEnumAndExamples: Story;
@@ -2,6 +2,7 @@ import { StoryObj } from '@storybook/react';
2
2
  declare const meta: {
3
3
  title: string;
4
4
  component: import('react').FunctionComponent<import('../types/asyncapi/Info').Info>;
5
+ decorators: ((Story: import('react').ComponentType) => import("react").JSX.Element)[];
5
6
  };
6
7
  export default meta;
7
8
  type Story = StoryObj<typeof meta>;
@@ -0,0 +1,11 @@
1
+ import { StoryObj } from '@storybook/react';
2
+ import { Message } from '../containers/Messages/Message';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof Message;
6
+ decorators: ((Story: import('react').ComponentType) => import("react").JSX.Element)[];
7
+ };
8
+ export default meta;
9
+ type Story = StoryObj<typeof meta>;
10
+ export declare const Default: Story;
11
+ export declare const Expanded: Story;
@@ -0,0 +1,11 @@
1
+ import { StoryObj } from '@storybook/react';
2
+ import { Messages } from '../public/sections';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof Messages;
6
+ decorators: ((Story: import('react').ComponentType) => import("react").JSX.Element)[];
7
+ tags: string[];
8
+ };
9
+ export default meta;
10
+ type Story = StoryObj<typeof meta>;
11
+ export declare const Default: Story;
@@ -0,0 +1,10 @@
1
+ import { StoryObj } from '@storybook/react';
2
+ import { default as Operation } from '../containers/Operation/Operation';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof Operation;
6
+ decorators: ((Story: import('react').ComponentType) => import("react").JSX.Element)[];
7
+ };
8
+ export default meta;
9
+ type Story = StoryObj<typeof meta>;
10
+ export declare const Default: Story;
@@ -0,0 +1,16 @@
1
+ import { StoryObj } from '@storybook/react';
2
+ import { Operations } from '../public/sections';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof Operations;
6
+ decorators: ((Story: import('react').ComponentType) => import("react").JSX.Element)[];
7
+ tags: string[];
8
+ parameters: {
9
+ docs: {
10
+ page: () => import("react").JSX.Element;
11
+ };
12
+ };
13
+ };
14
+ export default meta;
15
+ type Story = StoryObj<typeof meta>;
16
+ export declare const Default: Story;
@@ -0,0 +1,12 @@
1
+ import { StoryObj } from '@storybook/react';
2
+ import { default as SchemaTab } from '../components/schema/SchemaTab';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof SchemaTab;
6
+ decorators: ((Story: import('react').ComponentType) => import("react").JSX.Element)[];
7
+ tags: string[];
8
+ };
9
+ export default meta;
10
+ type Story = StoryObj<typeof meta>;
11
+ export declare const Default: Story;
12
+ export declare const ConversionError: Story;
@@ -5,6 +5,7 @@ declare const meta: {
5
5
  title: string;
6
6
  component: typeof SchemaTree;
7
7
  decorators: ((Story: ComponentType) => import("react").JSX.Element)[];
8
+ tags: string[];
8
9
  };
9
10
  export default meta;
10
11
  type Story = StoryObj<typeof meta>;
@@ -0,0 +1,16 @@
1
+ import { StoryObj } from '@storybook/react';
2
+ import { default as SearchPanel } from '../components/SearchPanel';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof SearchPanel;
6
+ decorators: ((Story: import('react').ComponentType) => import("react").JSX.Element)[];
7
+ args: {
8
+ query: string;
9
+ onQueryChange: () => void;
10
+ results: never[];
11
+ onSelectResult: import('@vitest/spy').Mock<(...args: any[]) => any>;
12
+ };
13
+ };
14
+ export default meta;
15
+ type Story = StoryObj<typeof meta>;
16
+ export declare const Default: Story;
@@ -1,9 +1,12 @@
1
1
  import { StoryObj } from '@storybook/react';
2
- import { default as Servers } from '../containers/Server/Servers';
2
+ import { Servers } from '../public/sections';
3
3
  declare const meta: {
4
4
  title: string;
5
5
  component: typeof Servers;
6
+ decorators: ((Story: import('react').ComponentType) => import("react").JSX.Element)[];
7
+ tags: string[];
6
8
  };
7
9
  export default meta;
8
10
  type Story = StoryObj<typeof meta>;
9
11
  export declare const Default: Story;
12
+ export declare const SingleServer: Story;
@@ -0,0 +1,10 @@
1
+ import { StoryObj } from '@storybook/react';
2
+ import { default as TabToggle } from '../components/TabToggle';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof TabToggle;
6
+ decorators: ((Story: import('react').ComponentType) => import("react").JSX.Element)[];
7
+ };
8
+ export default meta;
9
+ type Story = StoryObj<typeof meta>;
10
+ export declare const Default: Story;
@@ -0,0 +1,11 @@
1
+ import { StoryObj } from '@storybook/react';
2
+ import { default as Tabs } from '../components/Tabs';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof Tabs;
6
+ decorators: ((Story: import('react').ComponentType) => import("react").JSX.Element)[];
7
+ };
8
+ export default meta;
9
+ type Story = StoryObj<typeof meta>;
10
+ export declare const WithIcons: Story;
11
+ export declare const Plain: Story;
@@ -0,0 +1,25 @@
1
+ import { ComponentType } from 'react';
2
+ /**
3
+ * Centers a component story at one consistent max width and makes it fill that
4
+ * width. Scoped per-story (not global) on purpose: the full-page AsyncAPI
5
+ * example stories should render edge-to-edge, so centering must not be applied
6
+ * globally in preview.
7
+ */
8
+ export declare const centeredDecorator: (Story: ComponentType) => import("react").JSX.Element;
9
+ /**
10
+ * Shared Storybook decorator for rendering container components
11
+ * (Servers/Messages/Operations) in isolation. Those components, and their
12
+ * children (ChannelAddress, MessageDetails, the schema tree), read from
13
+ * AsyncAPIDocumentContext via useAsyncAPIDocument, which throws without a
14
+ * provider. This wraps a story in that provider, backed by a real document.
15
+ *
16
+ * `resolveDocument` inlines the doc's $refs (server security, message
17
+ * payloads, …) the way the production render path does, so stories show
18
+ * fully-resolved content instead of raw { $ref } wrappers, and the `deref`
19
+ * fallback below resolves any refs left in place (e.g. cycle-forming ones).
20
+ */
21
+ export declare function buildDocumentContext(rawDoc: unknown): {
22
+ document: Record<string, unknown>;
23
+ deref: (refPath: string) => unknown;
24
+ decorator: (Story: ComponentType) => import("react").JSX.Element;
25
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * A docs page with no live component canvas, just the description and prop
3
+ * table. Default autodocs embeds every story's canvas inline, sharing one DOM
4
+ * across the whole page: fine for a self-contained component, but this
5
+ * library's full-page widgets and portal/fixed-id-based components (search
6
+ * highlighting, side panels) don't render correctly when multiple instances
7
+ * share a page. Use this for those; leave default autodocs for the rest.
8
+ */
9
+ export declare const NoCanvasDocsPage: () => import("react").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apiuikit",
3
- "version": "0.2.1",
3
+ "version": "0.5.0",
4
4
  "description": "A React UI library for rendering your API specifications",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -41,6 +41,7 @@
41
41
  "dependencies": {
42
42
  "@asyncapi/specs": "^6.8.1",
43
43
  "@json-schema-tools/reference-resolver": "^1.2.6",
44
+ "fuse.js": "^7.5.0",
44
45
  "highlight.js": "^11.11.1",
45
46
  "isomorphic-dompurify": "^2.24.0",
46
47
  "json-schema-faker": "^0.6.2",
@@ -49,7 +50,6 @@
49
50
  "marked-highlight": "^2.2.1",
50
51
  "protobufjs": "^7.4.0",
51
52
  "react-markdown": "^9.0.3",
52
- "react-syntax-highlighter": "^15.6.1",
53
53
  "remark-gfm": "^4.0.1"
54
54
  },
55
55
  "peerDependencies": {
@@ -64,6 +64,7 @@
64
64
  },
65
65
  "devDependencies": {
66
66
  "@asyncapi/modelina": "^5.10.1",
67
+ "@asyncapi/parser": "^3.6.0",
67
68
  "@chromatic-com/storybook": "^3.2.3",
68
69
  "@eslint/js": "^9.17.0",
69
70
  "@storybook/addon-a11y": "^8.6.18",
@@ -81,7 +82,6 @@
81
82
  "@testing-library/react": "^16.3.2",
82
83
  "@types/react": "^19.0.0",
83
84
  "@types/react-dom": "^19.0.0",
84
- "@types/react-syntax-highlighter": "^15.5.13",
85
85
  "@vitejs/plugin-react": "^4.3.4",
86
86
  "eslint": "^9.17.0",
87
87
  "eslint-plugin-react-hooks": "^5.0.0",
@@ -98,7 +98,8 @@
98
98
  "typescript-eslint": "^8.18.2",
99
99
  "vite": "^6.0.5",
100
100
  "vite-plugin-dts": "^5.0.3",
101
- "vitest": "^4.1.10"
101
+ "vitest": "^4.1.10",
102
+ "x-tensions": "*"
102
103
  },
103
104
  "eslintConfig": {
104
105
  "extends": [