@elliemae/ds-chat 2.2.0 → 2.3.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/ChatDataTestids.js +54 -26
- package/cjs/ChatDataTestids.js.map +7 -0
- package/cjs/index.d.js +27 -2
- package/cjs/index.d.js.map +7 -0
- package/cjs/index.js +69 -44
- package/cjs/index.js.map +7 -0
- package/cjs/parts/bubble/ChatBubble.js +74 -64
- package/cjs/parts/bubble/ChatBubble.js.map +7 -0
- package/cjs/parts/bubble/ChatBubbleArrow.js +96 -79
- package/cjs/parts/bubble/ChatBubbleArrow.js.map +7 -0
- package/cjs/parts/bubble/config/useValidateProps.js +47 -24
- package/cjs/parts/bubble/config/useValidateProps.js.map +7 -0
- package/cjs/parts/bubble/index.js +38 -12
- package/cjs/parts/bubble/index.js.map +7 -0
- package/cjs/parts/bubble/props.js +60 -48
- package/cjs/parts/bubble/props.js.map +7 -0
- package/cjs/parts/bubble/styled.js +141 -48
- package/cjs/parts/bubble/styled.js.map +7 -0
- package/cjs/parts/chat-card/ChatCard.js +55 -39
- package/cjs/parts/chat-card/ChatCard.js.map +7 -0
- package/cjs/parts/chat-card/config/useValidateProps.js +36 -9
- package/cjs/parts/chat-card/config/useValidateProps.js.map +7 -0
- package/cjs/parts/chat-card/index.js +36 -10
- package/cjs/parts/chat-card/index.js.map +7 -0
- package/cjs/parts/chat-card/props.js +39 -12
- package/cjs/parts/chat-card/props.js.map +7 -0
- package/cjs/parts/chat-card/styled.js +71 -36
- package/cjs/parts/chat-card/styled.js.map +7 -0
- package/cjs/parts/chat-composer/ChatContainerComposer.js +92 -99
- package/cjs/parts/chat-composer/ChatContainerComposer.js.map +7 -0
- package/cjs/parts/chat-composer/config/useValidateProps.js +36 -9
- package/cjs/parts/chat-composer/config/useValidateProps.js.map +7 -0
- package/cjs/parts/chat-composer/index.js +36 -10
- package/cjs/parts/chat-composer/index.js.map +7 -0
- package/cjs/parts/chat-composer/props.js +73 -38
- package/cjs/parts/chat-composer/props.js.map +7 -0
- package/cjs/parts/chat-composer/styled.js +102 -34
- package/cjs/parts/chat-composer/styled.js.map +7 -0
- package/cjs/parts/chat-container/ChatContainer.js +122 -140
- package/cjs/parts/chat-container/ChatContainer.js.map +7 -0
- package/cjs/parts/chat-container/config/useValidateProps.js +36 -9
- package/cjs/parts/chat-container/config/useValidateProps.js.map +7 -0
- package/cjs/parts/chat-container/index.js +36 -10
- package/cjs/parts/chat-container/index.js.map +7 -0
- package/cjs/parts/chat-container/props.js +85 -42
- package/cjs/parts/chat-container/props.js.map +7 -0
- package/cjs/parts/chat-container/styled.js +104 -23
- package/cjs/parts/chat-container/styled.js.map +7 -0
- package/cjs/parts/chat-container-header/ChatContainerHeader.js +48 -30
- package/cjs/parts/chat-container-header/ChatContainerHeader.js.map +7 -0
- package/cjs/parts/chat-container-header/helpers.js +38 -25
- package/cjs/parts/chat-container-header/helpers.js.map +7 -0
- package/cjs/parts/chat-container-header/styled.js +59 -24
- package/cjs/parts/chat-container-header/styled.js.map +7 -0
- package/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js +163 -225
- package/cjs/parts/chat-container-messages-list/ChatContainerMessagesList.js.map +7 -0
- package/cjs/parts/chat-container-messages-list/config/useValidateProps.js +36 -9
- package/cjs/parts/chat-container-messages-list/config/useValidateProps.js.map +7 -0
- package/cjs/parts/chat-container-messages-list/index.js +36 -10
- package/cjs/parts/chat-container-messages-list/index.js.map +7 -0
- package/cjs/parts/chat-container-messages-list/props.js +62 -24
- package/cjs/parts/chat-container-messages-list/props.js.map +7 -0
- package/cjs/parts/chat-container-messages-list/styled.js +100 -38
- package/cjs/parts/chat-container-messages-list/styled.js.map +7 -0
- package/cjs/parts/chat-empty-state/ChatEmptyState.js +58 -42
- package/cjs/parts/chat-empty-state/ChatEmptyState.js.map +7 -0
- package/cjs/parts/chat-empty-state/config/useValidateProps.js +36 -9
- package/cjs/parts/chat-empty-state/config/useValidateProps.js.map +7 -0
- package/cjs/parts/chat-empty-state/props.js +39 -12
- package/cjs/parts/chat-empty-state/props.js.map +7 -0
- package/cjs/parts/chat-empty-state/styled.js +47 -21
- package/cjs/parts/chat-empty-state/styled.js.map +7 -0
- package/cjs/parts/chat-sidebar/SideBarChat.js +82 -81
- package/cjs/parts/chat-sidebar/SideBarChat.js.map +7 -0
- package/cjs/parts/chat-sidebar/config/useValidateProps.js +36 -9
- package/cjs/parts/chat-sidebar/config/useValidateProps.js.map +7 -0
- package/cjs/parts/chat-sidebar/index.js +36 -10
- package/cjs/parts/chat-sidebar/index.js.map +7 -0
- package/cjs/parts/chat-sidebar/props.js +72 -30
- package/cjs/parts/chat-sidebar/props.js.map +7 -0
- package/cjs/parts/chat-sidebar/styled.js +56 -20
- package/cjs/parts/chat-sidebar/styled.js.map +7 -0
- package/cjs/parts/floating-button/FloatingButton.js +47 -34
- package/cjs/parts/floating-button/FloatingButton.js.map +7 -0
- package/cjs/parts/floating-button/index.js +28 -9
- package/cjs/parts/floating-button/index.js.map +7 -0
- package/cjs/parts/floating-button/props.js +42 -15
- package/cjs/parts/floating-button/props.js.map +7 -0
- package/cjs/parts/floating-button/styled.js +63 -17
- package/cjs/parts/floating-button/styled.js.map +7 -0
- package/cjs/parts/floating-container/styled.js +47 -17
- package/cjs/parts/floating-container/styled.js.map +7 -0
- package/cjs/parts/grid-influencer/InfluencerContainer.js +41 -21
- package/cjs/parts/grid-influencer/InfluencerContainer.js.map +7 -0
- package/cjs/parts/grid-influencer/styled.js +56 -21
- package/cjs/parts/grid-influencer/styled.js.map +7 -0
- package/cjs/parts/message-delimiter/MessageDelimiter.js +53 -39
- package/cjs/parts/message-delimiter/MessageDelimiter.js.map +7 -0
- package/cjs/parts/message-delimiter/config/useValidateProps.js +36 -9
- package/cjs/parts/message-delimiter/config/useValidateProps.js.map +7 -0
- package/cjs/parts/message-delimiter/index.js +36 -10
- package/cjs/parts/message-delimiter/index.js.map +7 -0
- package/cjs/parts/message-delimiter/props.js +44 -19
- package/cjs/parts/message-delimiter/props.js.map +7 -0
- package/cjs/parts/message-delimiter/styled.js +53 -24
- package/cjs/parts/message-delimiter/styled.js.map +7 -0
- package/cjs/parts/sidebar-button/SidebarButton.js +52 -53
- package/cjs/parts/sidebar-button/SidebarButton.js.map +7 -0
- package/cjs/parts/sidebar-button/index.js +20 -2
- package/cjs/parts/sidebar-button/index.js.map +7 -0
- package/cjs/parts/sidebar-button/props.js +49 -26
- package/cjs/parts/sidebar-button/props.js.map +7 -0
- package/cjs/parts/sidebar-button/styled.js +68 -24
- package/cjs/parts/sidebar-button/styled.js.map +7 -0
- package/cjs/parts/system-message/SystemMessage.js +55 -40
- package/cjs/parts/system-message/SystemMessage.js.map +7 -0
- package/cjs/parts/system-message/config/useValidateProps.js +36 -9
- package/cjs/parts/system-message/config/useValidateProps.js.map +7 -0
- package/cjs/parts/system-message/index.js +36 -10
- package/cjs/parts/system-message/index.js.map +7 -0
- package/cjs/parts/system-message/props.js +42 -15
- package/cjs/parts/system-message/props.js.map +7 -0
- package/cjs/parts/system-message/style.js +75 -32
- package/cjs/parts/system-message/style.js.map +7 -0
- package/cjs/parts/tile-button/TileButton.js +98 -68
- package/cjs/parts/tile-button/TileButton.js.map +7 -0
- package/cjs/parts/tile-button/config/useValidateProps.js +36 -9
- package/cjs/parts/tile-button/config/useValidateProps.js.map +7 -0
- package/cjs/parts/tile-button/index.js +36 -10
- package/cjs/parts/tile-button/index.js.map +7 -0
- package/cjs/parts/tile-button/props.js +83 -45
- package/cjs/parts/tile-button/props.js.map +7 -0
- package/cjs/parts/tile-button/styled.js +229 -77
- package/cjs/parts/tile-button/styled.js.map +7 -0
- package/cjs/prop-types.js +53 -26
- package/cjs/prop-types.js.map +7 -0
- package/cjs/styled.js +42 -14
- package/cjs/styled.js.map +7 -0
- package/cjs/tests/utils.js +66 -0
- package/cjs/tests/utils.js.map +7 -0
- package/esm/ChatDataTestids.js +25 -22
- package/esm/ChatDataTestids.js.map +7 -0
- package/esm/index.d.js +2 -1
- package/esm/index.d.js.map +7 -0
- package/esm/index.js +40 -14
- package/esm/index.js.map +7 -0
- package/esm/parts/bubble/ChatBubble.js +51 -51
- package/esm/parts/bubble/ChatBubble.js.map +7 -0
- package/esm/parts/bubble/ChatBubbleArrow.js +67 -71
- package/esm/parts/bubble/ChatBubbleArrow.js.map +7 -0
- package/esm/parts/bubble/config/useValidateProps.js +17 -19
- package/esm/parts/bubble/config/useValidateProps.js.map +7 -0
- package/esm/parts/bubble/index.js +9 -2
- package/esm/parts/bubble/index.js.map +7 -0
- package/esm/parts/bubble/props.js +30 -36
- package/esm/parts/bubble/props.js.map +7 -0
- package/esm/parts/bubble/styled.js +112 -32
- package/esm/parts/bubble/styled.js.map +7 -0
- package/esm/parts/chat-card/ChatCard.js +23 -27
- package/esm/parts/chat-card/ChatCard.js.map +7 -0
- package/esm/parts/chat-card/config/useValidateProps.js +6 -4
- package/esm/parts/chat-card/config/useValidateProps.js.map +7 -0
- package/esm/parts/chat-card/index.js +7 -1
- package/esm/parts/chat-card/index.js.map +7 -0
- package/esm/parts/chat-card/props.js +10 -8
- package/esm/parts/chat-card/props.js.map +7 -0
- package/esm/parts/chat-card/styled.js +42 -23
- package/esm/parts/chat-card/styled.js.map +7 -0
- package/esm/parts/chat-composer/ChatContainerComposer.js +65 -84
- package/esm/parts/chat-composer/ChatContainerComposer.js.map +7 -0
- package/esm/parts/chat-composer/config/useValidateProps.js +6 -4
- package/esm/parts/chat-composer/config/useValidateProps.js.map +7 -0
- package/esm/parts/chat-composer/index.js +7 -1
- package/esm/parts/chat-composer/index.js.map +7 -0
- package/esm/parts/chat-composer/props.js +37 -26
- package/esm/parts/chat-composer/props.js.map +7 -0
- package/esm/parts/chat-composer/styled.js +73 -22
- package/esm/parts/chat-composer/styled.js.map +7 -0
- package/esm/parts/chat-container/ChatContainer.js +88 -122
- package/esm/parts/chat-container/ChatContainer.js.map +7 -0
- package/esm/parts/chat-container/config/useValidateProps.js +6 -4
- package/esm/parts/chat-container/config/useValidateProps.js.map +7 -0
- package/esm/parts/chat-container/index.js +7 -1
- package/esm/parts/chat-container/index.js.map +7 -0
- package/esm/parts/chat-container/props.js +52 -31
- package/esm/parts/chat-container/props.js.map +7 -0
- package/esm/parts/chat-container/styled.js +79 -16
- package/esm/parts/chat-container/styled.js.map +7 -0
- package/esm/parts/chat-container-header/ChatContainerHeader.js +22 -21
- package/esm/parts/chat-container-header/ChatContainerHeader.js.map +7 -0
- package/esm/parts/chat-container-header/helpers.js +9 -17
- package/esm/parts/chat-container-header/helpers.js.map +7 -0
- package/esm/parts/chat-container-header/styled.js +30 -14
- package/esm/parts/chat-container-header/styled.js.map +7 -0
- package/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js +138 -210
- package/esm/parts/chat-container-messages-list/ChatContainerMessagesList.js.map +7 -0
- package/esm/parts/chat-container-messages-list/config/useValidateProps.js +6 -4
- package/esm/parts/chat-container-messages-list/config/useValidateProps.js.map +7 -0
- package/esm/parts/chat-container-messages-list/index.js +10 -1
- package/esm/parts/chat-container-messages-list/index.js.map +7 -0
- package/esm/parts/chat-container-messages-list/props.js +31 -17
- package/esm/parts/chat-container-messages-list/props.js.map +7 -0
- package/esm/parts/chat-container-messages-list/styled.js +71 -25
- package/esm/parts/chat-container-messages-list/styled.js.map +7 -0
- package/esm/parts/chat-empty-state/ChatEmptyState.js +25 -29
- package/esm/parts/chat-empty-state/ChatEmptyState.js.map +7 -0
- package/esm/parts/chat-empty-state/config/useValidateProps.js +6 -4
- package/esm/parts/chat-empty-state/config/useValidateProps.js.map +7 -0
- package/esm/parts/chat-empty-state/props.js +10 -7
- package/esm/parts/chat-empty-state/props.js.map +7 -0
- package/esm/parts/chat-empty-state/styled.js +18 -11
- package/esm/parts/chat-empty-state/styled.js.map +7 -0
- package/esm/parts/chat-sidebar/SideBarChat.js +50 -67
- package/esm/parts/chat-sidebar/SideBarChat.js.map +7 -0
- package/esm/parts/chat-sidebar/config/useValidateProps.js +6 -4
- package/esm/parts/chat-sidebar/config/useValidateProps.js.map +7 -0
- package/esm/parts/chat-sidebar/index.js +7 -1
- package/esm/parts/chat-sidebar/index.js.map +7 -0
- package/esm/parts/chat-sidebar/props.js +39 -21
- package/esm/parts/chat-sidebar/props.js.map +7 -0
- package/esm/parts/chat-sidebar/styled.js +27 -11
- package/esm/parts/chat-sidebar/styled.js.map +7 -0
- package/esm/parts/floating-button/FloatingButton.js +18 -26
- package/esm/parts/floating-button/FloatingButton.js.map +7 -0
- package/esm/parts/floating-button/index.js +3 -1
- package/esm/parts/floating-button/index.js.map +7 -0
- package/esm/parts/floating-button/props.js +11 -8
- package/esm/parts/floating-button/props.js.map +7 -0
- package/esm/parts/floating-button/styled.js +34 -9
- package/esm/parts/floating-button/styled.js.map +7 -0
- package/esm/parts/floating-container/styled.js +18 -9
- package/esm/parts/floating-container/styled.js.map +7 -0
- package/esm/parts/grid-influencer/InfluencerContainer.js +12 -12
- package/esm/parts/grid-influencer/InfluencerContainer.js.map +7 -0
- package/esm/parts/grid-influencer/styled.js +27 -12
- package/esm/parts/grid-influencer/styled.js.map +7 -0
- package/esm/parts/message-delimiter/MessageDelimiter.js +20 -26
- package/esm/parts/message-delimiter/MessageDelimiter.js.map +7 -0
- package/esm/parts/message-delimiter/config/useValidateProps.js +6 -4
- package/esm/parts/message-delimiter/config/useValidateProps.js.map +7 -0
- package/esm/parts/message-delimiter/index.js +10 -1
- package/esm/parts/message-delimiter/index.js.map +7 -0
- package/esm/parts/message-delimiter/props.js +15 -14
- package/esm/parts/message-delimiter/props.js.map +7 -0
- package/esm/parts/message-delimiter/styled.js +24 -14
- package/esm/parts/message-delimiter/styled.js.map +7 -0
- package/esm/parts/sidebar-button/SidebarButton.js +22 -41
- package/esm/parts/sidebar-button/SidebarButton.js.map +7 -0
- package/esm/parts/sidebar-button/index.js +2 -1
- package/esm/parts/sidebar-button/index.js.map +7 -0
- package/esm/parts/sidebar-button/props.js +18 -15
- package/esm/parts/sidebar-button/props.js.map +7 -0
- package/esm/parts/sidebar-button/styled.js +39 -14
- package/esm/parts/sidebar-button/styled.js.map +7 -0
- package/esm/parts/system-message/SystemMessage.js +22 -27
- package/esm/parts/system-message/SystemMessage.js.map +7 -0
- package/esm/parts/system-message/config/useValidateProps.js +6 -4
- package/esm/parts/system-message/config/useValidateProps.js.map +7 -0
- package/esm/parts/system-message/index.js +7 -1
- package/esm/parts/system-message/index.js.map +7 -0
- package/esm/parts/system-message/props.js +13 -10
- package/esm/parts/system-message/props.js.map +7 -0
- package/esm/parts/system-message/style.js +46 -20
- package/esm/parts/system-message/style.js.map +7 -0
- package/esm/parts/tile-button/TileButton.js +75 -54
- package/esm/parts/tile-button/TileButton.js.map +7 -0
- package/esm/parts/tile-button/config/useValidateProps.js +6 -4
- package/esm/parts/tile-button/config/useValidateProps.js.map +7 -0
- package/esm/parts/tile-button/index.js +7 -1
- package/esm/parts/tile-button/index.js.map +7 -0
- package/esm/parts/tile-button/props.js +47 -33
- package/esm/parts/tile-button/props.js.map +7 -0
- package/esm/parts/tile-button/styled.js +200 -60
- package/esm/parts/tile-button/styled.js.map +7 -0
- package/esm/prop-types.js +19 -16
- package/esm/prop-types.js.map +7 -0
- package/esm/styled.js +13 -5
- package/esm/styled.js.map +7 -0
- package/esm/tests/utils.js +37 -0
- package/esm/tests/utils.js.map +7 -0
- package/package.json +10 -10
- package/types/parts/chat-composer/ChatContainerComposer.d.ts +0 -3
|
@@ -1,11 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var useValidateProps_exports = {};
|
|
29
|
+
__export(useValidateProps_exports, {
|
|
30
|
+
useValidateProps: () => useValidateProps
|
|
31
|
+
});
|
|
32
|
+
var React = __toESM(require("react"));
|
|
33
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
7
34
|
const useValidateProps = (props, schema) => {
|
|
8
|
-
|
|
35
|
+
(0, import_ds_props_helpers.useValidatePropTypes)(props, schema);
|
|
9
36
|
};
|
|
10
|
-
|
|
11
|
-
|
|
37
|
+
module.exports = __toCommonJS(useValidateProps_exports);
|
|
38
|
+
//# sourceMappingURL=useValidateProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/parts/chat-card/config/useValidateProps.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { useValidatePropTypes } from '@elliemae/ds-props-helpers';\nimport { CardPropTypes } from '../props';\n\nexport const useValidateProps = (props: CardPropTypes, schema: unknown): void => {\n useValidatePropTypes(props, schema);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAAqC;AAG9B,MAAM,mBAAmB,CAAC,OAAsB,WAA0B;AAC/E,oDAAqB,OAAO;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,10 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var chat_card_exports = {};
|
|
29
|
+
__export(chat_card_exports, {
|
|
30
|
+
ChatCard: () => import_ChatCard.ChatCard,
|
|
31
|
+
ChatCardWithSchema: () => import_ChatCard.ChatCardWithSchema
|
|
32
|
+
});
|
|
33
|
+
var React = __toESM(require("react"));
|
|
34
|
+
var import_ChatCard = require("./ChatCard");
|
|
35
|
+
module.exports = __toCommonJS(chat_card_exports);
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/parts/chat-card/index.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export { ChatCard, ChatCardWithSchema } from './ChatCard';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,sBAA6C;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,14 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var props_exports = {};
|
|
29
|
+
__export(props_exports, {
|
|
30
|
+
propTypes: () => propTypes
|
|
31
|
+
});
|
|
32
|
+
var React = __toESM(require("react"));
|
|
33
|
+
var import_react_desc = require("react-desc");
|
|
7
34
|
const propTypes = {
|
|
8
|
-
title:
|
|
9
|
-
content:
|
|
10
|
-
time:
|
|
11
|
-
rightAddon:
|
|
35
|
+
title: import_react_desc.PropTypes.string.isRequired.description(`Card's title`),
|
|
36
|
+
content: import_react_desc.PropTypes.string.description(`Card's content`),
|
|
37
|
+
time: import_react_desc.PropTypes.string.description("Time"),
|
|
38
|
+
rightAddon: import_react_desc.PropTypes.element.description("Right addon, badge or icon")
|
|
12
39
|
};
|
|
13
|
-
|
|
14
|
-
|
|
40
|
+
module.exports = __toCommonJS(props_exports);
|
|
41
|
+
//# sourceMappingURL=props.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/parts/chat-card/props.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { PropTypes } from 'react-desc';\n\nexport const propTypes = {\n title: PropTypes.string.isRequired.description(`Card's title`),\n content: PropTypes.string.description(`Card's content`),\n time: PropTypes.string.description('Time'),\n rightAddon: PropTypes.element.description('Right addon, badge or icon'),\n};\n\nexport interface CardPropTypes {\n title: string;\n content: string;\n time: string;\n rightAddon: JSX.Element;\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAA0B;AAEnB,MAAM,YAAY;AAAA,EACvB,OAAO,4BAAU,OAAO,WAAW,YAAY;AAAA,EAC/C,SAAS,4BAAU,OAAO,YAAY;AAAA,EACtC,MAAM,4BAAU,OAAO,YAAY;AAAA,EACnC,YAAY,4BAAU,QAAQ,YAAY;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,36 +1,71 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var styled_exports = {};
|
|
29
|
+
__export(styled_exports, {
|
|
30
|
+
Content: () => Content,
|
|
31
|
+
MainContent: () => MainContent,
|
|
32
|
+
RightAddon: () => RightAddon,
|
|
33
|
+
Time: () => Time,
|
|
34
|
+
Title: () => Title,
|
|
35
|
+
Wrapper: () => Wrapper
|
|
36
|
+
});
|
|
37
|
+
var React = __toESM(require("react"));
|
|
38
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
39
|
+
var import_ds_grid = require("@elliemae/ds-grid");
|
|
40
|
+
const Wrapper = (0, import_styled_components.default)(import_ds_grid.Grid)`
|
|
41
|
+
min-width: 248px;
|
|
42
|
+
border: 1px;
|
|
43
|
+
border-bottom: 1px solid #ccc;
|
|
44
|
+
padding: 12px 12px;
|
|
45
|
+
`;
|
|
46
|
+
const MainContent = import_styled_components.default.div``;
|
|
47
|
+
const Title = import_styled_components.default.p`
|
|
48
|
+
font-size: 16px;
|
|
49
|
+
font-weight: 600;
|
|
50
|
+
margin: 0;
|
|
51
|
+
`;
|
|
52
|
+
const Content = import_styled_components.default.p`
|
|
53
|
+
font-size: 12px;
|
|
54
|
+
font-weight: 400;
|
|
55
|
+
line-height: 1;
|
|
56
|
+
margin: 0;
|
|
57
|
+
`;
|
|
58
|
+
const Time = import_styled_components.default.p`
|
|
59
|
+
font-size: 12px;
|
|
60
|
+
font-weight: 100;
|
|
61
|
+
margin: 0;
|
|
62
|
+
margin-top: 8px;
|
|
63
|
+
font-weight: ${(props) => props.theme.fontWeights.regular};
|
|
64
|
+
color: ${(props) => props.theme.colors.neutral["500"]};
|
|
65
|
+
`;
|
|
66
|
+
const RightAddon = import_styled_components.default.div`
|
|
67
|
+
height: fit-content;
|
|
68
|
+
margin-left: 12px;
|
|
69
|
+
`;
|
|
70
|
+
module.exports = __toCommonJS(styled_exports);
|
|
71
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/parts/chat-card/styled.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import styled from 'styled-components';\nimport { Grid } from '@elliemae/ds-grid';\n\nexport const Wrapper = styled(Grid)`\n min-width: 248px;\n border: 1px;\n border-bottom: 1px solid #ccc;\n padding: 12px 12px;\n`;\n\nexport const MainContent = styled.div``;\n\nexport const Title = styled.p`\n font-size: 16px;\n font-weight: 600;\n margin: 0;\n`;\n\nexport const Content = styled.p`\n font-size: 12px;\n font-weight: 400;\n line-height: 1;\n margin: 0;\n`;\n\nexport const Time = styled.p`\n font-size: 12px;\n font-weight: 100;\n margin: 0;\n margin-top: 8px;\n font-weight: ${(props) => props.theme.fontWeights.regular};\n color: ${(props) => props.theme.colors.neutral['500']};\n`;\n\nexport const RightAddon = styled.div`\n height: fit-content;\n margin-left: 12px;\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,+BAAmB;AACnB,qBAAqB;AAEd,MAAM,UAAU,sCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAOvB,MAAM,cAAc,iCAAO;AAE3B,MAAM,QAAQ,iCAAO;AAAA;AAAA;AAAA;AAAA;AAMrB,MAAM,UAAU,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAOvB,MAAM,OAAO,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA,iBAKV,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,WACzC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAG1C,MAAM,aAAa,iCAAO;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,41 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var ChatContainerComposer_exports = {};
|
|
29
|
+
__export(ChatContainerComposer_exports, {
|
|
30
|
+
ChatComposer: () => ChatComposer,
|
|
31
|
+
ChatComposerWithSchema: () => ChatComposerWithSchema
|
|
32
|
+
});
|
|
33
|
+
var React = __toESM(require("react"));
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
var import_ds_grid = require("@elliemae/ds-grid");
|
|
36
|
+
var import_react_desc = require("react-desc");
|
|
37
|
+
var import_ds_icons = require("@elliemae/ds-icons");
|
|
38
|
+
var import_styled = require("./styled");
|
|
39
|
+
var import_useValidateProps = require("./config/useValidateProps");
|
|
40
|
+
var import_props = require("./props");
|
|
41
|
+
const ChatComposer = (props) => {
|
|
42
|
+
(0, import_useValidateProps.useValidateProps)(props, ChatComposerWithSchema.toJSON());
|
|
39
43
|
const {
|
|
40
44
|
inputValue,
|
|
41
45
|
onChange,
|
|
@@ -48,117 +52,106 @@ const ChatComposer = props => {
|
|
|
48
52
|
placeholder,
|
|
49
53
|
inputMaxLength,
|
|
50
54
|
maxLengthMessage,
|
|
51
|
-
ariaMaxLengthMessage,
|
|
52
55
|
buttonDisabled,
|
|
53
56
|
dataTestid,
|
|
54
57
|
actionRef
|
|
55
58
|
} = props;
|
|
56
59
|
const COMPOSER_MIN_HEIGHT = 32;
|
|
57
|
-
const input =
|
|
58
|
-
const inputSize =
|
|
59
|
-
const inputSend =
|
|
60
|
-
const [height, setHeight] =
|
|
61
|
-
const internalMaxHeight =
|
|
62
|
-
const [showScroll, setShowScroll] =
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if (newHeight !== height && newHeight > COMPOSER_MIN_HEIGHT) onResize(newHeight);
|
|
60
|
+
const input = import_react.default.useRef();
|
|
61
|
+
const inputSize = import_react.default.useRef();
|
|
62
|
+
const inputSend = import_react.default.useRef();
|
|
63
|
+
const [height, setHeight] = import_react.default.useState(32);
|
|
64
|
+
const internalMaxHeight = import_react.default.useMemo(() => maxHeight - 24, [maxHeight]);
|
|
65
|
+
const [showScroll, setShowScroll] = import_react.default.useState(true);
|
|
66
|
+
import_react.default.useEffect(() => {
|
|
67
|
+
const newHeight = inputSize.current?.scrollHeight > internalMaxHeight ? internalMaxHeight : inputSize.current?.scrollHeight;
|
|
68
|
+
if (newHeight !== height && newHeight > COMPOSER_MIN_HEIGHT)
|
|
69
|
+
onResize(newHeight);
|
|
68
70
|
setHeight(newHeight);
|
|
69
|
-
setShowScroll(
|
|
71
|
+
setShowScroll(inputSize.current?.scrollHeight - inputSize.current?.clientHeight > 5);
|
|
70
72
|
}, [inputValue, internalMaxHeight, height, onResize]);
|
|
71
|
-
|
|
73
|
+
import_react.default.useEffect(() => {
|
|
72
74
|
if (actionRef && actionRef.current) {
|
|
73
75
|
actionRef.current.focusToComposer = () => {
|
|
74
76
|
input.current.focus();
|
|
75
77
|
};
|
|
76
|
-
|
|
77
78
|
actionRef.current.focusToSend = () => {
|
|
78
79
|
inputSend.current.focus();
|
|
79
80
|
};
|
|
80
81
|
}
|
|
81
82
|
}, [actionRef]);
|
|
82
|
-
const handleChange =
|
|
83
|
+
const handleChange = import_react.default.useCallback((e) => {
|
|
83
84
|
onChange(e.target.value);
|
|
84
85
|
}, [onChange]);
|
|
85
|
-
const heightProps = {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return /*#__PURE__*/_jsx__default["default"](styled.StyledChatContainerContentComposer, {
|
|
92
|
-
rows: ['auto', '15px'],
|
|
93
|
-
maxHeight: "".concat(maxHeight, "px"),
|
|
86
|
+
const heightProps = { height, overflow: showScroll ? "auto" : "hidden" };
|
|
87
|
+
const inputLength = String(inputValue || "").length;
|
|
88
|
+
const hasError = import_react.default.useMemo(() => inputLength > inputMaxLength, [inputLength, inputMaxLength]);
|
|
89
|
+
return /* @__PURE__ */ import_react.default.createElement(import_styled.StyledChatContainerContentComposer, {
|
|
90
|
+
rows: ["auto", "15px"],
|
|
91
|
+
maxHeight: `${maxHeight}px`,
|
|
94
92
|
"data-testid": dataTestid
|
|
95
|
-
},
|
|
96
|
-
cols: [
|
|
97
|
-
style: {
|
|
98
|
-
height: heightProps.height
|
|
99
|
-
},
|
|
93
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_ds_grid.Grid, {
|
|
94
|
+
cols: ["1fr", "24px"],
|
|
95
|
+
style: { height: heightProps.height },
|
|
100
96
|
justifyContent: "center",
|
|
101
97
|
alignItems: "flex-end",
|
|
102
98
|
gutter: "xxs"
|
|
103
|
-
},
|
|
99
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_styled.StyledComposerInput, {
|
|
104
100
|
ref: input,
|
|
105
101
|
onChange: handleChange,
|
|
106
|
-
style:
|
|
102
|
+
style: { ...heightProps },
|
|
107
103
|
value: inputValue,
|
|
108
|
-
onFocus
|
|
109
|
-
onBlur
|
|
110
|
-
onKeyDown
|
|
111
|
-
placeholder
|
|
104
|
+
onFocus,
|
|
105
|
+
onBlur,
|
|
106
|
+
onKeyDown,
|
|
107
|
+
placeholder,
|
|
112
108
|
"aria-label": "Message to send",
|
|
113
109
|
"data-testid": "chat-composer-textarea",
|
|
114
110
|
name: "chat-composer-textarea",
|
|
115
111
|
id: "chat-composer-textarea"
|
|
116
|
-
}),
|
|
112
|
+
}), /* @__PURE__ */ import_react.default.createElement(import_ds_grid.Grid, {
|
|
117
113
|
height: "32px",
|
|
118
114
|
alignItems: "center"
|
|
119
|
-
},
|
|
115
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_styled.StyledComposerButton, {
|
|
120
116
|
buttonType: "text",
|
|
121
|
-
icon:
|
|
117
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_ds_icons.PaperAirplane, {
|
|
122
118
|
width: 18,
|
|
123
119
|
height: 18
|
|
124
|
-
})
|
|
120
|
+
}),
|
|
125
121
|
onClick: onSend,
|
|
126
122
|
size: "s",
|
|
127
123
|
disabled: !inputValue || buttonDisabled || hasError,
|
|
128
124
|
"data-testid": "chat-composer-send-button",
|
|
129
125
|
"aria-label": "Send",
|
|
130
126
|
innerRef: inputSend
|
|
131
|
-
}))),
|
|
127
|
+
}))), /* @__PURE__ */ import_react.default.createElement(import_styled.StyledComposerInput, {
|
|
132
128
|
ref: inputSize,
|
|
133
129
|
style: {
|
|
134
130
|
height: 32,
|
|
135
|
-
visibility:
|
|
136
|
-
pointerEvents:
|
|
137
|
-
position:
|
|
131
|
+
visibility: "hidden",
|
|
132
|
+
pointerEvents: "none",
|
|
133
|
+
position: "absolute",
|
|
138
134
|
top: 0,
|
|
139
|
-
width:
|
|
135
|
+
width: input.current?.clientWidth
|
|
140
136
|
},
|
|
141
137
|
onChange: handleChange,
|
|
142
138
|
value: inputValue
|
|
143
|
-
}),
|
|
144
|
-
cols: [
|
|
139
|
+
}), /* @__PURE__ */ import_react.default.createElement(import_ds_grid.Grid, {
|
|
140
|
+
cols: ["1fr", "24px"],
|
|
145
141
|
justifyContent: "flex-end",
|
|
146
142
|
alignItems: "center",
|
|
147
143
|
gutter: "xxs",
|
|
148
144
|
pb: "xxs"
|
|
149
|
-
},
|
|
150
|
-
hasError
|
|
145
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_styled.StyledCounterArea, {
|
|
146
|
+
hasError,
|
|
151
147
|
"data-testid": "composer-counter-area"
|
|
152
|
-
},
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}, void 0, ariaMaxLengthMessage || "You have entered ".concat(inputLength, " characters and have exceeded the limit by ").concat(inputLength - inputMaxLength, ". Please limit to less than ").concat(inputMaxLength, " characters. ")), maxLengthMessage || "Please limit to less than ".concat(inputMaxLength, " characters. ")]
|
|
156
|
-
}) : '', inputMaxLength ? " ".concat(inputLength, " / ").concat(inputMaxLength) : ''), _Grid || (_Grid = /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {}))));
|
|
148
|
+
}, inputMaxLength && hasError ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_styled.StyledCounterErrorA11y, {
|
|
149
|
+
role: "alert"
|
|
150
|
+
}, maxLengthMessage || `You have entered ${inputLength} characters and have exceeded the limit by ${inputLength - inputMaxLength}. Please limit to less than ${inputMaxLength} characters. `), maxLengthMessage || `Please limit to less than ${inputMaxLength} characters. `) : "", inputMaxLength && !maxLengthMessage ? ` ${inputLength} / ${inputMaxLength}` : ""), /* @__PURE__ */ import_react.default.createElement(import_ds_grid.Grid, null)));
|
|
157
151
|
};
|
|
158
|
-
|
|
159
|
-
ChatComposer.defaultProps =
|
|
160
|
-
const ChatComposerWithSchema =
|
|
161
|
-
ChatComposerWithSchema.propTypes =
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
exports.ChatComposerWithSchema = ChatComposerWithSchema;
|
|
152
|
+
ChatComposer.propTypes = import_props.composerProps;
|
|
153
|
+
ChatComposer.defaultProps = import_props.defaultComposerPros;
|
|
154
|
+
const ChatComposerWithSchema = (0, import_react_desc.describe)(ChatComposer);
|
|
155
|
+
ChatComposerWithSchema.propTypes = import_props.composerProps;
|
|
156
|
+
module.exports = __toCommonJS(ChatContainerComposer_exports);
|
|
157
|
+
//# sourceMappingURL=ChatContainerComposer.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/parts/chat-composer/ChatContainerComposer.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { describe } from 'react-desc';\nimport { PaperAirplane } from '@elliemae/ds-icons';\nimport {\n StyledChatContainerContentComposer,\n StyledComposerInput,\n StyledComposerButton,\n StyledCounterArea,\n StyledCounterErrorA11y,\n} from './styled';\nimport { useValidateProps } from './config/useValidateProps';\n\nimport { defaultComposerPros, composerProps, ChatComposerProps } from './props';\n\n// eslint-disable-next-line complexity\nconst ChatComposer = (props: ChatComposerProps): JSX.Element => {\n useValidateProps(props, ChatComposerWithSchema.toJSON());\n\n const {\n inputValue,\n onChange,\n onResize,\n onSend,\n onFocus,\n onBlur,\n onKeyDown,\n maxHeight = 300,\n placeholder,\n inputMaxLength,\n maxLengthMessage,\n buttonDisabled,\n dataTestid,\n actionRef,\n } = props;\n\n const COMPOSER_MIN_HEIGHT = 32;\n const input = React.useRef<HTMLTextAreaElement>();\n const inputSize = React.useRef<HTMLTextAreaElement>();\n const inputSend = React.useRef<HTMLButtonElement>();\n const [height, setHeight] = React.useState(32);\n const internalMaxHeight = React.useMemo(() => maxHeight - 24, [maxHeight]);\n const [showScroll, setShowScroll] = React.useState(true);\n\n React.useEffect(() => {\n const newHeight =\n inputSize.current?.scrollHeight > internalMaxHeight ? internalMaxHeight : inputSize.current?.scrollHeight;\n if (newHeight !== height && newHeight > COMPOSER_MIN_HEIGHT) onResize(newHeight);\n setHeight(newHeight);\n setShowScroll(inputSize.current?.scrollHeight - inputSize.current?.clientHeight > 5);\n }, [inputValue, internalMaxHeight, height, onResize]);\n\n React.useEffect(() => {\n if (actionRef && actionRef.current) {\n actionRef.current.focusToComposer = () => {\n input.current.focus();\n };\n actionRef.current.focusToSend = () => {\n inputSend.current.focus();\n };\n }\n }, [actionRef]);\n\n const handleChange = React.useCallback(\n (e) => {\n onChange(e.target.value);\n },\n [onChange],\n );\n const heightProps = { height, overflow: showScroll ? 'auto' : 'hidden' };\n\n const inputLength = String(inputValue || '').length;\n const hasError = React.useMemo(() => inputLength > inputMaxLength, [inputLength, inputMaxLength]);\n return (\n <StyledChatContainerContentComposer rows={['auto', '15px']} maxHeight={`${maxHeight}px`} data-testid={dataTestid}>\n <Grid\n cols={['1fr', '24px']}\n style={{ height: heightProps.height }}\n justifyContent=\"center\"\n alignItems=\"flex-end\"\n gutter=\"xxs\"\n >\n <StyledComposerInput\n ref={input}\n onChange={handleChange}\n style={{ ...heightProps }}\n value={inputValue}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n placeholder={placeholder}\n aria-label=\"Message to send\"\n data-testid=\"chat-composer-textarea\"\n name=\"chat-composer-textarea\"\n id=\"chat-composer-textarea\"\n />\n\n <Grid height=\"32px\" alignItems=\"center\">\n <StyledComposerButton\n buttonType=\"text\"\n icon={<PaperAirplane width={18} height={18} />}\n onClick={onSend}\n size=\"s\"\n disabled={!inputValue || buttonDisabled || hasError}\n data-testid=\"chat-composer-send-button\"\n aria-label=\"Send\"\n innerRef={inputSend}\n />\n </Grid>\n </Grid>\n <StyledComposerInput\n ref={inputSize}\n style={{\n height: 32,\n visibility: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n top: 0,\n width: input.current?.clientWidth,\n }}\n onChange={handleChange}\n value={inputValue}\n />\n <Grid cols={['1fr', '24px']} justifyContent=\"flex-end\" alignItems=\"center\" gutter=\"xxs\" pb=\"xxs\">\n <StyledCounterArea hasError={hasError} data-testid=\"composer-counter-area\">\n {inputMaxLength && hasError ? (\n <>\n <StyledCounterErrorA11y role=\"alert\">\n {maxLengthMessage ||\n `You have entered ${inputLength} characters and have exceeded the limit by ${\n inputLength - inputMaxLength\n }. Please limit to less than ${inputMaxLength} characters. `}\n </StyledCounterErrorA11y>\n {maxLengthMessage || `Please limit to less than ${inputMaxLength} characters. `}\n </>\n ) : (\n ''\n )}\n {inputMaxLength && !maxLengthMessage ? ` ${inputLength} / ${inputMaxLength}` : ''}\n </StyledCounterArea>\n <Grid />\n </Grid>\n </StyledChatContainerContentComposer>\n );\n};\n\nChatComposer.propTypes = composerProps;\nChatComposer.defaultProps = defaultComposerPros;\nconst ChatComposerWithSchema = describe(ChatComposer);\nChatComposerWithSchema.propTypes = composerProps;\n\nexport { ChatComposer, ChatComposerWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|