botframework-webchat-fluent-theme 4.17.0-main.20240411.ff34969 → 4.17.0-main.20240416.4ff01ae
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/dist/botframework-webchat-fluent-theme.development.css.map +1 -0
- package/dist/botframework-webchat-fluent-theme.development.js +384 -2081
- package/dist/botframework-webchat-fluent-theme.development.js.map +1 -1
- package/dist/botframework-webchat-fluent-theme.production.min.css.map +1 -0
- package/dist/botframework-webchat-fluent-theme.production.min.js +1 -3
- package/dist/botframework-webchat-fluent-theme.production.min.js.map +1 -1
- package/dist/index.css.map +1 -0
- package/dist/index.d.mts +27 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +360 -648
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1076 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -8
- package/src/components/Theme.module.css +60 -0
- package/src/components/Theme.tsx +4 -64
- package/src/components/dropZone/index.module.css +23 -0
- package/src/components/dropZone/index.tsx +6 -31
- package/src/components/sendbox/AddAttachmentButton.module.css +10 -0
- package/src/components/sendbox/AddAttachmentButton.tsx +5 -17
- package/src/components/sendbox/Attachments.module.css +7 -0
- package/src/components/sendbox/Attachments.tsx +3 -12
- package/src/components/sendbox/ErrorMessage.module.css +9 -0
- package/src/components/sendbox/ErrorMessage.tsx +2 -13
- package/src/components/sendbox/TelephoneKeypadToolbarButton.tsx +1 -1
- package/src/components/sendbox/TextArea.module.css +61 -0
- package/src/components/sendbox/TextArea.tsx +9 -70
- package/src/components/sendbox/Toolbar.module.css +49 -0
- package/src/components/sendbox/Toolbar.tsx +4 -55
- package/src/components/sendbox/index.module.css +58 -0
- package/src/components/sendbox/index.tsx +16 -81
- package/src/components/suggestedActions/SuggestedAction.module.css +34 -0
- package/src/components/suggestedActions/SuggestedAction.tsx +5 -47
- package/src/components/suggestedActions/index.module.css +23 -0
- package/src/components/suggestedActions/index.tsx +18 -23
- package/src/components/telephoneKeypad/private/Button.module.css +62 -0
- package/src/components/telephoneKeypad/private/Button.tsx +5 -67
- package/src/components/telephoneKeypad/private/TelephoneKeypad.module.css +30 -0
- package/src/components/telephoneKeypad/private/TelephoneKeypad.tsx +4 -35
- package/src/env.d.ts +7 -0
- package/src/index.ts +3 -0
- package/src/styles/injectStyle.ts +9 -0
- package/src/styles/useStyles.ts +19 -0
- package/src/styles.ts +4 -0
- package/src/tsconfig.json +2 -1
- package/src/private/useStyleToEmotionObject.ts +0 -32
- package/src/styles/index.ts +0 -15
package/dist/index.js
CHANGED
|
@@ -37,8 +37,8 @@ module.exports = __toCommonJS(src_exports);
|
|
|
37
37
|
var import_inject_meta_tag = require("inject-meta-tag");
|
|
38
38
|
|
|
39
39
|
// src/private/FluentThemeProvider.tsx
|
|
40
|
-
var
|
|
41
|
-
var
|
|
40
|
+
var import_botframework_webchat_component9 = require("botframework-webchat-component");
|
|
41
|
+
var import_react26 = __toESM(require("react"));
|
|
42
42
|
|
|
43
43
|
// src/components/telephoneKeypad/Provider.tsx
|
|
44
44
|
var import_react2 = __toESM(require("react"));
|
|
@@ -70,125 +70,75 @@ var Provider = (0, import_react2.memo)(({ children }) => {
|
|
|
70
70
|
var Provider_default = Provider;
|
|
71
71
|
|
|
72
72
|
// src/components/telephoneKeypad/Surrogate.tsx
|
|
73
|
-
var
|
|
73
|
+
var import_react7 = __toESM(require("react"));
|
|
74
74
|
|
|
75
75
|
// src/components/telephoneKeypad/private/TelephoneKeypad.tsx
|
|
76
|
-
var
|
|
76
|
+
var import_react6 = __toESM(require("react"));
|
|
77
77
|
var import_use_ref_from2 = require("use-ref-from");
|
|
78
78
|
|
|
79
|
-
// src/
|
|
80
|
-
var import_react4 = require("react");
|
|
79
|
+
// src/components/telephoneKeypad/private/Button.tsx
|
|
80
|
+
var import_react4 = __toESM(require("react"));
|
|
81
|
+
var import_use_ref_from = require("use-ref-from");
|
|
81
82
|
|
|
82
|
-
// src/private/
|
|
83
|
-
var
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
function useStyleToEmotionObject() {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
);
|
|
97
|
-
|
|
98
|
-
}, []);
|
|
83
|
+
// src/components/telephoneKeypad/private/Button.module.css
|
|
84
|
+
var Button_default = {
|
|
85
|
+
"telephone-keypad__button": "Button_telephone-keypad__button",
|
|
86
|
+
"telephone-keypad__button__ruby": "Button_telephone-keypad__button__ruby",
|
|
87
|
+
"telephone-keypad__button__text": "Button_telephone-keypad__button__text",
|
|
88
|
+
"telephone-keypad--horizontal": "Button_telephone-keypad--horizontal"
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
// src/styles/injectStyle.ts
|
|
92
|
+
var injectedStyles = "/* src/components/telephoneKeypad/private/Button.module.css */\n.webchat-fluent .Button_telephone-keypad__button {\n -webkit-user-select: none;\n align-items: center;\n appearance: none;\n background-color: White;\n border-radius: 100%;\n border: solid 1px var(--webchat-colorNeutralStroke1);\n color: var(--webchat-colorGray200);\n font-weight: var(--webchat-fontWeightSemibold);\n cursor: pointer;\n display: flex;\n flex-direction: column;\n height: 60px;\n opacity: 0.7;\n padding: 0;\n position: relative;\n touch-action: none;\n user-select: none;\n width: 60px;\n}\n.webchat-fluent .Button_telephone-keypad__button:hover {\n background-color: var(--webchat-colorGray30);\n}\n.webchat-fluent .Button_telephone-keypad__button__ruby {\n color: var(--webchat-colorGray190);\n font-size: 10px;\n}\n.webchat-fluent .Button_telephone-keypad__button__text {\n font-size: 24px;\n margin-top: 8px;\n}\n.webchat-fluent .Button_telephone-keypad--horizontal .Button_telephone-keypad__button {\n height: 32px;\n justify-content: center;\n margin: 8px 4px;\n width: 32px;\n}\n.webchat-fluent .Button_telephone-keypad--horizontal .Button_telephone-keypad__button__ruby {\n display: none;\n}\n.webchat-fluent .Button_telephone-keypad--horizontal .Button_telephone-keypad__button__text {\n font-size: 20px;\n margin-top: 0;\n}\n\n/* src/components/telephoneKeypad/private/TelephoneKeypad.module.css */\n.webchat-fluent .TelephoneKeypad_telephone-keypad {\n align-items: center;\n background: var(--webchat-colorNeutralBackground1);\n border: none;\n border-radius: var(--webchat-borderRadiusXLarge);\n display: flex;\n flex-direction: column;\n font-family: var(--webchat-fontFamilyBase);\n justify-content: center;\n}\n.webchat-fluent .TelephoneKeypad_telephone-keypad__box {\n box-sizing: border-box;\n display: grid;\n gap: 16px;\n grid-template-columns: repeat(3, 1fr);\n grid-template-rows: repeat(4, 1fr);\n justify-items: center;\n padding: 16px;\n width: 100%;\n}\n\n/* src/components/Theme.module.css */\n.webchat-fluent.Theme_theme {\n display: contents;\n --webchat-colorNeutralForeground1: var(--colorNeutralForeground1, #242424);\n --webchat-colorNeutralForeground2: var(--colorNeutralForeground2, #424242);\n --webchat-colorNeutralForeground4: var(--colorNeutralForeground4, #707070);\n --webchat-colorNeutralForegroundDisabled: var(--colorNeutralForegroundDisabled, #bdbdbd);\n --webchat-colorNeutralBackground1: var(--colorNeutralBackground1, #ffffff);\n --webchat-colorNeutralBackground4: var(--colorNeutralBackground4, #f0f0f0);\n --webchat-colorNeutralBackground5: var(--colorNeutralBackground5, #ebebeb);\n --webchat-colorSubtleBackgroundHover: var(--colorSubtleBackgroundHover, #f5f5f5);\n --webchat-colorSubtleBackgroundPressed: var(--colorSubtleBackgroundPressed, #e0e0e0);\n --webchat-colorNeutralStroke1: var(--colorNeutralStroke1, #d1d1d1);\n --webchat-colorNeutralStroke2: var(--colorNeutralStroke2, #e0e0e0);\n --webchat-colorNeutralStroke1Selected: var(--colorNeutralStroke1Selected, #bdbdbd);\n --webchat-colorBrandStroke2: var(--colorBrandStroke2, #9edcf7);\n --webchat-colorBrandForeground2Hover: var(--colorBrandForeground2Hover, #015a7a);\n --webchat-colorBrandForeground2Pressed: var(--colorBrandForeground2Pressed, #01384d);\n --webchat-colorBrandBackground2Hover: var(--colorBrandBackground2Hover, #bee7fa);\n --webchat-colorBrandBackground2Pressed: var(--colorBrandBackground2Pressed, #7fd2f5);\n --webchat-colorCompoundBrandForeground1: var(--colorCompoundBrandForeground1, #077fab);\n --webchat-colorCompoundBrandForeground1Hover: var(--colorCompoundBrandForeground1Hover, #02729c);\n --webchat-colorCompoundBrandForeground1Pressed: var(--colorCompoundBrandForeground1Pressed, #01678c);\n --webchat-colorStatusDangerForeground1: var(--colorStatusDangerForeground1, #b10e1c);\n --webchat-colorGray30: var(--colorGray30, #edebe9);\n --webchat-colorGray160: var(--colorGray160, #323130);\n --webchat-colorGray190: var(--colorGray190, #201f1e);\n --webchat-colorGray200: var(--colorGray200, #1b1a19);\n --webchat-borderRadiusSmall: var(--borderRadiusSmall, 2px);\n --webchat-borderRadiusLarge: var(--borderRadiusLarge, 6px);\n --webchat-borderRadiusXLarge: var(--borderRadiusXLarge, 8px);\n --webchat-shadow16: var(--shadow16, 0 6.4px 14.4px 0 rgba(0, 0, 0, 0.132), 0 1.2px 3.6px 0 rgba(0, 0, 0, 0.108));\n --webchat-spacingHorizontalMNudge: var(--spacingHorizontalMNudge, 10px);\n --webchat-fontFamilyBase: var(--fontFamilyBase, \"Segoe UI\", \"Segoe UI Web (West European)\", -apple-system, BlinkMacSystemFont, Roboto, \"Helvetica Neue\", sans-serif);\n --webchat-fontFamilyNumeric: var(--fontFamilyNumeric, Bahnschrift, \"Segoe UI\", \"Segoe UI Web (West European)\", -apple-system, BlinkMacSystemFont, Roboto, \"Helvetica Neue\", sans-serif);\n --webchat-fontWeightSemibold: var(--fontWeightSemibold, 600);\n}\n\n/* src/components/dropZone/index.module.css */\n.webchat-fluent .dropZone_sendbox__attachment-drop-zone {\n background-color: var(--webchat-colorNeutralBackground4);\n border-radius: inherit;\n cursor: copy;\n display: grid;\n gap: 8px;\n inset: 0;\n place-content: center;\n place-items: center;\n position: absolute;\n}\n.webchat-fluent .dropZone_sendbox__attachment-drop-zone--droppable {\n background-color: #e00;\n color: White;\n}\n.webchat-fluent .dropZone_sendbox__attachment-drop-zone-icon {\n height: 36px;\n pointer-events: none;\n width: 36px;\n}\n\n/* src/components/suggestedActions/SuggestedAction.module.css */\n.webchat-fluent .SuggestedAction_suggested-action {\n align-items: center;\n background: transparent;\n border-radius: 8px;\n border: 1px solid var(--webchat-colorBrandStroke2);\n cursor: pointer;\n display: flex;\n font-size: 12px;\n gap: 4px;\n padding: 4px 8px 4px;\n text-align: start;\n transition: all .15s ease-out;\n}\n@media (hover: hover) {\n .webchat-fluent .SuggestedAction_suggested-action:not([aria-disabled=true]):hover {\n background-color: var(--webchat-colorBrandBackground2Hover);\n color: var(--webchat-colorBrandForeground2Hover);\n }\n}\n.webchat-fluent .SuggestedAction_suggested-action:not([aria-disabled=true]):active {\n background-color: var(--webchat-colorBrandBackground2Pressed);\n color: var(--webchat-colorBrandForeground2Pressed);\n}\n.webchat-fluent .SuggestedAction_suggested-action[aria-disabled=true] {\n color: var(--webchat-colorNeutralForegroundDisabled);\n cursor: not-allowed;\n}\n.webchat-fluent .SuggestedAction_suggested-action__image {\n font-size: 12px;\n height: 1em;\n width: 1em;\n}\n\n/* src/components/suggestedActions/index.module.css */\n.webchat-fluent .suggestedActions_suggested-actions {\n align-items: flex-end;\n align-self: flex-end;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n.webchat-fluent .suggestedActions_suggested-actions:not(:empty) {\n padding-block-end: 8px;\n padding-inline-start: 4px;\n}\n.webchat-fluent .suggestedActions_suggested-actions.suggestedActions_suggested-actions--flow {\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: flex-end;\n}\n.webchat-fluent .suggestedActions_suggested-actions.suggestedActions_suggested-actions--stacked {\n flex-direction: column;\n}\n\n/* src/components/sendbox/Toolbar.module.css */\n.webchat-fluent .Toolbar_sendbox__toolbar {\n display: flex;\n gap: 4px;\n margin-inline-start: auto;\n}\n.webchat-fluent .Toolbar_sendbox__toolbar-button {\n align-items: center;\n appearance: none;\n aspect-ratio: 1;\n background: transparent;\n border-radius: var(--webchat-borderRadiusSmall);\n border: none;\n cursor: pointer;\n display: flex;\n justify-content: center;\n padding: 3px;\n width: 32px;\n}\n.webchat-fluent .Toolbar_sendbox__toolbar-button > svg {\n font-size: 20px;\n pointer-events: none;\n}\n@media (hover: hover) {\n .webchat-fluent .Toolbar_sendbox__toolbar-button:not([aria-disabled=true]):hover {\n background-color: var(--webchat-colorSubtleBackgroundHover);\n color: var(--webchat-colorCompoundBrandForeground1Hover);\n }\n}\n.webchat-fluent .Toolbar_sendbox__toolbar-button:not([aria-disabled=true]):active {\n background-color: var(--webchat-colorSubtleBackgroundPressed);\n color: var(--webchat-colorCompoundBrandForeground1Pressed);\n}\n.webchat-fluent .Toolbar_sendbox__toolbar-button[aria-disabled=true] {\n color: var(--webchat-colorNeutralForegroundDisabled);\n cursor: not-allowed;\n}\n.webchat-fluent .Toolbar_sendbox__toolbar-separator {\n align-self: center;\n border-inline-end: 1px solid var(--webchat-colorNeutralStroke2);\n height: 28px;\n}\n.webchat-fluent .Toolbar_sendbox__toolbar-separator:is(:first-child, :last-child, :only-child) {\n display: none;\n}\n\n/* src/components/sendbox/AddAttachmentButton.module.css */\n.webchat-fluent .AddAttachmentButton_sendbox__add-attachment {\n display: grid;\n}\n.webchat-fluent .AddAttachmentButton_sendbox__add-attachment-input {\n font-size: 0;\n height: 0;\n opacity: 0;\n width: 0;\n}\n\n/* src/components/sendbox/Attachments.module.css */\n.webchat-fluent .Attachments_sendbox__attachment {\n border-radius: var(--webchat-borderRadiusLarge);\n border: 1px solid var(--webchat-colorNeutralStroke1);\n cursor: default;\n padding: 6px 8px;\n width: fit-content;\n}\n\n/* src/components/sendbox/ErrorMessage.module.css */\n.webchat-fluent .ErrorMessage_sendbox__error-message {\n color: transparent;\n font-size: 0;\n height: 0;\n left: 0;\n position: absolute;\n top: 0;\n width: 0;\n}\n\n/* src/components/sendbox/TextArea.module.css */\n.webchat-fluent .TextArea_sendbox__text-area {\n display: grid;\n grid-template-areas: \"main\";\n max-height: 200px;\n overflow: hidden;\n}\n.webchat-fluent .TextArea_sendbox__text-area--hidden {\n height: 0;\n visibility: collapse;\n}\n.webchat-fluent .TextArea_sendbox__text-area-shared {\n border: none;\n font: inherit;\n grid-area: main;\n outline: inherit;\n overflow-wrap: anywhere;\n resize: inherit;\n scrollbar-gutter: stable;\n}\n.webchat-fluent .TextArea_sendbox__text-area-doppelganger {\n overflow: hidden;\n visibility: hidden;\n white-space: pre-wrap;\n}\n.webchat-fluent .TextArea_sendbox__text-area-input {\n height: 100%;\n padding: 0;\n}\n.webchat-fluent .TextArea_sendbox__text-area-input--scroll {\n scrollbar-color: unset;\n scrollbar-width: unset;\n -moz-scrollbar-color: var(--webchat-colorNeutralBackground5) var(--webchat-colorNeutralForeground2);\n -moz-scrollbar-width: thin;\n}\n.webchat-fluent .TextArea_sendbox__text-area-input--scroll::-webkit-scrollbar {\n width: 8px;\n}\n.webchat-fluent .TextArea_sendbox__text-area-input--scroll::-webkit-scrollbar-track {\n background-color: var(--webchat-colorNeutralBackground5);\n border-radius: 16px;\n}\n.webchat-fluent .TextArea_sendbox__text-area-input--scroll::-webkit-scrollbar-thumb {\n background-color: var(--webchat-colorNeutralForeground2);\n border-radius: 16px;\n}\n.webchat-fluent .TextArea_sendbox__text-area-input--scroll::-webkit-scrollbar-corner {\n background-color: var(--webchat-colorNeutralBackground5);\n}\n\n/* src/components/sendbox/index.module.css */\n.webchat-fluent .sendbox_sendbox {\n color: var(--webchat-colorNeutralForeground1);\n font-family: var(--webchat-fontFamilyBase);\n padding: 0 10px 10px;\n text-rendering: optimizeLegibility;\n}\n.webchat-fluent .sendbox_sendbox__sendbox {\n background-color: var(--webchat-colorNeutralBackground1);\n border-radius: var(--webchat-borderRadiusLarge);\n border: 1px solid var(--webchat-colorNeutralStroke1);\n display: grid;\n font-family: var(--webchat-fontFamilyBase);\n font-size: 14px;\n gap: 6px;\n line-height: 20px;\n padding: 8px;\n position: relative;\n}\n.webchat-fluent .sendbox_sendbox__sendbox:focus-within {\n border-color: var(--webchat-colorNeutralStroke1Selected);\n box-shadow: inset 0 -6px 0 -3px var(--webchat-colorCompoundBrandForeground1Hover);\n}\n.webchat-fluent .sendbox_sendbox__sendbox-text {\n background-color: transparent;\n border: none;\n flex: auto;\n font-family: var(--webchat-fontFamilyBase);\n font-size: 14px;\n line-height: 20px;\n outline: none;\n padding: 4px 4px 0;\n resize: none;\n}\n.webchat-fluent .sendbox_sendbox__sendbox-controls {\n align-items: center;\n display: flex;\n padding-inline-start: 4px;\n}\n.webchat-fluent .sendbox_sendbox__text-counter {\n color: var(--webchat-colorNeutralForeground4);\n cursor: default;\n font-family: var(--webchat-fontFamilyNumeric);\n font-size: 10px;\n line-height: 14px;\n}\n.webchat-fluent .sendbox_sendbox__text-counter--error {\n color: var(--webchat-colorStatusDangerForeground1);\n}\n";
|
|
93
|
+
function injectStyles() {
|
|
94
|
+
if (globalThis.document) {
|
|
95
|
+
const style = document.createElement("style");
|
|
96
|
+
style.append(document.createTextNode(injectedStyles));
|
|
97
|
+
document.head.appendChild(style);
|
|
98
|
+
}
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
// src/styles/
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
return (0,
|
|
101
|
+
// src/styles/useStyles.ts
|
|
102
|
+
var import_react3 = require("react");
|
|
103
|
+
function useStyles(styles) {
|
|
104
|
+
return (0, import_react3.useMemo)(
|
|
105
105
|
() => Object.freeze(
|
|
106
|
-
Object.fromEntries(
|
|
106
|
+
Object.fromEntries(
|
|
107
|
+
Object.entries(styles).map(([baseClassName, resultClassName]) => [
|
|
108
|
+
baseClassName,
|
|
109
|
+
`${baseClassName} ${resultClassName}`
|
|
110
|
+
])
|
|
111
|
+
)
|
|
107
112
|
),
|
|
108
|
-
[
|
|
113
|
+
[styles]
|
|
109
114
|
);
|
|
110
115
|
}
|
|
116
|
+
var useStyles_default = useStyles;
|
|
111
117
|
|
|
112
118
|
// src/components/telephoneKeypad/private/Button.tsx
|
|
113
|
-
var
|
|
114
|
-
var import_use_ref_from = require("use-ref-from");
|
|
115
|
-
var styles = {
|
|
116
|
-
"webchat__telephone-keypad__button": {
|
|
117
|
-
"-webkit-user-select": "none",
|
|
118
|
-
alignItems: "center",
|
|
119
|
-
appearance: "none",
|
|
120
|
-
// backgroundColor: isDarkTheme() || isHighContrastTheme() ? black : white,
|
|
121
|
-
backgroundColor: "White",
|
|
122
|
-
borderRadius: "100%",
|
|
123
|
-
// Whitelabel styles
|
|
124
|
-
// border: `solid 1px ${isHighContrastTheme() ? white : isDarkTheme() ? gray160 : gray40}`,
|
|
125
|
-
// color: 'inherit',
|
|
126
|
-
border: "solid 1px var(--webchat-colorNeutralStroke1)",
|
|
127
|
-
color: "var(--webchat-colorNeutralForeground1)",
|
|
128
|
-
fontWeight: "var(--webchat-fontWeightSemibold)",
|
|
129
|
-
cursor: "pointer",
|
|
130
|
-
display: "flex",
|
|
131
|
-
flexDirection: "column",
|
|
132
|
-
height: 60,
|
|
133
|
-
opacity: 0.7,
|
|
134
|
-
padding: 0,
|
|
135
|
-
position: "relative",
|
|
136
|
-
touchAction: "none",
|
|
137
|
-
userSelect: "none",
|
|
138
|
-
width: 60,
|
|
139
|
-
"&:hover": {
|
|
140
|
-
// backgroundColor: isHighContrastTheme() ? gray210 : isDarkTheme() ? gray150 : gray30
|
|
141
|
-
backgroundColor: "var(--webchat-colorGray30)"
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
"webchat__telephone-keypad__button__ruby": {
|
|
145
|
-
// color: isHighContrastTheme() ? white : isDarkTheme() ? gray40 : gray160,
|
|
146
|
-
color: "var(--webchat-colorGray160)",
|
|
147
|
-
fontSize: 10
|
|
148
|
-
},
|
|
149
|
-
"webchat__telephone-keypad__button__text": {
|
|
150
|
-
fontSize: 24,
|
|
151
|
-
marginTop: 8
|
|
152
|
-
},
|
|
153
|
-
"webchat__telephone-keypad--horizontal": {
|
|
154
|
-
"& .webchat__telephone-keypad__button": {
|
|
155
|
-
height: 32,
|
|
156
|
-
width: 32,
|
|
157
|
-
margin: "8px 4px",
|
|
158
|
-
justifyContent: "center"
|
|
159
|
-
},
|
|
160
|
-
"webchat__telephone-keypad__button__ruby": {
|
|
161
|
-
display: "none"
|
|
162
|
-
},
|
|
163
|
-
"& .webchat__telephone-keypad__button__text": {
|
|
164
|
-
fontSize: 20,
|
|
165
|
-
marginTop: 0
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
var Button = (0, import_react5.memo)(
|
|
119
|
+
var Button = (0, import_react4.memo)(
|
|
170
120
|
// As we are all TypeScript, internal components do not need propTypes.
|
|
171
121
|
// eslint-disable-next-line react/prop-types
|
|
172
|
-
(0,
|
|
173
|
-
const classNames =
|
|
122
|
+
(0, import_react4.forwardRef)(({ button, "data-testid": dataTestId, onClick, ruby }, ref) => {
|
|
123
|
+
const classNames = useStyles_default(Button_default);
|
|
174
124
|
const onClickRef = (0, import_use_ref_from.useRefFrom)(onClick);
|
|
175
|
-
const handleClick = (0,
|
|
176
|
-
return /* @__PURE__ */
|
|
125
|
+
const handleClick = (0, import_react4.useCallback)(() => onClickRef.current?.(), [onClickRef]);
|
|
126
|
+
return /* @__PURE__ */ import_react4.default.createElement(
|
|
177
127
|
"button",
|
|
178
128
|
{
|
|
179
|
-
className: classNames["
|
|
129
|
+
className: classNames["telephone-keypad__button"],
|
|
180
130
|
"data-testid": dataTestId,
|
|
181
131
|
onClick: handleClick,
|
|
182
132
|
ref,
|
|
183
133
|
type: "button"
|
|
184
134
|
},
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
!!ruby && /* @__PURE__ */
|
|
135
|
+
/* @__PURE__ */ import_react4.default.createElement("span", { className: classNames["telephone-keypad__button__text"] }, button === "star" ? "\u2217" : button === "pound" ? "#" : button),
|
|
136
|
+
!!ruby && /* @__PURE__ */ import_react4.default.createElement("ruby", { className: classNames["telephone-keypad__button__ruby"] }, ruby)
|
|
187
137
|
);
|
|
188
138
|
})
|
|
189
139
|
);
|
|
190
140
|
Button.displayName = "TelephoneKeypad.Button";
|
|
191
|
-
var
|
|
141
|
+
var Button_default2 = Button;
|
|
192
142
|
|
|
193
143
|
// src/testIds.ts
|
|
194
144
|
var testIds = {
|
|
@@ -213,71 +163,48 @@ var testIds = {
|
|
|
213
163
|
var testIds_default = testIds;
|
|
214
164
|
|
|
215
165
|
// src/components/telephoneKeypad/useShown.ts
|
|
216
|
-
var
|
|
166
|
+
var import_react5 = require("react");
|
|
217
167
|
function useShown() {
|
|
218
|
-
const { setShown, shown } = (0,
|
|
219
|
-
return (0,
|
|
168
|
+
const { setShown, shown } = (0, import_react5.useContext)(Context_default);
|
|
169
|
+
return (0, import_react5.useMemo)(() => Object.freeze([shown, setShown]), [shown, setShown]);
|
|
220
170
|
}
|
|
221
171
|
|
|
222
|
-
// src/components/telephoneKeypad/private/TelephoneKeypad.
|
|
223
|
-
var
|
|
224
|
-
"
|
|
225
|
-
|
|
226
|
-
// background: getHighContrastDarkThemeColor(highContrastColor: black, darkThemeColor: gray190, string, defaultColor: gray10),
|
|
227
|
-
// borderRadius: '8px 8px 0px 0px',
|
|
228
|
-
// boxShadow: '-3px 0px 7px 0px rgba(0, 0, 0, 0.13), -0.6px 0px 1.8px 0px rgba(0, 0, 0, 0.10)',
|
|
229
|
-
alignItems: "center",
|
|
230
|
-
background: "var(--webchat-colorNeutralBackground1)",
|
|
231
|
-
// border: isHighContrastTheme() ? `1px solid ${white}` : 'none',
|
|
232
|
-
border: "none",
|
|
233
|
-
borderRadius: "var(--webchat-borderRadiusXLarge)",
|
|
234
|
-
// boxShadow: 'var(--shadow16)',
|
|
235
|
-
display: "flex",
|
|
236
|
-
flexDirection: "column",
|
|
237
|
-
fontFamily: "var(--webchat-fontFamilyBase)",
|
|
238
|
-
justifyContent: "center"
|
|
239
|
-
// margin: 'var(--spacingHorizontalMNudge)'
|
|
240
|
-
},
|
|
241
|
-
"webchat__telephone-keypad__box": {
|
|
242
|
-
boxSizing: "border-box",
|
|
243
|
-
display: "grid",
|
|
244
|
-
gap: "16px",
|
|
245
|
-
gridTemplateColumns: "repeat(3, 1fr)",
|
|
246
|
-
gridTemplateRows: "repeat(4, 1fr)",
|
|
247
|
-
justifyItems: "center",
|
|
248
|
-
padding: "16px",
|
|
249
|
-
width: "100%"
|
|
250
|
-
}
|
|
172
|
+
// src/components/telephoneKeypad/private/TelephoneKeypad.module.css
|
|
173
|
+
var TelephoneKeypad_default = {
|
|
174
|
+
"telephone-keypad": "TelephoneKeypad_telephone-keypad",
|
|
175
|
+
"telephone-keypad__box": "TelephoneKeypad_telephone-keypad__box"
|
|
251
176
|
};
|
|
252
|
-
|
|
177
|
+
|
|
178
|
+
// src/components/telephoneKeypad/private/TelephoneKeypad.tsx
|
|
179
|
+
var Orientation = (0, import_react6.memo)(
|
|
253
180
|
({ children, isHorizontal }) => {
|
|
254
|
-
const classNames =
|
|
181
|
+
const classNames = useStyles_default(TelephoneKeypad_default);
|
|
255
182
|
return isHorizontal ? (
|
|
256
183
|
// <HorizontalDialPadController>{children}</HorizontalDialPadController>
|
|
257
184
|
false
|
|
258
|
-
) : /* @__PURE__ */
|
|
185
|
+
) : /* @__PURE__ */ import_react6.default.createElement("div", { className: classNames["telephone-keypad__box"] }, children);
|
|
259
186
|
}
|
|
260
187
|
);
|
|
261
188
|
Orientation.displayName = "TelephoneKeypad:Orientation";
|
|
262
|
-
var TelephoneKeypad = (0,
|
|
189
|
+
var TelephoneKeypad = (0, import_react6.memo)(({ autoFocus, onButtonClick, isHorizontal }) => {
|
|
263
190
|
const autoFocusRef = (0, import_use_ref_from2.useRefFrom)(autoFocus);
|
|
264
|
-
const classNames =
|
|
265
|
-
const firstButtonRef = (0,
|
|
191
|
+
const classNames = useStyles_default(TelephoneKeypad_default);
|
|
192
|
+
const firstButtonRef = (0, import_react6.useRef)(null);
|
|
266
193
|
const onButtonClickRef = (0, import_use_ref_from2.useRefFrom)(onButtonClick);
|
|
267
194
|
const [, setShown] = useShown();
|
|
268
|
-
const handleButton1Click = (0,
|
|
269
|
-
const handleButton2Click = (0,
|
|
270
|
-
const handleButton3Click = (0,
|
|
271
|
-
const handleButton4Click = (0,
|
|
272
|
-
const handleButton5Click = (0,
|
|
273
|
-
const handleButton6Click = (0,
|
|
274
|
-
const handleButton7Click = (0,
|
|
275
|
-
const handleButton8Click = (0,
|
|
276
|
-
const handleButton9Click = (0,
|
|
277
|
-
const handleButton0Click = (0,
|
|
278
|
-
const handleButtonStarClick = (0,
|
|
279
|
-
const handleButtonPoundClick = (0,
|
|
280
|
-
const handleKeyDown = (0,
|
|
195
|
+
const handleButton1Click = (0, import_react6.useCallback)(() => onButtonClickRef.current?.("1"), [onButtonClickRef]);
|
|
196
|
+
const handleButton2Click = (0, import_react6.useCallback)(() => onButtonClickRef.current?.("2"), [onButtonClickRef]);
|
|
197
|
+
const handleButton3Click = (0, import_react6.useCallback)(() => onButtonClickRef.current?.("3"), [onButtonClickRef]);
|
|
198
|
+
const handleButton4Click = (0, import_react6.useCallback)(() => onButtonClickRef.current?.("4"), [onButtonClickRef]);
|
|
199
|
+
const handleButton5Click = (0, import_react6.useCallback)(() => onButtonClickRef.current?.("5"), [onButtonClickRef]);
|
|
200
|
+
const handleButton6Click = (0, import_react6.useCallback)(() => onButtonClickRef.current?.("6"), [onButtonClickRef]);
|
|
201
|
+
const handleButton7Click = (0, import_react6.useCallback)(() => onButtonClickRef.current?.("7"), [onButtonClickRef]);
|
|
202
|
+
const handleButton8Click = (0, import_react6.useCallback)(() => onButtonClickRef.current?.("8"), [onButtonClickRef]);
|
|
203
|
+
const handleButton9Click = (0, import_react6.useCallback)(() => onButtonClickRef.current?.("9"), [onButtonClickRef]);
|
|
204
|
+
const handleButton0Click = (0, import_react6.useCallback)(() => onButtonClickRef.current?.("0"), [onButtonClickRef]);
|
|
205
|
+
const handleButtonStarClick = (0, import_react6.useCallback)(() => onButtonClickRef.current?.("star"), [onButtonClickRef]);
|
|
206
|
+
const handleButtonPoundClick = (0, import_react6.useCallback)(() => onButtonClickRef.current?.("pound"), [onButtonClickRef]);
|
|
207
|
+
const handleKeyDown = (0, import_react6.useCallback)(
|
|
281
208
|
(event) => {
|
|
282
209
|
if (event.key === "Escape") {
|
|
283
210
|
setShown(false);
|
|
@@ -285,83 +212,83 @@ var TelephoneKeypad = (0, import_react7.memo)(({ autoFocus, onButtonClick, isHor
|
|
|
285
212
|
},
|
|
286
213
|
[setShown]
|
|
287
214
|
);
|
|
288
|
-
(0,
|
|
215
|
+
(0, import_react6.useEffect)(() => {
|
|
289
216
|
autoFocusRef.current && firstButtonRef.current?.focus();
|
|
290
217
|
}, [autoFocusRef, firstButtonRef]);
|
|
291
|
-
return /* @__PURE__ */
|
|
292
|
-
|
|
218
|
+
return /* @__PURE__ */ import_react6.default.createElement("div", { className: classNames["telephone-keypad"], onKeyDown: handleKeyDown }, /* @__PURE__ */ import_react6.default.createElement(Orientation, { isHorizontal }, /* @__PURE__ */ import_react6.default.createElement(
|
|
219
|
+
Button_default2,
|
|
293
220
|
{
|
|
294
221
|
button: "1",
|
|
295
222
|
"data-testid": testIds_default.sendBoxTelephoneKeypadButton1,
|
|
296
223
|
onClick: handleButton1Click,
|
|
297
224
|
ref: firstButtonRef
|
|
298
225
|
}
|
|
299
|
-
), /* @__PURE__ */
|
|
300
|
-
|
|
226
|
+
), /* @__PURE__ */ import_react6.default.createElement(
|
|
227
|
+
Button_default2,
|
|
301
228
|
{
|
|
302
229
|
button: "2",
|
|
303
230
|
"data-testid": testIds_default.sendBoxTelephoneKeypadButton2,
|
|
304
231
|
onClick: handleButton2Click,
|
|
305
232
|
ruby: "ABC"
|
|
306
233
|
}
|
|
307
|
-
), /* @__PURE__ */
|
|
308
|
-
|
|
234
|
+
), /* @__PURE__ */ import_react6.default.createElement(
|
|
235
|
+
Button_default2,
|
|
309
236
|
{
|
|
310
237
|
button: "3",
|
|
311
238
|
"data-testid": testIds_default.sendBoxTelephoneKeypadButton3,
|
|
312
239
|
onClick: handleButton3Click,
|
|
313
240
|
ruby: "DEF"
|
|
314
241
|
}
|
|
315
|
-
), /* @__PURE__ */
|
|
316
|
-
|
|
242
|
+
), /* @__PURE__ */ import_react6.default.createElement(
|
|
243
|
+
Button_default2,
|
|
317
244
|
{
|
|
318
245
|
button: "4",
|
|
319
246
|
"data-testid": testIds_default.sendBoxTelephoneKeypadButton4,
|
|
320
247
|
onClick: handleButton4Click,
|
|
321
248
|
ruby: "GHI"
|
|
322
249
|
}
|
|
323
|
-
), /* @__PURE__ */
|
|
324
|
-
|
|
250
|
+
), /* @__PURE__ */ import_react6.default.createElement(
|
|
251
|
+
Button_default2,
|
|
325
252
|
{
|
|
326
253
|
button: "5",
|
|
327
254
|
"data-testid": testIds_default.sendBoxTelephoneKeypadButton5,
|
|
328
255
|
onClick: handleButton5Click,
|
|
329
256
|
ruby: "JKL"
|
|
330
257
|
}
|
|
331
|
-
), /* @__PURE__ */
|
|
332
|
-
|
|
258
|
+
), /* @__PURE__ */ import_react6.default.createElement(
|
|
259
|
+
Button_default2,
|
|
333
260
|
{
|
|
334
261
|
button: "6",
|
|
335
262
|
"data-testid": testIds_default.sendBoxTelephoneKeypadButton6,
|
|
336
263
|
onClick: handleButton6Click,
|
|
337
264
|
ruby: "MNO"
|
|
338
265
|
}
|
|
339
|
-
), /* @__PURE__ */
|
|
340
|
-
|
|
266
|
+
), /* @__PURE__ */ import_react6.default.createElement(
|
|
267
|
+
Button_default2,
|
|
341
268
|
{
|
|
342
269
|
button: "7",
|
|
343
270
|
"data-testid": testIds_default.sendBoxTelephoneKeypadButton7,
|
|
344
271
|
onClick: handleButton7Click,
|
|
345
272
|
ruby: "PQRS"
|
|
346
273
|
}
|
|
347
|
-
), /* @__PURE__ */
|
|
348
|
-
|
|
274
|
+
), /* @__PURE__ */ import_react6.default.createElement(
|
|
275
|
+
Button_default2,
|
|
349
276
|
{
|
|
350
277
|
button: "8",
|
|
351
278
|
"data-testid": testIds_default.sendBoxTelephoneKeypadButton8,
|
|
352
279
|
onClick: handleButton8Click,
|
|
353
280
|
ruby: "TUV"
|
|
354
281
|
}
|
|
355
|
-
), /* @__PURE__ */
|
|
356
|
-
|
|
282
|
+
), /* @__PURE__ */ import_react6.default.createElement(
|
|
283
|
+
Button_default2,
|
|
357
284
|
{
|
|
358
285
|
button: "9",
|
|
359
286
|
"data-testid": testIds_default.sendBoxTelephoneKeypadButton9,
|
|
360
287
|
onClick: handleButton9Click,
|
|
361
288
|
ruby: "WXYZ"
|
|
362
289
|
}
|
|
363
|
-
), /* @__PURE__ */
|
|
364
|
-
|
|
290
|
+
), /* @__PURE__ */ import_react6.default.createElement(Button_default2, { button: "star", "data-testid": testIds_default.sendBoxTelephoneKeypadButtonStar, onClick: handleButtonStarClick }), /* @__PURE__ */ import_react6.default.createElement(Button_default2, { button: "0", "data-testid": testIds_default.sendBoxTelephoneKeypadButton0, onClick: handleButton0Click, ruby: "+" }), /* @__PURE__ */ import_react6.default.createElement(
|
|
291
|
+
Button_default2,
|
|
365
292
|
{
|
|
366
293
|
button: "pound",
|
|
367
294
|
"data-testid": testIds_default.sendBoxTelephoneKeypadButtonPound,
|
|
@@ -370,75 +297,39 @@ var TelephoneKeypad = (0, import_react7.memo)(({ autoFocus, onButtonClick, isHor
|
|
|
370
297
|
)));
|
|
371
298
|
});
|
|
372
299
|
TelephoneKeypad.displayName = "TelephoneKeypad";
|
|
373
|
-
var
|
|
300
|
+
var TelephoneKeypad_default2 = TelephoneKeypad;
|
|
374
301
|
|
|
375
302
|
// src/components/telephoneKeypad/Surrogate.tsx
|
|
376
|
-
var TelephoneKeypadSurrogate = (0,
|
|
303
|
+
var TelephoneKeypadSurrogate = (0, import_react7.memo)((props) => useShown()[0] ? /* @__PURE__ */ import_react7.default.createElement(TelephoneKeypad_default2, { ...props }) : false);
|
|
377
304
|
TelephoneKeypadSurrogate.displayName = "TelephoneKeypad.Surrogate";
|
|
378
305
|
var Surrogate_default = TelephoneKeypadSurrogate;
|
|
379
306
|
|
|
380
307
|
// src/components/Theme.tsx
|
|
381
|
-
var
|
|
382
|
-
var
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
"--webchat-colorNeutralForeground4": "var(--colorNeutralForeground4, #707070)",
|
|
388
|
-
"--webchat-colorNeutralForegroundDisabled": "var(--colorNeutralForegroundDisabled, #bdbdbd)",
|
|
389
|
-
"--webchat-colorNeutralBackground1": "var(--colorNeutralBackground1, #ffffff)",
|
|
390
|
-
"--webchat-colorNeutralBackground4": "var(--colorNeutralBackground4, #f0f0f0)",
|
|
391
|
-
"--webchat-colorNeutralBackground5": "var(--colorNeutralBackground5, #ebebeb)",
|
|
392
|
-
"--webchat-colorSubtleBackgroundHover": "var(--colorSubtleBackgroundHover, #f5f5f5)",
|
|
393
|
-
"--webchat-colorSubtleBackgroundPressed": "var(--colorSubtleBackgroundPressed, #e0e0e0)",
|
|
394
|
-
"--webchat-colorNeutralStroke1": "var(--colorNeutralStroke1, #d1d1d1)",
|
|
395
|
-
"--webchat-colorNeutralStroke2": "var(--colorNeutralStroke2, #e0e0e0)",
|
|
396
|
-
"--webchat-colorNeutralStroke1Selected": "var(--colorNeutralStroke1Selected, #bdbdbd)",
|
|
397
|
-
"--webchat-colorBrandStroke2": "var(--colorBrandStroke2, #9edcf7)",
|
|
398
|
-
"--webchat-colorBrandForeground2Hover": "var(--colorBrandForeground2Hover, #015a7a)",
|
|
399
|
-
"--webchat-colorBrandForeground2Pressed": "var(--colorBrandForeground2Pressed, #01384d)",
|
|
400
|
-
"--webchat-colorBrandBackground2Hover": "var(--colorBrandBackground2Hover, #bee7fa)",
|
|
401
|
-
"--webchat-colorBrandBackground2Pressed": "var(--colorBrandBackground2Pressed, #7fd2f5)",
|
|
402
|
-
"--webchat-colorCompoundBrandForeground1": "var(--colorCompoundBrandForeground1, #077fab)",
|
|
403
|
-
"--webchat-colorCompoundBrandForeground1Hover": "var(--colorCompoundBrandForeground1Hover, #02729c)",
|
|
404
|
-
"--webchat-colorCompoundBrandForeground1Pressed": "var(--colorCompoundBrandForeground1Pressed, #01678c)",
|
|
405
|
-
"--webchat-colorStatusDangerForeground1": "var(--colorStatusDangerForeground1, #b10e1c)",
|
|
406
|
-
// https://github.com/microsoft/fluentui/blob/master/packages/tokens/src/global/colors.ts
|
|
407
|
-
"--webchat-colorGray30": "var(--colorGray30, #edebe9)",
|
|
408
|
-
"--webchat-colorGray160": "var(--colorGray160, #323130)",
|
|
409
|
-
"--webchat-colorGray200": "var(--colorGray200, #1b1a19)",
|
|
410
|
-
// https://github.com/microsoft/fluentui/blob/master/packages/tokens/src/global/borderRadius.ts
|
|
411
|
-
"--webchat-borderRadiusSmall": "var(--borderRadiusSmall, 2px)",
|
|
412
|
-
"--webchat-borderRadiusLarge": "var(--borderRadiusLarge, 6px)",
|
|
413
|
-
"--webchat-borderRadiusXLarge": "var(--borderRadiusXLarge, 8px)",
|
|
414
|
-
// https://github.com/microsoft/fluentui/blob/master/packages/tokens/src/utils/shadows.ts
|
|
415
|
-
"--webchat-shadow16": "var(--shadow16, 0 6.4px 14.4px 0 rgba(0, 0, 0, 0.132), 0 1.2px 3.6px 0 rgba(0, 0, 0, 0.108))",
|
|
416
|
-
// https://github.com/microsoft/fluentui/blob/master/packages/tokens/src/global/spacings.ts
|
|
417
|
-
"--webchat-spacingHorizontalMNudge": "var(--spacingHorizontalMNudge, 10px)",
|
|
418
|
-
// https://github.com/microsoft/fluentui/blob/master/packages/tokens/src/global/fonts.ts
|
|
419
|
-
"--webchat-fontFamilyBase": `var(--fontFamilyBase, 'Segoe UI)', 'Segoe UI Web (West European))', -apple-system,
|
|
420
|
-
BlinkMacSystemFont, Roboto, 'Helvetica Neue)', sans-serif)`,
|
|
421
|
-
"--webchat-fontFamilyNumeric": `var(--fontFamilyNumeric, Bahnschrift, 'Segoe UI)', 'Segoe UI Web (West European))',
|
|
422
|
-
-apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue)', sans-serif)`,
|
|
423
|
-
// https://github.com/microsoft/fluentui/blob/master/packages/tokens/src/global/fonts.ts
|
|
424
|
-
"--webchat-fontWeightSemibold": "var(--fontWeightSemibold, 600)"
|
|
425
|
-
}
|
|
308
|
+
var import_react8 = __toESM(require("react"));
|
|
309
|
+
var import_classnames = __toESM(require("classnames"));
|
|
310
|
+
|
|
311
|
+
// src/components/Theme.module.css
|
|
312
|
+
var Theme_default = {
|
|
313
|
+
theme: "Theme_theme"
|
|
426
314
|
};
|
|
315
|
+
|
|
316
|
+
// src/components/Theme.tsx
|
|
317
|
+
var rootClassName = "webchat-fluent";
|
|
427
318
|
function WebchatTheme(props) {
|
|
428
|
-
const classNames =
|
|
429
|
-
return /* @__PURE__ */
|
|
319
|
+
const classNames = useStyles_default(Theme_default);
|
|
320
|
+
return /* @__PURE__ */ import_react8.default.createElement("div", { className: (0, import_classnames.default)(rootClassName, classNames["theme"]) }, props.children);
|
|
430
321
|
}
|
|
431
322
|
|
|
432
323
|
// src/components/sendbox/index.tsx
|
|
433
|
-
var
|
|
434
|
-
var
|
|
435
|
-
var
|
|
324
|
+
var import_botframework_webchat_component8 = require("botframework-webchat-component");
|
|
325
|
+
var import_classnames7 = __toESM(require("classnames"));
|
|
326
|
+
var import_react25 = __toESM(require("react"));
|
|
436
327
|
var import_use_ref_from6 = require("use-ref-from");
|
|
437
328
|
|
|
438
329
|
// src/icons/SendIcon.tsx
|
|
439
|
-
var
|
|
330
|
+
var import_react9 = __toESM(require("react"));
|
|
440
331
|
function SendIcon(props) {
|
|
441
|
-
return /* @__PURE__ */
|
|
332
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
442
333
|
"svg",
|
|
443
334
|
{
|
|
444
335
|
"aria-hidden": "true",
|
|
@@ -449,7 +340,7 @@ function SendIcon(props) {
|
|
|
449
340
|
width: "1em",
|
|
450
341
|
xmlns: "http://www.w3.org/2000/svg"
|
|
451
342
|
},
|
|
452
|
-
/* @__PURE__ */
|
|
343
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
453
344
|
"path",
|
|
454
345
|
{
|
|
455
346
|
d: "M2.18 2.11a.5.5 0 0 1 .54-.06l15 7.5a.5.5 0 0 1 0 .9l-15 7.5a.5.5 0 0 1-.7-.58L3.98 10 2.02 2.63a.5.5 0 0 1 .16-.52Zm2.7 8.39-1.61 6.06L16.38 10 3.27 3.44 4.88 9.5h6.62a.5.5 0 1 1 0 1H4.88Z",
|
|
@@ -460,15 +351,15 @@ function SendIcon(props) {
|
|
|
460
351
|
}
|
|
461
352
|
|
|
462
353
|
// src/components/dropZone/index.tsx
|
|
463
|
-
var
|
|
464
|
-
var
|
|
465
|
-
var
|
|
354
|
+
var import_botframework_webchat_component = require("botframework-webchat-component");
|
|
355
|
+
var import_classnames2 = __toESM(require("classnames"));
|
|
356
|
+
var import_react11 = __toESM(require("react"));
|
|
466
357
|
var import_use_ref_from3 = require("use-ref-from");
|
|
467
358
|
|
|
468
359
|
// src/icons/AddDocumentIcon.tsx
|
|
469
|
-
var
|
|
360
|
+
var import_react10 = __toESM(require("react"));
|
|
470
361
|
function AddDocumentIcon(props) {
|
|
471
|
-
return /* @__PURE__ */
|
|
362
|
+
return /* @__PURE__ */ import_react10.default.createElement(
|
|
472
363
|
"svg",
|
|
473
364
|
{
|
|
474
365
|
"aria-hidden": "true",
|
|
@@ -479,7 +370,7 @@ function AddDocumentIcon(props) {
|
|
|
479
370
|
width: "1em",
|
|
480
371
|
xmlns: "http://www.w3.org/2000/svg"
|
|
481
372
|
},
|
|
482
|
-
/* @__PURE__ */
|
|
373
|
+
/* @__PURE__ */ import_react10.default.createElement(
|
|
483
374
|
"path",
|
|
484
375
|
{
|
|
485
376
|
d: "M6 2a2 2 0 0 0-2 2v5.2c.32-.08.66-.15 1-.18V4a1 1 0 0 1 1-1h4v3.5c0 .83.67 1.5 1.5 1.5H15v8a1 1 0 0 1-1 1h-3.6c-.18.36-.4.7-.66 1H14a2 2 0 0 0 2-2V7.41c0-.4-.16-.78-.44-1.06l-3.91-3.91A1.5 1.5 0 0 0 10.59 2H6Zm8.8 5h-3.3a.5.5 0 0 1-.5-.5V3.2L14.8 7ZM10 14.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Zm-4-2a.5.5 0 0 0-1 0V14H3.5a.5.5 0 0 0 0 1H5v1.5a.5.5 0 0 0 1 0V15h1.5a.5.5 0 0 0 0-1H6v-1.5Z",
|
|
@@ -489,31 +380,15 @@ function AddDocumentIcon(props) {
|
|
|
489
380
|
);
|
|
490
381
|
}
|
|
491
382
|
|
|
492
|
-
// src/components/dropZone/index.
|
|
493
|
-
var
|
|
494
|
-
|
|
495
|
-
"
|
|
496
|
-
|
|
497
|
-
borderRadius: "inherit",
|
|
498
|
-
cursor: "copy",
|
|
499
|
-
display: "grid",
|
|
500
|
-
gap: "8px",
|
|
501
|
-
inset: "0",
|
|
502
|
-
placeContent: "center",
|
|
503
|
-
placeItems: "center",
|
|
504
|
-
position: "absolute"
|
|
505
|
-
},
|
|
506
|
-
"webchat-fluent__sendbox__attachment-drop-zone--droppable": {
|
|
507
|
-
backgroundColor: "#e00",
|
|
508
|
-
color: "White"
|
|
509
|
-
},
|
|
510
|
-
"webchat-fluent__sendbox__attachment-drop-zone-icon": {
|
|
511
|
-
height: "36px",
|
|
512
|
-
// Set "pointer-events: none" to ignore dragging over the icon. Otherwise, when dragging over the icon, it would disable the "--droppable" modifier.
|
|
513
|
-
pointerEvents: "none",
|
|
514
|
-
width: "36px"
|
|
515
|
-
}
|
|
383
|
+
// src/components/dropZone/index.module.css
|
|
384
|
+
var dropZone_default = {
|
|
385
|
+
"sendbox__attachment-drop-zone": "dropZone_sendbox__attachment-drop-zone",
|
|
386
|
+
"sendbox__attachment-drop-zone--droppable": "dropZone_sendbox__attachment-drop-zone--droppable",
|
|
387
|
+
"sendbox__attachment-drop-zone-icon": "dropZone_sendbox__attachment-drop-zone-icon"
|
|
516
388
|
};
|
|
389
|
+
|
|
390
|
+
// src/components/dropZone/index.tsx
|
|
391
|
+
var { useLocalizer } = import_botframework_webchat_component.hooks;
|
|
517
392
|
var handleDragOver = (event) => {
|
|
518
393
|
event.preventDefault();
|
|
519
394
|
};
|
|
@@ -529,12 +404,12 @@ function isDescendantOf(target, ancestor) {
|
|
|
529
404
|
return false;
|
|
530
405
|
}
|
|
531
406
|
var DropZone = (props) => {
|
|
532
|
-
const [dropZoneState, setDropZoneState] = (0,
|
|
533
|
-
const classNames =
|
|
534
|
-
const dropZoneRef = (0,
|
|
407
|
+
const [dropZoneState, setDropZoneState] = (0, import_react11.useState)(false);
|
|
408
|
+
const classNames = useStyles_default(dropZone_default);
|
|
409
|
+
const dropZoneRef = (0, import_react11.useRef)(null);
|
|
535
410
|
const localize = useLocalizer();
|
|
536
411
|
const onFilesAddedRef = (0, import_use_ref_from3.useRefFrom)(props.onFilesAdded);
|
|
537
|
-
(0,
|
|
412
|
+
(0, import_react11.useEffect)(() => {
|
|
538
413
|
let entranceCounter = 0;
|
|
539
414
|
const handleDragEnter = (event) => {
|
|
540
415
|
entranceCounter++;
|
|
@@ -552,7 +427,7 @@ var DropZone = (props) => {
|
|
|
552
427
|
document.removeEventListener("dragleave", handleDragLeave);
|
|
553
428
|
};
|
|
554
429
|
}, [setDropZoneState]);
|
|
555
|
-
const handleDrop = (0,
|
|
430
|
+
const handleDrop = (0, import_react11.useCallback)(
|
|
556
431
|
(event) => {
|
|
557
432
|
event.preventDefault();
|
|
558
433
|
setDropZoneState(false);
|
|
@@ -563,59 +438,51 @@ var DropZone = (props) => {
|
|
|
563
438
|
},
|
|
564
439
|
[onFilesAddedRef, setDropZoneState]
|
|
565
440
|
);
|
|
566
|
-
return dropZoneState ? /* @__PURE__ */
|
|
441
|
+
return dropZoneState ? /* @__PURE__ */ import_react11.default.createElement(
|
|
567
442
|
"div",
|
|
568
443
|
{
|
|
569
|
-
className: (0,
|
|
570
|
-
[classNames["
|
|
444
|
+
className: (0, import_classnames2.default)(classNames["sendbox__attachment-drop-zone"], {
|
|
445
|
+
[classNames["sendbox__attachment-drop-zone--droppable"]]: dropZoneState === "droppable"
|
|
571
446
|
}),
|
|
572
447
|
"data-testid": testIds_default.sendBoxDropZone,
|
|
573
448
|
onDragOver: handleDragOver,
|
|
574
449
|
onDrop: handleDrop,
|
|
575
450
|
ref: dropZoneRef
|
|
576
451
|
},
|
|
577
|
-
/* @__PURE__ */
|
|
452
|
+
/* @__PURE__ */ import_react11.default.createElement(AddDocumentIcon, { className: classNames["sendbox__attachment-drop-zone-icon"] }),
|
|
578
453
|
localize("TEXT_INPUT_DROP_ZONE")
|
|
579
454
|
) : null;
|
|
580
455
|
};
|
|
581
456
|
DropZone.displayName = "DropZone";
|
|
582
|
-
var
|
|
457
|
+
var dropZone_default2 = (0, import_react11.memo)(DropZone);
|
|
583
458
|
|
|
584
459
|
// src/components/DropZone.tsx
|
|
585
|
-
var DropZone_default =
|
|
460
|
+
var DropZone_default = dropZone_default2;
|
|
586
461
|
|
|
587
462
|
// src/components/suggestedActions/index.tsx
|
|
463
|
+
var import_botframework_webchat_component3 = require("botframework-webchat-component");
|
|
464
|
+
var import_classnames4 = __toESM(require("classnames"));
|
|
465
|
+
var import_react14 = __toESM(require("react"));
|
|
466
|
+
|
|
467
|
+
// src/components/suggestedActions/SuggestedAction.tsx
|
|
588
468
|
var import_botframework_webchat_component2 = require("botframework-webchat-component");
|
|
589
469
|
var import_classnames3 = __toESM(require("classnames"));
|
|
590
|
-
var
|
|
591
|
-
|
|
592
|
-
// src/components/suggestedActions/private/computeSuggestedActionText.ts
|
|
593
|
-
function computeSuggestedActionText(cardAction) {
|
|
594
|
-
const { title } = cardAction;
|
|
595
|
-
const { type, value } = cardAction;
|
|
596
|
-
if (type === "messageBack") {
|
|
597
|
-
return title || cardAction.displayText;
|
|
598
|
-
} else if (title) {
|
|
599
|
-
return title;
|
|
600
|
-
} else if (typeof value === "string") {
|
|
601
|
-
return value;
|
|
602
|
-
}
|
|
603
|
-
return JSON.stringify(value);
|
|
604
|
-
}
|
|
470
|
+
var import_react13 = __toESM(require("react"));
|
|
605
471
|
|
|
606
|
-
// src/components/suggestedActions/SuggestedAction.
|
|
607
|
-
var
|
|
608
|
-
|
|
609
|
-
|
|
472
|
+
// src/components/suggestedActions/SuggestedAction.module.css
|
|
473
|
+
var SuggestedAction_default = {
|
|
474
|
+
"suggested-action": "SuggestedAction_suggested-action",
|
|
475
|
+
"suggested-action__image": "SuggestedAction_suggested-action__image"
|
|
476
|
+
};
|
|
610
477
|
|
|
611
478
|
// src/components/suggestedActions/AccessibleButton.tsx
|
|
612
|
-
var
|
|
479
|
+
var import_react12 = __toESM(require("react"));
|
|
613
480
|
var preventDefaultHandler = (event) => event.preventDefault();
|
|
614
|
-
var AccessibleButton = (0,
|
|
481
|
+
var AccessibleButton = (0, import_react12.forwardRef)(
|
|
615
482
|
({ "aria-hidden": ariaHidden, children, disabled, onClick, tabIndex, ...props }, forwardedRef) => {
|
|
616
|
-
const targetRef = (0,
|
|
483
|
+
const targetRef = (0, import_react12.useRef)(null);
|
|
617
484
|
const ref = forwardedRef || targetRef;
|
|
618
|
-
return /* @__PURE__ */
|
|
485
|
+
return /* @__PURE__ */ import_react12.default.createElement(
|
|
619
486
|
"button",
|
|
620
487
|
{
|
|
621
488
|
"aria-disabled": disabled ? "true" : "false",
|
|
@@ -634,46 +501,10 @@ var AccessibleButton = (0, import_react13.forwardRef)(
|
|
|
634
501
|
);
|
|
635
502
|
}
|
|
636
503
|
);
|
|
637
|
-
var AccessibleButton_default = (0,
|
|
504
|
+
var AccessibleButton_default = (0, import_react12.memo)(AccessibleButton);
|
|
638
505
|
|
|
639
506
|
// src/components/suggestedActions/SuggestedAction.tsx
|
|
640
|
-
var {
|
|
641
|
-
var styles5 = {
|
|
642
|
-
"webchat-fluent__suggested-action": {
|
|
643
|
-
background: "transparent",
|
|
644
|
-
border: "1px solid var(--webchat-colorBrandStroke2)",
|
|
645
|
-
borderRadius: "8px",
|
|
646
|
-
cursor: "pointer",
|
|
647
|
-
fontSize: "12px",
|
|
648
|
-
lineHeight: "14px",
|
|
649
|
-
padding: "6px 8px 4px",
|
|
650
|
-
textAlign: "start",
|
|
651
|
-
display: "flex",
|
|
652
|
-
gap: "4px",
|
|
653
|
-
alignItems: "center",
|
|
654
|
-
transition: "all .15s ease-out",
|
|
655
|
-
"@media (hover: hover)": {
|
|
656
|
-
'&:not([aria-disabled="true"]):hover': {
|
|
657
|
-
backgroundColor: "var(--webchat-colorBrandBackground2Hover)",
|
|
658
|
-
color: "var(--webchat-colorBrandForeground2Hover)"
|
|
659
|
-
}
|
|
660
|
-
},
|
|
661
|
-
'&:not([aria-disabled="true"]):active': {
|
|
662
|
-
backgroundColor: "var(--webchat-colorBrandBackground2Pressed)",
|
|
663
|
-
color: "var(--webchat-colorBrandForeground2Pressed)"
|
|
664
|
-
},
|
|
665
|
-
'&[aria-disabled="true"]': {
|
|
666
|
-
color: " var(--webchat-colorNeutralForegroundDisabled)",
|
|
667
|
-
cursor: "not-allowed"
|
|
668
|
-
}
|
|
669
|
-
},
|
|
670
|
-
"webchat-fluent__suggested-action__image": {
|
|
671
|
-
width: "1em",
|
|
672
|
-
height: "1em",
|
|
673
|
-
fontSize: "20px",
|
|
674
|
-
translate: "0 -1px"
|
|
675
|
-
}
|
|
676
|
-
};
|
|
507
|
+
var { useDisabled, useFocus, usePerformCardAction, useScrollToEnd, useStyleSet, useSuggestedActions } = import_botframework_webchat_component2.hooks;
|
|
677
508
|
function SuggestedAction({
|
|
678
509
|
buttonText,
|
|
679
510
|
className,
|
|
@@ -688,11 +519,11 @@ function SuggestedAction({
|
|
|
688
519
|
const [{ suggestedAction: suggestedActionStyleSet }] = useStyleSet();
|
|
689
520
|
const [disabled] = useDisabled();
|
|
690
521
|
const focus = useFocus();
|
|
691
|
-
const focusRef = (0,
|
|
522
|
+
const focusRef = (0, import_react13.useRef)(null);
|
|
692
523
|
const performCardAction = usePerformCardAction();
|
|
693
|
-
const classNames =
|
|
524
|
+
const classNames = useStyles_default(SuggestedAction_default);
|
|
694
525
|
const scrollToEnd = useScrollToEnd();
|
|
695
|
-
const handleClick = (0,
|
|
526
|
+
const handleClick = (0, import_react13.useCallback)(
|
|
696
527
|
({ target }) => {
|
|
697
528
|
(async function() {
|
|
698
529
|
await focus("sendBoxWithoutKeyboard");
|
|
@@ -703,57 +534,70 @@ function SuggestedAction({
|
|
|
703
534
|
},
|
|
704
535
|
[displayText, focus, performCardAction, scrollToEnd, setSuggestedActions, text, type, value]
|
|
705
536
|
);
|
|
706
|
-
return /* @__PURE__ */
|
|
537
|
+
return /* @__PURE__ */ import_react13.default.createElement(
|
|
707
538
|
AccessibleButton_default,
|
|
708
539
|
{
|
|
709
|
-
className: (0,
|
|
710
|
-
classNames["webchat-fluent__suggested-action"],
|
|
711
|
-
suggestedActionStyleSet + "",
|
|
712
|
-
(className || "") + ""
|
|
713
|
-
),
|
|
540
|
+
className: (0, import_classnames3.default)(classNames["suggested-action"], suggestedActionStyleSet + "", (className || "") + ""),
|
|
714
541
|
disabled,
|
|
715
542
|
onClick: handleClick,
|
|
716
543
|
ref: focusRef,
|
|
717
544
|
type: "button"
|
|
718
545
|
},
|
|
719
|
-
image && /* @__PURE__ */
|
|
720
|
-
/* @__PURE__ */
|
|
546
|
+
image && /* @__PURE__ */ import_react13.default.createElement("img", { alt: imageAlt, className: classNames["suggested-action__image"], src: image }),
|
|
547
|
+
/* @__PURE__ */ import_react13.default.createElement("span", null, buttonText)
|
|
721
548
|
);
|
|
722
549
|
}
|
|
723
|
-
var
|
|
550
|
+
var SuggestedAction_default2 = (0, import_react13.memo)(SuggestedAction);
|
|
724
551
|
|
|
725
|
-
// src/components/suggestedActions/
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
paddingBlockEnd: "8px",
|
|
736
|
-
paddingInlineStart: "4px"
|
|
737
|
-
}
|
|
552
|
+
// src/components/suggestedActions/private/computeSuggestedActionText.ts
|
|
553
|
+
function computeSuggestedActionText(cardAction) {
|
|
554
|
+
const { title } = cardAction;
|
|
555
|
+
const { type, value } = cardAction;
|
|
556
|
+
if (type === "messageBack") {
|
|
557
|
+
return title || cardAction.displayText;
|
|
558
|
+
} else if (title) {
|
|
559
|
+
return title;
|
|
560
|
+
} else if (typeof value === "string") {
|
|
561
|
+
return value;
|
|
738
562
|
}
|
|
563
|
+
return JSON.stringify(value);
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
// src/components/suggestedActions/index.module.css
|
|
567
|
+
var suggestedActions_default = {
|
|
568
|
+
"suggested-actions": "suggestedActions_suggested-actions",
|
|
569
|
+
"suggested-actions--flow": "suggestedActions_suggested-actions--flow",
|
|
570
|
+
"suggested-actions--stacked": "suggestedActions_suggested-actions--stacked"
|
|
739
571
|
};
|
|
740
|
-
|
|
572
|
+
|
|
573
|
+
// src/components/suggestedActions/index.tsx
|
|
574
|
+
var { useLocalizer: useLocalizer2, useStyleOptions, useStyleSet: useStyleSet2, useSuggestedActions: useSuggestedActions2 } = import_botframework_webchat_component3.hooks;
|
|
575
|
+
function SuggestedActionStackedOrFlowContainer(props) {
|
|
576
|
+
const [{ suggestedActionLayout }] = useStyleOptions();
|
|
741
577
|
const [{ suggestedActions: suggestedActionsStyleSet }] = useStyleSet2();
|
|
742
|
-
const classNames =
|
|
743
|
-
return /* @__PURE__ */
|
|
578
|
+
const classNames = useStyles_default(suggestedActions_default);
|
|
579
|
+
return /* @__PURE__ */ import_react14.default.createElement(
|
|
744
580
|
"div",
|
|
745
581
|
{
|
|
746
582
|
"aria-label": props["aria-label"],
|
|
747
583
|
"aria-live": "polite",
|
|
748
584
|
"aria-orientation": "vertical",
|
|
749
|
-
className: (0,
|
|
585
|
+
className: (0, import_classnames4.default)(
|
|
586
|
+
classNames["suggested-actions"],
|
|
587
|
+
suggestedActionsStyleSet + "",
|
|
588
|
+
{
|
|
589
|
+
[classNames["suggested-actions--flow"]]: suggestedActionLayout === "flow",
|
|
590
|
+
[classNames["suggested-actions--stacked"]]: suggestedActionLayout !== "flow"
|
|
591
|
+
},
|
|
592
|
+
props.className
|
|
593
|
+
),
|
|
750
594
|
role: "toolbar"
|
|
751
595
|
},
|
|
752
|
-
!!props.children && !!
|
|
596
|
+
!!props.children && !!import_react14.default.Children.count(props.children) && props.children
|
|
753
597
|
);
|
|
754
598
|
}
|
|
755
599
|
function SuggestedActions() {
|
|
756
|
-
const classNames =
|
|
600
|
+
const classNames = useStyles_default(suggestedActions_default);
|
|
757
601
|
const localize = useLocalizer2();
|
|
758
602
|
const [suggestedActions] = useSuggestedActions2();
|
|
759
603
|
const children = suggestedActions.map((cardAction, index) => {
|
|
@@ -761,8 +605,8 @@ function SuggestedActions() {
|
|
|
761
605
|
if (!suggestedActions?.length) {
|
|
762
606
|
return null;
|
|
763
607
|
}
|
|
764
|
-
return /* @__PURE__ */
|
|
765
|
-
|
|
608
|
+
return /* @__PURE__ */ import_react14.default.createElement(
|
|
609
|
+
SuggestedAction_default2,
|
|
766
610
|
{
|
|
767
611
|
buttonText: computeSuggestedActionText(cardAction),
|
|
768
612
|
displayText,
|
|
@@ -776,29 +620,29 @@ function SuggestedActions() {
|
|
|
776
620
|
}
|
|
777
621
|
);
|
|
778
622
|
});
|
|
779
|
-
return /* @__PURE__ */
|
|
780
|
-
|
|
623
|
+
return /* @__PURE__ */ import_react14.default.createElement(
|
|
624
|
+
SuggestedActionStackedOrFlowContainer,
|
|
781
625
|
{
|
|
782
626
|
"aria-label": localize("SUGGESTED_ACTIONS_LABEL_ALT"),
|
|
783
|
-
className: classNames["
|
|
627
|
+
className: classNames["suggested-actions"]
|
|
784
628
|
},
|
|
785
629
|
children
|
|
786
630
|
);
|
|
787
631
|
}
|
|
788
|
-
var
|
|
632
|
+
var suggestedActions_default2 = (0, import_react14.memo)(SuggestedActions);
|
|
789
633
|
|
|
790
634
|
// src/components/SuggestedActions.tsx
|
|
791
|
-
var SuggestedActions_default =
|
|
635
|
+
var SuggestedActions_default = suggestedActions_default2;
|
|
792
636
|
|
|
793
637
|
// src/components/sendbox/AddAttachmentButton.tsx
|
|
794
|
-
var
|
|
795
|
-
var
|
|
638
|
+
var import_botframework_webchat_component4 = require("botframework-webchat-component");
|
|
639
|
+
var import_react17 = __toESM(require("react"));
|
|
796
640
|
var import_use_ref_from4 = require("use-ref-from");
|
|
797
641
|
|
|
798
642
|
// src/icons/AttachmentIcon.tsx
|
|
799
|
-
var
|
|
643
|
+
var import_react15 = __toESM(require("react"));
|
|
800
644
|
function AttachmentIcon(props) {
|
|
801
|
-
return /* @__PURE__ */
|
|
645
|
+
return /* @__PURE__ */ import_react15.default.createElement(
|
|
802
646
|
"svg",
|
|
803
647
|
{
|
|
804
648
|
"aria-hidden": "true",
|
|
@@ -809,7 +653,7 @@ function AttachmentIcon(props) {
|
|
|
809
653
|
width: "1em",
|
|
810
654
|
xmlns: "http://www.w3.org/2000/svg"
|
|
811
655
|
},
|
|
812
|
-
/* @__PURE__ */
|
|
656
|
+
/* @__PURE__ */ import_react15.default.createElement(
|
|
813
657
|
"path",
|
|
814
658
|
{
|
|
815
659
|
d: "m4.83 10.48 5.65-5.65a3 3 0 0 1 4.25 4.24L8 15.8a1.5 1.5 0 0 1-2.12-2.12l6-6.01a.5.5 0 1 0-.7-.71l-6 6.01a2.5 2.5 0 0 0 3.53 3.54l6.71-6.72a4 4 0 1 0-5.65-5.66L4.12 9.78a.5.5 0 0 0 .7.7Z",
|
|
@@ -820,63 +664,26 @@ function AttachmentIcon(props) {
|
|
|
820
664
|
}
|
|
821
665
|
|
|
822
666
|
// src/components/sendbox/Toolbar.tsx
|
|
823
|
-
var
|
|
824
|
-
var
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
"webchat-fluent__sendbox__toolbar-button": {
|
|
832
|
-
alignItems: "center",
|
|
833
|
-
appearance: "none",
|
|
834
|
-
aspectRatio: "1",
|
|
835
|
-
background: "transparent",
|
|
836
|
-
border: "none",
|
|
837
|
-
borderRadius: "var(--webchat-borderRadiusSmall)",
|
|
838
|
-
cursor: "pointer",
|
|
839
|
-
display: "flex",
|
|
840
|
-
justifyContent: "center",
|
|
841
|
-
padding: "3px",
|
|
842
|
-
width: "32px",
|
|
843
|
-
"> svg": {
|
|
844
|
-
fontSize: "20px",
|
|
845
|
-
pointerEvents: "none"
|
|
846
|
-
},
|
|
847
|
-
"@media (hover: hover)": {
|
|
848
|
-
'&:not([aria-disabled="true"]):hover': {
|
|
849
|
-
backgroundColor: "var(--webchat-colorSubtleBackgroundHover)",
|
|
850
|
-
color: "var(--webchat-colorCompoundBrandForeground1Hover)"
|
|
851
|
-
}
|
|
852
|
-
},
|
|
853
|
-
'&:not([aria-disabled="true"]):active': {
|
|
854
|
-
backgroundColor: "var(--webchat-colorSubtleBackgroundPressed)",
|
|
855
|
-
color: "var(--webchat-colorCompoundBrandForeground1Pressed)"
|
|
856
|
-
},
|
|
857
|
-
'&[aria-disabled="true"]': {
|
|
858
|
-
color: " var(--webchat-colorNeutralForegroundDisabled)",
|
|
859
|
-
cursor: "not-allowed"
|
|
860
|
-
}
|
|
861
|
-
},
|
|
862
|
-
"webchat-fluent__sendbox__toolbar-separator": {
|
|
863
|
-
alignSelf: "center",
|
|
864
|
-
borderInlineEnd: "1px solid var(--webchat-colorNeutralStroke2)",
|
|
865
|
-
height: "28px",
|
|
866
|
-
"&:first-child, &:last-child, &:only-child": {
|
|
867
|
-
display: "none"
|
|
868
|
-
}
|
|
869
|
-
}
|
|
667
|
+
var import_classnames5 = __toESM(require("classnames"));
|
|
668
|
+
var import_react16 = __toESM(require("react"));
|
|
669
|
+
|
|
670
|
+
// src/components/sendbox/Toolbar.module.css
|
|
671
|
+
var Toolbar_default = {
|
|
672
|
+
sendbox__toolbar: "Toolbar_sendbox__toolbar",
|
|
673
|
+
"sendbox__toolbar-button": "Toolbar_sendbox__toolbar-button",
|
|
674
|
+
"sendbox__toolbar-separator": "Toolbar_sendbox__toolbar-separator"
|
|
870
675
|
};
|
|
676
|
+
|
|
677
|
+
// src/components/sendbox/Toolbar.tsx
|
|
871
678
|
var preventDefaultHandler2 = (event) => event.preventDefault();
|
|
872
|
-
var ToolbarButton = (0,
|
|
679
|
+
var ToolbarButton = (0, import_react16.memo)(
|
|
873
680
|
(props) => {
|
|
874
|
-
const classNames =
|
|
875
|
-
return /* @__PURE__ */
|
|
681
|
+
const classNames = useStyles_default(Toolbar_default);
|
|
682
|
+
return /* @__PURE__ */ import_react16.default.createElement(
|
|
876
683
|
"button",
|
|
877
684
|
{
|
|
878
685
|
"aria-label": props["aria-label"],
|
|
879
|
-
className: (0,
|
|
686
|
+
className: (0, import_classnames5.default)(classNames["sendbox__toolbar-button"], props.className),
|
|
880
687
|
"data-testid": props["data-testid"],
|
|
881
688
|
onClick: props.disabled ? preventDefaultHandler2 : props.onClick,
|
|
882
689
|
type: props.type === "submit" ? "submit" : "button",
|
|
@@ -890,19 +697,19 @@ var ToolbarButton = (0, import_react17.memo)(
|
|
|
890
697
|
}
|
|
891
698
|
);
|
|
892
699
|
ToolbarButton.displayName = "ToolbarButton";
|
|
893
|
-
var Toolbar = (0,
|
|
894
|
-
const classNames =
|
|
895
|
-
return /* @__PURE__ */
|
|
700
|
+
var Toolbar = (0, import_react16.memo)((props) => {
|
|
701
|
+
const classNames = useStyles_default(Toolbar_default);
|
|
702
|
+
return /* @__PURE__ */ import_react16.default.createElement("div", { className: (0, import_classnames5.default)(classNames["sendbox__toolbar"], props.className) }, props.children);
|
|
896
703
|
});
|
|
897
704
|
Toolbar.displayName = "Toolbar";
|
|
898
|
-
var ToolbarSeparator = (0,
|
|
705
|
+
var ToolbarSeparator = (0, import_react16.memo)(
|
|
899
706
|
(props) => {
|
|
900
|
-
const classNames =
|
|
901
|
-
return /* @__PURE__ */
|
|
707
|
+
const classNames = useStyles_default(Toolbar_default);
|
|
708
|
+
return /* @__PURE__ */ import_react16.default.createElement(
|
|
902
709
|
"div",
|
|
903
710
|
{
|
|
904
711
|
"aria-orientation": "vertical",
|
|
905
|
-
className: (0,
|
|
712
|
+
className: (0, import_classnames5.default)(classNames["sendbox__toolbar-separator"], props.className),
|
|
906
713
|
role: "separator"
|
|
907
714
|
}
|
|
908
715
|
);
|
|
@@ -910,27 +717,22 @@ var ToolbarSeparator = (0, import_react17.memo)(
|
|
|
910
717
|
);
|
|
911
718
|
ToolbarSeparator.displayName = "ToolbarSeparator";
|
|
912
719
|
|
|
913
|
-
// src/components/sendbox/AddAttachmentButton.
|
|
914
|
-
var
|
|
915
|
-
|
|
916
|
-
"
|
|
917
|
-
display: "grid"
|
|
918
|
-
},
|
|
919
|
-
"webchat-fluent__sendbox__add-attachment-input": {
|
|
920
|
-
fontSize: 0,
|
|
921
|
-
height: 0,
|
|
922
|
-
opacity: 0,
|
|
923
|
-
width: 0
|
|
924
|
-
}
|
|
720
|
+
// src/components/sendbox/AddAttachmentButton.module.css
|
|
721
|
+
var AddAttachmentButton_default = {
|
|
722
|
+
"sendbox__add-attachment": "AddAttachmentButton_sendbox__add-attachment",
|
|
723
|
+
"sendbox__add-attachment-input": "AddAttachmentButton_sendbox__add-attachment-input"
|
|
925
724
|
};
|
|
725
|
+
|
|
726
|
+
// src/components/sendbox/AddAttachmentButton.tsx
|
|
727
|
+
var { useLocalizer: useLocalizer3, useStyleOptions: useStyleOptions2 } = import_botframework_webchat_component4.hooks;
|
|
926
728
|
function AddAttachmentButton(props) {
|
|
927
|
-
const inputRef = (0,
|
|
928
|
-
const classNames =
|
|
729
|
+
const inputRef = (0, import_react17.useRef)(null);
|
|
730
|
+
const classNames = useStyles_default(AddAttachmentButton_default);
|
|
929
731
|
const localize = useLocalizer3();
|
|
930
|
-
const [{ uploadAccept, uploadMultiple }] =
|
|
732
|
+
const [{ uploadAccept, uploadMultiple }] = useStyleOptions2();
|
|
931
733
|
const onFilesAddedRef = (0, import_use_ref_from4.useRefFrom)(props.onFilesAdded);
|
|
932
|
-
const handleClick = (0,
|
|
933
|
-
const handleFileChange = (0,
|
|
734
|
+
const handleClick = (0, import_react17.useCallback)(() => inputRef.current?.click(), [inputRef]);
|
|
735
|
+
const handleFileChange = (0, import_react17.useCallback)(
|
|
934
736
|
({ target: { files } }) => {
|
|
935
737
|
if (files) {
|
|
936
738
|
onFilesAddedRef.current?.([...files]);
|
|
@@ -941,13 +743,13 @@ function AddAttachmentButton(props) {
|
|
|
941
743
|
},
|
|
942
744
|
[inputRef, onFilesAddedRef]
|
|
943
745
|
);
|
|
944
|
-
return /* @__PURE__ */
|
|
746
|
+
return /* @__PURE__ */ import_react17.default.createElement("div", { className: classNames["sendbox__add-attachment"] }, /* @__PURE__ */ import_react17.default.createElement(
|
|
945
747
|
"input",
|
|
946
748
|
{
|
|
947
749
|
accept: uploadAccept,
|
|
948
750
|
"aria-disabled": props.disabled,
|
|
949
751
|
"aria-hidden": "true",
|
|
950
|
-
className: classNames["
|
|
752
|
+
className: classNames["sendbox__add-attachment-input"],
|
|
951
753
|
multiple: uploadMultiple,
|
|
952
754
|
onInput: props.disabled ? void 0 : handleFileChange,
|
|
953
755
|
readOnly: props.disabled,
|
|
@@ -956,31 +758,29 @@ function AddAttachmentButton(props) {
|
|
|
956
758
|
tabIndex: -1,
|
|
957
759
|
type: "file"
|
|
958
760
|
}
|
|
959
|
-
), /* @__PURE__ */
|
|
761
|
+
), /* @__PURE__ */ import_react17.default.createElement(
|
|
960
762
|
ToolbarButton,
|
|
961
763
|
{
|
|
962
764
|
"aria-label": localize("TEXT_INPUT_UPLOAD_BUTTON_ALT"),
|
|
963
765
|
"data-testid": testIds_default.sendBoxUploadButton,
|
|
964
766
|
onClick: handleClick
|
|
965
767
|
},
|
|
966
|
-
/* @__PURE__ */
|
|
768
|
+
/* @__PURE__ */ import_react17.default.createElement(AttachmentIcon, null)
|
|
967
769
|
));
|
|
968
770
|
}
|
|
969
|
-
var
|
|
771
|
+
var AddAttachmentButton_default2 = (0, import_react17.memo)(AddAttachmentButton);
|
|
970
772
|
|
|
971
773
|
// src/components/sendbox/Attachments.tsx
|
|
972
|
-
var
|
|
973
|
-
var
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
borderRadius: "var(--webchat-borderRadiusLarge)",
|
|
979
|
-
cursor: "default",
|
|
980
|
-
padding: "6px 8px",
|
|
981
|
-
width: "fit-content"
|
|
982
|
-
}
|
|
774
|
+
var import_botframework_webchat_component5 = require("botframework-webchat-component");
|
|
775
|
+
var import_react18 = __toESM(require("react"));
|
|
776
|
+
|
|
777
|
+
// src/components/sendbox/Attachments.module.css
|
|
778
|
+
var Attachments_default = {
|
|
779
|
+
sendbox__attachment: "Attachments_sendbox__attachment"
|
|
983
780
|
};
|
|
781
|
+
|
|
782
|
+
// src/components/sendbox/Attachments.tsx
|
|
783
|
+
var { useLocalizer: useLocalizer4 } = import_botframework_webchat_component5.hooks;
|
|
984
784
|
var attachmentsPluralStringIds = {
|
|
985
785
|
one: "TEXT_INPUT_ATTACHMENTS_ONE",
|
|
986
786
|
two: "TEXT_INPUT_ATTACHMENTS_TWO",
|
|
@@ -991,42 +791,38 @@ var attachmentsPluralStringIds = {
|
|
|
991
791
|
function Attachments({
|
|
992
792
|
attachments
|
|
993
793
|
}) {
|
|
994
|
-
const classNames =
|
|
794
|
+
const classNames = useStyles_default(Attachments_default);
|
|
995
795
|
const localizeWithPlural = useLocalizer4({ plural: true });
|
|
996
|
-
return attachments.length ? /* @__PURE__ */
|
|
796
|
+
return attachments.length ? /* @__PURE__ */ import_react18.default.createElement("div", { className: classNames["sendbox__attachment"] }, localizeWithPlural(attachmentsPluralStringIds, attachments.length)) : null;
|
|
997
797
|
}
|
|
998
|
-
var
|
|
798
|
+
var Attachments_default2 = (0, import_react18.memo)(Attachments);
|
|
999
799
|
|
|
1000
800
|
// src/components/sendbox/ErrorMessage.tsx
|
|
1001
|
-
var
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
width: 0,
|
|
1007
|
-
position: "absolute",
|
|
1008
|
-
top: 0,
|
|
1009
|
-
left: 0,
|
|
1010
|
-
color: "transparent"
|
|
1011
|
-
}
|
|
801
|
+
var import_react19 = __toESM(require("react"));
|
|
802
|
+
|
|
803
|
+
// src/components/sendbox/ErrorMessage.module.css
|
|
804
|
+
var ErrorMessage_default = {
|
|
805
|
+
"sendbox__error-message": "ErrorMessage_sendbox__error-message"
|
|
1012
806
|
};
|
|
807
|
+
|
|
808
|
+
// src/components/sendbox/ErrorMessage.tsx
|
|
1013
809
|
function ErrorMessage(props) {
|
|
1014
|
-
const classNames =
|
|
810
|
+
const classNames = useStyles_default(ErrorMessage_default);
|
|
1015
811
|
return (
|
|
1016
812
|
// eslint-disable-next-line react/forbid-dom-props
|
|
1017
|
-
/* @__PURE__ */
|
|
813
|
+
/* @__PURE__ */ import_react19.default.createElement("span", { className: classNames["sendbox__error-message"], id: props.id, role: "alert" }, props.error)
|
|
1018
814
|
);
|
|
1019
815
|
}
|
|
1020
|
-
var
|
|
816
|
+
var ErrorMessage_default2 = (0, import_react19.memo)(ErrorMessage);
|
|
1021
817
|
|
|
1022
818
|
// src/components/sendbox/TelephoneKeypadToolbarButton.tsx
|
|
1023
|
-
var
|
|
1024
|
-
var
|
|
819
|
+
var import_react21 = __toESM(require("react"));
|
|
820
|
+
var import_botframework_webchat_component6 = require("botframework-webchat-component");
|
|
1025
821
|
|
|
1026
822
|
// src/icons/TelephoneKeypad.tsx
|
|
1027
|
-
var
|
|
823
|
+
var import_react20 = __toESM(require("react"));
|
|
1028
824
|
function TelephoneKeypadIcon(props) {
|
|
1029
|
-
return /* @__PURE__ */
|
|
825
|
+
return /* @__PURE__ */ import_react20.default.createElement(
|
|
1030
826
|
"svg",
|
|
1031
827
|
{
|
|
1032
828
|
"aria-hidden": "true",
|
|
@@ -1037,7 +833,7 @@ function TelephoneKeypadIcon(props) {
|
|
|
1037
833
|
width: "1em",
|
|
1038
834
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1039
835
|
},
|
|
1040
|
-
/* @__PURE__ */
|
|
836
|
+
/* @__PURE__ */ import_react20.default.createElement(
|
|
1041
837
|
"path",
|
|
1042
838
|
{
|
|
1043
839
|
d: "M6 5.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm0 4a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5ZM7.25 12a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0ZM10 5.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5ZM11.25 8a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0ZM10 13.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5ZM11.25 16a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0ZM14 5.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5ZM15.25 8a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0ZM14 13.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z",
|
|
@@ -1048,81 +844,42 @@ function TelephoneKeypadIcon(props) {
|
|
|
1048
844
|
}
|
|
1049
845
|
|
|
1050
846
|
// src/components/sendbox/TelephoneKeypadToolbarButton.tsx
|
|
1051
|
-
var { useLocalizer: useLocalizer5 } =
|
|
1052
|
-
var TelephoneKeypadToolbarButton = (0,
|
|
847
|
+
var { useLocalizer: useLocalizer5 } = import_botframework_webchat_component6.hooks;
|
|
848
|
+
var TelephoneKeypadToolbarButton = (0, import_react21.memo)(() => {
|
|
1053
849
|
const [, setTelephoneKeypadShown] = useShown();
|
|
1054
850
|
const localize = useLocalizer5();
|
|
1055
|
-
const handleClick = (0,
|
|
1056
|
-
return /* @__PURE__ */
|
|
851
|
+
const handleClick = (0, import_react21.useCallback)(() => setTelephoneKeypadShown((shown) => !shown), [setTelephoneKeypadShown]);
|
|
852
|
+
return /* @__PURE__ */ import_react21.default.createElement(
|
|
1057
853
|
ToolbarButton,
|
|
1058
854
|
{
|
|
1059
855
|
"aria-label": localize("TEXT_INPUT_TELEPHONE_KEYPAD_BUTTON_ALT"),
|
|
1060
856
|
"data-testid": testIds_default.sendBoxTelephoneKeypadToolbarButton,
|
|
1061
857
|
onClick: handleClick
|
|
1062
858
|
},
|
|
1063
|
-
/* @__PURE__ */
|
|
859
|
+
/* @__PURE__ */ import_react21.default.createElement(TelephoneKeypadIcon, null)
|
|
1064
860
|
);
|
|
1065
861
|
});
|
|
1066
862
|
TelephoneKeypadToolbarButton.displayName = "SendBox.TelephoneKeypadToolbarButton";
|
|
1067
863
|
var TelephoneKeypadToolbarButton_default = TelephoneKeypadToolbarButton;
|
|
1068
864
|
|
|
1069
865
|
// src/components/sendbox/TextArea.tsx
|
|
1070
|
-
var
|
|
1071
|
-
var
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
"
|
|
1080
|
-
|
|
1081
|
-
height: 0,
|
|
1082
|
-
visibility: "collapse"
|
|
1083
|
-
},
|
|
1084
|
-
"webchat-fluent__sendbox__text-area-shared": {
|
|
1085
|
-
border: "none",
|
|
1086
|
-
font: "inherit",
|
|
1087
|
-
gridArea: "main",
|
|
1088
|
-
outline: "inherit",
|
|
1089
|
-
overflowWrap: "anywhere",
|
|
1090
|
-
resize: "inherit",
|
|
1091
|
-
scrollbarGutter: "stable"
|
|
1092
|
-
},
|
|
1093
|
-
"webchat-fluent__sendbox__text-area-doppelganger": {
|
|
1094
|
-
overflow: "hidden",
|
|
1095
|
-
visibility: "hidden",
|
|
1096
|
-
whiteSpace: "pre-wrap"
|
|
1097
|
-
},
|
|
1098
|
-
"webchat-fluent__sendbox__text-area-input": {
|
|
1099
|
-
height: "100%",
|
|
1100
|
-
padding: 0
|
|
1101
|
-
},
|
|
1102
|
-
"webchat-fluent__sendbox__text-area-input--scroll": {
|
|
1103
|
-
/* Firefox */
|
|
1104
|
-
MozScrollbarColor: "var(--webchat-colorNeutralBackground5) var(--webchat-colorNeutralForeground2)",
|
|
1105
|
-
MozScrollbarWidth: "thin",
|
|
1106
|
-
/* Chrome, Edge, and Safari */
|
|
1107
|
-
"&::-webkit-scrollbar": {
|
|
1108
|
-
width: "8px"
|
|
1109
|
-
},
|
|
1110
|
-
"&::-webkit-scrollbar-track": {
|
|
1111
|
-
backgroundColor: " var(--webchat-colorNeutralBackground5)",
|
|
1112
|
-
borderRadius: "16px"
|
|
1113
|
-
},
|
|
1114
|
-
"&::-webkit-scrollbar-thumb": {
|
|
1115
|
-
backgroundColor: "var(--webchat-colorNeutralForeground2)",
|
|
1116
|
-
borderRadius: "16px"
|
|
1117
|
-
},
|
|
1118
|
-
"&::-webkit-scrollbar-corner": {
|
|
1119
|
-
backgroundColor: "var(--webchat-colorNeutralBackground5)"
|
|
1120
|
-
}
|
|
1121
|
-
}
|
|
866
|
+
var import_classnames6 = __toESM(require("classnames"));
|
|
867
|
+
var import_react22 = __toESM(require("react"));
|
|
868
|
+
|
|
869
|
+
// src/components/sendbox/TextArea.module.css
|
|
870
|
+
var TextArea_default = {
|
|
871
|
+
"sendbox__text-area": "TextArea_sendbox__text-area",
|
|
872
|
+
"sendbox__text-area--hidden": "TextArea_sendbox__text-area--hidden",
|
|
873
|
+
"sendbox__text-area-shared": "TextArea_sendbox__text-area-shared",
|
|
874
|
+
"sendbox__text-area-doppelganger": "TextArea_sendbox__text-area-doppelganger",
|
|
875
|
+
"sendbox__text-area-input": "TextArea_sendbox__text-area-input",
|
|
876
|
+
"sendbox__text-area-input--scroll": "TextArea_sendbox__text-area-input--scroll"
|
|
1122
877
|
};
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
878
|
+
|
|
879
|
+
// src/components/sendbox/TextArea.tsx
|
|
880
|
+
var TextArea = (0, import_react22.forwardRef)((props, ref) => {
|
|
881
|
+
const classNames = useStyles_default(TextArea_default);
|
|
882
|
+
const handleKeyDown = (0, import_react22.useCallback)((event) => {
|
|
1126
883
|
if (!event.shiftKey && event.key === "Enter") {
|
|
1127
884
|
event.preventDefault();
|
|
1128
885
|
if ("form" in event.target && event.target.form instanceof HTMLFormElement) {
|
|
@@ -1130,38 +887,38 @@ var TextArea = (0, import_react23.forwardRef)((props, ref) => {
|
|
|
1130
887
|
}
|
|
1131
888
|
}
|
|
1132
889
|
}, []);
|
|
1133
|
-
return /* @__PURE__ */
|
|
890
|
+
return /* @__PURE__ */ import_react22.default.createElement(
|
|
1134
891
|
"div",
|
|
1135
892
|
{
|
|
1136
|
-
className: (0,
|
|
1137
|
-
classNames["
|
|
893
|
+
className: (0, import_classnames6.default)(
|
|
894
|
+
classNames["sendbox__text-area"],
|
|
1138
895
|
{
|
|
1139
|
-
[classNames["
|
|
896
|
+
[classNames["sendbox__text-area--hidden"]]: props.hidden
|
|
1140
897
|
},
|
|
1141
898
|
props.className
|
|
1142
899
|
),
|
|
1143
900
|
role: props.hidden ? "hidden" : void 0
|
|
1144
901
|
},
|
|
1145
|
-
/* @__PURE__ */
|
|
902
|
+
/* @__PURE__ */ import_react22.default.createElement(
|
|
1146
903
|
"div",
|
|
1147
904
|
{
|
|
1148
|
-
className: (0,
|
|
1149
|
-
classNames["
|
|
1150
|
-
classNames["
|
|
1151
|
-
classNames["
|
|
905
|
+
className: (0, import_classnames6.default)(
|
|
906
|
+
classNames["sendbox__text-area-doppelganger"],
|
|
907
|
+
classNames["sendbox__text-area-shared"],
|
|
908
|
+
classNames["sendbox__text-area-input--scroll"]
|
|
1152
909
|
)
|
|
1153
910
|
},
|
|
1154
911
|
props.value || props.placeholder,
|
|
1155
912
|
" "
|
|
1156
913
|
),
|
|
1157
|
-
/* @__PURE__ */
|
|
914
|
+
/* @__PURE__ */ import_react22.default.createElement(
|
|
1158
915
|
"textarea",
|
|
1159
916
|
{
|
|
1160
917
|
"aria-label": props["aria-label"],
|
|
1161
|
-
className: (0,
|
|
1162
|
-
classNames["
|
|
1163
|
-
classNames["
|
|
1164
|
-
classNames["
|
|
918
|
+
className: (0, import_classnames6.default)(
|
|
919
|
+
classNames["sendbox__text-area-input"],
|
|
920
|
+
classNames["sendbox__text-area-shared"],
|
|
921
|
+
classNames["sendbox__text-area-input--scroll"]
|
|
1165
922
|
),
|
|
1166
923
|
"data-testid": props["data-testid"],
|
|
1167
924
|
onInput: props.onInput,
|
|
@@ -1176,13 +933,13 @@ var TextArea = (0, import_react23.forwardRef)((props, ref) => {
|
|
|
1176
933
|
);
|
|
1177
934
|
});
|
|
1178
935
|
TextArea.displayName = "TextArea";
|
|
1179
|
-
var
|
|
936
|
+
var TextArea_default2 = TextArea;
|
|
1180
937
|
|
|
1181
938
|
// src/components/sendbox/private/useSubmitError.ts
|
|
1182
|
-
var
|
|
1183
|
-
var
|
|
939
|
+
var import_botframework_webchat_component7 = require("botframework-webchat-component");
|
|
940
|
+
var import_react23 = require("react");
|
|
1184
941
|
var import_use_ref_from5 = require("use-ref-from");
|
|
1185
|
-
var { useConnectivityStatus, useLocalizer: useLocalizer6 } =
|
|
942
|
+
var { useConnectivityStatus, useLocalizer: useLocalizer6 } = import_botframework_webchat_component7.hooks;
|
|
1186
943
|
var useSubmitError = ({
|
|
1187
944
|
attachments,
|
|
1188
945
|
message
|
|
@@ -1192,13 +949,13 @@ var useSubmitError = ({
|
|
|
1192
949
|
const submitErrorRef = (0, import_use_ref_from5.useRefFrom)(
|
|
1193
950
|
connectivityStatus !== "connected" && connectivityStatus !== "reconnected" ? "offline" : !message && !attachments.length ? "empty" : void 0
|
|
1194
951
|
);
|
|
1195
|
-
const errorMessageStringMap = (0,
|
|
952
|
+
const errorMessageStringMap = (0, import_react23.useMemo)(
|
|
1196
953
|
() => Object.freeze(
|
|
1197
954
|
(/* @__PURE__ */ new Map()).set("empty", localize("SEND_BOX_IS_EMPTY_TOOLTIP_ALT")).set("offline", localize("CONNECTIVITY_STATUS_ALT_FATAL"))
|
|
1198
955
|
),
|
|
1199
956
|
[localize]
|
|
1200
957
|
);
|
|
1201
|
-
return (0,
|
|
958
|
+
return (0, import_react23.useMemo)(
|
|
1202
959
|
() => Object.freeze([submitErrorRef, submitErrorRef.current && errorMessageStringMap.get(submitErrorRef.current)]),
|
|
1203
960
|
[errorMessageStringMap, submitErrorRef]
|
|
1204
961
|
);
|
|
@@ -1206,85 +963,41 @@ var useSubmitError = ({
|
|
|
1206
963
|
var useSubmitError_default = useSubmitError;
|
|
1207
964
|
|
|
1208
965
|
// src/components/sendbox/private/useUniqueId.ts
|
|
1209
|
-
var
|
|
966
|
+
var import_react24 = require("react");
|
|
1210
967
|
function useUniqueId(prefix) {
|
|
1211
|
-
const id = (0,
|
|
968
|
+
const id = (0, import_react24.useMemo)(() => Math.random().toString(36).substr(2, 5), []);
|
|
1212
969
|
prefix = prefix ? `${prefix}--` : "";
|
|
1213
970
|
return `${prefix}${id}`;
|
|
1214
971
|
}
|
|
1215
972
|
|
|
1216
|
-
// src/components/sendbox/index.
|
|
1217
|
-
var
|
|
1218
|
-
|
|
1219
|
-
"
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
},
|
|
1225
|
-
"webchat-fluent__sendbox__sendbox": {
|
|
1226
|
-
backgroundColor: "var(--webchat-colorNeutralBackground1)",
|
|
1227
|
-
border: "1px solid var(--webchat-colorNeutralStroke1)",
|
|
1228
|
-
borderRadius: "var(--webchat-borderRadiusLarge)",
|
|
1229
|
-
display: "grid",
|
|
1230
|
-
fontFamily: "var(--webchat-fontFamilyBase)",
|
|
1231
|
-
fontSize: "14px",
|
|
1232
|
-
gap: "6px",
|
|
1233
|
-
lineHeight: "20px",
|
|
1234
|
-
padding: "8px",
|
|
1235
|
-
position: "relative",
|
|
1236
|
-
"&:focus-within": {
|
|
1237
|
-
borderColor: "var(--webchat-colorNeutralStroke1Selected)",
|
|
1238
|
-
// TODO clarify with design the color:
|
|
1239
|
-
// - Teams is using colorCompoundBrandForeground1
|
|
1240
|
-
// - Fluent is using colorCompoundBrandStroke
|
|
1241
|
-
// - we are using colorCompoundBrandForeground1Hover
|
|
1242
|
-
boxShadow: "inset 0 -6px 0 -3px var(--webchat-colorCompoundBrandForeground1Hover)"
|
|
1243
|
-
}
|
|
1244
|
-
},
|
|
1245
|
-
"webchat-fluent__sendbox__sendbox-text": {
|
|
1246
|
-
backgroundColor: "transparent",
|
|
1247
|
-
border: "none",
|
|
1248
|
-
flex: "auto",
|
|
1249
|
-
fontFamily: "var(--webchat-fontFamilyBase)",
|
|
1250
|
-
fontSize: "14px",
|
|
1251
|
-
lineHeight: "20px",
|
|
1252
|
-
outline: "none",
|
|
1253
|
-
padding: "4px 4px 0",
|
|
1254
|
-
resize: "none"
|
|
1255
|
-
},
|
|
1256
|
-
"webchat-fluent__sendbox__sendbox-controls": {
|
|
1257
|
-
alignItems: "center",
|
|
1258
|
-
display: "flex",
|
|
1259
|
-
paddingInlineStart: "4px"
|
|
1260
|
-
},
|
|
1261
|
-
"webchat-fluent__sendbox__text-counter": {
|
|
1262
|
-
color: "var(--webchat-colorNeutralForeground4)",
|
|
1263
|
-
cursor: "default",
|
|
1264
|
-
fontFamily: "var(--webchat-fontFamilyNumeric)",
|
|
1265
|
-
fontSize: "10px",
|
|
1266
|
-
lineHeight: "14px"
|
|
1267
|
-
},
|
|
1268
|
-
"webchat-fluent__sendbox__text-counter--error": {
|
|
1269
|
-
color: "var(--webchat-colorStatusDangerForeground1)"
|
|
1270
|
-
}
|
|
973
|
+
// src/components/sendbox/index.module.css
|
|
974
|
+
var sendbox_default = {
|
|
975
|
+
sendbox: "sendbox_sendbox",
|
|
976
|
+
sendbox__sendbox: "sendbox_sendbox__sendbox",
|
|
977
|
+
"sendbox__sendbox-text": "sendbox_sendbox__sendbox-text",
|
|
978
|
+
"sendbox__sendbox-controls": "sendbox_sendbox__sendbox-controls",
|
|
979
|
+
"sendbox__text-counter": "sendbox_sendbox__text-counter",
|
|
980
|
+
"sendbox__text-counter--error": "sendbox_sendbox__text-counter--error"
|
|
1271
981
|
};
|
|
982
|
+
|
|
983
|
+
// src/components/sendbox/index.tsx
|
|
984
|
+
var { useStyleOptions: useStyleOptions3, useMakeThumbnail, useLocalizer: useLocalizer7, useSendBoxAttachments, useSendMessage } = import_botframework_webchat_component8.hooks;
|
|
1272
985
|
function SendBox(props) {
|
|
1273
|
-
const inputRef = (0,
|
|
1274
|
-
const [message, setMessage] = (0,
|
|
986
|
+
const inputRef = (0, import_react25.useRef)(null);
|
|
987
|
+
const [message, setMessage] = (0, import_react25.useState)("");
|
|
1275
988
|
const [attachments, setAttachments] = useSendBoxAttachments();
|
|
1276
|
-
const [{ maxMessageLength }] =
|
|
989
|
+
const [{ hideTelephoneKeypadButton, hideUploadButton, maxMessageLength }] = useStyleOptions3();
|
|
1277
990
|
const isMessageLengthExceeded = !!maxMessageLength && message.length > maxMessageLength;
|
|
1278
|
-
const classNames =
|
|
991
|
+
const classNames = useStyles_default(sendbox_default);
|
|
1279
992
|
const localize = useLocalizer7();
|
|
1280
993
|
const sendMessage = useSendMessage();
|
|
1281
994
|
const makeThumbnail = useMakeThumbnail();
|
|
1282
|
-
const errorMessageId = useUniqueId("
|
|
995
|
+
const errorMessageId = useUniqueId("sendbox__error-message-id");
|
|
1283
996
|
const [errorRef, errorMessage] = useSubmitError_default({ message, attachments });
|
|
1284
|
-
const [telephoneKeypadShown
|
|
997
|
+
const [telephoneKeypadShown] = useShown();
|
|
1285
998
|
const attachmentsRef = (0, import_use_ref_from6.useRefFrom)(attachments);
|
|
1286
999
|
const messageRef = (0, import_use_ref_from6.useRefFrom)(message);
|
|
1287
|
-
const handleSendBoxClick = (0,
|
|
1000
|
+
const handleSendBoxClick = (0, import_react25.useCallback)(
|
|
1288
1001
|
(event) => {
|
|
1289
1002
|
if ("tabIndex" in event.target && typeof event.target.tabIndex === "number" && event.target.tabIndex >= 0) {
|
|
1290
1003
|
return;
|
|
@@ -1293,11 +1006,11 @@ function SendBox(props) {
|
|
|
1293
1006
|
},
|
|
1294
1007
|
[inputRef]
|
|
1295
1008
|
);
|
|
1296
|
-
const handleMessageChange = (0,
|
|
1009
|
+
const handleMessageChange = (0, import_react25.useCallback)(
|
|
1297
1010
|
(event) => setMessage(event.currentTarget.value),
|
|
1298
1011
|
[setMessage]
|
|
1299
1012
|
);
|
|
1300
|
-
const handleAddFiles = (0,
|
|
1013
|
+
const handleAddFiles = (0, import_react25.useCallback)(
|
|
1301
1014
|
async (inputFiles) => {
|
|
1302
1015
|
const newAttachments = Object.freeze(
|
|
1303
1016
|
await Promise.all(
|
|
@@ -1315,7 +1028,7 @@ function SendBox(props) {
|
|
|
1315
1028
|
},
|
|
1316
1029
|
[makeThumbnail, setAttachments]
|
|
1317
1030
|
);
|
|
1318
|
-
const handleFormSubmit = (0,
|
|
1031
|
+
const handleFormSubmit = (0, import_react25.useCallback)(
|
|
1319
1032
|
(event) => {
|
|
1320
1033
|
event.preventDefault();
|
|
1321
1034
|
if (errorRef.current !== "empty" && !isMessageLengthExceeded) {
|
|
@@ -1327,12 +1040,10 @@ function SendBox(props) {
|
|
|
1327
1040
|
},
|
|
1328
1041
|
[attachmentsRef, messageRef, sendMessage, setAttachments, setMessage, isMessageLengthExceeded, errorRef, inputRef]
|
|
1329
1042
|
);
|
|
1330
|
-
const handleTelephoneKeypadButtonClick = (0,
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
},
|
|
1335
|
-
[sendMessage, setTelephoneKeypadShown]
|
|
1043
|
+
const handleTelephoneKeypadButtonClick = (0, import_react25.useCallback)(
|
|
1044
|
+
// TODO: We need more official way of sending DTMF.
|
|
1045
|
+
(dtmf) => sendMessage(`/DTMF ${dtmf}`),
|
|
1046
|
+
[sendMessage]
|
|
1336
1047
|
);
|
|
1337
1048
|
const aria = {
|
|
1338
1049
|
"aria-invalid": "false",
|
|
@@ -1341,18 +1052,18 @@ function SendBox(props) {
|
|
|
1341
1052
|
"aria-errormessage": errorMessageId
|
|
1342
1053
|
}
|
|
1343
1054
|
};
|
|
1344
|
-
return /* @__PURE__ */
|
|
1055
|
+
return /* @__PURE__ */ import_react25.default.createElement("form", { ...aria, className: (0, import_classnames7.default)(classNames["sendbox"], props.className), onSubmit: handleFormSubmit }, /* @__PURE__ */ import_react25.default.createElement(SuggestedActions_default, null), /* @__PURE__ */ import_react25.default.createElement("div", { className: (0, import_classnames7.default)(classNames["sendbox__sendbox"]), onClickCapture: handleSendBoxClick }, /* @__PURE__ */ import_react25.default.createElement(
|
|
1345
1056
|
Surrogate_default,
|
|
1346
1057
|
{
|
|
1347
1058
|
autoFocus: true,
|
|
1348
1059
|
isHorizontal: false,
|
|
1349
1060
|
onButtonClick: handleTelephoneKeypadButtonClick
|
|
1350
1061
|
}
|
|
1351
|
-
), /* @__PURE__ */
|
|
1352
|
-
|
|
1062
|
+
), /* @__PURE__ */ import_react25.default.createElement(
|
|
1063
|
+
TextArea_default2,
|
|
1353
1064
|
{
|
|
1354
1065
|
"aria-label": isMessageLengthExceeded ? localize("TEXT_INPUT_LENGTH_EXCEEDED_ALT") : localize("TEXT_INPUT_ALT"),
|
|
1355
|
-
className: classNames["
|
|
1066
|
+
className: classNames["sendbox__sendbox-text"],
|
|
1356
1067
|
"data-testid": testIds_default.sendBoxTextBox,
|
|
1357
1068
|
hidden: telephoneKeypadShown,
|
|
1358
1069
|
onInput: handleMessageChange,
|
|
@@ -1360,15 +1071,15 @@ function SendBox(props) {
|
|
|
1360
1071
|
ref: inputRef,
|
|
1361
1072
|
value: message
|
|
1362
1073
|
}
|
|
1363
|
-
), /* @__PURE__ */
|
|
1074
|
+
), /* @__PURE__ */ import_react25.default.createElement(Attachments_default2, { attachments }), /* @__PURE__ */ import_react25.default.createElement("div", { className: (0, import_classnames7.default)(classNames["sendbox__sendbox-controls"]) }, maxMessageLength && /* @__PURE__ */ import_react25.default.createElement(
|
|
1364
1075
|
"div",
|
|
1365
1076
|
{
|
|
1366
|
-
className: (0,
|
|
1367
|
-
[classNames["
|
|
1077
|
+
className: (0, import_classnames7.default)(classNames["sendbox__text-counter"], {
|
|
1078
|
+
[classNames["sendbox__text-counter--error"]]: isMessageLengthExceeded
|
|
1368
1079
|
})
|
|
1369
1080
|
},
|
|
1370
1081
|
`${message.length}/${maxMessageLength}`
|
|
1371
|
-
), /* @__PURE__ */
|
|
1082
|
+
), /* @__PURE__ */ import_react25.default.createElement(Toolbar, null, !hideTelephoneKeypadButton && /* @__PURE__ */ import_react25.default.createElement(TelephoneKeypadToolbarButton_default, null), !hideUploadButton && /* @__PURE__ */ import_react25.default.createElement(AddAttachmentButton_default2, { onFilesAdded: handleAddFiles }), /* @__PURE__ */ import_react25.default.createElement(ToolbarSeparator, null), /* @__PURE__ */ import_react25.default.createElement(
|
|
1372
1083
|
ToolbarButton,
|
|
1373
1084
|
{
|
|
1374
1085
|
"aria-label": localize("TEXT_INPUT_SEND_BUTTON_ALT"),
|
|
@@ -1376,22 +1087,23 @@ function SendBox(props) {
|
|
|
1376
1087
|
disabled: isMessageLengthExceeded,
|
|
1377
1088
|
type: "submit"
|
|
1378
1089
|
},
|
|
1379
|
-
/* @__PURE__ */
|
|
1380
|
-
))), /* @__PURE__ */
|
|
1090
|
+
/* @__PURE__ */ import_react25.default.createElement(SendIcon, null)
|
|
1091
|
+
))), /* @__PURE__ */ import_react25.default.createElement(DropZone_default, { onFilesAdded: handleAddFiles }), /* @__PURE__ */ import_react25.default.createElement(ErrorMessage_default2, { error: errorMessage, id: errorMessageId })));
|
|
1381
1092
|
}
|
|
1382
|
-
var
|
|
1093
|
+
var sendbox_default2 = (0, import_react25.memo)(SendBox);
|
|
1383
1094
|
|
|
1384
1095
|
// src/components/SendBox.tsx
|
|
1385
|
-
var SendBox_default =
|
|
1096
|
+
var SendBox_default = sendbox_default2;
|
|
1386
1097
|
|
|
1387
1098
|
// src/private/FluentThemeProvider.tsx
|
|
1388
|
-
var { ThemeProvider } =
|
|
1099
|
+
var { ThemeProvider } = import_botframework_webchat_component9.Components;
|
|
1389
1100
|
var sendBoxMiddleware = [() => () => () => SendBox_default];
|
|
1390
|
-
var FluentThemeProvider = ({ children }) => /* @__PURE__ */
|
|
1391
|
-
var FluentThemeProvider_default = (0,
|
|
1101
|
+
var FluentThemeProvider = ({ children }) => /* @__PURE__ */ import_react26.default.createElement(WebchatTheme, null, /* @__PURE__ */ import_react26.default.createElement(Provider_default, null, /* @__PURE__ */ import_react26.default.createElement(ThemeProvider, { sendBoxMiddleware }, children)));
|
|
1102
|
+
var FluentThemeProvider_default = (0, import_react26.memo)(FluentThemeProvider);
|
|
1392
1103
|
|
|
1393
1104
|
// src/index.ts
|
|
1394
|
-
(0, import_inject_meta_tag.injectMetaTag)("botframework-webchat-fluent-theme:version", "4.17.0-main.
|
|
1105
|
+
(0, import_inject_meta_tag.injectMetaTag)("botframework-webchat-fluent-theme:version", "4.17.0-main.20240416.4ff01ae");
|
|
1106
|
+
injectStyles();
|
|
1395
1107
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1396
1108
|
0 && (module.exports = {
|
|
1397
1109
|
FluentThemeProvider,
|