@elliemae/ds-comments 3.3.0-next.4 → 3.3.0-next.7

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.
@@ -1,27 +1,10 @@
1
1
  "use strict";
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
- var __defProps = Object.defineProperties;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
6
  var __getProtoOf = Object.getPrototypeOf;
10
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
- var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {}))
15
- if (__hasOwnProp.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- if (__getOwnPropSymbols)
18
- for (var prop of __getOwnPropSymbols(b)) {
19
- if (__propIsEnum.call(b, prop))
20
- __defNormalProp(a, prop, b[prop]);
21
- }
22
- return a;
23
- };
24
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
8
  var __export = (target, all) => {
26
9
  for (var name in all)
27
10
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -74,14 +57,15 @@ const CommentCard = ({
74
57
  const handleCloseMenu = (0, import_react.useCallback)(() => {
75
58
  ref.current.focus();
76
59
  }, []);
77
- return /* @__PURE__ */ import_react.default.createElement(import_blocks.CommentCardWrapper, __spreadProps(__spreadValues({
60
+ return /* @__PURE__ */ import_react.default.createElement(import_blocks.CommentCardWrapper, {
78
61
  classProps: { borderBottom },
79
- tabIndex: 0
80
- }, containerProps), {
81
- style: __spreadValues(__spreadValues({}, style), containerProps.style || {})
82
- }), /* @__PURE__ */ import_react.default.createElement(import_blocks.CommentCardHeader, {
62
+ tabIndex: 0,
63
+ ...containerProps,
64
+ style: { ...style, ...containerProps.style || {} }
65
+ }, /* @__PURE__ */ import_react.default.createElement(import_blocks.CommentCardHeader, {
83
66
  classProps: { borderBottom }
84
- }, /* @__PURE__ */ import_react.default.createElement(import_blocks.CommentCardLeft, null, /* @__PURE__ */ import_react.default.createElement(import_blocks.CommentCardName, null, name), /* @__PURE__ */ import_react.default.createElement(import_blocks.CommentCardData, null, displayDate, displayTime && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("span", null, "\u2022"), displayTime), type && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("span", null, "\u2022"), type))), options && options.length > 0 && /* @__PURE__ */ import_react.default.createElement(import_blocks.CommentCardMenu, null, /* @__PURE__ */ import_react.default.createElement(import_ds_dropdownmenu.default, __spreadProps(__spreadValues({}, customDropdownMenuProps), {
67
+ }, /* @__PURE__ */ import_react.default.createElement(import_blocks.CommentCardLeft, null, /* @__PURE__ */ import_react.default.createElement(import_blocks.CommentCardName, null, name), /* @__PURE__ */ import_react.default.createElement(import_blocks.CommentCardData, null, displayDate, displayTime && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("span", null, "\u2022"), displayTime), type && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("span", null, "\u2022"), type))), options && options.length > 0 && /* @__PURE__ */ import_react.default.createElement(import_blocks.CommentCardMenu, null, /* @__PURE__ */ import_react.default.createElement(import_ds_dropdownmenu.default, {
68
+ ...customDropdownMenuProps,
85
69
  onClose: handleCloseMenu,
86
70
  options,
87
71
  selection,
@@ -91,7 +75,7 @@ const CommentCard = ({
91
75
  innerRef: ref
92
76
  }),
93
77
  zIndex: "11"
94
- })))), /* @__PURE__ */ import_react.default.createElement(import_blocks.CommentCardContent, null, /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(import_ds_read_more.DSReadMore, {
78
+ }))), /* @__PURE__ */ import_react.default.createElement(import_blocks.CommentCardContent, null, /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(import_ds_read_more.DSReadMore, {
95
79
  lines: maxLines,
96
80
  content: `${content} `,
97
81
  more: "MORE",
@@ -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;ADEvB,mBAA2C;AAC3C,0BAAoC;AACpC,uBAAqB;AACrB,0BAA2B;AAC3B,6BAA2B;AAC3B,sBAAgC;AAChC,oBAQO;AACP,oBAAwC;AAExC,MAAM,cAAc,CAAC;AAAA,EACnB,iBAAiB,CAAC;AAAA,EAClB,OAAO;AAAA,EACP,OAAO,IAAI,KAAK;AAAA,EAChB,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ,CAAC;AAAA,EACT,UAAU,CAAC;AAAA,EACX,YAAY,EAAE,sCAAsC,CAAC,iBAAiB,EAAE;AAAA,EACxE,0BAA0B;AAAA,IACxB,aAAa;AAAA,EACf;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb,aAAa;AAAA,EACb,WAAW;AAAA,MACP;AACJ,QAAM,MAAM,yBAAO;AACnB,QAAM,cAAc,OAAO,kCAAe,MAAM,UAAU,IAAI;AAC9D,QAAM,cAAc,OAAO,2BAAQ,MAAM,UAAU,IAAI;AAEvD,QAAM,kBAAkB,8BAAY,MAAM;AACxC,QAAI,QAAQ,MAAM;AAAA,EACpB,GAAG,CAAC,CAAC;AAEL,SACE,mDAAC;AAAA,IACC,YAAY,EAAE,aAAa;A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EvD,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,YACxD,uFACF;AAAA,EAEA,YAAY,8BAAU,MAAM,CAAC,WAAW,OAAO,CAAC,EAAE,YAChD,gHACF;AAAA,EAIA,UAAU,8BAAU,OAAO,YAAY,WAAW;AACpD;AAEA,YAAY,YAAY;AACxB,YAAY,cAAc;AAC1B,MAAM,0BAA0B,kCAAS,WAAW;AACpD,wBAAwB,YAAY;AAEpC,IAAO,sBAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,23 +1,4 @@
1
1
  "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __defProps = Object.defineProperties;
4
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
- var __spreadValues = (a, b) => {
10
- for (var prop in b || (b = {}))
11
- if (__hasOwnProp.call(b, prop))
12
- __defNormalProp(a, prop, b[prop]);
13
- if (__getOwnPropSymbols)
14
- for (var prop of __getOwnPropSymbols(b)) {
15
- if (__propIsEnum.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- }
18
- return a;
19
- };
20
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
2
  import * as React from "react";
22
3
  import React2, { useCallback, useRef } from "react";
23
4
  import { PropTypes, describe } from "@elliemae/ds-utilities";
@@ -58,14 +39,15 @@ const CommentCard = ({
58
39
  const handleCloseMenu = useCallback(() => {
59
40
  ref.current.focus();
60
41
  }, []);
61
- return /* @__PURE__ */ React2.createElement(CommentCardWrapper, __spreadProps(__spreadValues({
42
+ return /* @__PURE__ */ React2.createElement(CommentCardWrapper, {
62
43
  classProps: { borderBottom },
63
- tabIndex: 0
64
- }, containerProps), {
65
- style: __spreadValues(__spreadValues({}, style), containerProps.style || {})
66
- }), /* @__PURE__ */ React2.createElement(CommentCardHeader, {
44
+ tabIndex: 0,
45
+ ...containerProps,
46
+ style: { ...style, ...containerProps.style || {} }
47
+ }, /* @__PURE__ */ React2.createElement(CommentCardHeader, {
67
48
  classProps: { borderBottom }
68
- }, /* @__PURE__ */ React2.createElement(CommentCardLeft, null, /* @__PURE__ */ React2.createElement(CommentCardName, null, name), /* @__PURE__ */ React2.createElement(CommentCardData, null, displayDate, displayTime && /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement("span", null, "\u2022"), displayTime), type && /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement("span", null, "\u2022"), type))), options && options.length > 0 && /* @__PURE__ */ React2.createElement(CommentCardMenu, null, /* @__PURE__ */ React2.createElement(DSDropdownMenu, __spreadProps(__spreadValues({}, customDropdownMenuProps), {
49
+ }, /* @__PURE__ */ React2.createElement(CommentCardLeft, null, /* @__PURE__ */ React2.createElement(CommentCardName, null, name), /* @__PURE__ */ React2.createElement(CommentCardData, null, displayDate, displayTime && /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement("span", null, "\u2022"), displayTime), type && /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement("span", null, "\u2022"), type))), options && options.length > 0 && /* @__PURE__ */ React2.createElement(CommentCardMenu, null, /* @__PURE__ */ React2.createElement(DSDropdownMenu, {
50
+ ...customDropdownMenuProps,
69
51
  onClose: handleCloseMenu,
70
52
  options,
71
53
  selection,
@@ -75,7 +57,7 @@ const CommentCard = ({
75
57
  innerRef: ref
76
58
  }),
77
59
  zIndex: "11"
78
- })))), /* @__PURE__ */ React2.createElement(CommentCardContent, null, /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement(DSReadMore, {
60
+ }))), /* @__PURE__ */ React2.createElement(CommentCardContent, null, /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement(DSReadMore, {
79
61
  lines: maxLines,
80
62
  content: `${content} `,
81
63
  more: "MORE",
@@ -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 CommentCard;\nexport { DSCommentCardWithSchema };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;ACEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA;AAEA,MAAM,cAAc,CAAC;AAAA,EACnB,iBAAiB,CAAC;AAAA,EAClB,OAAO;AAAA,EACP,OAAO,IAAI,KAAK;AAAA,EAChB,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ,CAAC;AAAA,EACT,UAAU,CAAC;AAAA,EACX,YAAY,EAAE,sCAAsC,CAAC,iBAAiB,EAAE;AAAA,EACxE,0BAA0B;AAAA,IACxB,aAAa;AAAA,EACf;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb,aAAa;AAAA,EACb,WAAW;AAAA,MACP;AACJ,QAAM,MAAM,OAAO;AACnB,QAAM,cAAc,OAAO,eAAe,MAAM,UAAU,IAAI;AAC9D,QAAM,cAAc,OAAO,QAAQ,MAAM,UAAU,IAAI;AAEvD,QAAM,kBAAkB,YAAY,MAAM;AACxC,QAAI,QAAQ,MAAM;AAAA,EACpB,GAAG,CAAC,CAAC;AAEL,SACE,qCAAC;AAAA,IACC,YAAY,EAAE,aAAa;AAAA,IAC3B,UAAU;AAA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AAU;AAAA,EACzB,CAAC,EAAE,YAAY,6BAA6B;AAAA,EAE5C,cAAc,UAAU,KAAK,YAAY,+BAA+B;AAAA,EAExE,YAAY,UAAU,MAAM,CAAC,cAAc,YAAY,CAAC,EAAE,YACxD,uFACF;AAAA,EAEA,YAAY,UAAU,MAAM,CAAC,WAAW,OAAO,CAAC,EAAE,YAChD,gHACF;AAAA,EAIA,UAAU,UAAU,OAAO,YAAY,WAAW;AACpD;AAEA,YAAY,YAAY;AACxB,YAAY,cAAc;AAC1B,MAAM,0BAA0B,SAAS,WAAW;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.3.0-next.4",
3
+ "version": "3.3.0-next.7",
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.3.0-next.4",
55
- "@elliemae/ds-classnames": "3.3.0-next.4",
56
- "@elliemae/ds-dropdownmenu": "3.3.0-next.4",
57
- "@elliemae/ds-icons": "3.3.0-next.4",
58
- "@elliemae/ds-read-more": "3.3.0-next.4",
59
- "@elliemae/ds-utilities": "3.3.0-next.4",
54
+ "@elliemae/ds-button": "3.3.0-next.7",
55
+ "@elliemae/ds-classnames": "3.3.0-next.7",
56
+ "@elliemae/ds-dropdownmenu": "3.3.0-next.7",
57
+ "@elliemae/ds-icons": "3.3.0-next.7",
58
+ "@elliemae/ds-read-more": "3.3.0-next.7",
59
+ "@elliemae/ds-utilities": "3.3.0-next.7",
60
60
  "moment": "~2.29.3"
61
61
  },
62
62
  "devDependencies": {