@elliemae/ds-legacy-chat-system-message 1.0.0-rc.1
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/cjs/ChatSystemMessageDataTestIds.js +40 -0
- package/dist/cjs/ChatSystemMessageDataTestIds.js.map +7 -0
- package/dist/cjs/DSChatSystemMessageDefinitions.js +36 -0
- package/dist/cjs/DSChatSystemMessageDefinitions.js.map +7 -0
- package/dist/cjs/SystemMessage.js +64 -0
- package/dist/cjs/SystemMessage.js.map +7 -0
- package/dist/cjs/index.js +41 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/package.json +4 -0
- package/dist/cjs/react-desc-prop-types.js +45 -0
- package/dist/cjs/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/style.js +83 -0
- package/dist/cjs/style.js.map +7 -0
- package/dist/cjs/typescript-testing/typescript-system-message-valid.js +85 -0
- package/dist/cjs/typescript-testing/typescript-system-message-valid.js.map +7 -0
- package/dist/esm/ChatSystemMessageDataTestIds.js +10 -0
- package/dist/esm/ChatSystemMessageDataTestIds.js.map +7 -0
- package/dist/esm/DSChatSystemMessageDefinitions.js +6 -0
- package/dist/esm/DSChatSystemMessageDefinitions.js.map +7 -0
- package/dist/esm/SystemMessage.js +34 -0
- package/dist/esm/SystemMessage.js.map +7 -0
- package/dist/esm/index.js +10 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/package.json +4 -0
- package/dist/esm/react-desc-prop-types.js +15 -0
- package/dist/esm/react-desc-prop-types.js.map +7 -0
- package/dist/esm/style.js +53 -0
- package/dist/esm/style.js.map +7 -0
- package/dist/esm/typescript-testing/typescript-system-message-valid.js +62 -0
- package/dist/esm/typescript-testing/typescript-system-message-valid.js.map +7 -0
- package/dist/types/ChatSystemMessageDataTestIds.d.ts +5 -0
- package/dist/types/DSChatSystemMessageDefinitions.d.ts +1 -0
- package/dist/types/SystemMessage.d.ts +5 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/react-desc-prop-types.d.ts +21 -0
- package/dist/types/style.d.ts +7 -0
- package/dist/types/typescript-testing/typescript-system-message-valid.d.ts +1 -0
- package/package.json +76 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var ChatSystemMessageDataTestIds_exports = {};
|
|
30
|
+
__export(ChatSystemMessageDataTestIds_exports, {
|
|
31
|
+
ChatSystemMessageDataTestIds: () => ChatSystemMessageDataTestIds
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(ChatSystemMessageDataTestIds_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
const ChatSystemMessageDataTestIds = {
|
|
36
|
+
SYSTEM_MSG_TITLE: "chat-system-message-title",
|
|
37
|
+
SYSTEM_MSG_BODY: "chat-system-message-body",
|
|
38
|
+
SYSTEM_MSG_TIME: "chat-system-message-time"
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=ChatSystemMessageDataTestIds.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/ChatSystemMessageDataTestIds.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export const ChatSystemMessageDataTestIds = {\n SYSTEM_MSG_TITLE: 'chat-system-message-title',\n SYSTEM_MSG_BODY: 'chat-system-message-body',\n SYSTEM_MSG_TIME: 'chat-system-message-time',\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,+BAA+B;AAAA,EAC1C,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,iBAAiB;AACnB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var DSChatSystemMessageDefinitions_exports = {};
|
|
30
|
+
__export(DSChatSystemMessageDefinitions_exports, {
|
|
31
|
+
DSChatSystemMessageName: () => DSChatSystemMessageName
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(DSChatSystemMessageDefinitions_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
const DSChatSystemMessageName = "DSChatSystemMessage";
|
|
36
|
+
//# sourceMappingURL=DSChatSystemMessageDefinitions.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/DSChatSystemMessageDefinitions.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export const DSChatSystemMessageName = 'DSChatSystemMessage';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,0BAA0B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var SystemMessage_exports = {};
|
|
30
|
+
__export(SystemMessage_exports, {
|
|
31
|
+
SystemMessage: () => SystemMessage,
|
|
32
|
+
SystemMessageWithSchema: () => SystemMessageWithSchema
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(SystemMessage_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
+
var import_ds_legacy_props_helpers = require("@elliemae/ds-legacy-props-helpers");
|
|
38
|
+
var import_style = require("./style.js");
|
|
39
|
+
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
40
|
+
var import_ChatSystemMessageDataTestIds = require("./ChatSystemMessageDataTestIds.js");
|
|
41
|
+
var import_DSChatSystemMessageDefinitions = require("./DSChatSystemMessageDefinitions.js");
|
|
42
|
+
const SystemMessage = (props) => {
|
|
43
|
+
const propsWithDefault = (0, import_ds_legacy_props_helpers.useMemoMergePropsWithDefault)(props, import_react_desc_prop_types.defaultProps);
|
|
44
|
+
(0, import_ds_legacy_props_helpers.useValidateTypescriptPropTypes)(propsWithDefault, import_react_desc_prop_types.systemMessageProps, import_DSChatSystemMessageDefinitions.DSChatSystemMessageName);
|
|
45
|
+
const {
|
|
46
|
+
title,
|
|
47
|
+
time = null,
|
|
48
|
+
// undefined is technically not a valid React node, it should be null instead
|
|
49
|
+
body
|
|
50
|
+
} = propsWithDefault;
|
|
51
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_style.Wrapper, { rows: ["auto", "auto"], cols: [1], children: [
|
|
52
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_style.Header, { cols: ["1fr", "auto", "1fr"], children: [
|
|
53
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {}),
|
|
54
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_style.Title, { "data-testid": import_ChatSystemMessageDataTestIds.ChatSystemMessageDataTestIds.SYSTEM_MSG_TITLE, children: title }),
|
|
55
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_style.Time, { "data-testid": import_ChatSystemMessageDataTestIds.ChatSystemMessageDataTestIds.SYSTEM_MSG_TIME, children: time })
|
|
56
|
+
] }),
|
|
57
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_style.Message, { "data-testid": import_ChatSystemMessageDataTestIds.ChatSystemMessageDataTestIds.SYSTEM_MSG_BODY, children: body })
|
|
58
|
+
] });
|
|
59
|
+
};
|
|
60
|
+
SystemMessage.propTypes = import_react_desc_prop_types.systemMessageProps;
|
|
61
|
+
SystemMessage.displayName = import_DSChatSystemMessageDefinitions.DSChatSystemMessageName;
|
|
62
|
+
const SystemMessageWithSchema = (0, import_ds_legacy_props_helpers.describe)(SystemMessage);
|
|
63
|
+
SystemMessageWithSchema.propTypes = import_react_desc_prop_types.systemMessageProps;
|
|
64
|
+
//# sourceMappingURL=SystemMessage.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/SystemMessage.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport React from 'react';\nimport { describe, useValidateTypescriptPropTypes, useMemoMergePropsWithDefault } from '@elliemae/ds-legacy-props-helpers';\nimport { Wrapper, Header, Title, Time, Message } from './style.js';\nimport type { DSChatSystemMessageT } from './react-desc-prop-types.js';\nimport { systemMessageProps, defaultProps } from './react-desc-prop-types.js';\nimport { ChatSystemMessageDataTestIds } from './ChatSystemMessageDataTestIds.js';\nimport { DSChatSystemMessageName } from './DSChatSystemMessageDefinitions.js';\n\nconst SystemMessage: React.ComponentType<DSChatSystemMessageT.Props> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSChatSystemMessageT.InternalProps>(props, defaultProps);\n useValidateTypescriptPropTypes(propsWithDefault, systemMessageProps, DSChatSystemMessageName);\n\n const {\n title,\n time = null, // undefined is technically not a valid React node, it should be null instead\n body,\n } = propsWithDefault;\n return (\n <Wrapper rows={['auto', 'auto']} cols={[1]}>\n <Header cols={['1fr', 'auto', '1fr']}>\n <span />\n <Title data-testid={ChatSystemMessageDataTestIds.SYSTEM_MSG_TITLE}>{title}</Title>\n <Time data-testid={ChatSystemMessageDataTestIds.SYSTEM_MSG_TIME}>{time}</Time>\n </Header>\n <Message data-testid={ChatSystemMessageDataTestIds.SYSTEM_MSG_BODY}>{body}</Message>\n </Wrapper>\n );\n};\n\nSystemMessage.propTypes = systemMessageProps as WeakValidationMap<unknown>;\nSystemMessage.displayName = DSChatSystemMessageName;\nconst SystemMessageWithSchema = describe(SystemMessage);\nSystemMessageWithSchema.propTypes = systemMessageProps as WeakValidationMap<unknown>;\n\nexport { SystemMessage, SystemMessageWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADoBjB;AAlBN,qCAAuF;AACvF,mBAAsD;AAEtD,mCAAiD;AACjD,0CAA6C;AAC7C,4CAAwC;AAExC,MAAM,gBAAiE,CAAC,UAAU;AAChF,QAAM,uBAAmB,6DAAiE,OAAO,yCAAY;AAC7G,qEAA+B,kBAAkB,iDAAoB,6DAAuB;AAE5F,QAAM;AAAA,IACJ;AAAA,IACA,OAAO;AAAA;AAAA,IACP;AAAA,EACF,IAAI;AACJ,SACE,6CAAC,wBAAQ,MAAM,CAAC,QAAQ,MAAM,GAAG,MAAM,CAAC,CAAC,GACvC;AAAA,iDAAC,uBAAO,MAAM,CAAC,OAAO,QAAQ,KAAK,GACjC;AAAA,kDAAC,UAAK;AAAA,MACN,4CAAC,sBAAM,eAAa,iEAA6B,kBAAmB,iBAAM;AAAA,MAC1E,4CAAC,qBAAK,eAAa,iEAA6B,iBAAkB,gBAAK;AAAA,OACzE;AAAA,IACA,4CAAC,wBAAQ,eAAa,iEAA6B,iBAAkB,gBAAK;AAAA,KAC5E;AAEJ;AAEA,cAAc,YAAY;AAC1B,cAAc,cAAc;AAC5B,MAAM,8BAA0B,yCAAS,aAAa;AACtD,wBAAwB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var src_exports = {};
|
|
31
|
+
__export(src_exports, {
|
|
32
|
+
ChatSystemMessageDataTestIds: () => import_ChatSystemMessageDataTestIds.ChatSystemMessageDataTestIds,
|
|
33
|
+
SystemMessage: () => import_SystemMessage.SystemMessage,
|
|
34
|
+
SystemMessageWithSchema: () => import_SystemMessage.SystemMessageWithSchema
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(src_exports);
|
|
37
|
+
var React = __toESM(require("react"));
|
|
38
|
+
var import_SystemMessage = require("./SystemMessage.js");
|
|
39
|
+
var import_ChatSystemMessageDataTestIds = require("./ChatSystemMessageDataTestIds.js");
|
|
40
|
+
__reExport(src_exports, require("./style.js"), module.exports);
|
|
41
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import type {} from '@elliemae/ds-legacy-props-helpers';\nexport { SystemMessage, SystemMessageWithSchema } from './SystemMessage.js';\nexport { ChatSystemMessageDataTestIds } from './ChatSystemMessageDataTestIds.js';\nexport * from './style.js';\nexport type { DSChatSystemMessageT } from './react-desc-prop-types.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,2BAAuD;AACvD,0CAA6C;AAC7C,wBAAc,uBAHd;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var react_desc_prop_types_exports = {};
|
|
30
|
+
__export(react_desc_prop_types_exports, {
|
|
31
|
+
defaultProps: () => defaultProps,
|
|
32
|
+
systemMessageProps: () => systemMessageProps
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_ds_legacy_props_helpers = require("@elliemae/ds-legacy-props-helpers");
|
|
37
|
+
const defaultProps = {
|
|
38
|
+
title: "System Message"
|
|
39
|
+
};
|
|
40
|
+
const systemMessageProps = {
|
|
41
|
+
body: import_ds_legacy_props_helpers.PropTypes.string.isRequired.description("message"),
|
|
42
|
+
title: import_ds_legacy_props_helpers.PropTypes.string.description("Message title").defaultValue("System Message"),
|
|
43
|
+
time: import_ds_legacy_props_helpers.PropTypes.string.description("data of the message, ie: hour")
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/react-desc-prop-types.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-empty-interface */\nimport { PropTypes } from '@elliemae/ds-legacy-props-helpers';\n// import type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-legacy-props-helpers';\n\nexport declare namespace DSChatSystemMessageT {\n export interface DefaultProps {\n title: string;\n }\n export interface OptionalProps {\n time?: string;\n }\n export interface RequiredProps {\n body: string;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n // currently the component doesn't accept global attributes...\n // Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n // XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n // currently the component doesn't accept global attributes...\n // Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n // XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSChatSystemMessageT.DefaultProps = {\n title: 'System Message',\n};\n\nexport const systemMessageProps = {\n body: PropTypes.string.isRequired.description('message'),\n title: PropTypes.string.description('Message title').defaultValue('System Message'),\n time: PropTypes.string.description('data of the message, ie: hour'),\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,qCAA0B;AA+BnB,MAAM,eAAkD;AAAA,EAC7D,OAAO;AACT;AAEO,MAAM,qBAAqB;AAAA,EAChC,MAAM,yCAAU,OAAO,WAAW,YAAY,SAAS;AAAA,EACvD,OAAO,yCAAU,OAAO,YAAY,eAAe,EAAE,aAAa,gBAAgB;AAAA,EAClF,MAAM,yCAAU,OAAO,YAAY,+BAA+B;AACpE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var style_exports = {};
|
|
30
|
+
__export(style_exports, {
|
|
31
|
+
Header: () => Header,
|
|
32
|
+
Message: () => Message,
|
|
33
|
+
Time: () => Time,
|
|
34
|
+
Title: () => Title,
|
|
35
|
+
Wrapper: () => Wrapper
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(style_exports);
|
|
38
|
+
var React = __toESM(require("react"));
|
|
39
|
+
var import_ds_legacy_system = require("@elliemae/ds-legacy-system");
|
|
40
|
+
var import_ds_legacy_grid = require("@elliemae/ds-legacy-grid");
|
|
41
|
+
const wrapRule = import_ds_legacy_system.css`
|
|
42
|
+
overflow-wrap: break-word;
|
|
43
|
+
white-space: 'pre-wrap';
|
|
44
|
+
`;
|
|
45
|
+
const Wrapper = (0, import_ds_legacy_system.styled)(import_ds_legacy_grid.Grid)`
|
|
46
|
+
align-items: center;
|
|
47
|
+
max-width: 100%;
|
|
48
|
+
padding: 0 8px 8px;
|
|
49
|
+
border: 1px solid ${(props) => props.theme.colors.neutral["100"]};
|
|
50
|
+
border-radius: 10px;
|
|
51
|
+
background-color: ${(props) => props.theme.colors.neutral["080"]};
|
|
52
|
+
box-shadow: none;
|
|
53
|
+
`;
|
|
54
|
+
const Header = (0, import_ds_legacy_system.styled)(import_ds_legacy_grid.Grid)`
|
|
55
|
+
align-items: center;
|
|
56
|
+
height: 36px;
|
|
57
|
+
`;
|
|
58
|
+
const Title = import_ds_legacy_system.styled.p`
|
|
59
|
+
font-size: 14px;
|
|
60
|
+
font-weight: ${(props) => props.theme.fontWeights.semibold};
|
|
61
|
+
color: ${(props) => props.theme.colors.neutral["700"]};
|
|
62
|
+
margin: 0;
|
|
63
|
+
padding-left: 16px;
|
|
64
|
+
padding-right: 16px;
|
|
65
|
+
${wrapRule}
|
|
66
|
+
`;
|
|
67
|
+
const Time = import_ds_legacy_system.styled.p`
|
|
68
|
+
font-size: 12px;
|
|
69
|
+
font-weight: ${(props) => props.theme.fontWeights.regular};
|
|
70
|
+
color: ${(props) => props.theme.colors.neutral["700"]};
|
|
71
|
+
margin: 0;
|
|
72
|
+
text-align: right;
|
|
73
|
+
`;
|
|
74
|
+
const Message = import_ds_legacy_system.styled.p`
|
|
75
|
+
font-size: 13px;
|
|
76
|
+
font-weight: ${(props) => props.theme.fontWeights.regular};
|
|
77
|
+
color: ${(props) => props.theme.colors.neutral["700"]};
|
|
78
|
+
min-height: 32px;
|
|
79
|
+
text-align: center;
|
|
80
|
+
margin: 0;
|
|
81
|
+
${wrapRule}
|
|
82
|
+
`;
|
|
83
|
+
//# sourceMappingURL=style.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/style.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { styled, css } from '@elliemae/ds-legacy-system';\nimport { Grid } from '@elliemae/ds-legacy-grid';\n\nconst wrapRule = css`\n overflow-wrap: break-word;\n white-space: 'pre-wrap';\n`;\nconst Wrapper = styled(Grid)`\n align-items: center;\n max-width: 100%;\n padding: 0 8px 8px;\n border: 1px solid ${(props) => props.theme.colors.neutral['100']};\n border-radius: 10px;\n background-color: ${(props) => props.theme.colors.neutral['080']};\n box-shadow: none;\n`;\n\nconst Header = styled(Grid)`\n align-items: center;\n height: 36px;\n`;\n\nconst Title = styled.p`\n font-size: 14px;\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n color: ${(props) => props.theme.colors.neutral['700']};\n margin: 0;\n padding-left: 16px;\n padding-right: 16px;\n ${wrapRule}\n`;\n\nconst Time = styled.p`\n font-size: 12px;\n font-weight: ${(props) => props.theme.fontWeights.regular};\n color: ${(props) => props.theme.colors.neutral['700']};\n margin: 0;\n text-align: right;\n`;\n\nconst Message = styled.p`\n font-size: 13px;\n font-weight: ${(props) => props.theme.fontWeights.regular};\n color: ${(props) => props.theme.colors.neutral['700']};\n min-height: 32px;\n text-align: center;\n margin: 0;\n ${wrapRule}\n`;\n\nexport { Wrapper, Header, Title, Time, Message };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA4B;AAC5B,4BAAqB;AAErB,MAAM,WAAW;AAAA;AAAA;AAAA;AAIjB,MAAM,cAAU,gCAAO,0BAAI;AAAA;AAAA;AAAA;AAAA,sBAIL,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA;AAAA,sBAE3C,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA;AAAA;AAIjE,MAAM,aAAS,gCAAO,0BAAI;AAAA;AAAA;AAAA;AAK1B,MAAM,QAAQ,+BAAO;AAAA;AAAA,iBAEJ,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,WACzC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA;AAAA;AAAA;AAAA,IAIlD;AAAA;AAGJ,MAAM,OAAO,+BAAO;AAAA;AAAA,iBAEH,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,WACzC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA;AAAA;AAAA;AAKtD,MAAM,UAAU,+BAAO;AAAA;AAAA,iBAEN,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,WACzC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA;AAAA;AAAA;AAAA,IAIlD;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var React = __toESM(require("react"));
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import__ = require("../index.js");
|
|
27
|
+
const testRequiredProps = {
|
|
28
|
+
body: "This is defined as just as string so this is fine for testing"
|
|
29
|
+
};
|
|
30
|
+
const testOptionalProps = {
|
|
31
|
+
time: "This is defined as just as string so this is fine for testing"
|
|
32
|
+
};
|
|
33
|
+
const testPartialDefaults = {};
|
|
34
|
+
const testProps = {
|
|
35
|
+
...testRequiredProps,
|
|
36
|
+
...testOptionalProps,
|
|
37
|
+
...testPartialDefaults
|
|
38
|
+
};
|
|
39
|
+
const testPropsAsSyntax = {
|
|
40
|
+
...testRequiredProps,
|
|
41
|
+
...testOptionalProps,
|
|
42
|
+
...testPartialDefaults
|
|
43
|
+
};
|
|
44
|
+
const testCompleteDefaults = {
|
|
45
|
+
title: "System Message"
|
|
46
|
+
};
|
|
47
|
+
const testInternalProps = {
|
|
48
|
+
...testRequiredProps,
|
|
49
|
+
...testOptionalProps,
|
|
50
|
+
...testCompleteDefaults
|
|
51
|
+
};
|
|
52
|
+
const testInternalPropsAsSyntax = {
|
|
53
|
+
...testRequiredProps,
|
|
54
|
+
...testOptionalProps,
|
|
55
|
+
...testCompleteDefaults
|
|
56
|
+
};
|
|
57
|
+
const testExplicitDefinition = {
|
|
58
|
+
title: "System Message",
|
|
59
|
+
body: "This is defined as just as string so this is fine for testing",
|
|
60
|
+
time: "This is defined as just as string so this is fine for testing"
|
|
61
|
+
};
|
|
62
|
+
const testInferedTypeCompatibility = {
|
|
63
|
+
title: "test for lossless 'as' syntax",
|
|
64
|
+
body: "when declaring this variable, this definition is expected to be compatible with the ComponentProps type",
|
|
65
|
+
time: "abc"
|
|
66
|
+
};
|
|
67
|
+
const testDefinitionAsConst = {
|
|
68
|
+
title: "System Message",
|
|
69
|
+
body: "This is defined as just as string so this is fine for testing",
|
|
70
|
+
time: "This is defined as just as string so this is fine for testing"
|
|
71
|
+
};
|
|
72
|
+
const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.SystemMessage, { ...testExplicitDefinition }),
|
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.SystemMessage, { ...testInferedTypeCompatibility }),
|
|
75
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.SystemMessage, { ...testDefinitionAsConst }),
|
|
76
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
77
|
+
import__.SystemMessage,
|
|
78
|
+
{
|
|
79
|
+
title: "System Message",
|
|
80
|
+
body: "This is defined as just as string so this is fine for testing",
|
|
81
|
+
time: "This is defined as just as string so this is fine for testing"
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
] });
|
|
85
|
+
//# sourceMappingURL=typescript-system-message-valid.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-system-message-valid.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { SystemMessage } from '../index.js';\nimport type { DSChatSystemMessageT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSChatSystemMessageT.Props;\ntype ComponentPropsInternals = DSChatSystemMessageT.InternalProps;\ntype ComponentPropsDefaultProps = DSChatSystemMessageT.DefaultProps;\ntype ComponentPropsOptionalProps = DSChatSystemMessageT.OptionalProps;\ntype ComponentPropsRequiredProps = DSChatSystemMessageT.RequiredProps;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {\n body: 'This is defined as just as string so this is fine for testing',\n};\nconst testOptionalProps: ComponentPropsOptionalProps = {\n time: 'This is defined as just as string so this is fine for testing',\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {};\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n title: 'System Message',\n};\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n title: 'System Message',\n body: 'This is defined as just as string so this is fine for testing',\n time: 'This is defined as just as string so this is fine for testing',\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n title: \"test for lossless 'as' syntax\",\n body: 'when declaring this variable, this definition is expected to be compatible with the ComponentProps type',\n time: 'abc',\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n title: 'System Message',\n body: 'This is defined as just as string so this is fine for testing',\n time: 'This is defined as just as string so this is fine for testing',\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <SystemMessage {...testExplicitDefinition} />\n <SystemMessage {...testInferedTypeCompatibility} />\n <SystemMessage {...testDefinitionAsConst} />\n {/* works with inline values */}\n <SystemMessage\n title=\"System Message\"\n body=\"This is defined as just as string so this is fine for testing\"\n time=\"This is defined as just as string so this is fine for testing\"\n />\n </>\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACmErB;AAlEF,eAA8B;AAU9B,MAAM,oBAAiD;AAAA,EACrD,MAAM;AACR;AACA,MAAM,oBAAiD;AAAA,EACrD,MAAM;AACR;AAIA,MAAM,sBAA2D,CAAC;AAClE,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AACA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,uBAA6D;AAAA,EACjE,OAAO;AACT;AACA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AACA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AACR;AAGA,MAAM,+BAA+B;AAAA,EACnC,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,wBAAwB;AAAA,EAC5B,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,wBAAwB,MAC5B,4EAEE;AAAA,8CAAC,0BAAe,GAAG,wBAAwB;AAAA,EAC3C,4CAAC,0BAAe,GAAG,8BAA8B;AAAA,EACjD,4CAAC,0BAAe,GAAG,uBAAuB;AAAA,EAE1C;AAAA,IAAC;AAAA;AAAA,MACC,OAAM;AAAA,MACN,MAAK;AAAA,MACL,MAAK;AAAA;AAAA,EACP;AAAA,GACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const ChatSystemMessageDataTestIds = {
|
|
3
|
+
SYSTEM_MSG_TITLE: "chat-system-message-title",
|
|
4
|
+
SYSTEM_MSG_BODY: "chat-system-message-body",
|
|
5
|
+
SYSTEM_MSG_TIME: "chat-system-message-time"
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
ChatSystemMessageDataTestIds
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=ChatSystemMessageDataTestIds.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/ChatSystemMessageDataTestIds.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const ChatSystemMessageDataTestIds = {\n SYSTEM_MSG_TITLE: 'chat-system-message-title',\n SYSTEM_MSG_BODY: 'chat-system-message-body',\n SYSTEM_MSG_TIME: 'chat-system-message-time',\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,+BAA+B;AAAA,EAC1C,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,iBAAiB;AACnB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSChatSystemMessageDefinitions.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DSChatSystemMessageName = 'DSChatSystemMessage';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,0BAA0B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { describe, useValidateTypescriptPropTypes, useMemoMergePropsWithDefault } from "@elliemae/ds-legacy-props-helpers";
|
|
4
|
+
import { Wrapper, Header, Title, Time, Message } from "./style.js";
|
|
5
|
+
import { systemMessageProps, defaultProps } from "./react-desc-prop-types.js";
|
|
6
|
+
import { ChatSystemMessageDataTestIds } from "./ChatSystemMessageDataTestIds.js";
|
|
7
|
+
import { DSChatSystemMessageName } from "./DSChatSystemMessageDefinitions.js";
|
|
8
|
+
const SystemMessage = (props) => {
|
|
9
|
+
const propsWithDefault = useMemoMergePropsWithDefault(props, defaultProps);
|
|
10
|
+
useValidateTypescriptPropTypes(propsWithDefault, systemMessageProps, DSChatSystemMessageName);
|
|
11
|
+
const {
|
|
12
|
+
title,
|
|
13
|
+
time = null,
|
|
14
|
+
// undefined is technically not a valid React node, it should be null instead
|
|
15
|
+
body
|
|
16
|
+
} = propsWithDefault;
|
|
17
|
+
return /* @__PURE__ */ jsxs(Wrapper, { rows: ["auto", "auto"], cols: [1], children: [
|
|
18
|
+
/* @__PURE__ */ jsxs(Header, { cols: ["1fr", "auto", "1fr"], children: [
|
|
19
|
+
/* @__PURE__ */ jsx("span", {}),
|
|
20
|
+
/* @__PURE__ */ jsx(Title, { "data-testid": ChatSystemMessageDataTestIds.SYSTEM_MSG_TITLE, children: title }),
|
|
21
|
+
/* @__PURE__ */ jsx(Time, { "data-testid": ChatSystemMessageDataTestIds.SYSTEM_MSG_TIME, children: time })
|
|
22
|
+
] }),
|
|
23
|
+
/* @__PURE__ */ jsx(Message, { "data-testid": ChatSystemMessageDataTestIds.SYSTEM_MSG_BODY, children: body })
|
|
24
|
+
] });
|
|
25
|
+
};
|
|
26
|
+
SystemMessage.propTypes = systemMessageProps;
|
|
27
|
+
SystemMessage.displayName = DSChatSystemMessageName;
|
|
28
|
+
const SystemMessageWithSchema = describe(SystemMessage);
|
|
29
|
+
SystemMessageWithSchema.propTypes = systemMessageProps;
|
|
30
|
+
export {
|
|
31
|
+
SystemMessage,
|
|
32
|
+
SystemMessageWithSchema
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=SystemMessage.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/SystemMessage.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { WeakValidationMap } from 'react';\nimport React from 'react';\nimport { describe, useValidateTypescriptPropTypes, useMemoMergePropsWithDefault } from '@elliemae/ds-legacy-props-helpers';\nimport { Wrapper, Header, Title, Time, Message } from './style.js';\nimport type { DSChatSystemMessageT } from './react-desc-prop-types.js';\nimport { systemMessageProps, defaultProps } from './react-desc-prop-types.js';\nimport { ChatSystemMessageDataTestIds } from './ChatSystemMessageDataTestIds.js';\nimport { DSChatSystemMessageName } from './DSChatSystemMessageDefinitions.js';\n\nconst SystemMessage: React.ComponentType<DSChatSystemMessageT.Props> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSChatSystemMessageT.InternalProps>(props, defaultProps);\n useValidateTypescriptPropTypes(propsWithDefault, systemMessageProps, DSChatSystemMessageName);\n\n const {\n title,\n time = null, // undefined is technically not a valid React node, it should be null instead\n body,\n } = propsWithDefault;\n return (\n <Wrapper rows={['auto', 'auto']} cols={[1]}>\n <Header cols={['1fr', 'auto', '1fr']}>\n <span />\n <Title data-testid={ChatSystemMessageDataTestIds.SYSTEM_MSG_TITLE}>{title}</Title>\n <Time data-testid={ChatSystemMessageDataTestIds.SYSTEM_MSG_TIME}>{time}</Time>\n </Header>\n <Message data-testid={ChatSystemMessageDataTestIds.SYSTEM_MSG_BODY}>{body}</Message>\n </Wrapper>\n );\n};\n\nSystemMessage.propTypes = systemMessageProps as WeakValidationMap<unknown>;\nSystemMessage.displayName = DSChatSystemMessageName;\nconst SystemMessageWithSchema = describe(SystemMessage);\nSystemMessageWithSchema.propTypes = systemMessageProps as WeakValidationMap<unknown>;\n\nexport { SystemMessage, SystemMessageWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACoBjB,SACE,KADF;AAlBN,SAAS,UAAU,gCAAgC,oCAAoC;AACvF,SAAS,SAAS,QAAQ,OAAO,MAAM,eAAe;AAEtD,SAAS,oBAAoB,oBAAoB;AACjD,SAAS,oCAAoC;AAC7C,SAAS,+BAA+B;AAExC,MAAM,gBAAiE,CAAC,UAAU;AAChF,QAAM,mBAAmB,6BAAiE,OAAO,YAAY;AAC7G,iCAA+B,kBAAkB,oBAAoB,uBAAuB;AAE5F,QAAM;AAAA,IACJ;AAAA,IACA,OAAO;AAAA;AAAA,IACP;AAAA,EACF,IAAI;AACJ,SACE,qBAAC,WAAQ,MAAM,CAAC,QAAQ,MAAM,GAAG,MAAM,CAAC,CAAC,GACvC;AAAA,yBAAC,UAAO,MAAM,CAAC,OAAO,QAAQ,KAAK,GACjC;AAAA,0BAAC,UAAK;AAAA,MACN,oBAAC,SAAM,eAAa,6BAA6B,kBAAmB,iBAAM;AAAA,MAC1E,oBAAC,QAAK,eAAa,6BAA6B,iBAAkB,gBAAK;AAAA,OACzE;AAAA,IACA,oBAAC,WAAQ,eAAa,6BAA6B,iBAAkB,gBAAK;AAAA,KAC5E;AAEJ;AAEA,cAAc,YAAY;AAC1B,cAAc,cAAc;AAC5B,MAAM,0BAA0B,SAAS,aAAa;AACtD,wBAAwB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { SystemMessage, SystemMessageWithSchema } from "./SystemMessage.js";
|
|
3
|
+
import { ChatSystemMessageDataTestIds } from "./ChatSystemMessageDataTestIds.js";
|
|
4
|
+
export * from "./style.js";
|
|
5
|
+
export {
|
|
6
|
+
ChatSystemMessageDataTestIds,
|
|
7
|
+
SystemMessage,
|
|
8
|
+
SystemMessageWithSchema
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type {} from '@elliemae/ds-legacy-props-helpers';\nexport { SystemMessage, SystemMessageWithSchema } from './SystemMessage.js';\nexport { ChatSystemMessageDataTestIds } from './ChatSystemMessageDataTestIds.js';\nexport * from './style.js';\nexport type { DSChatSystemMessageT } from './react-desc-prop-types.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,eAAe,+BAA+B;AACvD,SAAS,oCAAoC;AAC7C,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PropTypes } from "@elliemae/ds-legacy-props-helpers";
|
|
3
|
+
const defaultProps = {
|
|
4
|
+
title: "System Message"
|
|
5
|
+
};
|
|
6
|
+
const systemMessageProps = {
|
|
7
|
+
body: PropTypes.string.isRequired.description("message"),
|
|
8
|
+
title: PropTypes.string.description("Message title").defaultValue("System Message"),
|
|
9
|
+
time: PropTypes.string.description("data of the message, ie: hour")
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
defaultProps,
|
|
13
|
+
systemMessageProps
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-empty-interface */\nimport { PropTypes } from '@elliemae/ds-legacy-props-helpers';\n// import type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-legacy-props-helpers';\n\nexport declare namespace DSChatSystemMessageT {\n export interface DefaultProps {\n title: string;\n }\n export interface OptionalProps {\n time?: string;\n }\n export interface RequiredProps {\n body: string;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n // currently the component doesn't accept global attributes...\n // Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n // XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n // currently the component doesn't accept global attributes...\n // Omit<GlobalAttributesT<HTMLButtonElement>, keyof DefaultProps | keyof OptionalProps | keyof RequiredProps>,\n // XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSChatSystemMessageT.DefaultProps = {\n title: 'System Message',\n};\n\nexport const systemMessageProps = {\n body: PropTypes.string.isRequired.description('message'),\n title: PropTypes.string.description('Message title').defaultValue('System Message'),\n time: PropTypes.string.description('data of the message, ie: hour'),\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,iBAAiB;AA+BnB,MAAM,eAAkD;AAAA,EAC7D,OAAO;AACT;AAEO,MAAM,qBAAqB;AAAA,EAChC,MAAM,UAAU,OAAO,WAAW,YAAY,SAAS;AAAA,EACvD,OAAO,UAAU,OAAO,YAAY,eAAe,EAAE,aAAa,gBAAgB;AAAA,EAClF,MAAM,UAAU,OAAO,YAAY,+BAA+B;AACpE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { styled, css } from "@elliemae/ds-legacy-system";
|
|
3
|
+
import { Grid } from "@elliemae/ds-legacy-grid";
|
|
4
|
+
const wrapRule = css`
|
|
5
|
+
overflow-wrap: break-word;
|
|
6
|
+
white-space: 'pre-wrap';
|
|
7
|
+
`;
|
|
8
|
+
const Wrapper = styled(Grid)`
|
|
9
|
+
align-items: center;
|
|
10
|
+
max-width: 100%;
|
|
11
|
+
padding: 0 8px 8px;
|
|
12
|
+
border: 1px solid ${(props) => props.theme.colors.neutral["100"]};
|
|
13
|
+
border-radius: 10px;
|
|
14
|
+
background-color: ${(props) => props.theme.colors.neutral["080"]};
|
|
15
|
+
box-shadow: none;
|
|
16
|
+
`;
|
|
17
|
+
const Header = styled(Grid)`
|
|
18
|
+
align-items: center;
|
|
19
|
+
height: 36px;
|
|
20
|
+
`;
|
|
21
|
+
const Title = styled.p`
|
|
22
|
+
font-size: 14px;
|
|
23
|
+
font-weight: ${(props) => props.theme.fontWeights.semibold};
|
|
24
|
+
color: ${(props) => props.theme.colors.neutral["700"]};
|
|
25
|
+
margin: 0;
|
|
26
|
+
padding-left: 16px;
|
|
27
|
+
padding-right: 16px;
|
|
28
|
+
${wrapRule}
|
|
29
|
+
`;
|
|
30
|
+
const Time = styled.p`
|
|
31
|
+
font-size: 12px;
|
|
32
|
+
font-weight: ${(props) => props.theme.fontWeights.regular};
|
|
33
|
+
color: ${(props) => props.theme.colors.neutral["700"]};
|
|
34
|
+
margin: 0;
|
|
35
|
+
text-align: right;
|
|
36
|
+
`;
|
|
37
|
+
const Message = styled.p`
|
|
38
|
+
font-size: 13px;
|
|
39
|
+
font-weight: ${(props) => props.theme.fontWeights.regular};
|
|
40
|
+
color: ${(props) => props.theme.colors.neutral["700"]};
|
|
41
|
+
min-height: 32px;
|
|
42
|
+
text-align: center;
|
|
43
|
+
margin: 0;
|
|
44
|
+
${wrapRule}
|
|
45
|
+
`;
|
|
46
|
+
export {
|
|
47
|
+
Header,
|
|
48
|
+
Message,
|
|
49
|
+
Time,
|
|
50
|
+
Title,
|
|
51
|
+
Wrapper
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=style.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/style.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, css } from '@elliemae/ds-legacy-system';\nimport { Grid } from '@elliemae/ds-legacy-grid';\n\nconst wrapRule = css`\n overflow-wrap: break-word;\n white-space: 'pre-wrap';\n`;\nconst Wrapper = styled(Grid)`\n align-items: center;\n max-width: 100%;\n padding: 0 8px 8px;\n border: 1px solid ${(props) => props.theme.colors.neutral['100']};\n border-radius: 10px;\n background-color: ${(props) => props.theme.colors.neutral['080']};\n box-shadow: none;\n`;\n\nconst Header = styled(Grid)`\n align-items: center;\n height: 36px;\n`;\n\nconst Title = styled.p`\n font-size: 14px;\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n color: ${(props) => props.theme.colors.neutral['700']};\n margin: 0;\n padding-left: 16px;\n padding-right: 16px;\n ${wrapRule}\n`;\n\nconst Time = styled.p`\n font-size: 12px;\n font-weight: ${(props) => props.theme.fontWeights.regular};\n color: ${(props) => props.theme.colors.neutral['700']};\n margin: 0;\n text-align: right;\n`;\n\nconst Message = styled.p`\n font-size: 13px;\n font-weight: ${(props) => props.theme.fontWeights.regular};\n color: ${(props) => props.theme.colors.neutral['700']};\n min-height: 32px;\n text-align: center;\n margin: 0;\n ${wrapRule}\n`;\n\nexport { Wrapper, Header, Title, Time, Message };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,WAAW;AAC5B,SAAS,YAAY;AAErB,MAAM,WAAW;AAAA;AAAA;AAAA;AAIjB,MAAM,UAAU,OAAO,IAAI;AAAA;AAAA;AAAA;AAAA,sBAIL,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA;AAAA,sBAE3C,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA;AAAA;AAIjE,MAAM,SAAS,OAAO,IAAI;AAAA;AAAA;AAAA;AAK1B,MAAM,QAAQ,OAAO;AAAA;AAAA,iBAEJ,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,WACzC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA;AAAA;AAAA;AAAA,IAIlD;AAAA;AAGJ,MAAM,OAAO,OAAO;AAAA;AAAA,iBAEH,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,WACzC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA;AAAA;AAAA;AAKtD,MAAM,UAAU,OAAO;AAAA;AAAA,iBAEN,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,WACzC,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,KAAK;AAAA;AAAA;AAAA;AAAA,IAIlD;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { SystemMessage } from "../index.js";
|
|
4
|
+
const testRequiredProps = {
|
|
5
|
+
body: "This is defined as just as string so this is fine for testing"
|
|
6
|
+
};
|
|
7
|
+
const testOptionalProps = {
|
|
8
|
+
time: "This is defined as just as string so this is fine for testing"
|
|
9
|
+
};
|
|
10
|
+
const testPartialDefaults = {};
|
|
11
|
+
const testProps = {
|
|
12
|
+
...testRequiredProps,
|
|
13
|
+
...testOptionalProps,
|
|
14
|
+
...testPartialDefaults
|
|
15
|
+
};
|
|
16
|
+
const testPropsAsSyntax = {
|
|
17
|
+
...testRequiredProps,
|
|
18
|
+
...testOptionalProps,
|
|
19
|
+
...testPartialDefaults
|
|
20
|
+
};
|
|
21
|
+
const testCompleteDefaults = {
|
|
22
|
+
title: "System Message"
|
|
23
|
+
};
|
|
24
|
+
const testInternalProps = {
|
|
25
|
+
...testRequiredProps,
|
|
26
|
+
...testOptionalProps,
|
|
27
|
+
...testCompleteDefaults
|
|
28
|
+
};
|
|
29
|
+
const testInternalPropsAsSyntax = {
|
|
30
|
+
...testRequiredProps,
|
|
31
|
+
...testOptionalProps,
|
|
32
|
+
...testCompleteDefaults
|
|
33
|
+
};
|
|
34
|
+
const testExplicitDefinition = {
|
|
35
|
+
title: "System Message",
|
|
36
|
+
body: "This is defined as just as string so this is fine for testing",
|
|
37
|
+
time: "This is defined as just as string so this is fine for testing"
|
|
38
|
+
};
|
|
39
|
+
const testInferedTypeCompatibility = {
|
|
40
|
+
title: "test for lossless 'as' syntax",
|
|
41
|
+
body: "when declaring this variable, this definition is expected to be compatible with the ComponentProps type",
|
|
42
|
+
time: "abc"
|
|
43
|
+
};
|
|
44
|
+
const testDefinitionAsConst = {
|
|
45
|
+
title: "System Message",
|
|
46
|
+
body: "This is defined as just as string so this is fine for testing",
|
|
47
|
+
time: "This is defined as just as string so this is fine for testing"
|
|
48
|
+
};
|
|
49
|
+
const ExampleUsageComponent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
50
|
+
/* @__PURE__ */ jsx(SystemMessage, { ...testExplicitDefinition }),
|
|
51
|
+
/* @__PURE__ */ jsx(SystemMessage, { ...testInferedTypeCompatibility }),
|
|
52
|
+
/* @__PURE__ */ jsx(SystemMessage, { ...testDefinitionAsConst }),
|
|
53
|
+
/* @__PURE__ */ jsx(
|
|
54
|
+
SystemMessage,
|
|
55
|
+
{
|
|
56
|
+
title: "System Message",
|
|
57
|
+
body: "This is defined as just as string so this is fine for testing",
|
|
58
|
+
time: "This is defined as just as string so this is fine for testing"
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
] });
|
|
62
|
+
//# sourceMappingURL=typescript-system-message-valid.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-system-message-valid.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { SystemMessage } from '../index.js';\nimport type { DSChatSystemMessageT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSChatSystemMessageT.Props;\ntype ComponentPropsInternals = DSChatSystemMessageT.InternalProps;\ntype ComponentPropsDefaultProps = DSChatSystemMessageT.DefaultProps;\ntype ComponentPropsOptionalProps = DSChatSystemMessageT.OptionalProps;\ntype ComponentPropsRequiredProps = DSChatSystemMessageT.RequiredProps;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {\n body: 'This is defined as just as string so this is fine for testing',\n};\nconst testOptionalProps: ComponentPropsOptionalProps = {\n time: 'This is defined as just as string so this is fine for testing',\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {};\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n title: 'System Message',\n};\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n title: 'System Message',\n body: 'This is defined as just as string so this is fine for testing',\n time: 'This is defined as just as string so this is fine for testing',\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n title: \"test for lossless 'as' syntax\",\n body: 'when declaring this variable, this definition is expected to be compatible with the ComponentProps type',\n time: 'abc',\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n title: 'System Message',\n body: 'This is defined as just as string so this is fine for testing',\n time: 'This is defined as just as string so this is fine for testing',\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <SystemMessage {...testExplicitDefinition} />\n <SystemMessage {...testInferedTypeCompatibility} />\n <SystemMessage {...testDefinitionAsConst} />\n {/* works with inline values */}\n <SystemMessage\n title=\"System Message\"\n body=\"This is defined as just as string so this is fine for testing\"\n time=\"This is defined as just as string so this is fine for testing\"\n />\n </>\n);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACmErB,mBAEE,KAFF;AAlEF,SAAS,qBAAqB;AAU9B,MAAM,oBAAiD;AAAA,EACrD,MAAM;AACR;AACA,MAAM,oBAAiD;AAAA,EACrD,MAAM;AACR;AAIA,MAAM,sBAA2D,CAAC;AAClE,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AACA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,uBAA6D;AAAA,EACjE,OAAO;AACT;AACA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AACA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AACR;AAGA,MAAM,+BAA+B;AAAA,EACnC,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,wBAAwB;AAAA,EAC5B,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,wBAAwB,MAC5B,iCAEE;AAAA,sBAAC,iBAAe,GAAG,wBAAwB;AAAA,EAC3C,oBAAC,iBAAe,GAAG,8BAA8B;AAAA,EACjD,oBAAC,iBAAe,GAAG,uBAAuB;AAAA,EAE1C;AAAA,IAAC;AAAA;AAAA,MACC,OAAM;AAAA,MACN,MAAK;AAAA,MACL,MAAK;AAAA;AAAA,EACP;AAAA,GACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DSChatSystemMessageName = "DSChatSystemMessage";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DSChatSystemMessageT } from './react-desc-prop-types.js';
|
|
3
|
+
declare const SystemMessage: React.ComponentType<DSChatSystemMessageT.Props>;
|
|
4
|
+
declare const SystemMessageWithSchema: import("@elliemae/ds-legacy-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSChatSystemMessageT.Props>;
|
|
5
|
+
export { SystemMessage, SystemMessageWithSchema };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare namespace DSChatSystemMessageT {
|
|
2
|
+
interface DefaultProps {
|
|
3
|
+
title: string;
|
|
4
|
+
}
|
|
5
|
+
interface OptionalProps {
|
|
6
|
+
time?: string;
|
|
7
|
+
}
|
|
8
|
+
interface RequiredProps {
|
|
9
|
+
body: string;
|
|
10
|
+
}
|
|
11
|
+
interface Props extends Partial<DefaultProps>, OptionalProps, RequiredProps {
|
|
12
|
+
}
|
|
13
|
+
interface InternalProps extends DefaultProps, OptionalProps, RequiredProps {
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export declare const defaultProps: DSChatSystemMessageT.DefaultProps;
|
|
17
|
+
export declare const systemMessageProps: {
|
|
18
|
+
body: import("@elliemae/ds-legacy-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
19
|
+
title: import("@elliemae/ds-legacy-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
20
|
+
time: import("@elliemae/ds-legacy-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
21
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const Wrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-legacy-grid").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>, import("@elliemae/ds-legacy-system").Theme, object & import("@elliemae/ds-legacy-system").OwnerInterface, never>;
|
|
3
|
+
declare const Header: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-legacy-grid").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>, import("@elliemae/ds-legacy-system").Theme, object & import("@elliemae/ds-legacy-system").OwnerInterface, never>;
|
|
4
|
+
declare const Title: import("styled-components").StyledComponent<"p", import("@elliemae/ds-legacy-system").Theme, object & import("@elliemae/ds-legacy-system").OwnerInterface, never>;
|
|
5
|
+
declare const Time: import("styled-components").StyledComponent<"p", import("@elliemae/ds-legacy-system").Theme, object & import("@elliemae/ds-legacy-system").OwnerInterface, never>;
|
|
6
|
+
declare const Message: import("styled-components").StyledComponent<"p", import("@elliemae/ds-legacy-system").Theme, object & import("@elliemae/ds-legacy-system").OwnerInterface, never>;
|
|
7
|
+
export { Wrapper, Header, Title, Time, Message };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@elliemae/ds-legacy-chat-system-message",
|
|
3
|
+
"version": "1.0.0-rc.1",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "ICE MT - Dimsum - Chat System Message",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"module": "./dist/esm/index.js",
|
|
10
|
+
"main": "./dist/cjs/index.js",
|
|
11
|
+
"types": "./dist/types/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./dist/esm/index.js",
|
|
15
|
+
"require": "./dist/cjs/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./styled": {
|
|
18
|
+
"import": "./dist/esm/styled.js",
|
|
19
|
+
"require": "./dist/cjs/styled.js"
|
|
20
|
+
},
|
|
21
|
+
"./props": {
|
|
22
|
+
"import": "./dist/esm/props.js",
|
|
23
|
+
"require": "./dist/cjs/props.js"
|
|
24
|
+
},
|
|
25
|
+
"./SystemMessage": {
|
|
26
|
+
"import": "./dist/esm/SystemMessage.js",
|
|
27
|
+
"require": "./dist/cjs/SystemMessage.js"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://git.elliemae.io/platform-ui/dimsum-legacy.git"
|
|
33
|
+
},
|
|
34
|
+
"engines": {
|
|
35
|
+
"pnpm": ">=6",
|
|
36
|
+
"node": ">=16"
|
|
37
|
+
},
|
|
38
|
+
"author": "ICE MT",
|
|
39
|
+
"jestSonar": {
|
|
40
|
+
"sonar56x": true,
|
|
41
|
+
"reportPath": "reports",
|
|
42
|
+
"reportFile": "tests.xml",
|
|
43
|
+
"indent": 4
|
|
44
|
+
},
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public",
|
|
47
|
+
"typeSafety": true
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@elliemae/ds-legacy-grid": "1.0.0-rc.1",
|
|
51
|
+
"@elliemae/ds-legacy-props-helpers": "1.0.0-rc.1",
|
|
52
|
+
"@elliemae/ds-legacy-system": "1.0.0-rc.1"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@elliemae/pui-cli": "~9.0.0-next.31",
|
|
56
|
+
"styled-components": "~5.3.9",
|
|
57
|
+
"@elliemae/ds-legacy-monorepo-devops": "1.0.0-rc.1"
|
|
58
|
+
},
|
|
59
|
+
"peerDependencies": {
|
|
60
|
+
"lodash": "^4.17.21",
|
|
61
|
+
"react": "^17.0.2",
|
|
62
|
+
"react-dom": "^17.0.2",
|
|
63
|
+
"styled-components": "~5.3.9"
|
|
64
|
+
},
|
|
65
|
+
"scripts": {
|
|
66
|
+
"test": "pui-cli test --passWithNoTests",
|
|
67
|
+
"lint": "node ../../../scripts/lint.mjs",
|
|
68
|
+
"eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../../.eslintrc.js' src/",
|
|
69
|
+
"dts": "node ../../../scripts/dts.mjs",
|
|
70
|
+
"dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
|
|
71
|
+
"build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
|
|
72
|
+
"dev:build": "pnpm --filter {.}... build",
|
|
73
|
+
"dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
|
|
74
|
+
"checkDeps": "npm exec ../../util/ds-codemods -- check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
|
|
75
|
+
}
|
|
76
|
+
}
|