@alifd/chat 0.3.0-beta.8 → 0.3.0-beta.9
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/es/drawer/index.d.ts +60 -0
- package/es/drawer/index.js +29 -0
- package/es/drawer/main.scss +20 -0
- package/es/drawer/style.d.ts +2 -0
- package/es/drawer/style.js +2 -0
- package/es/drawer/types.d.ts +10 -0
- package/es/drawer/types.js +1 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/es/markdown/index.js +5 -0
- package/lib/drawer/index.d.ts +60 -0
- package/lib/drawer/index.js +31 -0
- package/lib/drawer/main.scss +20 -0
- package/lib/drawer/style.d.ts +2 -0
- package/lib/drawer/style.js +4 -0
- package/lib/drawer/types.d.ts +10 -0
- package/lib/drawer/types.js +2 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +4 -2
- package/lib/markdown/index.js +5 -0
- package/package.json +13 -1
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @component 抽屉
|
|
3
|
+
* @en Drawer
|
|
4
|
+
* * @remarks 同 Next Drawer- Same as Next Drawer component.
|
|
5
|
+
* @type 通用 - General
|
|
6
|
+
* @when
|
|
7
|
+
*/
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import type { DrawerProps } from './types';
|
|
10
|
+
export * from './types';
|
|
11
|
+
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<DrawerProps & React.RefAttributes<import("@alifd/next/types/config-provider/types").ConfiguredComponent<import("@alifd/next/types/drawer").DrawerProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, {
|
|
12
|
+
render(): React.JSX.Element;
|
|
13
|
+
context: any;
|
|
14
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("@alifd/next/types/drawer").DrawerProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
15
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
16
|
+
readonly props: Readonly<import("@alifd/next/types/drawer").DrawerProps> & Readonly<{
|
|
17
|
+
children?: React.ReactNode | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
state: Readonly<{}>;
|
|
20
|
+
refs: {
|
|
21
|
+
[key: string]: React.ReactInstance;
|
|
22
|
+
};
|
|
23
|
+
componentDidMount?(): void;
|
|
24
|
+
shouldComponentUpdate?(nextProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
25
|
+
componentWillUnmount?(): void;
|
|
26
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
27
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, prevState: Readonly<{}>): any;
|
|
28
|
+
componentDidUpdate?(prevProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
29
|
+
componentWillMount?(): void;
|
|
30
|
+
UNSAFE_componentWillMount?(): void;
|
|
31
|
+
componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, nextContext: any): void;
|
|
32
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, nextContext: any): void;
|
|
33
|
+
componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
34
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
35
|
+
}>>, "key" | keyof DrawerProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("@alifd/next/types/config-provider/types").ConfiguredComponent<import("@alifd/next/types/drawer").DrawerProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, {
|
|
36
|
+
render(): React.JSX.Element;
|
|
37
|
+
context: any;
|
|
38
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("@alifd/next/types/drawer").DrawerProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
39
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
40
|
+
readonly props: Readonly<import("@alifd/next/types/drawer").DrawerProps> & Readonly<{
|
|
41
|
+
children?: React.ReactNode | undefined;
|
|
42
|
+
}>;
|
|
43
|
+
state: Readonly<{}>;
|
|
44
|
+
refs: {
|
|
45
|
+
[key: string]: React.ReactInstance;
|
|
46
|
+
};
|
|
47
|
+
componentDidMount?(): void;
|
|
48
|
+
shouldComponentUpdate?(nextProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
49
|
+
componentWillUnmount?(): void;
|
|
50
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
51
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, prevState: Readonly<{}>): any;
|
|
52
|
+
componentDidUpdate?(prevProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
53
|
+
componentWillMount?(): void;
|
|
54
|
+
UNSAFE_componentWillMount?(): void;
|
|
55
|
+
componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, nextContext: any): void;
|
|
56
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, nextContext: any): void;
|
|
57
|
+
componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
58
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
59
|
+
}>, {}>;
|
|
60
|
+
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @component 抽屉
|
|
3
|
+
* @en Drawer
|
|
4
|
+
* * @remarks 同 Next Drawer- Same as Next Drawer component.
|
|
5
|
+
* @type 通用 - General
|
|
6
|
+
* @when
|
|
7
|
+
*/
|
|
8
|
+
import { __rest } from "tslib";
|
|
9
|
+
import React, { forwardRef } from 'react';
|
|
10
|
+
import { Drawer as NextDrawer, ConfigProvider } from '@alifd/next';
|
|
11
|
+
import cs from 'classnames';
|
|
12
|
+
import { PREFIX_DEFAULT, assignSubComponent } from '../utils';
|
|
13
|
+
const Drawer = forwardRef((_a, ref) => {
|
|
14
|
+
var { className, headerStyle, children, footer, footerClassName } = _a, props = __rest(_a, ["className", "headerStyle", "children", "footer", "footerClassName"]);
|
|
15
|
+
// 对齐小蜜现有的底部
|
|
16
|
+
const defaultHeaderStyle = {
|
|
17
|
+
"border-bottom:": "1px solid var(--40gmM)",
|
|
18
|
+
"border-top-left-radius": "16px",
|
|
19
|
+
"border-top-right-radius": "16px",
|
|
20
|
+
};
|
|
21
|
+
return (React.createElement(NextDrawer, Object.assign({}, props, { ref: ref, headerStyle: Object.assign(Object.assign({}, defaultHeaderStyle), headerStyle), className: cs(`${PREFIX_DEFAULT}drawer`, className) }),
|
|
22
|
+
React.createElement("div", { className: 'draw-content' }, children),
|
|
23
|
+
footer && footer.length && React.createElement("div", { className: cs('draw-footer', footerClassName) }, footer)));
|
|
24
|
+
});
|
|
25
|
+
const DrawerWithSub = assignSubComponent(Drawer, {
|
|
26
|
+
displayName: 'Drawer',
|
|
27
|
+
});
|
|
28
|
+
export * from './types';
|
|
29
|
+
export default ConfigProvider.config(DrawerWithSub);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@import "../core/variables.scss";
|
|
2
|
+
|
|
3
|
+
.#{$prefix}drawer {
|
|
4
|
+
border: none;
|
|
5
|
+
|
|
6
|
+
.draw-footer {
|
|
7
|
+
width: calc(100% - 40px);
|
|
8
|
+
position: absolute;
|
|
9
|
+
bottom: 20px;
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
|
|
13
|
+
button {
|
|
14
|
+
width: calc(50% - 8px);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type CommonProps } from '@alifd/next';
|
|
2
|
+
import type { DrawerV2Props as FusionDrawerProps } from '@alifd/next/types/drawer/types';
|
|
3
|
+
import type { ButtonProps } from '../button/types';
|
|
4
|
+
/**
|
|
5
|
+
* @api Drawer
|
|
6
|
+
*/
|
|
7
|
+
export interface DrawerProps extends FusionDrawerProps, CommonProps {
|
|
8
|
+
footer?: ButtonProps[];
|
|
9
|
+
footerClassName?: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/es/index.d.ts
CHANGED
|
@@ -19,4 +19,5 @@ export { default as Markdown } from './markdown';
|
|
|
19
19
|
export { default as CardLoading } from './card-loading';
|
|
20
20
|
export { default as Origin } from './origin';
|
|
21
21
|
export { default as Loading } from './loading';
|
|
22
|
+
export { default as Drawer } from './drawer';
|
|
22
23
|
export declare const version: string;
|
package/es/index.js
CHANGED
|
@@ -19,4 +19,5 @@ export { default as Markdown } from './markdown';
|
|
|
19
19
|
export { default as CardLoading } from './card-loading';
|
|
20
20
|
export { default as Origin } from './origin';
|
|
21
21
|
export { default as Loading } from './loading';
|
|
22
|
-
export
|
|
22
|
+
export { default as Drawer } from './drawer';
|
|
23
|
+
export const version = '0.3.0-beta.9';
|
package/es/markdown/index.js
CHANGED
|
@@ -42,12 +42,17 @@ const Markdown = forwardRef(({ className, onReady, content }, ref) => {
|
|
|
42
42
|
// 提取属性
|
|
43
43
|
const sizeTokenMatch = attributes.match(/sizeToken=([\w_]+)/);
|
|
44
44
|
const colorTokenV2Match = attributes.match(/colorTokenV2=([\w_]+)/);
|
|
45
|
+
const colorTokenV1Match = attributes.match(/color=([\w_]+)/);
|
|
45
46
|
if (sizeTokenMatch) {
|
|
46
47
|
sizeToken = sizeTokenMatch[1].replace(/-/g, '_');
|
|
47
48
|
}
|
|
48
49
|
if (colorTokenV2Match) {
|
|
49
50
|
colorTokenV2 = colorTokenV2Match[1].replace(/-/g, '_');
|
|
50
51
|
}
|
|
52
|
+
// 兼容老的钉钉变量
|
|
53
|
+
if (!colorTokenV2 && colorTokenV1Match) {
|
|
54
|
+
colorTokenV2 = colorTokenV1Match[1].replace(/-/g, '_');
|
|
55
|
+
}
|
|
51
56
|
// 生成样式
|
|
52
57
|
const styleParts = [];
|
|
53
58
|
if (sizeToken) {
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @component 抽屉
|
|
3
|
+
* @en Drawer
|
|
4
|
+
* * @remarks 同 Next Drawer- Same as Next Drawer component.
|
|
5
|
+
* @type 通用 - General
|
|
6
|
+
* @when
|
|
7
|
+
*/
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import type { DrawerProps } from './types';
|
|
10
|
+
export * from './types';
|
|
11
|
+
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<DrawerProps & React.RefAttributes<import("@alifd/next/types/config-provider/types").ConfiguredComponent<import("@alifd/next/types/drawer").DrawerProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, {
|
|
12
|
+
render(): React.JSX.Element;
|
|
13
|
+
context: any;
|
|
14
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("@alifd/next/types/drawer").DrawerProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
15
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
16
|
+
readonly props: Readonly<import("@alifd/next/types/drawer").DrawerProps> & Readonly<{
|
|
17
|
+
children?: React.ReactNode | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
state: Readonly<{}>;
|
|
20
|
+
refs: {
|
|
21
|
+
[key: string]: React.ReactInstance;
|
|
22
|
+
};
|
|
23
|
+
componentDidMount?(): void;
|
|
24
|
+
shouldComponentUpdate?(nextProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
25
|
+
componentWillUnmount?(): void;
|
|
26
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
27
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, prevState: Readonly<{}>): any;
|
|
28
|
+
componentDidUpdate?(prevProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
29
|
+
componentWillMount?(): void;
|
|
30
|
+
UNSAFE_componentWillMount?(): void;
|
|
31
|
+
componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, nextContext: any): void;
|
|
32
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, nextContext: any): void;
|
|
33
|
+
componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
34
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
35
|
+
}>>, "key" | keyof DrawerProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("@alifd/next/types/config-provider/types").ConfiguredComponent<import("@alifd/next/types/drawer").DrawerProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, {
|
|
36
|
+
render(): React.JSX.Element;
|
|
37
|
+
context: any;
|
|
38
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("@alifd/next/types/drawer").DrawerProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
39
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
40
|
+
readonly props: Readonly<import("@alifd/next/types/drawer").DrawerProps> & Readonly<{
|
|
41
|
+
children?: React.ReactNode | undefined;
|
|
42
|
+
}>;
|
|
43
|
+
state: Readonly<{}>;
|
|
44
|
+
refs: {
|
|
45
|
+
[key: string]: React.ReactInstance;
|
|
46
|
+
};
|
|
47
|
+
componentDidMount?(): void;
|
|
48
|
+
shouldComponentUpdate?(nextProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
49
|
+
componentWillUnmount?(): void;
|
|
50
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
51
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, prevState: Readonly<{}>): any;
|
|
52
|
+
componentDidUpdate?(prevProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
53
|
+
componentWillMount?(): void;
|
|
54
|
+
UNSAFE_componentWillMount?(): void;
|
|
55
|
+
componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, nextContext: any): void;
|
|
56
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, nextContext: any): void;
|
|
57
|
+
componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
58
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/drawer").DrawerProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
59
|
+
}>, {}>;
|
|
60
|
+
export default _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @component 抽屉
|
|
4
|
+
* @en Drawer
|
|
5
|
+
* * @remarks 同 Next Drawer- Same as Next Drawer component.
|
|
6
|
+
* @type 通用 - General
|
|
7
|
+
* @when
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
const tslib_1 = require("tslib");
|
|
11
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
12
|
+
const next_1 = require("@alifd/next");
|
|
13
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
14
|
+
const utils_1 = require("../utils");
|
|
15
|
+
const Drawer = (0, react_1.forwardRef)((_a, ref) => {
|
|
16
|
+
var { className, headerStyle, children, footer, footerClassName } = _a, props = tslib_1.__rest(_a, ["className", "headerStyle", "children", "footer", "footerClassName"]);
|
|
17
|
+
// 对齐小蜜现有的底部
|
|
18
|
+
const defaultHeaderStyle = {
|
|
19
|
+
"border-bottom:": "1px solid var(--40gmM)",
|
|
20
|
+
"border-top-left-radius": "16px",
|
|
21
|
+
"border-top-right-radius": "16px",
|
|
22
|
+
};
|
|
23
|
+
return (react_1.default.createElement(next_1.Drawer, Object.assign({}, props, { ref: ref, headerStyle: Object.assign(Object.assign({}, defaultHeaderStyle), headerStyle), className: (0, classnames_1.default)(`${utils_1.PREFIX_DEFAULT}drawer`, className) }),
|
|
24
|
+
react_1.default.createElement("div", { className: 'draw-content' }, children),
|
|
25
|
+
footer && footer.length && react_1.default.createElement("div", { className: (0, classnames_1.default)('draw-footer', footerClassName) }, footer)));
|
|
26
|
+
});
|
|
27
|
+
const DrawerWithSub = (0, utils_1.assignSubComponent)(Drawer, {
|
|
28
|
+
displayName: 'Drawer',
|
|
29
|
+
});
|
|
30
|
+
tslib_1.__exportStar(require("./types"), exports);
|
|
31
|
+
exports.default = next_1.ConfigProvider.config(DrawerWithSub);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@import "../core/variables.scss";
|
|
2
|
+
|
|
3
|
+
.#{$prefix}drawer {
|
|
4
|
+
border: none;
|
|
5
|
+
|
|
6
|
+
.draw-footer {
|
|
7
|
+
width: calc(100% - 40px);
|
|
8
|
+
position: absolute;
|
|
9
|
+
bottom: 20px;
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
|
|
13
|
+
button {
|
|
14
|
+
width: calc(50% - 8px);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type CommonProps } from '@alifd/next';
|
|
2
|
+
import type { DrawerV2Props as FusionDrawerProps } from '@alifd/next/types/drawer/types';
|
|
3
|
+
import type { ButtonProps } from '../button/types';
|
|
4
|
+
/**
|
|
5
|
+
* @api Drawer
|
|
6
|
+
*/
|
|
7
|
+
export interface DrawerProps extends FusionDrawerProps, CommonProps {
|
|
8
|
+
footer?: ButtonProps[];
|
|
9
|
+
footerClassName?: string;
|
|
10
|
+
}
|
package/lib/index.d.ts
CHANGED
|
@@ -19,4 +19,5 @@ export { default as Markdown } from './markdown';
|
|
|
19
19
|
export { default as CardLoading } from './card-loading';
|
|
20
20
|
export { default as Origin } from './origin';
|
|
21
21
|
export { default as Loading } from './loading';
|
|
22
|
+
export { default as Drawer } from './drawer';
|
|
22
23
|
export declare const version: string;
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.version = exports.Loading = exports.Origin = exports.CardLoading = exports.Markdown = exports.HtmlRender = exports.ImagePreview = exports.List = exports.Balloon = exports.Icon = exports.Message = exports.PersonPicker = exports.TimePicker = exports.DatePicker = exports.Input = exports.Tab = exports.Tag = exports.Text = exports.FloatButton = exports.Feedback = exports.Card = exports.Button = void 0;
|
|
3
|
+
exports.version = exports.Drawer = exports.Loading = exports.Origin = exports.CardLoading = exports.Markdown = exports.HtmlRender = exports.ImagePreview = exports.List = exports.Balloon = exports.Icon = exports.Message = exports.PersonPicker = exports.TimePicker = exports.DatePicker = exports.Input = exports.Tab = exports.Tag = exports.Text = exports.FloatButton = exports.Feedback = exports.Card = exports.Button = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
var button_1 = require("./button");
|
|
6
6
|
Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return tslib_1.__importDefault(button_1).default; } });
|
|
@@ -44,4 +44,6 @@ var origin_1 = require("./origin");
|
|
|
44
44
|
Object.defineProperty(exports, "Origin", { enumerable: true, get: function () { return tslib_1.__importDefault(origin_1).default; } });
|
|
45
45
|
var loading_1 = require("./loading");
|
|
46
46
|
Object.defineProperty(exports, "Loading", { enumerable: true, get: function () { return tslib_1.__importDefault(loading_1).default; } });
|
|
47
|
-
|
|
47
|
+
var drawer_1 = require("./drawer");
|
|
48
|
+
Object.defineProperty(exports, "Drawer", { enumerable: true, get: function () { return tslib_1.__importDefault(drawer_1).default; } });
|
|
49
|
+
exports.version = '0.3.0-beta.9';
|
package/lib/markdown/index.js
CHANGED
|
@@ -45,12 +45,17 @@ const Markdown = (0, react_1.forwardRef)(({ className, onReady, content }, ref)
|
|
|
45
45
|
// 提取属性
|
|
46
46
|
const sizeTokenMatch = attributes.match(/sizeToken=([\w_]+)/);
|
|
47
47
|
const colorTokenV2Match = attributes.match(/colorTokenV2=([\w_]+)/);
|
|
48
|
+
const colorTokenV1Match = attributes.match(/color=([\w_]+)/);
|
|
48
49
|
if (sizeTokenMatch) {
|
|
49
50
|
sizeToken = sizeTokenMatch[1].replace(/-/g, '_');
|
|
50
51
|
}
|
|
51
52
|
if (colorTokenV2Match) {
|
|
52
53
|
colorTokenV2 = colorTokenV2Match[1].replace(/-/g, '_');
|
|
53
54
|
}
|
|
55
|
+
// 兼容老的钉钉变量
|
|
56
|
+
if (!colorTokenV2 && colorTokenV1Match) {
|
|
57
|
+
colorTokenV2 = colorTokenV1Match[1].replace(/-/g, '_');
|
|
58
|
+
}
|
|
54
59
|
// 生成样式
|
|
55
60
|
const styleParts = [];
|
|
56
61
|
if (sizeToken) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alifd/chat",
|
|
3
|
-
"version": "0.3.0-beta.
|
|
3
|
+
"version": "0.3.0-beta.9",
|
|
4
4
|
"description": "A configurable component library for chat built on React.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -313,6 +313,18 @@
|
|
|
313
313
|
"./loading/style.js": {
|
|
314
314
|
"import": "./es/loading/style.js",
|
|
315
315
|
"require": "./lib/loading/style.js"
|
|
316
|
+
},
|
|
317
|
+
"./drawer": {
|
|
318
|
+
"import": "./es/drawer/index.js",
|
|
319
|
+
"require": "./lib/drawer/index.js"
|
|
320
|
+
},
|
|
321
|
+
"./drawer/style": {
|
|
322
|
+
"import": "./es/drawer/style.js",
|
|
323
|
+
"require": "./lib/drawer/style.js"
|
|
324
|
+
},
|
|
325
|
+
"./drawer/style.js": {
|
|
326
|
+
"import": "./es/drawer/style.js",
|
|
327
|
+
"require": "./lib/drawer/style.js"
|
|
316
328
|
}
|
|
317
329
|
},
|
|
318
330
|
"files": [
|