@alifd/chat 0.3.0-beta.1 → 0.3.0-beta.2
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/core/variables.scss +1 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/es/markdown/main.scss +6 -4
- package/es/origin/index.d.ts +11 -0
- package/es/origin/index.js +19 -0
- package/es/origin/main.scss +18 -0
- package/es/origin/style.d.ts +1 -0
- package/es/origin/style.js +1 -0
- package/es/origin/types.d.ts +12 -0
- package/es/origin/types.js +1 -0
- package/lib/core/variables.scss +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +4 -2
- package/lib/markdown/main.scss +6 -4
- package/lib/origin/index.d.ts +11 -0
- package/lib/origin/index.js +22 -0
- package/lib/origin/main.scss +18 -0
- package/lib/origin/style.d.ts +1 -0
- package/lib/origin/style.js +3 -0
- package/lib/origin/types.d.ts +12 -0
- package/lib/origin/types.js +2 -0
- package/package.json +13 -1
package/es/core/variables.scss
CHANGED
package/es/index.d.ts
CHANGED
|
@@ -17,4 +17,5 @@ export { default as ImagePreview } from './ImagePreview';
|
|
|
17
17
|
export { default as HTMLRenderer } from './HTMLRenderer';
|
|
18
18
|
export { default as Markdown } from './markdown';
|
|
19
19
|
export { default as CardLoading } from './card-loading';
|
|
20
|
+
export { default as Origin } from './origin';
|
|
20
21
|
export declare const version: string;
|
package/es/index.js
CHANGED
|
@@ -17,4 +17,5 @@ export { default as ImagePreview } from './ImagePreview';
|
|
|
17
17
|
export { default as HTMLRenderer } from './HTMLRenderer';
|
|
18
18
|
export { default as Markdown } from './markdown';
|
|
19
19
|
export { default as CardLoading } from './card-loading';
|
|
20
|
-
export
|
|
20
|
+
export { default as Origin } from './origin';
|
|
21
|
+
export const version = '0.3.0-beta.2';
|
package/es/markdown/main.scss
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
@import "../core/variables.scss";
|
|
2
|
+
|
|
3
|
+
$primaryColor: $color-brand1-6;
|
|
2
4
|
$alternativePrimaryColor: $primaryColor;
|
|
3
|
-
$mistPrimaryColor:
|
|
4
|
-
$mediumTextColor:
|
|
5
|
-
$subTextColor:
|
|
5
|
+
$mistPrimaryColor: $color-brand1-1;
|
|
6
|
+
$mediumTextColor: $color-text1-3;
|
|
7
|
+
$subTextColor: $color-text1-2;
|
|
6
8
|
|
|
7
9
|
@mixin f-single-line() {
|
|
8
10
|
overflow: hidden;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @component Origin
|
|
3
|
+
* @en Origin
|
|
4
|
+
* @type 通用 - Origin
|
|
5
|
+
* @when Origin
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import type { OriginProps } from './types';
|
|
9
|
+
export * from './types';
|
|
10
|
+
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<OriginProps & React.RefAttributes<HTMLDivElement>, "key" | keyof OriginProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, HTMLDivElement, {}>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @component Origin
|
|
3
|
+
* @en Origin
|
|
4
|
+
* @type 通用 - Origin
|
|
5
|
+
* @when Origin
|
|
6
|
+
*/
|
|
7
|
+
import React, { forwardRef } from 'react';
|
|
8
|
+
import { ConfigProvider } from '@alifd/next';
|
|
9
|
+
import cs from 'classnames';
|
|
10
|
+
import { PREFIX_DEFAULT, assignSubComponent } from '../utils';
|
|
11
|
+
const Origin = forwardRef(({ className, text }, ref) => {
|
|
12
|
+
return (React.createElement("div", { className: cs(`${PREFIX_DEFAULT}origin`, className) },
|
|
13
|
+
React.createElement("div", { className: 'origin-tip-inner' }, text)));
|
|
14
|
+
});
|
|
15
|
+
const OriginWithSub = assignSubComponent(Origin, {
|
|
16
|
+
displayName: 'Origin',
|
|
17
|
+
});
|
|
18
|
+
export * from './types';
|
|
19
|
+
export default ConfigProvider.config(OriginWithSub);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@import "../core/variables.scss";
|
|
2
|
+
|
|
3
|
+
.#{$prefix}origin {
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: flex-end;
|
|
6
|
+
.origin-tip-inner {
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
white-space: nowrap;
|
|
9
|
+
text-overflow: ellipsis;
|
|
10
|
+
background: linear-gradient(90deg, transparent, $color-brand1-1);
|
|
11
|
+
padding: 0 16px 0 32px;
|
|
12
|
+
color: $color-text1-3;
|
|
13
|
+
min-width: 0;
|
|
14
|
+
flex: 0 1 auto;
|
|
15
|
+
font-size: 12px;
|
|
16
|
+
line-height: 20px;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './main.scss';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './main.scss';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
import { type CommonProps } from '@alifd/next';
|
|
3
|
+
/**
|
|
4
|
+
* @api
|
|
5
|
+
*/
|
|
6
|
+
export interface OriginProps extends React.HTMLAttributes<HTMLElement>, CommonProps {
|
|
7
|
+
className?: string;
|
|
8
|
+
/**
|
|
9
|
+
* 来源的文案或者dom内容
|
|
10
|
+
*/
|
|
11
|
+
text?: string | ReactNode;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/core/variables.scss
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -17,4 +17,5 @@ export { default as ImagePreview } from './ImagePreview';
|
|
|
17
17
|
export { default as HTMLRenderer } from './HTMLRenderer';
|
|
18
18
|
export { default as Markdown } from './markdown';
|
|
19
19
|
export { default as CardLoading } from './card-loading';
|
|
20
|
+
export { default as Origin } from './origin';
|
|
20
21
|
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.CardLoading = exports.Markdown = exports.HTMLRenderer = 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.Origin = exports.CardLoading = exports.Markdown = exports.HTMLRenderer = 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; } });
|
|
@@ -40,4 +40,6 @@ var markdown_1 = require("./markdown");
|
|
|
40
40
|
Object.defineProperty(exports, "Markdown", { enumerable: true, get: function () { return tslib_1.__importDefault(markdown_1).default; } });
|
|
41
41
|
var card_loading_1 = require("./card-loading");
|
|
42
42
|
Object.defineProperty(exports, "CardLoading", { enumerable: true, get: function () { return tslib_1.__importDefault(card_loading_1).default; } });
|
|
43
|
-
|
|
43
|
+
var origin_1 = require("./origin");
|
|
44
|
+
Object.defineProperty(exports, "Origin", { enumerable: true, get: function () { return tslib_1.__importDefault(origin_1).default; } });
|
|
45
|
+
exports.version = '0.3.0-beta.2';
|
package/lib/markdown/main.scss
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
@import "../core/variables.scss";
|
|
2
|
+
|
|
3
|
+
$primaryColor: $color-brand1-6;
|
|
2
4
|
$alternativePrimaryColor: $primaryColor;
|
|
3
|
-
$mistPrimaryColor:
|
|
4
|
-
$mediumTextColor:
|
|
5
|
-
$subTextColor:
|
|
5
|
+
$mistPrimaryColor: $color-brand1-1;
|
|
6
|
+
$mediumTextColor: $color-text1-3;
|
|
7
|
+
$subTextColor: $color-text1-2;
|
|
6
8
|
|
|
7
9
|
@mixin f-single-line() {
|
|
8
10
|
overflow: hidden;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @component Origin
|
|
3
|
+
* @en Origin
|
|
4
|
+
* @type 通用 - Origin
|
|
5
|
+
* @when Origin
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import type { OriginProps } from './types';
|
|
9
|
+
export * from './types';
|
|
10
|
+
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<OriginProps & React.RefAttributes<HTMLDivElement>, "key" | keyof OriginProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, HTMLDivElement, {}>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @component Origin
|
|
4
|
+
* @en Origin
|
|
5
|
+
* @type 通用 - Origin
|
|
6
|
+
* @when Origin
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const tslib_1 = require("tslib");
|
|
10
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
11
|
+
const next_1 = require("@alifd/next");
|
|
12
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
13
|
+
const utils_1 = require("../utils");
|
|
14
|
+
const Origin = (0, react_1.forwardRef)(({ className, text }, ref) => {
|
|
15
|
+
return (react_1.default.createElement("div", { className: (0, classnames_1.default)(`${utils_1.PREFIX_DEFAULT}origin`, className) },
|
|
16
|
+
react_1.default.createElement("div", { className: 'origin-tip-inner' }, text)));
|
|
17
|
+
});
|
|
18
|
+
const OriginWithSub = (0, utils_1.assignSubComponent)(Origin, {
|
|
19
|
+
displayName: 'Origin',
|
|
20
|
+
});
|
|
21
|
+
tslib_1.__exportStar(require("./types"), exports);
|
|
22
|
+
exports.default = next_1.ConfigProvider.config(OriginWithSub);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@import "../core/variables.scss";
|
|
2
|
+
|
|
3
|
+
.#{$prefix}origin {
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: flex-end;
|
|
6
|
+
.origin-tip-inner {
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
white-space: nowrap;
|
|
9
|
+
text-overflow: ellipsis;
|
|
10
|
+
background: linear-gradient(90deg, transparent, $color-brand1-1);
|
|
11
|
+
padding: 0 16px 0 32px;
|
|
12
|
+
color: $color-text1-3;
|
|
13
|
+
min-width: 0;
|
|
14
|
+
flex: 0 1 auto;
|
|
15
|
+
font-size: 12px;
|
|
16
|
+
line-height: 20px;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './main.scss';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
import { type CommonProps } from '@alifd/next';
|
|
3
|
+
/**
|
|
4
|
+
* @api
|
|
5
|
+
*/
|
|
6
|
+
export interface OriginProps extends React.HTMLAttributes<HTMLElement>, CommonProps {
|
|
7
|
+
className?: string;
|
|
8
|
+
/**
|
|
9
|
+
* 来源的文案或者dom内容
|
|
10
|
+
*/
|
|
11
|
+
text?: string | ReactNode;
|
|
12
|
+
}
|
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.2",
|
|
4
4
|
"description": "A configurable component library for chat built on React.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -265,6 +265,18 @@
|
|
|
265
265
|
"./card-loading/style.js": {
|
|
266
266
|
"import": "./es/card-loading/style.js",
|
|
267
267
|
"require": "./lib/card-loading/style.js"
|
|
268
|
+
},
|
|
269
|
+
"./origin": {
|
|
270
|
+
"import": "./es/origin/index.js",
|
|
271
|
+
"require": "./lib/origin/index.js"
|
|
272
|
+
},
|
|
273
|
+
"./origin/style": {
|
|
274
|
+
"import": "./es/origin/style.js",
|
|
275
|
+
"require": "./lib/origin/style.js"
|
|
276
|
+
},
|
|
277
|
+
"./origin/style.js": {
|
|
278
|
+
"import": "./es/origin/style.js",
|
|
279
|
+
"require": "./lib/origin/style.js"
|
|
268
280
|
}
|
|
269
281
|
},
|
|
270
282
|
"files": [
|