botframework-webchat-fluent-theme 4.17.0-main.20240416.e3f5401 → 4.17.0-main.20240423.d9e4f4d
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 +418 -2085
- 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.js +285 -545
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +335 -595
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -5
- package/src/components/Theme.module.css +80 -0
- package/src/components/Theme.tsx +4 -65
- 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 +7 -13
- package/src/components/sendbox/ErrorMessage.module.css +9 -0
- package/src/components/sendbox/ErrorMessage.tsx +2 -13
- package/src/components/sendbox/TelephoneKeypadToolbarButton.tsx +3 -2
- package/src/components/sendbox/TextArea.module.css +63 -0
- package/src/components/sendbox/TextArea.tsx +9 -70
- package/src/components/sendbox/Toolbar.module.css +51 -0
- package/src/components/sendbox/Toolbar.tsx +7 -55
- package/src/components/sendbox/index.module.css +101 -0
- package/src/components/sendbox/index.tsx +18 -77
- package/src/components/suggestedActions/SuggestedAction.module.css +35 -0
- package/src/components/suggestedActions/SuggestedAction.tsx +3 -43
- package/src/components/suggestedActions/index.module.css +23 -0
- package/src/components/suggestedActions/index.tsx +6 -29
- 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 +59 -0
- package/src/components/telephoneKeypad/private/TelephoneKeypad.tsx +17 -35
- package/src/env.d.ts +7 -0
- package/src/icons/AddDocumentIcon.tsx +0 -1
- package/src/icons/AttachmentIcon.tsx +0 -1
- package/src/icons/InfoSmallIcon.tsx +17 -0
- package/src/icons/SendIcon.tsx +0 -1
- package/src/icons/TelephoneKeypad.tsx +0 -1
- 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,7 +37,7 @@ 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
|
|
40
|
+
var import_botframework_webchat_component10 = require("botframework-webchat-component");
|
|
41
41
|
var import_react27 = __toESM(require("react"));
|
|
42
42
|
|
|
43
43
|
// src/components/telephoneKeypad/Provider.tsx
|
|
@@ -74,121 +74,73 @@ var import_react8 = __toESM(require("react"));
|
|
|
74
74
|
|
|
75
75
|
// src/components/telephoneKeypad/private/TelephoneKeypad.tsx
|
|
76
76
|
var import_react7 = __toESM(require("react"));
|
|
77
|
+
var import_classnames = __toESM(require("classnames"));
|
|
77
78
|
var import_use_ref_from2 = require("use-ref-from");
|
|
79
|
+
var import_botframework_webchat_component = require("botframework-webchat-component");
|
|
78
80
|
|
|
79
|
-
// src/
|
|
80
|
-
var import_react4 = require("react");
|
|
81
|
+
// src/components/telephoneKeypad/private/Button.tsx
|
|
82
|
+
var import_react4 = __toESM(require("react"));
|
|
83
|
+
var import_use_ref_from = require("use-ref-from");
|
|
81
84
|
|
|
82
|
-
// src/private/
|
|
83
|
-
var
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
function useStyleToEmotionObject() {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
);
|
|
97
|
-
|
|
98
|
-
}, []);
|
|
85
|
+
// src/components/telephoneKeypad/private/Button.module.css
|
|
86
|
+
var Button_default = {
|
|
87
|
+
"telephone-keypad__button": "Button_telephone-keypad__button",
|
|
88
|
+
"telephone-keypad__button__ruby": "Button_telephone-keypad__button__ruby",
|
|
89
|
+
"telephone-keypad__button__text": "Button_telephone-keypad__button__text",
|
|
90
|
+
"telephone-keypad--horizontal": "Button_telephone-keypad--horizontal"
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
// src/styles/injectStyle.ts
|
|
94
|
+
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.webchat-fluent .TelephoneKeypad_telephone-keypad__info-message {\n align-items: center;\n color: var(--webchat-colorNeutralForeground4);\n display: flex;\n font-size: 12px;\n gap: 6px;\n margin-block-end: 6px;\n}\n.webchat-fluent .TelephoneKeypad_telephone-keypad__info-message-link {\n color: var(--webchat-colorBrandForegroundLink);\n text-decoration-color: transparent;\n}\n.webchat-fluent .TelephoneKeypad_telephone-keypad__info-message-link:target {\n color: var(--webchat-colorBrandForegroundLinkSelected);\n}\n.webchat-fluent .TelephoneKeypad_telephone-keypad__info-message-link:hover {\n color: var(--webchat-colorBrandForegroundLinkHover);\n text-decoration: underline 1px currentColor;\n}\n.webchat-fluent .TelephoneKeypad_telephone-keypad__info-message-link:active {\n color: var(--webchat-colorBrandForegroundLinkPressed);\n}\n.webchat-fluent .TelephoneKeypad_telephone-keypad__info-message-link:focus-visible {\n outline: none;\n text-decoration: underline 1px double var(--webchat-colorStrokeFocus2);\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-colorNeutralForeground2BrandHover: var(--colorNeutralForeground2BrandHover, #02729c);\n --webchat-colorNeutralForeground2BrandPressed: var(--colorNeutralForeground2BrandPressed, #01678c);\n --webchat-colorNeutralForeground2BrandSelected: var(--colorNeutralForeground2BrandSelected, #067191);\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-colorNeutralStroke1: var(--colorNeutralStroke1, #d1d1d1);\n --webchat-colorNeutralStroke2: var(--colorNeutralStroke2, #e0e0e0);\n --webchat-colorNeutralStroke1Selected: var(--colorNeutralStroke1Selected, #bdbdbd);\n --webchat-colorStrokeFocus2: var(--colorStrokeFocus2, #000000);\n --webchat-colorBrandStroke2: var(--colorBrandStroke2, #9edcf7);\n --webchat-colorBrandForeground2Hover: var(--colorBrandForeground2Hover, #015a7a);\n --webchat-colorBrandForeground2Pressed: var(--colorBrandForeground2Pressed, #01384d);\n --webchat-colorBrandForegroundLink: var(--colorBrandForegroundLink, #01678c);\n --webchat-colorBrandForegroundLinkHover: var(--colorBrandForegroundLinkHover, #015a7a);\n --webchat-colorBrandForegroundLinkPressed: var(--colorBrandForegroundLinkPressed, #014259);\n --webchat-colorBrandForegroundLinkSelected: var(--colorBrandForegroundLinkSelected, #01678c);\n --webchat-colorBrandBackground2Hover: var(--colorBrandBackground2Hover, #bee7fa);\n --webchat-colorBrandBackground2Pressed: var(--colorBrandBackground2Pressed, #7fd2f5);\n --webchat-colorCompoundBrandForeground1Hover: var(--colorCompoundBrandForeground1Hover, #02729c);\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 --webchat-strokeWidthThicker: var(--strokeWidthThicker, 3px);\n --webchat-durationUltraFast: var(--durationUltraFast, 0);\n --webchat-durationNormal: var(--durationNormal, 200ms);\n --webchat-curveAccelerateMid: var(--curveAccelerateMid, cubic-bezier(1,0,1,1));\n --webchat-curveDecelerateMid: var(--curveDecelerateMid, cubic-bezier(0,0,0,1));\n}\n@media (prefers-reduced-motion) {\n .webchat-fluent.Theme_theme {\n --webchat-durationUltraFast: 0.01ms;\n --webchat-durationNormal: 0.01ms;\n }\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 color: currentColor;\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 color: currentColor;\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.webchat-fluent .Toolbar_sendbox__toolbar-button.Toolbar_sendbox__toolbar-button--selected {\n color: var(--webchat-colorNeutralForeground2BrandSelected);\n}\n@media (hover: hover) {\n .webchat-fluent .Toolbar_sendbox__toolbar-button:not([aria-disabled=true]):hover {\n color: var(--webchat-colorNeutralForeground2BrandHover);\n }\n}\n.webchat-fluent .Toolbar_sendbox__toolbar-button:not([aria-disabled=true]):active {\n color: var(--webchat-colorNeutralForeground2BrandPressed);\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 background-color: inherit;\n color: currentColor;\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 --webchat-sendbox-attachment-area-active: ;\n --webchat-sendbox-border-radius: var(--webchat-borderRadiusLarge);\n}\n.webchat-fluent .sendbox_sendbox__sendbox {\n background-color: var(--webchat-colorNeutralBackground1);\n border-radius: var(--webchat-sendbox-border-radius);\n border: 1px solid var(--webchat-colorNeutralStroke1);\n display: grid;\n font-family: var(--webchat-fontFamilyBase);\n font-size: 14px;\n gap: 6px;\n grid-template: [telephone-keypad-start] \"text-area\" [telephone-keypad-end] var(--webchat-sendbox-attachment-area-active) \"controls\" / [telephone-keypad] 1fr;\n line-height: 20px;\n padding: 8px;\n position: relative;\n}\n.webchat-fluent .sendbox_sendbox__sendbox:has(.sendbox_sendbox__attachment--in-grid) {\n --webchat-sendbox-attachment-area-active: \"attachment\" ;\n}\n.webchat-fluent .sendbox_sendbox__sendbox:focus-within {\n border-color: var(--webchat-colorNeutralStroke1Selected);\n}\n.webchat-fluent .sendbox_sendbox__sendbox::after {\n border-bottom-left-radius: var(--webchat-sendbox-border-radius);\n border-bottom-right-radius: var(--webchat-sendbox-border-radius);\n border-bottom: var(--webchat-strokeWidthThicker) solid var(--webchat-colorCompoundBrandForeground1Hover);\n bottom: -1px;\n clip-path: inset(calc(100% - var(--webchat-strokeWidthThicker)) 50% 0 50%);\n content: \"\";\n height: var(--webchat-sendbox-border-radius);\n left: -1px;\n position: absolute;\n right: -1px;\n transition: clip-path var(--webchat-durationUltraFast) var(--webchat-curveAccelerateMid);\n}\n.webchat-fluent .sendbox_sendbox__sendbox:focus-within::after {\n clip-path: inset(calc(100% - var(--webchat-strokeWidthThicker)) 0 0 0);\n transition: clip-path var(--webchat-durationNormal) var(--webchat-curveDecelerateMid);\n}\n.webchat-fluent .sendbox_sendbox__sendbox > .sendbox_sendbox__text-area--in-grid {\n grid-area: text-area;\n}\n.webchat-fluent .sendbox_sendbox__sendbox > .sendbox_sendbox__attachment--in-grid {\n grid-area: attachment;\n}\n.webchat-fluent .sendbox_sendbox__sendbox > .sendbox_sendbox__sendbox-controls--in-grid {\n grid-area: controls;\n}\n.webchat-fluent .sendbox_sendbox__sendbox > .sendbox_sendbox__telephone-keypad--in-grid {\n grid-area: telephone-keypad;\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 margin-inline-end: 4px;\n}\n.webchat-fluent .sendbox_sendbox__text-counter--error {\n color: var(--webchat-colorStatusDangerForeground1);\n}\n";
|
|
95
|
+
function injectStyles() {
|
|
96
|
+
if (globalThis.document) {
|
|
97
|
+
const style = document.createElement("style");
|
|
98
|
+
style.append(document.createTextNode(injectedStyles));
|
|
99
|
+
document.head.appendChild(style);
|
|
100
|
+
}
|
|
99
101
|
}
|
|
100
102
|
|
|
101
|
-
// src/styles/
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
return (0,
|
|
103
|
+
// src/styles/useStyles.ts
|
|
104
|
+
var import_react3 = require("react");
|
|
105
|
+
function useStyles(styles) {
|
|
106
|
+
return (0, import_react3.useMemo)(
|
|
105
107
|
() => Object.freeze(
|
|
106
|
-
Object.fromEntries(
|
|
108
|
+
Object.fromEntries(
|
|
109
|
+
Object.entries(styles).map(([baseClassName, resultClassName]) => [
|
|
110
|
+
baseClassName,
|
|
111
|
+
`${baseClassName} ${resultClassName}`
|
|
112
|
+
])
|
|
113
|
+
)
|
|
107
114
|
),
|
|
108
|
-
[
|
|
115
|
+
[styles]
|
|
109
116
|
);
|
|
110
117
|
}
|
|
118
|
+
var useStyles_default = useStyles;
|
|
111
119
|
|
|
112
120
|
// 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-colorGray200)",
|
|
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-colorGray190)",
|
|
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)(
|
|
121
|
+
var Button = (0, import_react4.memo)(
|
|
170
122
|
// As we are all TypeScript, internal components do not need propTypes.
|
|
171
123
|
// eslint-disable-next-line react/prop-types
|
|
172
|
-
(0,
|
|
173
|
-
const classNames =
|
|
124
|
+
(0, import_react4.forwardRef)(({ button, "data-testid": dataTestId, onClick, ruby }, ref) => {
|
|
125
|
+
const classNames = useStyles_default(Button_default);
|
|
174
126
|
const onClickRef = (0, import_use_ref_from.useRefFrom)(onClick);
|
|
175
|
-
const handleClick = (0,
|
|
176
|
-
return /* @__PURE__ */
|
|
127
|
+
const handleClick = (0, import_react4.useCallback)(() => onClickRef.current?.(), [onClickRef]);
|
|
128
|
+
return /* @__PURE__ */ import_react4.default.createElement(
|
|
177
129
|
"button",
|
|
178
130
|
{
|
|
179
|
-
className: classNames["
|
|
131
|
+
className: classNames["telephone-keypad__button"],
|
|
180
132
|
"data-testid": dataTestId,
|
|
181
133
|
onClick: handleClick,
|
|
182
134
|
ref,
|
|
183
135
|
type: "button"
|
|
184
136
|
},
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
!!ruby && /* @__PURE__ */
|
|
137
|
+
/* @__PURE__ */ import_react4.default.createElement("span", { className: classNames["telephone-keypad__button__text"] }, button === "star" ? "\u2217" : button === "pound" ? "#" : button),
|
|
138
|
+
!!ruby && /* @__PURE__ */ import_react4.default.createElement("ruby", { className: classNames["telephone-keypad__button__ruby"] }, ruby)
|
|
187
139
|
);
|
|
188
140
|
})
|
|
189
141
|
);
|
|
190
142
|
Button.displayName = "TelephoneKeypad.Button";
|
|
191
|
-
var
|
|
143
|
+
var Button_default2 = Button;
|
|
192
144
|
|
|
193
145
|
// src/testIds.ts
|
|
194
146
|
var testIds = {
|
|
@@ -213,55 +165,56 @@ var testIds = {
|
|
|
213
165
|
var testIds_default = testIds;
|
|
214
166
|
|
|
215
167
|
// src/components/telephoneKeypad/useShown.ts
|
|
216
|
-
var
|
|
168
|
+
var import_react5 = require("react");
|
|
217
169
|
function useShown() {
|
|
218
|
-
const { setShown, shown } = (0,
|
|
219
|
-
return (0,
|
|
170
|
+
const { setShown, shown } = (0, import_react5.useContext)(Context_default);
|
|
171
|
+
return (0, import_react5.useMemo)(() => Object.freeze([shown, setShown]), [shown, setShown]);
|
|
220
172
|
}
|
|
221
173
|
|
|
222
|
-
// src/components/telephoneKeypad/private/TelephoneKeypad.
|
|
223
|
-
var
|
|
224
|
-
"
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
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
|
-
}
|
|
174
|
+
// src/components/telephoneKeypad/private/TelephoneKeypad.module.css
|
|
175
|
+
var TelephoneKeypad_default = {
|
|
176
|
+
"telephone-keypad": "TelephoneKeypad_telephone-keypad",
|
|
177
|
+
"telephone-keypad__box": "TelephoneKeypad_telephone-keypad__box",
|
|
178
|
+
"telephone-keypad__info-message": "TelephoneKeypad_telephone-keypad__info-message",
|
|
179
|
+
"telephone-keypad__info-message-link": "TelephoneKeypad_telephone-keypad__info-message-link"
|
|
251
180
|
};
|
|
181
|
+
|
|
182
|
+
// src/icons/InfoSmallIcon.tsx
|
|
183
|
+
var import_react6 = __toESM(require("react"));
|
|
184
|
+
var InfoSmallIcon_default = (0, import_react6.memo)((props) => /* @__PURE__ */ import_react6.default.createElement(
|
|
185
|
+
"svg",
|
|
186
|
+
{
|
|
187
|
+
"aria-hidden": "true",
|
|
188
|
+
className: props.className,
|
|
189
|
+
height: "1em",
|
|
190
|
+
viewBox: "0 0 16 16",
|
|
191
|
+
width: "1em",
|
|
192
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
193
|
+
},
|
|
194
|
+
/* @__PURE__ */ import_react6.default.createElement(
|
|
195
|
+
"path",
|
|
196
|
+
{
|
|
197
|
+
d: "M8.5 7.5a.5.5 0 1 0-1 0v3a.5.5 0 0 0 1 0v-3Zm.25-2a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1ZM2 8a6 6 0 1 1 12 0A6 6 0 0 1 2 8Z",
|
|
198
|
+
fill: "currentColor"
|
|
199
|
+
}
|
|
200
|
+
)
|
|
201
|
+
));
|
|
202
|
+
|
|
203
|
+
// src/components/telephoneKeypad/private/TelephoneKeypad.tsx
|
|
204
|
+
var { LocalizedString } = import_botframework_webchat_component.Components;
|
|
252
205
|
var Orientation = (0, import_react7.memo)(
|
|
253
206
|
({ children, isHorizontal }) => {
|
|
254
|
-
const classNames =
|
|
207
|
+
const classNames = useStyles_default(TelephoneKeypad_default);
|
|
255
208
|
return isHorizontal ? (
|
|
256
209
|
// <HorizontalDialPadController>{children}</HorizontalDialPadController>
|
|
257
210
|
false
|
|
258
|
-
) : /* @__PURE__ */ import_react7.default.createElement("div", { className: classNames["
|
|
211
|
+
) : /* @__PURE__ */ import_react7.default.createElement("div", { className: classNames["telephone-keypad__box"] }, children);
|
|
259
212
|
}
|
|
260
213
|
);
|
|
261
214
|
Orientation.displayName = "TelephoneKeypad:Orientation";
|
|
262
|
-
var TelephoneKeypad = (0, import_react7.memo)(({ autoFocus, onButtonClick, isHorizontal }) => {
|
|
215
|
+
var TelephoneKeypad = (0, import_react7.memo)(({ autoFocus, className, onButtonClick, isHorizontal }) => {
|
|
263
216
|
const autoFocusRef = (0, import_use_ref_from2.useRefFrom)(autoFocus);
|
|
264
|
-
const classNames =
|
|
217
|
+
const classNames = useStyles_default(TelephoneKeypad_default);
|
|
265
218
|
const firstButtonRef = (0, import_react7.useRef)(null);
|
|
266
219
|
const onButtonClickRef = (0, import_use_ref_from2.useRefFrom)(onButtonClick);
|
|
267
220
|
const [, setShown] = useShown();
|
|
@@ -288,8 +241,8 @@ var TelephoneKeypad = (0, import_react7.memo)(({ autoFocus, onButtonClick, isHor
|
|
|
288
241
|
(0, import_react7.useEffect)(() => {
|
|
289
242
|
autoFocusRef.current && firstButtonRef.current?.focus();
|
|
290
243
|
}, [autoFocusRef, firstButtonRef]);
|
|
291
|
-
return /* @__PURE__ */ import_react7.default.createElement("div", { className: classNames["
|
|
292
|
-
|
|
244
|
+
return /* @__PURE__ */ import_react7.default.createElement("div", { className: (0, import_classnames.default)(classNames["telephone-keypad"], className), onKeyDown: handleKeyDown }, /* @__PURE__ */ import_react7.default.createElement(Orientation, { isHorizontal }, /* @__PURE__ */ import_react7.default.createElement(
|
|
245
|
+
Button_default2,
|
|
293
246
|
{
|
|
294
247
|
button: "1",
|
|
295
248
|
"data-testid": testIds_default.sendBoxTelephoneKeypadButton1,
|
|
@@ -297,7 +250,7 @@ var TelephoneKeypad = (0, import_react7.memo)(({ autoFocus, onButtonClick, isHor
|
|
|
297
250
|
ref: firstButtonRef
|
|
298
251
|
}
|
|
299
252
|
), /* @__PURE__ */ import_react7.default.createElement(
|
|
300
|
-
|
|
253
|
+
Button_default2,
|
|
301
254
|
{
|
|
302
255
|
button: "2",
|
|
303
256
|
"data-testid": testIds_default.sendBoxTelephoneKeypadButton2,
|
|
@@ -305,7 +258,7 @@ var TelephoneKeypad = (0, import_react7.memo)(({ autoFocus, onButtonClick, isHor
|
|
|
305
258
|
ruby: "ABC"
|
|
306
259
|
}
|
|
307
260
|
), /* @__PURE__ */ import_react7.default.createElement(
|
|
308
|
-
|
|
261
|
+
Button_default2,
|
|
309
262
|
{
|
|
310
263
|
button: "3",
|
|
311
264
|
"data-testid": testIds_default.sendBoxTelephoneKeypadButton3,
|
|
@@ -313,7 +266,7 @@ var TelephoneKeypad = (0, import_react7.memo)(({ autoFocus, onButtonClick, isHor
|
|
|
313
266
|
ruby: "DEF"
|
|
314
267
|
}
|
|
315
268
|
), /* @__PURE__ */ import_react7.default.createElement(
|
|
316
|
-
|
|
269
|
+
Button_default2,
|
|
317
270
|
{
|
|
318
271
|
button: "4",
|
|
319
272
|
"data-testid": testIds_default.sendBoxTelephoneKeypadButton4,
|
|
@@ -321,7 +274,7 @@ var TelephoneKeypad = (0, import_react7.memo)(({ autoFocus, onButtonClick, isHor
|
|
|
321
274
|
ruby: "GHI"
|
|
322
275
|
}
|
|
323
276
|
), /* @__PURE__ */ import_react7.default.createElement(
|
|
324
|
-
|
|
277
|
+
Button_default2,
|
|
325
278
|
{
|
|
326
279
|
button: "5",
|
|
327
280
|
"data-testid": testIds_default.sendBoxTelephoneKeypadButton5,
|
|
@@ -329,7 +282,7 @@ var TelephoneKeypad = (0, import_react7.memo)(({ autoFocus, onButtonClick, isHor
|
|
|
329
282
|
ruby: "JKL"
|
|
330
283
|
}
|
|
331
284
|
), /* @__PURE__ */ import_react7.default.createElement(
|
|
332
|
-
|
|
285
|
+
Button_default2,
|
|
333
286
|
{
|
|
334
287
|
button: "6",
|
|
335
288
|
"data-testid": testIds_default.sendBoxTelephoneKeypadButton6,
|
|
@@ -337,7 +290,7 @@ var TelephoneKeypad = (0, import_react7.memo)(({ autoFocus, onButtonClick, isHor
|
|
|
337
290
|
ruby: "MNO"
|
|
338
291
|
}
|
|
339
292
|
), /* @__PURE__ */ import_react7.default.createElement(
|
|
340
|
-
|
|
293
|
+
Button_default2,
|
|
341
294
|
{
|
|
342
295
|
button: "7",
|
|
343
296
|
"data-testid": testIds_default.sendBoxTelephoneKeypadButton7,
|
|
@@ -345,7 +298,7 @@ var TelephoneKeypad = (0, import_react7.memo)(({ autoFocus, onButtonClick, isHor
|
|
|
345
298
|
ruby: "PQRS"
|
|
346
299
|
}
|
|
347
300
|
), /* @__PURE__ */ import_react7.default.createElement(
|
|
348
|
-
|
|
301
|
+
Button_default2,
|
|
349
302
|
{
|
|
350
303
|
button: "8",
|
|
351
304
|
"data-testid": testIds_default.sendBoxTelephoneKeypadButton8,
|
|
@@ -353,86 +306,55 @@ var TelephoneKeypad = (0, import_react7.memo)(({ autoFocus, onButtonClick, isHor
|
|
|
353
306
|
ruby: "TUV"
|
|
354
307
|
}
|
|
355
308
|
), /* @__PURE__ */ import_react7.default.createElement(
|
|
356
|
-
|
|
309
|
+
Button_default2,
|
|
357
310
|
{
|
|
358
311
|
button: "9",
|
|
359
312
|
"data-testid": testIds_default.sendBoxTelephoneKeypadButton9,
|
|
360
313
|
onClick: handleButton9Click,
|
|
361
314
|
ruby: "WXYZ"
|
|
362
315
|
}
|
|
363
|
-
), /* @__PURE__ */ import_react7.default.createElement(
|
|
364
|
-
|
|
316
|
+
), /* @__PURE__ */ import_react7.default.createElement(Button_default2, { button: "star", "data-testid": testIds_default.sendBoxTelephoneKeypadButtonStar, onClick: handleButtonStarClick }), /* @__PURE__ */ import_react7.default.createElement(Button_default2, { button: "0", "data-testid": testIds_default.sendBoxTelephoneKeypadButton0, onClick: handleButton0Click, ruby: "+" }), /* @__PURE__ */ import_react7.default.createElement(
|
|
317
|
+
Button_default2,
|
|
365
318
|
{
|
|
366
319
|
button: "pound",
|
|
367
320
|
"data-testid": testIds_default.sendBoxTelephoneKeypadButtonPound,
|
|
368
321
|
onClick: handleButtonPoundClick
|
|
369
322
|
}
|
|
323
|
+
)), /* @__PURE__ */ import_react7.default.createElement("div", { className: classNames["telephone-keypad__info-message"] }, /* @__PURE__ */ import_react7.default.createElement(InfoSmallIcon_default, null), /* @__PURE__ */ import_react7.default.createElement(
|
|
324
|
+
LocalizedString,
|
|
325
|
+
{
|
|
326
|
+
linkClassName: classNames["telephone-keypad__info-message-link"],
|
|
327
|
+
stringIds: "TELEPHONE_KEYPAD_INPUT_MESSAGE"
|
|
328
|
+
}
|
|
370
329
|
)));
|
|
371
330
|
});
|
|
372
331
|
TelephoneKeypad.displayName = "TelephoneKeypad";
|
|
373
|
-
var
|
|
332
|
+
var TelephoneKeypad_default2 = TelephoneKeypad;
|
|
374
333
|
|
|
375
334
|
// src/components/telephoneKeypad/Surrogate.tsx
|
|
376
|
-
var TelephoneKeypadSurrogate = (0, import_react8.memo)((props) => useShown()[0] ? /* @__PURE__ */ import_react8.default.createElement(
|
|
335
|
+
var TelephoneKeypadSurrogate = (0, import_react8.memo)((props) => useShown()[0] ? /* @__PURE__ */ import_react8.default.createElement(TelephoneKeypad_default2, { ...props }) : false);
|
|
377
336
|
TelephoneKeypadSurrogate.displayName = "TelephoneKeypad.Surrogate";
|
|
378
337
|
var Surrogate_default = TelephoneKeypadSurrogate;
|
|
379
338
|
|
|
380
339
|
// src/components/Theme.tsx
|
|
381
340
|
var import_react9 = __toESM(require("react"));
|
|
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/theme/src/colors/FluentColors.ts
|
|
407
|
-
"--webchat-colorGray30": "var(--colorGray30, #edebe9)",
|
|
408
|
-
"--webchat-colorGray160": "var(--colorGray160, #323130)",
|
|
409
|
-
"--webchat-colorGray190": "var(--colorGray190, #201f1e)",
|
|
410
|
-
"--webchat-colorGray200": "var(--colorGray200, #1b1a19)",
|
|
411
|
-
// https://github.com/microsoft/fluentui/blob/master/packages/tokens/src/global/borderRadius.ts
|
|
412
|
-
"--webchat-borderRadiusSmall": "var(--borderRadiusSmall, 2px)",
|
|
413
|
-
"--webchat-borderRadiusLarge": "var(--borderRadiusLarge, 6px)",
|
|
414
|
-
"--webchat-borderRadiusXLarge": "var(--borderRadiusXLarge, 8px)",
|
|
415
|
-
// https://github.com/microsoft/fluentui/blob/master/packages/tokens/src/utils/shadows.ts
|
|
416
|
-
"--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))",
|
|
417
|
-
// https://github.com/microsoft/fluentui/blob/master/packages/tokens/src/global/spacings.ts
|
|
418
|
-
"--webchat-spacingHorizontalMNudge": "var(--spacingHorizontalMNudge, 10px)",
|
|
419
|
-
// https://github.com/microsoft/fluentui/blob/master/packages/tokens/src/global/fonts.ts
|
|
420
|
-
"--webchat-fontFamilyBase": `var(--fontFamilyBase, 'Segoe UI)', 'Segoe UI Web (West European))', -apple-system,
|
|
421
|
-
BlinkMacSystemFont, Roboto, 'Helvetica Neue)', sans-serif)`,
|
|
422
|
-
"--webchat-fontFamilyNumeric": `var(--fontFamilyNumeric, Bahnschrift, 'Segoe UI)', 'Segoe UI Web (West European))',
|
|
423
|
-
-apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue)', sans-serif)`,
|
|
424
|
-
// https://github.com/microsoft/fluentui/blob/master/packages/tokens/src/global/fonts.ts
|
|
425
|
-
"--webchat-fontWeightSemibold": "var(--fontWeightSemibold, 600)"
|
|
426
|
-
}
|
|
341
|
+
var import_classnames2 = __toESM(require("classnames"));
|
|
342
|
+
|
|
343
|
+
// src/components/Theme.module.css
|
|
344
|
+
var Theme_default = {
|
|
345
|
+
theme: "Theme_theme"
|
|
427
346
|
};
|
|
347
|
+
|
|
348
|
+
// src/components/Theme.tsx
|
|
349
|
+
var rootClassName = "webchat-fluent";
|
|
428
350
|
function WebchatTheme(props) {
|
|
429
|
-
const classNames =
|
|
430
|
-
return /* @__PURE__ */ import_react9.default.createElement("div", { className: classNames["
|
|
351
|
+
const classNames = useStyles_default(Theme_default);
|
|
352
|
+
return /* @__PURE__ */ import_react9.default.createElement("div", { className: (0, import_classnames2.default)(rootClassName, classNames["theme"]) }, props.children);
|
|
431
353
|
}
|
|
432
354
|
|
|
433
355
|
// src/components/sendbox/index.tsx
|
|
434
|
-
var
|
|
435
|
-
var
|
|
356
|
+
var import_botframework_webchat_component9 = require("botframework-webchat-component");
|
|
357
|
+
var import_classnames9 = __toESM(require("classnames"));
|
|
436
358
|
var import_react26 = __toESM(require("react"));
|
|
437
359
|
var import_use_ref_from6 = require("use-ref-from");
|
|
438
360
|
|
|
@@ -444,7 +366,6 @@ function SendIcon(props) {
|
|
|
444
366
|
{
|
|
445
367
|
"aria-hidden": "true",
|
|
446
368
|
className: props.className,
|
|
447
|
-
fill: "currentColor",
|
|
448
369
|
height: "1em",
|
|
449
370
|
viewBox: "0 0 20 20",
|
|
450
371
|
width: "1em",
|
|
@@ -461,8 +382,8 @@ function SendIcon(props) {
|
|
|
461
382
|
}
|
|
462
383
|
|
|
463
384
|
// src/components/dropZone/index.tsx
|
|
464
|
-
var
|
|
465
|
-
var
|
|
385
|
+
var import_botframework_webchat_component2 = require("botframework-webchat-component");
|
|
386
|
+
var import_classnames3 = __toESM(require("classnames"));
|
|
466
387
|
var import_react12 = __toESM(require("react"));
|
|
467
388
|
var import_use_ref_from3 = require("use-ref-from");
|
|
468
389
|
|
|
@@ -474,7 +395,6 @@ function AddDocumentIcon(props) {
|
|
|
474
395
|
{
|
|
475
396
|
"aria-hidden": "true",
|
|
476
397
|
className: props.className,
|
|
477
|
-
fill: "currentColor",
|
|
478
398
|
height: "1em",
|
|
479
399
|
viewBox: "0 0 20 20",
|
|
480
400
|
width: "1em",
|
|
@@ -490,31 +410,15 @@ function AddDocumentIcon(props) {
|
|
|
490
410
|
);
|
|
491
411
|
}
|
|
492
412
|
|
|
493
|
-
// src/components/dropZone/index.
|
|
494
|
-
var
|
|
495
|
-
|
|
496
|
-
"
|
|
497
|
-
|
|
498
|
-
borderRadius: "inherit",
|
|
499
|
-
cursor: "copy",
|
|
500
|
-
display: "grid",
|
|
501
|
-
gap: "8px",
|
|
502
|
-
inset: "0",
|
|
503
|
-
placeContent: "center",
|
|
504
|
-
placeItems: "center",
|
|
505
|
-
position: "absolute"
|
|
506
|
-
},
|
|
507
|
-
"webchat-fluent__sendbox__attachment-drop-zone--droppable": {
|
|
508
|
-
backgroundColor: "#e00",
|
|
509
|
-
color: "White"
|
|
510
|
-
},
|
|
511
|
-
"webchat-fluent__sendbox__attachment-drop-zone-icon": {
|
|
512
|
-
height: "36px",
|
|
513
|
-
// Set "pointer-events: none" to ignore dragging over the icon. Otherwise, when dragging over the icon, it would disable the "--droppable" modifier.
|
|
514
|
-
pointerEvents: "none",
|
|
515
|
-
width: "36px"
|
|
516
|
-
}
|
|
413
|
+
// src/components/dropZone/index.module.css
|
|
414
|
+
var dropZone_default = {
|
|
415
|
+
"sendbox__attachment-drop-zone": "dropZone_sendbox__attachment-drop-zone",
|
|
416
|
+
"sendbox__attachment-drop-zone--droppable": "dropZone_sendbox__attachment-drop-zone--droppable",
|
|
417
|
+
"sendbox__attachment-drop-zone-icon": "dropZone_sendbox__attachment-drop-zone-icon"
|
|
517
418
|
};
|
|
419
|
+
|
|
420
|
+
// src/components/dropZone/index.tsx
|
|
421
|
+
var { useLocalizer } = import_botframework_webchat_component2.hooks;
|
|
518
422
|
var handleDragOver = (event) => {
|
|
519
423
|
event.preventDefault();
|
|
520
424
|
};
|
|
@@ -531,7 +435,7 @@ function isDescendantOf(target, ancestor) {
|
|
|
531
435
|
}
|
|
532
436
|
var DropZone = (props) => {
|
|
533
437
|
const [dropZoneState, setDropZoneState] = (0, import_react12.useState)(false);
|
|
534
|
-
const classNames =
|
|
438
|
+
const classNames = useStyles_default(dropZone_default);
|
|
535
439
|
const dropZoneRef = (0, import_react12.useRef)(null);
|
|
536
440
|
const localize = useLocalizer();
|
|
537
441
|
const onFilesAddedRef = (0, import_use_ref_from3.useRefFrom)(props.onFilesAdded);
|
|
@@ -567,34 +471,40 @@ var DropZone = (props) => {
|
|
|
567
471
|
return dropZoneState ? /* @__PURE__ */ import_react12.default.createElement(
|
|
568
472
|
"div",
|
|
569
473
|
{
|
|
570
|
-
className: (0,
|
|
571
|
-
[classNames["
|
|
474
|
+
className: (0, import_classnames3.default)(classNames["sendbox__attachment-drop-zone"], {
|
|
475
|
+
[classNames["sendbox__attachment-drop-zone--droppable"]]: dropZoneState === "droppable"
|
|
572
476
|
}),
|
|
573
477
|
"data-testid": testIds_default.sendBoxDropZone,
|
|
574
478
|
onDragOver: handleDragOver,
|
|
575
479
|
onDrop: handleDrop,
|
|
576
480
|
ref: dropZoneRef
|
|
577
481
|
},
|
|
578
|
-
/* @__PURE__ */ import_react12.default.createElement(AddDocumentIcon, { className: classNames["
|
|
482
|
+
/* @__PURE__ */ import_react12.default.createElement(AddDocumentIcon, { className: classNames["sendbox__attachment-drop-zone-icon"] }),
|
|
579
483
|
localize("TEXT_INPUT_DROP_ZONE")
|
|
580
484
|
) : null;
|
|
581
485
|
};
|
|
582
486
|
DropZone.displayName = "DropZone";
|
|
583
|
-
var
|
|
487
|
+
var dropZone_default2 = (0, import_react12.memo)(DropZone);
|
|
584
488
|
|
|
585
489
|
// src/components/DropZone.tsx
|
|
586
|
-
var DropZone_default =
|
|
490
|
+
var DropZone_default = dropZone_default2;
|
|
587
491
|
|
|
588
492
|
// src/components/suggestedActions/index.tsx
|
|
589
|
-
var
|
|
590
|
-
var
|
|
493
|
+
var import_botframework_webchat_component4 = require("botframework-webchat-component");
|
|
494
|
+
var import_classnames5 = __toESM(require("classnames"));
|
|
591
495
|
var import_react15 = __toESM(require("react"));
|
|
592
496
|
|
|
593
497
|
// src/components/suggestedActions/SuggestedAction.tsx
|
|
594
|
-
var
|
|
595
|
-
var
|
|
498
|
+
var import_botframework_webchat_component3 = require("botframework-webchat-component");
|
|
499
|
+
var import_classnames4 = __toESM(require("classnames"));
|
|
596
500
|
var import_react14 = __toESM(require("react"));
|
|
597
501
|
|
|
502
|
+
// src/components/suggestedActions/SuggestedAction.module.css
|
|
503
|
+
var SuggestedAction_default = {
|
|
504
|
+
"suggested-action": "SuggestedAction_suggested-action",
|
|
505
|
+
"suggested-action__image": "SuggestedAction_suggested-action__image"
|
|
506
|
+
};
|
|
507
|
+
|
|
598
508
|
// src/components/suggestedActions/AccessibleButton.tsx
|
|
599
509
|
var import_react13 = __toESM(require("react"));
|
|
600
510
|
var preventDefaultHandler = (event) => event.preventDefault();
|
|
@@ -624,39 +534,7 @@ var AccessibleButton = (0, import_react13.forwardRef)(
|
|
|
624
534
|
var AccessibleButton_default = (0, import_react13.memo)(AccessibleButton);
|
|
625
535
|
|
|
626
536
|
// src/components/suggestedActions/SuggestedAction.tsx
|
|
627
|
-
var { useDisabled, useFocus, usePerformCardAction, useScrollToEnd, useStyleSet, useSuggestedActions } =
|
|
628
|
-
var styles5 = {
|
|
629
|
-
"webchat-fluent__suggested-action": {
|
|
630
|
-
alignItems: "center",
|
|
631
|
-
background: "transparent",
|
|
632
|
-
border: "1px solid var(--webchat-colorBrandStroke2)",
|
|
633
|
-
borderRadius: "8px",
|
|
634
|
-
cursor: "pointer",
|
|
635
|
-
display: "flex",
|
|
636
|
-
fontSize: "12px",
|
|
637
|
-
gap: "4px",
|
|
638
|
-
padding: "4px 8px 4px",
|
|
639
|
-
textAlign: "start",
|
|
640
|
-
transition: "all .15s ease-out",
|
|
641
|
-
"@media (hover: hover)": {
|
|
642
|
-
'&:not([aria-disabled="true"]):hover': {
|
|
643
|
-
backgroundColor: "var(--webchat-colorBrandBackground2Hover)",
|
|
644
|
-
color: "var(--webchat-colorBrandForeground2Hover)"
|
|
645
|
-
}
|
|
646
|
-
},
|
|
647
|
-
'&:not([aria-disabled="true"]):active': {
|
|
648
|
-
backgroundColor: "var(--webchat-colorBrandBackground2Pressed)",
|
|
649
|
-
color: "var(--webchat-colorBrandForeground2Pressed)"
|
|
650
|
-
},
|
|
651
|
-
'&[aria-disabled="true"]': {
|
|
652
|
-
color: "var(--webchat-colorNeutralForegroundDisabled)",
|
|
653
|
-
cursor: "not-allowed"
|
|
654
|
-
}
|
|
655
|
-
},
|
|
656
|
-
"webchat-fluent__suggested-action__image": {
|
|
657
|
-
height: "12px"
|
|
658
|
-
}
|
|
659
|
-
};
|
|
537
|
+
var { useDisabled, useFocus, usePerformCardAction, useScrollToEnd, useStyleSet, useSuggestedActions } = import_botframework_webchat_component3.hooks;
|
|
660
538
|
function SuggestedAction({
|
|
661
539
|
buttonText,
|
|
662
540
|
className,
|
|
@@ -673,7 +551,7 @@ function SuggestedAction({
|
|
|
673
551
|
const focus = useFocus();
|
|
674
552
|
const focusRef = (0, import_react14.useRef)(null);
|
|
675
553
|
const performCardAction = usePerformCardAction();
|
|
676
|
-
const classNames =
|
|
554
|
+
const classNames = useStyles_default(SuggestedAction_default);
|
|
677
555
|
const scrollToEnd = useScrollToEnd();
|
|
678
556
|
const handleClick = (0, import_react14.useCallback)(
|
|
679
557
|
({ target }) => {
|
|
@@ -689,21 +567,17 @@ function SuggestedAction({
|
|
|
689
567
|
return /* @__PURE__ */ import_react14.default.createElement(
|
|
690
568
|
AccessibleButton_default,
|
|
691
569
|
{
|
|
692
|
-
className: (0,
|
|
693
|
-
classNames["webchat-fluent__suggested-action"],
|
|
694
|
-
suggestedActionStyleSet + "",
|
|
695
|
-
(className || "") + ""
|
|
696
|
-
),
|
|
570
|
+
className: (0, import_classnames4.default)(classNames["suggested-action"], suggestedActionStyleSet + "", (className || "") + ""),
|
|
697
571
|
disabled,
|
|
698
572
|
onClick: handleClick,
|
|
699
573
|
ref: focusRef,
|
|
700
574
|
type: "button"
|
|
701
575
|
},
|
|
702
|
-
image && /* @__PURE__ */ import_react14.default.createElement("img", { alt: imageAlt, className: classNames["
|
|
576
|
+
image && /* @__PURE__ */ import_react14.default.createElement("img", { alt: imageAlt, className: classNames["suggested-action__image"], src: image }),
|
|
703
577
|
/* @__PURE__ */ import_react14.default.createElement("span", null, buttonText)
|
|
704
578
|
);
|
|
705
579
|
}
|
|
706
|
-
var
|
|
580
|
+
var SuggestedAction_default2 = (0, import_react14.memo)(SuggestedAction);
|
|
707
581
|
|
|
708
582
|
// src/components/suggestedActions/private/computeSuggestedActionText.ts
|
|
709
583
|
function computeSuggestedActionText(cardAction) {
|
|
@@ -719,44 +593,31 @@ function computeSuggestedActionText(cardAction) {
|
|
|
719
593
|
return JSON.stringify(value);
|
|
720
594
|
}
|
|
721
595
|
|
|
722
|
-
// src/components/suggestedActions/index.
|
|
723
|
-
var
|
|
724
|
-
|
|
725
|
-
"
|
|
726
|
-
|
|
727
|
-
alignSelf: "flex-end",
|
|
728
|
-
display: "flex",
|
|
729
|
-
gap: "8px",
|
|
730
|
-
"&:not(:empty)": {
|
|
731
|
-
paddingBlockEnd: "8px",
|
|
732
|
-
paddingInlineStart: "4px"
|
|
733
|
-
},
|
|
734
|
-
"&.webchat-fluent__suggested-actions--flow": {
|
|
735
|
-
flexDirection: "row",
|
|
736
|
-
flexWrap: "wrap",
|
|
737
|
-
justifyContent: "flex-end"
|
|
738
|
-
},
|
|
739
|
-
"&.webchat-fluent__suggested-actions--stacked": {
|
|
740
|
-
flexDirection: "column"
|
|
741
|
-
}
|
|
742
|
-
}
|
|
596
|
+
// src/components/suggestedActions/index.module.css
|
|
597
|
+
var suggestedActions_default = {
|
|
598
|
+
"suggested-actions": "suggestedActions_suggested-actions",
|
|
599
|
+
"suggested-actions--flow": "suggestedActions_suggested-actions--flow",
|
|
600
|
+
"suggested-actions--stacked": "suggestedActions_suggested-actions--stacked"
|
|
743
601
|
};
|
|
602
|
+
|
|
603
|
+
// src/components/suggestedActions/index.tsx
|
|
604
|
+
var { useLocalizer: useLocalizer2, useStyleOptions, useStyleSet: useStyleSet2, useSuggestedActions: useSuggestedActions2 } = import_botframework_webchat_component4.hooks;
|
|
744
605
|
function SuggestedActionStackedOrFlowContainer(props) {
|
|
745
606
|
const [{ suggestedActionLayout }] = useStyleOptions();
|
|
746
607
|
const [{ suggestedActions: suggestedActionsStyleSet }] = useStyleSet2();
|
|
747
|
-
const classNames =
|
|
608
|
+
const classNames = useStyles_default(suggestedActions_default);
|
|
748
609
|
return /* @__PURE__ */ import_react15.default.createElement(
|
|
749
610
|
"div",
|
|
750
611
|
{
|
|
751
612
|
"aria-label": props["aria-label"],
|
|
752
613
|
"aria-live": "polite",
|
|
753
614
|
"aria-orientation": "vertical",
|
|
754
|
-
className: (0,
|
|
755
|
-
classNames["
|
|
615
|
+
className: (0, import_classnames5.default)(
|
|
616
|
+
classNames["suggested-actions"],
|
|
756
617
|
suggestedActionsStyleSet + "",
|
|
757
618
|
{
|
|
758
|
-
"
|
|
759
|
-
"
|
|
619
|
+
[classNames["suggested-actions--flow"]]: suggestedActionLayout === "flow",
|
|
620
|
+
[classNames["suggested-actions--stacked"]]: suggestedActionLayout !== "flow"
|
|
760
621
|
},
|
|
761
622
|
props.className
|
|
762
623
|
),
|
|
@@ -766,7 +627,7 @@ function SuggestedActionStackedOrFlowContainer(props) {
|
|
|
766
627
|
);
|
|
767
628
|
}
|
|
768
629
|
function SuggestedActions() {
|
|
769
|
-
const classNames =
|
|
630
|
+
const classNames = useStyles_default(suggestedActions_default);
|
|
770
631
|
const localize = useLocalizer2();
|
|
771
632
|
const [suggestedActions] = useSuggestedActions2();
|
|
772
633
|
const children = suggestedActions.map((cardAction, index) => {
|
|
@@ -775,7 +636,7 @@ function SuggestedActions() {
|
|
|
775
636
|
return null;
|
|
776
637
|
}
|
|
777
638
|
return /* @__PURE__ */ import_react15.default.createElement(
|
|
778
|
-
|
|
639
|
+
SuggestedAction_default2,
|
|
779
640
|
{
|
|
780
641
|
buttonText: computeSuggestedActionText(cardAction),
|
|
781
642
|
displayText,
|
|
@@ -793,18 +654,18 @@ function SuggestedActions() {
|
|
|
793
654
|
SuggestedActionStackedOrFlowContainer,
|
|
794
655
|
{
|
|
795
656
|
"aria-label": localize("SUGGESTED_ACTIONS_LABEL_ALT"),
|
|
796
|
-
className: classNames["
|
|
657
|
+
className: classNames["suggested-actions"]
|
|
797
658
|
},
|
|
798
659
|
children
|
|
799
660
|
);
|
|
800
661
|
}
|
|
801
|
-
var
|
|
662
|
+
var suggestedActions_default2 = (0, import_react15.memo)(SuggestedActions);
|
|
802
663
|
|
|
803
664
|
// src/components/SuggestedActions.tsx
|
|
804
|
-
var SuggestedActions_default =
|
|
665
|
+
var SuggestedActions_default = suggestedActions_default2;
|
|
805
666
|
|
|
806
667
|
// src/components/sendbox/AddAttachmentButton.tsx
|
|
807
|
-
var
|
|
668
|
+
var import_botframework_webchat_component5 = require("botframework-webchat-component");
|
|
808
669
|
var import_react18 = __toESM(require("react"));
|
|
809
670
|
var import_use_ref_from4 = require("use-ref-from");
|
|
810
671
|
|
|
@@ -816,7 +677,6 @@ function AttachmentIcon(props) {
|
|
|
816
677
|
{
|
|
817
678
|
"aria-hidden": "true",
|
|
818
679
|
className: props.className,
|
|
819
|
-
fill: "currentColor",
|
|
820
680
|
height: "1em",
|
|
821
681
|
viewBox: "0 0 20 20",
|
|
822
682
|
width: "1em",
|
|
@@ -833,63 +693,29 @@ function AttachmentIcon(props) {
|
|
|
833
693
|
}
|
|
834
694
|
|
|
835
695
|
// src/components/sendbox/Toolbar.tsx
|
|
836
|
-
var
|
|
696
|
+
var import_classnames6 = __toESM(require("classnames"));
|
|
837
697
|
var import_react17 = __toESM(require("react"));
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
"
|
|
845
|
-
alignItems: "center",
|
|
846
|
-
appearance: "none",
|
|
847
|
-
aspectRatio: "1",
|
|
848
|
-
background: "transparent",
|
|
849
|
-
border: "none",
|
|
850
|
-
borderRadius: "var(--webchat-borderRadiusSmall)",
|
|
851
|
-
cursor: "pointer",
|
|
852
|
-
display: "flex",
|
|
853
|
-
justifyContent: "center",
|
|
854
|
-
padding: "3px",
|
|
855
|
-
width: "32px",
|
|
856
|
-
"> svg": {
|
|
857
|
-
fontSize: "20px",
|
|
858
|
-
pointerEvents: "none"
|
|
859
|
-
},
|
|
860
|
-
"@media (hover: hover)": {
|
|
861
|
-
'&:not([aria-disabled="true"]):hover': {
|
|
862
|
-
backgroundColor: "var(--webchat-colorSubtleBackgroundHover)",
|
|
863
|
-
color: "var(--webchat-colorCompoundBrandForeground1Hover)"
|
|
864
|
-
}
|
|
865
|
-
},
|
|
866
|
-
'&:not([aria-disabled="true"]):active': {
|
|
867
|
-
backgroundColor: "var(--webchat-colorSubtleBackgroundPressed)",
|
|
868
|
-
color: "var(--webchat-colorCompoundBrandForeground1Pressed)"
|
|
869
|
-
},
|
|
870
|
-
'&[aria-disabled="true"]': {
|
|
871
|
-
color: "var(--webchat-colorNeutralForegroundDisabled)",
|
|
872
|
-
cursor: "not-allowed"
|
|
873
|
-
}
|
|
874
|
-
},
|
|
875
|
-
"webchat-fluent__sendbox__toolbar-separator": {
|
|
876
|
-
alignSelf: "center",
|
|
877
|
-
borderInlineEnd: "1px solid var(--webchat-colorNeutralStroke2)",
|
|
878
|
-
height: "28px",
|
|
879
|
-
"&:first-child, &:last-child, &:only-child": {
|
|
880
|
-
display: "none"
|
|
881
|
-
}
|
|
882
|
-
}
|
|
698
|
+
|
|
699
|
+
// src/components/sendbox/Toolbar.module.css
|
|
700
|
+
var Toolbar_default = {
|
|
701
|
+
sendbox__toolbar: "Toolbar_sendbox__toolbar",
|
|
702
|
+
"sendbox__toolbar-button": "Toolbar_sendbox__toolbar-button",
|
|
703
|
+
"sendbox__toolbar-button--selected": "Toolbar_sendbox__toolbar-button--selected",
|
|
704
|
+
"sendbox__toolbar-separator": "Toolbar_sendbox__toolbar-separator"
|
|
883
705
|
};
|
|
706
|
+
|
|
707
|
+
// src/components/sendbox/Toolbar.tsx
|
|
884
708
|
var preventDefaultHandler2 = (event) => event.preventDefault();
|
|
885
709
|
var ToolbarButton = (0, import_react17.memo)(
|
|
886
710
|
(props) => {
|
|
887
|
-
const classNames =
|
|
711
|
+
const classNames = useStyles_default(Toolbar_default);
|
|
888
712
|
return /* @__PURE__ */ import_react17.default.createElement(
|
|
889
713
|
"button",
|
|
890
714
|
{
|
|
891
715
|
"aria-label": props["aria-label"],
|
|
892
|
-
className: (0,
|
|
716
|
+
className: (0, import_classnames6.default)(classNames["sendbox__toolbar-button"], props.className, {
|
|
717
|
+
[classNames["sendbox__toolbar-button--selected"]]: props.selected
|
|
718
|
+
}),
|
|
893
719
|
"data-testid": props["data-testid"],
|
|
894
720
|
onClick: props.disabled ? preventDefaultHandler2 : props.onClick,
|
|
895
721
|
type: props.type === "submit" ? "submit" : "button",
|
|
@@ -904,18 +730,18 @@ var ToolbarButton = (0, import_react17.memo)(
|
|
|
904
730
|
);
|
|
905
731
|
ToolbarButton.displayName = "ToolbarButton";
|
|
906
732
|
var Toolbar = (0, import_react17.memo)((props) => {
|
|
907
|
-
const classNames =
|
|
908
|
-
return /* @__PURE__ */ import_react17.default.createElement("div", { className: (0,
|
|
733
|
+
const classNames = useStyles_default(Toolbar_default);
|
|
734
|
+
return /* @__PURE__ */ import_react17.default.createElement("div", { className: (0, import_classnames6.default)(classNames["sendbox__toolbar"], props.className) }, props.children);
|
|
909
735
|
});
|
|
910
736
|
Toolbar.displayName = "Toolbar";
|
|
911
737
|
var ToolbarSeparator = (0, import_react17.memo)(
|
|
912
738
|
(props) => {
|
|
913
|
-
const classNames =
|
|
739
|
+
const classNames = useStyles_default(Toolbar_default);
|
|
914
740
|
return /* @__PURE__ */ import_react17.default.createElement(
|
|
915
741
|
"div",
|
|
916
742
|
{
|
|
917
743
|
"aria-orientation": "vertical",
|
|
918
|
-
className: (0,
|
|
744
|
+
className: (0, import_classnames6.default)(classNames["sendbox__toolbar-separator"], props.className),
|
|
919
745
|
role: "separator"
|
|
920
746
|
}
|
|
921
747
|
);
|
|
@@ -923,22 +749,17 @@ var ToolbarSeparator = (0, import_react17.memo)(
|
|
|
923
749
|
);
|
|
924
750
|
ToolbarSeparator.displayName = "ToolbarSeparator";
|
|
925
751
|
|
|
926
|
-
// src/components/sendbox/AddAttachmentButton.
|
|
927
|
-
var
|
|
928
|
-
|
|
929
|
-
"
|
|
930
|
-
display: "grid"
|
|
931
|
-
},
|
|
932
|
-
"webchat-fluent__sendbox__add-attachment-input": {
|
|
933
|
-
fontSize: 0,
|
|
934
|
-
height: 0,
|
|
935
|
-
opacity: 0,
|
|
936
|
-
width: 0
|
|
937
|
-
}
|
|
752
|
+
// src/components/sendbox/AddAttachmentButton.module.css
|
|
753
|
+
var AddAttachmentButton_default = {
|
|
754
|
+
"sendbox__add-attachment": "AddAttachmentButton_sendbox__add-attachment",
|
|
755
|
+
"sendbox__add-attachment-input": "AddAttachmentButton_sendbox__add-attachment-input"
|
|
938
756
|
};
|
|
757
|
+
|
|
758
|
+
// src/components/sendbox/AddAttachmentButton.tsx
|
|
759
|
+
var { useLocalizer: useLocalizer3, useStyleOptions: useStyleOptions2 } = import_botframework_webchat_component5.hooks;
|
|
939
760
|
function AddAttachmentButton(props) {
|
|
940
761
|
const inputRef = (0, import_react18.useRef)(null);
|
|
941
|
-
const classNames =
|
|
762
|
+
const classNames = useStyles_default(AddAttachmentButton_default);
|
|
942
763
|
const localize = useLocalizer3();
|
|
943
764
|
const [{ uploadAccept, uploadMultiple }] = useStyleOptions2();
|
|
944
765
|
const onFilesAddedRef = (0, import_use_ref_from4.useRefFrom)(props.onFilesAdded);
|
|
@@ -954,13 +775,13 @@ function AddAttachmentButton(props) {
|
|
|
954
775
|
},
|
|
955
776
|
[inputRef, onFilesAddedRef]
|
|
956
777
|
);
|
|
957
|
-
return /* @__PURE__ */ import_react18.default.createElement("div", { className: classNames["
|
|
778
|
+
return /* @__PURE__ */ import_react18.default.createElement("div", { className: classNames["sendbox__add-attachment"] }, /* @__PURE__ */ import_react18.default.createElement(
|
|
958
779
|
"input",
|
|
959
780
|
{
|
|
960
781
|
accept: uploadAccept,
|
|
961
782
|
"aria-disabled": props.disabled,
|
|
962
783
|
"aria-hidden": "true",
|
|
963
|
-
className: classNames["
|
|
784
|
+
className: classNames["sendbox__add-attachment-input"],
|
|
964
785
|
multiple: uploadMultiple,
|
|
965
786
|
onInput: props.disabled ? void 0 : handleFileChange,
|
|
966
787
|
readOnly: props.disabled,
|
|
@@ -979,21 +800,20 @@ function AddAttachmentButton(props) {
|
|
|
979
800
|
/* @__PURE__ */ import_react18.default.createElement(AttachmentIcon, null)
|
|
980
801
|
));
|
|
981
802
|
}
|
|
982
|
-
var
|
|
803
|
+
var AddAttachmentButton_default2 = (0, import_react18.memo)(AddAttachmentButton);
|
|
983
804
|
|
|
984
805
|
// src/components/sendbox/Attachments.tsx
|
|
985
|
-
var
|
|
806
|
+
var import_botframework_webchat_component6 = require("botframework-webchat-component");
|
|
986
807
|
var import_react19 = __toESM(require("react"));
|
|
987
|
-
var
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
cursor: "default",
|
|
993
|
-
padding: "6px 8px",
|
|
994
|
-
width: "fit-content"
|
|
995
|
-
}
|
|
808
|
+
var import_classnames7 = __toESM(require("classnames"));
|
|
809
|
+
|
|
810
|
+
// src/components/sendbox/Attachments.module.css
|
|
811
|
+
var Attachments_default = {
|
|
812
|
+
sendbox__attachment: "Attachments_sendbox__attachment"
|
|
996
813
|
};
|
|
814
|
+
|
|
815
|
+
// src/components/sendbox/Attachments.tsx
|
|
816
|
+
var { useLocalizer: useLocalizer4 } = import_botframework_webchat_component6.hooks;
|
|
997
817
|
var attachmentsPluralStringIds = {
|
|
998
818
|
one: "TEXT_INPUT_ATTACHMENTS_ONE",
|
|
999
819
|
two: "TEXT_INPUT_ATTACHMENTS_TWO",
|
|
@@ -1002,39 +822,36 @@ var attachmentsPluralStringIds = {
|
|
|
1002
822
|
other: "TEXT_INPUT_ATTACHMENTS_OTHER"
|
|
1003
823
|
};
|
|
1004
824
|
function Attachments({
|
|
1005
|
-
attachments
|
|
825
|
+
attachments,
|
|
826
|
+
className
|
|
1006
827
|
}) {
|
|
1007
|
-
const classNames =
|
|
828
|
+
const classNames = useStyles_default(Attachments_default);
|
|
1008
829
|
const localizeWithPlural = useLocalizer4({ plural: true });
|
|
1009
|
-
return attachments.length ? /* @__PURE__ */ import_react19.default.createElement("div", { className: classNames["
|
|
830
|
+
return attachments.length ? /* @__PURE__ */ import_react19.default.createElement("div", { className: (0, import_classnames7.default)(classNames["sendbox__attachment"], className) }, localizeWithPlural(attachmentsPluralStringIds, attachments.length)) : null;
|
|
1010
831
|
}
|
|
1011
|
-
var
|
|
832
|
+
var Attachments_default2 = (0, import_react19.memo)(Attachments);
|
|
1012
833
|
|
|
1013
834
|
// src/components/sendbox/ErrorMessage.tsx
|
|
1014
835
|
var import_react20 = __toESM(require("react"));
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
width: 0,
|
|
1020
|
-
position: "absolute",
|
|
1021
|
-
top: 0,
|
|
1022
|
-
left: 0,
|
|
1023
|
-
color: "transparent"
|
|
1024
|
-
}
|
|
836
|
+
|
|
837
|
+
// src/components/sendbox/ErrorMessage.module.css
|
|
838
|
+
var ErrorMessage_default = {
|
|
839
|
+
"sendbox__error-message": "ErrorMessage_sendbox__error-message"
|
|
1025
840
|
};
|
|
841
|
+
|
|
842
|
+
// src/components/sendbox/ErrorMessage.tsx
|
|
1026
843
|
function ErrorMessage(props) {
|
|
1027
|
-
const classNames =
|
|
844
|
+
const classNames = useStyles_default(ErrorMessage_default);
|
|
1028
845
|
return (
|
|
1029
846
|
// eslint-disable-next-line react/forbid-dom-props
|
|
1030
|
-
/* @__PURE__ */ import_react20.default.createElement("span", { className: classNames["
|
|
847
|
+
/* @__PURE__ */ import_react20.default.createElement("span", { className: classNames["sendbox__error-message"], id: props.id, role: "alert" }, props.error)
|
|
1031
848
|
);
|
|
1032
849
|
}
|
|
1033
|
-
var
|
|
850
|
+
var ErrorMessage_default2 = (0, import_react20.memo)(ErrorMessage);
|
|
1034
851
|
|
|
1035
852
|
// src/components/sendbox/TelephoneKeypadToolbarButton.tsx
|
|
1036
853
|
var import_react22 = __toESM(require("react"));
|
|
1037
|
-
var
|
|
854
|
+
var import_botframework_webchat_component7 = require("botframework-webchat-component");
|
|
1038
855
|
|
|
1039
856
|
// src/icons/TelephoneKeypad.tsx
|
|
1040
857
|
var import_react21 = __toESM(require("react"));
|
|
@@ -1044,7 +861,6 @@ function TelephoneKeypadIcon(props) {
|
|
|
1044
861
|
{
|
|
1045
862
|
"aria-hidden": "true",
|
|
1046
863
|
className: props.className,
|
|
1047
|
-
fill: "currentColor",
|
|
1048
864
|
height: "1em",
|
|
1049
865
|
viewBox: "0 0 20 20",
|
|
1050
866
|
width: "1em",
|
|
@@ -1061,9 +877,9 @@ function TelephoneKeypadIcon(props) {
|
|
|
1061
877
|
}
|
|
1062
878
|
|
|
1063
879
|
// src/components/sendbox/TelephoneKeypadToolbarButton.tsx
|
|
1064
|
-
var { useLocalizer: useLocalizer5 } =
|
|
880
|
+
var { useLocalizer: useLocalizer5 } = import_botframework_webchat_component7.hooks;
|
|
1065
881
|
var TelephoneKeypadToolbarButton = (0, import_react22.memo)(() => {
|
|
1066
|
-
const [, setTelephoneKeypadShown] = useShown();
|
|
882
|
+
const [telephoneKeypadShown, setTelephoneKeypadShown] = useShown();
|
|
1067
883
|
const localize = useLocalizer5();
|
|
1068
884
|
const handleClick = (0, import_react22.useCallback)(() => setTelephoneKeypadShown((shown) => !shown), [setTelephoneKeypadShown]);
|
|
1069
885
|
return /* @__PURE__ */ import_react22.default.createElement(
|
|
@@ -1071,7 +887,8 @@ var TelephoneKeypadToolbarButton = (0, import_react22.memo)(() => {
|
|
|
1071
887
|
{
|
|
1072
888
|
"aria-label": localize("TEXT_INPUT_TELEPHONE_KEYPAD_BUTTON_ALT"),
|
|
1073
889
|
"data-testid": testIds_default.sendBoxTelephoneKeypadToolbarButton,
|
|
1074
|
-
onClick: handleClick
|
|
890
|
+
onClick: handleClick,
|
|
891
|
+
selected: telephoneKeypadShown
|
|
1075
892
|
},
|
|
1076
893
|
/* @__PURE__ */ import_react22.default.createElement(TelephoneKeypadIcon, null)
|
|
1077
894
|
);
|
|
@@ -1080,61 +897,22 @@ TelephoneKeypadToolbarButton.displayName = "SendBox.TelephoneKeypadToolbarButton
|
|
|
1080
897
|
var TelephoneKeypadToolbarButton_default = TelephoneKeypadToolbarButton;
|
|
1081
898
|
|
|
1082
899
|
// src/components/sendbox/TextArea.tsx
|
|
1083
|
-
var
|
|
900
|
+
var import_classnames8 = __toESM(require("classnames"));
|
|
1084
901
|
var import_react23 = __toESM(require("react"));
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
"
|
|
1093
|
-
|
|
1094
|
-
height: 0,
|
|
1095
|
-
visibility: "collapse"
|
|
1096
|
-
},
|
|
1097
|
-
"webchat-fluent__sendbox__text-area-shared": {
|
|
1098
|
-
border: "none",
|
|
1099
|
-
font: "inherit",
|
|
1100
|
-
gridArea: "main",
|
|
1101
|
-
outline: "inherit",
|
|
1102
|
-
overflowWrap: "anywhere",
|
|
1103
|
-
resize: "inherit",
|
|
1104
|
-
scrollbarGutter: "stable"
|
|
1105
|
-
},
|
|
1106
|
-
"webchat-fluent__sendbox__text-area-doppelganger": {
|
|
1107
|
-
overflow: "hidden",
|
|
1108
|
-
visibility: "hidden",
|
|
1109
|
-
whiteSpace: "pre-wrap"
|
|
1110
|
-
},
|
|
1111
|
-
"webchat-fluent__sendbox__text-area-input": {
|
|
1112
|
-
height: "100%",
|
|
1113
|
-
padding: 0
|
|
1114
|
-
},
|
|
1115
|
-
"webchat-fluent__sendbox__text-area-input--scroll": {
|
|
1116
|
-
/* Firefox */
|
|
1117
|
-
MozScrollbarColor: "var(--webchat-colorNeutralBackground5) var(--webchat-colorNeutralForeground2)",
|
|
1118
|
-
MozScrollbarWidth: "thin",
|
|
1119
|
-
/* Chrome, Edge, and Safari */
|
|
1120
|
-
"&::-webkit-scrollbar": {
|
|
1121
|
-
width: "8px"
|
|
1122
|
-
},
|
|
1123
|
-
"&::-webkit-scrollbar-track": {
|
|
1124
|
-
backgroundColor: "var(--webchat-colorNeutralBackground5)",
|
|
1125
|
-
borderRadius: "16px"
|
|
1126
|
-
},
|
|
1127
|
-
"&::-webkit-scrollbar-thumb": {
|
|
1128
|
-
backgroundColor: "var(--webchat-colorNeutralForeground2)",
|
|
1129
|
-
borderRadius: "16px"
|
|
1130
|
-
},
|
|
1131
|
-
"&::-webkit-scrollbar-corner": {
|
|
1132
|
-
backgroundColor: "var(--webchat-colorNeutralBackground5)"
|
|
1133
|
-
}
|
|
1134
|
-
}
|
|
902
|
+
|
|
903
|
+
// src/components/sendbox/TextArea.module.css
|
|
904
|
+
var TextArea_default = {
|
|
905
|
+
"sendbox__text-area": "TextArea_sendbox__text-area",
|
|
906
|
+
"sendbox__text-area--hidden": "TextArea_sendbox__text-area--hidden",
|
|
907
|
+
"sendbox__text-area-shared": "TextArea_sendbox__text-area-shared",
|
|
908
|
+
"sendbox__text-area-doppelganger": "TextArea_sendbox__text-area-doppelganger",
|
|
909
|
+
"sendbox__text-area-input": "TextArea_sendbox__text-area-input",
|
|
910
|
+
"sendbox__text-area-input--scroll": "TextArea_sendbox__text-area-input--scroll"
|
|
1135
911
|
};
|
|
912
|
+
|
|
913
|
+
// src/components/sendbox/TextArea.tsx
|
|
1136
914
|
var TextArea = (0, import_react23.forwardRef)((props, ref) => {
|
|
1137
|
-
const classNames =
|
|
915
|
+
const classNames = useStyles_default(TextArea_default);
|
|
1138
916
|
const handleKeyDown = (0, import_react23.useCallback)((event) => {
|
|
1139
917
|
if (!event.shiftKey && event.key === "Enter") {
|
|
1140
918
|
event.preventDefault();
|
|
@@ -1146,10 +924,10 @@ var TextArea = (0, import_react23.forwardRef)((props, ref) => {
|
|
|
1146
924
|
return /* @__PURE__ */ import_react23.default.createElement(
|
|
1147
925
|
"div",
|
|
1148
926
|
{
|
|
1149
|
-
className: (0,
|
|
1150
|
-
classNames["
|
|
927
|
+
className: (0, import_classnames8.default)(
|
|
928
|
+
classNames["sendbox__text-area"],
|
|
1151
929
|
{
|
|
1152
|
-
[classNames["
|
|
930
|
+
[classNames["sendbox__text-area--hidden"]]: props.hidden
|
|
1153
931
|
},
|
|
1154
932
|
props.className
|
|
1155
933
|
),
|
|
@@ -1158,10 +936,10 @@ var TextArea = (0, import_react23.forwardRef)((props, ref) => {
|
|
|
1158
936
|
/* @__PURE__ */ import_react23.default.createElement(
|
|
1159
937
|
"div",
|
|
1160
938
|
{
|
|
1161
|
-
className: (0,
|
|
1162
|
-
classNames["
|
|
1163
|
-
classNames["
|
|
1164
|
-
classNames["
|
|
939
|
+
className: (0, import_classnames8.default)(
|
|
940
|
+
classNames["sendbox__text-area-doppelganger"],
|
|
941
|
+
classNames["sendbox__text-area-shared"],
|
|
942
|
+
classNames["sendbox__text-area-input--scroll"]
|
|
1165
943
|
)
|
|
1166
944
|
},
|
|
1167
945
|
props.value || props.placeholder,
|
|
@@ -1171,10 +949,10 @@ var TextArea = (0, import_react23.forwardRef)((props, ref) => {
|
|
|
1171
949
|
"textarea",
|
|
1172
950
|
{
|
|
1173
951
|
"aria-label": props["aria-label"],
|
|
1174
|
-
className: (0,
|
|
1175
|
-
classNames["
|
|
1176
|
-
classNames["
|
|
1177
|
-
classNames["
|
|
952
|
+
className: (0, import_classnames8.default)(
|
|
953
|
+
classNames["sendbox__text-area-input"],
|
|
954
|
+
classNames["sendbox__text-area-shared"],
|
|
955
|
+
classNames["sendbox__text-area-input--scroll"]
|
|
1178
956
|
),
|
|
1179
957
|
"data-testid": props["data-testid"],
|
|
1180
958
|
onInput: props.onInput,
|
|
@@ -1189,13 +967,13 @@ var TextArea = (0, import_react23.forwardRef)((props, ref) => {
|
|
|
1189
967
|
);
|
|
1190
968
|
});
|
|
1191
969
|
TextArea.displayName = "TextArea";
|
|
1192
|
-
var
|
|
970
|
+
var TextArea_default2 = TextArea;
|
|
1193
971
|
|
|
1194
972
|
// src/components/sendbox/private/useSubmitError.ts
|
|
1195
|
-
var
|
|
973
|
+
var import_botframework_webchat_component8 = require("botframework-webchat-component");
|
|
1196
974
|
var import_react24 = require("react");
|
|
1197
975
|
var import_use_ref_from5 = require("use-ref-from");
|
|
1198
|
-
var { useConnectivityStatus, useLocalizer: useLocalizer6 } =
|
|
976
|
+
var { useConnectivityStatus, useLocalizer: useLocalizer6 } = import_botframework_webchat_component8.hooks;
|
|
1199
977
|
var useSubmitError = ({
|
|
1200
978
|
attachments,
|
|
1201
979
|
message
|
|
@@ -1226,73 +1004,33 @@ function useUniqueId(prefix) {
|
|
|
1226
1004
|
return `${prefix}${id}`;
|
|
1227
1005
|
}
|
|
1228
1006
|
|
|
1229
|
-
// src/components/sendbox/index.
|
|
1230
|
-
var
|
|
1231
|
-
|
|
1232
|
-
"
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
"
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
borderRadius: "var(--webchat-borderRadiusLarge)",
|
|
1242
|
-
display: "grid",
|
|
1243
|
-
fontFamily: "var(--webchat-fontFamilyBase)",
|
|
1244
|
-
fontSize: "14px",
|
|
1245
|
-
gap: "6px",
|
|
1246
|
-
lineHeight: "20px",
|
|
1247
|
-
padding: "8px",
|
|
1248
|
-
position: "relative",
|
|
1249
|
-
"&:focus-within": {
|
|
1250
|
-
borderColor: "var(--webchat-colorNeutralStroke1Selected)",
|
|
1251
|
-
// TODO clarify with design the color:
|
|
1252
|
-
// - Teams is using colorCompoundBrandForeground1
|
|
1253
|
-
// - Fluent is using colorCompoundBrandStroke
|
|
1254
|
-
// - we are using colorCompoundBrandForeground1Hover
|
|
1255
|
-
boxShadow: "inset 0 -6px 0 -3px var(--webchat-colorCompoundBrandForeground1Hover)"
|
|
1256
|
-
}
|
|
1257
|
-
},
|
|
1258
|
-
"webchat-fluent__sendbox__sendbox-text": {
|
|
1259
|
-
backgroundColor: "transparent",
|
|
1260
|
-
border: "none",
|
|
1261
|
-
flex: "auto",
|
|
1262
|
-
fontFamily: "var(--webchat-fontFamilyBase)",
|
|
1263
|
-
fontSize: "14px",
|
|
1264
|
-
lineHeight: "20px",
|
|
1265
|
-
outline: "none",
|
|
1266
|
-
padding: "4px 4px 0",
|
|
1267
|
-
resize: "none"
|
|
1268
|
-
},
|
|
1269
|
-
"webchat-fluent__sendbox__sendbox-controls": {
|
|
1270
|
-
alignItems: "center",
|
|
1271
|
-
display: "flex",
|
|
1272
|
-
paddingInlineStart: "4px"
|
|
1273
|
-
},
|
|
1274
|
-
"webchat-fluent__sendbox__text-counter": {
|
|
1275
|
-
color: "var(--webchat-colorNeutralForeground4)",
|
|
1276
|
-
cursor: "default",
|
|
1277
|
-
fontFamily: "var(--webchat-fontFamilyNumeric)",
|
|
1278
|
-
fontSize: "10px",
|
|
1279
|
-
lineHeight: "14px"
|
|
1280
|
-
},
|
|
1281
|
-
"webchat-fluent__sendbox__text-counter--error": {
|
|
1282
|
-
color: "var(--webchat-colorStatusDangerForeground1)"
|
|
1283
|
-
}
|
|
1007
|
+
// src/components/sendbox/index.module.css
|
|
1008
|
+
var sendbox_default = {
|
|
1009
|
+
sendbox: "sendbox_sendbox",
|
|
1010
|
+
sendbox__sendbox: "sendbox_sendbox__sendbox",
|
|
1011
|
+
"sendbox__attachment--in-grid": "sendbox_sendbox__attachment--in-grid",
|
|
1012
|
+
"sendbox__text-area--in-grid": "sendbox_sendbox__text-area--in-grid",
|
|
1013
|
+
"sendbox__sendbox-controls--in-grid": "sendbox_sendbox__sendbox-controls--in-grid",
|
|
1014
|
+
"sendbox__telephone-keypad--in-grid": "sendbox_sendbox__telephone-keypad--in-grid",
|
|
1015
|
+
"sendbox__sendbox-text": "sendbox_sendbox__sendbox-text",
|
|
1016
|
+
"sendbox__sendbox-controls": "sendbox_sendbox__sendbox-controls",
|
|
1017
|
+
"sendbox__text-counter": "sendbox_sendbox__text-counter",
|
|
1018
|
+
"sendbox__text-counter--error": "sendbox_sendbox__text-counter--error"
|
|
1284
1019
|
};
|
|
1020
|
+
|
|
1021
|
+
// src/components/sendbox/index.tsx
|
|
1022
|
+
var { useStyleOptions: useStyleOptions3, useMakeThumbnail, useLocalizer: useLocalizer7, useSendBoxAttachments, useSendMessage } = import_botframework_webchat_component9.hooks;
|
|
1285
1023
|
function SendBox(props) {
|
|
1286
1024
|
const inputRef = (0, import_react26.useRef)(null);
|
|
1287
1025
|
const [message, setMessage] = (0, import_react26.useState)("");
|
|
1288
1026
|
const [attachments, setAttachments] = useSendBoxAttachments();
|
|
1289
1027
|
const [{ hideTelephoneKeypadButton, hideUploadButton, maxMessageLength }] = useStyleOptions3();
|
|
1290
1028
|
const isMessageLengthExceeded = !!maxMessageLength && message.length > maxMessageLength;
|
|
1291
|
-
const classNames =
|
|
1029
|
+
const classNames = useStyles_default(sendbox_default);
|
|
1292
1030
|
const localize = useLocalizer7();
|
|
1293
1031
|
const sendMessage = useSendMessage();
|
|
1294
1032
|
const makeThumbnail = useMakeThumbnail();
|
|
1295
|
-
const errorMessageId = useUniqueId("
|
|
1033
|
+
const errorMessageId = useUniqueId("sendbox__error-message-id");
|
|
1296
1034
|
const [errorRef, errorMessage] = useSubmitError_default({ message, attachments });
|
|
1297
1035
|
const [telephoneKeypadShown] = useShown();
|
|
1298
1036
|
const attachmentsRef = (0, import_use_ref_from6.useRefFrom)(attachments);
|
|
@@ -1352,18 +1090,11 @@ function SendBox(props) {
|
|
|
1352
1090
|
"aria-errormessage": errorMessageId
|
|
1353
1091
|
}
|
|
1354
1092
|
};
|
|
1355
|
-
return /* @__PURE__ */ import_react26.default.createElement("form", { ...aria, className: (0,
|
|
1356
|
-
|
|
1357
|
-
{
|
|
1358
|
-
autoFocus: true,
|
|
1359
|
-
isHorizontal: false,
|
|
1360
|
-
onButtonClick: handleTelephoneKeypadButtonClick
|
|
1361
|
-
}
|
|
1362
|
-
), /* @__PURE__ */ import_react26.default.createElement(
|
|
1363
|
-
TextArea_default,
|
|
1093
|
+
return /* @__PURE__ */ import_react26.default.createElement("form", { ...aria, className: (0, import_classnames9.default)(classNames["sendbox"], props.className), onSubmit: handleFormSubmit }, /* @__PURE__ */ import_react26.default.createElement(SuggestedActions_default, null), /* @__PURE__ */ import_react26.default.createElement("div", { className: (0, import_classnames9.default)(classNames["sendbox__sendbox"]), onClickCapture: handleSendBoxClick }, /* @__PURE__ */ import_react26.default.createElement(
|
|
1094
|
+
TextArea_default2,
|
|
1364
1095
|
{
|
|
1365
1096
|
"aria-label": isMessageLengthExceeded ? localize("TEXT_INPUT_LENGTH_EXCEEDED_ALT") : localize("TEXT_INPUT_ALT"),
|
|
1366
|
-
className: classNames["
|
|
1097
|
+
className: (0, import_classnames9.default)(classNames["sendbox__sendbox-text"], classNames["sendbox__text-area--in-grid"]),
|
|
1367
1098
|
"data-testid": testIds_default.sendBoxTextBox,
|
|
1368
1099
|
hidden: telephoneKeypadShown,
|
|
1369
1100
|
onInput: handleMessageChange,
|
|
@@ -1371,38 +1102,47 @@ function SendBox(props) {
|
|
|
1371
1102
|
ref: inputRef,
|
|
1372
1103
|
value: message
|
|
1373
1104
|
}
|
|
1374
|
-
), /* @__PURE__ */ import_react26.default.createElement(
|
|
1105
|
+
), /* @__PURE__ */ import_react26.default.createElement(
|
|
1106
|
+
Surrogate_default,
|
|
1107
|
+
{
|
|
1108
|
+
autoFocus: true,
|
|
1109
|
+
className: classNames["sendbox__telephone-keypad--in-grid"],
|
|
1110
|
+
isHorizontal: false,
|
|
1111
|
+
onButtonClick: handleTelephoneKeypadButtonClick
|
|
1112
|
+
}
|
|
1113
|
+
), /* @__PURE__ */ import_react26.default.createElement(Attachments_default2, { attachments, className: classNames["sendbox__attachment--in-grid"] }), /* @__PURE__ */ import_react26.default.createElement("div", { className: (0, import_classnames9.default)(classNames["sendbox__sendbox-controls"], classNames["sendbox__sendbox-controls--in-grid"]) }, !telephoneKeypadShown && maxMessageLength && /* @__PURE__ */ import_react26.default.createElement(
|
|
1375
1114
|
"div",
|
|
1376
1115
|
{
|
|
1377
|
-
className: (0,
|
|
1378
|
-
[classNames["
|
|
1116
|
+
className: (0, import_classnames9.default)(classNames["sendbox__text-counter"], {
|
|
1117
|
+
[classNames["sendbox__text-counter--error"]]: isMessageLengthExceeded
|
|
1379
1118
|
})
|
|
1380
1119
|
},
|
|
1381
1120
|
`${message.length}/${maxMessageLength}`
|
|
1382
|
-
), /* @__PURE__ */ import_react26.default.createElement(Toolbar, null, !hideTelephoneKeypadButton && /* @__PURE__ */ import_react26.default.createElement(TelephoneKeypadToolbarButton_default, null), !hideUploadButton && /* @__PURE__ */ import_react26.default.createElement(
|
|
1121
|
+
), /* @__PURE__ */ import_react26.default.createElement(Toolbar, null, !hideTelephoneKeypadButton && /* @__PURE__ */ import_react26.default.createElement(TelephoneKeypadToolbarButton_default, null), !hideUploadButton && /* @__PURE__ */ import_react26.default.createElement(AddAttachmentButton_default2, { onFilesAdded: handleAddFiles }), /* @__PURE__ */ import_react26.default.createElement(ToolbarSeparator, null), /* @__PURE__ */ import_react26.default.createElement(
|
|
1383
1122
|
ToolbarButton,
|
|
1384
1123
|
{
|
|
1385
1124
|
"aria-label": localize("TEXT_INPUT_SEND_BUTTON_ALT"),
|
|
1386
1125
|
"data-testid": testIds_default.sendBoxSendButton,
|
|
1387
|
-
disabled: isMessageLengthExceeded,
|
|
1126
|
+
disabled: isMessageLengthExceeded || telephoneKeypadShown,
|
|
1388
1127
|
type: "submit"
|
|
1389
1128
|
},
|
|
1390
1129
|
/* @__PURE__ */ import_react26.default.createElement(SendIcon, null)
|
|
1391
|
-
))), /* @__PURE__ */ import_react26.default.createElement(DropZone_default, { onFilesAdded: handleAddFiles }), /* @__PURE__ */ import_react26.default.createElement(
|
|
1130
|
+
))), /* @__PURE__ */ import_react26.default.createElement(DropZone_default, { onFilesAdded: handleAddFiles }), /* @__PURE__ */ import_react26.default.createElement(ErrorMessage_default2, { error: errorMessage, id: errorMessageId })));
|
|
1392
1131
|
}
|
|
1393
|
-
var
|
|
1132
|
+
var sendbox_default2 = (0, import_react26.memo)(SendBox);
|
|
1394
1133
|
|
|
1395
1134
|
// src/components/SendBox.tsx
|
|
1396
|
-
var SendBox_default =
|
|
1135
|
+
var SendBox_default = sendbox_default2;
|
|
1397
1136
|
|
|
1398
1137
|
// src/private/FluentThemeProvider.tsx
|
|
1399
|
-
var { ThemeProvider } =
|
|
1138
|
+
var { ThemeProvider } = import_botframework_webchat_component10.Components;
|
|
1400
1139
|
var sendBoxMiddleware = [() => () => () => SendBox_default];
|
|
1401
1140
|
var FluentThemeProvider = ({ children }) => /* @__PURE__ */ import_react27.default.createElement(WebchatTheme, null, /* @__PURE__ */ import_react27.default.createElement(Provider_default, null, /* @__PURE__ */ import_react27.default.createElement(ThemeProvider, { sendBoxMiddleware }, children)));
|
|
1402
1141
|
var FluentThemeProvider_default = (0, import_react27.memo)(FluentThemeProvider);
|
|
1403
1142
|
|
|
1404
1143
|
// src/index.ts
|
|
1405
|
-
(0, import_inject_meta_tag.injectMetaTag)("botframework-webchat-fluent-theme:version", "4.17.0-main.
|
|
1144
|
+
(0, import_inject_meta_tag.injectMetaTag)("botframework-webchat-fluent-theme:version", "4.17.0-main.20240423.d9e4f4d");
|
|
1145
|
+
injectStyles();
|
|
1406
1146
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1407
1147
|
0 && (module.exports = {
|
|
1408
1148
|
FluentThemeProvider,
|