jvetrau-ds 0.1.34 → 0.1.35
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/components/action-group/action-group.d.ts +3 -4
- package/components/action-group/index.d.ts +2 -2
- package/components/attach/attach.d.ts +5 -6
- package/components/attach/index.d.ts +2 -2
- package/components/avatar/avatar.d.ts +4 -5
- package/components/avatar/index.d.ts +2 -2
- package/components/breadcrumbs/breadcrumbs.d.ts +5 -6
- package/components/breadcrumbs/index.d.ts +2 -2
- package/components/button/button.d.ts +3 -4
- package/components/button/index.d.ts +2 -2
- package/components/button-icon/button-icon.d.ts +4 -5
- package/components/button-icon/index.d.ts +2 -3
- package/components/card/card.d.ts +3 -4
- package/components/card/index.d.ts +2 -2
- package/components/card-group/card-group.d.ts +3 -4
- package/components/card-group/index.d.ts +2 -2
- package/components/checkbox/checkbox.d.ts +2 -4
- package/components/checkbox/index.d.ts +2 -2
- package/components/dropdown/dropdown.d.ts +4 -5
- package/components/dropdown/index.d.ts +2 -2
- package/components/field/field.d.ts +2 -4
- package/components/field/index.d.ts +2 -2
- package/components/field-group/field-group.d.ts +3 -4
- package/components/field-group/index.d.ts +2 -2
- package/components/helpers/classnames.d.ts +2 -3
- package/components/index.cjs +6 -0
- package/components/index.d.ts +48 -25
- package/components/index.js +1 -0
- package/components/input/index.d.ts +2 -2
- package/components/input/input.d.ts +2 -4
- package/components/logo/index.d.ts +2 -2
- package/components/logo/logo.d.ts +3 -4
- package/components/markdown/index.cjs +13 -0
- package/components/markdown/index.cjs.map +1 -0
- package/components/markdown/index.d.ts +2 -0
- package/components/markdown/index.js +3 -0
- package/components/markdown/index.js.map +1 -0
- package/components/markdown/markdown.cjs +126 -0
- package/components/markdown/markdown.cjs.map +1 -0
- package/components/markdown/markdown.css +196 -0
- package/components/markdown/markdown.d.ts +8 -0
- package/components/markdown/markdown.js +119 -0
- package/components/markdown/markdown.js.map +1 -0
- package/components/menu/index.d.ts +2 -2
- package/components/menu/menu.d.ts +4 -5
- package/components/panel/index.d.ts +2 -2
- package/components/panel/panel.d.ts +3 -4
- package/components/progressbar/index.d.ts +2 -2
- package/components/progressbar/progressbar.d.ts +3 -4
- package/components/radio/index.d.ts +2 -2
- package/components/radio/radio.d.ts +2 -4
- package/components/richedit/index.d.ts +2 -2
- package/components/richedit/richedit.d.ts +3 -4
- package/components/search/index.d.ts +2 -2
- package/components/search/search.d.ts +2 -4
- package/components/select/index.d.ts +2 -2
- package/components/select/select.d.ts +2 -4
- package/components/tabs/index.d.ts +2 -2
- package/components/tabs/tabs.d.ts +4 -5
- package/components/tag/index.d.ts +2 -2
- package/components/tag/tag.d.ts +2 -4
- package/components/textarea/index.d.ts +2 -2
- package/components/textarea/textarea.d.ts +2 -4
- package/components/video/index.d.ts +2 -2
- package/components/video/video.d.ts +6 -7
- package/icons/assets/arrow-link.d.ts +2 -6
- package/icons/assets/arrow-right.d.ts +2 -6
- package/icons/assets/chevron-left.d.ts +2 -6
- package/icons/assets/chevron-right.d.ts +2 -6
- package/icons/assets/fullscreen.d.ts +2 -6
- package/icons/assets/pause.d.ts +2 -6
- package/icons/assets/play.d.ts +2 -6
- package/icons/assets/settings.d.ts +2 -6
- package/icons/assets/sound-off.d.ts +2 -6
- package/icons/assets/sound.d.ts +2 -6
- package/icons/icon.d.ts +5 -6
- package/icons/index.d.ts +3 -3
- package/icons/manifest.d.ts +52 -2
- package/icons/public.d.ts +3 -3
- package/icons/registry.d.ts +2 -6
- package/icons/types.d.ts +8 -2
- package/index.cjs +12 -6
- package/index.d.ts +76 -37
- package/index.js +2 -1
- package/layouts/auth/auth.d.ts +3 -4
- package/layouts/auth/index.d.ts +2 -2
- package/layouts/base/base.d.ts +6 -7
- package/layouts/base/index.d.ts +2 -3
- package/layouts/foundation/foundation.d.ts +4 -5
- package/layouts/foundation/index.d.ts +2 -2
- package/layouts/public.d.ts +8 -5
- package/layouts/sidebar/index.d.ts +2 -3
- package/layouts/sidebar/sidebar.d.ts +4 -5
- package/lib/naming.d.ts +9 -11
- package/lib/resolve-asset.d.ts +1 -3
- package/package.json +1 -1
- package/patterns/footer/footer.d.ts +3 -4
- package/patterns/footer/index.d.ts +2 -2
- package/patterns/form/form.d.ts +3 -4
- package/patterns/form/index.d.ts +2 -2
- package/patterns/header/header.d.ts +3 -4
- package/patterns/header/index.d.ts +2 -2
- package/patterns/index.d.ts +12 -7
- package/patterns/masthead/index.d.ts +2 -2
- package/patterns/masthead/masthead.d.ts +3 -4
- package/patterns/modal/index.d.ts +2 -2
- package/patterns/modal/modal.d.ts +3 -4
- package/patterns/public.d.ts +1 -7
- package/patterns/screen-header/index.d.ts +2 -2
- package/patterns/screen-header/screen-header.d.ts +3 -4
- package/styles.css +198 -0
- package/tokens/public.d.ts +1 -1
- package/tokens/runtime/_tokens.internal.runtime.d.ts +1 -3
- package/tokens/runtime/index.d.ts +1 -1
- package/tokens/runtime/tokens.base.desktop.runtime.d.ts +4 -6
- package/tokens/runtime/tokens.base.diagram.runtime.d.ts +4 -6
- package/tokens/runtime/tokens.base.mobile.runtime.d.ts +4 -6
- package/tokens/runtime/tokens.brandcopilot.desktop.runtime.d.ts +4 -6
- package/tokens/runtime/tokens.brandcopilot.diagram.runtime.d.ts +4 -6
- package/tokens/runtime/tokens.brandcopilot.mobile.runtime.d.ts +4 -6
- package/tokens/runtime/tokens.dmpatterns.desktop.runtime.d.ts +4 -6
- package/tokens/runtime/tokens.dmpatterns.diagram.runtime.d.ts +4 -6
- package/tokens/runtime/tokens.dmpatterns.mobile.runtime.d.ts +4 -6
- package/tokens/runtime/tokens.pdigest.desktop.runtime.d.ts +4 -6
- package/tokens/runtime/tokens.pdigest.diagram.runtime.d.ts +4 -6
- package/tokens/runtime/tokens.pdigest.mobile.runtime.d.ts +4 -6
- package/tokens/runtime/tokens.redesigntrack.desktop.runtime.d.ts +4 -6
- package/tokens/runtime/tokens.redesigntrack.diagram.runtime.d.ts +4 -6
- package/tokens/runtime/tokens.redesigntrack.mobile.runtime.d.ts +4 -6
- package/tokens/runtime/tokens.runtime.d.ts +2 -1
- package/tokens/schema.d.ts +26 -0
- package/tokens/themes/config.d.ts +22 -0
- package/tokens/themes/registry-dist.d.ts +5 -26
- package/components/action-group/action-group.d.cts +0 -9
- package/components/action-group/index.d.cts +0 -2
- package/components/attach/attach.d.cts +0 -20
- package/components/attach/index.d.cts +0 -2
- package/components/avatar/avatar.d.cts +0 -17
- package/components/avatar/index.d.cts +0 -2
- package/components/breadcrumbs/breadcrumbs.d.cts +0 -14
- package/components/breadcrumbs/index.d.cts +0 -2
- package/components/button/button.d.cts +0 -9
- package/components/button/index.d.cts +0 -2
- package/components/button-icon/button-icon.d.cts +0 -11
- package/components/button-icon/index.d.cts +0 -3
- package/components/card/card.d.cts +0 -11
- package/components/card/index.d.cts +0 -2
- package/components/card-group/card-group.d.cts +0 -8
- package/components/card-group/index.d.cts +0 -2
- package/components/checkbox/checkbox.d.cts +0 -8
- package/components/checkbox/index.d.cts +0 -2
- package/components/dropdown/dropdown.d.cts +0 -26
- package/components/dropdown/index.d.cts +0 -2
- package/components/field/field.d.cts +0 -15
- package/components/field/index.d.cts +0 -2
- package/components/field-group/field-group.d.cts +0 -8
- package/components/field-group/index.d.cts +0 -2
- package/components/helpers/classnames.d.cts +0 -4
- package/components/index.d.cts +0 -25
- package/components/input/index.d.cts +0 -2
- package/components/input/input.d.cts +0 -8
- package/components/logo/index.d.cts +0 -2
- package/components/logo/logo.d.cts +0 -9
- package/components/menu/index.d.cts +0 -2
- package/components/menu/menu.d.cts +0 -18
- package/components/panel/index.d.cts +0 -2
- package/components/panel/panel.d.cts +0 -10
- package/components/progressbar/index.d.cts +0 -2
- package/components/progressbar/progressbar.d.cts +0 -17
- package/components/radio/index.d.cts +0 -2
- package/components/radio/radio.d.cts +0 -8
- package/components/richedit/index.d.cts +0 -2
- package/components/richedit/richedit.d.cts +0 -8
- package/components/search/index.d.cts +0 -2
- package/components/search/search.d.cts +0 -8
- package/components/select/index.d.cts +0 -2
- package/components/select/select.d.cts +0 -8
- package/components/tabs/index.d.cts +0 -2
- package/components/tabs/tabs.d.cts +0 -15
- package/components/tag/index.d.cts +0 -2
- package/components/tag/tag.d.cts +0 -8
- package/components/textarea/index.d.cts +0 -2
- package/components/textarea/textarea.d.cts +0 -8
- package/components/video/index.d.cts +0 -2
- package/components/video/video.d.cts +0 -36
- package/icons/assets/arrow-link.d.cts +0 -6
- package/icons/assets/arrow-right.d.cts +0 -6
- package/icons/assets/chevron-left.d.cts +0 -6
- package/icons/assets/chevron-right.d.cts +0 -6
- package/icons/assets/fullscreen.d.cts +0 -6
- package/icons/assets/pause.d.cts +0 -6
- package/icons/assets/play.d.cts +0 -6
- package/icons/assets/settings.d.cts +0 -6
- package/icons/assets/sound-off.d.cts +0 -6
- package/icons/assets/sound.d.cts +0 -6
- package/icons/icon.d.cts +0 -10
- package/icons/index.d.cts +0 -3
- package/icons/manifest.d.cts +0 -2
- package/icons/public.d.cts +0 -3
- package/icons/registry.d.cts +0 -6
- package/icons/types.d.cts +0 -2
- package/index.d.cts +0 -37
- package/layouts/auth/auth.d.cts +0 -9
- package/layouts/auth/index.d.cts +0 -2
- package/layouts/base/base.d.cts +0 -15
- package/layouts/base/index.d.cts +0 -3
- package/layouts/foundation/foundation.d.cts +0 -9
- package/layouts/foundation/index.d.cts +0 -2
- package/layouts/public.d.cts +0 -5
- package/layouts/sidebar/index.d.cts +0 -3
- package/layouts/sidebar/sidebar.d.cts +0 -13
- package/lib/naming.d.cts +0 -11
- package/lib/resolve-asset.d.cts +0 -3
- package/patterns/footer/footer.d.cts +0 -10
- package/patterns/footer/index.d.cts +0 -2
- package/patterns/form/form.d.cts +0 -7
- package/patterns/form/index.d.cts +0 -2
- package/patterns/header/header.d.cts +0 -10
- package/patterns/header/index.d.cts +0 -2
- package/patterns/index.d.cts +0 -7
- package/patterns/masthead/index.d.cts +0 -2
- package/patterns/masthead/masthead.d.cts +0 -8
- package/patterns/modal/index.d.cts +0 -2
- package/patterns/modal/modal.d.cts +0 -14
- package/patterns/public.d.cts +0 -7
- package/patterns/screen-header/index.d.cts +0 -2
- package/patterns/screen-header/screen-header.d.cts +0 -11
- package/tokens/public.d.cts +0 -1
- package/tokens/runtime/_tokens.internal.runtime.d.cts +0 -169
- package/tokens/runtime/index.d.cts +0 -1
- package/tokens/runtime/tokens.base.desktop.runtime.d.cts +0 -165
- package/tokens/runtime/tokens.base.diagram.runtime.d.cts +0 -165
- package/tokens/runtime/tokens.base.mobile.runtime.d.cts +0 -165
- package/tokens/runtime/tokens.brandcopilot.desktop.runtime.d.cts +0 -165
- package/tokens/runtime/tokens.brandcopilot.diagram.runtime.d.cts +0 -165
- package/tokens/runtime/tokens.brandcopilot.mobile.runtime.d.cts +0 -165
- package/tokens/runtime/tokens.dmpatterns.desktop.runtime.d.cts +0 -165
- package/tokens/runtime/tokens.dmpatterns.diagram.runtime.d.cts +0 -165
- package/tokens/runtime/tokens.dmpatterns.mobile.runtime.d.cts +0 -165
- package/tokens/runtime/tokens.pdigest.desktop.runtime.d.cts +0 -165
- package/tokens/runtime/tokens.pdigest.diagram.runtime.d.cts +0 -165
- package/tokens/runtime/tokens.pdigest.mobile.runtime.d.cts +0 -165
- package/tokens/runtime/tokens.redesigntrack.desktop.runtime.d.cts +0 -165
- package/tokens/runtime/tokens.redesigntrack.diagram.runtime.d.cts +0 -165
- package/tokens/runtime/tokens.redesigntrack.mobile.runtime.d.cts +0 -165
- package/tokens/runtime/tokens.runtime.d.cts +0 -1
- package/tokens/themes/registry-dist.d.cts +0 -28
- package/types-By9fL_Nu.d.cts +0 -63
- package/types-By9fL_Nu.d.ts +0 -63
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
interface ActionGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2
|
+
import './action-group.css';
|
|
3
|
+
export interface ActionGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
direction?: 'row' | 'column';
|
|
5
5
|
align?: 'start' | 'end';
|
|
6
6
|
}
|
|
7
7
|
declare const ActionGroup: React.FC<ActionGroupProps>;
|
|
8
|
-
|
|
9
|
-
export { type ActionGroupProps, ActionGroup as default };
|
|
8
|
+
export default ActionGroup;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
1
|
+
export { default } from './action-group';
|
|
2
|
+
export type { ActionGroupProps } from './action-group';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
type AttachItemKind = 'file' | 'link';
|
|
4
|
-
interface AttachItem {
|
|
2
|
+
import './attach.css';
|
|
3
|
+
export type AttachItemKind = 'file' | 'link';
|
|
4
|
+
export interface AttachItem {
|
|
5
5
|
id: string;
|
|
6
6
|
name: string;
|
|
7
7
|
url: string;
|
|
@@ -9,12 +9,11 @@ interface AttachItem {
|
|
|
9
9
|
mimeType?: string;
|
|
10
10
|
sizeBytes?: number;
|
|
11
11
|
}
|
|
12
|
-
interface AttachProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
12
|
+
export interface AttachProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
13
13
|
items: AttachItem[];
|
|
14
14
|
onRemove?: (id: string) => void;
|
|
15
15
|
removeLabel?: string;
|
|
16
16
|
emptyLabel?: string;
|
|
17
17
|
}
|
|
18
18
|
declare const Attach: React.FC<AttachProps>;
|
|
19
|
-
|
|
20
|
-
export { type AttachItem, type AttachItemKind, type AttachProps, Attach as default };
|
|
19
|
+
export default Attach;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
1
|
+
export { default } from './attach';
|
|
2
|
+
export type { AttachItem, AttachProps, } from './attach';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
interface AvatarBaseProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2
|
+
import './avatar.css';
|
|
3
|
+
export interface AvatarBaseProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
src?: string;
|
|
5
5
|
alt?: string;
|
|
6
6
|
initials?: string;
|
|
@@ -11,7 +11,6 @@ type AvatarStaticProps = AvatarBaseProps & React.HTMLAttributes<HTMLDivElement>
|
|
|
11
11
|
type AvatarButtonProps = AvatarBaseProps & React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
12
12
|
onClick: React.MouseEventHandler<HTMLButtonElement>;
|
|
13
13
|
};
|
|
14
|
-
type AvatarProps = AvatarStaticProps | AvatarButtonProps;
|
|
14
|
+
export type AvatarProps = AvatarStaticProps | AvatarButtonProps;
|
|
15
15
|
declare const Avatar: React.FC<AvatarProps>;
|
|
16
|
-
|
|
17
|
-
export { type AvatarBaseProps, type AvatarProps, Avatar as default };
|
|
16
|
+
export default Avatar;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
1
|
+
export { default } from './avatar';
|
|
2
|
+
export type { AvatarProps } from './avatar';
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
type BreadcrumbsPresentation = 'backlink' | 'path';
|
|
4
|
-
interface BreadcrumbItem {
|
|
2
|
+
import './breadcrumbs.css';
|
|
3
|
+
export type BreadcrumbsPresentation = 'backlink' | 'path';
|
|
4
|
+
export interface BreadcrumbItem {
|
|
5
5
|
label: React.ReactNode;
|
|
6
6
|
renderLink?: (children: React.ReactNode) => React.ReactNode;
|
|
7
7
|
}
|
|
8
|
-
interface BreadcrumbsProps extends React.HTMLAttributes<HTMLElement> {
|
|
8
|
+
export interface BreadcrumbsProps extends React.HTMLAttributes<HTMLElement> {
|
|
9
9
|
presentation?: BreadcrumbsPresentation;
|
|
10
10
|
items: BreadcrumbItem[];
|
|
11
11
|
}
|
|
12
12
|
declare const Breadcrumbs: React.FC<BreadcrumbsProps>;
|
|
13
|
-
|
|
14
|
-
export { type BreadcrumbItem, type BreadcrumbsPresentation, type BreadcrumbsProps, Breadcrumbs as default };
|
|
13
|
+
export default Breadcrumbs;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
1
|
+
export { default } from './breadcrumbs';
|
|
2
|
+
export type { BreadcrumbItem, BreadcrumbsPresentation, BreadcrumbsProps, } from './breadcrumbs';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
2
|
+
import './button.css';
|
|
3
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
4
|
state?: 'default' | 'primary';
|
|
5
5
|
icon?: React.ReactNode;
|
|
6
6
|
}
|
|
7
7
|
declare const Button: React.FC<ButtonProps>;
|
|
8
|
-
|
|
9
|
-
export { type ButtonProps, Button as default };
|
|
8
|
+
export default Button;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
1
|
+
export { default } from './button';
|
|
2
|
+
export type { ButtonProps } from './button';
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
interface ButtonIconProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
2
|
+
import './button-icon.css';
|
|
3
|
+
import type { IconName } from '../../icons/types';
|
|
4
|
+
export interface ButtonIconProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
5
|
icon: IconName;
|
|
6
6
|
state?: 'default' | 'disabled';
|
|
7
7
|
label: string;
|
|
8
8
|
}
|
|
9
9
|
declare const ButtonIcon: React.FC<ButtonIconProps>;
|
|
10
|
-
|
|
11
|
-
export { type ButtonIconProps, ButtonIcon as default };
|
|
10
|
+
export default ButtonIcon;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
3
|
-
import '../../types-By9fL_Nu.js';
|
|
1
|
+
export { default } from './button-icon';
|
|
2
|
+
export type { ButtonIconProps } from './button-icon';
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
interface CardProps extends React.HTMLAttributes<HTMLElement> {
|
|
2
|
+
import './card.css';
|
|
3
|
+
export interface CardProps extends React.HTMLAttributes<HTMLElement> {
|
|
4
4
|
state?: 'default';
|
|
5
5
|
heading?: React.ReactNode;
|
|
6
6
|
description?: React.ReactNode;
|
|
7
7
|
actions?: React.ReactNode;
|
|
8
8
|
}
|
|
9
9
|
declare const Card: React.FC<CardProps>;
|
|
10
|
-
|
|
11
|
-
export { type CardProps, Card as default };
|
|
10
|
+
export default Card;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
1
|
+
export { default } from './card';
|
|
2
|
+
export type { CardProps } from './card';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
interface CardGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2
|
+
import './card-group.css';
|
|
3
|
+
export interface CardGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
columns?: 1 | 2 | 3 | 4;
|
|
5
5
|
}
|
|
6
6
|
declare const CardGroup: React.FC<CardGroupProps>;
|
|
7
|
-
|
|
8
|
-
export { type CardGroupProps, CardGroup as default };
|
|
7
|
+
export default CardGroup;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
1
|
+
export { default } from './card-group';
|
|
2
|
+
export type { CardGroupProps } from './card-group';
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
interface CheckboxProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
2
|
+
export interface CheckboxProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
4
3
|
label?: React.ReactNode;
|
|
5
4
|
}
|
|
6
5
|
declare const Checkbox: React.FC<CheckboxProps>;
|
|
7
|
-
|
|
8
|
-
export { type CheckboxProps, Checkbox as default };
|
|
6
|
+
export default Checkbox;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
1
|
+
export { default } from './checkbox';
|
|
2
|
+
export type { CheckboxProps } from './checkbox';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
interface DropdownOption {
|
|
2
|
+
import './dropdown.css';
|
|
3
|
+
export interface DropdownOption {
|
|
4
4
|
value: string;
|
|
5
5
|
label: string;
|
|
6
6
|
disabled?: boolean;
|
|
@@ -12,7 +12,7 @@ type DropdownTriggerProps = {
|
|
|
12
12
|
'aria-expanded'?: boolean;
|
|
13
13
|
};
|
|
14
14
|
type DropdownTriggerElement = React.ReactElement<DropdownTriggerProps>;
|
|
15
|
-
interface DropdownProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
15
|
+
export interface DropdownProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
16
16
|
options: DropdownOption[];
|
|
17
17
|
value?: string;
|
|
18
18
|
defaultValue?: string;
|
|
@@ -22,5 +22,4 @@ interface DropdownProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onCh
|
|
|
22
22
|
onChange?: (value: string) => void;
|
|
23
23
|
}
|
|
24
24
|
declare const Dropdown: React.FC<DropdownProps>;
|
|
25
|
-
|
|
26
|
-
export { type DropdownOption, type DropdownProps, Dropdown as default };
|
|
25
|
+
export default Dropdown;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
1
|
+
export { default } from './dropdown';
|
|
2
|
+
export type { DropdownOption, DropdownProps } from './dropdown';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
interface FieldProps {
|
|
2
|
+
export interface FieldProps {
|
|
4
3
|
label?: React.ReactNode;
|
|
5
4
|
hint?: React.ReactNode;
|
|
6
5
|
error?: React.ReactNode;
|
|
@@ -11,5 +10,4 @@ interface FieldProps {
|
|
|
11
10
|
children: React.ReactNode;
|
|
12
11
|
}
|
|
13
12
|
declare const Field: React.FC<FieldProps>;
|
|
14
|
-
|
|
15
|
-
export { type FieldProps, Field as default };
|
|
13
|
+
export default Field;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
1
|
+
export { default } from './field';
|
|
2
|
+
export type { FieldProps } from './field';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
interface FieldGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2
|
+
import './field-group.css';
|
|
3
|
+
export interface FieldGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
direction?: 'row' | 'column';
|
|
5
5
|
}
|
|
6
6
|
declare const FieldGroup: React.FC<FieldGroupProps>;
|
|
7
|
-
|
|
8
|
-
export { type FieldGroupProps, FieldGroup as default };
|
|
7
|
+
export default FieldGroup;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
1
|
+
export { default } from './field-group';
|
|
2
|
+
export type { FieldGroupProps } from './field-group';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
type ClassValue = string | undefined | null | false;
|
|
2
|
-
declare function classnames(...args: (ClassValue | Record<string, boolean | undefined | null>)[]): string;
|
|
3
|
-
|
|
4
|
-
export { classnames };
|
|
2
|
+
export declare function classnames(...args: (ClassValue | Record<string, boolean | undefined | null>)[]): string;
|
|
3
|
+
export {};
|
package/components/index.cjs
CHANGED
|
@@ -23,6 +23,7 @@ var actionGroup = require('./action-group/action-group');
|
|
|
23
23
|
var fieldGroup = require('./field-group/field-group');
|
|
24
24
|
var cardGroup = require('./card-group/card-group');
|
|
25
25
|
var breadcrumbs = require('./breadcrumbs/breadcrumbs');
|
|
26
|
+
var markdown = require('./markdown/markdown');
|
|
26
27
|
|
|
27
28
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
28
29
|
|
|
@@ -49,6 +50,7 @@ var actionGroup__default = /*#__PURE__*/_interopDefault(actionGroup);
|
|
|
49
50
|
var fieldGroup__default = /*#__PURE__*/_interopDefault(fieldGroup);
|
|
50
51
|
var cardGroup__default = /*#__PURE__*/_interopDefault(cardGroup);
|
|
51
52
|
var breadcrumbs__default = /*#__PURE__*/_interopDefault(breadcrumbs);
|
|
53
|
+
var markdown__default = /*#__PURE__*/_interopDefault(markdown);
|
|
52
54
|
|
|
53
55
|
|
|
54
56
|
|
|
@@ -144,5 +146,9 @@ Object.defineProperty(exports, "Breadcrumbs", {
|
|
|
144
146
|
enumerable: true,
|
|
145
147
|
get: function () { return breadcrumbs__default.default; }
|
|
146
148
|
});
|
|
149
|
+
Object.defineProperty(exports, "Markdown", {
|
|
150
|
+
enumerable: true,
|
|
151
|
+
get: function () { return markdown__default.default; }
|
|
152
|
+
});
|
|
147
153
|
//# sourceMappingURL=index.cjs.map
|
|
148
154
|
//# sourceMappingURL=index.cjs.map
|
package/components/index.d.ts
CHANGED
|
@@ -1,25 +1,48 @@
|
|
|
1
|
-
export { default as Button
|
|
2
|
-
export {
|
|
3
|
-
export { default as
|
|
4
|
-
export {
|
|
5
|
-
export { default as
|
|
6
|
-
export {
|
|
7
|
-
export { default as
|
|
8
|
-
export {
|
|
9
|
-
export { default as
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export { default as
|
|
14
|
-
export {
|
|
15
|
-
export { default as
|
|
16
|
-
export {
|
|
17
|
-
export { default as
|
|
18
|
-
export {
|
|
19
|
-
export { default as
|
|
20
|
-
export {
|
|
21
|
-
export { default as
|
|
22
|
-
export {
|
|
23
|
-
export { default as
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
export { default as Button } from './button/button';
|
|
2
|
+
export type { ButtonProps } from './button/button';
|
|
3
|
+
export { default as ButtonIcon } from './button-icon/button-icon';
|
|
4
|
+
export type { ButtonIconProps } from './button-icon/button-icon';
|
|
5
|
+
export { default as Input } from './input/input';
|
|
6
|
+
export type { InputProps } from './input/input';
|
|
7
|
+
export { default as Textarea } from './textarea/textarea';
|
|
8
|
+
export type { TextareaProps } from './textarea/textarea';
|
|
9
|
+
export { default as Select } from './select/select';
|
|
10
|
+
export type { SelectProps } from './select/select';
|
|
11
|
+
export { default as Dropdown } from './dropdown/dropdown';
|
|
12
|
+
export type { DropdownProps } from './dropdown/dropdown';
|
|
13
|
+
export { default as Checkbox } from './checkbox/checkbox';
|
|
14
|
+
export type { CheckboxProps } from './checkbox/checkbox';
|
|
15
|
+
export { default as Radio } from './radio/radio';
|
|
16
|
+
export type { RadioProps } from './radio/radio';
|
|
17
|
+
export { default as Field } from './field/field';
|
|
18
|
+
export type { FieldProps } from './field/field';
|
|
19
|
+
export { default as Menu } from './menu/menu';
|
|
20
|
+
export type { MenuItem, MenuProps, } from './menu/menu';
|
|
21
|
+
export { default as Tabs } from './tabs/tabs';
|
|
22
|
+
export type { TabItem, TabsProps, } from './tabs/tabs';
|
|
23
|
+
export { default as Tag } from './tag/tag';
|
|
24
|
+
export type { TagProps } from './tag/tag';
|
|
25
|
+
export { default as ProgressBar } from './progressbar/progressbar';
|
|
26
|
+
export type { ProgressBarProps } from './progressbar/progressbar';
|
|
27
|
+
export { default as Card } from './card/card';
|
|
28
|
+
export type { CardProps } from './card/card';
|
|
29
|
+
export { default as Panel } from './panel/panel';
|
|
30
|
+
export type { PanelProps } from './panel/panel';
|
|
31
|
+
export { default as Video } from './video/video';
|
|
32
|
+
export type { VideoProps, VideoQuality, } from './video/video';
|
|
33
|
+
export { default as Logo } from './logo/logo';
|
|
34
|
+
export type { LogoProps } from './logo/logo';
|
|
35
|
+
export { default as Avatar } from './avatar/avatar';
|
|
36
|
+
export type { AvatarProps } from './avatar/avatar';
|
|
37
|
+
export { default as Attach } from './attach/attach';
|
|
38
|
+
export type { AttachItem, AttachProps, } from './attach/attach';
|
|
39
|
+
export { default as ActionGroup } from './action-group/action-group';
|
|
40
|
+
export type { ActionGroupProps } from './action-group/action-group';
|
|
41
|
+
export { default as FieldGroup } from './field-group/field-group';
|
|
42
|
+
export type { FieldGroupProps } from './field-group/field-group';
|
|
43
|
+
export { default as CardGroup } from './card-group/card-group';
|
|
44
|
+
export type { CardGroupProps } from './card-group/card-group';
|
|
45
|
+
export { default as Breadcrumbs } from './breadcrumbs/breadcrumbs';
|
|
46
|
+
export type { BreadcrumbsProps } from './breadcrumbs/breadcrumbs';
|
|
47
|
+
export { default as Markdown } from './markdown/markdown';
|
|
48
|
+
export type { MarkdownProps } from './markdown/markdown';
|
package/components/index.js
CHANGED
|
@@ -21,5 +21,6 @@ export { default as ActionGroup } from './action-group/action-group';
|
|
|
21
21
|
export { default as FieldGroup } from './field-group/field-group';
|
|
22
22
|
export { default as CardGroup } from './card-group/card-group';
|
|
23
23
|
export { default as Breadcrumbs } from './breadcrumbs/breadcrumbs';
|
|
24
|
+
export { default as Markdown } from './markdown/markdown';
|
|
24
25
|
//# sourceMappingURL=index.js.map
|
|
25
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
1
|
+
export { default } from './input';
|
|
2
|
+
export type { InputProps } from './input';
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
2
|
+
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
4
3
|
state?: 'default' | 'error' | 'success';
|
|
5
4
|
}
|
|
6
5
|
declare const Input: React.FC<InputProps>;
|
|
7
|
-
|
|
8
|
-
export { type InputProps, Input as default };
|
|
6
|
+
export default Input;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
1
|
+
export { default } from './logo';
|
|
2
|
+
export type { LogoProps } from './logo';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
interface LogoProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2
|
+
import './logo.css';
|
|
3
|
+
export interface LogoProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
mode?: 'full' | 'symbol';
|
|
5
5
|
label?: string;
|
|
6
6
|
}
|
|
7
7
|
declare const Logo: React.FC<LogoProps>;
|
|
8
|
-
|
|
9
|
-
export { type LogoProps, Logo as default };
|
|
8
|
+
export default Logo;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var markdown = require('./markdown');
|
|
4
|
+
|
|
5
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
6
|
+
|
|
7
|
+
var markdown__default = /*#__PURE__*/_interopDefault(markdown);
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
module.exports = markdown__default.default;
|
|
12
|
+
//# sourceMappingURL=index.cjs.map
|
|
13
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs","sourcesContent":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var ReactMarkdown = require('react-markdown');
|
|
5
|
+
var remarkGfm = require('remark-gfm');
|
|
6
|
+
require('./markdown.css');
|
|
7
|
+
var classnames = require('../helpers/classnames');
|
|
8
|
+
|
|
9
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
|
|
11
|
+
var ReactMarkdown__default = /*#__PURE__*/_interopDefault(ReactMarkdown);
|
|
12
|
+
var remarkGfm__default = /*#__PURE__*/_interopDefault(remarkGfm);
|
|
13
|
+
|
|
14
|
+
function normalizeHeadingLevelOffset(value) {
|
|
15
|
+
if (value === void 0 || !Number.isFinite(value)) {
|
|
16
|
+
return 0;
|
|
17
|
+
}
|
|
18
|
+
return Math.max(0, Math.floor(value));
|
|
19
|
+
}
|
|
20
|
+
function getHeadingLevel(sourceLevel, offset) {
|
|
21
|
+
return Math.min(6, sourceLevel + offset);
|
|
22
|
+
}
|
|
23
|
+
const MarkdownHeading = ({
|
|
24
|
+
sourceLevel,
|
|
25
|
+
offset,
|
|
26
|
+
children,
|
|
27
|
+
...props
|
|
28
|
+
}) => {
|
|
29
|
+
const level = getHeadingLevel(sourceLevel, offset);
|
|
30
|
+
switch (level) {
|
|
31
|
+
case 1:
|
|
32
|
+
return /* @__PURE__ */ jsxRuntime.jsx("h1", { ...props, children });
|
|
33
|
+
case 2:
|
|
34
|
+
return /* @__PURE__ */ jsxRuntime.jsx("h2", { ...props, children });
|
|
35
|
+
case 3:
|
|
36
|
+
return /* @__PURE__ */ jsxRuntime.jsx("h3", { ...props, children });
|
|
37
|
+
case 4:
|
|
38
|
+
return /* @__PURE__ */ jsxRuntime.jsx("h4", { ...props, children });
|
|
39
|
+
case 5:
|
|
40
|
+
return /* @__PURE__ */ jsxRuntime.jsx("h5", { ...props, children });
|
|
41
|
+
default:
|
|
42
|
+
return /* @__PURE__ */ jsxRuntime.jsx("h6", { ...props, children });
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const Markdown = ({
|
|
46
|
+
content,
|
|
47
|
+
headingLevelOffset = 0,
|
|
48
|
+
className = "",
|
|
49
|
+
...props
|
|
50
|
+
}) => {
|
|
51
|
+
if (!content.trim()) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
const classes = classnames.classnames("markdown", className, {});
|
|
55
|
+
const normalizedHeadingLevelOffset = normalizeHeadingLevelOffset(headingLevelOffset);
|
|
56
|
+
const components = {
|
|
57
|
+
h1: ({ node: _node, ...headingProps }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
58
|
+
MarkdownHeading,
|
|
59
|
+
{
|
|
60
|
+
...headingProps,
|
|
61
|
+
sourceLevel: 1,
|
|
62
|
+
offset: normalizedHeadingLevelOffset
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
h2: ({ node: _node, ...headingProps }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
66
|
+
MarkdownHeading,
|
|
67
|
+
{
|
|
68
|
+
...headingProps,
|
|
69
|
+
sourceLevel: 2,
|
|
70
|
+
offset: normalizedHeadingLevelOffset
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
h3: ({ node: _node, ...headingProps }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
74
|
+
MarkdownHeading,
|
|
75
|
+
{
|
|
76
|
+
...headingProps,
|
|
77
|
+
sourceLevel: 3,
|
|
78
|
+
offset: normalizedHeadingLevelOffset
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
h4: ({ node: _node, ...headingProps }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
82
|
+
MarkdownHeading,
|
|
83
|
+
{
|
|
84
|
+
...headingProps,
|
|
85
|
+
sourceLevel: 4,
|
|
86
|
+
offset: normalizedHeadingLevelOffset
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
h5: ({ node: _node, ...headingProps }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
90
|
+
MarkdownHeading,
|
|
91
|
+
{
|
|
92
|
+
...headingProps,
|
|
93
|
+
sourceLevel: 5,
|
|
94
|
+
offset: normalizedHeadingLevelOffset
|
|
95
|
+
}
|
|
96
|
+
),
|
|
97
|
+
h6: ({ node: _node, ...headingProps }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
98
|
+
MarkdownHeading,
|
|
99
|
+
{
|
|
100
|
+
...headingProps,
|
|
101
|
+
sourceLevel: 6,
|
|
102
|
+
offset: normalizedHeadingLevelOffset
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
};
|
|
106
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
107
|
+
"div",
|
|
108
|
+
{
|
|
109
|
+
className: classes,
|
|
110
|
+
...props,
|
|
111
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
112
|
+
ReactMarkdown__default.default,
|
|
113
|
+
{
|
|
114
|
+
remarkPlugins: [remarkGfm__default.default],
|
|
115
|
+
components,
|
|
116
|
+
children: content
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
};
|
|
122
|
+
var markdown_default = Markdown;
|
|
123
|
+
|
|
124
|
+
module.exports = markdown_default;
|
|
125
|
+
//# sourceMappingURL=markdown.cjs.map
|
|
126
|
+
//# sourceMappingURL=markdown.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/markdown/markdown.tsx"],"names":["jsx","classnames","ReactMarkdown","remarkGfm"],"mappings":"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","file":"markdown.cjs","sourcesContent":["import React from 'react';\nimport ReactMarkdown, { type Components } from 'react-markdown';\nimport remarkGfm from 'remark-gfm';\n\nimport './markdown.css';\nimport { classnames } from '../helpers/classnames';\n\nexport interface MarkdownProps\n extends Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'children' | 'dangerouslySetInnerHTML'\n > {\n content: string;\n headingLevelOffset?: number;\n}\n\ninterface MarkdownHeadingProps\n extends React.HTMLAttributes<HTMLHeadingElement> {\n sourceLevel: number;\n offset: number;\n}\n\nfunction normalizeHeadingLevelOffset(value: number | undefined) {\n if (value === undefined || !Number.isFinite(value)) {\n return 0;\n }\n\n return Math.max(0, Math.floor(value));\n}\n\nfunction getHeadingLevel(\n sourceLevel: number,\n offset: number,\n) {\n return Math.min(6, sourceLevel + offset);\n}\n\nconst MarkdownHeading: React.FC<MarkdownHeadingProps> = ({\n sourceLevel,\n offset,\n children,\n ...props\n}) => {\n const level = getHeadingLevel(sourceLevel, offset);\n\n switch (level) {\n case 1:\n return <h1 {...props}>{children}</h1>;\n\n case 2:\n return <h2 {...props}>{children}</h2>;\n\n case 3:\n return <h3 {...props}>{children}</h3>;\n\n case 4:\n return <h4 {...props}>{children}</h4>;\n\n case 5:\n return <h5 {...props}>{children}</h5>;\n\n default:\n return <h6 {...props}>{children}</h6>;\n }\n};\n\nconst Markdown: React.FC<MarkdownProps> = ({\n content,\n headingLevelOffset = 0,\n className = '',\n ...props\n}) => {\n if (!content.trim()) {\n return null;\n }\n\n const classes = classnames('markdown', className, {});\n\n const normalizedHeadingLevelOffset =\n normalizeHeadingLevelOffset(headingLevelOffset);\n\n const components: Components = {\n h1: ({ node: _node, ...headingProps }) => (\n <MarkdownHeading\n {...headingProps}\n sourceLevel={1}\n offset={normalizedHeadingLevelOffset}\n />\n ),\n\n h2: ({ node: _node, ...headingProps }) => (\n <MarkdownHeading\n {...headingProps}\n sourceLevel={2}\n offset={normalizedHeadingLevelOffset}\n />\n ),\n\n h3: ({ node: _node, ...headingProps }) => (\n <MarkdownHeading\n {...headingProps}\n sourceLevel={3}\n offset={normalizedHeadingLevelOffset}\n />\n ),\n\n h4: ({ node: _node, ...headingProps }) => (\n <MarkdownHeading\n {...headingProps}\n sourceLevel={4}\n offset={normalizedHeadingLevelOffset}\n />\n ),\n\n h5: ({ node: _node, ...headingProps }) => (\n <MarkdownHeading\n {...headingProps}\n sourceLevel={5}\n offset={normalizedHeadingLevelOffset}\n />\n ),\n\n h6: ({ node: _node, ...headingProps }) => (\n <MarkdownHeading\n {...headingProps}\n sourceLevel={6}\n offset={normalizedHeadingLevelOffset}\n />\n ),\n };\n\n return (\n <div\n className={classes}\n {...props}\n >\n <ReactMarkdown\n remarkPlugins={[remarkGfm]}\n components={components}\n >\n {content}\n </ReactMarkdown>\n </div>\n );\n};\n\nexport default Markdown;\n"]}
|