@datarobot/design-system 30.5.0 → 30.6.0
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/cjs/form-field/constants.d.ts +2 -0
- package/cjs/form-field/constants.js +2 -1
- package/cjs/message/message.d.ts +2 -1
- package/cjs/message/message.js +25 -9
- package/cjs/message/thinking-icon.d.ts +12 -0
- package/cjs/message/thinking-icon.js +79 -0
- package/cjs/text-editor/text-editor-content.js +0 -2
- package/esm/form-field/constants.d.ts +2 -0
- package/esm/form-field/constants.js +2 -1
- package/esm/message/message.d.ts +2 -1
- package/esm/message/message.js +25 -9
- package/esm/message/thinking-icon.d.ts +12 -0
- package/esm/message/thinking-icon.js +71 -0
- package/esm/text-editor/text-editor-content.js +0 -2
- package/js/bundle/bundle.js +133 -14
- package/js/bundle/bundle.min.js +1 -1
- package/js/bundle/index.d.ts +4 -1
- package/package.json +1 -1
- package/styles/index.css +55 -1
- package/styles/index.min.css +1 -1
- package/styles/themes/alpine-light.css +1 -0
- package/styles/themes/alpine-light.min.css +1 -1
- package/styles/themes/midnight-gray.css +1 -0
- package/styles/themes/midnight-gray.min.css +1 -1
|
@@ -8,6 +8,7 @@ export declare const VALIDATION_RULE_TYPES: {
|
|
|
8
8
|
readonly IN_PROGRESS: "in-progress";
|
|
9
9
|
readonly EXPIRED: "expired";
|
|
10
10
|
readonly DISABLED: "disabled";
|
|
11
|
+
readonly THINKING: "thinking";
|
|
11
12
|
};
|
|
12
13
|
export type ValidationRuleTypes = ValueOf<typeof VALIDATION_RULE_TYPES>;
|
|
13
14
|
export declare const MESSAGE_DISPLAY_LOCATION: {
|
|
@@ -30,6 +31,7 @@ export type VALIDATION_VALUES = {
|
|
|
30
31
|
[VALIDATION_RULE_TYPES.IN_PROGRESS]?: string;
|
|
31
32
|
[VALIDATION_RULE_TYPES.EXPIRED]?: string;
|
|
32
33
|
[VALIDATION_RULE_TYPES.DISABLED]?: string;
|
|
34
|
+
[VALIDATION_RULE_TYPES.THINKING]?: string;
|
|
33
35
|
};
|
|
34
36
|
export declare const useDefaultValidationValues: () => VALIDATION_VALUES;
|
|
35
37
|
export declare const INPUT_TYPES: {
|
|
@@ -15,7 +15,8 @@ const VALIDATION_RULE_TYPES = exports.VALIDATION_RULE_TYPES = {
|
|
|
15
15
|
SUCCESS_INFO: 'success-info',
|
|
16
16
|
IN_PROGRESS: 'in-progress',
|
|
17
17
|
EXPIRED: 'expired',
|
|
18
|
-
DISABLED: 'disabled'
|
|
18
|
+
DISABLED: 'disabled',
|
|
19
|
+
THINKING: 'thinking'
|
|
19
20
|
};
|
|
20
21
|
const MESSAGE_DISPLAY_LOCATION = exports.MESSAGE_DISPLAY_LOCATION = {
|
|
21
22
|
INLINE: 'inline',
|
package/cjs/message/message.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare const MESSAGE_TYPES: {
|
|
|
11
11
|
readonly SUCCESS_INFO: "success-info";
|
|
12
12
|
readonly IN_PROGRESS: "in-progress";
|
|
13
13
|
readonly EXPIRED: "expired";
|
|
14
|
+
readonly THINKING: "thinking";
|
|
14
15
|
};
|
|
15
16
|
export declare const MESSAGE_ICON_PLACEMENT: {
|
|
16
17
|
readonly LEFT: "left";
|
|
@@ -37,7 +38,7 @@ type Icons = {
|
|
|
37
38
|
[key: string]: IconLookup;
|
|
38
39
|
};
|
|
39
40
|
export type MessageProps = {
|
|
40
|
-
children
|
|
41
|
+
children?: ReactNode;
|
|
41
42
|
className?: string;
|
|
42
43
|
testId?: string;
|
|
43
44
|
/** Identifies the type of the message */
|
package/cjs/message/message.js
CHANGED
|
@@ -14,6 +14,7 @@ var _faCircleXmark = require("@fortawesome/free-solid-svg-icons/faCircleXmark");
|
|
|
14
14
|
var _faCircleCheck = require("@fortawesome/free-solid-svg-icons/faCircleCheck");
|
|
15
15
|
var _faCircleNotch = require("@fortawesome/free-solid-svg-icons/faCircleNotch");
|
|
16
16
|
var _fontAwesomeIcon = require("../font-awesome-icon");
|
|
17
|
+
var _thinkingIcon = require("./thinking-icon");
|
|
17
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
19
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
20
|
const MESSAGE_TYPES = exports.MESSAGE_TYPES = {
|
|
@@ -24,7 +25,8 @@ const MESSAGE_TYPES = exports.MESSAGE_TYPES = {
|
|
|
24
25
|
SUCCESS: 'success',
|
|
25
26
|
SUCCESS_INFO: 'success-info',
|
|
26
27
|
IN_PROGRESS: 'in-progress',
|
|
27
|
-
EXPIRED: 'expired'
|
|
28
|
+
EXPIRED: 'expired',
|
|
29
|
+
THINKING: 'thinking'
|
|
28
30
|
};
|
|
29
31
|
const MESSAGE_ICON_PLACEMENT = exports.MESSAGE_ICON_PLACEMENT = {
|
|
30
32
|
LEFT: 'left',
|
|
@@ -88,6 +90,10 @@ function getMessageConfig(icons, type) {
|
|
|
88
90
|
icon,
|
|
89
91
|
className: 'expired'
|
|
90
92
|
};
|
|
93
|
+
case MESSAGE_TYPES.THINKING:
|
|
94
|
+
return {
|
|
95
|
+
className: 'thinking'
|
|
96
|
+
};
|
|
91
97
|
default:
|
|
92
98
|
return {
|
|
93
99
|
icon,
|
|
@@ -113,23 +119,33 @@ function Message({
|
|
|
113
119
|
icons = MESSAGE_ICONS
|
|
114
120
|
}) {
|
|
115
121
|
const messageConfig = getMessageConfig(icons, type);
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
122
|
+
const renderIcon = () => {
|
|
123
|
+
if (type === MESSAGE_TYPES.THINKING) {
|
|
124
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_thinkingIcon.ThinkingIcon, {
|
|
125
|
+
size: size
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
if (messageConfig.icon) {
|
|
129
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_fontAwesomeIcon.FontAwesomeIcon, {
|
|
130
|
+
icon: messageConfig.icon,
|
|
131
|
+
spin: type === MESSAGE_TYPES.IN_PROGRESS
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
return null;
|
|
135
|
+
};
|
|
136
|
+
const icon = renderIcon();
|
|
137
|
+
const resolvedChildren = type === MESSAGE_TYPES.THINKING ? children ?? 'Thinking' : children;
|
|
120
138
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
121
139
|
className: (0, _classnames.default)('message-component', isStatus && 'status', messageConfig.className, {
|
|
122
140
|
'center-status': isCentered,
|
|
123
141
|
sm: size === MESSAGE_SIZES.SM
|
|
124
|
-
},
|
|
125
|
-
// global styles for now, should be moved into the components styles, once we message css usages to React
|
|
126
|
-
className, `with-${iconPlacement}-icon`),
|
|
142
|
+
}, className, `with-${iconPlacement}-icon`),
|
|
127
143
|
"test-id": testId,
|
|
128
144
|
id: id,
|
|
129
145
|
"aria-live": "polite",
|
|
130
146
|
role: messageConfig?.role,
|
|
131
147
|
children: [iconPlacement === MESSAGE_ICON_PLACEMENT.LEFT && icon, /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
132
|
-
children:
|
|
148
|
+
children: resolvedChildren
|
|
133
149
|
}), iconPlacement === MESSAGE_ICON_PLACEMENT.RIGHT && icon]
|
|
134
150
|
});
|
|
135
151
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ValueOf } from '../types';
|
|
2
|
+
import './thinking-icon.less';
|
|
3
|
+
export declare const THINKING_ICON_SIZES: {
|
|
4
|
+
readonly SM: "sm";
|
|
5
|
+
readonly MD: "md";
|
|
6
|
+
};
|
|
7
|
+
export type ThinkingIconSize = ValueOf<typeof THINKING_ICON_SIZES>;
|
|
8
|
+
type ThinkingIconProps = {
|
|
9
|
+
size?: ThinkingIconSize;
|
|
10
|
+
};
|
|
11
|
+
export declare function ThinkingIcon({ size, }: ThinkingIconProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.THINKING_ICON_SIZES = void 0;
|
|
7
|
+
exports.ThinkingIcon = ThinkingIcon;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
const THINKING_ICON_SIZES = exports.THINKING_ICON_SIZES = {
|
|
13
|
+
SM: 'sm',
|
|
14
|
+
MD: 'md'
|
|
15
|
+
};
|
|
16
|
+
// Bar geometry in natural SVG coordinates (viewBox 0 0 18.667 18).
|
|
17
|
+
const BARS = [{
|
|
18
|
+
top: 0,
|
|
19
|
+
left: 0,
|
|
20
|
+
width: 9.334
|
|
21
|
+
}, {
|
|
22
|
+
top: 2,
|
|
23
|
+
left: 9.334,
|
|
24
|
+
width: 4.661
|
|
25
|
+
}, {
|
|
26
|
+
top: 4,
|
|
27
|
+
left: 0,
|
|
28
|
+
width: 9.334
|
|
29
|
+
}, {
|
|
30
|
+
top: 6,
|
|
31
|
+
left: 14,
|
|
32
|
+
width: 4.667
|
|
33
|
+
}, {
|
|
34
|
+
top: 8,
|
|
35
|
+
left: 0,
|
|
36
|
+
width: 14
|
|
37
|
+
}, {
|
|
38
|
+
top: 10,
|
|
39
|
+
left: 14,
|
|
40
|
+
width: 4.667
|
|
41
|
+
}, {
|
|
42
|
+
top: 12,
|
|
43
|
+
left: 0,
|
|
44
|
+
width: 9.334
|
|
45
|
+
}, {
|
|
46
|
+
top: 14,
|
|
47
|
+
left: 9.334,
|
|
48
|
+
width: 4.661
|
|
49
|
+
}, {
|
|
50
|
+
top: 16,
|
|
51
|
+
left: 0,
|
|
52
|
+
width: 9.334
|
|
53
|
+
}];
|
|
54
|
+
const BAR_HEIGHT = 2;
|
|
55
|
+
|
|
56
|
+
// Staggered cascade: left backbone bars enter first, right accent bars follow.
|
|
57
|
+
// Entry order: r1 → r7 → r3 → r9 → r5 → r8 → r2 → r4 → r6
|
|
58
|
+
const DELAYS = [0.0, 0.62, 0.22, 0.7, 0.44, 0.76, 0.12, 0.54, 0.32];
|
|
59
|
+
function ThinkingIcon({
|
|
60
|
+
size = THINKING_ICON_SIZES.MD
|
|
61
|
+
}) {
|
|
62
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
|
|
63
|
+
className: (0, _classnames.default)('thinking-icon', size),
|
|
64
|
+
viewBox: "0 0 18.667 18",
|
|
65
|
+
"aria-hidden": "true",
|
|
66
|
+
children: BARS.map((bar, i) => /*#__PURE__*/(0, _jsxRuntime.jsx)("rect", {
|
|
67
|
+
className: "bar",
|
|
68
|
+
x: bar.left,
|
|
69
|
+
y: bar.top,
|
|
70
|
+
width: bar.width,
|
|
71
|
+
height: BAR_HEIGHT
|
|
72
|
+
// eslint-disable-next-line react/forbid-dom-props
|
|
73
|
+
,
|
|
74
|
+
style: {
|
|
75
|
+
animationDelay: `${DELAYS[i]}s`
|
|
76
|
+
}
|
|
77
|
+
}, i))
|
|
78
|
+
});
|
|
79
|
+
}
|
|
@@ -170,9 +170,7 @@ function TextEditorContent({
|
|
|
170
170
|
useSlate
|
|
171
171
|
} = slateReact;
|
|
172
172
|
const editor = useSlate();
|
|
173
|
-
/* eslint-disable-next-line testing-library/render-result-naming-convention */
|
|
174
173
|
const ElementNode = elementRender;
|
|
175
|
-
/* eslint-disable-next-line testing-library/render-result-naming-convention */
|
|
176
174
|
const LeafNode = leafRender;
|
|
177
175
|
|
|
178
176
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -8,6 +8,7 @@ export declare const VALIDATION_RULE_TYPES: {
|
|
|
8
8
|
readonly IN_PROGRESS: "in-progress";
|
|
9
9
|
readonly EXPIRED: "expired";
|
|
10
10
|
readonly DISABLED: "disabled";
|
|
11
|
+
readonly THINKING: "thinking";
|
|
11
12
|
};
|
|
12
13
|
export type ValidationRuleTypes = ValueOf<typeof VALIDATION_RULE_TYPES>;
|
|
13
14
|
export declare const MESSAGE_DISPLAY_LOCATION: {
|
|
@@ -30,6 +31,7 @@ export type VALIDATION_VALUES = {
|
|
|
30
31
|
[VALIDATION_RULE_TYPES.IN_PROGRESS]?: string;
|
|
31
32
|
[VALIDATION_RULE_TYPES.EXPIRED]?: string;
|
|
32
33
|
[VALIDATION_RULE_TYPES.DISABLED]?: string;
|
|
34
|
+
[VALIDATION_RULE_TYPES.THINKING]?: string;
|
|
33
35
|
};
|
|
34
36
|
export declare const useDefaultValidationValues: () => VALIDATION_VALUES;
|
|
35
37
|
export declare const INPUT_TYPES: {
|
|
@@ -9,7 +9,8 @@ export const VALIDATION_RULE_TYPES = {
|
|
|
9
9
|
SUCCESS_INFO: 'success-info',
|
|
10
10
|
IN_PROGRESS: 'in-progress',
|
|
11
11
|
EXPIRED: 'expired',
|
|
12
|
-
DISABLED: 'disabled'
|
|
12
|
+
DISABLED: 'disabled',
|
|
13
|
+
THINKING: 'thinking'
|
|
13
14
|
};
|
|
14
15
|
export const MESSAGE_DISPLAY_LOCATION = {
|
|
15
16
|
INLINE: 'inline',
|
package/esm/message/message.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare const MESSAGE_TYPES: {
|
|
|
11
11
|
readonly SUCCESS_INFO: "success-info";
|
|
12
12
|
readonly IN_PROGRESS: "in-progress";
|
|
13
13
|
readonly EXPIRED: "expired";
|
|
14
|
+
readonly THINKING: "thinking";
|
|
14
15
|
};
|
|
15
16
|
export declare const MESSAGE_ICON_PLACEMENT: {
|
|
16
17
|
readonly LEFT: "left";
|
|
@@ -37,7 +38,7 @@ type Icons = {
|
|
|
37
38
|
[key: string]: IconLookup;
|
|
38
39
|
};
|
|
39
40
|
export type MessageProps = {
|
|
40
|
-
children
|
|
41
|
+
children?: ReactNode;
|
|
41
42
|
className?: string;
|
|
42
43
|
testId?: string;
|
|
43
44
|
/** Identifies the type of the message */
|
package/esm/message/message.js
CHANGED
|
@@ -7,6 +7,7 @@ import { faCircleXmark } from '@fortawesome/free-solid-svg-icons/faCircleXmark';
|
|
|
7
7
|
import { faCircleCheck } from '@fortawesome/free-solid-svg-icons/faCircleCheck';
|
|
8
8
|
import { faCircleNotch } from '@fortawesome/free-solid-svg-icons/faCircleNotch';
|
|
9
9
|
import { FontAwesomeIcon } from '../font-awesome-icon';
|
|
10
|
+
import { ThinkingIcon } from './thinking-icon';
|
|
10
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
12
|
export const MESSAGE_TYPES = {
|
|
12
13
|
DISABLED: 'disabled',
|
|
@@ -16,7 +17,8 @@ export const MESSAGE_TYPES = {
|
|
|
16
17
|
SUCCESS: 'success',
|
|
17
18
|
SUCCESS_INFO: 'success-info',
|
|
18
19
|
IN_PROGRESS: 'in-progress',
|
|
19
|
-
EXPIRED: 'expired'
|
|
20
|
+
EXPIRED: 'expired',
|
|
21
|
+
THINKING: 'thinking'
|
|
20
22
|
};
|
|
21
23
|
export const MESSAGE_ICON_PLACEMENT = {
|
|
22
24
|
LEFT: 'left',
|
|
@@ -80,6 +82,10 @@ function getMessageConfig(icons, type) {
|
|
|
80
82
|
icon,
|
|
81
83
|
className: 'expired'
|
|
82
84
|
};
|
|
85
|
+
case MESSAGE_TYPES.THINKING:
|
|
86
|
+
return {
|
|
87
|
+
className: 'thinking'
|
|
88
|
+
};
|
|
83
89
|
default:
|
|
84
90
|
return {
|
|
85
91
|
icon,
|
|
@@ -105,23 +111,33 @@ export function Message({
|
|
|
105
111
|
icons = MESSAGE_ICONS
|
|
106
112
|
}) {
|
|
107
113
|
const messageConfig = getMessageConfig(icons, type);
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
114
|
+
const renderIcon = () => {
|
|
115
|
+
if (type === MESSAGE_TYPES.THINKING) {
|
|
116
|
+
return /*#__PURE__*/_jsx(ThinkingIcon, {
|
|
117
|
+
size: size
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
if (messageConfig.icon) {
|
|
121
|
+
return /*#__PURE__*/_jsx(FontAwesomeIcon, {
|
|
122
|
+
icon: messageConfig.icon,
|
|
123
|
+
spin: type === MESSAGE_TYPES.IN_PROGRESS
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return null;
|
|
127
|
+
};
|
|
128
|
+
const icon = renderIcon();
|
|
129
|
+
const resolvedChildren = type === MESSAGE_TYPES.THINKING ? children ?? 'Thinking' : children;
|
|
112
130
|
return /*#__PURE__*/_jsxs("p", {
|
|
113
131
|
className: classNames('message-component', isStatus && 'status', messageConfig.className, {
|
|
114
132
|
'center-status': isCentered,
|
|
115
133
|
sm: size === MESSAGE_SIZES.SM
|
|
116
|
-
},
|
|
117
|
-
// global styles for now, should be moved into the components styles, once we message css usages to React
|
|
118
|
-
className, `with-${iconPlacement}-icon`),
|
|
134
|
+
}, className, `with-${iconPlacement}-icon`),
|
|
119
135
|
"test-id": testId,
|
|
120
136
|
id: id,
|
|
121
137
|
"aria-live": "polite",
|
|
122
138
|
role: messageConfig?.role,
|
|
123
139
|
children: [iconPlacement === MESSAGE_ICON_PLACEMENT.LEFT && icon, /*#__PURE__*/_jsx("span", {
|
|
124
|
-
children:
|
|
140
|
+
children: resolvedChildren
|
|
125
141
|
}), iconPlacement === MESSAGE_ICON_PLACEMENT.RIGHT && icon]
|
|
126
142
|
});
|
|
127
143
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ValueOf } from '../types';
|
|
2
|
+
import './thinking-icon.less';
|
|
3
|
+
export declare const THINKING_ICON_SIZES: {
|
|
4
|
+
readonly SM: "sm";
|
|
5
|
+
readonly MD: "md";
|
|
6
|
+
};
|
|
7
|
+
export type ThinkingIconSize = ValueOf<typeof THINKING_ICON_SIZES>;
|
|
8
|
+
type ThinkingIconProps = {
|
|
9
|
+
size?: ThinkingIconSize;
|
|
10
|
+
};
|
|
11
|
+
export declare function ThinkingIcon({ size, }: ThinkingIconProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
export const THINKING_ICON_SIZES = {
|
|
5
|
+
SM: 'sm',
|
|
6
|
+
MD: 'md'
|
|
7
|
+
};
|
|
8
|
+
// Bar geometry in natural SVG coordinates (viewBox 0 0 18.667 18).
|
|
9
|
+
const BARS = [{
|
|
10
|
+
top: 0,
|
|
11
|
+
left: 0,
|
|
12
|
+
width: 9.334
|
|
13
|
+
}, {
|
|
14
|
+
top: 2,
|
|
15
|
+
left: 9.334,
|
|
16
|
+
width: 4.661
|
|
17
|
+
}, {
|
|
18
|
+
top: 4,
|
|
19
|
+
left: 0,
|
|
20
|
+
width: 9.334
|
|
21
|
+
}, {
|
|
22
|
+
top: 6,
|
|
23
|
+
left: 14,
|
|
24
|
+
width: 4.667
|
|
25
|
+
}, {
|
|
26
|
+
top: 8,
|
|
27
|
+
left: 0,
|
|
28
|
+
width: 14
|
|
29
|
+
}, {
|
|
30
|
+
top: 10,
|
|
31
|
+
left: 14,
|
|
32
|
+
width: 4.667
|
|
33
|
+
}, {
|
|
34
|
+
top: 12,
|
|
35
|
+
left: 0,
|
|
36
|
+
width: 9.334
|
|
37
|
+
}, {
|
|
38
|
+
top: 14,
|
|
39
|
+
left: 9.334,
|
|
40
|
+
width: 4.661
|
|
41
|
+
}, {
|
|
42
|
+
top: 16,
|
|
43
|
+
left: 0,
|
|
44
|
+
width: 9.334
|
|
45
|
+
}];
|
|
46
|
+
const BAR_HEIGHT = 2;
|
|
47
|
+
|
|
48
|
+
// Staggered cascade: left backbone bars enter first, right accent bars follow.
|
|
49
|
+
// Entry order: r1 → r7 → r3 → r9 → r5 → r8 → r2 → r4 → r6
|
|
50
|
+
const DELAYS = [0.0, 0.62, 0.22, 0.7, 0.44, 0.76, 0.12, 0.54, 0.32];
|
|
51
|
+
export function ThinkingIcon({
|
|
52
|
+
size = THINKING_ICON_SIZES.MD
|
|
53
|
+
}) {
|
|
54
|
+
return /*#__PURE__*/_jsx("svg", {
|
|
55
|
+
className: classNames('thinking-icon', size),
|
|
56
|
+
viewBox: "0 0 18.667 18",
|
|
57
|
+
"aria-hidden": "true",
|
|
58
|
+
children: BARS.map((bar, i) => /*#__PURE__*/_jsx("rect", {
|
|
59
|
+
className: "bar",
|
|
60
|
+
x: bar.left,
|
|
61
|
+
y: bar.top,
|
|
62
|
+
width: bar.width,
|
|
63
|
+
height: BAR_HEIGHT
|
|
64
|
+
// eslint-disable-next-line react/forbid-dom-props
|
|
65
|
+
,
|
|
66
|
+
style: {
|
|
67
|
+
animationDelay: `${DELAYS[i]}s`
|
|
68
|
+
}
|
|
69
|
+
}, i))
|
|
70
|
+
});
|
|
71
|
+
}
|
|
@@ -158,9 +158,7 @@ export default function TextEditorContent({
|
|
|
158
158
|
useSlate
|
|
159
159
|
} = slateReact;
|
|
160
160
|
const editor = useSlate();
|
|
161
|
-
/* eslint-disable-next-line testing-library/render-result-naming-convention */
|
|
162
161
|
const ElementNode = elementRender;
|
|
163
|
-
/* eslint-disable-next-line testing-library/render-result-naming-convention */
|
|
164
162
|
const LeafNode = leafRender;
|
|
165
163
|
|
|
166
164
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
package/js/bundle/bundle.js
CHANGED
|
@@ -60232,7 +60232,8 @@ var VALIDATION_RULE_TYPES = {
|
|
|
60232
60232
|
SUCCESS_INFO: 'success-info',
|
|
60233
60233
|
IN_PROGRESS: 'in-progress',
|
|
60234
60234
|
EXPIRED: 'expired',
|
|
60235
|
-
DISABLED: 'disabled'
|
|
60235
|
+
DISABLED: 'disabled',
|
|
60236
|
+
THINKING: 'thinking'
|
|
60236
60237
|
};
|
|
60237
60238
|
var MESSAGE_DISPLAY_LOCATION = {
|
|
60238
60239
|
INLINE: 'inline',
|
|
@@ -69754,8 +69755,9 @@ var Markdown = function Markdown(_ref) {
|
|
|
69754
69755
|
/* harmony import */ var _fortawesome_free_solid_svg_icons_faCircleNotch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @fortawesome/free-solid-svg-icons/faCircleNotch */ "@fortawesome/free-solid-svg-icons/faCircleNotch");
|
|
69755
69756
|
/* harmony import */ var _fortawesome_free_solid_svg_icons_faCircleNotch__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_fortawesome_free_solid_svg_icons_faCircleNotch__WEBPACK_IMPORTED_MODULE_7__);
|
|
69756
69757
|
/* harmony import */ var _font_awesome_icon__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../font-awesome-icon */ "./src/components/font-awesome-icon/index.ts");
|
|
69757
|
-
/* harmony import */ var
|
|
69758
|
-
/* harmony import */ var
|
|
69758
|
+
/* harmony import */ var _thinking_icon__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./thinking-icon */ "./src/components/message/thinking-icon.tsx");
|
|
69759
|
+
/* harmony import */ var _message_less__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./message.less */ "./src/components/message/message.less");
|
|
69760
|
+
/* harmony import */ var _message_less__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_message_less__WEBPACK_IMPORTED_MODULE_10__);
|
|
69759
69761
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
69760
69762
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
69761
69763
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
@@ -69770,6 +69772,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
69770
69772
|
|
|
69771
69773
|
|
|
69772
69774
|
|
|
69775
|
+
|
|
69773
69776
|
var MESSAGE_TYPES = {
|
|
69774
69777
|
DISABLED: 'disabled',
|
|
69775
69778
|
INFO: 'info',
|
|
@@ -69778,7 +69781,8 @@ var MESSAGE_TYPES = {
|
|
|
69778
69781
|
SUCCESS: 'success',
|
|
69779
69782
|
SUCCESS_INFO: 'success-info',
|
|
69780
69783
|
IN_PROGRESS: 'in-progress',
|
|
69781
|
-
EXPIRED: 'expired'
|
|
69784
|
+
EXPIRED: 'expired',
|
|
69785
|
+
THINKING: 'thinking'
|
|
69782
69786
|
};
|
|
69783
69787
|
var MESSAGE_ICON_PLACEMENT = {
|
|
69784
69788
|
LEFT: 'left',
|
|
@@ -69833,6 +69837,10 @@ function getMessageConfig(icons, type) {
|
|
|
69833
69837
|
icon: icon,
|
|
69834
69838
|
className: 'expired'
|
|
69835
69839
|
};
|
|
69840
|
+
case MESSAGE_TYPES.THINKING:
|
|
69841
|
+
return {
|
|
69842
|
+
className: 'thinking'
|
|
69843
|
+
};
|
|
69836
69844
|
default:
|
|
69837
69845
|
return {
|
|
69838
69846
|
icon: icon,
|
|
@@ -69863,22 +69871,135 @@ function Message(_ref) {
|
|
|
69863
69871
|
_ref$icons = _ref.icons,
|
|
69864
69872
|
icons = _ref$icons === void 0 ? MESSAGE_ICONS : _ref$icons;
|
|
69865
69873
|
var messageConfig = getMessageConfig(icons, type);
|
|
69866
|
-
var
|
|
69867
|
-
|
|
69868
|
-
|
|
69869
|
-
|
|
69874
|
+
var renderIcon = function renderIcon() {
|
|
69875
|
+
if (type === MESSAGE_TYPES.THINKING) {
|
|
69876
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_thinking_icon__WEBPACK_IMPORTED_MODULE_9__.ThinkingIcon, {
|
|
69877
|
+
size: size
|
|
69878
|
+
});
|
|
69879
|
+
}
|
|
69880
|
+
if (messageConfig.icon) {
|
|
69881
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_font_awesome_icon__WEBPACK_IMPORTED_MODULE_8__.FontAwesomeIcon, {
|
|
69882
|
+
icon: messageConfig.icon,
|
|
69883
|
+
spin: type === MESSAGE_TYPES.IN_PROGRESS
|
|
69884
|
+
});
|
|
69885
|
+
}
|
|
69886
|
+
return null;
|
|
69887
|
+
};
|
|
69888
|
+
var icon = renderIcon();
|
|
69889
|
+
var resolvedChildren = type === MESSAGE_TYPES.THINKING ? children !== null && children !== void 0 ? children : 'Thinking' : children;
|
|
69870
69890
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", {
|
|
69871
69891
|
className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('message-component', isStatus && 'status', messageConfig.className, {
|
|
69872
69892
|
'center-status': isCentered,
|
|
69873
69893
|
sm: size === MESSAGE_SIZES.SM
|
|
69874
|
-
},
|
|
69875
|
-
// global styles for now, should be moved into the components styles, once we message css usages to React
|
|
69876
|
-
className, "with-".concat(iconPlacement, "-icon")),
|
|
69894
|
+
}, className, "with-".concat(iconPlacement, "-icon")),
|
|
69877
69895
|
"test-id": testId,
|
|
69878
69896
|
id: id,
|
|
69879
69897
|
"aria-live": "polite",
|
|
69880
69898
|
role: messageConfig === null || messageConfig === void 0 ? void 0 : messageConfig.role
|
|
69881
|
-
}, iconPlacement === MESSAGE_ICON_PLACEMENT.LEFT && icon, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", null,
|
|
69899
|
+
}, iconPlacement === MESSAGE_ICON_PLACEMENT.LEFT && icon, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", null, resolvedChildren), iconPlacement === MESSAGE_ICON_PLACEMENT.RIGHT && icon);
|
|
69900
|
+
}
|
|
69901
|
+
|
|
69902
|
+
/***/ }),
|
|
69903
|
+
|
|
69904
|
+
/***/ "./src/components/message/thinking-icon.less":
|
|
69905
|
+
/*!***************************************************!*\
|
|
69906
|
+
!*** ./src/components/message/thinking-icon.less ***!
|
|
69907
|
+
\***************************************************/
|
|
69908
|
+
/***/ (() => {
|
|
69909
|
+
|
|
69910
|
+
// extracted by mini-css-extract-plugin
|
|
69911
|
+
|
|
69912
|
+
/***/ }),
|
|
69913
|
+
|
|
69914
|
+
/***/ "./src/components/message/thinking-icon.tsx":
|
|
69915
|
+
/*!**************************************************!*\
|
|
69916
|
+
!*** ./src/components/message/thinking-icon.tsx ***!
|
|
69917
|
+
\**************************************************/
|
|
69918
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
69919
|
+
|
|
69920
|
+
"use strict";
|
|
69921
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
69922
|
+
/* harmony export */ ThinkingIcon: () => (/* binding */ ThinkingIcon)
|
|
69923
|
+
/* harmony export */ });
|
|
69924
|
+
/* unused harmony export THINKING_ICON_SIZES */
|
|
69925
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
69926
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
69927
|
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
|
|
69928
|
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
|
|
69929
|
+
/* harmony import */ var _thinking_icon_less__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./thinking-icon.less */ "./src/components/message/thinking-icon.less");
|
|
69930
|
+
/* harmony import */ var _thinking_icon_less__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_thinking_icon_less__WEBPACK_IMPORTED_MODULE_2__);
|
|
69931
|
+
|
|
69932
|
+
|
|
69933
|
+
|
|
69934
|
+
var THINKING_ICON_SIZES = {
|
|
69935
|
+
SM: 'sm',
|
|
69936
|
+
MD: 'md'
|
|
69937
|
+
};
|
|
69938
|
+
// Bar geometry in natural SVG coordinates (viewBox 0 0 18.667 18).
|
|
69939
|
+
var BARS = [{
|
|
69940
|
+
top: 0,
|
|
69941
|
+
left: 0,
|
|
69942
|
+
width: 9.334
|
|
69943
|
+
}, {
|
|
69944
|
+
top: 2,
|
|
69945
|
+
left: 9.334,
|
|
69946
|
+
width: 4.661
|
|
69947
|
+
}, {
|
|
69948
|
+
top: 4,
|
|
69949
|
+
left: 0,
|
|
69950
|
+
width: 9.334
|
|
69951
|
+
}, {
|
|
69952
|
+
top: 6,
|
|
69953
|
+
left: 14,
|
|
69954
|
+
width: 4.667
|
|
69955
|
+
}, {
|
|
69956
|
+
top: 8,
|
|
69957
|
+
left: 0,
|
|
69958
|
+
width: 14
|
|
69959
|
+
}, {
|
|
69960
|
+
top: 10,
|
|
69961
|
+
left: 14,
|
|
69962
|
+
width: 4.667
|
|
69963
|
+
}, {
|
|
69964
|
+
top: 12,
|
|
69965
|
+
left: 0,
|
|
69966
|
+
width: 9.334
|
|
69967
|
+
}, {
|
|
69968
|
+
top: 14,
|
|
69969
|
+
left: 9.334,
|
|
69970
|
+
width: 4.661
|
|
69971
|
+
}, {
|
|
69972
|
+
top: 16,
|
|
69973
|
+
left: 0,
|
|
69974
|
+
width: 9.334
|
|
69975
|
+
}];
|
|
69976
|
+
var BAR_HEIGHT = 2;
|
|
69977
|
+
|
|
69978
|
+
// Staggered cascade: left backbone bars enter first, right accent bars follow.
|
|
69979
|
+
// Entry order: r1 → r7 → r3 → r9 → r5 → r8 → r2 → r4 → r6
|
|
69980
|
+
var DELAYS = [0.0, 0.62, 0.22, 0.7, 0.44, 0.76, 0.12, 0.54, 0.32];
|
|
69981
|
+
function ThinkingIcon(_ref) {
|
|
69982
|
+
var _ref$size = _ref.size,
|
|
69983
|
+
size = _ref$size === void 0 ? THINKING_ICON_SIZES.MD : _ref$size;
|
|
69984
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", {
|
|
69985
|
+
className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('thinking-icon', size),
|
|
69986
|
+
viewBox: "0 0 18.667 18",
|
|
69987
|
+
"aria-hidden": "true"
|
|
69988
|
+
}, BARS.map(function (bar, i) {
|
|
69989
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("rect", {
|
|
69990
|
+
key: i,
|
|
69991
|
+
className: "bar",
|
|
69992
|
+
x: bar.left,
|
|
69993
|
+
y: bar.top,
|
|
69994
|
+
width: bar.width,
|
|
69995
|
+
height: BAR_HEIGHT
|
|
69996
|
+
// eslint-disable-next-line react/forbid-dom-props
|
|
69997
|
+
,
|
|
69998
|
+
style: {
|
|
69999
|
+
animationDelay: "".concat(DELAYS[i], "s")
|
|
70000
|
+
}
|
|
70001
|
+
});
|
|
70002
|
+
}));
|
|
69882
70003
|
}
|
|
69883
70004
|
|
|
69884
70005
|
/***/ }),
|
|
@@ -83642,9 +83763,7 @@ function TextEditorContent(_ref4) {
|
|
|
83642
83763
|
var Editable = slateReact.Editable,
|
|
83643
83764
|
useSlate = slateReact.useSlate;
|
|
83644
83765
|
var editor = useSlate();
|
|
83645
|
-
/* eslint-disable-next-line testing-library/render-result-naming-convention */
|
|
83646
83766
|
var ElementNode = elementRender;
|
|
83647
|
-
/* eslint-disable-next-line testing-library/render-result-naming-convention */
|
|
83648
83767
|
var LeafNode = leafRender;
|
|
83649
83768
|
|
|
83650
83769
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|