@elliemae/ds-chat-message-delimeter 3.28.1-rc.2 → 3.29.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/MessageDelimiter.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/typescript-testing/typescript-chat-message-delimeter-valid.js +74 -0
- package/dist/cjs/typescript-testing/typescript-chat-message-delimeter-valid.js.map +7 -0
- package/dist/esm/MessageDelimiter.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/typescript-testing/typescript-chat-message-delimeter-valid.js +51 -0
- package/dist/esm/typescript-testing/typescript-chat-message-delimeter-valid.js.map +7 -0
- package/dist/types/react-desc-prop-types.d.ts +3 -1
- package/dist/types/typescript-testing/typescript-chat-message-delimeter-valid.d.ts +1 -0
- package/package.json +5 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/MessageDelimiter.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport React from 'react';\nimport {\n describe,\n useGetGlobalAttributes,\n useValidateTypescriptPropTypes,\n useMemoMergePropsWithDefault,\n} from '@elliemae/ds-props-helpers';\nimport { Wrapper, Line, Text } from './styled.js';\nimport type { DSChatMessageDelimeterT } from './react-desc-prop-types.js';\nimport { defaultProps, messageDelimiterProps } from './react-desc-prop-types.js';\nimport { DSMessageDelimiterName } from './DSMessageDelimiterDefinitions.js';\n\nconst MessageDelimiter: React.ComponentType<DSChatMessageDelimeterT.Props> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSChatMessageDelimeterT.
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADoBjB;AAlBN,8BAKO;AACP,oBAAoC;AAEpC,mCAAoD;AACpD,2CAAuC;AAEvC,MAAM,mBAAuE,CAAC,UAAU;AACtF,QAAM,uBAAmB,
|
|
4
|
+
"sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport React from 'react';\nimport {\n describe,\n useGetGlobalAttributes,\n useValidateTypescriptPropTypes,\n useMemoMergePropsWithDefault,\n} from '@elliemae/ds-props-helpers';\nimport { Wrapper, Line, Text } from './styled.js';\nimport type { DSChatMessageDelimeterT } from './react-desc-prop-types.js';\nimport { defaultProps, messageDelimiterProps } from './react-desc-prop-types.js';\nimport { DSMessageDelimiterName } from './DSMessageDelimiterDefinitions.js';\n\nconst MessageDelimiter: React.ComponentType<DSChatMessageDelimeterT.Props> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSChatMessageDelimeterT.InternalProps>(props, defaultProps);\n useValidateTypescriptPropTypes(propsWithDefault, messageDelimiterProps, DSMessageDelimiterName);\n const globalAttrs = useGetGlobalAttributes(propsWithDefault);\n const { title, size, verticalMargin } = propsWithDefault;\n return (\n <div {...globalAttrs}>\n <Wrapper cols={['1fr', 'auto', '1fr']}>\n <Line />\n <Text size={size} verticalMargin={verticalMargin} data-testid=\"chat-message-delimiter-title\">\n {title}\n </Text>\n <Line />\n </Wrapper>\n </div>\n );\n};\n\nMessageDelimiter.propTypes = messageDelimiterProps as WeakValidationMap<unknown>;\nMessageDelimiter.displayName = DSMessageDelimiterName;\nconst MessageDelimiterWithSchema = describe(MessageDelimiter);\nMessageDelimiterWithSchema.propTypes = messageDelimiterProps as WeakValidationMap<unknown>;\n\nexport { MessageDelimiter, MessageDelimiterWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADoBjB;AAlBN,8BAKO;AACP,oBAAoC;AAEpC,mCAAoD;AACpD,2CAAuC;AAEvC,MAAM,mBAAuE,CAAC,UAAU;AACtF,QAAM,uBAAmB,sDAAoE,OAAO,yCAAY;AAChH,8DAA+B,kBAAkB,oDAAuB,2DAAsB;AAC9F,QAAM,kBAAc,gDAAuB,gBAAgB;AAC3D,QAAM,EAAE,OAAO,MAAM,eAAe,IAAI;AACxC,SACE,4CAAC,SAAK,GAAG,aACP,uDAAC,yBAAQ,MAAM,CAAC,OAAO,QAAQ,KAAK,GAClC;AAAA,gDAAC,sBAAK;AAAA,IACN,4CAAC,sBAAK,MAAY,gBAAgC,eAAY,gCAC3D,iBACH;AAAA,IACA,4CAAC,sBAAK;AAAA,KACR,GACF;AAEJ;AAEA,iBAAiB,YAAY;AAC7B,iBAAiB,cAAc;AAC/B,MAAM,iCAA6B,kCAAS,gBAAgB;AAC5D,2BAA2B,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/react-desc-prop-types.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { PropTypes, globalAttributesPropTypes } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSChatMessageDelimeterT {\n export interface RequiredProps {\n title: string;\n }\n\n export interface DefaultProps extends Record<string, unknown> {\n size?: 's' | 'l';\n verticalMargin?: number | string | undefined;\n }\n\n export interface Props extends DefaultProps, RequiredProps, Record<string, unknown> {}\n}\n\nexport const defaultProps: DSChatMessageDelimeterT.DefaultProps = {\n size: 's',\n verticalMargin: 0,\n};\n\nexport const messageDelimiterProps = {\n ...globalAttributesPropTypes,\n title: PropTypes.string.isRequired.description('Text to display in the delimiter'),\n size: PropTypes.oneOf(['s', 'l']).description('size of the delimiter').defaultValue('s'),\n verticalMargin: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description(\n 'Configurable css vertical margin property for flexibilty',\n ),\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAAqD;
|
|
4
|
+
"sourcesContent": ["import { PropTypes, globalAttributesPropTypes } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSChatMessageDelimeterT {\n export interface RequiredProps {\n title: string;\n }\n\n export interface DefaultProps extends Record<string, unknown> {\n size?: 's' | 'l';\n verticalMargin?: number | string | undefined;\n }\n\n export interface Props extends Partial<DefaultProps>, RequiredProps, Record<string, unknown> {}\n\n export interface InternalProps extends DefaultProps, RequiredProps, Record<string, unknown> {}\n}\n\nexport const defaultProps: DSChatMessageDelimeterT.DefaultProps = {\n size: 's',\n verticalMargin: 0,\n};\n\nexport const messageDelimiterProps = {\n ...globalAttributesPropTypes,\n title: PropTypes.string.isRequired.description('Text to display in the delimiter'),\n size: PropTypes.oneOf(['s', 'l']).description('size of the delimiter').defaultValue('s'),\n verticalMargin: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description(\n 'Configurable css vertical margin property for flexibilty',\n ),\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAAqD;AAiB9C,MAAM,eAAqD;AAAA,EAChE,MAAM;AAAA,EACN,gBAAgB;AAClB;AAEO,MAAM,wBAAwB;AAAA,EACnC,GAAG;AAAA,EACH,OAAO,kCAAU,OAAO,WAAW,YAAY,kCAAkC;AAAA,EACjF,MAAM,kCAAU,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,YAAY,uBAAuB,EAAE,aAAa,GAAG;AAAA,EACvF,gBAAgB,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,MAAM,CAAC,EAAE;AAAA,IACxE;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,74 @@
|
|
|
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
|
+
title: ""
|
|
29
|
+
};
|
|
30
|
+
const testPartialDefaults = {
|
|
31
|
+
size: "l"
|
|
32
|
+
};
|
|
33
|
+
const testProps = {
|
|
34
|
+
...testRequiredProps,
|
|
35
|
+
...testPartialDefaults
|
|
36
|
+
};
|
|
37
|
+
const testPropsAsSyntax = {
|
|
38
|
+
...testRequiredProps,
|
|
39
|
+
...testPartialDefaults
|
|
40
|
+
};
|
|
41
|
+
const testCompleteDefaults = {
|
|
42
|
+
size: "s",
|
|
43
|
+
verticalMargin: 4
|
|
44
|
+
};
|
|
45
|
+
const testInternalProps = {
|
|
46
|
+
...testRequiredProps,
|
|
47
|
+
...testCompleteDefaults
|
|
48
|
+
};
|
|
49
|
+
const testInternalPropsAsSyntax = {
|
|
50
|
+
...testRequiredProps,
|
|
51
|
+
...testCompleteDefaults
|
|
52
|
+
};
|
|
53
|
+
const testExplicitDefinition = {
|
|
54
|
+
title: "",
|
|
55
|
+
size: "l",
|
|
56
|
+
verticalMargin: 4
|
|
57
|
+
};
|
|
58
|
+
const testInferedTypeCompatibility = {
|
|
59
|
+
title: "",
|
|
60
|
+
size: "l",
|
|
61
|
+
verticalMargin: 4
|
|
62
|
+
};
|
|
63
|
+
const testDefinitionAsConst = {
|
|
64
|
+
title: "",
|
|
65
|
+
size: "l",
|
|
66
|
+
verticalMargin: 4
|
|
67
|
+
};
|
|
68
|
+
const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
69
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.MessageDelimiter, { ...testExplicitDefinition }),
|
|
70
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.MessageDelimiter, { ...testInferedTypeCompatibility }),
|
|
71
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.MessageDelimiter, { ...testDefinitionAsConst }),
|
|
72
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.MessageDelimiter, { title: "Title", size: "s", verticalMargin: 8 })
|
|
73
|
+
] });
|
|
74
|
+
//# sourceMappingURL=typescript-chat-message-delimeter-valid.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-chat-message-delimeter-valid.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { MessageDelimiter } from '../index.js';\nimport type { DSChatMessageDelimeterT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSChatMessageDelimeterT.Props;\ntype ComponentPropsInternals = DSChatMessageDelimeterT.InternalProps;\ntype ComponentPropsDefaultProps = DSChatMessageDelimeterT.DefaultProps;\ntype ComponentPropsRequiredProps = DSChatMessageDelimeterT.RequiredProps;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {\n title: '',\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> = {\n size: 'l',\n};\n\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n size: 's',\n verticalMargin: 4,\n};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testCompleteDefaults,\n};\n\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\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: '',\n size: 'l',\n verticalMargin: 4,\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: '',\n size: 'l',\n verticalMargin: 4,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n title: '',\n size: 'l',\n verticalMargin: 4,\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <MessageDelimiter {...testExplicitDefinition} />\n <MessageDelimiter {...testInferedTypeCompatibility} />\n <MessageDelimiter {...testDefinitionAsConst} />\n {/* works with inline values */}\n <MessageDelimiter title=\"Title\" size=\"s\" verticalMargin={8} />\n </>\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACmErB;AAlEF,eAAiC;AASjC,MAAM,oBAAiD;AAAA,EACrD,OAAO;AACT;AAIA,MAAM,sBAA2D;AAAA,EAC/D,MAAM;AACR;AAEA,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,uBAA6D;AAAA,EACjE,MAAM;AAAA,EACN,gBAAgB;AAClB;AAEA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,OAAO;AAAA,EACP,MAAM;AAAA,EACN,gBAAgB;AAClB;AAGA,MAAM,+BAA+B;AAAA,EACnC,OAAO;AAAA,EACP,MAAM;AAAA,EACN,gBAAgB;AAClB;AAEA,MAAM,wBAAwB;AAAA,EAC5B,OAAO;AAAA,EACP,MAAM;AAAA,EACN,gBAAgB;AAClB;AAEA,MAAM,wBAAwB,MAC5B,4EAEE;AAAA,8CAAC,6BAAkB,GAAG,wBAAwB;AAAA,EAC9C,4CAAC,6BAAkB,GAAG,8BAA8B;AAAA,EACpD,4CAAC,6BAAkB,GAAG,uBAAuB;AAAA,EAE7C,4CAAC,6BAAiB,OAAM,SAAQ,MAAK,KAAI,gBAAgB,GAAG;AAAA,GAC9D;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/MessageDelimiter.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { WeakValidationMap } from 'react';\nimport React from 'react';\nimport {\n describe,\n useGetGlobalAttributes,\n useValidateTypescriptPropTypes,\n useMemoMergePropsWithDefault,\n} from '@elliemae/ds-props-helpers';\nimport { Wrapper, Line, Text } from './styled.js';\nimport type { DSChatMessageDelimeterT } from './react-desc-prop-types.js';\nimport { defaultProps, messageDelimiterProps } from './react-desc-prop-types.js';\nimport { DSMessageDelimiterName } from './DSMessageDelimiterDefinitions.js';\n\nconst MessageDelimiter: React.ComponentType<DSChatMessageDelimeterT.Props> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSChatMessageDelimeterT.
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACoBjB,SACE,KADF;AAlBN;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,SAAS,MAAM,YAAY;AAEpC,SAAS,cAAc,6BAA6B;AACpD,SAAS,8BAA8B;AAEvC,MAAM,mBAAuE,CAAC,UAAU;AACtF,QAAM,mBAAmB,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { WeakValidationMap } from 'react';\nimport React from 'react';\nimport {\n describe,\n useGetGlobalAttributes,\n useValidateTypescriptPropTypes,\n useMemoMergePropsWithDefault,\n} from '@elliemae/ds-props-helpers';\nimport { Wrapper, Line, Text } from './styled.js';\nimport type { DSChatMessageDelimeterT } from './react-desc-prop-types.js';\nimport { defaultProps, messageDelimiterProps } from './react-desc-prop-types.js';\nimport { DSMessageDelimiterName } from './DSMessageDelimiterDefinitions.js';\n\nconst MessageDelimiter: React.ComponentType<DSChatMessageDelimeterT.Props> = (props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSChatMessageDelimeterT.InternalProps>(props, defaultProps);\n useValidateTypescriptPropTypes(propsWithDefault, messageDelimiterProps, DSMessageDelimiterName);\n const globalAttrs = useGetGlobalAttributes(propsWithDefault);\n const { title, size, verticalMargin } = propsWithDefault;\n return (\n <div {...globalAttrs}>\n <Wrapper cols={['1fr', 'auto', '1fr']}>\n <Line />\n <Text size={size} verticalMargin={verticalMargin} data-testid=\"chat-message-delimiter-title\">\n {title}\n </Text>\n <Line />\n </Wrapper>\n </div>\n );\n};\n\nMessageDelimiter.propTypes = messageDelimiterProps as WeakValidationMap<unknown>;\nMessageDelimiter.displayName = DSMessageDelimiterName;\nconst MessageDelimiterWithSchema = describe(MessageDelimiter);\nMessageDelimiterWithSchema.propTypes = messageDelimiterProps as WeakValidationMap<unknown>;\n\nexport { MessageDelimiter, MessageDelimiterWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACoBjB,SACE,KADF;AAlBN;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,SAAS,MAAM,YAAY;AAEpC,SAAS,cAAc,6BAA6B;AACpD,SAAS,8BAA8B;AAEvC,MAAM,mBAAuE,CAAC,UAAU;AACtF,QAAM,mBAAmB,6BAAoE,OAAO,YAAY;AAChH,iCAA+B,kBAAkB,uBAAuB,sBAAsB;AAC9F,QAAM,cAAc,uBAAuB,gBAAgB;AAC3D,QAAM,EAAE,OAAO,MAAM,eAAe,IAAI;AACxC,SACE,oBAAC,SAAK,GAAG,aACP,+BAAC,WAAQ,MAAM,CAAC,OAAO,QAAQ,KAAK,GAClC;AAAA,wBAAC,QAAK;AAAA,IACN,oBAAC,QAAK,MAAY,gBAAgC,eAAY,gCAC3D,iBACH;AAAA,IACA,oBAAC,QAAK;AAAA,KACR,GACF;AAEJ;AAEA,iBAAiB,YAAY;AAC7B,iBAAiB,cAAc;AAC/B,MAAM,6BAA6B,SAAS,gBAAgB;AAC5D,2BAA2B,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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", "import { PropTypes, globalAttributesPropTypes } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSChatMessageDelimeterT {\n export interface RequiredProps {\n title: string;\n }\n\n export interface DefaultProps extends Record<string, unknown> {\n size?: 's' | 'l';\n verticalMargin?: number | string | undefined;\n }\n\n export interface Props extends DefaultProps, RequiredProps, Record<string, unknown> {}\n}\n\nexport const defaultProps: DSChatMessageDelimeterT.DefaultProps = {\n size: 's',\n verticalMargin: 0,\n};\n\nexport const messageDelimiterProps = {\n ...globalAttributesPropTypes,\n title: PropTypes.string.isRequired.description('Text to display in the delimiter'),\n size: PropTypes.oneOf(['s', 'l']).description('size of the delimiter').defaultValue('s'),\n verticalMargin: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description(\n 'Configurable css vertical margin property for flexibilty',\n ),\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,WAAW,iCAAiC;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes, globalAttributesPropTypes } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSChatMessageDelimeterT {\n export interface RequiredProps {\n title: string;\n }\n\n export interface DefaultProps extends Record<string, unknown> {\n size?: 's' | 'l';\n verticalMargin?: number | string | undefined;\n }\n\n export interface Props extends Partial<DefaultProps>, RequiredProps, Record<string, unknown> {}\n\n export interface InternalProps extends DefaultProps, RequiredProps, Record<string, unknown> {}\n}\n\nexport const defaultProps: DSChatMessageDelimeterT.DefaultProps = {\n size: 's',\n verticalMargin: 0,\n};\n\nexport const messageDelimiterProps = {\n ...globalAttributesPropTypes,\n title: PropTypes.string.isRequired.description('Text to display in the delimiter'),\n size: PropTypes.oneOf(['s', 'l']).description('size of the delimiter').defaultValue('s'),\n verticalMargin: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description(\n 'Configurable css vertical margin property for flexibilty',\n ),\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,WAAW,iCAAiC;AAiB9C,MAAM,eAAqD;AAAA,EAChE,MAAM;AAAA,EACN,gBAAgB;AAClB;AAEO,MAAM,wBAAwB;AAAA,EACnC,GAAG;AAAA,EACH,OAAO,UAAU,OAAO,WAAW,YAAY,kCAAkC;AAAA,EACjF,MAAM,UAAU,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,YAAY,uBAAuB,EAAE,aAAa,GAAG;AAAA,EACvF,gBAAgB,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE;AAAA,IACxE;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { MessageDelimiter } from "../index.js";
|
|
4
|
+
const testRequiredProps = {
|
|
5
|
+
title: ""
|
|
6
|
+
};
|
|
7
|
+
const testPartialDefaults = {
|
|
8
|
+
size: "l"
|
|
9
|
+
};
|
|
10
|
+
const testProps = {
|
|
11
|
+
...testRequiredProps,
|
|
12
|
+
...testPartialDefaults
|
|
13
|
+
};
|
|
14
|
+
const testPropsAsSyntax = {
|
|
15
|
+
...testRequiredProps,
|
|
16
|
+
...testPartialDefaults
|
|
17
|
+
};
|
|
18
|
+
const testCompleteDefaults = {
|
|
19
|
+
size: "s",
|
|
20
|
+
verticalMargin: 4
|
|
21
|
+
};
|
|
22
|
+
const testInternalProps = {
|
|
23
|
+
...testRequiredProps,
|
|
24
|
+
...testCompleteDefaults
|
|
25
|
+
};
|
|
26
|
+
const testInternalPropsAsSyntax = {
|
|
27
|
+
...testRequiredProps,
|
|
28
|
+
...testCompleteDefaults
|
|
29
|
+
};
|
|
30
|
+
const testExplicitDefinition = {
|
|
31
|
+
title: "",
|
|
32
|
+
size: "l",
|
|
33
|
+
verticalMargin: 4
|
|
34
|
+
};
|
|
35
|
+
const testInferedTypeCompatibility = {
|
|
36
|
+
title: "",
|
|
37
|
+
size: "l",
|
|
38
|
+
verticalMargin: 4
|
|
39
|
+
};
|
|
40
|
+
const testDefinitionAsConst = {
|
|
41
|
+
title: "",
|
|
42
|
+
size: "l",
|
|
43
|
+
verticalMargin: 4
|
|
44
|
+
};
|
|
45
|
+
const ExampleUsageComponent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
46
|
+
/* @__PURE__ */ jsx(MessageDelimiter, { ...testExplicitDefinition }),
|
|
47
|
+
/* @__PURE__ */ jsx(MessageDelimiter, { ...testInferedTypeCompatibility }),
|
|
48
|
+
/* @__PURE__ */ jsx(MessageDelimiter, { ...testDefinitionAsConst }),
|
|
49
|
+
/* @__PURE__ */ jsx(MessageDelimiter, { title: "Title", size: "s", verticalMargin: 8 })
|
|
50
|
+
] });
|
|
51
|
+
//# sourceMappingURL=typescript-chat-message-delimeter-valid.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-chat-message-delimeter-valid.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { MessageDelimiter } from '../index.js';\nimport type { DSChatMessageDelimeterT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSChatMessageDelimeterT.Props;\ntype ComponentPropsInternals = DSChatMessageDelimeterT.InternalProps;\ntype ComponentPropsDefaultProps = DSChatMessageDelimeterT.DefaultProps;\ntype ComponentPropsRequiredProps = DSChatMessageDelimeterT.RequiredProps;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {\n title: '',\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> = {\n size: 'l',\n};\n\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n size: 's',\n verticalMargin: 4,\n};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testCompleteDefaults,\n};\n\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\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: '',\n size: 'l',\n verticalMargin: 4,\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: '',\n size: 'l',\n verticalMargin: 4,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n title: '',\n size: 'l',\n verticalMargin: 4,\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <MessageDelimiter {...testExplicitDefinition} />\n <MessageDelimiter {...testInferedTypeCompatibility} />\n <MessageDelimiter {...testDefinitionAsConst} />\n {/* works with inline values */}\n <MessageDelimiter title=\"Title\" size=\"s\" verticalMargin={8} />\n </>\n);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACmErB,mBAEE,KAFF;AAlEF,SAAS,wBAAwB;AASjC,MAAM,oBAAiD;AAAA,EACrD,OAAO;AACT;AAIA,MAAM,sBAA2D;AAAA,EAC/D,MAAM;AACR;AAEA,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,uBAA6D;AAAA,EACjE,MAAM;AAAA,EACN,gBAAgB;AAClB;AAEA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,OAAO;AAAA,EACP,MAAM;AAAA,EACN,gBAAgB;AAClB;AAGA,MAAM,+BAA+B;AAAA,EACnC,OAAO;AAAA,EACP,MAAM;AAAA,EACN,gBAAgB;AAClB;AAEA,MAAM,wBAAwB;AAAA,EAC5B,OAAO;AAAA,EACP,MAAM;AAAA,EACN,gBAAgB;AAClB;AAEA,MAAM,wBAAwB,MAC5B,iCAEE;AAAA,sBAAC,oBAAkB,GAAG,wBAAwB;AAAA,EAC9C,oBAAC,oBAAkB,GAAG,8BAA8B;AAAA,EACpD,oBAAC,oBAAkB,GAAG,uBAAuB;AAAA,EAE7C,oBAAC,oBAAiB,OAAM,SAAQ,MAAK,KAAI,gBAAgB,GAAG;AAAA,GAC9D;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -6,7 +6,9 @@ export declare namespace DSChatMessageDelimeterT {
|
|
|
6
6
|
size?: 's' | 'l';
|
|
7
7
|
verticalMargin?: number | string | undefined;
|
|
8
8
|
}
|
|
9
|
-
interface Props extends DefaultProps
|
|
9
|
+
interface Props extends Partial<DefaultProps>, RequiredProps, Record<string, unknown> {
|
|
10
|
+
}
|
|
11
|
+
interface InternalProps extends DefaultProps, RequiredProps, Record<string, unknown> {
|
|
10
12
|
}
|
|
11
13
|
}
|
|
12
14
|
export declare const defaultProps: DSChatMessageDelimeterT.DefaultProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-chat-message-delimeter",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.29.0-next.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Chat Message Delimeter",
|
|
6
6
|
"files": [
|
|
@@ -47,14 +47,14 @@
|
|
|
47
47
|
"typeSafety": true
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@elliemae/ds-grid": "3.
|
|
51
|
-
"@elliemae/ds-props-helpers": "3.
|
|
52
|
-
"@elliemae/ds-system": "3.
|
|
50
|
+
"@elliemae/ds-grid": "3.29.0-next.0",
|
|
51
|
+
"@elliemae/ds-props-helpers": "3.29.0-next.0",
|
|
52
|
+
"@elliemae/ds-system": "3.29.0-next.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@elliemae/pui-cli": "~9.0.0-next.31",
|
|
56
56
|
"styled-components": "~5.3.9",
|
|
57
|
-
"@elliemae/ds-monorepo-devops": "3.
|
|
57
|
+
"@elliemae/ds-monorepo-devops": "3.29.0-next.0"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"lodash": "^4.17.21",
|