@redocly/portal-plugin-async-api 1.0.202 → 1.0.203

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/src/template.tsx CHANGED
@@ -1,18 +1,16 @@
1
1
  import AsyncApiComponent from '@asyncapi/react-component';
2
2
  import React from 'react';
3
3
  import styled from 'styled-components';
4
- // @ts-ignore
5
4
  import { Breadcrumbs as ThemeBreadcrumbs } from '@redocly/theme';
6
- import '@asyncapi/react-component/lib/styles/fiori.css';
7
5
 
8
6
  import type { ConfigInterface, AsyncApiProps } from '@asyncapi/react-component';
9
7
  import type { PageProps } from '@redocly/realm/dist/shared/types';
10
8
  import type { AsyncApiDocsSettings } from './config';
11
- import type { ExpandConfig, ShowConfig } from '@asyncapi/react-component/lib/config';
12
9
 
13
10
  // @ts-ignore has no exported member error
14
11
  import { usePageSharedData } from '@portal/hooks';
15
12
 
13
+ import '@asyncapi/react-component/styles/default.css';
16
14
  import { StylesProvider } from './styles.js';
17
15
 
18
16
  interface AsyncApiDocsProps {
@@ -25,47 +23,33 @@ function AsyncApiDocs({ pageProps }: AsyncApiDocsProps) {
25
23
  const { settings = {} } = pageProps;
26
24
  const asyncApiDefinition = usePageSharedData('AsyncApiDefinition') as AsyncApiProps['schema'];
27
25
 
28
- const {
29
- schemaId,
30
- hideChannels,
31
- hideErrors,
32
- hideInfo,
33
- hideMessages,
34
- hideSchemas,
35
- hideServers,
36
- expandChannels,
37
- expandMessages,
38
- expandSchemas,
39
- expandServers,
40
- } = settings;
26
+ const { schemaId, hideOperations, hideErrors, hideInfo, hideMessages, hideSchemas, hideServers } =
27
+ settings;
41
28
 
42
- const componentConfig: Partial<
43
- ConfigInterface & {
44
- showErrors?: boolean;
45
- show: ShowConfig & { channels?: boolean };
46
- expand: ExpandConfig & {
47
- schemas?: AsyncApiDocsSettings['expandSchemas'];
48
- channels?: AsyncApiDocsSettings['expandChannels'];
49
- messages?: AsyncApiDocsSettings['expandMessages'];
50
- servers?: AsyncApiDocsSettings['expandServers'];
51
- };
52
- }
53
- > = {
29
+ const componentConfig: Partial<ConfigInterface> = {
54
30
  schemaID: schemaId,
55
- showErrors: !hideErrors,
56
31
  show: {
32
+ errors: !hideErrors,
57
33
  info: !hideInfo,
58
- channels: !hideChannels,
34
+ operations: !hideOperations,
59
35
  servers: !hideServers,
60
36
  messages: !hideMessages,
61
37
  schemas: !hideSchemas,
38
+ sidebar: false,
62
39
  },
63
40
  expand: {
64
- schemas: expandSchemas,
65
- channels: expandChannels,
66
- messages: expandMessages,
67
- servers: expandServers,
41
+ messageExamples: false,
68
42
  },
43
+ sidebar: {
44
+ showServers: 'byDefault',
45
+ showOperations: 'byDefault',
46
+ },
47
+ publishLabel: 'PUBLISHER',
48
+ subscribeLabel: 'SUBSCRIBER',
49
+ sendLabel: 'SEND',
50
+ receiveLabel: 'RECEIVE',
51
+ requestLabel: 'REQUEST',
52
+ replyLabel: 'REPLY',
69
53
  };
70
54
 
71
55
  return (