@redocly/theme 0.68.0-next.0 → 0.68.0-next.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/lib/components/Catalog/CatalogEntities.js +2 -11
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.js +3 -16
- package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.d.ts +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +3 -9
- package/lib/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.js +1 -7
- package/lib/components/Feedback/Feedback.js +4 -1
- package/lib/core/hooks/use-active-heading.js +5 -2
- package/lib/core/hooks/use-telemetry-fallback.d.ts +1 -1
- package/lib/core/hooks/use-telemetry-fallback.js +1 -1
- package/lib/core/styles/dark.js +11 -0
- package/lib/core/styles/global.js +36 -34
- package/lib/markdoc/components/NumberedList/NumberedItem.d.ts +25 -0
- package/lib/markdoc/components/NumberedList/NumberedItem.js +217 -0
- package/lib/markdoc/components/NumberedList/NumberedList.d.ts +5 -0
- package/lib/markdoc/components/NumberedList/NumberedList.js +28 -0
- package/lib/markdoc/components/NumberedList/variables.d.ts +1 -0
- package/lib/markdoc/components/NumberedList/variables.js +42 -0
- package/lib/markdoc/components/default.d.ts +2 -0
- package/lib/markdoc/components/default.js +2 -0
- package/lib/markdoc/default.js +4 -0
- package/lib/markdoc/tags/numbered-item.d.ts +2 -0
- package/lib/markdoc/tags/numbered-item.js +35 -0
- package/lib/markdoc/tags/numbered-list.d.ts +2 -0
- package/lib/markdoc/tags/numbered-list.js +28 -0
- package/package.json +1 -1
- package/src/components/Catalog/CatalogEntities.tsx +7 -11
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +8 -9
- package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +6 -8
- package/src/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.tsx +2 -4
- package/src/components/Feedback/Feedback.tsx +11 -1
- package/src/core/hooks/use-active-heading.ts +7 -2
- package/src/core/hooks/use-telemetry-fallback.ts +1 -1
- package/src/core/styles/dark.ts +12 -0
- package/src/core/styles/global.ts +2 -0
- package/src/markdoc/components/NumberedList/NumberedItem.tsx +274 -0
- package/src/markdoc/components/NumberedList/NumberedList.tsx +37 -0
- package/src/markdoc/components/NumberedList/variables.ts +39 -0
- package/src/markdoc/components/default.ts +2 -0
- package/src/markdoc/default.ts +4 -0
- package/src/markdoc/tags/numbered-item.ts +46 -0
- package/src/markdoc/tags/numbered-list.ts +34 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { css } from 'styled-components';
|
|
2
|
+
|
|
3
|
+
export const markdownNumberedList = css`
|
|
4
|
+
/**
|
|
5
|
+
* @tokens Markdown Numbered List
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
--md-numbered-list-margin: var(--spacing-sm) 0; // @presenter Spacing
|
|
9
|
+
--md-numbered-list-gap: var(--spacing-base); // @presenter Spacing
|
|
10
|
+
|
|
11
|
+
--md-numbered-list-marker-bg-color: var(--color-warm-grey-2); // @presenter Color
|
|
12
|
+
--md-numbered-list-marker-bg-color-hover: var(--color-warm-grey-3); // @presenter Color
|
|
13
|
+
--md-numbered-list-marker-icon-bg-color: transparent; // @presenter Color
|
|
14
|
+
--md-numbered-list-marker-text-color: var(--text-color-primary); // @presenter Color
|
|
15
|
+
--md-numbered-list-marker-font-size: var(--font-size-base); // @presenter FontSize
|
|
16
|
+
|
|
17
|
+
--md-numbered-list-marker-medium-size: 28px; // @presenter Spacing
|
|
18
|
+
--md-numbered-list-icon-medium-size: 16px; // @presenter Spacing
|
|
19
|
+
--md-numbered-list-tail-width: 1px; // @presenter Spacing
|
|
20
|
+
--md-numbered-list-marker-small-size: 24px; // @presenter Spacing
|
|
21
|
+
--md-numbered-list-icon-small-size: 12px; // @presenter Spacing
|
|
22
|
+
--md-numbered-list-dot-size: 10px; // @presenter Spacing
|
|
23
|
+
--md-numbered-list-dot-rail-padding-top: 7px; // @presenter Spacing
|
|
24
|
+
--md-numbered-list-dot-link-gap: 6px; // @presenter Spacing
|
|
25
|
+
|
|
26
|
+
--md-numbered-list-tail-bg-color: var(--md-numbered-list-marker-bg-color); // @presenter Color
|
|
27
|
+
--md-numbered-list-tail-fade-gradient: linear-gradient(to bottom, var(--md-numbered-list-tail-bg-color), transparent); // @presenter Color
|
|
28
|
+
|
|
29
|
+
--md-numbered-list-headline-text-color: var(--text-color-primary); // @presenter Color
|
|
30
|
+
--md-numbered-list-headline-font-size: var(--font-size-base); // @presenter FontSize
|
|
31
|
+
--md-numbered-list-headline-font-weight: var(--font-weight-medium); // @presenter FontWeight
|
|
32
|
+
--md-numbered-list-headline-line-height: var(--line-height-base); // @presenter LineHeight
|
|
33
|
+
|
|
34
|
+
--md-numbered-list-body-text-color: var(--text-color-secondary); // @presenter Color
|
|
35
|
+
--md-numbered-list-body-gap: var(--spacing-xs); // @presenter Spacing
|
|
36
|
+
--md-numbered-list-body-font-size: var(--font-size-base); // @presenter FontSize
|
|
37
|
+
|
|
38
|
+
// @tokens End
|
|
39
|
+
`;
|
|
@@ -8,6 +8,8 @@ export * from '@redocly/theme/markdoc/components/Tabs/TabItemFragment';
|
|
|
8
8
|
export * from '@redocly/theme/markdoc/components/Tabs/Tab';
|
|
9
9
|
export * from '@redocly/theme/markdoc/components/Tabs/TabList';
|
|
10
10
|
export * from '@redocly/theme/markdoc/components/Tabs/Tabs';
|
|
11
|
+
export * from '@redocly/theme/markdoc/components/NumberedList/NumberedItem';
|
|
12
|
+
export * from '@redocly/theme/markdoc/components/NumberedList/NumberedList';
|
|
11
13
|
export * from '@redocly/theme/markdoc/components/CodeBlock/CodeBlock';
|
|
12
14
|
export * from '@redocly/theme/markdoc/components/Cards/Cards';
|
|
13
15
|
export * from '@redocly/theme/markdoc/components/Cards/Card';
|
package/src/markdoc/default.ts
CHANGED
|
@@ -14,6 +14,8 @@ import { markdocExample } from '@redocly/theme/markdoc/tags/markdoc-example';
|
|
|
14
14
|
import { partial } from '@redocly/theme/markdoc/tags/partial';
|
|
15
15
|
import { tab } from '@redocly/theme/markdoc/tags/tab';
|
|
16
16
|
import { tabs } from '@redocly/theme/markdoc/tags/tabs';
|
|
17
|
+
import { numberedItem } from '@redocly/theme/markdoc/tags/numbered-item';
|
|
18
|
+
import { numberedList } from '@redocly/theme/markdoc/tags/numbered-list';
|
|
17
19
|
import { debug } from '@redocly/theme/markdoc/tags/debug';
|
|
18
20
|
import { codeSnippet } from '@redocly/theme/markdoc/tags/code-snippet';
|
|
19
21
|
import { inlineSvg } from '@redocly/theme/markdoc/tags/inline-svg';
|
|
@@ -38,6 +40,8 @@ export const tags = {
|
|
|
38
40
|
[partial.tagName]: partial.schema,
|
|
39
41
|
[tab.tagName]: tab.schema,
|
|
40
42
|
[tabs.tagName]: tabs.schema,
|
|
43
|
+
[numberedItem.tagName]: numberedItem.schema,
|
|
44
|
+
[numberedList.tagName]: numberedList.schema,
|
|
41
45
|
[codeSnippet.tagName]: codeSnippet.schema,
|
|
42
46
|
[inlineSvg.tagName]: inlineSvg.schema,
|
|
43
47
|
[cards.tagName]: cards.schema,
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import markdoc from '@markdoc/markdoc';
|
|
2
|
+
|
|
3
|
+
import type { MarkdocSchemaWrapper } from '@redocly/theme/markdoc/tags/types';
|
|
4
|
+
|
|
5
|
+
import { isTag } from '@redocly/theme/core/utils';
|
|
6
|
+
|
|
7
|
+
const HEADING_TAG_NAME = /^(Heading|h[1-6])$/;
|
|
8
|
+
|
|
9
|
+
export const numberedItem: MarkdocSchemaWrapper = {
|
|
10
|
+
schema: {
|
|
11
|
+
transform(node, config) {
|
|
12
|
+
const attributes = node.transformAttributes(config);
|
|
13
|
+
const children = node.transformChildren(config);
|
|
14
|
+
const [first, ...body] = children;
|
|
15
|
+
|
|
16
|
+
if (isTag(first) && HEADING_TAG_NAME.test(String(first.name))) {
|
|
17
|
+
const headlineLevel =
|
|
18
|
+
typeof first.attributes.level === 'number'
|
|
19
|
+
? first.attributes.level
|
|
20
|
+
: Number(String(first.name).slice(1)) || undefined;
|
|
21
|
+
|
|
22
|
+
return new markdoc.Tag(
|
|
23
|
+
'NumberedItem',
|
|
24
|
+
{
|
|
25
|
+
...attributes,
|
|
26
|
+
headline: first.children,
|
|
27
|
+
anchorId: first.attributes.id,
|
|
28
|
+
headlineLevel,
|
|
29
|
+
},
|
|
30
|
+
body,
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return new markdoc.Tag('NumberedItem', attributes, children);
|
|
35
|
+
},
|
|
36
|
+
attributes: {
|
|
37
|
+
icon: { type: String, resolver: 'relativeOrCdnIcon' },
|
|
38
|
+
iconRawContent: {
|
|
39
|
+
// internal use only
|
|
40
|
+
type: String,
|
|
41
|
+
render: true,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
tagName: 'numbered-item',
|
|
46
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import markdoc from '@markdoc/markdoc';
|
|
2
|
+
|
|
3
|
+
import type { Tag } from '@markdoc/markdoc';
|
|
4
|
+
import type { MarkdocSchemaWrapper } from '@redocly/theme/markdoc/tags/types';
|
|
5
|
+
|
|
6
|
+
import { isTag } from '@redocly/theme/core/utils';
|
|
7
|
+
|
|
8
|
+
export const numberedList: MarkdocSchemaWrapper = {
|
|
9
|
+
schema: {
|
|
10
|
+
transform(node, config) {
|
|
11
|
+
const attributes = node.transformAttributes(config);
|
|
12
|
+
const items = node
|
|
13
|
+
.transformChildren(config)
|
|
14
|
+
.filter((child): child is Tag => isTag(child) && child.name === 'NumberedItem');
|
|
15
|
+
|
|
16
|
+
items.forEach((item, index) => {
|
|
17
|
+
item.attributes = {
|
|
18
|
+
...item.attributes,
|
|
19
|
+
type: attributes.type,
|
|
20
|
+
size: attributes.size,
|
|
21
|
+
index: index + 1,
|
|
22
|
+
isLast: index === items.length - 1,
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
return new markdoc.Tag('NumberedList', attributes, items);
|
|
27
|
+
},
|
|
28
|
+
attributes: {
|
|
29
|
+
type: { type: String, matches: ['icon', 'number', 'dot'], default: 'number' },
|
|
30
|
+
size: { type: String, matches: ['small', 'medium'], default: 'medium' },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
tagName: 'numbered-list',
|
|
34
|
+
};
|