@elliemae/ds-comments 3.12.0-rc.2 → 3.12.0-rc.4
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.
|
@@ -61,62 +61,44 @@ const CommentCard = ({
|
|
|
61
61
|
const handleCloseMenu = (0, import_react.useCallback)(() => {
|
|
62
62
|
ref.current.focus();
|
|
63
63
|
}, []);
|
|
64
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
children: [
|
|
73
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_blocks.CommentCardLeft, {
|
|
74
|
-
children:
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
children: [
|
|
91
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
92
|
-
children: "\u2022"
|
|
93
|
-
}),
|
|
94
|
-
type
|
|
95
|
-
]
|
|
96
|
-
})
|
|
97
|
-
]
|
|
98
|
-
})
|
|
99
|
-
]
|
|
100
|
-
}),
|
|
101
|
-
options && options.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.CommentCardMenu, {
|
|
102
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_dropdownmenu.default, {
|
|
64
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
65
|
+
import_blocks.CommentCardWrapper,
|
|
66
|
+
{
|
|
67
|
+
classProps: { borderBottom },
|
|
68
|
+
tabIndex: 0,
|
|
69
|
+
...containerProps,
|
|
70
|
+
style: { ...style, ...containerProps.style || {} },
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_blocks.CommentCardHeader, { classProps: { borderBottom }, children: [
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_blocks.CommentCardLeft, { children: [
|
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.CommentCardName, { children: name }),
|
|
75
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_blocks.CommentCardData, { children: [
|
|
76
|
+
displayDate,
|
|
77
|
+
displayTime && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
78
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "\u2022" }),
|
|
79
|
+
displayTime
|
|
80
|
+
] }),
|
|
81
|
+
type && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
82
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "\u2022" }),
|
|
83
|
+
type
|
|
84
|
+
] })
|
|
85
|
+
] })
|
|
86
|
+
] }),
|
|
87
|
+
options && options.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.CommentCardMenu, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
88
|
+
import_ds_dropdownmenu.default,
|
|
89
|
+
{
|
|
103
90
|
...customDropdownMenuProps,
|
|
104
91
|
onClose: handleCloseMenu,
|
|
105
92
|
options,
|
|
106
93
|
selection,
|
|
107
|
-
triggerComponent: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_button.default, {
|
|
108
|
-
buttonType: "text",
|
|
109
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.MoreOptionsVert, {}),
|
|
110
|
-
innerRef: ref
|
|
111
|
-
}),
|
|
94
|
+
triggerComponent: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_button.default, { buttonType: "text", icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.MoreOptionsVert, {}), innerRef: ref }),
|
|
112
95
|
zIndex: 11
|
|
113
|
-
}
|
|
114
|
-
})
|
|
115
|
-
]
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_read_more.DSReadMore, {
|
|
96
|
+
}
|
|
97
|
+
) })
|
|
98
|
+
] }),
|
|
99
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_blocks.CommentCardContent, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
100
|
+
import_ds_read_more.DSReadMore,
|
|
101
|
+
{
|
|
120
102
|
lines: maxLines,
|
|
121
103
|
content: `${content} `,
|
|
122
104
|
more: "MORE",
|
|
@@ -124,11 +106,11 @@ const CommentCard = ({
|
|
|
124
106
|
buttonType: "text",
|
|
125
107
|
size: "m",
|
|
126
108
|
ellipsis: "... "
|
|
127
|
-
}
|
|
128
|
-
})
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
109
|
+
}
|
|
110
|
+
) }) })
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
);
|
|
132
114
|
};
|
|
133
115
|
const props = {
|
|
134
116
|
containerProps: import_ds_utilities.PropTypes.shape({
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/CommentCard.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport React, { useCallback, useRef } from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\nimport DSButton from '@elliemae/ds-button';\nimport { DSReadMore } from '@elliemae/ds-read-more';\nimport DSDropdownMenu from '@elliemae/ds-dropdownmenu';\nimport { MoreOptionsVert } from '@elliemae/ds-icons';\nimport {\n CommentCardWrapper,\n CommentCardHeader,\n CommentCardContent,\n CommentCardName,\n CommentCardData,\n CommentCardMenu,\n CommentCardLeft,\n} from './blocks';\nimport { getTime, getDisplayDate } from './helper';\n\nconst CommentCard = ({\n containerProps = {},\n name = '',\n date = new Date(),\n type = '',\n content = '',\n style = {},\n options = [],\n selection = { 'single-selection-internal-external': ['set-as-internal'] },\n customDropdownMenuProps = {\n focusOnOpen: true,\n },\n borderBottom,\n dateFormat = 'MM/DD/YYYY',\n timeFormat = 'hh:mm a',\n maxLines = 2,\n}) => {\n const ref = useRef();\n const displayDate = date ? getDisplayDate(date, dateFormat) : null;\n const displayTime = date ? getTime(date, timeFormat) : null;\n\n const handleCloseMenu = useCallback(() => {\n ref.current.focus();\n }, []);\n\n return (\n <CommentCardWrapper\n classProps={{ borderBottom }}\n tabIndex={0}\n {...containerProps}\n style={{ ...style, ...(containerProps.style || {}) }}\n >\n <CommentCardHeader classProps={{ borderBottom }}>\n <CommentCardLeft>\n <CommentCardName>{name}</CommentCardName>\n <CommentCardData>\n {displayDate}\n {displayTime && (\n <>\n <span>\u2022</span>\n {displayTime}\n </>\n )}\n {type && (\n <>\n <span>\u2022</span>\n {type}\n </>\n )}\n </CommentCardData>\n </CommentCardLeft>\n {options && options.length > 0 && (\n <CommentCardMenu>\n <DSDropdownMenu\n {...customDropdownMenuProps}\n onClose={handleCloseMenu}\n options={options}\n selection={selection}\n triggerComponent={<DSButton buttonType=\"text\" icon={<MoreOptionsVert />} innerRef={ref} />}\n zIndex={11} // https://jira.elliemae.io/browse/PUI-1664\n />\n </CommentCardMenu>\n )}\n </CommentCardHeader>\n <CommentCardContent>\n <div>\n <DSReadMore\n lines={maxLines}\n content={`${content} `}\n more=\"MORE\"\n less=\"LESS\"\n buttonType=\"text\"\n size=\"m\"\n ellipsis=\"... \"\n />\n </div>\n </CommentCardContent>\n </CommentCardWrapper>\n );\n};\n\nconst props = {\n /** props to inject to comment card wrapper */\n containerProps: PropTypes.shape({\n id: PropTypes.string,\n 'data-testid': PropTypes.string,\n }).description('props to inject to comment card wrapper'),\n /** form name */\n name: PropTypes.string.description('form name'),\n /** style object */\n style: PropTypes.object.description(' style object '),\n /** date object */\n date: PropTypes.instanceOf(Date).description('date object'),\n /** comment type string */\n type: PropTypes.string.description('comment type string'),\n /** comment content */\n content: PropTypes.string.description('comment content'),\n /** dropdown menu options */\n options: PropTypes.arrayOf(PropTypes.object).description('dropdown menu options'),\n /** dropdown selection */\n selection: PropTypes.object.description('dropdown selection'),\n /** pass down props to dropdown */\n customDropdownMenuProps: PropTypes.shape({\n focusOnOpen: PropTypes.bool,\n }).description('pass down props to dropdown'),\n /** toggle border bottom for card */\n borderBottom: PropTypes.bool.description('toggle border bottom for card'),\n /** moment Year, month, and day tokens https://momentjs.com/docs/#/parsing/string-format/ */\n dateFormat: PropTypes.oneOf(['MM/DD/YYYY', 'MM DD YYYY']).description(\n 'moment Year, month, and day tokens https://momentjs.com/docs/#/parsing/string-format/',\n ),\n /** moment Hour, minute, second, millisecond, and offset tokens https://momentjs.com/docs/#/parsing/string-format/ */\n timeFormat: PropTypes.oneOf(['hh:mm a', 'HH:mm']).description(\n 'moment Hour, minute, second, millisecond, and offset tokens https://momentjs.com/docs/#/parsing/string-format/',\n ),\n /**\n * Max lines\n */\n maxLines: PropTypes.number.description('Max lines'),\n};\n\nCommentCard.propTypes = props;\nCommentCard.displayName = 'CommentCard';\nconst DSCommentCardWithSchema = describe(CommentCard);\nDSCommentCardWithSchema.propTypes = props;\n\nexport default CommentCard;\nexport { DSCommentCardWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADqDb;AAnDV,mBAA2C;AAC3C,0BAAoC;AACpC,uBAAqB;AACrB,0BAA2B;AAC3B,6BAA2B;AAC3B,sBAAgC;AAChC,oBAQO;AACP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,IACd,eAAe,8BAAU;AAAA,EAC3B,CAAC,EAAE,YAAY,yCAAyC;AAAA,EAExD,MAAM,8BAAU,OAAO,YAAY,WAAW;AAAA,EAE9C,OAAO,8BAAU,OAAO,YAAY,gBAAgB;AAAA,EAEpD,MAAM,8BAAU,WAAW,IAAI,EAAE,YAAY,aAAa;AAAA,EAE1D,MAAM,8BAAU,OAAO,YAAY,qBAAqB;AAAA,EAExD,SAAS,8BAAU,OAAO,YAAY,iBAAiB;AAAA,EAEvD,SAAS,8BAAU,QAAQ,8BAAU,MAAM,EAAE,YAAY,uBAAuB;AAAA,EAEhF,WAAW,8BAAU,OAAO,YAAY,oBAAoB;AAAA,EAE5D,yBAAyB,8BAAU,MAAM;AAAA,IACvC,aAAa,8BAAU;AAAA,EACzB,CAAC,EAAE,YAAY,6BAA6B;AAAA,EAE5C,cAAc,8BAAU,KAAK,YAAY,+BAA+B;AAAA,EAExE,YAAY,8BAAU,MAAM,CAAC,cAAc,YAAY,CAAC,EAAE;AAAA,IACxD;AAAA,EACF;AAAA,EAEA,YAAY,8BAAU,MAAM,CAAC,WAAW,OAAO,CAAC,EAAE;AAAA,IAChD;AAAA,EACF;AAAA,EAIA,UAAU,8BAAU,OAAO,YAAY,WAAW;AACpD;AAEA,YAAY,YAAY;AACxB,YAAY,cAAc;AAC1B,MAAM,8BAA0B,8BAAS,WAAW;AACpD,wBAAwB,YAAY;AAEpC,IAAO,sBAAQ;",
|
|
6
6
|
"names": ["DSDropdownMenu", "DSButton"]
|
|
7
7
|
}
|
|
@@ -39,62 +39,44 @@ const CommentCard = ({
|
|
|
39
39
|
const handleCloseMenu = useCallback(() => {
|
|
40
40
|
ref.current.focus();
|
|
41
41
|
}, []);
|
|
42
|
-
return /* @__PURE__ */ jsxs(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
children: [
|
|
51
|
-
/* @__PURE__ */ jsxs(CommentCardLeft, {
|
|
52
|
-
children:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
children: [
|
|
69
|
-
/* @__PURE__ */ jsx("span", {
|
|
70
|
-
children: "\u2022"
|
|
71
|
-
}),
|
|
72
|
-
type
|
|
73
|
-
]
|
|
74
|
-
})
|
|
75
|
-
]
|
|
76
|
-
})
|
|
77
|
-
]
|
|
78
|
-
}),
|
|
79
|
-
options && options.length > 0 && /* @__PURE__ */ jsx(CommentCardMenu, {
|
|
80
|
-
children: /* @__PURE__ */ jsx(DSDropdownMenu, {
|
|
42
|
+
return /* @__PURE__ */ jsxs(
|
|
43
|
+
CommentCardWrapper,
|
|
44
|
+
{
|
|
45
|
+
classProps: { borderBottom },
|
|
46
|
+
tabIndex: 0,
|
|
47
|
+
...containerProps,
|
|
48
|
+
style: { ...style, ...containerProps.style || {} },
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ jsxs(CommentCardHeader, { classProps: { borderBottom }, children: [
|
|
51
|
+
/* @__PURE__ */ jsxs(CommentCardLeft, { children: [
|
|
52
|
+
/* @__PURE__ */ jsx(CommentCardName, { children: name }),
|
|
53
|
+
/* @__PURE__ */ jsxs(CommentCardData, { children: [
|
|
54
|
+
displayDate,
|
|
55
|
+
displayTime && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
56
|
+
/* @__PURE__ */ jsx("span", { children: "\u2022" }),
|
|
57
|
+
displayTime
|
|
58
|
+
] }),
|
|
59
|
+
type && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
60
|
+
/* @__PURE__ */ jsx("span", { children: "\u2022" }),
|
|
61
|
+
type
|
|
62
|
+
] })
|
|
63
|
+
] })
|
|
64
|
+
] }),
|
|
65
|
+
options && options.length > 0 && /* @__PURE__ */ jsx(CommentCardMenu, { children: /* @__PURE__ */ jsx(
|
|
66
|
+
DSDropdownMenu,
|
|
67
|
+
{
|
|
81
68
|
...customDropdownMenuProps,
|
|
82
69
|
onClose: handleCloseMenu,
|
|
83
70
|
options,
|
|
84
71
|
selection,
|
|
85
|
-
triggerComponent: /* @__PURE__ */ jsx(DSButton, {
|
|
86
|
-
buttonType: "text",
|
|
87
|
-
icon: /* @__PURE__ */ jsx(MoreOptionsVert, {}),
|
|
88
|
-
innerRef: ref
|
|
89
|
-
}),
|
|
72
|
+
triggerComponent: /* @__PURE__ */ jsx(DSButton, { buttonType: "text", icon: /* @__PURE__ */ jsx(MoreOptionsVert, {}), innerRef: ref }),
|
|
90
73
|
zIndex: 11
|
|
91
|
-
}
|
|
92
|
-
})
|
|
93
|
-
]
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
children: /* @__PURE__ */ jsx(DSReadMore, {
|
|
74
|
+
}
|
|
75
|
+
) })
|
|
76
|
+
] }),
|
|
77
|
+
/* @__PURE__ */ jsx(CommentCardContent, { children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
78
|
+
DSReadMore,
|
|
79
|
+
{
|
|
98
80
|
lines: maxLines,
|
|
99
81
|
content: `${content} `,
|
|
100
82
|
more: "MORE",
|
|
@@ -102,11 +84,11 @@ const CommentCard = ({
|
|
|
102
84
|
buttonType: "text",
|
|
103
85
|
size: "m",
|
|
104
86
|
ellipsis: "... "
|
|
105
|
-
}
|
|
106
|
-
})
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
87
|
+
}
|
|
88
|
+
) }) })
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
);
|
|
110
92
|
};
|
|
111
93
|
const props = {
|
|
112
94
|
containerProps: PropTypes.shape({
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/CommentCard.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport React, { useCallback, useRef } from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\nimport DSButton from '@elliemae/ds-button';\nimport { DSReadMore } from '@elliemae/ds-read-more';\nimport DSDropdownMenu from '@elliemae/ds-dropdownmenu';\nimport { MoreOptionsVert } from '@elliemae/ds-icons';\nimport {\n CommentCardWrapper,\n CommentCardHeader,\n CommentCardContent,\n CommentCardName,\n CommentCardData,\n CommentCardMenu,\n CommentCardLeft,\n} from './blocks';\nimport { getTime, getDisplayDate } from './helper';\n\nconst CommentCard = ({\n containerProps = {},\n name = '',\n date = new Date(),\n type = '',\n content = '',\n style = {},\n options = [],\n selection = { 'single-selection-internal-external': ['set-as-internal'] },\n customDropdownMenuProps = {\n focusOnOpen: true,\n },\n borderBottom,\n dateFormat = 'MM/DD/YYYY',\n timeFormat = 'hh:mm a',\n maxLines = 2,\n}) => {\n const ref = useRef();\n const displayDate = date ? getDisplayDate(date, dateFormat) : null;\n const displayTime = date ? getTime(date, timeFormat) : null;\n\n const handleCloseMenu = useCallback(() => {\n ref.current.focus();\n }, []);\n\n return (\n <CommentCardWrapper\n classProps={{ borderBottom }}\n tabIndex={0}\n {...containerProps}\n style={{ ...style, ...(containerProps.style || {}) }}\n >\n <CommentCardHeader classProps={{ borderBottom }}>\n <CommentCardLeft>\n <CommentCardName>{name}</CommentCardName>\n <CommentCardData>\n {displayDate}\n {displayTime && (\n <>\n <span>\u2022</span>\n {displayTime}\n </>\n )}\n {type && (\n <>\n <span>\u2022</span>\n {type}\n </>\n )}\n </CommentCardData>\n </CommentCardLeft>\n {options && options.length > 0 && (\n <CommentCardMenu>\n <DSDropdownMenu\n {...customDropdownMenuProps}\n onClose={handleCloseMenu}\n options={options}\n selection={selection}\n triggerComponent={<DSButton buttonType=\"text\" icon={<MoreOptionsVert />} innerRef={ref} />}\n zIndex={11} // https://jira.elliemae.io/browse/PUI-1664\n />\n </CommentCardMenu>\n )}\n </CommentCardHeader>\n <CommentCardContent>\n <div>\n <DSReadMore\n lines={maxLines}\n content={`${content} `}\n more=\"MORE\"\n less=\"LESS\"\n buttonType=\"text\"\n size=\"m\"\n ellipsis=\"... \"\n />\n </div>\n </CommentCardContent>\n </CommentCardWrapper>\n );\n};\n\nconst props = {\n /** props to inject to comment card wrapper */\n containerProps: PropTypes.shape({\n id: PropTypes.string,\n 'data-testid': PropTypes.string,\n }).description('props to inject to comment card wrapper'),\n /** form name */\n name: PropTypes.string.description('form name'),\n /** style object */\n style: PropTypes.object.description(' style object '),\n /** date object */\n date: PropTypes.instanceOf(Date).description('date object'),\n /** comment type string */\n type: PropTypes.string.description('comment type string'),\n /** comment content */\n content: PropTypes.string.description('comment content'),\n /** dropdown menu options */\n options: PropTypes.arrayOf(PropTypes.object).description('dropdown menu options'),\n /** dropdown selection */\n selection: PropTypes.object.description('dropdown selection'),\n /** pass down props to dropdown */\n customDropdownMenuProps: PropTypes.shape({\n focusOnOpen: PropTypes.bool,\n }).description('pass down props to dropdown'),\n /** toggle border bottom for card */\n borderBottom: PropTypes.bool.description('toggle border bottom for card'),\n /** moment Year, month, and day tokens https://momentjs.com/docs/#/parsing/string-format/ */\n dateFormat: PropTypes.oneOf(['MM/DD/YYYY', 'MM DD YYYY']).description(\n 'moment Year, month, and day tokens https://momentjs.com/docs/#/parsing/string-format/',\n ),\n /** moment Hour, minute, second, millisecond, and offset tokens https://momentjs.com/docs/#/parsing/string-format/ */\n timeFormat: PropTypes.oneOf(['hh:mm a', 'HH:mm']).description(\n 'moment Hour, minute, second, millisecond, and offset tokens https://momentjs.com/docs/#/parsing/string-format/',\n ),\n /**\n * Max lines\n */\n maxLines: PropTypes.number.description('Max lines'),\n};\n\nCommentCard.propTypes = props;\nCommentCard.displayName = 'CommentCard';\nconst DSCommentCardWithSchema = describe(CommentCard);\nDSCommentCardWithSchema.propTypes = props;\n\nexport default Comm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AACpD,wBAAwB,YAAY;AAEpC,IAAO,sBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-comments",
|
|
3
|
-
"version": "3.12.0-rc.
|
|
3
|
+
"version": "3.12.0-rc.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Comments",
|
|
6
6
|
"files": [
|
|
@@ -51,12 +51,12 @@
|
|
|
51
51
|
"indent": 4
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@elliemae/ds-button": "3.12.0-rc.
|
|
55
|
-
"@elliemae/ds-classnames": "3.12.0-rc.
|
|
56
|
-
"@elliemae/ds-dropdownmenu": "3.12.0-rc.
|
|
57
|
-
"@elliemae/ds-icons": "3.12.0-rc.
|
|
58
|
-
"@elliemae/ds-read-more": "3.12.0-rc.
|
|
59
|
-
"@elliemae/ds-utilities": "3.12.0-rc.
|
|
54
|
+
"@elliemae/ds-button": "3.12.0-rc.4",
|
|
55
|
+
"@elliemae/ds-classnames": "3.12.0-rc.4",
|
|
56
|
+
"@elliemae/ds-dropdownmenu": "3.12.0-rc.4",
|
|
57
|
+
"@elliemae/ds-icons": "3.12.0-rc.4",
|
|
58
|
+
"@elliemae/ds-read-more": "3.12.0-rc.4",
|
|
59
|
+
"@elliemae/ds-utilities": "3.12.0-rc.4",
|
|
60
60
|
"moment": "~2.29.3"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|