@corva/ui 3.79.0-8 → 3.79.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs-bundle/components/CommentCard/CommentCard.js +1 -1
- package/cjs-bundle/components/CommentCard/CommentCard.js.map +1 -1
- package/cjs-bundle/components/CommentCard/CommentCard.scss.js +1 -1
- package/cjs-bundle/components/CurveTooltip/CurveTooltip.js +2 -0
- package/cjs-bundle/components/CurveTooltip/CurveTooltip.js.map +1 -0
- package/cjs-bundle/components/CurveTooltip/CurveTooltip.scss.js +2 -0
- package/cjs-bundle/components/CurveTooltip/CurveTooltip.scss.js.map +1 -0
- package/cjs-bundle/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.js +1 -1
- package/cjs-bundle/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.js.map +1 -1
- package/cjs-bundle/components/NewCommentCursor/NewCommentCursor.js +1 -1
- package/cjs-bundle/components/NewCommentCursor/NewCommentCursor.js.map +1 -1
- package/cjs-bundle/componentsV2/ColorPicker/Swatches/Swatches.js +1 -1
- package/cjs-bundle/componentsV2/ColorPicker/Swatches/Swatches.js.map +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/AssetFilters/AssetFilters.js +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/AssetFilters/AssetFilters.js.map +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/AssetSearchInput/AssetSearchInput.js +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/AssetSearchInput/AssetSearchInput.js.map +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/CompletionsOffsetWellPicker.js +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/CompletionsOffsetWellPicker.js.map +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/Map/Map.js +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/Map/Map.js.map +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/ModalTitle/ModalTitle.js +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/ModalTitle/ModalTitle.js.map +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadTableRow.js +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadTableRow.js.map +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTable.js +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTable.js.map +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTableBody.js +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTableBody.js.map +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTableHead.js +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTableHead.js.map +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/TableSortLabel.js +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/TableSortLabel.js.map +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/helpers/columns.js +1 -1
- package/cjs-bundle/componentsV2/CompletionsOffsetWellPicker/PadsTable/helpers/columns.js.map +1 -1
- package/cjs-bundle/componentsV2/DragHandle/DragHandle.js +1 -1
- package/cjs-bundle/componentsV2/DragHandle/DragHandle.js.map +1 -1
- package/cjs-bundle/componentsV2/OffsetWellsButton/OffsetWellsButton.js +1 -1
- package/cjs-bundle/componentsV2/OffsetWellsButton/OffsetWellsButton.js.map +1 -1
- package/cjs-bundle/componentsV2/OffsetWellsButton/OffsetWellsButton.scss.js +1 -1
- package/cjs-bundle/config/highcharts/highcharts.js +1 -1
- package/cjs-bundle/config/highcharts/highcharts.js.map +1 -1
- package/cjs-bundle/permissions/withPermissionsHOC.js +1 -1
- package/cjs-bundle/permissions/withPermissionsHOC.js.map +1 -1
- package/components/CommentCard/CommentCard.d.ts.map +1 -1
- package/components/CommentCard/CommentCard.js +1 -1
- package/components/CommentCard/CommentCard.js.map +1 -1
- package/components/CommentCard/CommentCard.scss.js +1 -1
- package/components/CommentCard/CommentCard.types.d.ts +3 -0
- package/components/CommentCard/CommentCard.types.d.ts.map +1 -1
- package/components/CurveTooltip/CurveTooltip.d.ts +24 -0
- package/components/CurveTooltip/CurveTooltip.d.ts.map +1 -0
- package/components/CurveTooltip/CurveTooltip.js +2 -0
- package/components/CurveTooltip/CurveTooltip.js.map +1 -0
- package/components/CurveTooltip/CurveTooltip.scss.js +2 -0
- package/components/CurveTooltip/CurveTooltip.scss.js.map +1 -0
- package/components/CurveTooltip/index.d.ts +2 -0
- package/components/CurveTooltip/index.d.ts.map +1 -0
- package/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.d.ts +1 -0
- package/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.d.ts.map +1 -1
- package/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.js +1 -1
- package/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.js.map +1 -1
- package/components/NewCommentCursor/NewCommentCursor.d.ts +2 -0
- package/components/NewCommentCursor/NewCommentCursor.d.ts.map +1 -1
- package/components/NewCommentCursor/NewCommentCursor.js +1 -1
- package/components/NewCommentCursor/NewCommentCursor.js.map +1 -1
- package/components/NewCommentCursor/__tests__/NewCommentCursor.test.d.ts +2 -0
- package/components/NewCommentCursor/__tests__/NewCommentCursor.test.d.ts.map +1 -0
- package/componentsV2/ColorPicker/Swatches/Swatches.js +1 -1
- package/componentsV2/ColorPicker/Swatches/Swatches.js.map +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/AssetFilters/AssetFilters.d.ts.map +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/AssetFilters/AssetFilters.js +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/AssetFilters/AssetFilters.js.map +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/AssetSearchInput/AssetSearchInput.d.ts.map +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/AssetSearchInput/AssetSearchInput.js +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/AssetSearchInput/AssetSearchInput.js.map +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/CompletionsOffsetWellPicker.d.ts.map +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/CompletionsOffsetWellPicker.js +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/CompletionsOffsetWellPicker.js.map +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/Map/Map.d.ts.map +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/Map/Map.js +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/Map/Map.js.map +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/ModalTitle/ModalTitle.d.ts.map +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/ModalTitle/ModalTitle.js +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/ModalTitle/ModalTitle.js.map +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadTableRow.d.ts.map +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadTableRow.js +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadTableRow.js.map +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTable.js +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTable.js.map +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTableBody.d.ts.map +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTableBody.js +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTableBody.js.map +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTableHead.d.ts.map +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTableHead.js +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/PadsTable/PadsTableHead.js.map +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/PadsTable/TableSortLabel.d.ts.map +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/PadsTable/TableSortLabel.js +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/PadsTable/TableSortLabel.js.map +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/PadsTable/helpers/columns.d.ts +1 -0
- package/componentsV2/CompletionsOffsetWellPicker/PadsTable/helpers/columns.d.ts.map +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/PadsTable/helpers/columns.js +1 -1
- package/componentsV2/CompletionsOffsetWellPicker/PadsTable/helpers/columns.js.map +1 -1
- package/componentsV2/DragHandle/DragHandle.d.ts +1 -0
- package/componentsV2/DragHandle/DragHandle.d.ts.map +1 -1
- package/componentsV2/DragHandle/DragHandle.js +1 -1
- package/componentsV2/DragHandle/DragHandle.js.map +1 -1
- package/componentsV2/DragHandle/DragHandle.stories.d.ts +1 -0
- package/componentsV2/DragHandle/DragHandle.stories.d.ts.map +1 -1
- package/componentsV2/OffsetWellsButton/OffsetWellsButton.d.ts.map +1 -1
- package/componentsV2/OffsetWellsButton/OffsetWellsButton.js +1 -1
- package/componentsV2/OffsetWellsButton/OffsetWellsButton.js.map +1 -1
- package/componentsV2/OffsetWellsButton/OffsetWellsButton.scss.js +1 -1
- package/config/highcharts/highcharts.d.ts.map +1 -1
- package/config/highcharts/highcharts.js +1 -1
- package/config/highcharts/highcharts.js.map +1 -1
- package/mcp-server/server.mjs +71 -5
- package/package.json +1 -1
- package/permissions/__tests__/withPermissionsHOC.test.d.ts.map +1 -1
- package/permissions/withPermissionsHOC.d.ts.map +1 -1
- package/permissions/withPermissionsHOC.js +1 -1
- package/permissions/withPermissionsHOC.js.map +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentCard.js","sources":["../../../src/components/CommentCard/CommentCard.tsx"],"sourcesContent":["import { CSSProperties, forwardRef, ReactElement, useMemo } from 'react';\nimport { Collapse } from '@material-ui/core';\nimport classNames from 'classnames';\n\nimport { FeedCard, FEED_CARD_MAX_HEIGHT_PX } from '../FeedCard';\nimport { StoredAttachment } from '../AttachmentPreview/useStoredAttachment';\nimport { useStoredAttachments } from '../AttachmentPreview/useStoredAttachments';\nimport { useFeedActivity } from '../FeedCard/useFeedActivity';\nimport { AttachmentPreview } from '../AttachmentPreview';\nimport { Avatar } from '../../componentsV2/Avatar';\nimport { Tooltip } from '../../componentsV2/Tooltip';\nimport { LinkedText } from '../LinkedText';\nimport { InfoIcon } from '../../icons';\n\nimport { CommentCardReactions } from './CommentCardReactions';\nimport { CommentCardReplies } from './CommentCardReplies';\nimport { CommentCardProps, CommentContextRow } from './CommentCard.types';\n\nimport styles from './CommentCard.scss';\n\nconst MetadataTooltip = ({ rows }: { rows: CommentContextRow[] }) => (\n <div className={styles.metadataRows}>\n {rows.map(({ label, value, unit }) => (\n <div key={label} className={styles.metadataRow}>\n <span className={styles.metadataLabel}>{label}</span>\n <span className={styles.metadataValue}>{value}</span>\n {unit && <span className={styles.metadataUnit}>{unit}</span>}\n </div>\n ))}\n </div>\n);\n\nexport const CommentCard = forwardRef<HTMLDivElement, CommentCardProps>((props, ref) => {\n const {\n activity,\n variant = 'expanded',\n author,\n timestamp,\n subtitle,\n body,\n contextRows,\n attachment,\n storedAttachments,\n isLiked,\n likesCount,\n commentsCount,\n replies,\n hasMoreReplies,\n moreRepliesCount,\n attachments,\n onAttachmentClick,\n onAttachmentShare,\n attachmentSlot,\n chip,\n chipColor,\n onLike,\n onReplyToggle,\n onForward,\n onShowMoreReplies,\n menuItems,\n isReplyOpen,\n replyInput,\n editForm,\n width,\n onMouseEnter,\n onMouseLeave,\n className,\n testId,\n } = props;\n\n const activityBinding = useFeedActivity(activity, 'comment');\n const cardMenuItems = activityBinding\n ? [...(menuItems ?? []), ...activityBinding.menuItems]\n : menuItems;\n const cardReplyInput = activityBinding ? activityBinding.replyInput : replyInput;\n const cardIsReplyOpen = activityBinding ? activityBinding.isReplyOpen : isReplyOpen;\n const cardReplies = activityBinding ? activityBinding.replies : replies;\n\n const hasMetadata = !!contextRows?.length;\n // The chip takes over the metadata tooltip when present, so the info icon is redundant.\n const showInfoIcon = hasMetadata && !chip;\n\n const hasFooter = !!(\n activityBinding ||\n onLike ||\n onReplyToggle ||\n onForward ||\n cardMenuItems?.length ||\n showInfoIcon\n );\n\n const info = showInfoIcon && (\n <Tooltip\n placement=\"top\"\n className={styles.metadataTooltip}\n title={<MetadataTooltip rows={contextRows} />}\n >\n <span className={styles.infoButton} data-testid=\"comment-card-info\">\n <InfoIcon size={12} strokeWidth={2} />\n </span>\n </Tooltip>\n );\n\n const reactions = (\n <CommentCardReactions\n info={info}\n commentsCount={activityBinding ? activityBinding.commentsCount : commentsCount}\n likesCount={activityBinding ? activityBinding.likesCount : likesCount}\n isLiked={activityBinding ? activityBinding.isLiked : isLiked}\n menuItems={cardMenuItems}\n onLike={activityBinding ? activityBinding.onLike : onLike}\n onReplyToggle={activityBinding ? activityBinding.onReplyToggle : onReplyToggle}\n onForward={onForward}\n />\n );\n\n const bodyRow = (\n <div className={styles.text}>\n {chip && (\n <Tooltip\n placement=\"top\"\n className={styles.metadataTooltip}\n title={hasMetadata ? <MetadataTooltip rows={contextRows} /> : ''}\n >\n <span\n className={classNames(styles.chip, !!chipColor && styles.chipAccented)}\n style={chipColor ? ({ '--chip-color': chipColor } as CSSProperties) : undefined}\n >\n {chipColor && <span className={styles.chipDot} />}\n {chip}\n </span>\n </Tooltip>\n )}\n <LinkedText>{body}</LinkedText>\n </div>\n );\n\n const storedList = useMemo(\n () => storedAttachments ?? ([attachment].filter(Boolean) as StoredAttachment[]),\n [storedAttachments, attachment]\n );\n const storedItems = useStoredAttachments(storedList);\n const items = storedItems.length ? storedItems : attachments;\n\n // Undefined is the norm, which lets AttachmentPreview run its own lightbox; a caller that\n // passes the prop is taking the click over.\n const attachmentPreview = items?.length ? (\n <AttachmentPreview items={items} onItemClick={onAttachmentClick} onShare={onAttachmentShare} />\n ) : null;\n\n const surfaceProps = {\n ref,\n width,\n radius: 12,\n onMouseEnter,\n onMouseLeave,\n testId,\n className,\n };\n\n if (activityBinding?.isDeleted) return null;\n const withOverlays = (card: ReactElement) => (\n <>\n {card}\n {activityBinding?.deleteDialog}\n </>\n );\n\n if (variant === 'preview') {\n return withOverlays(\n <FeedCard {...surfaceProps} maxHeight={FEED_CARD_MAX_HEIGHT_PX}>\n <div className={styles.compactBody}>\n <div className={styles.compactTop}>\n <Avatar\n size={24}\n name={author.name}\n imageSrc={author.avatarUrl}\n className={styles.avatar}\n />\n <span className={styles.name}>{author.name}</span>\n <span className={styles.compactTime}>{timestamp}</span>\n </div>\n <div className={styles.scrollBody}>{bodyRow}</div>\n </div>\n {hasFooter && <div className={styles.compactFooter}>{reactions}</div>}\n </FeedCard>\n );\n }\n\n const editing = !!editForm;\n\n const headerEl = (\n <div className={styles.header}>\n <Avatar size={24} name={author.name} imageSrc={author.avatarUrl} className={styles.avatar} />\n <div className={styles.headerText}>\n <div className={styles.nameRow}>\n <span className={styles.name}>{author.name}</span>\n {timestamp && <span className={styles.timestamp}>{timestamp}</span>}\n </div>\n {subtitle && <span className={styles.subtitle}>{subtitle}</span>}\n </div>\n </div>\n );\n\n if (editing) {\n return withOverlays(\n <FeedCard {...surfaceProps}>\n <div className={styles.editHeader}>{headerEl}</div>\n {editForm}\n </FeedCard>\n );\n }\n\n return withOverlays(\n <FeedCard {...surfaceProps}>\n <div className={styles.capped} style={{ maxHeight: FEED_CARD_MAX_HEIGHT_PX }}>\n <div className={styles.bodySurface}>\n {headerEl}\n\n <div className={styles.scrollBody}>\n {bodyRow}\n {(attachmentPreview || attachmentSlot) && (\n <div className={styles.attachment}>\n {attachmentPreview}\n {attachmentSlot}\n </div>\n )}\n </div>\n </div>\n\n {hasFooter && <div className={styles.footer}>{reactions}</div>}\n </div>\n\n {hasFooter && (\n <Collapse in={cardIsReplyOpen} timeout={250} unmountOnExit>\n <div className={styles.repliesSection}>\n <CommentCardReplies\n replies={cardReplies}\n hasMoreReplies={activityBinding ? activityBinding.hasMoreReplies : hasMoreReplies}\n moreRepliesCount={\n activityBinding ? activityBinding.moreRepliesCount : moreRepliesCount\n }\n isReplyOpen={cardIsReplyOpen}\n replyInput={cardReplyInput}\n onShowMoreReplies={\n activityBinding ? activityBinding.onShowMoreReplies : onShowMoreReplies\n }\n />\n </div>\n </Collapse>\n )}\n </FeedCard>\n );\n});\n"],"names":["MetadataTooltip","_ref","rows","_jsx","className","styles","metadataRows","children","map","_ref2","label","value","unit","_jsxs","metadataRow","metadataLabel","metadataValue","metadataUnit","CommentCard","forwardRef","props","ref","activity","_props$variant","variant","author","timestamp","subtitle","body","contextRows","attachment","storedAttachments","isLiked","likesCount","commentsCount","replies","hasMoreReplies","moreRepliesCount","attachments","onAttachmentClick","onAttachmentShare","attachmentSlot","chip","chipColor","onLike","onReplyToggle","onForward","onShowMoreReplies","menuItems","isReplyOpen","replyInput","editForm","width","onMouseEnter","onMouseLeave","testId","activityBinding","useFeedActivity","cardMenuItems","cardReplyInput","cardIsReplyOpen","cardReplies","hasMetadata","length","showInfoIcon","hasFooter","info","Tooltip","placement","metadataTooltip","title","infoButton","InfoIcon","size","strokeWidth","reactions","CommentCardReactions","bodyRow","text","classNames","chipAccented","style","undefined","chipDot","LinkedText","storedList","useMemo","filter","Boolean","storedItems","useStoredAttachments","items","attachmentPreview","AttachmentPreview","onItemClick","onShare","surfaceProps","radius","isDeleted","withOverlays","card","_Fragment","deleteDialog","FeedCard","maxHeight","FEED_CARD_MAX_HEIGHT_PX","compactBody","compactTop","Avatar","name","imageSrc","avatarUrl","avatar","compactTime","scrollBody","compactFooter","editing","headerEl","header","headerText","nameRow","editHeader","capped","bodySurface","footer","Collapse","in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,UAAWC,EAAO4H,eAAe1H,SACpCJ,EAAC+H,EAAkB,CACjB/F,QAAS0B,GACTzB,eAAgBoB,GAAkBA,GAAgBpB,eAAiBA,EACnEC,iBACEmB,GAAkBA,GAAgBnB,iBAAmBA,EAEvDY,YAAaW,GACbV,WAAYS,GACZZ,kBACES,GAAkBA,GAAgBT,kBAAoBA,YAQtE"}
|
|
1
|
+
{"version":3,"file":"CommentCard.js","sources":["../../../src/components/CommentCard/CommentCard.tsx"],"sourcesContent":["import { CSSProperties, forwardRef, ReactElement, useMemo } from 'react';\nimport { Collapse } from '@material-ui/core';\nimport classNames from 'classnames';\n\nimport { FeedCard, FEED_CARD_MAX_HEIGHT_PX } from '../FeedCard';\nimport { StoredAttachment } from '../AttachmentPreview/useStoredAttachment';\nimport { useStoredAttachments } from '../AttachmentPreview/useStoredAttachments';\nimport { useFeedActivity } from '../FeedCard/useFeedActivity';\nimport { AttachmentPreview } from '../AttachmentPreview';\nimport { Avatar } from '../../componentsV2/Avatar';\nimport { CurveTooltip } from '../CurveTooltip';\nimport { LinkedText } from '../LinkedText';\nimport { InfoIcon } from '../../icons';\n\nimport { CommentCardReactions } from './CommentCardReactions';\nimport { CommentCardReplies } from './CommentCardReplies';\nimport { CommentCardProps } from './CommentCard.types';\n\nimport styles from './CommentCard.scss';\n\nexport const CommentCard = forwardRef<HTMLDivElement, CommentCardProps>((props, ref) => {\n const {\n activity,\n variant = 'expanded',\n author,\n timestamp,\n subtitle,\n body,\n contextRows,\n attachment,\n storedAttachments,\n isLiked,\n likesCount,\n commentsCount,\n replies,\n hasMoreReplies,\n moreRepliesCount,\n attachments,\n onAttachmentClick,\n onAttachmentShare,\n attachmentSlot,\n chip,\n chipColor,\n chipValue,\n chipUnit,\n onLike,\n onReplyToggle,\n onForward,\n onShowMoreReplies,\n menuItems,\n isReplyOpen,\n replyInput,\n editForm,\n width,\n onMouseEnter,\n onMouseLeave,\n className,\n testId,\n } = props;\n\n const activityBinding = useFeedActivity(activity, 'comment');\n const cardMenuItems = activityBinding\n ? [...(menuItems ?? []), ...activityBinding.menuItems]\n : menuItems;\n const cardReplyInput = activityBinding ? activityBinding.replyInput : replyInput;\n const cardIsReplyOpen = activityBinding ? activityBinding.isReplyOpen : isReplyOpen;\n const cardReplies = activityBinding ? activityBinding.replies : replies;\n\n const hasMetadata = !!contextRows?.length;\n // The chip takes over the metadata tooltip when present, so the info icon is redundant.\n const showInfoIcon = hasMetadata && !chip;\n\n const hasFooter = !!(\n activityBinding ||\n onLike ||\n onReplyToggle ||\n onForward ||\n cardMenuItems?.length ||\n showInfoIcon\n );\n\n const info = showInfoIcon && (\n <CurveTooltip data={{ rows: contextRows ?? [] }}>\n <span className={styles.infoButton} data-testid=\"comment-card-info\">\n <InfoIcon size={12} strokeWidth={2} />\n </span>\n </CurveTooltip>\n );\n\n const reactions = (\n <CommentCardReactions\n info={info}\n commentsCount={activityBinding ? activityBinding.commentsCount : commentsCount}\n likesCount={activityBinding ? activityBinding.likesCount : likesCount}\n isLiked={activityBinding ? activityBinding.isLiked : isLiked}\n menuItems={cardMenuItems}\n onLike={activityBinding ? activityBinding.onLike : onLike}\n onReplyToggle={activityBinding ? activityBinding.onReplyToggle : onReplyToggle}\n onForward={onForward}\n />\n );\n\n const bodyRow = (\n <div className={styles.text}>\n {chip && (\n <CurveTooltip\n data={\n hasMetadata || chipValue != null\n ? {\n title: chip,\n value: chipValue,\n unit: chipUnit,\n color: chipColor,\n rows: contextRows ?? [],\n }\n : { rows: [] }\n }\n >\n <span\n className={classNames(styles.chip, !!chipColor && styles.chipAccented)}\n style={chipColor ? ({ '--chip-color': chipColor } as CSSProperties) : undefined}\n >\n {chipColor && <span className={styles.chipDot} />}\n {chip}\n </span>\n </CurveTooltip>\n )}\n <LinkedText>{body}</LinkedText>\n </div>\n );\n\n const storedList = useMemo(\n () => storedAttachments ?? ([attachment].filter(Boolean) as StoredAttachment[]),\n [storedAttachments, attachment]\n );\n const storedItems = useStoredAttachments(storedList);\n const items = storedItems.length ? storedItems : attachments;\n\n // Undefined is the norm, which lets AttachmentPreview run its own lightbox; a caller that\n // passes the prop is taking the click over.\n const attachmentPreview = items?.length ? (\n <AttachmentPreview items={items} onItemClick={onAttachmentClick} onShare={onAttachmentShare} />\n ) : null;\n\n const surfaceProps = {\n ref,\n width,\n radius: 12,\n onMouseEnter,\n onMouseLeave,\n testId,\n className,\n };\n\n if (activityBinding?.isDeleted) return null;\n const withOverlays = (card: ReactElement) => (\n <>\n {card}\n {activityBinding?.deleteDialog}\n </>\n );\n\n if (variant === 'preview') {\n return withOverlays(\n <FeedCard {...surfaceProps} maxHeight={FEED_CARD_MAX_HEIGHT_PX}>\n <div className={styles.compactBody}>\n <div className={styles.compactTop}>\n <Avatar\n size={24}\n name={author.name}\n imageSrc={author.avatarUrl}\n className={styles.avatar}\n />\n <span className={styles.name}>{author.name}</span>\n <span className={styles.compactTime}>{timestamp}</span>\n </div>\n <div className={styles.scrollBody}>{bodyRow}</div>\n </div>\n {hasFooter && <div className={styles.compactFooter}>{reactions}</div>}\n </FeedCard>\n );\n }\n\n const editing = !!editForm;\n\n const headerEl = (\n <div className={styles.header}>\n <Avatar size={24} name={author.name} imageSrc={author.avatarUrl} className={styles.avatar} />\n <div className={styles.headerText}>\n <div className={styles.nameRow}>\n <span className={styles.name}>{author.name}</span>\n {timestamp && <span className={styles.timestamp}>{timestamp}</span>}\n </div>\n {subtitle && <span className={styles.subtitle}>{subtitle}</span>}\n </div>\n </div>\n );\n\n if (editing) {\n return withOverlays(\n <FeedCard {...surfaceProps}>\n <div className={styles.editHeader}>{headerEl}</div>\n {editForm}\n </FeedCard>\n );\n }\n\n return withOverlays(\n <FeedCard {...surfaceProps}>\n <div className={styles.capped} style={{ maxHeight: FEED_CARD_MAX_HEIGHT_PX }}>\n <div className={styles.bodySurface}>\n {headerEl}\n\n <div className={styles.scrollBody}>\n {bodyRow}\n {(attachmentPreview || attachmentSlot) && (\n <div className={styles.attachment}>\n {attachmentPreview}\n {attachmentSlot}\n </div>\n )}\n </div>\n </div>\n\n {hasFooter && <div className={styles.footer}>{reactions}</div>}\n </div>\n\n {hasFooter && (\n <Collapse in={cardIsReplyOpen} timeout={250} unmountOnExit>\n <div className={styles.repliesSection}>\n <CommentCardReplies\n replies={cardReplies}\n hasMoreReplies={activityBinding ? activityBinding.hasMoreReplies : hasMoreReplies}\n moreRepliesCount={\n activityBinding ? activityBinding.moreRepliesCount : moreRepliesCount\n }\n isReplyOpen={cardIsReplyOpen}\n replyInput={cardReplyInput}\n onShowMoreReplies={\n activityBinding ? activityBinding.onShowMoreReplies : onShowMoreReplies\n }\n />\n </div>\n </Collapse>\n )}\n </FeedCard>\n );\n});\n"],"names":["CommentCard","forwardRef","props","ref","activity","_props$variant","variant","author","timestamp","subtitle","body","contextRows","attachment","storedAttachments","isLiked","likesCount","commentsCount","replies","hasMoreReplies","moreRepliesCount","attachments","onAttachmentClick","onAttachmentShare","attachmentSlot","chip","chipColor","chipValue","chipUnit","onLike","onReplyToggle","onForward","onShowMoreReplies","menuItems","isReplyOpen","replyInput","editForm","width","onMouseEnter","onMouseLeave","className","testId","activityBinding","useFeedActivity","cardMenuItems","cardReplyInput","cardIsReplyOpen","cardReplies","hasMetadata","length","showInfoIcon","hasFooter","info","_jsx","CurveTooltip","data","rows","children","styles","infoButton","InfoIcon","size","strokeWidth","reactions","CommentCardReactions","bodyRow","_jsxs","text","title","value","unit","color","classNames","chipAccented","style","undefined","chipDot","LinkedText","storedList","useMemo","filter","Boolean","storedItems","useStoredAttachments","items","attachmentPreview","AttachmentPreview","onItemClick","onShare","surfaceProps","radius","isDeleted","withOverlays","card","_Fragment","deleteDialog","FeedCard","maxHeight","FEED_CARD_MAX_HEIGHT_PX","compactBody","compactTop","Avatar","name","imageSrc","avatarUrl","avatar","compactTime","scrollBody","compactFooter","editing","headerEl","header","headerText","nameRow","editHeader","capped","bodySurface","footer","Collapse","in","timeout","unmountOnExit","repliesSection","CommentCardReplies"],"mappings":"+zMAoBO,IAAMA,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AAEjD,EAAO8F,OACrC7F,GAAa4C,EAAA,OAAA,CAAMb,UAAWkB,EAAOjD,UAAUgD,SAAEhD,OAEnDC,GAAY2C,EAAA,OAAA,CAAMb,UAAWkB,EAAOhD,SAAS+C,SAAE/C,UAKtD,OACSkF,GACL1B,EAAC8B,SAAaP,IAAY,GAF1BoB,GAE0B,CAAApD,SACxB,CAAAJ,EAAA,MAAA,CAAKb,UAAWkB,EAAOwD,WAAWzD,SAAEqD,KACnC1E,IAMqB,CAAAqB,SACxB,CAAAS,EAAA,MAAA,CAAK1B,UAAWkB,EAAOyD,OAAQzC,MAAO,CAAEuB,UAAWC,GAA0BzC,SAC3E,CAAAS,EAAA,MAAA,CAAK1B,UAAWkB,EAAO0D,YAAY3D,SAAA,CAChCqD,GAED5C,EAAA,MAAA,CAAK1B,UAAWkB,EAAOiD,WAAWlD,SAAA,CAC/BQ,IACCoB,IAAqB7D,IACrB0C,EAAA,MAAA,CAAK1B,UAAWkB,EAAO7C,WAAW4C,SAC/B4B,CAAAA,GACA7D,WAMR2B,IAAaE,EAAA,MAAA,CAAKb,UAAWkB,EAAO2D,OAAO5D,SAAEM,QAG/CZ,IACCE,EAACiE,EAAQ,CAACC,GAAIzE,GAAiB0E,QAAS,IAAKC,eAAa,EAAAhE,SACxDJ,EAAA,MAAA,CAAKb,UAAWkB,EAAOgE,eAAejE,SACpCJ,EAACsE,EAAkB,CACjBzG,QAAS6B,GACT5B,eAAgBuB,GAAkBA,GAAgBvB,eAAiBA,EACnEC,iBACEsB,GAAkBA,GAAgBtB,iBAAmBA,EAEvDc,YAAaY,GACbX,WAAYU,GACZb,kBACEU,GAAkBA,GAAgBV,kBAAoBA,YAQtE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from'./../../ext-esm/style-inject/dist/style-inject.es.js';var t={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",chipDot:"CommentCard_chipDot__P-usA",text:"CommentCard_text__eAIZM",attachment:"CommentCard_attachment__KktIn",infoButton:"CommentCard_infoButton__gqcvK",
|
|
1
|
+
import e from'./../../ext-esm/style-inject/dist/style-inject.es.js';var t={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",chipDot:"CommentCard_chipDot__P-usA",text:"CommentCard_text__eAIZM",attachment:"CommentCard_attachment__KktIn",infoButton:"CommentCard_infoButton__gqcvK",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"};e(".CommentCard_capped__izWBZ{flex-direction:column}.CommentCard_bodySurface__scobR,.CommentCard_capped__izWBZ{overflow-clip-margin:12px;display:flex;overflow:hidden;overflow:clip}.CommentCard_bodySurface__scobR{flex:1 1 auto;flex-direction:column;gap:8px;min-height:0;padding:8px 12px}.CommentCard_editHeader__8aUBt{padding:8px 12px 0}.CommentCard_scrollBody__CIun9{display:flex;flex:1 1 auto;flex-direction:column;gap:8px;margin:0 -24px;min-height:0;overflow-x:hidden;overflow-y:auto;padding:0 24px}.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);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;box-sizing:border-box;color:var(--palette-primary-text-1);cursor:pointer;display:flex;float:right;font-size:12px;gap:4px;height:24px;line-height:16px;margin:4px 0 0 8px;padding:6px;white-space:nowrap}.CommentCard_chipAccented__Xl8ek{background:linear-gradient(94deg,rgb(from var(--chip-color) r g b/.16) 1%,transparent 35%),rgb(from var(--palette-primary-text-1) r g b/.04);border:.5px solid rgb(from var(--chip-color) r g b/.5)}.CommentCard_chipDot__P-usA{background:var(--chip-color);border-radius:50%;flex-shrink:0;height:6px;width:6px}.CommentCard_text__eAIZM{color:var(--palette-primary-text-1);font-size:12px;line-height:16px;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{--attachment-arrow-outset:12px;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_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}");export{t as default};
|
|
2
2
|
//# sourceMappingURL=CommentCard.scss.js.map
|
|
@@ -53,6 +53,9 @@ export type CommentCardProps = {
|
|
|
53
53
|
attachmentSlot?: ReactNode;
|
|
54
54
|
chip?: ReactNode;
|
|
55
55
|
chipColor?: string;
|
|
56
|
+
/** The chip curve's value at the comment, shown in the chip tooltip title. */
|
|
57
|
+
chipValue?: ReactNode;
|
|
58
|
+
chipUnit?: ReactNode;
|
|
56
59
|
onLike?: () => void;
|
|
57
60
|
onReplyToggle?: () => void;
|
|
58
61
|
onForward?: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentCard.types.d.ts","sourceRoot":"","sources":["../../../src/components/CommentCard/CommentCard.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8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CAAC;IAC1D,2FAA2F;IAC3F,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAC1D,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;IAGrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,SAAS,CAAC,EAAE,eAAe,EAAE,CAAC;IAE9B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,SAAS,CAAC;IAEvB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAE1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { TooltipProps } from '../Tooltip/Tooltip';
|
|
3
|
+
export type CurveTooltipRow = {
|
|
4
|
+
label: string;
|
|
5
|
+
value: ReactNode;
|
|
6
|
+
unit?: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export type CurveTooltipData = {
|
|
9
|
+
title?: ReactNode;
|
|
10
|
+
value?: ReactNode;
|
|
11
|
+
unit?: ReactNode;
|
|
12
|
+
color?: string;
|
|
13
|
+
rows: CurveTooltipRow[];
|
|
14
|
+
};
|
|
15
|
+
type Props = {
|
|
16
|
+
data: CurveTooltipData;
|
|
17
|
+
children: ReactElement;
|
|
18
|
+
open?: boolean;
|
|
19
|
+
isFullScreen?: boolean;
|
|
20
|
+
placement?: TooltipProps['placement'];
|
|
21
|
+
};
|
|
22
|
+
export declare const CurveTooltip: ({ data, children, open, isFullScreen, placement }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=CurveTooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CurveTooltip.d.ts","sourceRoot":"","sources":["../../../src/components/CurveTooltip/CurveTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGhD,OAAO,EAAW,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAI3D,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,eAAe,EAAE,CAAC;CACzB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,gBAAgB,CAAC;IACvB,QAAQ,EAAE,YAAY,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;CACvC,CAAC;AAUF,eAAO,MAAM,YAAY,sDAA+D,KAAK,4CA+C5F,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Text as e}from"../../componentsV2/Text/Text.js";import{Tooltip as l}from"../Tooltip/Tooltip.js";import o from"./CurveTooltip.scss.js";import{jsx as t,jsxs as r,Fragment as i}from"react/jsx-runtime";var n={popperOptions:{modifiers:{preventOverflow:{enabled:!0,boundariesElement:"viewport"}}}},s={popper:o.popper,tooltip:o.tooltip},p=function(p){var a=p.data,c=p.children,u=p.open,d=p.isFullScreen,m=p.placement,v=void 0===m?"top":m;return null!=a.title||a.rows.length?t(l,{open:u,isFullScreen:d,placement:v,PopperProps:n,classes:s,title:r("div",{className:o.content,"data-testid":"curveTooltip",children:[null!=a.title&&r(e,{size:12,tagName:"div",className:o.title,children:[t("span",{className:o.titleBar,style:{backgroundColor:a.color}}),r("span",{children:[a.title,null!=a.value&&r(i,{children:[": ",a.value]})]}),null!=a.unit&&t(e,{size:12,color:"T6",children:a.unit})]}),a.rows.map((function(l){return r("div",{className:o.row,children:[t(e,{size:14,color:"T6",children:l.label}),t(e,{size:14,color:"T1",children:l.value}),null!=l.unit&&t(e,{size:12,color:"T6",className:o.rowUnit,children:l.unit})]},l.label)}))]}),children:c}):c};export{p as CurveTooltip};
|
|
2
|
+
//# sourceMappingURL=CurveTooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CurveTooltip.js","sources":["../../../src/components/CurveTooltip/CurveTooltip.tsx"],"sourcesContent":["import { ReactElement, ReactNode } from 'react';\n\nimport { Text } from '../../componentsV2/Text';\nimport { Tooltip, TooltipProps } from '../Tooltip/Tooltip';\n\nimport styles from './CurveTooltip.scss';\n\nexport type CurveTooltipRow = {\n label: string;\n value: ReactNode;\n unit?: ReactNode;\n};\n\nexport type CurveTooltipData = {\n title?: ReactNode;\n value?: ReactNode;\n unit?: ReactNode;\n color?: string;\n rows: CurveTooltipRow[];\n};\n\ntype Props = {\n data: CurveTooltipData;\n children: ReactElement;\n open?: boolean;\n isFullScreen?: boolean;\n placement?: TooltipProps['placement'];\n};\n\nconst POPPER_PROPS = {\n popperOptions: {\n modifiers: { preventOverflow: { enabled: true, boundariesElement: 'viewport' } },\n },\n};\n\nconst TOOLTIP_CLASSES = { popper: styles.popper, tooltip: styles.tooltip };\n\nexport const CurveTooltip = ({ data, children, open, isFullScreen, placement = 'top' }: Props) => {\n if (data.title == null && !data.rows.length) return children;\n\n return (\n <Tooltip\n open={open}\n isFullScreen={isFullScreen}\n placement={placement}\n PopperProps={POPPER_PROPS}\n classes={TOOLTIP_CLASSES}\n title={\n <div className={styles.content} data-testid=\"curveTooltip\">\n {data.title != null && (\n <Text size={12} tagName=\"div\" className={styles.title}>\n <span className={styles.titleBar} style={{ backgroundColor: data.color }} />\n <span>\n {data.title}\n {data.value != null && <>: {data.value}</>}\n </span>\n {data.unit != null && (\n <Text size={12} color=\"T6\">\n {data.unit}\n </Text>\n )}\n </Text>\n )}\n {data.rows.map(row => (\n <div key={row.label} className={styles.row}>\n <Text size={14} color=\"T6\">\n {row.label}\n </Text>\n <Text size={14} color=\"T1\">\n {row.value}\n </Text>\n {row.unit != null && (\n <Text size={12} color=\"T6\" className={styles.rowUnit}>\n {row.unit}\n </Text>\n )}\n </div>\n ))}\n </div>\n }\n >\n {children}\n </Tooltip>\n );\n};\n"],"names":["POPPER_PROPS","popperOptions","modifiers","preventOverflow","enabled","boundariesElement","TOOLTIP_CLASSES","popper","styles","tooltip","CurveTooltip","_ref","data","children","open","isFullScreen","_ref$placement","placement","title","rows","length","_jsx","Tooltip","PopperProps","classes","_jsxs","className","content","Text","size","tagName","titleBar","style","backgroundColor","color","value","_Fragment","unit","map","row","label","rowUnit"],"mappings":"6MA6BA,IAAMA,EAAe,CACnBC,cAAe,CACbC,UAAW,CAAEC,gBAAiB,CAAEC,SAAS,EAAMC,kBAAmB,eAIhEC,EAAkB,CAAEC,OAAQC,EAAOD,OAAQE,QAASD,EAAOC,SAEpDC,EAAe,SAAsEC,GAAA,IAAnEC,IAAAA,KAAMC,IAAAA,SAAUC,IAAAA,KAAMC,IAAAA,aAAYC,EAAAL,EAAEM,UAAAA,aAAY,MAAKD,EAClF,OAAkB,MAAdJ,EAAKM,OAAkBN,EAAKO,KAAKC,OAGnCC,EAACC,EAAO,CACNR,KAAMA,EACNC,aAAcA,EACdE,UAAWA,EACXM,YAAavB,EACbwB,QAASlB,EACTY,MACEO,EAAA,MAAA,CAAKC,UAAWlB,EAAOmB,QAAS,cAAY,eAAcd,SAAA,CACzC,MAAdD,EAAKM,OACJO,EAACG,EAAI,CAACC,KAAM,GAAIC,QAAQ,MAAMJ,UAAWlB,EAAOU,MAAML,SACpD,CAAAQ,EAAA,OAAA,CAAMK,UAAWlB,EAAOuB,SAAUC,MAAO,CAAEC,gBAAiBrB,EAAKsB,SACjET,EAAA,OAAA,CAAAZ,SACGD,CAAAA,EAAKM,MACS,MAAdN,EAAKuB,OAAiBV,EAAAW,EAAA,CAAAvB,SAAKD,CAAAA,KAAAA,EAAKuB,YAErB,MAAbvB,EAAKyB,MACJhB,EAACO,EAAI,CAACC,KAAM,GAAIK,MAAM,KAAIrB,SACvBD,EAAKyB,UAKbzB,EAAKO,KAAKmB,KAAI,SAAAC,GAAG,OAChBd,EAAA,MAAA,CAAqBC,UAAWlB,EAAO+B,IAAI1B,SAAA,CACzCQ,EAACO,EAAI,CAACC,KAAM,GAAIK,MAAM,KAAIrB,SACvB0B,EAAIC,QAEPnB,EAACO,EAAI,CAACC,KAAM,GAAIK,MAAM,KAAIrB,SACvB0B,EAAIJ,QAEM,MAAZI,EAAIF,MACHhB,EAACO,EAAI,CAACC,KAAM,GAAIK,MAAM,KAAKR,UAAWlB,EAAOiC,QAAQ5B,SAClD0B,EAAIF,SATDE,EAAIC,MAYR,OAGX3B,SAEAA,IA3C+CA,CA8CtD"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import o from'./../../ext-esm/style-inject/dist/style-inject.es.js';var t={spacing:"8",popper:"CurveTooltip_popper__inKjq",tooltip:"CurveTooltip_tooltip__8f67C",content:"CurveTooltip_content__OY7AI",title:"CurveTooltip_title__dzymJ",titleBar:"CurveTooltip_titleBar__XcI5e",row:"CurveTooltip_row__2zHX2",rowUnit:"CurveTooltip_rowUnit__MCGr4"};o(".CurveTooltip_popper__inKjq .MuiTooltip-tooltip.CurveTooltip_tooltip__8f67C{background:rgb(from var(--palette-background-b-9) r g b/.9);max-width:none}.CurveTooltip_popper__inKjq .MuiTooltip-tooltip.CurveTooltip_tooltip__8f67C.MuiTooltip-tooltipPlacementBottom{margin-top:4px}.CurveTooltip_popper__inKjq .MuiTooltip-tooltip.CurveTooltip_tooltip__8f67C.MuiTooltip-tooltipPlacementTop{margin-bottom:4px}.CurveTooltip_content__OY7AI{display:flex;flex-direction:column;gap:4px;padding:4px 0;white-space:nowrap}.CurveTooltip_title__dzymJ{align-items:center;display:flex;gap:4px;margin-bottom:4px}.CurveTooltip_titleBar__XcI5e{background:var(--palette-primary-text-6);border-radius:1px;flex-shrink:0;height:14px;width:2px}.CurveTooltip_row__2zHX2{align-items:baseline;display:flex;gap:4px}.CurveTooltip_row__2zHX2 .CurveTooltip_rowUnit__MCGr4{line-height:18px}");export{t as default};
|
|
2
|
+
//# sourceMappingURL=CurveTooltip.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,aAAa,sDAAyD;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/CurveTooltip/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
@@ -7,6 +7,7 @@ declare global {
|
|
|
7
7
|
interface Window {
|
|
8
8
|
xprops?: Record<string, any>;
|
|
9
9
|
xpropsOnProps?: (props: any) => void;
|
|
10
|
+
xpropsOnUnmount?: () => void;
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
export declare function IsolatedPage({ ...restProps }: IsolatedPageProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IsolatedPage.d.ts","sourceRoot":"","sources":["../../../../src/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IsolatedPage.d.ts","sourceRoot":"","sources":["../../../../src/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.tsx"],"names":[],"mappings":"AAgEA,eAAO,MAAM,YAAY,QAAS,OAAO,KAAG,OAU3C,CAAC;AAQF,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAO5D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC;AAEF,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC7B,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;QACrC,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;KAC9B;CACF;AAED,wBAAgB,YAAY,CAAC,EAAE,GAAG,SAAS,EAAE,EAAE,iBAAiB,2CAmF/D"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import r from"@babel/runtime/helpers/slicedToArray";import e from"@babel/runtime/helpers/extends";import t from"@babel/runtime/helpers/defineProperty";import{useRef as
|
|
1
|
+
import r from"@babel/runtime/helpers/slicedToArray";import e from"@babel/runtime/helpers/extends";import t from"@babel/runtime/helpers/defineProperty";import{useRef as n,useState as o,useCallback as a,useEffect as i,useLayoutEffect as c}from"react";import{isEqual as p}from"lodash";import l from"../../LoadingIndicator/LoadingIndicator.js";import s from"./IsolatedPage.module.css.js";import{jsxs as u,jsx as f}from"react/jsx-runtime";var d;function m(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function v(r){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?m(Object(n),!0).forEach((function(e){t(r,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}))}return r}var O=/(^|[\^~>=\s])18\./,b=function(r){var e,t,n=null==r?void 0:r.package;if(!n)return!0;var o=null===(e=n.package_json)||void 0===e||null===(t=e.dependencies)||void 0===t?void 0:t.react;return!("string"==typeof o&&O.test(o))},y="data-corva-app-iframe",g=(t(d={},"data-corva-app-iframe",!0),t(d,"data-testid","isolatedAppContainer"),d);function P(t){var d,m,O=e({},t),y=n(null),P=n(null),j=o(!0),h=r(j,2),w=h[0],x=h[1],_=a((function(){x(!1)}),[]),I=function(r,e){if(r){var t=!r.xprops,n=!function(r,e){if(r===e)return!0;if(!r)return!1;var t,n,o=Object.keys(r),a=Object.keys(e);if(o.length!==a.length)return!1;for(var i=0,c=a;i<c.length;i++){var l=c[i];if(!Object.prototype.hasOwnProperty.call(r,l))return!1;if(!((t=r[l])===(n=e[l])||"function"==typeof t&&"function"==typeof n||p(t,n)))return!1}return!0}(P.current||{},e);if(r.xprops=v({},e),P.current=e,(t||n)&&r.xpropsOnProps)try{r.xpropsOnProps(e)}catch(r){console.debug("[IsolatedPage] xpropsOnProps was not set yet:",r)}}};return i((function(){try{var r,e=null===(r=y.current)||void 0===r?void 0:r.contentWindow;I(e,O)}catch(r){console.error("[IsolatedPage] Error accessing iframe contentWindow:",r)}})),c((function(){return function(){try{var r,e,t=null===(r=y.current)||void 0===r?void 0:r.contentWindow;null==t||null===(e=t.xpropsOnUnmount)||void 0===e||e.call(t),t&&t.xprops&&delete t.xprops}catch(r){console.error("[IsolatedPage] Error cleaning up xprops:",r)}P.current=null,y.current=null}}),[]),u("div",{className:s.container,children:[w&&f(l,{}),f("iframe",v({ref:y,src:(d=O.app,m=window.__DC_REACT17_ISOLATED_PAGE_PATH__,m&&b(d)?m:"/DevCenterIsolatedAppPage.html"),onLoad:_,className:s.iframe},g))]})}export{y as APP_IFRAME_ATTRIBUTE,P as IsolatedPage,b as isReact17App};
|
|
2
2
|
//# sourceMappingURL=IsolatedPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IsolatedPage.js","sources":["../../../../src/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.tsx"],"sourcesContent":["// Ultra-minimal, same-origin isolation helper. Used to isolate DC apps from the parent page.\n//\n// Usage:\n// <IsolatedPage currentUser={user} onSettingsChange={fn} isFeatEnabled={false} />\n//\n// Inside isolated page:\n// window.xpropsOnProps = (props) => { /* handle updates */ };\n// window.xprops.onSettingsChange(payload);\n//\n// Notes:\n// - Path is hardcoded to `/DevCenterIsolatedAppPage.html`.\n// - Client sets `window.xpropsOnProps` function directly (separate from xprops data).\n// - `IsolatedPage` calls `window.xpropsOnProps` when props change (if it exists).\n// - On unmount: xprops deleted, iframe set to about:blank.\n// - Uses a callback-identity-aware deep equality check (see `areXPropsEqual` below) to avoid\n// unnecessary `xpropsOnProps` fires.\n\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { isEqual } from 'lodash';\nimport LoadingIndicator from '~/components/LoadingIndicator';\nimport styles from './IsolatedPage.module.css';\n\n// Callbacks arrive with a new identity every parent render, so comparing them would fire\n// `xpropsOnProps` into the iframe on every benign re-render. They are safe to treat as equal\n// because the iframe always reads the latest function from `window.xprops`, which `publishProps`\n// replaces unconditionally and `useXProps` dereferences at call time.\nconst isXPropEqual = (a: unknown, b: unknown): boolean => {\n if (a === b) return true;\n if (typeof a === 'function' && typeof b === 'function') return true;\n return isEqual(a, b);\n};\n\nconst areXPropsEqual = (\n prev: Record<string, unknown> | null,\n next: Record<string, unknown>\n): boolean => {\n if (prev === next) return true;\n if (!prev) return false;\n const prevKeys = Object.keys(prev);\n const nextKeys = Object.keys(next);\n if (prevKeys.length !== nextKeys.length) return false;\n for (const key of nextKeys) {\n if (!Object.prototype.hasOwnProperty.call(prev, key)) return false;\n if (!isXPropEqual(prev[key], next[key])) return false;\n }\n return true;\n};\n\nconst ISOLATED_PAGE_PATH = '/DevCenterIsolatedAppPage.html';\n\n// [REACT-18-MIGRATION-TAG] Per-app React version (PLT-3099): under a React-18 host an isolated app\n// must run in a React-17 iframe realm unless it is known to be React-18-ready. Legacy builds carry\n// no `package.package_json.dependencies.react` at all (the field predates the migration and is\n// absent even in the packages API), so React-17-ness cannot be positively detected — everything\n// before the migration is React 17. Therefore treat \"does not explicitly declare React 18\" as\n// React 17 and route it to `/r17/`; only an explicit React-18 declaration (present on new builds,\n// filled in by the host's package_json enrichment) keeps the app on the default React-18 iframe.\n// The host opts in by setting `window.__DC_REACT17_ISOLATED_PAGE_PATH__` to a SAME-ORIGIN path that\n// serves a React-17 build of the iframe entry (same-origin is required — the xprops bridge below\n// uses direct `contentWindow.xprops`, which the browser blocks cross-origin). Remove once all apps\n// are on React 18.\nconst REACT_18_DECLARATION_REGEX = /(^|[\\^~>=\\s])18\\./;\n\nexport const isReact17App = (app: unknown): boolean => {\n const pkg = (app as { package?: { package_json?: { dependencies?: Record<string, string> } } })\n ?.package;\n // No package at all = a legacy build with no React-18 declaration → route to /r17/. A React-18\n // app always carries a package_json declaring react 18 (host package_json enrichment), so a\n // missing package can never be a detectable React-18 app; default unknown/legacy to React 17.\n if (!pkg) return true;\n\n const declared = pkg.package_json?.dependencies?.react;\n return !(typeof declared === 'string' && REACT_18_DECLARATION_REGEX.test(declared));\n};\n\nconst getIsolatedPagePath = (app: unknown): string => {\n const react17Path = (window as any).__DC_REACT17_ISOLATED_PAGE_PATH__;\n if (react17Path && isReact17App(app)) return react17Path;\n return ISOLATED_PAGE_PATH;\n};\n\nexport const APP_IFRAME_ATTRIBUTE = 'data-corva-app-iframe';\n\nconst IFRAME_ATTRIBUTES = {\n [APP_IFRAME_ATTRIBUTE]: true,\n 'data-testid': 'isolatedAppContainer',\n} as Record<string, boolean | string>;\n\nexport type IsolatedPageProps = {\n [key: string]: any; // forwarded as xprops\n};\n\ndeclare global {\n interface Window {\n xprops?: Record<string, any>;\n xpropsOnProps?: (props: any) => void;\n }\n}\n\nexport function IsolatedPage({ ...restProps }: IsolatedPageProps) {\n const iframeRef = useRef<HTMLIFrameElement | null>(null);\n const lastPropsSnapshotRef = useRef<Record<string, any> | null>(null);\n const [isLoading, setIsLoading] = useState(true);\n\n const handleIframeLoad = useCallback(() => {\n setIsLoading(false);\n }, []);\n\n /**\n * Inject or update props into iframe window.xprops.\n * Calls window.xpropsOnProps callback only if props changed (deep check).\n */\n const publishProps = (\n targetWindow: (Window & { xprops?: any; xpropsOnProps?: (props: any) => void }) | null,\n newProps: Record<string, any>\n ) => {\n if (!targetWindow) return;\n\n const isInitialSet = !targetWindow.xprops;\n const previousSnapshot = lastPropsSnapshotRef.current || {};\n const propsChanged = !areXPropsEqual(previousSnapshot, newProps);\n\n // Unconditional, and outside the fire check below: suppressing the iframe re-render must not\n // leave stale callbacks on the object the DC app dereferences on every user action.\n targetWindow.xprops = { ...newProps };\n lastPropsSnapshotRef.current = newProps;\n\n // Call xpropsOnProps callback if it exists (on initial set or when props changed)\n if ((isInitialSet || propsChanged) && targetWindow.xpropsOnProps) {\n try {\n targetWindow.xpropsOnProps(newProps);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.debug('[IsolatedPage] xpropsOnProps was not set yet:', error);\n }\n }\n };\n\n // Try to set/update xprops whenever props change (including initial mount)\n useEffect(() => {\n try {\n const win = iframeRef.current?.contentWindow as\n | (Window & { xprops?: any; xpropsOnProps?: (props: any) => void })\n | null;\n publishProps(win, restProps);\n } catch (error) {\n // contentWindow might not be accessible yet, will retry on next prop change\n console.error('[IsolatedPage] Error accessing iframe contentWindow:', error);\n }\n });\n\n // Cleanup on unmount\n useEffect(() => {\n return () => {\n try {\n const win = iframeRef.current?.contentWindow as (Window & { xprops?: any }) | null;\n if (win && win.xprops) delete (win as any).xprops;\n } catch (error) {\n console.error('[IsolatedPage] Error cleaning up xprops:', error);\n }\n lastPropsSnapshotRef.current = null;\n const iframeElement = iframeRef.current;\n if (iframeElement) {\n try {\n iframeElement.src = 'about:blank';\n } catch (error) {\n console.error('[IsolatedPage] Error setting iframe src to about:blank:', error);\n }\n }\n iframeRef.current = null;\n };\n }, []);\n\n return (\n <div className={styles.container}>\n {isLoading && <LoadingIndicator />}\n <iframe\n ref={iframeRef}\n src={getIsolatedPagePath(restProps.app)}\n onLoad={handleIframeLoad}\n className={styles.iframe}\n {...IFRAME_ATTRIBUTES}\n />\n </div>\n );\n}\n"],"names":["REACT_18_DECLARATION_REGEX","isReact17App","app","_pkg$package_json","_pkg$package_json$dep","pkg","package","declared","package_json","dependencies","react","test","APP_IFRAME_ATTRIBUTE","IFRAME_ATTRIBUTES","_defineProperty","_IFRAME_ATTRIBUTES","IsolatedPage","_ref","react17Path","restProps","_extends","iframeRef","useRef","lastPropsSnapshotRef","useState","_useState2","_slicedToArray","_useState","isLoading","setIsLoading","handleIframeLoad","useCallback","publishProps","targetWindow","newProps","isInitialSet","xprops","propsChanged","prev","next","a","b","prevKeys","Object","keys","nextKeys","length","_i","_nextKeys","key","prototype","hasOwnProperty","call","isEqual","areXPropsEqual","current","xpropsOnProps","error","console","debug","useEffect","_iframeRef$current","win","contentWindow","_iframeRef$current2","iframeElement","src","_jsxs","className","styles","container","children","_jsx","LoadingIndicator","_objectSpread","ref","window","__DC_REACT17_ISOLATED_PAGE_PATH__","onLoad","iframe"],"mappings":"k+BA0BA,IAmCMA,EAA6B,oBAEtBC,EAAe,SAACC,GAA0B,IAAAC,EAAAC,EAC/CC,EAAOH,aAAAA,EAAAA,EACTI,QAIJ,IAAKD,EAAK,OAAO,EAEjB,IAAME,UAAWF,EAAAA,EAAIG,2BAAJ,UAAAL,EAAkBM,oBAAlB,IAAAL,SAAAA,EAAgCM,MACjD,QAA6B,iBAAbH,GAAyBP,EA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IAAAC,EACIC,EAAuB,QAAjBzC,EAAAA,EAAUkC,eAAO,IAAAM,OAAA,EAAjBA,EAAmBE,cAG/B/B,EAAa8B,EAAK3C,EAIpB,CAHE,MAAOsC,GAEPC,QAAQD,MAAM,uDAAwDA,EACxE,CACF,IAGAG,GAAU,WACR,OAAO,WACL,IAAI,IAAAI,EACIF,EAAuB,QAAjBzC,EAAAA,EAAUkC,eAAO,IAAAS,OAAA,EAAjBA,EAAmBD,cAC3BD,GAAOA,EAAI1B,eAAgB0B,EAAY1B,MAG7C,CAFE,MAAOqB,GACPC,QAAQD,MAAM,2CAA4CA,EAC5D,CACAlC,EAAqBgC,QAAU,KAC/B,IAAMU,EAAgB5C,EAAUkC,QAChC,GAAIU,EACF,IACEA,EAAcC,IAAM,aAGtB,CAFE,MAAOT,GACPC,QAAQD,MAAM,0DAA2DA,EAC3E,CAEFpC,EAAUkC,QAAU,KAEvB,GAAE,IAGDY,EAAA,MAAA,CAAKC,UAAWC,EAAOC,UAAUC,SAAA,CAC9B3C,GAAa4C,EAACC,MACfD,EAAA,SAAAE,EAAA,CACEC,IAAKtD,EACL6C,KAvGqBhE,EAuGIiB,EAAUjB,IAtGnCgB,EAAe0D,OAAeC,kCAChC3D,GAAejB,EAAaC,GAAagB,EA7BpB,kCAmInB4D,OAAQhD,EACRsC,UAAWC,EAAOU,QACdlE,MAIZ"}
|
|
1
|
+
{"version":3,"file":"IsolatedPage.js","sources":["../../../../src/components/DevCenter/IsolatedDevCenterAppContainer/IsolatedPage.tsx"],"sourcesContent":["// Ultra-minimal, same-origin isolation helper. Used to isolate DC apps from the parent page.\n//\n// Usage:\n// <IsolatedPage currentUser={user} onSettingsChange={fn} isFeatEnabled={false} />\n//\n// Inside isolated page:\n// window.xpropsOnProps = (props) => { /* handle updates */ };\n// window.xprops.onSettingsChange(payload);\n//\n// Notes:\n// - Path is hardcoded to `/DevCenterIsolatedAppPage.html`.\n// - Client sets `window.xpropsOnProps` function directly (separate from xprops data).\n// - `IsolatedPage` calls `window.xpropsOnProps` when props change (if it exists).\n// - Client sets `window.xpropsOnUnmount` to unmount its React root; `IsolatedPage` calls it\n// while the iframe is still in the document, then deletes xprops.\n// - Uses a callback-identity-aware deep equality check (see `areXPropsEqual` below) to avoid\n// unnecessary `xpropsOnProps` fires.\n\nimport { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { isEqual } from 'lodash';\nimport LoadingIndicator from '~/components/LoadingIndicator';\nimport styles from './IsolatedPage.module.css';\n\n// Callbacks arrive with a new identity every parent render, so comparing them would fire\n// `xpropsOnProps` into the iframe on every benign re-render. They are safe to treat as equal\n// because the iframe always reads the latest function from `window.xprops`, which `publishProps`\n// replaces unconditionally and `useXProps` dereferences at call time.\nconst isXPropEqual = (a: unknown, b: unknown): boolean => {\n if (a === b) return true;\n if (typeof a === 'function' && typeof b === 'function') return true;\n return isEqual(a, b);\n};\n\nconst areXPropsEqual = (\n prev: Record<string, unknown> | null,\n next: Record<string, unknown>\n): boolean => {\n if (prev === next) return true;\n if (!prev) return false;\n const prevKeys = Object.keys(prev);\n const nextKeys = Object.keys(next);\n if (prevKeys.length !== nextKeys.length) return false;\n for (const key of nextKeys) {\n if (!Object.prototype.hasOwnProperty.call(prev, key)) return false;\n if (!isXPropEqual(prev[key], next[key])) return false;\n }\n return true;\n};\n\nconst ISOLATED_PAGE_PATH = '/DevCenterIsolatedAppPage.html';\n\n// [REACT-18-MIGRATION-TAG] Per-app React version (PLT-3099): under a React-18 host an isolated app\n// must run in a React-17 iframe realm unless it is known to be React-18-ready. Legacy builds carry\n// no `package.package_json.dependencies.react` at all (the field predates the migration and is\n// absent even in the packages API), so React-17-ness cannot be positively detected — everything\n// before the migration is React 17. Therefore treat \"does not explicitly declare React 18\" as\n// React 17 and route it to `/r17/`; only an explicit React-18 declaration (present on new builds,\n// filled in by the host's package_json enrichment) keeps the app on the default React-18 iframe.\n// The host opts in by setting `window.__DC_REACT17_ISOLATED_PAGE_PATH__` to a SAME-ORIGIN path that\n// serves a React-17 build of the iframe entry (same-origin is required — the xprops bridge below\n// uses direct `contentWindow.xprops`, which the browser blocks cross-origin). Remove once all apps\n// are on React 18.\nconst REACT_18_DECLARATION_REGEX = /(^|[\\^~>=\\s])18\\./;\n\nexport const isReact17App = (app: unknown): boolean => {\n const pkg = (app as { package?: { package_json?: { dependencies?: Record<string, string> } } })\n ?.package;\n // No package at all = a legacy build with no React-18 declaration → route to /r17/. A React-18\n // app always carries a package_json declaring react 18 (host package_json enrichment), so a\n // missing package can never be a detectable React-18 app; default unknown/legacy to React 17.\n if (!pkg) return true;\n\n const declared = pkg.package_json?.dependencies?.react;\n return !(typeof declared === 'string' && REACT_18_DECLARATION_REGEX.test(declared));\n};\n\nconst getIsolatedPagePath = (app: unknown): string => {\n const react17Path = (window as any).__DC_REACT17_ISOLATED_PAGE_PATH__;\n if (react17Path && isReact17App(app)) return react17Path;\n return ISOLATED_PAGE_PATH;\n};\n\nexport const APP_IFRAME_ATTRIBUTE = 'data-corva-app-iframe';\n\nconst IFRAME_ATTRIBUTES = {\n [APP_IFRAME_ATTRIBUTE]: true,\n 'data-testid': 'isolatedAppContainer',\n} as Record<string, boolean | string>;\n\nexport type IsolatedPageProps = {\n [key: string]: any; // forwarded as xprops\n};\n\ndeclare global {\n interface Window {\n xprops?: Record<string, any>;\n xpropsOnProps?: (props: any) => void;\n xpropsOnUnmount?: () => void;\n }\n}\n\nexport function IsolatedPage({ ...restProps }: IsolatedPageProps) {\n const iframeRef = useRef<HTMLIFrameElement | null>(null);\n const lastPropsSnapshotRef = useRef<Record<string, any> | null>(null);\n const [isLoading, setIsLoading] = useState(true);\n\n const handleIframeLoad = useCallback(() => {\n setIsLoading(false);\n }, []);\n\n /**\n * Inject or update props into iframe window.xprops.\n * Calls window.xpropsOnProps callback only if props changed (deep check).\n */\n const publishProps = (\n targetWindow: (Window & { xprops?: any; xpropsOnProps?: (props: any) => void }) | null,\n newProps: Record<string, any>\n ) => {\n if (!targetWindow) return;\n\n const isInitialSet = !targetWindow.xprops;\n const previousSnapshot = lastPropsSnapshotRef.current || {};\n const propsChanged = !areXPropsEqual(previousSnapshot, newProps);\n\n // Unconditional, and outside the fire check below: suppressing the iframe re-render must not\n // leave stale callbacks on the object the DC app dereferences on every user action.\n targetWindow.xprops = { ...newProps };\n lastPropsSnapshotRef.current = newProps;\n\n // Call xpropsOnProps callback if it exists (on initial set or when props changed)\n if ((isInitialSet || propsChanged) && targetWindow.xpropsOnProps) {\n try {\n targetWindow.xpropsOnProps(newProps);\n } catch (error) {\n // eslint-disable-next-line no-console\n console.debug('[IsolatedPage] xpropsOnProps was not set yet:', error);\n }\n }\n };\n\n // Try to set/update xprops whenever props change (including initial mount)\n useEffect(() => {\n try {\n const win = iframeRef.current?.contentWindow as\n | (Window & { xprops?: any; xpropsOnProps?: (props: any) => void })\n | null;\n publishProps(win, restProps);\n } catch (error) {\n // contentWindow might not be accessible yet, will retry on next prop change\n console.error('[IsolatedPage] Error accessing iframe contentWindow:', error);\n }\n });\n\n // Cleanup on unmount. A layout effect: React detaches the iframe ref before passive cleanups\n // run, and the app's own unmount must happen while the iframe is still in the document — the\n // listeners an app attached to window.top otherwise outlive the iframe and keep its realm alive.\n useLayoutEffect(() => {\n return () => {\n try {\n const win = iframeRef.current?.contentWindow as\n | (Window & { xprops?: any; xpropsOnUnmount?: () => void })\n | null;\n win?.xpropsOnUnmount?.();\n if (win && win.xprops) delete (win as any).xprops;\n } catch (error) {\n console.error('[IsolatedPage] Error cleaning up xprops:', error);\n }\n lastPropsSnapshotRef.current = null;\n iframeRef.current = null;\n };\n }, []);\n\n return (\n <div className={styles.container}>\n {isLoading && <LoadingIndicator />}\n <iframe\n ref={iframeRef}\n src={getIsolatedPagePath(restProps.app)}\n onLoad={handleIframeLoad}\n className={styles.iframe}\n {...IFRAME_ATTRIBUTES}\n />\n </div>\n );\n}\n"],"names":["REACT_18_DECLARATION_REGEX","isReact17App","app","_pkg$package_json","_pkg$package_json$dep","pkg","package","declared","package_json","dependencies","react","test","APP_IFRAME_ATTRIBUTE","IFRAME_ATTRIBUTES","_defineProperty","_IFRAME_ATTRIBUTES","IsolatedPage","_ref","react17Path","restProps","_extends","iframeRef","useRef","lastPropsSnapshotRef","useState","_useState2","_slicedToArray","_useState","isLoading","setIsLoading","handleIframeLoad","useCallback","publishProps","targetWindow","newProps","isInitialSet","xprops","propsChanged","prev","next","a","b","prevKeys","Object","keys","nextKeys","length","_i","_nextKeys","key","prototype","hasOwnProperty","call","isEqual","areXPropsEqual","current","xpropsOnProps","error","console","debug","useEffect","_iframeRef$current","win","contentWindow","useLayoutEffect","_iframeRef$current2","_win$xpropsOnUnmount","xpropsOnUnmount","_jsxs","className","styles","container","children","_jsx","LoadingIndicator","_objectSpread","ref","src","window","__DC_REACT17_ISOLATED_PAGE_PATH__","onLoad","iframe"],"mappings":"u/BA2BA,IAmCMA,EAA6B,oBAEtBC,EAAe,SAACC,GAA0B,IAAAC,EAAAC,EAC/CC,EAAOH,aAAAA,EAAAA,EACTI,QAIJ,IAAKD,EAAK,OAAO,EAEjB,IAAME,UAAWF,EAAAA,EAAIG,2BAAJ,UAAAL,EAAkBM,oBAAlB,IAAAL,SAAAA,EAAgCM,MACjD,QAA6B,iBAAbH,GAAyBP,EAA2BW,KAAKJ,GAC3E,EAQaK,EAAuB,wBAE9BC,UAF8B,yBAGV,GACxBC,EAAAC,EAAA,cAAe,wBACoBA,GAc9B,SAASC,EAAkDC,GAAA,IAzBrCf,EACrBgB,EAwB0BC,EAASC,EAAA,CAAA,EAAAH,GACnCI,EAAYC,EAAiC,MAC7CC,EAAuBD,EAAmC,MAC9BE,EAAAA,GAAS,GAAKC,EAAAC,EAAAC,EAAA,GAAzCC,EAASH,EAAA,GAAEI,EAAYJ,EAAA,GAExBK,EAAmBC,GAAY,WACnCF,GAAa,EACd,GAAE,IAMGG,EAAe,SACnBC,EACAC,GAEA,GAAKD,EAAL,CAEA,IAAME,GAAgBF,EAAaG,OAE7BC,GAzFa,SACrBC,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AA4CA,EAC5D,CACAlC,EAAqBgC,QAAU,KAC/BlC,EAAUkC,QAAU,KAEvB,GAAE,IAGDa,EAAA,MAAA,CAAKC,UAAWC,EAAOC,UAAUC,SAAA,CAC9B5C,GAAa6C,EAACC,MACfD,EAAA,SAAAE,EAAA,CACEC,IAAKvD,EACLwD,KArGqB3E,EAqGIiB,EAAUjB,IApGnCgB,EAAe4D,OAAeC,kCAChC7D,GAAejB,EAAaC,GAAagB,EA7BpB,kCAiInB8D,OAAQlD,EACRuC,UAAWC,EAAOW,QACdpE,MAIZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewCommentCursor.d.ts","sourceRoot":"","sources":["../../../src/components/NewCommentCursor/NewCommentCursor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NewCommentCursor.d.ts","sourceRoot":"","sources":["../../../src/components/NewCommentCursor/NewCommentCursor.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAgB,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEjE,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAE3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAQF,eAAO,MAAM,gBAAgB,kHA0C5B,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{forwardRef as e}from"react";import
|
|
1
|
+
import{forwardRef as e}from"react";import o from"classnames";import t from"./NewCommentCursor.scss.js";import{CurveTooltip as r}from"../CurveTooltip/CurveTooltip.js";import{jsx as i,jsxs as l}from"react/jsx-runtime";var d=e((function(e,d){var n=e.size,s=void 0===n?40:n,a=e.onClick,c=e.tooltip,m=e.className,C=e.testId,p=i("div",{ref:d,"data-testid":C,className:o(t.root,m),style:{width:s,height:s},onClick:a,children:l("svg",{width:.48839026568430455*s,height:.48839026568430455*s,viewBox:"0 0 8.75 8.75",fill:"none","aria-hidden":!0,children:[i("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 4.375C0 4.02982 0.279822 3.75 0.625 3.75H8.125C8.47018 3.75 8.75 4.02982 8.75 4.375C8.75 4.72018 8.47018 5 8.125 5H0.625C0.279822 5 0 4.72018 0 4.375Z",fill:"currentColor"}),i("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.375 0C4.72018 0 5 0.279822 5 0.625V8.125C5 8.47018 4.72018 8.75 4.375 8.75C4.02982 8.75 3.75 8.47018 3.75 8.125V0.625C3.75 0.279822 4.02982 0 4.375 0Z",fill:"currentColor"})]})});return c?i(r,{data:c,open:!0,isFullScreen:!1,placement:"bottom-start",children:p}):p}));export{d as NewCommentCursor};
|
|
2
2
|
//# sourceMappingURL=NewCommentCursor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewCommentCursor.js","sources":["../../../src/components/NewCommentCursor/NewCommentCursor.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport classNames from 'classnames';\n\nimport styles from './NewCommentCursor.scss';\n\nexport type NewCommentCursorProps = {\n size?: number;\n onClick?: () => void;\n\n className?: string;\n testId?: string;\n};\n\n// Figma's \"Vector\" plus glyph is sized relative to the pin (\"Union\", 17.916 units),\n// not the full 24px canvas the pin sits in (node 3119:21596, \"add-message-custom-fill\").\n// Our CSS-drawn pin fills the whole container, so the glyph scales off `size` directly\n// using that plus/pin ratio. Paths/viewBox below are exact Figma coordinates.\nconst GLYPH_RATIO = 8.75 / 17.916;\n\nexport const NewCommentCursor = forwardRef<HTMLDivElement, NewCommentCursorProps>(\n ({ size = 40, onClick, className, testId }, ref) => (\n
|
|
1
|
+
{"version":3,"file":"NewCommentCursor.js","sources":["../../../src/components/NewCommentCursor/NewCommentCursor.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport classNames from 'classnames';\n\nimport styles from './NewCommentCursor.scss';\nimport { CurveTooltip, CurveTooltipData } from '../CurveTooltip';\n\nexport type NewCommentCursorProps = {\n size?: number;\n onClick?: () => void;\n tooltip?: CurveTooltipData;\n\n className?: string;\n testId?: string;\n};\n\n// Figma's \"Vector\" plus glyph is sized relative to the pin (\"Union\", 17.916 units),\n// not the full 24px canvas the pin sits in (node 3119:21596, \"add-message-custom-fill\").\n// Our CSS-drawn pin fills the whole container, so the glyph scales off `size` directly\n// using that plus/pin ratio. Paths/viewBox below are exact Figma coordinates.\nconst GLYPH_RATIO = 8.75 / 17.916;\n\nexport const NewCommentCursor = forwardRef<HTMLDivElement, NewCommentCursorProps>(\n ({ size = 40, onClick, tooltip, className, testId }, ref) => {\n const cursor = (\n <div\n ref={ref}\n data-testid={testId}\n className={classNames(styles.root, className)}\n style={{ width: size, height: size }}\n onClick={onClick}\n >\n <svg\n width={size * GLYPH_RATIO}\n height={size * GLYPH_RATIO}\n viewBox=\"0 0 8.75 8.75\"\n fill=\"none\"\n aria-hidden\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M0 4.375C0 4.02982 0.279822 3.75 0.625 3.75H8.125C8.47018 3.75 8.75 4.02982 8.75 4.375C8.75 4.72018 8.47018 5 8.125 5H0.625C0.279822 5 0 4.72018 0 4.375Z\"\n fill=\"currentColor\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M4.375 0C4.72018 0 5 0.279822 5 0.625V8.125C5 8.47018 4.72018 8.75 4.375 8.75C4.02982 8.75 3.75 8.47018 3.75 8.125V0.625C3.75 0.279822 4.02982 0 4.375 0Z\"\n fill=\"currentColor\"\n />\n </svg>\n </div>\n );\n\n // isFullScreen: the DC variant resizes the app iframe on open, making a cursor-following tooltip loop.\n return tooltip ? (\n <CurveTooltip data={tooltip} open isFullScreen={false} placement=\"bottom-start\">\n {cursor}\n </CurveTooltip>\n ) : (\n cursor\n );\n }\n);\n"],"names":["NewCommentCursor","forwardRef","_ref","ref","_ref$size","size","onClick","tooltip","className","testId","cursor","_jsx","classNames","styles","root","style","width","height","children","_jsxs","viewBox","fill","fillRule","clipRule","d","CurveTooltip","data","open","isFullScreen","placement"],"mappings":"wNAmBA,IAEaA,EAAmBC,GAC9B,SAAAC,EAAqDC,GAAQ,IAAAC,EAAAF,EAA1DG,KAAAA,aAAO,GAAED,EAAEE,IAAAA,QAASC,IAAAA,QAASC,IAAAA,UAAWC,IAAAA,OACnCC,EACJC,EAAA,MAAA,CACER,IAAKA,EACL,cAAaM,EACbD,UAAWI,EAAWC,EAAOC,KAAMN,GACnCO,MAAO,CAAEC,MAAOX,EAAMY,OAAQZ,GAC9BC,QAASA,EAAQY,SAEjBC,EAAA,MAAA,CACEH,MAbU,mBAaHX,EACPY,OAdU,mBAcFZ,EACRe,QAAQ,gBACRC,KAAK,OACL,eAAW,EAAAH,SAEX,CAAAP,EAAA,OAAA,CACEW,SAAS,UACTC,SAAS,UACTC,EAAE,4JACFH,KAAK,iBAEPV,EAAA,OAAA,CACEW,SAAS,UACTC,SAAS,UACTC,EAAE,4JACFH,KAAK,sBAOb,OAAOd,EACLI,EAACc,EAAY,CAACC,KAAMnB,EAASoB,MAAI,EAACC,cAAc,EAAOC,UAAU,eAAcX,SAC5ER,IAGHA,CAEJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NewCommentCursor.test.d.ts","sourceRoot":"","sources":["../../../../src/components/NewCommentCursor/__tests__/NewCommentCursor.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import o from"@babel/runtime/helpers/objectWithoutProperties";import s from"@babel/runtime/helpers/defineProperty";import c from"classnames";import{isEqual as n}from"lodash";import{useRef as i,useEffect as t}from"react";import{parseColor as r,getLuminance as e}from"../utils.js";import{paletteColors as m}from"./constants.js";import p from"./Swatches.scss.js";import{CheckSmallIcon as u}from"../../../icons/iconParkIcons.js";import"../../../icons/customIcons/icons/AddMessage.js";import"../../../icons/customIcons/icons/DragOne.js";import"../../../icons/customIcons/icons/Attention.js";import"../../../icons/customIcons/icons/Collapse.js";import"../../../icons/customIcons/icons/Dashboard.js";import"../../../icons/customIcons/icons/Expand.js";import"../../../icons/customIcons/icons/FolderClosed.js";import"../../../icons/customIcons/icons/FolderClosedFilled.js";import"../../../icons/customIcons/icons/FolderOpened.js";import"../../../icons/customIcons/icons/GreaterOrEqual.js";import"../../../icons/customIcons/icons/LessOrEqual.js";import"../../../icons/customIcons/icons/Search.js";import"../../../icons/customIcons/icons/SearchOne.js";import"../../../icons/customIcons/icons/Wellhub.js";import"../../../icons/customIcons/icons/MultiRuler.js";import"../../../icons/customIcons/icons/Checkbox.js";import"../../../icons/customIcons/icons/CheckboxChecked.js";import"../../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../../icons/customIcons/icons/Radio.js";import"../../../icons/customIcons/icons/RadioChecked.js";import"../../../icons/customIcons/icons/SimulFrac.js";import"../../../icons/customIcons/icons/ZipperFrac.js";import"../../../icons/customIcons/icons/CautionFilled.js";import"../../../icons/customIcons/icons/InfoRounded.js";import"../../../icons/customIcons/icons/FlameFilled.js";import"../../../icons/customIcons/icons/MoreApp.js";import"../../../icons/customIcons/icons/Pad.js";import"../../../icons/customIcons/icons/DrilloutUnit.js";import"../../../icons/customIcons/icons/FracFleet.js";import"../../../icons/customIcons/icons/Global.js";import"../../../icons/customIcons/icons/Program.js";import"../../../icons/customIcons/icons/Rig.js";import"../../../icons/customIcons/icons/Well.js";import"../../../icons/customIcons/icons/Gap.js";import"../../../icons/customIcons/icons/Pin.js";import"../../../icons/customIcons/icons/PinOne.js";import"../../../icons/customIcons/icons/PinOneCrossed.js";import"../../../icons/customIcons/icons/CloseOneFilled.js";import"../../../icons/customIcons/icons/AttentionFilled.js";import"../../../icons/customIcons/icons/CheckOneFilled.js";import"../../../icons/customIcons/icons/Archive.js";import"../../../icons/customIcons/icons/ArchiveCancel.js";import"../../../icons/customIcons/icons/Unarchive.js";import"../../../icons/customIcons/icons/Archived.js";import"../../../icons/customIcons/icons/InterventionUnit.js";import"../../../icons/customIcons/icons/CloudDelete.js";import"../../../icons/customIcons/icons/Lasso.js";import"../../../icons/customIcons/icons/Radius.js";import"../../../icons/customIcons/icons/ErrorOps.js";import"../../../icons/customIcons/icons/DataTypeOps.js";import"../../../icons/customIcons/icons/FalsePositiveOps.js";import"../../../icons/customIcons/icons/CalibrationOps.js";import"../../../icons/customIcons/icons/CriticalOps.js";import"../../../icons/customIcons/icons/Company.js";import"../../../icons/customIcons/icons/ArchiveOne.js";import"../../../icons/customIcons/icons/ParseBotFusion.js";import"../../../icons/customIcons/icons/Connect.js";import"../../../icons/customIcons/icons/PuzzleOne.js";import"../../../icons/customIcons/icons/Feed.js";import"../../../icons/customIcons/icons/Prompt.js";import"../../../icons/customIcons/icons/Companies.js";import"../../../icons/customIcons/icons/ClipboardAi.js";import"../../../icons/customIcons/icons/Key.js";import"../../../icons/customIcons/icons/AtSignCrossed.js";import"../../../icons/customIcons/icons/MappingManual.js";import"../../../icons/customIcons/icons/Mapping.js";import"../../../icons/customIcons/icons/Metrics.js";import"../../../icons/customIcons/icons/Drops.js";import"../../../icons/customIcons/icons/ClipboardSearch.js";import"../../../icons/customIcons/icons/Template.js";import"../../../icons/customIcons/icons/ClipboardMetrics.js";import"../../../icons/customIcons/icons/ClipboardBuilder.js";import"../../../icons/customIcons/icons/UnitConversion.js";import"../../../icons/customIcons/icons/NPT.js";import"../../../icons/customIcons/icons/GuidedFrac.js";import{jsx as a}from"react/jsx-runtime";var l=["a"];function j(o,s){var c=Object.keys(o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);s&&(n=n.filter((function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable}))),c.push.apply(c,n)}return c}function I(o){for(var c=1;c<arguments.length;c++){var n=null!=arguments[c]?arguments[c]:{};c%2?j(Object(n),!0).forEach((function(c){s(o,c,n[c])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(s){Object.defineProperty(o,s,Object.getOwnPropertyDescriptor(n,s))}))}return o}var d=function(s){var j=s.value,d=s.onChange,b=s.addTransparent,f=s.autoFocus,h=s.onAutoFocus,O=i([]),v=I(I({},j),{},{a:1}),C=0===j.a,g=b?m.toSpliced(
|
|
1
|
+
import o from"@babel/runtime/helpers/objectWithoutProperties";import s from"@babel/runtime/helpers/defineProperty";import c from"classnames";import{isEqual as n}from"lodash";import{useRef as i,useEffect as t}from"react";import{parseColor as r,getLuminance as e}from"../utils.js";import{paletteColors as m}from"./constants.js";import p from"./Swatches.scss.js";import{CheckSmallIcon as u}from"../../../icons/iconParkIcons.js";import"../../../icons/customIcons/icons/AddMessage.js";import"../../../icons/customIcons/icons/DragOne.js";import"../../../icons/customIcons/icons/Attention.js";import"../../../icons/customIcons/icons/Collapse.js";import"../../../icons/customIcons/icons/Dashboard.js";import"../../../icons/customIcons/icons/Expand.js";import"../../../icons/customIcons/icons/FolderClosed.js";import"../../../icons/customIcons/icons/FolderClosedFilled.js";import"../../../icons/customIcons/icons/FolderOpened.js";import"../../../icons/customIcons/icons/GreaterOrEqual.js";import"../../../icons/customIcons/icons/LessOrEqual.js";import"../../../icons/customIcons/icons/Search.js";import"../../../icons/customIcons/icons/SearchOne.js";import"../../../icons/customIcons/icons/Wellhub.js";import"../../../icons/customIcons/icons/MultiRuler.js";import"../../../icons/customIcons/icons/Checkbox.js";import"../../../icons/customIcons/icons/CheckboxChecked.js";import"../../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../../icons/customIcons/icons/Radio.js";import"../../../icons/customIcons/icons/RadioChecked.js";import"../../../icons/customIcons/icons/SimulFrac.js";import"../../../icons/customIcons/icons/ZipperFrac.js";import"../../../icons/customIcons/icons/CautionFilled.js";import"../../../icons/customIcons/icons/InfoRounded.js";import"../../../icons/customIcons/icons/FlameFilled.js";import"../../../icons/customIcons/icons/MoreApp.js";import"../../../icons/customIcons/icons/Pad.js";import"../../../icons/customIcons/icons/DrilloutUnit.js";import"../../../icons/customIcons/icons/FracFleet.js";import"../../../icons/customIcons/icons/Global.js";import"../../../icons/customIcons/icons/Program.js";import"../../../icons/customIcons/icons/Rig.js";import"../../../icons/customIcons/icons/Well.js";import"../../../icons/customIcons/icons/Gap.js";import"../../../icons/customIcons/icons/Pin.js";import"../../../icons/customIcons/icons/PinOne.js";import"../../../icons/customIcons/icons/PinOneCrossed.js";import"../../../icons/customIcons/icons/CloseOneFilled.js";import"../../../icons/customIcons/icons/AttentionFilled.js";import"../../../icons/customIcons/icons/CheckOneFilled.js";import"../../../icons/customIcons/icons/Archive.js";import"../../../icons/customIcons/icons/ArchiveCancel.js";import"../../../icons/customIcons/icons/Unarchive.js";import"../../../icons/customIcons/icons/Archived.js";import"../../../icons/customIcons/icons/InterventionUnit.js";import"../../../icons/customIcons/icons/CloudDelete.js";import"../../../icons/customIcons/icons/Lasso.js";import"../../../icons/customIcons/icons/Radius.js";import"../../../icons/customIcons/icons/ErrorOps.js";import"../../../icons/customIcons/icons/DataTypeOps.js";import"../../../icons/customIcons/icons/FalsePositiveOps.js";import"../../../icons/customIcons/icons/CalibrationOps.js";import"../../../icons/customIcons/icons/CriticalOps.js";import"../../../icons/customIcons/icons/Company.js";import"../../../icons/customIcons/icons/ArchiveOne.js";import"../../../icons/customIcons/icons/ParseBotFusion.js";import"../../../icons/customIcons/icons/Connect.js";import"../../../icons/customIcons/icons/PuzzleOne.js";import"../../../icons/customIcons/icons/Feed.js";import"../../../icons/customIcons/icons/Prompt.js";import"../../../icons/customIcons/icons/Companies.js";import"../../../icons/customIcons/icons/ClipboardAi.js";import"../../../icons/customIcons/icons/Key.js";import"../../../icons/customIcons/icons/AtSignCrossed.js";import"../../../icons/customIcons/icons/MappingManual.js";import"../../../icons/customIcons/icons/Mapping.js";import"../../../icons/customIcons/icons/Metrics.js";import"../../../icons/customIcons/icons/Drops.js";import"../../../icons/customIcons/icons/ClipboardSearch.js";import"../../../icons/customIcons/icons/Template.js";import"../../../icons/customIcons/icons/ClipboardMetrics.js";import"../../../icons/customIcons/icons/ClipboardBuilder.js";import"../../../icons/customIcons/icons/UnitConversion.js";import"../../../icons/customIcons/icons/NPT.js";import"../../../icons/customIcons/icons/GuidedFrac.js";import{jsx as a}from"react/jsx-runtime";var l=["a"];function j(o,s){var c=Object.keys(o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);s&&(n=n.filter((function(s){return Object.getOwnPropertyDescriptor(o,s).enumerable}))),c.push.apply(c,n)}return c}function I(o){for(var c=1;c<arguments.length;c++){var n=null!=arguments[c]?arguments[c]:{};c%2?j(Object(n),!0).forEach((function(c){s(o,c,n[c])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(s){Object.defineProperty(o,s,Object.getOwnPropertyDescriptor(n,s))}))}return o}var d=function(s){var j=s.value,d=s.onChange,b=s.addTransparent,f=s.autoFocus,h=s.onAutoFocus,O=i([]),v=I(I({},j),{},{a:1}),C=0===j.a,g=b?m.toSpliced(11,1,"#FFFFFF00"):m,F=function(s){var c=r(s),i=c.a,t=I(I({},o(c,l)),{},{a:1}),e=0===i;return n(v,t)&&!e&&!C||C&&e},P=g.findIndex(F);t((function(){if(f){var o=-1===P?0:P,s=O.current[o];s&&(s.focus({preventScroll:!0}),null==h||h())}}),[f,h,P]);var k=function(o,s){var c;(d(r(g[o])),s)&&(null===(c=O.current[o])||void 0===c||c.focus({preventScroll:!0}))},y=function(o){var s,c=Number(o.currentTarget.dataset.index);switch(o.key){case"ArrowRight":s=(c+1)%g.length;break;case"ArrowLeft":s=(c-1+g.length)%g.length;break;case"ArrowDown":s=(c+12)%g.length;break;case"ArrowUp":s=(c-12+g.length)%g.length;break;case"Home":s=0;break;case"End":s=g.length-1;break;case"Enter":case" ":return o.preventDefault(),void k(c,!1);default:return}"number"==typeof s&&(o.preventDefault(),k(s,!0))};return a("div",{className:p.root,role:"radiogroup","aria-label":"Color palette",children:g.map((function(o,s){var n=r(o),i=e(o)>.97,t=0===n.a,m=F(o);return a("div",{ref:function(o){O.current[s]=o},className:c(p.swatch,m&&p.selected,t&&p.transparent,(i||t)&&p.darkAccent),onClick:function(){return d(n)},onKeyDown:y,style:t?void 0:{background:o},role:"radio","aria-checked":m,"aria-label":t?"Transparent":o.toUpperCase(),tabIndex:m||-1===P&&0===s?0:-1,"data-index":s,children:a(u,{size:14,className:p.icon})},o)}))})};export{d as Swatches};
|
|
2
2
|
//# sourceMappingURL=Swatches.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Swatches.js","sources":["../../../../src/componentsV2/ColorPicker/Swatches/Swatches.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport { isEqual } from 'lodash';\nimport { KeyboardEventHandler, useEffect, useRef } from 'react';\n\nimport { ColorChannels, getLuminance, parseColor } from '../utils';\n\nimport { paletteColors } from './constants';\n\nimport styles from './Swatches.scss';\n\nimport { CheckSmallIcon } from '~/icons';\n\nexport type SwatchesProps = {\n /**\n * Hex or rgba, with or without alpha\n */\n value: ColorChannels;\n onChange: (color: ColorChannels) => void;\n addTransparent?: boolean;\n autoFocus?: boolean;\n onAutoFocus?: () => void;\n};\n\nconst colorsPerRow = 12;\n\nexport const Swatches = ({\n value,\n onChange,\n addTransparent,\n autoFocus,\n onAutoFocus,\n}: SwatchesProps) => {\n const swatchRefs = useRef<Array<HTMLDivElement | null>>([]);\n const opaqueValue = { ...value, a: 1 };\n const isValueTransparent = value.a === 0;\n\n const colors = addTransparent\n ? paletteColors.toSpliced(
|
|
1
|
+
{"version":3,"file":"Swatches.js","sources":["../../../../src/componentsV2/ColorPicker/Swatches/Swatches.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport { isEqual } from 'lodash';\nimport { KeyboardEventHandler, useEffect, useRef } from 'react';\n\nimport { ColorChannels, getLuminance, parseColor } from '../utils';\n\nimport { paletteColors } from './constants';\n\nimport styles from './Swatches.scss';\n\nimport { CheckSmallIcon } from '~/icons';\n\nexport type SwatchesProps = {\n /**\n * Hex or rgba, with or without alpha\n */\n value: ColorChannels;\n onChange: (color: ColorChannels) => void;\n addTransparent?: boolean;\n autoFocus?: boolean;\n onAutoFocus?: () => void;\n};\n\nconst colorsPerRow = 12;\n\nexport const Swatches = ({\n value,\n onChange,\n addTransparent,\n autoFocus,\n onAutoFocus,\n}: SwatchesProps) => {\n const swatchRefs = useRef<Array<HTMLDivElement | null>>([]);\n const opaqueValue = { ...value, a: 1 };\n const isValueTransparent = value.a === 0;\n\n const colors = addTransparent\n ? paletteColors.toSpliced(colorsPerRow - 1, 1, '#FFFFFF00')\n : paletteColors;\n\n const isSelectedColor = (color: string) => {\n const { a, ...colorChannels } = parseColor(color);\n const opaqueColor = { ...colorChannels, a: 1 };\n const isTransparent = a === 0;\n\n return (\n (isEqual(opaqueValue, opaqueColor) && !isTransparent && !isValueTransparent) ||\n (isValueTransparent && isTransparent)\n );\n };\n\n const selectedIndex = colors.findIndex(isSelectedColor);\n\n useEffect(() => {\n if (!autoFocus) {\n return;\n }\n\n const focusIndex = selectedIndex === -1 ? 0 : selectedIndex;\n const swatch = swatchRefs.current[focusIndex];\n\n if (swatch) {\n swatch.focus({ preventScroll: true });\n onAutoFocus?.();\n }\n }, [autoFocus, onAutoFocus, selectedIndex]);\n\n const selectColor = (index: number, focus: boolean) => {\n onChange(parseColor(colors[index]));\n\n if (focus) {\n swatchRefs.current[index]?.focus({ preventScroll: true });\n }\n };\n\n const handleKeyDown: KeyboardEventHandler<HTMLDivElement> = event => {\n const currentIndex = Number(event.currentTarget.dataset.index);\n let nextIndex: number | undefined;\n\n switch (event.key) {\n case 'ArrowRight':\n nextIndex = (currentIndex + 1) % colors.length;\n break;\n case 'ArrowLeft':\n nextIndex = (currentIndex - 1 + colors.length) % colors.length;\n break;\n case 'ArrowDown':\n nextIndex = (currentIndex + colorsPerRow) % colors.length;\n break;\n case 'ArrowUp':\n nextIndex = (currentIndex - colorsPerRow + colors.length) % colors.length;\n break;\n case 'Home':\n nextIndex = 0;\n break;\n case 'End':\n nextIndex = colors.length - 1;\n break;\n case 'Enter':\n case ' ':\n event.preventDefault();\n selectColor(currentIndex, false);\n return;\n default:\n return;\n }\n\n if (typeof nextIndex === 'number') {\n event.preventDefault();\n selectColor(nextIndex, true);\n }\n };\n\n return (\n <div className={styles.root} role=\"radiogroup\" aria-label=\"Color palette\">\n {colors.map((color, index) => {\n const channels = parseColor(color);\n const isLightColor = getLuminance(color) > 0.97;\n const isTransparent = channels.a === 0;\n const isSelected = isSelectedColor(color);\n\n return (\n <div\n key={color}\n ref={element => {\n swatchRefs.current[index] = element;\n }}\n className={classNames(\n styles.swatch,\n isSelected && styles.selected,\n isTransparent && styles.transparent,\n (isLightColor || isTransparent) && styles.darkAccent\n )}\n onClick={() => onChange(channels)}\n onKeyDown={handleKeyDown}\n style={isTransparent ? undefined : { background: color }}\n role=\"radio\"\n aria-checked={isSelected}\n aria-label={isTransparent ? 'Transparent' : color.toUpperCase()}\n tabIndex={isSelected || (selectedIndex === -1 && index === 0) ? 0 : -1}\n data-index={index}\n >\n <CheckSmallIcon size={14} className={styles.icon} />\n </div>\n );\n })}\n </div>\n );\n};\n"],"names":["Swatches","_ref","value","onChange","addTransparent","autoFocus","onAutoFocus","swatchRefs","useRef","opaqueValue","a","isValueTransparent","colors","paletteColors","toSpliced","colorsPerRow","isSelectedColor","color","parseColor","opaqueColor","_objectWithoutProperties","_parseColor","_excluded","isTransparent","isEqual","selectedIndex","findIndex","useEffect","focusIndex","swatch","current","focus","preventScroll","selectColor","index","_swatchRefs$current$i","handleKeyDown","event","nextIndex","currentIndex","Number","currentTarget","dataset","key","length","preventDefault","_jsx","className","styles","root","role","children","map","channels","isLightColor","getLuminance","isSelected","ref","element","classNames","selected","transparent","darkAccent","onClick","onKeyDown","style","undefined","background","toUpperCase","tabIndex","CheckSmallIcon","size","icon"],"mappings":"+hKAuBA,IAEaA,EAAW,SAMHC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ACHA,EAAY1B,EAAOgC,OAAS,EAC5B,MACF,IAAK,QACL,IAAK,IAGH,OAFAP,EAAMQ,sBACNZ,EAAYM,GAAc,GAE5B,QACE,OAGqB,iBAAdD,IACTD,EAAMQ,iBACNZ,EAAYK,GAAW,KAI3B,OACEQ,EAAA,MAAA,CAAKC,UAAWC,EAAOC,KAAMC,KAAK,aAAa,aAAW,gBAAeC,SACtEvC,EAAOwC,KAAI,SAACnC,EAAOiB,GAClB,IAAMmB,EAAWnC,EAAWD,GACtBqC,EAAeC,EAAatC,GAAS,IACrCM,EAA+B,IAAf8B,EAAS3C,EACzB8C,EAAaxC,EAAgBC,GAEnC,OACE6B,EAAA,MAAA,CAEEW,IAAK,SAAAC,GACHnD,EAAWuB,QAAQI,GAASwB,CAC5B,EACFX,UAAWY,EACTX,EAAOnB,OACP2B,GAAcR,EAAOY,SACrBrC,GAAiByB,EAAOa,aACvBP,GAAgB/B,IAAkByB,EAAOc,YAE5CC,QAAS,WAAA,OAAM5D,EAASkD,EAAU,EAClCW,UAAW5B,EACX6B,MAAO1C,OAAgB2C,EAAY,CAAEC,WAAYlD,GACjDiC,KAAK,QACL,eAAcM,EACd,aAAYjC,EAAgB,cAAgBN,EAAMmD,cAClDC,SAAUb,IAAkC,IAAnB/B,GAAkC,IAAVS,EAAe,GAAK,EACrE,aAAYA,EAAMiB,SAElBL,EAACwB,EAAc,CAACC,KAAM,GAAIxB,UAAWC,EAAOwB,QAnBvCvD,OAyBjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetFilters.d.ts","sourceRoot":"","sources":["../../../../src/componentsV2/CompletionsOffsetWellPicker/AssetFilters/AssetFilters.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAQ,MAAM,OAAO,CAAC;AAIjC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAO9C,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;CAC3D,CAAC;AAEF,QAAA,MAAM,YAAY,EAAE,EAAE,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"AssetFilters.d.ts","sourceRoot":"","sources":["../../../../src/componentsV2/CompletionsOffsetWellPicker/AssetFilters/AssetFilters.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAQ,MAAM,OAAO,CAAC;AAIjC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAO9C,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;CAC3D,CAAC;AAEF,QAAA,MAAM,YAAY,EAAE,EAAE,CAAC,KAAK,CAwF1B,CAAC;eAEY,YAAY"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{memo as e}from"react";import{TextInput as t}from"../../TextInput/TextInput.js";import{Autocomplete as
|
|
1
|
+
import{memo as e}from"react";import{TextInput as t}from"../../TextInput/TextInput.js";import{Autocomplete as a}from"../../Autocomplete/Autocomplete.js";import{useOptions as l}from"./useOptions.js";import{useAssetFiltersHandlers as o}from"./useAssetFiltersHandlers.js";import n from"./AssetFilters.scss.js";import{jsxs as s,jsx as r}from"react/jsx-runtime";var i=e((function(e){var i=e.pads,d=e.selectedPadId,p=e.filters,m=e.setFilters,u=l(i,d),c=u.fracFleetOptions,h=u.formationOptions,v=u.padOptions,f=o(m),F=f.handlePadStatusChange,b=f.handleTvdMinChange,C=f.handleTvdMaxChange,I=f.handleFracFleetsSelect,g=f.handleFormationsSelect;return s("div",{className:n.filters,"data-testid":"assetFilters",children:[r("div",{children:r(a,{clearable:!1,className:n.autocomplete,label:"Pad",value:p.padStatus,onChange:F,options:v,testId:"padStatusDropdown"})}),r("div",{children:r(a,{clearable:!1,className:n.autocomplete,label:"Frac Fleet",testId:"fracFleetDropdown",value:p.selectedFracFleets,onChange:I,useAllOption:!0,dropdownClassName:n.dropdown,multiple:!0,options:c.map((function(e){return{id:e.value,title:e.label}}))})}),r("div",{children:r(a,{clearable:!1,className:n.autocomplete,useAllOption:!0,label:"Formation",testId:"formationDropdown",value:p.selectedFormations,onChange:g,multiple:!0,dropdownClassName:n.dropdown,options:h.map((function(e){return{id:e.value,title:e.label}}))})}),r("div",{children:r(t,{className:n.input,label:"TVD (Min)",testId:"tvdMinInput",placeholder:"0",type:"number",htmlAttributes:{min:0},value:p.tvdMin,onChange:b})}),r("div",{children:r(t,{className:n.input,label:"TVD (Max)",testId:"tvdMaxInput",placeholder:"10000",type:"number",htmlAttributes:{min:0},value:p.tvdMax,onChange:C})})]})}));export{i as default};
|
|
2
2
|
//# sourceMappingURL=AssetFilters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetFilters.js","sources":["../../../../src/componentsV2/CompletionsOffsetWellPicker/AssetFilters/AssetFilters.tsx"],"sourcesContent":["import { FC, memo } from 'react';\n\nimport { TextInput } from '../../../componentsV2/TextInput';\nimport { Autocomplete } from '../../../componentsV2/Autocomplete';\nimport { Filters, MappedPad } from '../types';\n\nimport { useOptions } from './useOptions';\nimport { useAssetFiltersHandlers } from './useAssetFiltersHandlers';\n\nimport styles from './AssetFilters.scss';\n\ntype Props = {\n pads: MappedPad[];\n selectedPadId?: number;\n filters: Filters;\n setFilters: React.Dispatch<React.SetStateAction<Filters>>;\n};\n\nconst AssetFilters: FC<Props> = memo(({ pads, selectedPadId, filters, setFilters }) => {\n const { fracFleetOptions, formationOptions, padOptions } = useOptions(pads, selectedPadId);\n\n const {\n handlePadStatusChange,\n handleTvdMinChange,\n handleTvdMaxChange,\n handleFracFleetsSelect,\n handleFormationsSelect,\n } = useAssetFiltersHandlers(setFilters);\n\n return (\n <div className={styles.filters}>\n <div>\n <Autocomplete\n clearable={false}\n className={styles.autocomplete}\n label=\"Pad\"\n value={filters.padStatus}\n onChange={handlePadStatusChange}\n options={padOptions}\n />\n </div>\n <div>\n <Autocomplete\n clearable={false}\n className={styles.autocomplete}\n label=\"Frac Fleet\"\n value={filters.selectedFracFleets}\n onChange={handleFracFleetsSelect}\n useAllOption\n dropdownClassName={styles.dropdown}\n multiple\n options={fracFleetOptions.map(option => ({\n id: option.value,\n title: option.label,\n }))}\n />\n </div>\n <div>\n <Autocomplete\n clearable={false}\n className={styles.autocomplete}\n useAllOption\n label=\"Formation\"\n value={filters.selectedFormations}\n onChange={handleFormationsSelect}\n multiple\n dropdownClassName={styles.dropdown}\n options={formationOptions.map(option => ({\n id: option.value,\n title: option.label,\n }))}\n />\n </div>\n <div>\n <TextInput\n className={styles.input}\n label=\"TVD (Min)\"\n placeholder=\"0\"\n type=\"number\"\n htmlAttributes={{\n min: 0,\n }}\n value={filters.tvdMin}\n onChange={handleTvdMinChange}\n />\n </div>\n <div>\n <TextInput\n className={styles.input}\n label=\"TVD (Max)\"\n placeholder=\"10000\"\n type=\"number\"\n htmlAttributes={{\n min: 0,\n }}\n value={filters.tvdMax}\n onChange={handleTvdMaxChange}\n />\n </div>\n </div>\n );\n});\n\nexport default AssetFilters;\n"],"names":["AssetFilters","memo","_ref","pads","selectedPadId","filters","setFilters","_useOptions","useOptions","fracFleetOptions","formationOptions","padOptions","useAssetFiltersHandlers","handlePadStatusChange","handleTvdMinChange","handleTvdMaxChange","handleFracFleetsSelect","handleFormationsSelect","_jsxs","className","styles","children","_jsx","Autocomplete","clearable","autocomplete","label","value","padStatus","onChange","options","selectedFracFleets","useAllOption","dropdownClassName","dropdown","multiple","map","option","id","title","selectedFormations","TextInput","input","placeholder","type","htmlAttributes","min","tvdMin","tvdMax"],"mappings":"oWAkBA,IAAMA,EAA0BC,GAAK,SAAkDC,GAAA,IAA/CC,IAAAA,KAAMC,IAAAA,cAAeC,IAAAA,QAASC,IAAAA,WACpEC,EAA2DC,EAAWL,EAAMC,GAApEK,IAAAA,iBAAkBC,IAAAA,iBAAkBC,IAAAA,WAQxCC,EAAAA,EAAwBN,GAL1BO,IAAAA,sBACAC,IAAAA,mBACAC,IAAAA,mBACAC,IAAAA,uBACAC,IAAAA,uBAGF,OACEC,EAAA,MAAA,CAAKC,UAAWC,EAAOf,
|
|
1
|
+
{"version":3,"file":"AssetFilters.js","sources":["../../../../src/componentsV2/CompletionsOffsetWellPicker/AssetFilters/AssetFilters.tsx"],"sourcesContent":["import { FC, memo } from 'react';\n\nimport { TextInput } from '../../../componentsV2/TextInput';\nimport { Autocomplete } from '../../../componentsV2/Autocomplete';\nimport { Filters, MappedPad } from '../types';\n\nimport { useOptions } from './useOptions';\nimport { useAssetFiltersHandlers } from './useAssetFiltersHandlers';\n\nimport styles from './AssetFilters.scss';\n\ntype Props = {\n pads: MappedPad[];\n selectedPadId?: number;\n filters: Filters;\n setFilters: React.Dispatch<React.SetStateAction<Filters>>;\n};\n\nconst AssetFilters: FC<Props> = memo(({ pads, selectedPadId, filters, setFilters }) => {\n const { fracFleetOptions, formationOptions, padOptions } = useOptions(pads, selectedPadId);\n\n const {\n handlePadStatusChange,\n handleTvdMinChange,\n handleTvdMaxChange,\n handleFracFleetsSelect,\n handleFormationsSelect,\n } = useAssetFiltersHandlers(setFilters);\n\n return (\n <div className={styles.filters} data-testid=\"assetFilters\">\n <div>\n <Autocomplete\n clearable={false}\n className={styles.autocomplete}\n label=\"Pad\"\n value={filters.padStatus}\n onChange={handlePadStatusChange}\n options={padOptions}\n testId=\"padStatusDropdown\"\n />\n </div>\n <div>\n <Autocomplete\n clearable={false}\n className={styles.autocomplete}\n label=\"Frac Fleet\"\n testId=\"fracFleetDropdown\"\n value={filters.selectedFracFleets}\n onChange={handleFracFleetsSelect}\n useAllOption\n dropdownClassName={styles.dropdown}\n multiple\n options={fracFleetOptions.map(option => ({\n id: option.value,\n title: option.label,\n }))}\n />\n </div>\n <div>\n <Autocomplete\n clearable={false}\n className={styles.autocomplete}\n useAllOption\n label=\"Formation\"\n testId=\"formationDropdown\"\n value={filters.selectedFormations}\n onChange={handleFormationsSelect}\n multiple\n dropdownClassName={styles.dropdown}\n options={formationOptions.map(option => ({\n id: option.value,\n title: option.label,\n }))}\n />\n </div>\n <div>\n <TextInput\n className={styles.input}\n label=\"TVD (Min)\"\n testId=\"tvdMinInput\"\n placeholder=\"0\"\n type=\"number\"\n htmlAttributes={{\n min: 0,\n }}\n value={filters.tvdMin}\n onChange={handleTvdMinChange}\n />\n </div>\n <div>\n <TextInput\n className={styles.input}\n label=\"TVD (Max)\"\n testId=\"tvdMaxInput\"\n placeholder=\"10000\"\n type=\"number\"\n htmlAttributes={{\n min: 0,\n }}\n value={filters.tvdMax}\n onChange={handleTvdMaxChange}\n />\n </div>\n </div>\n );\n});\n\nexport default AssetFilters;\n"],"names":["AssetFilters","memo","_ref","pads","selectedPadId","filters","setFilters","_useOptions","useOptions","fracFleetOptions","formationOptions","padOptions","useAssetFiltersHandlers","handlePadStatusChange","handleTvdMinChange","handleTvdMaxChange","handleFracFleetsSelect","handleFormationsSelect","_jsxs","className","styles","children","_jsx","Autocomplete","clearable","autocomplete","label","value","padStatus","onChange","options","testId","selectedFracFleets","useAllOption","dropdownClassName","dropdown","multiple","map","option","id","title","selectedFormations","TextInput","input","placeholder","type","htmlAttributes","min","tvdMin","tvdMax"],"mappings":"oWAkBA,IAAMA,EAA0BC,GAAK,SAAkDC,GAAA,IAA/CC,IAAAA,KAAMC,IAAAA,cAAeC,IAAAA,QAASC,IAAAA,WACpEC,EAA2DC,EAAWL,EAAMC,GAApEK,IAAAA,iBAAkBC,IAAAA,iBAAkBC,IAAAA,WAQxCC,EAAAA,EAAwBN,GAL1BO,IAAAA,sBACA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pB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetSearchInput.d.ts","sourceRoot":"","sources":["../../../../src/componentsV2/CompletionsOffsetWellPicker/AssetSearchInput/AssetSearchInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAqB,MAAM,OAAO,CAAC;AAQ9C,KAAK,KAAK,GAAG;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;AAEF,QAAA,MAAM,gBAAgB,EAAE,EAAE,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"AssetSearchInput.d.ts","sourceRoot":"","sources":["../../../../src/componentsV2/CompletionsOffsetWellPicker/AssetSearchInput/AssetSearchInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAqB,MAAM,OAAO,CAAC;AAQ9C,KAAK,KAAK,GAAG;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;AAEF,QAAA,MAAM,gBAAgB,EAAE,EAAE,CAAC,KAAK,CAe9B,CAAC;eAEY,gBAAgB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{memo as o,useCallback as s}from"react";import{TextInput as c}from"../../TextInput/TextInput.js";import i from"./AssetSearchInput.scss.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/objectWithoutProperties";import"@icon-park/react/es/all";import{jsx as n}from"react/jsx-runtime";import"../../../icons/IconParkProvider.js";import"../../../icons/customIcons/icons/AddMessage.js";import"../../../icons/customIcons/icons/DragOne.js";import"../../../icons/customIcons/icons/Attention.js";import"../../../icons/customIcons/icons/Collapse.js";import"../../../icons/customIcons/icons/Dashboard.js";import"../../../icons/customIcons/icons/Expand.js";import"../../../icons/customIcons/icons/FolderClosed.js";import"../../../icons/customIcons/icons/FolderClosedFilled.js";import"../../../icons/customIcons/icons/FolderOpened.js";import"../../../icons/customIcons/icons/GreaterOrEqual.js";import"../../../icons/customIcons/icons/LessOrEqual.js";import"../../../icons/customIcons/icons/Search.js";import{SearchOne as t}from"../../../icons/customIcons/icons/SearchOne.js";import"../../../icons/customIcons/icons/Wellhub.js";import"../../../icons/customIcons/icons/MultiRuler.js";import"../../../icons/customIcons/icons/Checkbox.js";import"../../../icons/customIcons/icons/CheckboxChecked.js";import"../../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../../icons/customIcons/icons/Radio.js";import"../../../icons/customIcons/icons/RadioChecked.js";import"../../../icons/customIcons/icons/SimulFrac.js";import"../../../icons/customIcons/icons/ZipperFrac.js";import"../../../icons/customIcons/icons/CautionFilled.js";import"../../../icons/customIcons/icons/InfoRounded.js";import"../../../icons/customIcons/icons/FlameFilled.js";import"../../../icons/customIcons/icons/MoreApp.js";import"../../../icons/customIcons/icons/Pad.js";import"../../../icons/customIcons/icons/DrilloutUnit.js";import"../../../icons/customIcons/icons/FracFleet.js";import"../../../icons/customIcons/icons/Global.js";import"../../../icons/customIcons/icons/Program.js";import"../../../icons/customIcons/icons/Rig.js";import"../../../icons/customIcons/icons/Well.js";import"../../../icons/customIcons/icons/Gap.js";import"../../../icons/customIcons/icons/Pin.js";import"../../../icons/customIcons/icons/PinOne.js";import"../../../icons/customIcons/icons/PinOneCrossed.js";import"../../../icons/customIcons/icons/CloseOneFilled.js";import"../../../icons/customIcons/icons/AttentionFilled.js";import"../../../icons/customIcons/icons/CheckOneFilled.js";import"../../../icons/customIcons/icons/Archive.js";import"../../../icons/customIcons/icons/ArchiveCancel.js";import"../../../icons/customIcons/icons/Unarchive.js";import"../../../icons/customIcons/icons/Archived.js";import"../../../icons/customIcons/icons/InterventionUnit.js";import"../../../icons/customIcons/icons/CloudDelete.js";import"../../../icons/customIcons/icons/Lasso.js";import"../../../icons/customIcons/icons/Radius.js";import"../../../icons/customIcons/icons/ErrorOps.js";import"../../../icons/customIcons/icons/DataTypeOps.js";import"../../../icons/customIcons/icons/FalsePositiveOps.js";import"../../../icons/customIcons/icons/CalibrationOps.js";import"../../../icons/customIcons/icons/CriticalOps.js";import"../../../icons/customIcons/icons/Company.js";import"../../../icons/customIcons/icons/ArchiveOne.js";import"../../../icons/customIcons/icons/ParseBotFusion.js";import"../../../icons/customIcons/icons/Connect.js";import"../../../icons/customIcons/icons/PuzzleOne.js";import"../../../icons/customIcons/icons/Feed.js";import"../../../icons/customIcons/icons/Prompt.js";import"../../../icons/customIcons/icons/Companies.js";import"../../../icons/customIcons/icons/ClipboardAi.js";import"../../../icons/customIcons/icons/Key.js";import"../../../icons/customIcons/icons/AtSignCrossed.js";import"../../../icons/customIcons/icons/MappingManual.js";import"../../../icons/customIcons/icons/Mapping.js";import"../../../icons/customIcons/icons/Metrics.js";import"../../../icons/customIcons/icons/Drops.js";import"../../../icons/customIcons/icons/ClipboardSearch.js";import"../../../icons/customIcons/icons/Template.js";import"../../../icons/customIcons/icons/ClipboardMetrics.js";import"../../../icons/customIcons/icons/ClipboardBuilder.js";import"../../../icons/customIcons/icons/UnitConversion.js";import"../../../icons/customIcons/icons/NPT.js";import"../../../icons/customIcons/icons/GuidedFrac.js";var m=o((function(o){var m=o.searchText,r=o.onChange,e=s((function(){return r("")}),[r]);return n(c,{className:i.textInput,label:"Search",placeholder:"Search for Pads...",prefix:n(t,{}),onChange:r,value:m,onClear:e})}));export{m as default};
|
|
1
|
+
import{memo as o,useCallback as s}from"react";import{TextInput as c}from"../../TextInput/TextInput.js";import i from"./AssetSearchInput.scss.js";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/objectWithoutProperties";import"@icon-park/react/es/all";import{jsx as n}from"react/jsx-runtime";import"../../../icons/IconParkProvider.js";import"../../../icons/customIcons/icons/AddMessage.js";import"../../../icons/customIcons/icons/DragOne.js";import"../../../icons/customIcons/icons/Attention.js";import"../../../icons/customIcons/icons/Collapse.js";import"../../../icons/customIcons/icons/Dashboard.js";import"../../../icons/customIcons/icons/Expand.js";import"../../../icons/customIcons/icons/FolderClosed.js";import"../../../icons/customIcons/icons/FolderClosedFilled.js";import"../../../icons/customIcons/icons/FolderOpened.js";import"../../../icons/customIcons/icons/GreaterOrEqual.js";import"../../../icons/customIcons/icons/LessOrEqual.js";import"../../../icons/customIcons/icons/Search.js";import{SearchOne as t}from"../../../icons/customIcons/icons/SearchOne.js";import"../../../icons/customIcons/icons/Wellhub.js";import"../../../icons/customIcons/icons/MultiRuler.js";import"../../../icons/customIcons/icons/Checkbox.js";import"../../../icons/customIcons/icons/CheckboxChecked.js";import"../../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../../icons/customIcons/icons/Radio.js";import"../../../icons/customIcons/icons/RadioChecked.js";import"../../../icons/customIcons/icons/SimulFrac.js";import"../../../icons/customIcons/icons/ZipperFrac.js";import"../../../icons/customIcons/icons/CautionFilled.js";import"../../../icons/customIcons/icons/InfoRounded.js";import"../../../icons/customIcons/icons/FlameFilled.js";import"../../../icons/customIcons/icons/MoreApp.js";import"../../../icons/customIcons/icons/Pad.js";import"../../../icons/customIcons/icons/DrilloutUnit.js";import"../../../icons/customIcons/icons/FracFleet.js";import"../../../icons/customIcons/icons/Global.js";import"../../../icons/customIcons/icons/Program.js";import"../../../icons/customIcons/icons/Rig.js";import"../../../icons/customIcons/icons/Well.js";import"../../../icons/customIcons/icons/Gap.js";import"../../../icons/customIcons/icons/Pin.js";import"../../../icons/customIcons/icons/PinOne.js";import"../../../icons/customIcons/icons/PinOneCrossed.js";import"../../../icons/customIcons/icons/CloseOneFilled.js";import"../../../icons/customIcons/icons/AttentionFilled.js";import"../../../icons/customIcons/icons/CheckOneFilled.js";import"../../../icons/customIcons/icons/Archive.js";import"../../../icons/customIcons/icons/ArchiveCancel.js";import"../../../icons/customIcons/icons/Unarchive.js";import"../../../icons/customIcons/icons/Archived.js";import"../../../icons/customIcons/icons/InterventionUnit.js";import"../../../icons/customIcons/icons/CloudDelete.js";import"../../../icons/customIcons/icons/Lasso.js";import"../../../icons/customIcons/icons/Radius.js";import"../../../icons/customIcons/icons/ErrorOps.js";import"../../../icons/customIcons/icons/DataTypeOps.js";import"../../../icons/customIcons/icons/FalsePositiveOps.js";import"../../../icons/customIcons/icons/CalibrationOps.js";import"../../../icons/customIcons/icons/CriticalOps.js";import"../../../icons/customIcons/icons/Company.js";import"../../../icons/customIcons/icons/ArchiveOne.js";import"../../../icons/customIcons/icons/ParseBotFusion.js";import"../../../icons/customIcons/icons/Connect.js";import"../../../icons/customIcons/icons/PuzzleOne.js";import"../../../icons/customIcons/icons/Feed.js";import"../../../icons/customIcons/icons/Prompt.js";import"../../../icons/customIcons/icons/Companies.js";import"../../../icons/customIcons/icons/ClipboardAi.js";import"../../../icons/customIcons/icons/Key.js";import"../../../icons/customIcons/icons/AtSignCrossed.js";import"../../../icons/customIcons/icons/MappingManual.js";import"../../../icons/customIcons/icons/Mapping.js";import"../../../icons/customIcons/icons/Metrics.js";import"../../../icons/customIcons/icons/Drops.js";import"../../../icons/customIcons/icons/ClipboardSearch.js";import"../../../icons/customIcons/icons/Template.js";import"../../../icons/customIcons/icons/ClipboardMetrics.js";import"../../../icons/customIcons/icons/ClipboardBuilder.js";import"../../../icons/customIcons/icons/UnitConversion.js";import"../../../icons/customIcons/icons/NPT.js";import"../../../icons/customIcons/icons/GuidedFrac.js";var m=o((function(o){var m=o.searchText,r=o.onChange,e=s((function(){return r("")}),[r]);return n(c,{className:i.textInput,label:"Search",placeholder:"Search for Pads...",prefix:n(t,{}),onChange:r,value:m,onClear:e,testId:"padSearchInput"})}));export{m as default};
|
|
2
2
|
//# sourceMappingURL=AssetSearchInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetSearchInput.js","sources":["../../../../src/componentsV2/CompletionsOffsetWellPicker/AssetSearchInput/AssetSearchInput.tsx"],"sourcesContent":["import { FC, memo, useCallback } from 'react';\n\nimport { TextInput } from '../../TextInput';\n\nimport styles from './AssetSearchInput.scss';\n\nimport { SearchOne } from '~/icons';\n\ntype Props = {\n searchText: string;\n onChange: (value: string) => void;\n};\n\nconst AssetSearchInput: FC<Props> = memo(({ searchText, onChange }) => {\n const clearSearch = useCallback(() => onChange(''), [onChange]);\n\n return (\n <TextInput\n className={styles.textInput}\n label=\"Search\"\n placeholder=\"Search for Pads...\"\n prefix={<SearchOne />}\n onChange={onChange}\n value={searchText}\n onClear={clearSearch}\n />\n );\n});\n\nexport default AssetSearchInput;\n"],"names":["AssetSearchInput","memo","_ref","searchText","onChange","clearSearch","useCallback","_jsx","TextInput","className","styles","textInput","label","placeholder","prefix","SearchOne","value","onClear"],"mappings":"g4IAaA,IAAMA,EAA8BC,GAAK,SAA8BC,GAAA,IAA3BC,IAAAA,WAAYC,IAAAA,SAChDC,EAAcC,GAAY,WAAA,OAAMF,EAAS,MAAK,CAACA,IAErD,OACEG,EAACC,EAAS,CACRC,UAAWC,EAAOC,UAClBC,MAAM,SACNC,YAAY,qBACZC,OAAQP,EAACQ,EAAa,IACtBX,SAAUA,EACVY,MAAOb,EACPc,QAASZ,
|
|
1
|
+
{"version":3,"file":"AssetSearchInput.js","sources":["../../../../src/componentsV2/CompletionsOffsetWellPicker/AssetSearchInput/AssetSearchInput.tsx"],"sourcesContent":["import { FC, memo, useCallback } from 'react';\n\nimport { TextInput } from '../../TextInput';\n\nimport styles from './AssetSearchInput.scss';\n\nimport { SearchOne } from '~/icons';\n\ntype Props = {\n searchText: string;\n onChange: (value: string) => void;\n};\n\nconst AssetSearchInput: FC<Props> = memo(({ searchText, onChange }) => {\n const clearSearch = useCallback(() => onChange(''), [onChange]);\n\n return (\n <TextInput\n className={styles.textInput}\n label=\"Search\"\n placeholder=\"Search for Pads...\"\n prefix={<SearchOne />}\n onChange={onChange}\n value={searchText}\n onClear={clearSearch}\n testId=\"padSearchInput\"\n />\n );\n});\n\nexport default AssetSearchInput;\n"],"names":["AssetSearchInput","memo","_ref","searchText","onChange","clearSearch","useCallback","_jsx","TextInput","className","styles","textInput","label","placeholder","prefix","SearchOne","value","onClear","testId"],"mappings":"g4IAaA,IAAMA,EAA8BC,GAAK,SAA8BC,GAAA,IAA3BC,IAAAA,WAAYC,IAAAA,SAChDC,EAAcC,GAAY,WAAA,OAAMF,EAAS,MAAK,CAACA,IAErD,OACEG,EAACC,EAAS,CACRC,UAAWC,EAAOC,UAClBC,MAAM,SACNC,YAAY,qBACZC,OAAQP,EAACQ,EAAa,IACtBX,SAAUA,EACVY,MAAOb,EACPc,QAASZ,EACTa,OAAO,kBAGb"}
|