@corva/ui 3.76.0-10 → 3.76.0-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs-bundle/components/AttachmentPreview/AttachmentPreview.js +1 -1
- package/cjs-bundle/components/AttachmentPreview/AttachmentPreview.js.map +1 -1
- package/cjs-bundle/components/AttachmentPreview/AttachmentPreview.scss.js +1 -1
- package/cjs-bundle/components/CommentCard/CommentCard.scss.js +1 -1
- package/cjs-bundle/components/CommentInput/index.js +1 -1
- package/cjs-bundle/components/CommentInput/index.js.map +1 -1
- package/cjs-bundle/components/CommentInputNext/CommentInputNext.scss.js +1 -1
- package/cjs-bundle/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js.map +1 -1
- package/cjs-bundle/components/FeedCard/FeedCard.scss.js +1 -1
- package/cjs-bundle/componentsV2/AppCommonsProvider/AppCommonsContext.js.map +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/Actions/Actions.constants.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/Actions/Actions.constants.js.map +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/Actions/Actions.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/Actions/Actions.js.map +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/AppHeaderV3.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/AppHeaderV3.js.map +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/AppHeaderV3.scss.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/useResponsivity.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/V3/useResponsivity.js.map +1 -1
- package/components/AttachmentPreview/AttachmentPreview.d.ts +0 -1
- package/components/AttachmentPreview/AttachmentPreview.d.ts.map +1 -1
- package/components/AttachmentPreview/AttachmentPreview.js +1 -1
- package/components/AttachmentPreview/AttachmentPreview.js.map +1 -1
- package/components/AttachmentPreview/AttachmentPreview.scss.js +1 -1
- package/components/CommentCard/CommentCard.scss.js +1 -1
- package/components/CommentInput/index.d.ts +24 -26
- package/components/CommentInput/index.js +1 -1
- package/components/CommentInput/index.js.map +1 -1
- package/components/CommentInputNext/CommentInputNext.scss.js +1 -1
- package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.d.ts +9 -2
- package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.d.ts.map +1 -1
- package/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.js.map +1 -1
- package/components/FeedCard/FeedCard.scss.js +1 -1
- package/componentsV2/AppCommonsProvider/AppCommonsContext.d.ts +6 -19
- package/componentsV2/AppCommonsProvider/AppCommonsContext.d.ts.map +1 -1
- package/componentsV2/AppCommonsProvider/AppCommonsContext.js.map +1 -1
- package/componentsV2/AppHeader/V3/Actions/Actions.constants.d.ts +0 -1
- package/componentsV2/AppHeader/V3/Actions/Actions.constants.d.ts.map +1 -1
- package/componentsV2/AppHeader/V3/Actions/Actions.constants.js +1 -1
- package/componentsV2/AppHeader/V3/Actions/Actions.constants.js.map +1 -1
- package/componentsV2/AppHeader/V3/Actions/Actions.d.ts.map +1 -1
- package/componentsV2/AppHeader/V3/Actions/Actions.js +1 -1
- package/componentsV2/AppHeader/V3/Actions/Actions.js.map +1 -1
- package/componentsV2/AppHeader/V3/AppHeaderV3.d.ts.map +1 -1
- package/componentsV2/AppHeader/V3/AppHeaderV3.js +1 -1
- package/componentsV2/AppHeader/V3/AppHeaderV3.js.map +1 -1
- package/componentsV2/AppHeader/V3/AppHeaderV3.scss.js +1 -1
- package/componentsV2/AppHeader/V3/useResponsivity.js +1 -1
- package/componentsV2/AppHeader/V3/useResponsivity.js.map +1 -1
- package/mcp-server/server.mjs +3 -7
- package/package.json +1 -1
- package/styles/common.scss +0 -14
- package/styles/mixins.scss +0 -14
- package/tsconfig.tsbuildinfo +1 -1
- package/cjs-bundle/components/AttachmentPreview/useScrollOverflow.js +0 -2
- package/cjs-bundle/components/AttachmentPreview/useScrollOverflow.js.map +0 -1
- package/cjs-bundle/components/CommentInput/useCommentInput.js +0 -2
- package/cjs-bundle/components/CommentInput/useCommentInput.js.map +0 -1
- package/components/AttachmentPreview/__tests__/AttachmentPreview.overflow.test.d.ts +0 -2
- package/components/AttachmentPreview/__tests__/AttachmentPreview.overflow.test.d.ts.map +0 -1
- package/components/AttachmentPreview/useScrollOverflow.d.ts +0 -16
- package/components/AttachmentPreview/useScrollOverflow.d.ts.map +0 -1
- package/components/AttachmentPreview/useScrollOverflow.js +0 -2
- package/components/AttachmentPreview/useScrollOverflow.js.map +0 -1
- package/components/CommentInput/__tests__/useCommentInput.test.d.ts +0 -2
- package/components/CommentInput/__tests__/useCommentInput.test.d.ts.map +0 -1
- package/components/CommentInput/useCommentInput.d.ts +0 -26
- package/components/CommentInput/useCommentInput.d.ts.map +0 -1
- package/components/CommentInput/useCommentInput.js +0 -2
- package/components/CommentInput/useCommentInput.js.map +0 -1
- package/componentsV2/AppHeader/__tests__/AppHeaderEmbedded.test.d.ts +0 -2
- package/componentsV2/AppHeader/__tests__/AppHeaderEmbedded.test.d.ts.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/objectWithoutProperties"),r=require("react"),n=require("../AttachmentLightbox/useAttachmentLightbox.js"),o=require("./AttachmentRow.js"),i=require("./SortableAttachments.js"),c=require("react/jsx-runtime");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=a(e),l=a(t),s=["onReorder","onItemClick","onShare"];function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){u.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var f=r.forwardRef((function(e,t){var r=e.onReorder,a=e.onItemClick,u=e.onShare,b=l.default(e,s),f=n.useAttachmentLightbox(b.items,{onShare:u}),p=f.openAttachment,m=f.lightbox;if(!b.items.length)return null;var j=!!r&&b.items.length>1?c.jsx(i.SortableAttachments,h(h({},b),{},{ref:t,onReorder:r,onItemClick:null!=a?a:p})):c.jsx(o.AttachmentRow,h(h({},b),{},{ref:t,onShare:u,onItemClick:null!=a?a:p}));return c.jsxs(c.Fragment,{children:[j,!a&&m]})}));exports.AttachmentPreview=f;
|
|
2
2
|
//# sourceMappingURL=AttachmentPreview.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentPreview.js","sources":["../../../../src/components/AttachmentPreview/AttachmentPreview.tsx"],"sourcesContent":["import { forwardRef
|
|
1
|
+
{"version":3,"file":"AttachmentPreview.js","sources":["../../../../src/components/AttachmentPreview/AttachmentPreview.tsx"],"sourcesContent":["import { forwardRef } from 'react';\n\nimport { useAttachmentLightbox } from '../AttachmentLightbox/useAttachmentLightbox';\n\nimport { AttachmentRow } from './AttachmentRow';\nimport { SortableAttachments } from './SortableAttachments';\nimport { AttachmentPreviewProps } from './AttachmentPreview.types';\n\n/**\n * Picks the strip that fits — reorderable or plain — and gives it a lightbox. Rendering lives in\n * `AttachmentRow`, drag-and-drop in `SortableAttachments`, the modal in `useAttachmentLightbox`.\n */\nexport const AttachmentPreview = forwardRef<HTMLDivElement, AttachmentPreviewProps>(\n ({ onReorder, onItemClick, onShare, ...props }, ref) => {\n const { openAttachment, lightbox } = useAttachmentLightbox(props.items, { onShare });\n\n if (!props.items.length) return null;\n\n const isSortable = !!onReorder && props.items.length > 1;\n const strip = isSortable ? (\n <SortableAttachments\n {...props}\n ref={ref}\n onReorder={onReorder}\n onItemClick={onItemClick ?? openAttachment}\n />\n ) : (\n <AttachmentRow\n {...props}\n ref={ref}\n onShare={onShare}\n onItemClick={onItemClick ?? openAttachment}\n />\n );\n\n return (\n <>\n {strip}\n {!onItemClick && lightbox}\n </>\n );\n }\n);\n"],"names":["AttachmentPreview","forwardRef","_ref","ref","onReorder","onItemClick","onShare","props","_objectWithoutProperties","_excluded","_useAttachmentLightbo","useAttachmentLightbox","items","openAttachment","lightbox","length","strip","_jsx","SortableAttachments","jsx","AttachmentRow","_objectSpread","_jsxs","_Fragment","children"],"mappings":"wjCAYaA,EAAoBC,EAAUA,YACzC,SAAAC,EAAgDC,GAAQ,IAArDC,IAAAA,UAAWC,IAAAA,YAAaC,IAAAA,QAAYC,EAAKC,EAAA,QAAAN,EAAAO,GAC1CC,EAAqCC,EAAAA,sBAAsBJ,EAAMK,MAAO,CAAEN,QAAAA,IAAlEO,IAAAA,eAAgBC,IAAAA,SAExB,IAAKP,EAAMK,MAAMG,OAAQ,OAAO,KAEhC,IACMC,IADeZ,GAAaG,EAAMK,MAAMG,OAAS,EAErDE,EAAAA,IAACC,EAAmBA,2BACdX,GAAK,GAAA,CACTJ,IAAKA,EACLC,UAAWA,EACXC,YAAaA,QAAAA,EAAeQ,KAG9BI,EAAAE,IAACC,gBAAaC,EAAAA,EAAA,CAAA,EACRd,GAAK,GAAA,CACTJ,IAAKA,EACLG,QAASA,EACTD,YAAaA,QAAAA,EAAeQ,KAIhC,OACES,EAAAA,KAAAC,EAAAA,SAAA,CAAAC,SAAA,CACGR,GACCX,GAAeS,IAGvB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";require('./../../ext-esm/style-inject/dist/style-inject.es.js')('.AttachmentPreview_scroller__ZqYC8{-ms-overflow-style:none;align-items:flex-start;display:flex;gap:12px;margin-left:-8px;overflow-x:auto;overflow-y:visible;padding-left:8px;padding-right:8px;padding-top:6px;scroll-behavior:smooth;scrollbar-width:none}.AttachmentPreview_scroller__ZqYC8::-webkit-scrollbar{display:none}.
|
|
1
|
+
"use strict";require('./../../ext-esm/style-inject/dist/style-inject.es.js')('.AttachmentPreview_scroller__ZqYC8{-ms-overflow-style:none;align-items:flex-start;display:flex;gap:12px;margin-left:-8px;overflow-x:auto;overflow-y:visible;padding-left:8px;padding-right:8px;padding-top:6px;scroll-behavior:smooth;scrollbar-width:none}.AttachmentPreview_scroller__ZqYC8::-webkit-scrollbar{display:none}.AttachmentPreview_slot__ewKLo{border-radius:8px;cursor:grab;flex-shrink:0;position:relative;touch-action:none}.AttachmentPreview_slot__ewKLo:focus-visible{outline:none}.AttachmentPreview_slot__ewKLo:focus-visible:before{border:2px solid var(--palette-primary-main);border-radius:8px;content:"";inset:0;pointer-events:none;position:absolute;z-index:5}.AttachmentPreview_slotDragging__hrfJX{cursor:grabbing}.AttachmentPreview_slotDragging__hrfJX .AttachmentPreview_slotContent__GNuSu{visibility:hidden}.AttachmentPreview_slotDragging__hrfJX:focus-visible:before{display:none}.AttachmentPreview_slotDragging__hrfJX:after{background:rgb(from var(--palette-primary-text-1) r g b/.04);border:1px dashed var(--palette-primary-text-6);border-radius:8px;content:"";inset:0;position:absolute}.AttachmentPreview_insertion__iFqlp{background:var(--palette-primary-main);border-radius:2px;bottom:0;box-shadow:0 0 6px rgb(from var(--palette-primary-main) r g b/.6);position:absolute;top:0;width:2px;z-index:4}.AttachmentPreview_insertionBefore__jyWQM,.AttachmentPreview_insertionEdge__Bjk1t{left:-7px}.AttachmentPreview_insertionAfter__4NvhP{right:-7px}.AttachmentPreview_dragGhost__4aSzE{background:var(--palette-background-b-6);border-radius:8px;box-shadow:0 10px 20px rgb(from var(--palette-background-b-1) r g b/.45);cursor:grabbing;opacity:.9;position:relative;transform:rotate(4deg)}.AttachmentPreview_dragGhostHandle__Gu2CP{align-items:center;display:flex;inset:0;justify-content:center;pointer-events:none;position:absolute;z-index:2}.AttachmentPreview_dragGhostHandle__Gu2CP button{backdrop-filter:blur(4px);background-color:rgb(from var(--palette-primary-text-1) r g b/.16)!important;color:var(--palette-primary-text-1)!important}.AttachmentPreview_dragGhostHandle__Gu2CP svg{color:var(--palette-primary-text-1)}.AttachmentPreview_thumbnail__ytI2L{border-radius:8px;flex-shrink:0;height:64px;overflow:visible;position:relative;width:64px}.AttachmentPreview_clickable__BEXzK{cursor:pointer}.AttachmentPreview_clickable__BEXzK:hover{opacity:.9}.AttachmentPreview_selected__JRuMO:after{border:1px solid var(--palette-primary-main);border-radius:8px;content:"";inset:0;pointer-events:none;position:absolute;z-index:4}.AttachmentPreview_thumbnailInner__9Ex4-{border-radius:8px;inset:0;overflow:hidden;pointer-events:none;position:absolute}.AttachmentPreview_thumbnailImage__RQ4fL{height:100%;left:50%;max-width:none;min-width:100%;object-fit:cover;pointer-events:none;position:absolute;top:0;transform:translateX(-50%);width:auto}.AttachmentPreview_videoOverlay__5Lgi1{align-items:center;background:rgb(from var(--palette-background-b-1) r g b/.5);border-radius:8px;display:flex;inset:0;justify-content:center;pointer-events:none;position:absolute}.AttachmentPreview_playIcon__OOnql{color:var(--palette-primary-text-1);font-size:32px}.AttachmentPreview_fileCard__oxDbD{align-items:flex-start;border:1px solid rgb(from var(--palette-primary-text-1) r g b/.08);border-radius:8px;display:flex;flex-direction:column;flex-shrink:0;height:64px;justify-content:center;padding:8px 16px;position:relative;width:142px}.AttachmentPreview_fileCardLink__TDpvh{color:inherit;cursor:pointer;text-decoration:none}.AttachmentPreview_fileCardLink__TDpvh:hover{border-color:rgb(from var(--palette-primary-text-1) r g b/.16)}.AttachmentPreview_fileCardContent__c-99Q{align-items:center;display:flex;gap:8px;width:100%}.AttachmentPreview_fileInfo__eqJ-B{align-items:flex-start;display:flex;flex:1 0 0;flex-direction:column;justify-content:center;min-width:0}.AttachmentPreview_fileName__1Ccg0{color:var(--palette-primary-text-1)}.AttachmentPreview_fileName__1Ccg0,.AttachmentPreview_fileType__0v6E4{font-size:14px;line-height:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.AttachmentPreview_fileType__0v6E4{color:var(--palette-primary-text-6);text-transform:uppercase}.AttachmentPreview_tileActions__2nLlw{display:flex;gap:4px;opacity:0;position:absolute;right:-6px;top:-6px;transition:opacity .2s;z-index:3}.AttachmentPreview_tileActions__2nLlw button{backdrop-filter:blur(4px);background-color:rgb(from var(--palette-primary-text-1) r g b/.08)!important}.AttachmentPreview_tileActions__2nLlw button:hover{background-color:rgb(from var(--palette-primary-text-1) r g b/.15)!important}.AttachmentPreview_fileCard__oxDbD .AttachmentPreview_tileActions__2nLlw:focus-within,.AttachmentPreview_fileCard__oxDbD:hover .AttachmentPreview_tileActions__2nLlw,.AttachmentPreview_thumbnail__ytI2L .AttachmentPreview_tileActions__2nLlw:focus-within,.AttachmentPreview_thumbnail__ytI2L:hover .AttachmentPreview_tileActions__2nLlw{opacity:1}.AttachmentPreview_tileActionLink__aMyS4{display:inline-flex}.AttachmentPreview_removeButton__aX-qu{opacity:0;position:absolute;right:-6px;top:-6px;transition:opacity .2s;z-index:3}.AttachmentPreview_removeButton__aX-qu button{backdrop-filter:blur(4px);background-color:rgb(from var(--palette-primary-text-1) r g b/.08)!important}.AttachmentPreview_removeButton__aX-qu button:hover{background-color:rgb(from var(--palette-primary-text-1) r g b/.15)!important}.AttachmentPreview_fileCard__oxDbD:hover .AttachmentPreview_removeButton__aX-qu,.AttachmentPreview_removeButtonVisible__BVjYB,.AttachmentPreview_thumbnail__ytI2L:hover .AttachmentPreview_removeButton__aX-qu{opacity:1}.AttachmentPreview_thumbnailError__yyH08{border:1px solid rgb(from var(--palette-error-main) r g b/.4)}.AttachmentPreview_uploadingOverlay__leV1D{background:rgb(from var(--palette-background-b-1) r g b/.5);border-radius:8px;inset:0;pointer-events:none;position:absolute}.AttachmentPreview_uploadingSpinner__u-t7d{align-items:center;backdrop-filter:blur(4px);background-color:rgb(from var(--palette-primary-text-1) r g b/.08);border-radius:6px;display:flex;height:24px;justify-content:center;position:absolute;right:-6px;top:-6px;width:24px;z-index:2}.AttachmentPreview_loader__HK5bZ{color:var(--palette-primary-text-6)!important;height:14px!important;width:14px!important}.AttachmentPreview_errorOverlay__8sM1d{background:rgb(from var(--palette-error-main) r g b/.08);border-radius:8px;inset:0;pointer-events:none;position:absolute}.AttachmentPreview_retryButton__tKVV0{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:2}.AttachmentPreview_retryButton__tKVV0 button{backdrop-filter:blur(4px);background-color:rgb(from var(--palette-primary-text-1) r g b/.08)!important}.AttachmentPreview_retryButton__tKVV0 button:hover{background-color:rgb(from var(--palette-primary-text-1) r g b/.15)!important}'),module.exports={spacing:"8",scroller:"AttachmentPreview_scroller__ZqYC8",slot:"AttachmentPreview_slot__ewKLo",slotDragging:"AttachmentPreview_slotDragging__hrfJX",slotContent:"AttachmentPreview_slotContent__GNuSu",insertion:"AttachmentPreview_insertion__iFqlp",insertionBefore:"AttachmentPreview_insertionBefore__jyWQM",insertionEdge:"AttachmentPreview_insertionEdge__Bjk1t",insertionAfter:"AttachmentPreview_insertionAfter__4NvhP",dragGhost:"AttachmentPreview_dragGhost__4aSzE",dragGhostHandle:"AttachmentPreview_dragGhostHandle__Gu2CP",thumbnail:"AttachmentPreview_thumbnail__ytI2L",clickable:"AttachmentPreview_clickable__BEXzK",selected:"AttachmentPreview_selected__JRuMO",thumbnailInner:"AttachmentPreview_thumbnailInner__9Ex4-",thumbnailImage:"AttachmentPreview_thumbnailImage__RQ4fL",videoOverlay:"AttachmentPreview_videoOverlay__5Lgi1",playIcon:"AttachmentPreview_playIcon__OOnql",fileCard:"AttachmentPreview_fileCard__oxDbD",fileCardLink:"AttachmentPreview_fileCardLink__TDpvh",fileCardContent:"AttachmentPreview_fileCardContent__c-99Q",fileInfo:"AttachmentPreview_fileInfo__eqJ-B",fileName:"AttachmentPreview_fileName__1Ccg0",fileType:"AttachmentPreview_fileType__0v6E4",tileActions:"AttachmentPreview_tileActions__2nLlw",tileActionLink:"AttachmentPreview_tileActionLink__aMyS4",removeButton:"AttachmentPreview_removeButton__aX-qu",removeButtonVisible:"AttachmentPreview_removeButtonVisible__BVjYB",thumbnailError:"AttachmentPreview_thumbnailError__yyH08",uploadingOverlay:"AttachmentPreview_uploadingOverlay__leV1D",uploadingSpinner:"AttachmentPreview_uploadingSpinner__u-t7d",loader:"AttachmentPreview_loader__HK5bZ",errorOverlay:"AttachmentPreview_errorOverlay__8sM1d",retryButton:"AttachmentPreview_retryButton__tKVV0"};
|
|
2
2
|
//# sourceMappingURL=AttachmentPreview.scss.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";require('./../../ext-esm/style-inject/dist/style-inject.es.js')(".CommentCard_capped__izWBZ{flex-direction:column
|
|
1
|
+
"use strict";require('./../../ext-esm/style-inject/dist/style-inject.es.js')(".CommentCard_capped__izWBZ{display:flex;flex-direction:column;overflow:hidden}.CommentCard_bodySurface__scobR{display:flex;flex:1 1 auto;flex-direction:column;gap:8px;min-height:0;overflow:hidden;padding:8px 12px}.CommentCard_editHeader__8aUBt{padding:8px 12px 0}.CommentCard_scrollBody__CIun9{display:flex;flex:1 1 auto;flex-direction:column;gap:8px;min-height:0;overflow-x:hidden;overflow-y:auto}.CommentCard_footer__z3-CY{border-top:1px solid var(--palette-background-b-4);display:flex;flex-direction:column;flex-shrink:0;padding:4px 12px 8px}.CommentCard_repliesSection__iE7QO{padding:8px 12px 12px}.CommentCard_compactBody__zM10O{display:flex;flex:1 1 auto;flex-direction:column;gap:8px;min-height:0;overflow:hidden;padding:8px 12px}.CommentCard_compactTop__LpiQi{align-items:center;display:flex;flex-shrink:0;gap:8px}.CommentCard_compactTime__JzVQR{color:var(--palette-primary-text-7);font-size:12px;line-height:16px;margin-left:auto;white-space:nowrap}.CommentCard_compactFooter__rgB4D{border-top:1px solid var(--palette-background-b-4);flex-shrink:0;padding:4px 12px 8px}.CommentCard_header__T1SH8{align-items:center;display:flex;flex-shrink:0;gap:8px}.CommentCard_headerText__DRsQG{display:flex;flex:1 0 0;flex-direction:column;min-width:0;word-break:break-word}.CommentCard_nameRow__Or1c0{align-items:center;display:flex;gap:8px;width:100%}.CommentCard_nameRow__Or1c0 .CommentCard_timestamp__EbJCO{margin-left:auto}.CommentCard_subtitle__d-XRe{color:var(--palette-primary-main);font-size:12px;line-height:16px}.CommentCard_avatar__NA2ZA{flex-shrink:0}.CommentCard_name__9-e7A{color:var(--palette-primary-text-1);flex:0 1 auto;font-size:14px;line-height:20px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.CommentCard_timestamp__EbJCO{color:var(--palette-primary-text-7)}.CommentCard_chip__4NUrf,.CommentCard_timestamp__EbJCO{flex-shrink:0;font-size:12px;line-height:16px;white-space:nowrap}.CommentCard_chip__4NUrf{align-items:center;background:rgb(from var(--palette-primary-text-1) r g b/.04);border-radius:8px;color:var(--palette-primary-text-6);display:flex;height:24px;padding:6px 8px}.CommentCard_chipAccented__Xl8ek{border-left:2px solid transparent}.CommentCard_bodyRow__ZUufY{align-items:center;display:flex;gap:8px}.CommentCard_text__eAIZM{color:var(--palette-primary-text-1);flex:1 1 auto;font-size:12px;line-height:16px;min-width:0;white-space:pre-wrap;word-break:break-word}.CommentCard_text__eAIZM a,.CommentCard_text__eAIZM button{font:inherit;padding:0;vertical-align:baseline}.CommentCard_attachment__KktIn{display:flex;flex-direction:column;gap:8px}.CommentCard_infoButton__gqcvK{align-items:center;color:var(--palette-primary-text-6);cursor:default;display:inline-flex}.CommentCard_infoButton__gqcvK:hover{color:var(--palette-primary-text-1)}.CommentCard_metadataTooltip__AL0xt .MuiTooltip-tooltip{max-width:none!important}.CommentCard_metadataRows__c-kqf{display:flex;flex-direction:column;gap:4px;padding:4px 0}.CommentCard_metadataRow__BqcII{align-items:baseline;display:flex;font-size:14px;gap:4px;line-height:20px;white-space:nowrap}.CommentCard_metadataLabel__WRWl7{color:var(--palette-primary-text-6)}.CommentCard_metadataValue__Xwf7S{color:var(--palette-primary-text-1)}.CommentCard_metadataUnit__Bxeps{color:var(--palette-primary-text-6);font-size:12px}.CommentCard_contextLine__Jyoui{align-items:center;color:var(--palette-primary-text-7);column-gap:16px;display:flex;flex-wrap:wrap;font-size:12px;line-height:16px;row-gap:4px}.CommentCard_contextItem__2Xmql{white-space:nowrap}.CommentCard_actionsRow__1Ftxn{align-items:center;display:flex;justify-content:space-between;width:100%}.CommentCard_actions__mUmsV{align-items:center;display:flex;gap:8px}.CommentCard_trailingActions__uGt-3{align-items:center;display:flex;gap:4px}.CommentCard_action__ZfyBP{align-items:center;display:flex;gap:2px}.CommentCard_count__stfpY{color:var(--palette-primary-text-6);font-size:12px;line-height:16px}.CommentCard_liked__zsBqe svg{color:var(--palette-primary-main)}.CommentCard_replies__nRRYo{display:flex;flex-direction:column;gap:8px}.CommentCard_reply__7-U7Q{display:flex;flex-direction:column;gap:4px}.CommentCard_replyHeader__sWnLA{align-items:center;display:flex;gap:8px}.CommentCard_replyNameRow__bs7h2{align-items:center;display:flex;flex:1 0 0;gap:12px;min-width:0}.CommentCard_replyName__C8tst{color:var(--palette-primary-text-1);font-size:14px;line-height:20px;white-space:nowrap}.CommentCard_replyTimestamp__YzuW1{color:var(--palette-primary-text-7);flex:1 0 0;font-size:12px;line-height:16px;min-width:0}.CommentCard_replyText__8JPKK{color:var(--palette-primary-text-1);font-size:12px;line-height:16px;padding-left:40px;white-space:pre-wrap;word-break:break-word}.CommentCard_replyText__8JPKK a,.CommentCard_replyText__8JPKK button{font:inherit;padding:0;vertical-align:baseline}"),module.exports={spacing:"8",capped:"CommentCard_capped__izWBZ",bodySurface:"CommentCard_bodySurface__scobR",editHeader:"CommentCard_editHeader__8aUBt",scrollBody:"CommentCard_scrollBody__CIun9",footer:"CommentCard_footer__z3-CY",repliesSection:"CommentCard_repliesSection__iE7QO",compactBody:"CommentCard_compactBody__zM10O",compactTop:"CommentCard_compactTop__LpiQi",compactTime:"CommentCard_compactTime__JzVQR",compactFooter:"CommentCard_compactFooter__rgB4D",header:"CommentCard_header__T1SH8",headerText:"CommentCard_headerText__DRsQG",nameRow:"CommentCard_nameRow__Or1c0",timestamp:"CommentCard_timestamp__EbJCO",subtitle:"CommentCard_subtitle__d-XRe",avatar:"CommentCard_avatar__NA2ZA",name:"CommentCard_name__9-e7A",chip:"CommentCard_chip__4NUrf",chipAccented:"CommentCard_chipAccented__Xl8ek",bodyRow:"CommentCard_bodyRow__ZUufY",text:"CommentCard_text__eAIZM",attachment:"CommentCard_attachment__KktIn",infoButton:"CommentCard_infoButton__gqcvK",metadataTooltip:"CommentCard_metadataTooltip__AL0xt",metadataRows:"CommentCard_metadataRows__c-kqf",metadataRow:"CommentCard_metadataRow__BqcII",metadataLabel:"CommentCard_metadataLabel__WRWl7",metadataValue:"CommentCard_metadataValue__Xwf7S",metadataUnit:"CommentCard_metadataUnit__Bxeps",contextLine:"CommentCard_contextLine__Jyoui",contextItem:"CommentCard_contextItem__2Xmql",actionsRow:"CommentCard_actionsRow__1Ftxn",actions:"CommentCard_actions__mUmsV",trailingActions:"CommentCard_trailingActions__uGt-3",action:"CommentCard_action__ZfyBP",count:"CommentCard_count__stfpY",liked:"CommentCard_liked__zsBqe",replies:"CommentCard_replies__nRRYo",reply:"CommentCard_reply__7-U7Q",replyHeader:"CommentCard_replyHeader__sWnLA",replyNameRow:"CommentCard_replyNameRow__bs7h2",replyName:"CommentCard_replyName__C8tst",replyTimestamp:"CommentCard_replyTimestamp__YzuW1",replyText:"CommentCard_replyText__8JPKK"};
|
|
2
2
|
//# sourceMappingURL=CommentCard.scss.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react"),t=require("prop-types"),n=require("lodash/noop"),i=require("@material-ui/core/styles"),o=require("@material-ui/core"),a=require("classnames"),l=require("lodash"),r=require("@material-ui/core/colors/grey"),d=require("./useCommentInput.js"),s=require("./styles.css.js"),u=require("../Avatar/index.js"),c=require("../FileUploadIconButton.js"),p=require("../EmojiIconButton.js"),m=require("../FailedFileUploading.js"),h=require("../UserMention/index.js"),f=require("../FilePreview/index.js"),g=require("../IconButton/index.js"),x=require("../Icons/SendIcon.js"),C=require("../../utils/mobileDetect.js"),v=require("react/jsx-runtime");function I(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var j=I(t),b=I(n),y=I(a),F=I(r),A={chatAvatarWrapper:{display:"flex",alignItems:"center",position:"absolute",left:0,height:32},commentTextFieldContainer:{position:"relative",margin:"0"},commentTextFieldContainerSpaceAround:{position:"relative",margin:"20px 10px"}},q={},E=e.forwardRef((function(t,n){var i=t.inputRef,a=void 0===i?null:i,r=t.editFeedItemId,I=void 0===r?null:r,j=t.editCommentId,E=void 0===j?null:j,N=t.parentId,T=void 0===N?null:N,B=t.editComment,S=void 0===B?null:B,U=t.editAttachment,R=void 0===U?q:U,w=t.spaceAround,M=void 0!==w&&w,P=t.postComment,k=t.setIsPosting,L=void 0===k?b.default:k,D=t.setIsEditting,_=void 0===D?b.default:D,H=t.onMount,z=void 0===H?b.default:H,O=t.autoFocus,K=t.disabled,W=void 0!==K&&K,G=t.patchCommentCallback,J=void 0===G?b.default:G,Q=t.postCommentCallback,V=void 0===Q?b.default:Q,X=t.exitEditMode,Y=void 0===X?b.default:X,Z=t.companyId,$=void 0===Z?null:Z,ee=t.currentUser,te=void 0===ee?q:ee,ne=t.isNative,ie=void 0===ne?C.isNativeDetected:ne,oe=t.classes,ae=d({inputRef:a,editFeedItemId:I,editCommentId:E,editComment:S,editAttachment:R,postComment:P,setIsPosting:L,setIsEditting:_,patchCommentCallback:J,postCommentCallback:V,exitEditMode:Y}),le=ae.state,re=ae.update,de=ae.imperativeHandle,se=ae.handleSendComment,ue=ae.handleKeyDown,ce=ae.handleSelectEmoji,pe=ae.handleAttachmentLoadingError,me=ae.handleFileUpload,he=ae.handleFileDelete,fe=ae.handleCancelClick;e.useImperativeHandle(n,(function(){return de}),[de]);var ge="".concat(l.get(te,["attributes","first_name"])||l.get(te,"first_name")," ").concat(l.get(te,["attributes","last_name"])||l.get(te,"last_name")),xe=le.isInputFocused||le.attachmentUrl||le.comment||S||(null==R?void 0:R.url);return v.jsxs("div",{style:M?A.commentTextFieldContainerSpaceAround:A.commentTextFieldContainer,children:[v.jsx("div",{style:A.chatAvatarWrapper,children:v.jsx(u.AvatarComponent,{displayName:ge,size:32,imgSrc:te&&te.profile_photo})}),v.jsx(o.Paper,{className:oe.paperRoot,children:v.jsx(o.TextField,{"data-testid":"".concat("commentInput","_input"),placeholder:"Type Comment",FormHelperTextProps:{component:"div",margin:"dense"},InputProps:{inputComponent:h,inputProps:{onChange:function(e){return re({comment:e})},singleLine:!0,value:le.comment||"",inputRef:a,withLightTheme:!1,onMount:z,companyId:$,autoFocus:O,disabled:W,onFocus:function(){return re({isInputFocused:!0})},onBlur:function(){return re({isInputFocused:!1})},allowSuggestionsAboveCursor:!0},endAdornment:!ie&&v.jsxs(o.InputAdornment,{position:"end",className:oe.inputAdornment,children:[!le.attachmentUrl&&v.jsx("div",{className:y.default(s.cCommentInputIconContainer,s.cCommentInputIconUpload),children:v.jsx(c.default,{openPreviewDialogOnUpload:!1,disableRipple:!0,onFinish:me,onError:pe,fileUploadIconClassName:oe.additionalActionButton,htmlColor:F.default[400],inputId:"comment-attachment-".concat(E||T),tooltipProps:{title:"Attach File",classes:{tooltip:oe.iconTooltip},placement:"top"}})}),v.jsx("div",{className:s.cCommentInputIconContainer,children:v.jsx(p,{"data-testid":"".concat("commentInput","_emojiButton"),handleSelectEmoji:ce,emojiIconClassName:oe.additionalActionButton,htmlColor:F.default[400],disableRipple:!0,tooltipProps:{title:"Add Emoji",classes:{tooltip:oe.iconTooltip},placement:"top"}})})]}),disableUnderline:!0,classes:{root:oe.inputRoot,input:oe.inputEl}},className:oe.input,onKeyDown:ue})}),le.attachmentLoadingError&&v.jsx(m,{errorMessage:le.attachmentLoadingError,className:oe.fileUploadingError}),le.attachmentUrl&&v.jsx(f,{fileName:le.attachmentName,fileUrl:le.attachmentUrl,handleFileDelete:he,classes:oe}),v.jsx(o.Collapse,{in:xe,mountOnEnter:!0,unmountOnExit:!0,children:v.jsxs("div",{className:s.cCommentInputSendContainer,children:[v.jsx("div",{className:s.cCommentInputSendContainerCancel,children:v.jsx(o.Typography,{"data-testid":"".concat("commentInput","_cancel"),variant:"caption",className:y.default(oe.inputMain,oe.cancelText,oe.highlightedLabel),component:"div",gutterBottom:!0,onClick:fe,children:"Cancel"})}),v.jsxs("div",{className:s.cCommentInputSendContainerSend,children:[v.jsxs(o.Typography,{variant:"caption",className:y.default(oe.inputMain,oe.inputHelper),component:"div",gutterBottom:!0,children:["Press ",v.jsx(o.Typography,{variant:"caption",color:"primary",className:y.default(oe.inputMain,oe.highlightedLabel),children:"Enter"})," to send"]}),v.jsx(g,{size:"large",tooltipProps:{title:"Send"},"data-testid":"".concat("commentInput","_sendButton"),onClick:se,classes:{root:oe.sendButton},children:v.jsx(x,{})})]})]})})]})})),N={inputRef:j.default.shape({current:j.default.shape({focus:j.default.shape({})})}),editFeedItemId:j.default.number,editCommentId:j.default.number,editComment:j.default.string,editAttachment:j.default.shape({url:j.default.string,size:j.default.number,file_name:j.default.string}),spaceAround:j.default.bool,postComment:j.default.func.isRequired,postCommentCallback:j.default.func,patchCommentCallback:j.default.func,exitEditMode:j.default.func,setIsPosting:j.default.func,setIsEditting:j.default.func,onMount:j.default.func,autoFocus:j.default.bool,disabled:j.default.bool,classes:j.default.shape({}).isRequired,currentUser:j.default.shape(),isNative:j.default.bool,companyId:j.default.number,parentId:j.default.string};E.propTypes=N;var T=i.withStyles((function(e){return{paperRoot:{width:"calc(100% - 48px)",marginLeft:48,display:"inline-block",height:32,border:"0","&:focus-within":{boxShadow:"inset 0 0 0 2px ".concat(e.palette.primary.main)},boxShadow:"none",background:"#4D4D4D"},input:{paddingLeft:5,width:"100%"},inputRoot:{height:32,paddingRight:"8px",lineHeight:"29px",paddingLeft:"8px"},inputEl:{padding:"0 0 0 6px",height:"100%"},additionalActionButton:{padding:"6px"},nativeActionButton:{margin:"5px 10px",cursor:"pointer"},fileUploadingError:{marginTop:10,marginLeft:24},inputMain:{marginBottom:0,fontSize:"11px",color:e.palette.primary.text8},inputHelper:{display:"flex",paddingRight:5},cancelText:{cursor:"pointer"},highlightedLabel:{color:e.palette.primary.main},iconTooltip:{marginTop:"3px"},sendButton:{"&:hover":{backgroundColor:"rgba(3,188,212, 0.1)"},"&.MuiButtonBase-root":{padding:7}},inputAdornment:{marginBottom:"0!important",height:"100%"}}}))(e.memo(E));module.exports=T;
|
|
1
|
+
"use strict";var t=require("@babel/runtime/helpers/asyncToGenerator"),e=require("@babel/runtime/helpers/classCallCheck"),n=require("@babel/runtime/helpers/createClass"),a=require("@babel/runtime/helpers/assertThisInitialized"),i=require("@babel/runtime/helpers/inherits"),s=require("@babel/runtime/helpers/possibleConstructorReturn"),r=require("@babel/runtime/helpers/getPrototypeOf"),o=require("@babel/runtime/helpers/defineProperty"),l=require("@babel/runtime/regenerator"),u=require("react"),c=require("prop-types"),d=require("lodash/noop"),p=require("@material-ui/core/styles"),m=require("@material-ui/core"),h=require("classnames"),f=require("lodash"),g=require("@material-ui/core/colors/grey"),C=require("../../clients/jsonApi/index.js"),x=require("./styles.css.js"),v=require("../Avatar/index.js"),b=require("../FileUploadIconButton.js"),I=require("../EmojiIconButton.js"),y=require("../FailedFileUploading.js"),j=require("../UserMention/index.js"),F=require("../FilePreview/index.js"),E=require("../IconButton/index.js"),S=require("../Icons/SendIcon.js"),q=require("../UserMention/utils/index.js"),U=require("../../utils/main.js"),A=require("../../utils/mobileDetect.js"),N=require("../../utils/nativeMessages.js"),k=require("react/jsx-runtime");function M(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var R=M(t),P=M(e),T=M(n),B=M(a),w=M(i),L=M(s),z=M(r),D=M(o),_=M(l),O=M(c),H=M(d),K=M(h),V=M(g);function W(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,a=z.default(t);if(e){var i=z.default(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return L.default(this,n)}}var G={chatAvatarWrapper:{display:"flex",alignItems:"center",position:"absolute",left:0,height:32},commentTextFieldContainer:{position:"relative",margin:"0"},commentTextFieldContainerSpaceAround:{position:"relative",margin:"20px 10px"}},J=function(t){w.default(n,t);var e=W(n);function n(t){var a,i,s;return P.default(this,n),a=e.call(this,t),D.default(B.default(a),"handleSelectEmoji",(function(t){return a.setState((function(e){var n=e.comment;return{comment:"".concat(n).concat(t.native)}}))})),D.default(B.default(a),"postComment",(i=R.default(_.default.mark((function t(e){var n;return _.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,a.props.postComment(e);case 3:n=t.sent,t.next=9;break;case 6:t.prev=6,t.t0=t.catch(0),console.error(t.t0.message);case 9:return t.abrupt("return",n);case 10:case"end":return t.stop()}}),t,null,[[0,6]])}))),function(t){return i.apply(this,arguments)})),D.default(B.default(a),"patchComment",(s=R.default(_.default.mark((function t(e){var n,i,s,r;return _.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=a.props,i=n.editFeedItemId,s=n.editCommentId,t.prev=1,t.next=4,C.patchFeedItemComment(i,s,e);case 4:r=t.sent,t.next=10;break;case 7:t.prev=7,t.t0=t.catch(1),console.error(t.t0.message);case 10:return t.abrupt("return",r);case 11:case"end":return t.stop()}}),t,null,[[1,7]])}))),function(t){return s.apply(this,arguments)})),D.default(B.default(a),"clearCommentField",(function(t){a.setState({comment:"",attachmentUrl:null,attachmentName:null,attachmentSize:null},(function(){a.focusOnRef(),t&&"function"==typeof t&&t()}))})),D.default(B.default(a),"handleKeyDown",(function(t){var e=t.key;"Escape"===e&&a.props.exitEditMode(),"Enter"===e&&(q.isSuggestionsListOpened()||(t.preventDefault(),a.handleSendComment()))})),D.default(B.default(a),"handleAttachmentLoadingError",(function(t){a.setState({attachmentUrl:null,attachmentName:null,attachmentSize:null,attachmentLoadingError:t})})),D.default(B.default(a),"handleFileUpload",(function(t,e,n){a.setState({attachmentUrl:t,attachmentName:e,attachmentSize:n,attachmentLoadingError:null})})),D.default(B.default(a),"handleNativeFileUpload",(function(){var t=a.state.comment;a.isEditMode?(N.notifyCommentEdit(t),a.clearCommentField(a.props.exitEditMode)):(N.notifyCommentPost(t),a.clearCommentField())})),D.default(B.default(a),"handleFileDelete",(function(){return a.setState({attachmentUrl:null,attachmentName:null,attachmentSize:null})})),D.default(B.default(a),"handleSendComment",R.default(_.default.mark((function t(){var e,n,i;return _.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((e=a.state.comment?a.state.comment.trim():null)||a.state.attachmentUrl){t.next=3;break}return t.abrupt("return");case 3:if(n={comment:{body:e,attachment:{url:a.state.attachmentUrl,size:a.state.attachmentSize,file_name:a.state.attachmentName}}},!a.isEditMode){t.next=16;break}return a.props.setIsEditting(!0),t.next=8,a.patchComment(n);case 8:return i=t.sent,t.next=11,a.props.patchCommentCallback(i);case 11:a.props.setIsEditting(!1),a.clearCommentField(),a.props.exitEditMode(),t.next=24;break;case 16:return a.props.setIsPosting(!0),t.next=19,a.postComment(n);case 19:return i=t.sent,t.next=22,a.props.postCommentCallback(i);case 22:a.props.setIsPosting(!1),a.clearCommentField();case 24:case"end":return t.stop()}}),t)})))),D.default(B.default(a),"handleCancelClick",(function(){a.setState({comment:"",attachmentUrl:null,attachmentName:null,attachmentSize:null},a.props.exitEditMode())})),a.state={comment:"",attachmentUrl:null,attachmentName:null,attachmentSize:null,attachmentLoadingError:null,isInputFocused:!1},a}return T.default(n,[{key:"componentDidMount",value:function(){this.isEditMode&&this.setInitialCommentValue()}},{key:"componentDidUpdate",value:function(t){(this.isEditMode&&!t.editFeedItemId||this.props.editCommentId&&this.props.editCommentId!==t.editCommentId)&&this.setInitialCommentValue()}},{key:"isEditMode",get:function(){return!!this.props.editFeedItemId}},{key:"setInitialCommentValue",value:function(){var t=this.props.editAttachment?this.props.editAttachment.url:null;this.setState({comment:this.props.editComment,attachmentUrl:t,attachmentName:t?this.props.editAttachment.file_name||U.default.getFileNameWithExtensionFromPath(t):null,attachmentSize:this.props.editAttachment?this.props.editAttachment.size:null})}},{key:"focusOnRef",value:function(){this.props.inputRef&&this.props.inputRef.current.focus()}},{key:"render",value:function(){var t,e=this,n=this.props,a=n.classes,i=n.currentUser,s="".concat(f.get(i,["attributes","first_name"])||f.get(i,"first_name")," ").concat(f.get(i,["attributes","last_name"])||f.get(i,"last_name")),r=this.state.isInputFocused||this.state.attachmentUrl||this.state.comment||this.props.editComment||(null===(t=this.props.editAttachment)||void 0===t?void 0:t.url);return k.jsxs("div",{style:this.props.spaceAround?G.commentTextFieldContainerSpaceAround:G.commentTextFieldContainer,children:[k.jsx("div",{style:G.chatAvatarWrapper,children:k.jsx(v.AvatarComponent,{displayName:s,size:32,imgSrc:this.props.currentUser&&this.props.currentUser.profile_photo})}),k.jsx(m.Paper,{className:this.props.classes.paperRoot,children:k.jsx(m.TextField,{"data-testid":"".concat("commentInput","_input"),placeholder:"Type Comment",FormHelperTextProps:{component:"div",margin:"dense"},InputProps:{inputComponent:j,inputProps:{onChange:function(t){return e.setState({comment:t})},singleLine:!0,value:this.state.comment||"",inputRef:this.props.inputRef,withLightTheme:!1,onMount:this.props.onMount,companyId:this.props.companyId,autoFocus:this.props.autoFocus,disabled:this.props.disabled,onFocus:function(){return e.setState({isInputFocused:!0})},onBlur:function(){return e.setState({isInputFocused:!1})},allowSuggestionsAboveCursor:!0},endAdornment:!this.props.isNative&&k.jsxs(m.InputAdornment,{position:"end",className:this.props.classes.inputAdornment,children:[!this.state.attachmentUrl&&k.jsx("div",{className:K.default(x.cCommentInputIconContainer,x.cCommentInputIconUpload),children:k.jsx(b.default,{openPreviewDialogOnUpload:!1,disableRipple:!0,onFinish:this.handleFileUpload,onError:this.handleAttachmentLoadingError,fileUploadIconClassName:this.props.classes.additionalActionButton,htmlColor:V.default[400],inputId:"comment-attachment-".concat(this.props.editCommentId||this.props.parentId),tooltipProps:{title:"Attach File",classes:{tooltip:a.iconTooltip},placement:"top"}})}),k.jsx("div",{className:x.cCommentInputIconContainer,children:k.jsx(I,{"data-testid":"".concat("commentInput","_emojiButton"),handleSelectEmoji:this.handleSelectEmoji,emojiIconClassName:this.props.classes.additionalActionButton,htmlColor:V.default[400],disableRipple:!0,tooltipProps:{title:"Add Emoji",classes:{tooltip:a.iconTooltip},placement:"top"}})})]}),disableUnderline:!0,classes:{root:this.props.classes.inputRoot,input:this.props.classes.inputEl}},className:this.props.classes.input,onKeyDown:this.handleKeyDown})}),this.state.attachmentLoadingError&&k.jsx(y,{errorMessage:this.state.attachmentLoadingError,className:this.props.classes.fileUploadingError}),this.state.attachmentUrl&&k.jsx(F,{fileName:this.state.attachmentName,fileUrl:this.state.attachmentUrl,handleFileDelete:this.handleFileDelete,classes:this.props.classes}),k.jsx(m.Collapse,{in:r,mountOnEnter:!0,unmountOnExit:!0,children:k.jsxs("div",{className:x.cCommentInputSendContainer,children:[k.jsx("div",{className:x.cCommentInputSendContainerCancel,children:k.jsx(m.Typography,{"data-testid":"".concat("commentInput","_cancel"),variant:"caption",className:K.default(this.props.classes.inputMain,this.props.classes.cancelText,this.props.classes.highlightedLabel),component:"div",gutterBottom:!0,onClick:this.handleCancelClick,children:"Cancel"})}),k.jsxs("div",{className:x.cCommentInputSendContainerSend,children:[k.jsxs(m.Typography,{variant:"caption",className:K.default(this.props.classes.inputMain,this.props.classes.inputHelper),component:"div",gutterBottom:!0,children:["Press ",k.jsx(m.Typography,{variant:"caption",color:"primary",className:K.default(this.props.classes.inputMain,this.props.classes.highlightedLabel),children:"Enter"})," to send"]}),k.jsx(E,{size:"large",tooltipProps:{title:"Send"},"data-testid":"".concat("commentInput","_sendButton"),onClick:this.handleSendComment,classes:{root:this.props.classes.sendButton},children:k.jsx(S,{})})]})]})})]})}}]),n}(u.PureComponent);J.propTypes={inputRef:O.default.shape({current:O.default.shape({focus:O.default.shape({})})}),editFeedItemId:O.default.number,editCommentId:O.default.number,editComment:O.default.string,editAttachment:O.default.shape({url:O.default.string,size:O.default.number,file_name:O.default.string}),spaceAround:O.default.bool,postComment:O.default.func.isRequired,postCommentCallback:O.default.func,patchCommentCallback:O.default.func,exitEditMode:O.default.func,setIsPosting:O.default.func,setIsEditting:O.default.func,onMount:O.default.func,autoFocus:O.default.bool,disabled:O.default.bool,classes:O.default.shape({}).isRequired,currentUser:O.default.shape(),isNative:O.default.bool,companyId:O.default.number,parentId:O.default.string},J.defaultProps={inputRef:null,editFeedItemId:null,editCommentId:null,parentId:null,editComment:null,editAttachment:{},spaceAround:!1,setIsPosting:H.default,setIsEditting:H.default,onMount:H.default,autoFocus:void 0,disabled:!1,patchCommentCallback:H.default,postCommentCallback:H.default,exitEditMode:H.default,companyId:null,currentUser:{},isNative:A.isNativeDetected};var Q=p.withStyles((function(t){return{paperRoot:{width:"calc(100% - 48px)",marginLeft:48,display:"inline-block",height:32,border:"0","&:focus-within":{boxShadow:"inset 0 0 0 2px ".concat(t.palette.primary.main)},boxShadow:"none",background:"#4D4D4D"},input:{paddingLeft:5,width:"100%"},inputRoot:{height:32,paddingRight:"8px",lineHeight:"29px",paddingLeft:"8px"},inputEl:{padding:"0 0 0 6px",height:"100%"},additionalActionButton:{padding:"6px"},nativeActionButton:{margin:"5px 10px",cursor:"pointer"},fileUploadingError:{marginTop:10,marginLeft:24},inputMain:{marginBottom:0,fontSize:"11px",color:t.palette.primary.text8},inputHelper:{display:"flex",paddingRight:5},cancelText:{cursor:"pointer"},highlightedLabel:{color:t.palette.primary.main},iconTooltip:{marginTop:"3px"},sendButton:{"&:hover":{backgroundColor:"rgba(3,188,212, 0.1)"},"&.MuiButtonBase-root":{padding:7}},inputAdornment:{marginBottom:"0!important",height:"100%"}}}))(J);module.exports=Q;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/CommentInput/index.js"],"sourcesContent":["import { forwardRef, memo, useImperativeHandle } from 'react';\nimport PropTypes from 'prop-types';\nimport noop from 'lodash/noop';\nimport { withStyles } from '@material-ui/core/styles';\nimport { Collapse, Typography, TextField, InputAdornment, Paper } from '@material-ui/core';\nimport classNames from 'classnames';\nimport { get } from 'lodash';\nimport grey from '@material-ui/core/colors/grey';\n\nimport useCommentInput from './useCommentInput';\n\nimport styles from './styles.css';\n\nimport Avatar from '~components/Avatar';\nimport FileUploadIconButton from '~components/FileUploadIconButton';\nimport EmojiIconButton from '~components/EmojiIconButton';\nimport FailedFileUploading from '~components/FailedFileUploading';\nimport UserMention from '~components/UserMention';\nimport FilePreview from '~components/FilePreview';\nimport IconButton from '~components/IconButton';\nimport SendIcon from '~components/Icons/SendIcon';\nimport { isNativeDetected } from '~/utils/mobileDetect';\n\nconst PAGE_NAME = 'commentInput';\n\nconst INPUT_HEIGHT = 32;\nconst AVATAR_SIZE = 32;\n\nconst style = {\n chatAvatarWrapper: {\n display: 'flex',\n alignItems: 'center',\n position: 'absolute',\n left: 0,\n height: INPUT_HEIGHT,\n },\n commentTextFieldContainer: { position: 'relative', margin: '0' },\n commentTextFieldContainerSpaceAround: { position: 'relative', margin: '20px 10px' },\n};\n\nconst muiStyles = theme => ({\n paperRoot: {\n width: 'calc(100% - 48px)',\n marginLeft: AVATAR_SIZE + 16,\n display: 'inline-block',\n height: INPUT_HEIGHT,\n border: '0',\n '&:focus-within': {\n boxShadow: `inset 0 0 0 2px ${theme.palette.primary.main}`,\n },\n boxShadow: 'none',\n background: '#4D4D4D',\n },\n input: {\n paddingLeft: 5,\n width: '100%',\n },\n inputRoot: {\n height: INPUT_HEIGHT,\n paddingRight: '8px',\n lineHeight: '29px',\n paddingLeft: '8px',\n },\n inputEl: { padding: '0 0 0 6px', height: '100%' },\n additionalActionButton: {\n padding: '6px',\n },\n nativeActionButton: {\n margin: '5px 10px',\n cursor: 'pointer',\n },\n fileUploadingError: {\n marginTop: 10,\n marginLeft: 24,\n },\n inputMain: {\n marginBottom: 0,\n fontSize: '11px',\n color: theme.palette.primary.text8,\n },\n inputHelper: {\n display: 'flex',\n paddingRight: 5,\n },\n cancelText: {\n cursor: 'pointer',\n },\n highlightedLabel: {\n color: theme.palette.primary.main,\n },\n iconTooltip: {\n marginTop: '3px',\n },\n sendButton: {\n '&:hover': {\n backgroundColor: 'rgba(3,188,212, 0.1)',\n },\n '&.MuiButtonBase-root': {\n padding: 7,\n },\n },\n inputAdornment: {\n marginBottom: '0!important',\n height: '100%',\n },\n});\n\nconst emptyObject = {};\n\nconst CommentInput = forwardRef(\n /** @param {PropTypes.InferProps<typeof propTypes>} props */ function CommentInput(\n {\n inputRef = null,\n editFeedItemId = null,\n editCommentId = null,\n parentId = null,\n editComment = null,\n editAttachment = emptyObject,\n spaceAround = false,\n postComment,\n setIsPosting = noop,\n setIsEditting = noop,\n onMount = noop,\n autoFocus,\n disabled = false,\n patchCommentCallback = noop,\n postCommentCallback = noop,\n exitEditMode = noop,\n companyId = null,\n currentUser = emptyObject,\n isNative = isNativeDetected,\n classes,\n },\n ref\n ) {\n const {\n state,\n update,\n imperativeHandle,\n handleSendComment,\n handleKeyDown,\n handleSelectEmoji,\n handleAttachmentLoadingError,\n handleFileUpload,\n handleFileDelete,\n handleCancelClick,\n } = useCommentInput({\n inputRef,\n editFeedItemId,\n editCommentId,\n editComment,\n editAttachment,\n postComment,\n setIsPosting,\n setIsEditting,\n patchCommentCallback,\n postCommentCallback,\n exitEditMode,\n });\n useImperativeHandle(ref, () => imperativeHandle, [imperativeHandle]);\n\n const currentUserFullName = `${\n get(currentUser, ['attributes', 'first_name']) || get(currentUser, 'first_name')\n } ${get(currentUser, ['attributes', 'last_name']) || get(currentUser, 'last_name')}`;\n\n const isVisibleActionBar =\n state.isInputFocused ||\n state.attachmentUrl ||\n state.comment ||\n editComment ||\n editAttachment?.url;\n\n return (\n <div\n style={\n spaceAround ? style.commentTextFieldContainerSpaceAround : style.commentTextFieldContainer\n }\n >\n <div style={style.chatAvatarWrapper}>\n <Avatar\n displayName={currentUserFullName}\n size={AVATAR_SIZE}\n imgSrc={currentUser && currentUser.profile_photo}\n />\n </div>\n <Paper className={classes.paperRoot}>\n <TextField\n data-testid={`${PAGE_NAME}_input`}\n placeholder=\"Type Comment\"\n FormHelperTextProps={{\n component: 'div',\n margin: 'dense',\n }}\n InputProps={{\n inputComponent: UserMention,\n inputProps: {\n onChange: comment => update({ comment }),\n singleLine: true,\n value: state.comment || '',\n inputRef: inputRef,\n withLightTheme: false,\n onMount: onMount,\n companyId: companyId,\n autoFocus: autoFocus,\n disabled: disabled,\n onFocus: () => update({ isInputFocused: true }),\n onBlur: () => update({ isInputFocused: false }),\n allowSuggestionsAboveCursor: true,\n },\n endAdornment: !isNative && (\n <InputAdornment position=\"end\" className={classes.inputAdornment}>\n {!state.attachmentUrl && (\n <div\n className={classNames(\n styles.cCommentInputIconContainer,\n styles.cCommentInputIconUpload\n )}\n >\n <FileUploadIconButton\n openPreviewDialogOnUpload={false}\n disableRipple\n onFinish={handleFileUpload}\n onError={handleAttachmentLoadingError}\n fileUploadIconClassName={classes.additionalActionButton}\n htmlColor={grey[400]}\n inputId={`comment-attachment-${editCommentId || parentId}`}\n tooltipProps={{\n title: 'Attach File',\n classes: { tooltip: classes.iconTooltip },\n placement: 'top',\n }}\n />\n </div>\n )}\n <div className={styles.cCommentInputIconContainer}>\n <EmojiIconButton\n data-testid={`${PAGE_NAME}_emojiButton`}\n handleSelectEmoji={handleSelectEmoji}\n emojiIconClassName={classes.additionalActionButton}\n htmlColor={grey[400]}\n disableRipple\n tooltipProps={{\n title: 'Add Emoji',\n classes: { tooltip: classes.iconTooltip },\n placement: 'top',\n }}\n />\n </div>\n </InputAdornment>\n ),\n disableUnderline: true,\n classes: {\n root: classes.inputRoot,\n input: classes.inputEl,\n },\n }}\n className={classes.input}\n onKeyDown={handleKeyDown}\n />\n </Paper>\n\n {state.attachmentLoadingError && (\n <FailedFileUploading\n errorMessage={state.attachmentLoadingError}\n className={classes.fileUploadingError}\n />\n )}\n\n {state.attachmentUrl && (\n <FilePreview\n fileName={state.attachmentName}\n fileUrl={state.attachmentUrl}\n handleFileDelete={handleFileDelete}\n classes={classes}\n />\n )}\n <Collapse in={isVisibleActionBar} mountOnEnter unmountOnExit>\n <div className={styles.cCommentInputSendContainer}>\n <div className={styles.cCommentInputSendContainerCancel}>\n <Typography\n data-testid={`${PAGE_NAME}_cancel`}\n variant=\"caption\"\n className={classNames(\n classes.inputMain,\n classes.cancelText,\n classes.highlightedLabel\n )}\n component=\"div\"\n gutterBottom\n onClick={handleCancelClick}\n >\n Cancel\n </Typography>\n </div>\n <div className={styles.cCommentInputSendContainerSend}>\n <Typography\n variant=\"caption\"\n className={classNames(classes.inputMain, classes.inputHelper)}\n component=\"div\"\n gutterBottom\n >\n Press \n <Typography\n variant=\"caption\"\n color=\"primary\"\n className={classNames(classes.inputMain, classes.highlightedLabel)}\n >\n Enter\n </Typography>\n to send\n </Typography>\n <IconButton\n size=\"large\"\n tooltipProps={{ title: 'Send' }}\n data-testid={`${PAGE_NAME}_sendButton`}\n onClick={handleSendComment}\n classes={{ root: classes.sendButton }}\n >\n <SendIcon />\n </IconButton>\n </div>\n </div>\n </Collapse>\n </div>\n );\n }\n);\n\nconst propTypes = {\n inputRef: PropTypes.shape({ current: PropTypes.shape({ focus: PropTypes.shape({}) }) }),\n editFeedItemId: PropTypes.number,\n editCommentId: PropTypes.number,\n editComment: PropTypes.string,\n editAttachment: PropTypes.shape({\n url: PropTypes.string,\n size: PropTypes.number,\n file_name: PropTypes.string,\n }),\n spaceAround: PropTypes.bool,\n postComment: PropTypes.func.isRequired,\n postCommentCallback: PropTypes.func,\n patchCommentCallback: PropTypes.func,\n exitEditMode: PropTypes.func,\n setIsPosting: PropTypes.func,\n setIsEditting: PropTypes.func,\n onMount: PropTypes.func,\n autoFocus: PropTypes.bool,\n disabled: PropTypes.bool,\n\n classes: PropTypes.shape({}).isRequired,\n\n currentUser: PropTypes.shape(),\n isNative: PropTypes.bool,\n companyId: PropTypes.number,\n parentId: PropTypes.string,\n};\n\nCommentInput.propTypes = propTypes;\n\nexport default withStyles(muiStyles)(memo(CommentInput));\n"],"names":["style","chatAvatarWrapper","display","alignItems","position","left","height","commentTextFieldContainer","margin","commentTextFieldContainerSpaceAround","emptyObject","CommentInput","forwardRef","ref","_ref$inputRef","_ref","inputRef","_ref$editFeedItemId","editFeedItemId","_ref$editCommentId","editCommentId","_ref$parentId","parentId","_ref$editComment","editComment","_ref$editAttachment","editAttachment","_ref$spaceAround","spaceAround","postComment","_ref$setIsPosting","setIsPosting","noop","_ref$setIsEditting","setIsEditting","_ref$onMount","onMount","autoFocus","_ref$disabled","disabled","_ref$patchCommentCall","patchCommentCallback","_ref$postCommentCallb","postCommentCallback","_ref$exitEditMode","exitEditMode","_ref$companyId","companyId","_ref$currentUser","currentUser","_ref$isNative","isNative","isNativeDetected","classes","_useCommentInput","useCommentInput","state","update","imperativeHandle","handleSendComment","handleKeyDown","handleSelectEmoji","handleAttachmentLoadingError","handleFileUpload","handleFileDelete","handleCancelClick","useImperativeHandle","currentUserFullName","get","concat","isVisibleActionBar","isInputFocused","attachmentUrl","comment","url","_jsxs","children","_jsx","jsx","Avatar","displayName","size","imgSrc","profile_photo","Paper","className","paperRoot","TextField","placeholder","FormHelperTextProps","component","InputProps","inputComponent","UserMention","inputProps","onChange","singleLine","value","withLightTheme","onFocus","onBlur","allowSuggestionsAboveCursor","endAdornment","InputAdornment","inputAdornment","classNames","styles","cCommentInputIconContainer","cCommentInputIconUpload","FileUploadIconButton","openPreviewDialogOnUpload","disableRipple","onFinish","onError","fileUploadIconClassName","additionalActionButton","htmlColor","grey","inputId","tooltipProps","title","tooltip","iconTooltip","placement","EmojiIconButton","emojiIconClassName","disableUnderline","root","inputRoot","input","inputEl","onKeyDown","attachmentLoadingError","FailedFileUploading","errorMessage","fileUploadingError","FilePreview","fileName","attachmentName","fileUrl","Collapse","in","mountOnEnter","unmountOnExit","jsxs","cCommentInputSendContainer","cCommentInputSendContainerCancel","Typography","variant","inputMain","cancelText","highlightedLabel","gutterBottom","onClick","cCommentInputSendContainerSend","inputHelper","color","IconButton","sendButton","SendIcon","propTypes","PropTypes","shape","current","focus","number","string","file_name","bool","func","isRequired","withStyles","theme","width","marginLeft","AVATAR_SIZE","border","boxShadow","palette","primary","main","background","paddingLeft","paddingRight","lineHeight","padding","nativeActionButton","cursor","marginTop","marginBottom","fontSize","text8","backgroundColor","memo"],"mappings":"kwBA4BMA,EAAQ,CACZC,kBAAmB,CACjBC,QAAS,OACTC,WAAY,SACZC,SAAU,WACVC,KAAM,EACNC,OATiB,IAWnBC,0BAA2B,CAAEH,SAAU,WAAYI,OAAQ,KAC3DC,qCAAsC,CAAEL,SAAU,WAAYI,OAAQ,cAsElEE,EAAc,CAAA,EAEdC,EAAeC,EAAAA,YAC0C,SAuB3DC,EAAAA,GACA,IAAAC,EAAAC,EAtBEC,SAAAA,aAAW,KAAIF,EAAAG,EAAAF,EACfG,eAAAA,aAAiB,KAAID,EAAAE,EAAAJ,EACrBK,cAAAA,aAAgB,KAAID,EAAAE,EAAAN,EACpBO,SAAAA,aAAW,KAAID,EAAAE,EAAAR,EACfS,YAAAA,aAAc,KAAID,EAAAE,EAAAV,EAClBW,eAAAA,aAAiBhB,EAAWe,EAAAE,EAAAZ,EAC5Ba,YAAAA,cAAmBD,EACnBE,IAAAA,YAAWC,EAAAf,EACXgB,aAAAA,aAAeC,EAAI,QAAAF,EAAAG,EAAAlB,EACnBmB,cAAAA,aAAgBF,EAAI,QAAAC,EAAAE,EAAApB,EACpBqB,QAAAA,aAAUJ,EAAI,QAAAG,EACdE,IAAAA,UAASC,EAAAvB,EACTwB,SAAAA,cAAgBD,EAAAE,EAAAzB,EAChB0B,qBAAAA,aAAuBT,EAAI,QAAAQ,EAAAE,EAAA3B,EAC3B4B,oBAAAA,aAAsBX,EAAI,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mBAAoB,CAClBqD,UAAW,GACXd,WAAY,IAEdzB,UAAW,CACTwC,aAAc,EACdC,SAAU,OACVlC,MAAOgB,EAAMM,QAAQC,QAAQY,OAE/BpC,YAAa,CACXzJ,QAAS,OACTqL,aAAc,GAEhBjC,WAAY,CACVqC,OAAQ,WAEVpC,iBAAkB,CAChBK,MAAOgB,EAAMM,QAAQC,QAAQC,MAE/B1D,YAAa,CACXkE,UAAW,OAEb9B,WAAY,CACV,UAAW,CACTkC,gBAAiB,wBAEnB,uBAAwB,CACtBP,QAAS,IAGbjF,eAAgB,CACdqF,aAAc,cACdvL,OAAQ,QAEX,GA8PcqK,CAAsBsB,EAAIA,KAACtL"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/CommentInput/index.js"],"sourcesContent":["import { PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport noop from 'lodash/noop';\nimport { withStyles } from '@material-ui/core/styles';\nimport { Collapse, Typography, TextField, InputAdornment, Paper } from '@material-ui/core';\nimport classNames from 'classnames';\nimport { get } from 'lodash';\nimport grey from '@material-ui/core/colors/grey';\n\nimport { patchFeedItemComment } from '../../clients/jsonApi';\n\nimport styles from './styles.css';\n\nimport Avatar from '~components/Avatar';\nimport FileUploadIconButton from '~components/FileUploadIconButton';\nimport EmojiIconButton from '~components/EmojiIconButton';\nimport FailedFileUploading from '~components/FailedFileUploading';\nimport UserMention from '~components/UserMention';\nimport FilePreview from '~components/FilePreview';\nimport IconButton from '~components/IconButton';\nimport SendIcon from '~components/Icons/SendIcon';\nimport { isSuggestionsListOpened } from '~components/UserMention/utils';\nimport utils from '~utils/main';\nimport { isNativeDetected } from '~/utils/mobileDetect';\nimport { notifyCommentEdit, notifyCommentPost } from '~utils/nativeMessages'; // question here\n\nconst PAGE_NAME = 'commentInput';\n\nconst INPUT_HEIGHT = 32;\nconst AVATAR_SIZE = 32;\n\nconst style = {\n chatAvatarWrapper: {\n display: 'flex',\n alignItems: 'center',\n position: 'absolute',\n left: 0,\n height: INPUT_HEIGHT,\n },\n commentTextFieldContainer: { position: 'relative', margin: '0' },\n commentTextFieldContainerSpaceAround: { position: 'relative', margin: '20px 10px' },\n};\n\nconst muiStyles = theme => ({\n paperRoot: {\n width: 'calc(100% - 48px)',\n marginLeft: AVATAR_SIZE + 16,\n display: 'inline-block',\n height: INPUT_HEIGHT,\n border: '0',\n '&:focus-within': {\n boxShadow: `inset 0 0 0 2px ${theme.palette.primary.main}`,\n },\n boxShadow: 'none',\n background: '#4D4D4D',\n },\n input: {\n paddingLeft: 5,\n width: '100%',\n },\n inputRoot: {\n height: INPUT_HEIGHT,\n paddingRight: '8px',\n lineHeight: '29px',\n paddingLeft: '8px',\n },\n inputEl: { padding: '0 0 0 6px', height: '100%' },\n additionalActionButton: {\n padding: '6px',\n },\n nativeActionButton: {\n margin: '5px 10px',\n cursor: 'pointer',\n },\n fileUploadingError: {\n marginTop: 10,\n marginLeft: 24,\n },\n inputMain: {\n marginBottom: 0,\n fontSize: '11px',\n color: theme.palette.primary.text8,\n },\n inputHelper: {\n display: 'flex',\n paddingRight: 5,\n },\n cancelText: {\n cursor: 'pointer',\n },\n highlightedLabel: {\n color: theme.palette.primary.main,\n },\n iconTooltip: {\n marginTop: '3px',\n },\n sendButton: {\n '&:hover': {\n backgroundColor: 'rgba(3,188,212, 0.1)',\n },\n '&.MuiButtonBase-root': {\n padding: 7,\n },\n },\n inputAdornment: {\n marginBottom: '0!important',\n height: '100%',\n },\n});\n\nclass CommentInput extends PureComponent {\n constructor(props) {\n super(props);\n\n this.state = {\n comment: '',\n attachmentUrl: null,\n attachmentName: null,\n attachmentSize: null,\n\n attachmentLoadingError: null,\n isInputFocused: false,\n };\n }\n\n componentDidMount() {\n if (this.isEditMode) {\n this.setInitialCommentValue();\n }\n }\n\n componentDidUpdate(prevProps) {\n const enteredEditMode = this.isEditMode && !prevProps.editFeedItemId;\n if (\n enteredEditMode ||\n (this.props.editCommentId && this.props.editCommentId !== prevProps.editCommentId)\n ) {\n this.setInitialCommentValue();\n }\n }\n\n get isEditMode() {\n return !!this.props.editFeedItemId;\n }\n\n setInitialCommentValue() {\n const attachmentUrl = this.props.editAttachment ? this.props.editAttachment.url : null;\n\n this.setState({\n comment: this.props.editComment,\n attachmentUrl,\n attachmentName: attachmentUrl\n ? this.props.editAttachment.file_name ||\n utils.getFileNameWithExtensionFromPath(attachmentUrl)\n : null,\n attachmentSize: this.props.editAttachment ? this.props.editAttachment.size : null,\n });\n }\n\n handleSelectEmoji = emoji =>\n this.setState(({ comment }) => ({ comment: `${comment}${emoji.native}` }));\n\n postComment = async comment => {\n let commentResponse;\n try {\n commentResponse = await this.props.postComment(comment);\n } catch (e) {\n console.error(e.message);\n }\n\n return commentResponse;\n };\n\n patchComment = async comment => {\n const { editFeedItemId, editCommentId } = this.props;\n\n let commentResponse;\n\n try {\n commentResponse = await patchFeedItemComment(editFeedItemId, editCommentId, comment);\n } catch (e) {\n console.error(e.message);\n }\n\n return commentResponse;\n };\n\n focusOnRef() {\n if (this.props.inputRef) this.props.inputRef.current.focus();\n }\n\n clearCommentField = callback => {\n this.setState(\n {\n comment: '',\n attachmentUrl: null,\n attachmentName: null,\n attachmentSize: null,\n },\n () => {\n this.focusOnRef();\n if (callback && typeof callback === 'function') callback();\n }\n );\n };\n\n handleKeyDown = event => {\n const { key } = event;\n\n if (key === 'Escape') this.props.exitEditMode();\n\n if (key === 'Enter') {\n if (!isSuggestionsListOpened()) {\n event.preventDefault();\n this.handleSendComment();\n }\n }\n };\n\n handleAttachmentLoadingError = attachmentLoadingError => {\n this.setState({\n attachmentUrl: null,\n attachmentName: null,\n attachmentSize: null,\n attachmentLoadingError,\n });\n };\n\n handleFileUpload = (attachmentUrl, attachmentName, attachmentSize) => {\n this.setState({\n attachmentUrl,\n attachmentName,\n attachmentSize,\n attachmentLoadingError: null,\n });\n };\n\n handleNativeFileUpload = () => {\n const { comment } = this.state;\n\n if (this.isEditMode) {\n notifyCommentEdit(comment);\n this.clearCommentField(this.props.exitEditMode);\n } else {\n notifyCommentPost(comment);\n this.clearCommentField();\n }\n };\n\n handleFileDelete = () =>\n this.setState({ attachmentUrl: null, attachmentName: null, attachmentSize: null });\n\n handleSendComment = async () => {\n const textComment = this.state.comment ? this.state.comment.trim() : null;\n if (!textComment && !this.state.attachmentUrl) return;\n\n const comment = {\n comment: {\n body: textComment,\n attachment: {\n url: this.state.attachmentUrl,\n size: this.state.attachmentSize,\n file_name: this.state.attachmentName,\n },\n },\n };\n\n let commentResponse;\n\n if (this.isEditMode) {\n this.props.setIsEditting(true);\n\n commentResponse = await this.patchComment(comment);\n await this.props.patchCommentCallback(commentResponse);\n\n this.props.setIsEditting(false);\n this.clearCommentField();\n this.props.exitEditMode();\n } else {\n this.props.setIsPosting(true);\n\n commentResponse = await this.postComment(comment);\n await this.props.postCommentCallback(commentResponse);\n\n this.props.setIsPosting(false);\n this.clearCommentField();\n }\n };\n\n handleCancelClick = () => {\n this.setState(\n {\n comment: '',\n attachmentUrl: null,\n attachmentName: null,\n attachmentSize: null,\n },\n this.props.exitEditMode()\n );\n };\n\n render() {\n const { classes, currentUser } = this.props;\n\n const currentUserFullName = `${\n get(currentUser, ['attributes', 'first_name']) || get(currentUser, 'first_name')\n } ${get(currentUser, ['attributes', 'last_name']) || get(currentUser, 'last_name')}`;\n\n const isVisibleActionBar =\n this.state.isInputFocused ||\n this.state.attachmentUrl ||\n this.state.comment ||\n this.props.editComment ||\n this.props.editAttachment?.url;\n\n return (\n <div\n style={\n this.props.spaceAround\n ? style.commentTextFieldContainerSpaceAround\n : style.commentTextFieldContainer\n }\n >\n <div style={style.chatAvatarWrapper}>\n <Avatar\n displayName={currentUserFullName}\n size={AVATAR_SIZE}\n imgSrc={this.props.currentUser && this.props.currentUser.profile_photo}\n />\n </div>\n <Paper className={this.props.classes.paperRoot}>\n <TextField\n data-testid={`${PAGE_NAME}_input`}\n placeholder=\"Type Comment\"\n FormHelperTextProps={{\n component: 'div',\n margin: 'dense',\n }}\n InputProps={{\n inputComponent: UserMention,\n inputProps: {\n onChange: comment => this.setState({ comment }),\n singleLine: true,\n value: this.state.comment || '',\n inputRef: this.props.inputRef,\n withLightTheme: false,\n onMount: this.props.onMount,\n companyId: this.props.companyId,\n autoFocus: this.props.autoFocus,\n disabled: this.props.disabled,\n onFocus: () => this.setState({ isInputFocused: true }),\n onBlur: () => this.setState({ isInputFocused: false }),\n allowSuggestionsAboveCursor: true,\n },\n endAdornment: !this.props.isNative && (\n <InputAdornment position=\"end\" className={this.props.classes.inputAdornment}>\n {!this.state.attachmentUrl && (\n <div\n className={classNames(\n styles.cCommentInputIconContainer,\n styles.cCommentInputIconUpload\n )}\n >\n <FileUploadIconButton\n openPreviewDialogOnUpload={false}\n disableRipple\n onFinish={this.handleFileUpload}\n onError={this.handleAttachmentLoadingError}\n fileUploadIconClassName={this.props.classes.additionalActionButton}\n htmlColor={grey[400]}\n inputId={`comment-attachment-${\n this.props.editCommentId || this.props.parentId\n }`}\n tooltipProps={{\n title: 'Attach File',\n classes: { tooltip: classes.iconTooltip },\n placement: 'top',\n }}\n />\n </div>\n )}\n <div className={styles.cCommentInputIconContainer}>\n <EmojiIconButton\n data-testid={`${PAGE_NAME}_emojiButton`}\n handleSelectEmoji={this.handleSelectEmoji}\n emojiIconClassName={this.props.classes.additionalActionButton}\n htmlColor={grey[400]}\n disableRipple\n tooltipProps={{\n title: 'Add Emoji',\n classes: { tooltip: classes.iconTooltip },\n placement: 'top',\n }}\n />\n </div>\n </InputAdornment>\n ),\n disableUnderline: true,\n classes: {\n root: this.props.classes.inputRoot,\n input: this.props.classes.inputEl,\n },\n }}\n className={this.props.classes.input}\n onKeyDown={this.handleKeyDown}\n />\n </Paper>\n\n {this.state.attachmentLoadingError && (\n <FailedFileUploading\n errorMessage={this.state.attachmentLoadingError}\n className={this.props.classes.fileUploadingError}\n />\n )}\n\n {this.state.attachmentUrl && (\n <FilePreview\n fileName={this.state.attachmentName}\n fileUrl={this.state.attachmentUrl}\n handleFileDelete={this.handleFileDelete}\n classes={this.props.classes}\n />\n )}\n <Collapse in={isVisibleActionBar} mountOnEnter unmountOnExit>\n <div className={styles.cCommentInputSendContainer}>\n <div className={styles.cCommentInputSendContainerCancel}>\n <Typography\n data-testid={`${PAGE_NAME}_cancel`}\n variant=\"caption\"\n className={classNames(\n this.props.classes.inputMain,\n this.props.classes.cancelText,\n this.props.classes.highlightedLabel\n )}\n component=\"div\"\n gutterBottom\n onClick={this.handleCancelClick}\n >\n Cancel\n </Typography>\n </div>\n <div className={styles.cCommentInputSendContainerSend}>\n <Typography\n variant=\"caption\"\n className={classNames(this.props.classes.inputMain, this.props.classes.inputHelper)}\n component=\"div\"\n gutterBottom\n >\n Press \n <Typography\n variant=\"caption\"\n color=\"primary\"\n className={classNames(\n this.props.classes.inputMain,\n this.props.classes.highlightedLabel\n )}\n >\n Enter\n </Typography>\n to send\n </Typography>\n <IconButton\n size=\"large\"\n tooltipProps={{ title: 'Send' }}\n data-testid={`${PAGE_NAME}_sendButton`}\n onClick={this.handleSendComment}\n classes={{ root: this.props.classes.sendButton }}\n >\n <SendIcon />\n </IconButton>\n </div>\n </div>\n </Collapse>\n </div>\n );\n }\n}\n\nCommentInput.propTypes = {\n inputRef: PropTypes.shape({ current: PropTypes.shape({ focus: PropTypes.shape({}) }) }),\n editFeedItemId: PropTypes.number,\n editCommentId: PropTypes.number,\n editComment: PropTypes.string,\n editAttachment: PropTypes.shape({\n url: PropTypes.string,\n size: PropTypes.number,\n file_name: PropTypes.string,\n }),\n spaceAround: PropTypes.bool,\n postComment: PropTypes.func.isRequired,\n postCommentCallback: PropTypes.func,\n patchCommentCallback: PropTypes.func,\n exitEditMode: PropTypes.func,\n setIsPosting: PropTypes.func,\n setIsEditting: PropTypes.func,\n onMount: PropTypes.func,\n autoFocus: PropTypes.bool,\n disabled: PropTypes.bool,\n\n classes: PropTypes.shape({}).isRequired,\n\n currentUser: PropTypes.shape(),\n isNative: PropTypes.bool,\n companyId: PropTypes.number,\n parentId: PropTypes.string,\n};\n\nCommentInput.defaultProps = {\n inputRef: null,\n editFeedItemId: null,\n editCommentId: null,\n parentId: null,\n editComment: null,\n editAttachment: {},\n spaceAround: false,\n setIsPosting: noop,\n setIsEditting: noop,\n onMount: noop,\n autoFocus: undefined,\n disabled: false,\n patchCommentCallback: noop,\n postCommentCallback: noop,\n exitEditMode: noop,\n companyId: null,\n currentUser: {},\n\n isNative: isNativeDetected,\n};\n\nexport default withStyles(muiStyles)(CommentInput);\n"],"names":["style","chatAvatarWrapper","display","alignItems","position","left","height","commentTextFieldContainer","margin","commentTextFieldContainerSpaceAround","CommentInput","_PureComponent","_inherits","_super","_createSuper","props","_this","_ref2","_ref3","_classCallCheck","this","call","_defineProperty","_assertThisInitialized","emoji","setState","_ref","comment","native","_asyncToGenerator","_regeneratorRuntime","mark","commentResponse","wrap","_context","prev","next","postComment","sent","t0","console","error","message","abrupt","stop","_callee","_x","apply","arguments","_this$props","editFeedItemId","editCommentId","_context2","patchFeedItemComment","_callee2","_x2","callback","attachmentUrl","attachmentName","attachmentSize","focusOnRef","event","key","exitEditMode","isSuggestionsListOpened","preventDefault","handleSendComment","attachmentLoadingError","state","isEditMode","notifyCommentEdit","clearCommentField","notifyCommentPost","_callee3","textComment","_context3","trim","body","attachment","url","size","file_name","setIsEditting","patchComment","patchCommentCallback","setIsPosting","postCommentCallback","isInputFocused","_createClass","value","setInitialCommentValue","prevProps","get","editAttachment","editComment","utils","getFileNameWithExtensionFromPath","inputRef","current","focus","_this$props$editAttac","_this2","_this$props2","classes","currentUser","currentUserFullName","concat","isVisibleActionBar","_jsxs","spaceAround","children","_jsx","jsx","Avatar","displayName","imgSrc","profile_photo","Paper","className","paperRoot","TextField","placeholder","FormHelperTextProps","component","InputProps","inputComponent","UserMention","inputProps","onChange","singleLine","withLightTheme","onMount","companyId","autoFocus","disabled","onFocus","onBlur","allowSuggestionsAboveCursor","endAdornment","isNative","InputAdornment","inputAdornment","classNames","styles","cCommentInputIconContainer","cCommentInputIconUpload","FileUploadIconButton","openPreviewDialogOnUpload","disableRipple","onFinish","handleFileUpload","onError","handleAttachmentLoadingError","fileUploadIconClassName","additionalActionButton","htmlColor","grey","inputId","parentId","tooltipProps","title","tooltip","iconTooltip","placement","EmojiIconButton","handleSelectEmoji","emojiIconClassName","disableUnderline","root","inputRoot","input","inputEl","onKeyDown","handleKeyDown","FailedFileUploading","errorMessage","fileUploadingError","FilePreview","fileName","fileUrl","handleFileDelete","Collapse","in","mountOnEnter","unmountOnExit","jsxs","cCommentInputSendContainer","cCommentInputSendContainerCancel","Typography","variant","inputMain","cancelText","highlightedLabel","gutterBottom","onClick","handleCancelClick","cCommentInputSendContainerSend","inputHelper","color","IconButton","sendButton","SendIcon","PureComponent","propTypes","PropTypes","shape","number","string","bool","func","isRequired","defaultProps","noop","undefined","isNativeDetected","CommentInput$1","withStyles","theme","width","marginLeft","AVATAR_SIZE","border","boxShadow","palette","primary","main","background","paddingLeft","paddingRight","lineHeight","padding","nativeActionButton","cursor","marginTop","marginBottom","fontSize","text8","backgroundColor"],"mappings":"40DA0BA,IAKMA,EAAQ,CACZC,kBAAmB,CACjBC,QAAS,OACTC,WAAY,SACZC,SAAU,WACVC,KAAM,EACNC,OATiB,IAWnBC,0BAA2B,CAAEH,SAAU,WAAYI,OAAQ,KAC3DC,qCAAsC,CAAEL,SAAU,WAAYI,OAAQ,cAsElEE,EAAY,SAAAC,GAAAC,UAAAF,EAAAC,GAAA,IAAAE,EAAAC,EAAAJ,GAChB,SAAAA,EAAYK,GAAO,IAAAC,EAiDyDC,EAW3EC,EAjDG,OAXeC,UAAAC,KAAAV,GACjBM,EAAAH,EAAAQ,KAAAD,KAAML,GAAOO,EAAAA,QAAAC,EAAAA,QAAAP,GAAA,qBA+CK,SAAAQ,GAAK,OACvBR,EAAKS,UAAS,SAAAC,GAAA,IAAGC,IAAAA,QAAO,MAAQ,CAAEA,QAAYA,GAAAA,OAAAA,GAAUH,OAAAA,EAAMI,QAAU,GAAE,IAAAN,EAAAA,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qBjBuN,OAAQ,IACR,iBAAkB,CAChBC,oCAA8BL,EAAMM,QAAQC,QAAQC,OAEtDH,UAAW,OACXI,WAAY,WAEdxD,MAAO,CACLyD,YAAa,EACbT,MAAO,QAETjD,UAAW,CACTnK,OAjCiB,GAkCjB8N,aAAc,MACdC,WAAY,OACZF,YAAa,OAEfxD,QAAS,CAAE2D,QAAS,YAAahO,OAAQ,QACzCoJ,uBAAwB,CACtB4E,QAAS,OAEXC,mBAAoB,CAClB/N,OAAQ,WACRgO,OAAQ,WAEVxD,mBAAoB,CAClByD,UAAW,GACXd,WAAY,IAEd7B,UAAW,CACT4C,aAAc,EACdC,SAAU,OACVrC,MAAOmB,EAAMM,QAAQC,QAAQY,OAE/BvC,YAAa,CACXnM,QAAS,OACTkO,aAAc,GAEhBrC,WAAY,CACVyC,OAAQ,WAEVxC,iBAAkB,CAChBM,MAAOmB,EAAMM,QAAQC,QAAQC,MAE/B/D,YAAa,CACXuE,UAAW,OAEbjC,WAAY,CACV,UAAW,CACTqC,gBAAiB,wBAEnB,uBAAwB,CACtBP,QAAS,IAGbzF,eAAgB,CACd6F,aAAc,cACdpO,OAAQ,QAEX,GAqackN,CAAsB9M"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";require('./../../ext-esm/style-inject/dist/style-inject.es.js')(".CommentInputNext_root__5uxKl{
|
|
1
|
+
"use strict";require('./../../ext-esm/style-inject/dist/style-inject.es.js')(".CommentInputNext_root__5uxKl{background:var(--palette-background-b-6);border-radius:12px;display:flex;flex-direction:column;overflow:hidden;position:relative}.CommentInputNext_dropOverlay__E5Riv{align-items:center;background:rgb(from var(--palette-primary-main) r g b/.1);border:1px dashed var(--palette-primary-main);border-radius:inherit;color:var(--palette-primary-main);display:flex;font-size:14px;inset:0;justify-content:center;line-height:20px;pointer-events:none;position:absolute;z-index:5}.CommentInputNext_inputPanel__4KOFc{display:flex;flex-direction:column;gap:8px;padding:12px 12px 8px}.CommentInputNext_rootEmbedded__-LyQl{background:transparent;border-radius:0;overflow:visible}.CommentInputNext_toolbarRow__L8xXu{align-items:center;display:flex;justify-content:space-between;width:100%}.CommentInputNext_divider__LWp-3{background:var(--palette-background-b-4);height:1px}.CommentInputNext_metaShare__yJ8GZ{color:var(--palette-primary-text-6);display:flex;flex-direction:column;gap:8px;padding:8px 12px}.CommentInputNext_rootBare__lxyYY{display:flex;flex-direction:column;gap:8px;position:relative}.CommentInputNext_fieldRow__Rqcbr{align-items:flex-start;display:flex;gap:8px}.CommentInputNext_leading__yDBbV{flex-shrink:0}.CommentInputNext_field__OpnOp{align-items:flex-end;background:rgb(from var(--palette-primary-text-1) r g b/.04);border:1px solid rgb(from var(--palette-primary-text-1) r g b/.04);border-radius:8px;display:flex;flex:1 0 0;gap:8px;max-height:256px;min-height:36px;min-width:0;overflow:hidden;padding:6px 8px}.CommentInputNext_field__OpnOp:focus-within{border-color:var(--palette-primary-main)}.CommentInputNext_fieldExpanded__w1omA{max-height:none;overflow:visible}.CommentInputNext_fieldDisabled__g3aIT{opacity:.6}.CommentInputNext_bareToolbar__nFQP-{align-items:center;color:var(--palette-primary-text-6);display:flex;flex-shrink:0}.CommentInputNext_fieldMain__Rs8-Y{flex:1 0 0;min-width:0}.CommentInputNext_attachment__2EDgL,.CommentInputNext_fieldMain__Rs8-Y{display:flex;flex-direction:column;gap:8px}.CommentInputNext_input__w6b1c{background:transparent;border:none;color:var(--palette-primary-text-1);font:inherit;font-size:14px;line-height:20px;outline:none;resize:none;width:100%}.CommentInputNext_input__w6b1c::placeholder{color:var(--palette-primary-text-9)}.CommentInputNext_input__w6b1c:disabled{cursor:not-allowed}.CommentInputNext_toolbar__Zs2OG{align-items:center;color:var(--palette-primary-text-6);display:flex;gap:4px;margin-left:-4px}.CommentInputNext_send__p248I{flex-shrink:0}"),module.exports={spacing:"8",root:"CommentInputNext_root__5uxKl",dropOverlay:"CommentInputNext_dropOverlay__E5Riv",inputPanel:"CommentInputNext_inputPanel__4KOFc",rootEmbedded:"CommentInputNext_rootEmbedded__-LyQl",toolbarRow:"CommentInputNext_toolbarRow__L8xXu",divider:"CommentInputNext_divider__LWp-3",metaShare:"CommentInputNext_metaShare__yJ8GZ",rootBare:"CommentInputNext_rootBare__lxyYY",fieldRow:"CommentInputNext_fieldRow__Rqcbr",leading:"CommentInputNext_leading__yDBbV",field:"CommentInputNext_field__OpnOp",fieldExpanded:"CommentInputNext_fieldExpanded__w1omA",fieldDisabled:"CommentInputNext_fieldDisabled__g3aIT",bareToolbar:"CommentInputNext_bareToolbar__nFQP-",fieldMain:"CommentInputNext_fieldMain__Rs8-Y",attachment:"CommentInputNext_attachment__2EDgL",input:"CommentInputNext_input__w6b1c",toolbar:"CommentInputNext_toolbar__Zs2OG",send:"CommentInputNext_send__p248I"};
|
|
2
2
|
//# sourceMappingURL=CommentInputNext.scss.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevCenterAppContainer.js","sources":["../../../../../src/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.tsx"],"sourcesContent":["import { useContext, useMemo, useState } from 'react';\nimport type { ComponentType, FC } from 'react';\nimport classNames from 'classnames';\nimport { noop, pick, pickBy } from 'lodash';\nimport { useTheme } from '@material-ui/core';\n\nimport AppContext from '../AppContext';\nimport { DevCenterRouterContext } from '../DevCenterRouterContext';\n\nimport {\n useAnnotationsData,\n useAnnotationsList,\n useAppMaximized,\n useAppSettings,\n useDevCenterAppProps,\n} from './effects';\nimport { DcFullscreenElemsCoordinatorProvider } from './components/DcFullscreenElemsCoordinatorProvider';\nimport { DevCenterAppDialogs } from './components/DevCenterAppDialogs';\nimport DevCenterAppView from './components/DevCenterAppView';\nimport { LegacyAppActions } from './components/LegacyAppActions';\nimport RestoreAppSizeButton from './components/RestoreAppSizeButton';\nimport { getAppAvailability, getAppVersion } from './utils';\nimport {\n APP_DATA_ASSET_KEYS,\n HOME_PATH_PREFIX,\n MOBILE_CLI_APP_GRID_WIDTH,\n PAGE_NAME,\n} from './constants';\nimport type {\n AppCoordinates,\n AppDataEntry,\n ChatActions,\n DashboardAppLastAnnotation,\n DevCenterAppResource,\n DevCenterCurrentUser,\n DevCenterMenuItem,\n DevCenterRouter,\n LayoutEnvironment,\n RegisterAITools,\n SetIsFullscreenModalMode,\n UpdateDashboardAppLastAnnotation,\n} from './types';\nimport type { FullscreenModes } from '../../../types';\n// Relative on purpose: a `~/` alias does not resolve from the published `.d.ts`.\nimport type { AppDashboardMeta } from '../../../componentsV2/AppCommonsProvider/AppCommonsContext';\nimport { CommentsSwitchProvider } from './components/CommentsSwitch';\n\nimport styles from './DevCenterAppContainer.scss';\n\nimport { isInsideNewMobileApp, isMobileDetected, isNativeDetected } from '~/utils/mobileDetect';\nimport { ToastContainer } from '~/components/Toaster';\nimport { useDevCenterApp } from '~/effects';\nimport { DEV_CENTER_CLI_APP_ID } from '~/constants';\nimport {\n getAppName,\n getAppSegment,\n getTimestampFromQuery,\n isDCAppMultiRig,\n} from '~/utils/devcenter';\nimport { AppCommonsProvider } from '~/componentsV2/AppCommonsProvider';\n\n/**\n * `Partial<FullscreenModes>` carries the seven browser-fullscreen and separate-window members.\n * `AppCommonsProvider` derives `isExpanded` from them and republishes them to the app bundle,\n * so dropping them silently disables both features — and nothing type-checks it, because every\n * member is optional on the provider.\n */\nexport type DevCenterAppContainerProps = Partial<FullscreenModes> & {\n app: DevCenterAppResource;\n currentUser: DevCenterCurrentUser;\n /** Platform router. Not React Router — the DC shell supplies its own. */\n devCenterRouter: DevCenterRouter;\n\n /**\n * Slots for the CLI app bundle's own components. `any` rather than a narrower prop type on\n * purpose: this accepts arbitrary app components, and any narrowing would reject the concretely\n * typed ones consumers pass.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- see the note above\n CLIAppComponent?: ComponentType<any> | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- see the note above\n CLIAppSettings?: ComponentType<any> | null;\n /** Defaults to `app.id` when omitted. */\n appId?: number;\n className?: string | null;\n chatActions?: ChatActions | null;\n coordinates?: AppCoordinates | null;\n currentDashboardAppsLastAnnotations?: DashboardAppLastAnnotation[] | null;\n dashboardMeta?: AppDashboardMeta;\n disableAppAssetSelection?: boolean;\n isActionsDisabled?: boolean;\n /**\n * [REACT-18-MIGRATION-TAG] PLT-3099: the platform's isolation decision, passed only by the\n * in-process branch of DevCenterIsolatedApp; iframe mounts leave it false.\n */\n isNonIsolatedApp?: boolean;\n isSettingsDialogHidden?: boolean;\n layoutEnvironment?: LayoutEnvironment | null;\n onAppContainerClick?: () => void;\n onAppRemove?: () => void;\n onCloneDashboard?: () => void;\n onHelpCenterClick?: () => void;\n onIsMaximizedChange?: (isMaximized: boolean) => void;\n onReportBugClick?: (() => void) | null;\n onSettingChange?: (key: string, value: unknown) => void;\n onSettingsChange?: (value: unknown) => void;\n openIntercom?: () => void;\n registerAITools?: RegisterAITools;\n reloadApp?: () => void;\n setIsFullscreenModalMode?: SetIsFullscreenModalMode;\n timestamp?: number | null;\n updateCurrentDashboardAppLastAnnotation?: UpdateDashboardAppLastAnnotation;\n};\n\nconst isHomePage = (router: DevCenterRouter) =>\n !!router.location.pathname?.startsWith(HOME_PATH_PREFIX);\n\nconst DevCenterAppContainer: FC<DevCenterAppContainerProps> = ({\n CLIAppComponent,\n CLIAppSettings,\n app,\n appId,\n className,\n coordinates,\n currentDashboardAppsLastAnnotations,\n currentUser,\n devCenterRouter,\n disableAppAssetSelection,\n isActionsDisabled,\n isBrowserFullscreen,\n enterBrowserFullscreen,\n exitBrowserFullscreen,\n isSeparateWindow,\n openSeparateWindow,\n closeSeparateWindow,\n setSeparateWindowTitle,\n isNonIsolatedApp = false,\n isSettingsDialogHidden,\n layoutEnvironment,\n onAppContainerClick = noop,\n onAppRemove,\n onReportBugClick,\n onCloneDashboard,\n onHelpCenterClick,\n onIsMaximizedChange,\n onSettingChange = noop,\n onSettingsChange = noop,\n openIntercom = noop,\n registerAITools,\n setIsFullscreenModalMode = noop,\n timestamp,\n updateCurrentDashboardAppLastAnnotation,\n dashboardMeta,\n reloadApp,\n chatActions,\n}) => {\n // `AppContext` is still JavaScript and calls `createContext()` with no argument, so it hands\n // back `undefined`. Declared here rather than asserted; the real fix is a type argument on the\n // context itself, which belongs to `DevCenter/AppContext`.\n const appsData: Record<string, AppDataEntry> | undefined = useContext(AppContext);\n const theme = useTheme();\n const isMobileView = isNativeDetected || isMobileDetected;\n const [mainMenuItems, setMainMenuItems] = useState<DevCenterMenuItem[]>([]);\n const [secondaryMenuItems, setSecondaryMenuItems] = useState<DevCenterMenuItem[]>([]);\n // `||`, not `??`: DevCenterEmbeddedApp uses 0 as its unset sentinel for appId.\n const appDataKey = appId || app.id;\n const appData: AppDataEntry = (appDataKey ? appsData?.[appDataKey] : undefined) ?? {\n isLoading: true,\n };\n const application = app.package?.manifest?.application;\n const segment = getAppSegment(app);\n const isChiplessDashboard = !!dashboardMeta?.isChiplessDashboard;\n const isMultiRig = isDCAppMultiRig({\n uiSettings: application?.ui,\n isChiplessDashboard,\n });\n const isCommentsEnabled = !!application?.ui?.enable_comments;\n const appName = getAppName(app);\n const { isMaximized, setIsMaximized } = useAppMaximized({\n onIsMaximizedChange,\n devCenterRouter,\n appId,\n });\n\n // Isolated apps are mounted without the router query the timestamp normally comes from,\n // so the host passes it as a prop instead.\n const appTimestamp = timestamp || getTimestampFromQuery(devCenterRouter.location.query?.query);\n const isCLIApp = app.id === DEV_CENTER_CLI_APP_ID;\n // Memoised because the CLI-on-mobile branch builds a new object: unmemoised it would be a fresh\n // reference on every render and would keep `useDevCenterAppProps` from ever holding its memo.\n const updatedCoordinates = useMemo(\n () =>\n isCLIApp && isMobileView ? { ...coordinates, w: MOBILE_CLI_APP_GRID_WIDTH } : coordinates,\n [isCLIApp, isMobileView, coordinates]\n );\n const version = getAppVersion(app);\n\n const {\n isLoading: isAppLoading,\n AppSettings,\n AppComponent,\n } = useDevCenterApp({\n CLIAppComponent,\n CLIAppSettings,\n app,\n version,\n });\n\n const { isAppSettingsDialogOpened, toggleAppSettingsDialog } = useAppSettings({\n setIsFullscreenModalMode,\n });\n const { isAnnotationsListOpened, toggleAnnotationsList } = useAnnotationsList();\n\n const isLoading = !!(isAppLoading || !currentUser || (!isMultiRig && appData.isLoading));\n\n const {\n appLastAnnotation,\n assetCompanyId,\n assetIdForAnnotation,\n isAppSupportsAnnotations: isAnnotationsSupported,\n } = useAnnotationsData({\n app,\n appData,\n currentDashboardAppsLastAnnotations,\n });\n\n const filteredAppData = useMemo(\n () => pickBy(pick(appData, APP_DATA_ASSET_KEYS), Boolean),\n [appData]\n );\n\n const simplifiedSecondaryMenuItems = useMemo(\n () =>\n secondaryMenuItems.map(item => ({\n ...item,\n onClick: () => {\n item.onClick?.();\n if (item.to) {\n devCenterRouter.push(item.to);\n }\n },\n })),\n [secondaryMenuItems, devCenterRouter]\n );\n\n const isAppHeadersV3Enabled = !!application?.ui?.use_app_header_v3;\n const isInsideHomePage = isHomePage(devCenterRouter);\n\n const appProps = useDevCenterAppProps({\n app,\n appLastAnnotation,\n appTimestamp,\n chatActions,\n coordinates: updatedCoordinates,\n currentUser,\n devCenterRouter,\n filteredAppData,\n isMaximized,\n layoutEnvironment,\n onSettingChange,\n onSettingsChange,\n registerAITools,\n segment,\n setIsFullscreenModalMode,\n setIsMaximized,\n setMainMenuItems,\n setSecondaryMenuItems,\n toggleAnnotationsList,\n toggleAppSettingsDialog,\n updateCurrentDashboardAppLastAnnotation,\n });\n\n // Called without the native event: this crosses an iframe boundary, where a DOM event\n // cannot be serialised.\n const handleAppContainerClick = () => onAppContainerClick();\n\n // ⚠️⚠️⚠️ When adding/changing providers, also add them to/change /src/testing/AppTestWrapper\n return (\n <DevCenterRouterContext.Provider value={devCenterRouter}>\n <DcFullscreenElemsCoordinatorProvider setIsFullscreenModalMode={setIsFullscreenModalMode}>\n <AppCommonsProvider\n maximized={isMaximized}\n setMaximized={setIsMaximized}\n appId={app.app.id}\n app={app}\n appSettings={app.settings}\n onSettingChange={onSettingChange}\n onSettingsChange={onSettingsChange}\n appHeadersV3Enabled={isAppHeadersV3Enabled}\n isBrowserFullscreen={isBrowserFullscreen}\n enterBrowserFullscreen={enterBrowserFullscreen}\n exitBrowserFullscreen={exitBrowserFullscreen}\n isSeparateWindow={isSeparateWindow}\n openSeparateWindow={openSeparateWindow}\n closeSeparateWindow={closeSeparateWindow}\n setSeparateWindowTitle={setSeparateWindowTitle}\n isNonIsolatedApp={isNonIsolatedApp}\n disableAppAssetSelection={disableAppAssetSelection}\n isMultiRig={isMultiRig}\n currentUser={currentUser}\n appData={appData}\n layoutEnvironment={layoutEnvironment}\n appSettingsComponent={AppSettings}\n dashboardMeta={dashboardMeta}\n toggleAnnotationsList={isAnnotationsSupported ? toggleAnnotationsList : undefined}\n onHelpCenterClick={onHelpCenterClick}\n secondaryMenuItems={simplifiedSecondaryMenuItems}\n onAppRemove={onAppRemove}\n isInsideNewMobileApp={isInsideNewMobileApp}\n globalOffsetWells={dashboardMeta?.globalOffsetWells}\n globalOffsetWellsVersion={dashboardMeta?.globalOffsetWellsVersion}\n globalOffsetWellsToken={dashboardMeta?.globalOffsetWellsToken}\n reloadApp={reloadApp}\n {...filteredAppData}\n >\n <CommentsSwitchProvider>\n <article\n className={classNames(\n 'dc-app-container',\n isInsideNewMobileApp && 'dc-app-container--inside-new-mobile-app',\n isInsideHomePage && 'dc-app-container--inside-home-page',\n className,\n // This class is applied so that DC apps developers can style their content\n // when an app is in fullscreen\n isMaximized && 'dc-app-container__maximized',\n theme.isLightTheme && 'dc-app-container__light-theme',\n styles.container\n )}\n data-testid={`${PAGE_NAME}_${appName}`}\n onClick={handleAppContainerClick}\n >\n <ToastContainer />\n <div className={styles.containerContent}>\n <DevCenterAppView\n // DC apps keep per-asset state in mount-time hooks, so a new asset means a\n // new mount. React 18 batching collapses away the `isLoading` frame this used\n // to rely on whenever AppsDataProvider serves the asset from its cache.\n key={appData.appHash}\n AppComponent={AppComponent}\n app={app}\n appData={filteredAppData}\n availability={getAppAvailability(\n app.availability,\n currentUser.company.with_subscription\n )}\n isCLIApp={isCLIApp}\n isLoading={isLoading}\n isMultiRig={isMultiRig}\n layoutEnvironment={layoutEnvironment ?? null}\n openIntercom={openIntercom}\n segment={segment}\n toggleAppSettingsDialog={toggleAppSettingsDialog}\n appProps={appProps}\n />\n </div>\n <DevCenterAppDialogs\n app={app}\n appData={appData}\n appName={appName}\n appSettingsComponent={AppSettings}\n assetCompanyId={assetCompanyId}\n assetIdForAnnotation={assetIdForAnnotation}\n currentUser={currentUser}\n disableAppAssetSelection={disableAppAssetSelection}\n isAnnotationsListOpened={isAnnotationsListOpened}\n isAppSettingsDialogOpened={isAppSettingsDialogOpened}\n isMultiRig={isMultiRig}\n isSettingsDialogHidden={isSettingsDialogHidden}\n layoutEnvironment={layoutEnvironment}\n onAppRemove={onAppRemove}\n onCloneDashboard={onCloneDashboard}\n onSettingsChange={onSettingsChange}\n openIntercom={openIntercom}\n toggleAnnotationsList={toggleAnnotationsList}\n toggleAppSettingsDialog={toggleAppSettingsDialog}\n />\n {isMaximized && !isAppHeadersV3Enabled && (\n <RestoreAppSizeButton setIsMaximized={setIsMaximized} />\n )}\n\n {!isActionsDisabled && (!isAppHeadersV3Enabled || isLoading) && (\n <LegacyAppActions\n app={app}\n currentUser={currentUser}\n devCenterRouter={devCenterRouter}\n isAnnotationsSupported={isAnnotationsSupported}\n isCLIApp={isCLIApp}\n isCommentsEnabled={isCommentsEnabled}\n isInsideNewMobileApp={isInsideNewMobileApp}\n isMaximized={isMaximized}\n isMobileView={isMobileView}\n mainMenuItems={mainMenuItems}\n secondaryMenuItems={secondaryMenuItems}\n onHelpCenterClick={onHelpCenterClick}\n onReportBugClick={onReportBugClick}\n setIsFullscreenModalMode={setIsFullscreenModalMode}\n setIsMaximized={setIsMaximized}\n toggleAnnotationsList={toggleAnnotationsList}\n toggleAppSettingsDialog={toggleAppSettingsDialog}\n />\n )}\n </article>\n </CommentsSwitchProvider>\n </AppCommonsProvider>\n </DcFullscreenElemsCoordinatorProvider>\n </DevCenterRouterContext.Provider>\n );\n};\n\nexport default DevCenterAppContainer;\n"],"names":["_ref","_ref2","_app$package","_app$package$manifest","_application$ui","_devCenterRouter$loca","_application$ui2","_router$location$path","CLIAppComponent","CLIAppSettings","app","appId","className","coordinates","currentDashboardAppsLastAnnotations","currentUser","devCenterRouter","disableAppAssetSelection","isActionsDisabled","isBrowserFullscreen","enterBrowserFullscreen","exitBrowserFullscreen","isSeparateWindow","openSeparateWindow","closeSeparateWindow","setSeparateWindowTitle","_ref$isNonIsolatedApp","isNonIsolatedApp","isSettingsDialogHidden","layoutEnvironment","_ref$onAppContainerCl","onAppContainerClick","noop","onAppRemove","onReportBugClick","onCloneDashboard","onHelpCenterClick","onIsMaximizedChange","_ref$onSettingChange","onSettingChange","_ref$onSettingsChange","onSettingsChange","_ref$openIntercom","openIntercom","registerAITools","_ref$setIsFullscreenM","setIsFullscreenModalMode","timestamp","updateCurrentDashboardAppLastAnnotation","dashboardMeta","reloadApp","chatActions","appsData","useContext","AppContext","theme","useTheme","isMobileView","isNativeDetected","isMobileDetected","useState","_useState2","_slicedToArray","_useState","mainMenuItems","setMainMenuItems","_useState4","_useState3","secondaryMenuItems","setSecondaryMenuItems","appDataKey","id","appData","undefined","isLoading","application","package","manifest","segment","getAppSegment","isChiplessDashboard","isMultiRig","isDCAppMultiRig","uiSettings","ui","isCommentsEnabled","enable_comments","appName","getAppName","_useAppMaximized","useAppMaximized","isMaximized","setIsMaximized","appTimestamp","getTimestampFromQuery","location","query","isCLIApp","DEV_CENTER_CLI_APP_ID","updatedCoordinates","useMemo","_objectSpread","w","MOBILE_CLI_APP_GRID_WIDTH","version","getAppVersion","_useDevCenterApp","useDevCenterApp","isAppLoading","AppSettings","AppComponent","_useAppSettings","useAppSettings","isAppSettingsDialogOpened","toggleAppSettingsDialog","_useAnnotationsList","useAnnotationsList","isAnnotationsListOpened","toggleAnnotationsList","_useAnnotationsData","useAnnotationsData","appLastAnnotation","assetCompanyId","assetIdForAnnotation","isAnnotationsSupported","isAppSupportsAnnotations","filteredAppData","pickBy","pick","APP_DATA_ASSET_KEYS","Boolean","simplifiedSecondaryMenuItems","map","item","onClick","_item$onClick","call","to","push","isAppHeadersV3Enabled","use_app_header_v3","isInsideHomePage","pathname","startsWith","HOME_PATH_PREFIX","appProps","useDevCenterAppProps","_jsx","jsx","DevCenterRouterContext","Provider","value","children","DcFullscreenElemsCoordinatorProvider","AppCommonsProvider","maximized","setMaximized","appSettings","settings","appHeadersV3Enabled","appSettingsComponent","isInsideNewMobileApp","globalOffsetWells","globalOffsetWellsVersion","globalOffsetWellsToken","CommentsSwitchProvider","_jsxs","jsxs","classNames","isLightTheme","styles","container","PAGE_NAME","ToastContainer","containerContent","DevCenterAppView","availability","getAppAvailability","company","with_subscription","appHash","DevCenterAppDialogs","RestoreAppSizeButton","LegacyAppActions"],"mappings":"q5gBAqH8D,SAsCxDA,GAAA,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAzCqCC,EAIzCC,IAAAA,gBACAC,IAAAA,eACAC,IAAAA,IACAC,IAAAA,MACAC,IAAAA,UACAC,IAAAA,YACAC,IAAAA,oCACAC,IAAAA,YACAC,IAAAA,gBACAC,IAAAA,yBACAC,IAAAA,kBACAC,IAAAA,oBACAC,IAAAA,uBACAC,IAAAA,sBACAC,IAAAA,iBACAC,IAAAA,mBACAC,IAAAA,oBACAC,KAAAA,uBAAsBC,GAAA1B,EACtB2B,iBAAAA,gBAAwBD,GACxBE,KAAAA,uBACAC,KAAAA,kBAAiBC,GAAA9B,EACjB+B,oBAAAA,eAAsBC,EAAIA,KAAAF,GAC1BG,KAAAA,YACAC,KAAAA,iBACAC,KAAAA,iBACAC,KAAAA,kBACAC,KAAAA,oBAAmBC,GAAAtC,EACnBuC,gBAAAA,eAAkBP,EAAIA,KAAAM,GAAAE,GAAAxC,EACtByC,iBAAAA,eAAmBT,EAAIA,KAAAQ,GAAAE,GAAA1C,EACvB2C,aAAAA,eAAeX,EAAIA,KAAA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ACnBF,iBAAkBA,GAClBY,yBAA0BA,GAC1B8C,eAAgBA,GAChB0B,sBAAuBA,GACvBJ,wBAAyBA,gBAS3C"}
|
|
1
|
+
{"version":3,"file":"DevCenterAppContainer.js","sources":["../../../../../src/components/DevCenter/DevCenterAppContainer/DevCenterAppContainer.tsx"],"sourcesContent":["import { useContext, useMemo, useState } from 'react';\nimport type { ComponentType, FC } from 'react';\nimport classNames from 'classnames';\nimport { noop, pick, pickBy } from 'lodash';\nimport { useTheme } from '@material-ui/core';\n\nimport AppContext from '../AppContext';\nimport { DevCenterRouterContext } from '../DevCenterRouterContext';\n\nimport {\n useAnnotationsData,\n useAnnotationsList,\n useAppMaximized,\n useAppSettings,\n useDevCenterAppProps,\n} from './effects';\nimport { DcFullscreenElemsCoordinatorProvider } from './components/DcFullscreenElemsCoordinatorProvider';\nimport { DevCenterAppDialogs } from './components/DevCenterAppDialogs';\nimport DevCenterAppView from './components/DevCenterAppView';\nimport { LegacyAppActions } from './components/LegacyAppActions';\nimport RestoreAppSizeButton from './components/RestoreAppSizeButton';\nimport { getAppAvailability, getAppVersion } from './utils';\nimport {\n APP_DATA_ASSET_KEYS,\n HOME_PATH_PREFIX,\n MOBILE_CLI_APP_GRID_WIDTH,\n PAGE_NAME,\n} from './constants';\nimport type {\n AppCoordinates,\n AppDataEntry,\n ChatActions,\n DashboardAppLastAnnotation,\n DevCenterAppResource,\n DevCenterCurrentUser,\n DevCenterMenuItem,\n DevCenterRouter,\n LayoutEnvironment,\n RegisterAITools,\n SetIsFullscreenModalMode,\n UpdateDashboardAppLastAnnotation,\n} from './types';\nimport type { FullscreenModes } from '../../../types';\n// Relative on purpose: a `~/` alias does not resolve from the published `.d.ts`.\nimport type { GlobalOffsetWell } from '../../../componentsV2/AppCommonsProvider/AppCommonsContext';\nimport { CommentsSwitchProvider } from './components/CommentsSwitch';\n\nimport styles from './DevCenterAppContainer.scss';\n\nimport { isInsideNewMobileApp, isMobileDetected, isNativeDetected } from '~/utils/mobileDetect';\nimport { ToastContainer } from '~/components/Toaster';\nimport { useDevCenterApp } from '~/effects';\nimport { DEV_CENTER_CLI_APP_ID } from '~/constants';\nimport {\n getAppName,\n getAppSegment,\n getTimestampFromQuery,\n isDCAppMultiRig,\n} from '~/utils/devcenter';\nimport { AppCommonsProvider } from '~/componentsV2/AppCommonsProvider';\n\n/**\n * `Partial<FullscreenModes>` carries the seven browser-fullscreen and separate-window members.\n * `AppCommonsProvider` derives `isExpanded` from them and republishes them to the app bundle,\n * so dropping them silently disables both features — and nothing type-checks it, because every\n * member is optional on the provider.\n */\nexport type DevCenterAppContainerProps = Partial<FullscreenModes> & {\n app: DevCenterAppResource;\n currentUser: DevCenterCurrentUser;\n /** Platform router. Not React Router — the DC shell supplies its own. */\n devCenterRouter: DevCenterRouter;\n\n /**\n * Slots for the CLI app bundle's own components. `any` rather than a narrower prop type on\n * purpose: this accepts arbitrary app components, and any narrowing would reject the concretely\n * typed ones consumers pass.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- see the note above\n CLIAppComponent?: ComponentType<any> | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- see the note above\n CLIAppSettings?: ComponentType<any> | null;\n /** Defaults to `app.id` when omitted. */\n appId?: number;\n className?: string | null;\n chatActions?: ChatActions | null;\n coordinates?: AppCoordinates | null;\n currentDashboardAppsLastAnnotations?: DashboardAppLastAnnotation[] | null;\n dashboardMeta?: {\n isMultiAsset?: boolean;\n isMultiWell?: boolean;\n isChiplessDashboard?: boolean;\n globalOffsetWells?: GlobalOffsetWell[];\n globalOffsetWellsVersion?: number;\n globalOffsetWellsToken?: number;\n };\n disableAppAssetSelection?: boolean;\n isActionsDisabled?: boolean;\n /**\n * [REACT-18-MIGRATION-TAG] PLT-3099: the platform's isolation decision, passed only by the\n * in-process branch of DevCenterIsolatedApp; iframe mounts leave it false.\n */\n isNonIsolatedApp?: boolean;\n isSettingsDialogHidden?: boolean;\n layoutEnvironment?: LayoutEnvironment | null;\n onAppContainerClick?: () => void;\n onAppRemove?: () => void;\n onCloneDashboard?: () => void;\n onHelpCenterClick?: () => void;\n onIsMaximizedChange?: (isMaximized: boolean) => void;\n onReportBugClick?: (() => void) | null;\n onSettingChange?: (key: string, value: unknown) => void;\n onSettingsChange?: (value: unknown) => void;\n openIntercom?: () => void;\n registerAITools?: RegisterAITools;\n reloadApp?: () => void;\n setIsFullscreenModalMode?: SetIsFullscreenModalMode;\n timestamp?: number | null;\n updateCurrentDashboardAppLastAnnotation?: UpdateDashboardAppLastAnnotation;\n};\n\nconst isHomePage = (router: DevCenterRouter) =>\n !!router.location.pathname?.startsWith(HOME_PATH_PREFIX);\n\nconst DevCenterAppContainer: FC<DevCenterAppContainerProps> = ({\n CLIAppComponent,\n CLIAppSettings,\n app,\n appId,\n className,\n coordinates,\n currentDashboardAppsLastAnnotations,\n currentUser,\n devCenterRouter,\n disableAppAssetSelection,\n isActionsDisabled,\n isBrowserFullscreen,\n enterBrowserFullscreen,\n exitBrowserFullscreen,\n isSeparateWindow,\n openSeparateWindow,\n closeSeparateWindow,\n setSeparateWindowTitle,\n isNonIsolatedApp = false,\n isSettingsDialogHidden,\n layoutEnvironment,\n onAppContainerClick = noop,\n onAppRemove,\n onReportBugClick,\n onCloneDashboard,\n onHelpCenterClick,\n onIsMaximizedChange,\n onSettingChange = noop,\n onSettingsChange = noop,\n openIntercom = noop,\n registerAITools,\n setIsFullscreenModalMode = noop,\n timestamp,\n updateCurrentDashboardAppLastAnnotation,\n dashboardMeta,\n reloadApp,\n chatActions,\n}) => {\n // `AppContext` is still JavaScript and calls `createContext()` with no argument, so it hands\n // back `undefined`. Declared here rather than asserted; the real fix is a type argument on the\n // context itself, which belongs to `DevCenter/AppContext`.\n const appsData: Record<string, AppDataEntry> | undefined = useContext(AppContext);\n const theme = useTheme();\n const isMobileView = isNativeDetected || isMobileDetected;\n const [mainMenuItems, setMainMenuItems] = useState<DevCenterMenuItem[]>([]);\n const [secondaryMenuItems, setSecondaryMenuItems] = useState<DevCenterMenuItem[]>([]);\n // `||`, not `??`: DevCenterEmbeddedApp uses 0 as its unset sentinel for appId.\n const appDataKey = appId || app.id;\n const appData: AppDataEntry = (appDataKey ? appsData?.[appDataKey] : undefined) ?? {\n isLoading: true,\n };\n const application = app.package?.manifest?.application;\n const segment = getAppSegment(app);\n const isChiplessDashboard = !!dashboardMeta?.isChiplessDashboard;\n const isMultiRig = isDCAppMultiRig({\n uiSettings: application?.ui,\n isChiplessDashboard,\n });\n const isCommentsEnabled = !!application?.ui?.enable_comments;\n const appName = getAppName(app);\n const { isMaximized, setIsMaximized } = useAppMaximized({\n onIsMaximizedChange,\n devCenterRouter,\n appId,\n });\n\n // Isolated apps are mounted without the router query the timestamp normally comes from,\n // so the host passes it as a prop instead.\n const appTimestamp = timestamp || getTimestampFromQuery(devCenterRouter.location.query?.query);\n const isCLIApp = app.id === DEV_CENTER_CLI_APP_ID;\n // Memoised because the CLI-on-mobile branch builds a new object: unmemoised it would be a fresh\n // reference on every render and would keep `useDevCenterAppProps` from ever holding its memo.\n const updatedCoordinates = useMemo(\n () =>\n isCLIApp && isMobileView ? { ...coordinates, w: MOBILE_CLI_APP_GRID_WIDTH } : coordinates,\n [isCLIApp, isMobileView, coordinates]\n );\n const version = getAppVersion(app);\n\n const {\n isLoading: isAppLoading,\n AppSettings,\n AppComponent,\n } = useDevCenterApp({\n CLIAppComponent,\n CLIAppSettings,\n app,\n version,\n });\n\n const { isAppSettingsDialogOpened, toggleAppSettingsDialog } = useAppSettings({\n setIsFullscreenModalMode,\n });\n const { isAnnotationsListOpened, toggleAnnotationsList } = useAnnotationsList();\n\n const isLoading = !!(isAppLoading || !currentUser || (!isMultiRig && appData.isLoading));\n\n const {\n appLastAnnotation,\n assetCompanyId,\n assetIdForAnnotation,\n isAppSupportsAnnotations: isAnnotationsSupported,\n } = useAnnotationsData({\n app,\n appData,\n currentDashboardAppsLastAnnotations,\n });\n\n const filteredAppData = useMemo(\n () => pickBy(pick(appData, APP_DATA_ASSET_KEYS), Boolean),\n [appData]\n );\n\n const simplifiedSecondaryMenuItems = useMemo(\n () =>\n secondaryMenuItems.map(item => ({\n ...item,\n onClick: () => {\n item.onClick?.();\n if (item.to) {\n devCenterRouter.push(item.to);\n }\n },\n })),\n [secondaryMenuItems, devCenterRouter]\n );\n\n const isAppHeadersV3Enabled = !!application?.ui?.use_app_header_v3;\n const isInsideHomePage = isHomePage(devCenterRouter);\n\n const appProps = useDevCenterAppProps({\n app,\n appLastAnnotation,\n appTimestamp,\n chatActions,\n coordinates: updatedCoordinates,\n currentUser,\n devCenterRouter,\n filteredAppData,\n isMaximized,\n layoutEnvironment,\n onSettingChange,\n onSettingsChange,\n registerAITools,\n segment,\n setIsFullscreenModalMode,\n setIsMaximized,\n setMainMenuItems,\n setSecondaryMenuItems,\n toggleAnnotationsList,\n toggleAppSettingsDialog,\n updateCurrentDashboardAppLastAnnotation,\n });\n\n // Called without the native event: this crosses an iframe boundary, where a DOM event\n // cannot be serialised.\n const handleAppContainerClick = () => onAppContainerClick();\n\n // ⚠️⚠️⚠️ When adding/changing providers, also add them to/change /src/testing/AppTestWrapper\n return (\n <DevCenterRouterContext.Provider value={devCenterRouter}>\n <DcFullscreenElemsCoordinatorProvider setIsFullscreenModalMode={setIsFullscreenModalMode}>\n <AppCommonsProvider\n maximized={isMaximized}\n setMaximized={setIsMaximized}\n appId={app.app.id}\n app={app}\n appSettings={app.settings}\n onSettingChange={onSettingChange}\n onSettingsChange={onSettingsChange}\n appHeadersV3Enabled={isAppHeadersV3Enabled}\n isBrowserFullscreen={isBrowserFullscreen}\n enterBrowserFullscreen={enterBrowserFullscreen}\n exitBrowserFullscreen={exitBrowserFullscreen}\n isSeparateWindow={isSeparateWindow}\n openSeparateWindow={openSeparateWindow}\n closeSeparateWindow={closeSeparateWindow}\n setSeparateWindowTitle={setSeparateWindowTitle}\n isNonIsolatedApp={isNonIsolatedApp}\n disableAppAssetSelection={disableAppAssetSelection}\n isMultiRig={isMultiRig}\n currentUser={currentUser}\n appData={appData}\n layoutEnvironment={layoutEnvironment}\n appSettingsComponent={AppSettings}\n dashboardMeta={dashboardMeta}\n toggleAnnotationsList={isAnnotationsSupported ? toggleAnnotationsList : undefined}\n onHelpCenterClick={onHelpCenterClick}\n secondaryMenuItems={simplifiedSecondaryMenuItems}\n onAppRemove={onAppRemove}\n isInsideNewMobileApp={isInsideNewMobileApp}\n globalOffsetWells={dashboardMeta?.globalOffsetWells}\n globalOffsetWellsVersion={dashboardMeta?.globalOffsetWellsVersion}\n globalOffsetWellsToken={dashboardMeta?.globalOffsetWellsToken}\n reloadApp={reloadApp}\n {...filteredAppData}\n >\n <CommentsSwitchProvider>\n <article\n className={classNames(\n 'dc-app-container',\n isInsideNewMobileApp && 'dc-app-container--inside-new-mobile-app',\n isInsideHomePage && 'dc-app-container--inside-home-page',\n className,\n // This class is applied so that DC apps developers can style their content\n // when an app is in fullscreen\n isMaximized && 'dc-app-container__maximized',\n theme.isLightTheme && 'dc-app-container__light-theme',\n styles.container\n )}\n data-testid={`${PAGE_NAME}_${appName}`}\n onClick={handleAppContainerClick}\n >\n <ToastContainer />\n <div className={styles.containerContent}>\n <DevCenterAppView\n // DC apps keep per-asset state in mount-time hooks, so a new asset means a\n // new mount. React 18 batching collapses away the `isLoading` frame this used\n // to rely on whenever AppsDataProvider serves the asset from its cache.\n key={appData.appHash}\n AppComponent={AppComponent}\n app={app}\n appData={filteredAppData}\n availability={getAppAvailability(\n app.availability,\n currentUser.company.with_subscription\n )}\n isCLIApp={isCLIApp}\n isLoading={isLoading}\n isMultiRig={isMultiRig}\n layoutEnvironment={layoutEnvironment ?? null}\n openIntercom={openIntercom}\n segment={segment}\n toggleAppSettingsDialog={toggleAppSettingsDialog}\n appProps={appProps}\n />\n </div>\n <DevCenterAppDialogs\n app={app}\n appData={appData}\n appName={appName}\n appSettingsComponent={AppSettings}\n assetCompanyId={assetCompanyId}\n assetIdForAnnotation={assetIdForAnnotation}\n currentUser={currentUser}\n disableAppAssetSelection={disableAppAssetSelection}\n isAnnotationsListOpened={isAnnotationsListOpened}\n isAppSettingsDialogOpened={isAppSettingsDialogOpened}\n isMultiRig={isMultiRig}\n isSettingsDialogHidden={isSettingsDialogHidden}\n layoutEnvironment={layoutEnvironment}\n onAppRemove={onAppRemove}\n onCloneDashboard={onCloneDashboard}\n onSettingsChange={onSettingsChange}\n openIntercom={openIntercom}\n toggleAnnotationsList={toggleAnnotationsList}\n toggleAppSettingsDialog={toggleAppSettingsDialog}\n />\n {isMaximized && !isAppHeadersV3Enabled && (\n <RestoreAppSizeButton setIsMaximized={setIsMaximized} />\n )}\n\n {!isActionsDisabled && (!isAppHeadersV3Enabled || isLoading) && (\n <LegacyAppActions\n app={app}\n currentUser={currentUser}\n devCenterRouter={devCenterRouter}\n isAnnotationsSupported={isAnnotationsSupported}\n isCLIApp={isCLIApp}\n isCommentsEnabled={isCommentsEnabled}\n isInsideNewMobileApp={isInsideNewMobileApp}\n isMaximized={isMaximized}\n isMobileView={isMobileView}\n mainMenuItems={mainMenuItems}\n secondaryMenuItems={secondaryMenuItems}\n onHelpCenterClick={onHelpCenterClick}\n onReportBugClick={onReportBugClick}\n setIsFullscreenModalMode={setIsFullscreenModalMode}\n setIsMaximized={setIsMaximized}\n toggleAnnotationsList={toggleAnnotationsList}\n toggleAppSettingsDialog={toggleAppSettingsDialog}\n />\n )}\n </article>\n </CommentsSwitchProvider>\n </AppCommonsProvider>\n </DcFullscreenElemsCoordinatorProvider>\n </DevCenterRouterContext.Provider>\n );\n};\n\nexport default DevCenterAppContainer;\n"],"names":["_ref","_ref2","_app$package","_app$package$manifest","_application$ui","_devCenterRouter$loca","_application$ui2","_router$location$path","CLIAppComponent","CLIAppSettings","app","appId","className","coordinates","currentDashboardAppsLastAnnotations","currentUser","devCenterRouter","disableAppAssetSelection","isActionsDisabled","isBrowserFullscreen","enterBrowserFullscreen","exitBrowserFullscreen","isSeparateWindow","openSeparateWindow","closeSeparateWindow","setSeparateWindowTitle","_ref$isNonIsolatedApp","isNonIsolatedApp","isSettingsDialogHidden","layoutEnvironment","_ref$onAppContainerCl","onAppContainerClick","noop","onAppRemove","onReportBugClick","onCloneDashboard","onHelpCenterClick","onIsMaximizedChange","_ref$onSettingChange","onSettingChange","_ref$onSettingsChange","onSettingsChange","_ref$openIntercom","openIntercom","registerAITools","_ref$setIsFullscreenM","setIsFullscreenModalMode","timestamp","updateCurrentDashboardAppLastAnnotation","dashboardMeta","reloadApp","chatActions","appsData","useContext","AppContext","theme","useTheme","isMobileView","isNativeDetected","isMobileDetected","useState","_useState2","_slicedToArray","_useState","mainMenuItems","setMainMenuItems","_useState4","_useState3","secondaryMenuItems","setSecondaryMenuItems","appDataKey","id","appData","undefined","isLoading","application","package","manifest","segment","getAppSegment","isChiplessDashboard","isMultiRig","isDCAppMultiRig","uiSettings","ui","isCommentsEnabled","enable_comments","appName","getAppName","_useAppMaximized","useAppMaximized","isMaximized","setIsMaximized","appTimestamp","getTimestampFromQuery","location","query","isCLIApp","DEV_CENTER_CLI_APP_ID","updatedCoordinates","useMemo","_objectSpread","w","MOBILE_CLI_APP_GRID_WIDTH","version","getAppVersion","_useDevCenterApp","useDevCenterApp","isAppLoading","AppSettings","AppComponent","_useAppSettings","useAppSettings","isAppSettingsDialogOpened","toggleAppSettingsDialog","_useAnnotationsList","useAnnotationsList","isAnnotationsListOpened","toggleAnnotationsList","_useAnnotationsData","useAnnotationsData","appLastAnnotation","assetCompanyId","assetIdForAnnotation","isAnnotationsSupported","isAppSupportsAnnotations","filteredAppData","pickBy","pick","APP_DATA_ASSET_KEYS","Boolean","simplifiedSecondaryMenuItems","map","item","onClick","_item$onClick","call","to","push","isAppHeadersV3Enabled","use_app_header_v3","isInsideHomePage","pathname","startsWith","HOME_PATH_PREFIX","appProps","useDevCenterAppProps","_jsx","jsx","DevCenterRouterContext","Provider","value","children","DcFullscreenElemsCoordinatorProvider","AppCommonsProvider","maximized","setMaximized","appSettings","settings","appHeadersV3Enabled","appSettingsComponent","isInsideNewMobileApp","globalOffsetWells","globalOffsetWellsVersion","globalOffsetWellsToken","CommentsSwitchProvider","_jsxs","jsxs","classNames","isLightTheme","styles","container","PAGE_NAME","ToastContainer","containerContent","DevCenterAppView","availability","getAppAvailability","company","with_subscription","appHash","DevCenterAppDialogs","RestoreAppSizeButton","LegacyAppActions"],"mappings":"q5gBA4H8D,SAsCxDA,GAAA,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAzCqCC,EAIzCC,IAAAA,gBACAC,IAAAA,eACAC,IAAAA,IACAC,IAAAA,MACAC,IAAAA,UACAC,IAAAA,YACAC,IAAAA,oCACAC,IAAAA,YACAC,IAAAA,gBACAC,IAAAA,yBACAC,IAAAA,kBACAC,IAAAA,oBACAC,IAAAA,uBACAC,IAAAA,sBACAC,IAAAA,iBACAC,IAAAA,mBACAC,IAAAA,oBACAC,KAAAA,uBAAsBC,GAAA1B,EACtB2B,iBAAAA,gBAAwBD,GACxBE,KAAAA,uBACAC,KAAAA,kBAAiBC,GAAA9B,EACjB+B,oBAAAA,eAAsBC,EAAIA,KAAAF,GAC1BG,KAAAA,YACAC,KAAAA,iBACAC,KAAAA,iBACAC,KAAAA,kBACAC,KAAAA,oBAAmBC,GAAAtC,EACnBuC,gBAAAA,eAAkBP,EAAIA,KAAAM,GAAAE,GAAAxC,EACtByC,iBAAAA,eAAmBT,EAAIA,KAAAQ,GAAAE,GAAA1C,EACvB2C,aAAAA,eAAeX,EAAIA,KAAAU,GACnBE,KAAAA,gBAAeC,GAAA7C,EACf8C,yBAAAA,eAA2Bd,EAAIA,KAAAa,GAC/BE,KAAAA,UACAC,KAAAA,wCACAC,KAAAA,cACAC,KAAAA,UACAC,KAAAA,YAKMC,GAAqDC,aAAWC,GAChEC,GAAQC,EAAAA,WACRC,GAAeC,EAAgBA,kBAAIC,mBACCC,GAAAA,EAAQA,SAAsB,IAAGC,GAAAC,EAAAA,QAAAC,GAAA,GAApEC,GAAaH,GAAA,GAAEI,GAAgBJ,GAAA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cA,GACdpG,IAAKA,EACL8D,QAASsD,GACTkD,aAAcC,EAAkBA,mBAC9BvK,EAAIsK,aACJjK,EAAYmK,QAAQC,mBAEtBlF,SAAUA,GACVvB,UAAWA,GACXO,WAAYA,GACZpD,kBAAmBA,SAAAA,GAAqB,KACxCc,aAAcA,GACdmC,QAASA,GACToC,wBAAyBA,GACzB+B,SAAUA,IAfLzE,GAAQ4G,WAkBjBjC,MAACkC,sBAAmB,CAClB3K,IAAKA,EACL8D,QAASA,GACTe,QAASA,GACTyE,qBAAsBnD,GACtBa,eAAgBA,GAChBC,qBAAsBA,GACtB5G,YAAaA,EACbE,yBAA0BA,EAC1BoG,wBAAyBA,GACzBJ,0BAA2BA,GAC3BhC,WAAYA,GACZrD,uBAAwBA,GACxBC,kBAAmBA,GACnBI,YAAaA,GACbE,iBAAkBA,GAClBM,iBAAkBA,GAClBE,aAAcA,GACd2E,sBAAuBA,GACvBJ,wBAAyBA,KAE1BvB,KAAgBgD,IACfQ,EAAAA,IAACmC,EAAoB,CAAC1F,eAAgBA,MAGtC1E,KAAuByH,IAAyBjE,KAChDyE,EAAAC,IAACmC,mBAAgB,CACf7K,IAAKA,EACLK,YAAaA,EACbC,gBAAiBA,EACjB4G,uBAAwBA,GACxB3B,SAAUA,GACVZ,kBAAmBA,GACnB4E,qBAAsBA,EAAqBA,qBAC3CtE,YAAaA,GACblC,aAAcA,GACdO,cAAeA,GACfI,mBAAoBA,GACpBhC,kBAAmBA,GACnBF,iBAAkBA,GAClBY,yBAA0BA,GAC1B8C,eAAgBA,GAChB0B,sBAAuBA,GACvBJ,wBAAyBA,gBAS3C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";require('./../../ext-esm/style-inject/dist/style-inject.es.js')(".FeedCard_root__3hrMo{
|
|
1
|
+
"use strict";require('./../../ext-esm/style-inject/dist/style-inject.es.js')(".FeedCard_root__3hrMo{backdrop-filter:blur(2px);background:rgb(from var(--palette-background-b-6) r g b/.9);border-radius:16px;display:flex;flex-direction:column;overflow:hidden}"),module.exports={spacing:"8",root:"FeedCard_root__3hrMo"};
|
|
2
2
|
//# sourceMappingURL=FeedCard.scss.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppCommonsContext.js","sources":["../../../../src/componentsV2/AppCommonsProvider/AppCommonsContext.ts"],"sourcesContent":["import { ComponentType, createContext, ReactNode, useContext } from 'react';\n\nimport {\n App,\n AppSettings,\n Asset,\n FracFleet,\n FullscreenModes,\n InterventionUnit,\n User,\n Well,\n} from '../../types';\n\nexport type GlobalOffsetWell = {\n id: number;\n [key: string]: unknown;\n};\n\n
|
|
1
|
+
{"version":3,"file":"AppCommonsContext.js","sources":["../../../../src/componentsV2/AppCommonsProvider/AppCommonsContext.ts"],"sourcesContent":["import { ComponentType, createContext, ReactNode, useContext } from 'react';\n\nimport {\n App,\n AppSettings,\n Asset,\n FracFleet,\n FullscreenModes,\n InterventionUnit,\n User,\n Well,\n} from '../../types';\n\nexport type GlobalOffsetWell = {\n id: number;\n [key: string]: unknown;\n};\n\n// ⚠️⚠️⚠️ Mentioned in storybook, please update when editing this type\n// Used in AppTestWrapper\nexport type AppCommonsContextType = {\n maximized: boolean;\n appId: number;\n app: App;\n appKey: string;\n appName: string;\n appSettings?: AppSettings;\n onSettingChange: (key: string, value: unknown) => void;\n onSettingsChange: (value: unknown) => void;\n\n well?: Well;\n rig?: Asset;\n fracFleet?: FracFleet;\n interventionUnit?: InterventionUnit;\n wells?: Well[];\n\n // Passed down from corva-web-frontend. May not exist, so everything must be optional\n dashboardMeta?: {\n isMultiAsset?: boolean;\n isMultiWell?: boolean;\n isChiplessDashboard?: boolean;\n globalOffsetWellsToken?: number;\n };\n appHeadersV3Enabled?: boolean;\n // [REACT-18-MIGRATION-TAG] PLT-3099: true when the app renders in-process on the host\n // (the platform isolation decision from DevCenterIsolatedApp); iframe realms leave it unset.\n isNonIsolatedApp?: boolean;\n disableAppAssetSelection?: boolean;\n isMultiRig?: boolean;\n currentUser?: User;\n globalOffsetWells?: GlobalOffsetWell[];\n globalOffsetWellsVersion?: number;\n globalOffsetWellsToken?: number;\n removeApp?: () => void;\n};\n\nexport type AppCommonsContextTypeInternal = AppCommonsContextType &\n Partial<FullscreenModes> & {\n /** True in any of the three modes: dashboard maximize, browser fullscreen, separate window */\n isExpanded?: boolean;\n setMaximized: (maximized: boolean) => void;\n appData?: unknown;\n layoutEnvironment?: ({ type?: string } & Record<string, unknown>) | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n appSettingsComponent?: ComponentType<any>;\n toggleAnnotationsList?: () => void;\n onHelpCenterClick?: () => void;\n secondaryMenuItems?: { title: ReactNode; onClick?: () => void; icon?: ReactNode }[];\n isInsideNewMobileApp?: boolean;\n reloadApp?: () => void;\n };\n\nexport const AppCommonsContext = createContext<AppCommonsContextTypeInternal>(\n // TODO provide defaults\n null as unknown as AppCommonsContextTypeInternal\n);\n\nexport const useAppCommonsInternal = () => useContext(AppCommonsContext);\n\nexport const useAppCommons = () => useContext(AppCommonsContext) as AppCommonsContextType;\n"],"names":["AppCommonsContext","createContext","useContext"],"mappings":"2FAwEaA,EAAoBC,EAAaA,cAE5C,wDAK2B,WAAH,OAASC,EAAAA,WAAWF,EAAkB,gCAF3B,WAAH,OAASE,EAAAA,WAAWF,EAAkB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ActionsTestIds=void 0,(e=exports.ActionsTestIds||(exports.ActionsTestIds={})).
|
|
1
|
+
"use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),exports.ActionsTestIds=void 0,(e=exports.ActionsTestIds||(exports.ActionsTestIds={})).CollapseButtonTestId="CorvaUI.AppHeader.Actions.CollapseButtonTestId",e.ExpandButtonTestId="CorvaUI.AppHeader.Actions.ExpandButtonTestId",e.AdditionalActionItemTestId="CorvaUI.AppHeader.Actions.AdditionalActionItemTestId",e.CloseCommentButtonTestId="CorvaUI.AppHeader.Actions.CloseCommentButtonTestId",e.AddMessageButtonTestId="CorvaUI.AppHeader.Actions.AddMessageButtonTestId",e.MaximizeItemTestId="CorvaUI.AppHeader.Actions.MaximizeItemTestId",e.BrowserFullscreenItemTestId="CorvaUI.AppHeader.Actions.BrowserFullscreenItemTestId",e.SeparateWindowItemTestId="CorvaUI.AppHeader.Actions.SeparateWindowItemTestId";
|
|
2
2
|
//# sourceMappingURL=Actions.constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Actions.constants.js","sources":["../../../../../../src/componentsV2/AppHeader/V3/Actions/Actions.constants.ts"],"sourcesContent":["export enum ActionsTestIds {\n
|
|
1
|
+
{"version":3,"file":"Actions.constants.js","sources":["../../../../../../src/componentsV2/AppHeader/V3/Actions/Actions.constants.ts"],"sourcesContent":["export enum ActionsTestIds {\n CollapseButtonTestId = 'CorvaUI.AppHeader.Actions.CollapseButtonTestId',\n ExpandButtonTestId = 'CorvaUI.AppHeader.Actions.ExpandButtonTestId',\n AdditionalActionItemTestId = 'CorvaUI.AppHeader.Actions.AdditionalActionItemTestId',\n CloseCommentButtonTestId = 'CorvaUI.AppHeader.Actions.CloseCommentButtonTestId',\n AddMessageButtonTestId = 'CorvaUI.AppHeader.Actions.AddMessageButtonTestId',\n MaximizeItemTestId = 'CorvaUI.AppHeader.Actions.MaximizeItemTestId',\n BrowserFullscreenItemTestId = 'CorvaUI.AppHeader.Actions.BrowserFullscreenItemTestId',\n SeparateWindowItemTestId = 'CorvaUI.AppHeader.Actions.SeparateWindowItemTestId',\n}\n"],"names":["ActionsTestIds"],"mappings":"aASC,IATWA,yDAAAA,QAAcA,oBAAA,GAAdA,EAAAA,QAAcA,iBAAdA,uBAAc,CAAA,IAAA,qBAAA,iDAAdA,EAAc,mBAAA,+CAAdA,EAAc,2BAAA,uDAAdA,EAAc,yBAAA,qDAAdA,EAAc,uBAAA,mDAAdA,EAAc,mBAAA,+CAAdA,EAAc,4BAAA,wDAAdA,EAAc,yBAAA"}
|