sanity 6.9.2-next.21 → 6.9.2-next.22
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/lib/{AddonDatasetProvider-B5npf4J4.js → AddonDatasetProvider-CfAw3oMr.js} +2 -2
- package/lib/{AddonDatasetProvider-B5npf4J4.js.map → AddonDatasetProvider-CfAw3oMr.js.map} +1 -1
- package/lib/{CalendarFilter-DYJEZDCP.js → CalendarFilter-OHGevGRx.js} +3 -3
- package/lib/{CalendarFilter-DYJEZDCP.js.map → CalendarFilter-OHGevGRx.js.map} +1 -1
- package/lib/{CommentsDocumentLayout-CTL7lt6a.js → CommentsDocumentLayout-p8p-oNuH.js} +2 -2
- package/lib/{CommentsDocumentLayout-CTL7lt6a.js.map → CommentsDocumentLayout-p8p-oNuH.js.map} +1 -1
- package/lib/{CommentsField-BE_CI2SY.js → CommentsField-CqXs722Y.js} +3 -3
- package/lib/{CommentsField-BE_CI2SY.js.map → CommentsField-CqXs722Y.js.map} +1 -1
- package/lib/{CommentsInput-D_EM-t5a.js → CommentsInput-B3rd8HlF.js} +5 -5
- package/lib/{CommentsInput-D_EM-t5a.js.map → CommentsInput-B3rd8HlF.js.map} +1 -1
- package/lib/{CommentsInspector-DtBIUadl.js → CommentsInspector-DTHmjTFc.js} +5 -5
- package/lib/{CommentsInspector-DtBIUadl.js.map → CommentsInspector-DTHmjTFc.js.map} +1 -1
- package/lib/{CommentsListItem-BFRqZMJ6.js → CommentsListItem-C2Ac0esL.js} +3 -3
- package/lib/{CommentsListItem-BFRqZMJ6.js.map → CommentsListItem-C2Ac0esL.js.map} +1 -1
- package/lib/{CommentsSelectedPathProvider-CIKpHpK3.js → CommentsSelectedPathProvider-DwDw8s-s.js} +3 -3
- package/lib/{CommentsSelectedPathProvider-CIKpHpK3.js.map → CommentsSelectedPathProvider-DwDw8s-s.js.map} +1 -1
- package/lib/{CommentsStudioLayout-Dx0jIDle.js → CommentsStudioLayout-e2hCA_5z.js} +4 -4
- package/lib/{CommentsStudioLayout-Dx0jIDle.js.map → CommentsStudioLayout-e2hCA_5z.js.map} +1 -1
- package/lib/{ReleasesMetadataProvider-hILX90V4.js → ReleasesMetadataProvider-BWsmHWkh.js} +2 -2
- package/lib/{ReleasesMetadataProvider-hILX90V4.js.map → ReleasesMetadataProvider-BWsmHWkh.js.map} +1 -1
- package/lib/{ReleasesNav-DIv-1iR7.js → ReleasesNav-DPSjEs29.js} +14 -14
- package/lib/{ReleasesNav-DIv-1iR7.js.map → ReleasesNav-DPSjEs29.js.map} +1 -1
- package/lib/{ReleasesStudioLayout-DW7fJSfG.js → ReleasesStudioLayout-CtyE88nI.js} +8 -8
- package/lib/{ReleasesStudioLayout-DW7fJSfG.js.map → ReleasesStudioLayout-CtyE88nI.js.map} +1 -1
- package/lib/{ReleasesTool-BQjO7osC.js → ReleasesTool-BjbRMZlc.js} +15 -15
- package/lib/{ReleasesTool-BQjO7osC.js.map → ReleasesTool-BjbRMZlc.js.map} +1 -1
- package/lib/{SchedulePublishingStudioLayout-Cwmdz7HZ.js → SchedulePublishingStudioLayout-gZWH97ZL.js} +3 -3
- package/lib/{SchedulePublishingStudioLayout-Cwmdz7HZ.js.map → SchedulePublishingStudioLayout-gZWH97ZL.js.map} +1 -1
- package/lib/{SchedulePublishingUpsellProvider-C5B21VDh.js → SchedulePublishingUpsellProvider-DsI8OUg-.js} +2 -2
- package/lib/{SchedulePublishingUpsellProvider-C5B21VDh.js.map → SchedulePublishingUpsellProvider-DsI8OUg-.js.map} +1 -1
- package/lib/{ScheduledPublishingEnabledProvider-BNMAVqrS.js → ScheduledPublishingEnabledProvider-BDRtV8OB.js} +3 -3
- package/lib/{ScheduledPublishingEnabledProvider-BNMAVqrS.js.map → ScheduledPublishingEnabledProvider-BDRtV8OB.js.map} +1 -1
- package/lib/{SearchProvider-DkGUk8a6.js → SearchProvider-Hk7IMQqR.js} +4 -4
- package/lib/{SearchProvider-DkGUk8a6.js.map → SearchProvider-Hk7IMQqR.js.map} +1 -1
- package/lib/{SingleDocReleaseLayout-fW8U-ktp.js → SingleDocReleaseLayout-evCp37zs.js} +2 -2
- package/lib/{SingleDocReleaseLayout-fW8U-ktp.js.map → SingleDocReleaseLayout-evCp37zs.js.map} +1 -1
- package/lib/{SingleDocReleaseUpsellProvider-BNF2Rj3j.js → SingleDocReleaseUpsellProvider-BOe2BACb.js} +4 -4
- package/lib/{SingleDocReleaseUpsellProvider-BNF2Rj3j.js.map → SingleDocReleaseUpsellProvider-BOe2BACb.js.map} +1 -1
- package/lib/{TasksStudioActiveToolLayout-CHazNA61.js → TasksStudioActiveToolLayout-Dbs-1GX6.js} +11 -11
- package/lib/{TasksStudioActiveToolLayout-CHazNA61.js.map → TasksStudioActiveToolLayout-Dbs-1GX6.js.map} +1 -1
- package/lib/{TasksStudioLayout-B7bCL28Q.js → TasksStudioLayout-Pn-RwtPi.js} +5 -5
- package/lib/{TasksStudioLayout-B7bCL28Q.js.map → TasksStudioLayout-Pn-RwtPi.js.map} +1 -1
- package/lib/{Tool-rkq_tjXo.js → Tool-D4-WLZtb.js} +12 -12
- package/lib/{Tool-rkq_tjXo.js.map → Tool-D4-WLZtb.js.map} +1 -1
- package/lib/{UnpublishVersionDialog-DWYCXGkz.js → UnpublishVersionDialog-DmFHVqhI.js} +4 -4
- package/lib/{UnpublishVersionDialog-DWYCXGkz.js.map → UnpublishVersionDialog-DmFHVqhI.js.map} +1 -1
- package/lib/{UpsellDialog-BiDSVmne.js → UpsellDialog-DRhOCOce.js} +2 -2
- package/lib/{UpsellDialog-BiDSVmne.js.map → UpsellDialog-DRhOCOce.js.map} +1 -1
- package/lib/{VariantsStudioNavbar-Bae9LOIN.js → VariantsStudioNavbar-CXpr7UUl.js} +7 -7
- package/lib/{VariantsStudioNavbar-Bae9LOIN.js.map → VariantsStudioNavbar-CXpr7UUl.js.map} +1 -1
- package/lib/{VariantsTool-E4ptTHik.js → VariantsTool-BCtrSWfP.js} +7 -7
- package/lib/{VariantsTool-E4ptTHik.js.map → VariantsTool-BCtrSWfP.js.map} +1 -1
- package/lib/{WorkspaceLoader-sdFQ9rkh.js → WorkspaceLoader-_w6NnbDb.js} +21 -21
- package/lib/{WorkspaceLoader-sdFQ9rkh.js.map → WorkspaceLoader-_w6NnbDb.js.map} +1 -1
- package/lib/_createContext.js +1 -1
- package/lib/{buildTextSelectionFromFragment-CuXpitEZ.js → buildTextSelectionFromFragment-Egmw5rNs.js} +3 -3
- package/lib/{buildTextSelectionFromFragment-CuXpitEZ.js.map → buildTextSelectionFromFragment-Egmw5rNs.js.map} +1 -1
- package/lib/{datastores-XTDIa3jc.js → datastores-DpJ5Y313.js} +2 -2
- package/lib/{datastores-XTDIa3jc.js.map → datastores-DpJ5Y313.js.map} +1 -1
- package/lib/index.js +28 -28
- package/lib/{inputResolver-DLP8YZcM.js → inputResolver-BX-VuloN.js} +4 -4
- package/lib/{inputResolver-DLP8YZcM.js.map → inputResolver-BX-VuloN.js.map} +1 -1
- package/lib/{navigation.telemetry-4pppJENG.js → navigation.telemetry-VbqjOek0.js} +7 -7
- package/lib/{navigation.telemetry-4pppJENG.js.map → navigation.telemetry-VbqjOek0.js.map} +1 -1
- package/lib/{plugin-BmARoHKH.js → plugin-DGOEvpWT.js} +4 -4
- package/lib/{plugin-BmARoHKH.js.map → plugin-DGOEvpWT.js.map} +1 -1
- package/lib/{plugin-BUox1zeI.js → plugin-Da_fKb0U.js} +3 -3
- package/lib/{plugin-BUox1zeI.js.map → plugin-Da_fKb0U.js.map} +1 -1
- package/lib/{plugin-CjN39wwt.js → plugin-DqqaZdOH.js} +5 -5
- package/lib/{plugin-CjN39wwt.js.map → plugin-DqqaZdOH.js.map} +1 -1
- package/lib/{plugin-BRnqEpCl.js → plugin-qHXYpO99.js} +6 -6
- package/lib/{plugin-BRnqEpCl.js.map → plugin-qHXYpO99.js.map} +1 -1
- package/lib/{scheduleItem-Dtb26ejO.js → scheduleItem-DcC1HE9G.js} +8 -8
- package/lib/{scheduleItem-Dtb26ejO.js.map → scheduleItem-DcC1HE9G.js.map} +1 -1
- package/lib/{schedules-6qsR7E_I.js → schedules-CbnXaXM9.js} +3 -3
- package/lib/{schedules-6qsR7E_I.js.map → schedules-CbnXaXM9.js.map} +1 -1
- package/lib/{searchDocumentRelease-CUk7BiST.js → searchDocumentRelease-C5sClmGF.js} +4 -4
- package/lib/{searchDocumentRelease-CUk7BiST.js.map → searchDocumentRelease-C5sClmGF.js.map} +1 -1
- package/lib/{studioClient-D1Z2zK3C.js → studioClient-CwMJwOTd.js} +2 -2
- package/lib/{studioClient-D1Z2zK3C.js.map → studioClient-CwMJwOTd.js.map} +1 -1
- package/lib/{useBundleDocuments-BnCBcbdJ.js → useBundleDocuments-DvVAF6cf.js} +7 -7
- package/lib/{useBundleDocuments-BnCBcbdJ.js.map → useBundleDocuments-DvVAF6cf.js.map} +1 -1
- package/lib/{useComments-Bm-0CwNH.js → useComments-DuEOnDkA.js} +2 -2
- package/lib/{useComments-Bm-0CwNH.js.map → useComments-DuEOnDkA.js.map} +1 -1
- package/lib/{useCommentsTelemetry-D1kYRuPU.js → useCommentsTelemetry-BgNdQdz5.js} +3 -3
- package/lib/{useCommentsTelemetry-D1kYRuPU.js.map → useCommentsTelemetry-BgNdQdz5.js.map} +1 -1
- package/lib/{useDocumentPreviewValues-DJvES8Wi.js → useDocumentPreviewValues-B1zNjl_D.js} +3 -3
- package/lib/{useDocumentPreviewValues-DJvES8Wi.js.map → useDocumentPreviewValues-B1zNjl_D.js.map} +1 -1
- package/lib/{useFeatureEnabled-g8eZoiLM.js → useFeatureEnabled-4qCpV_mX.js} +2 -2
- package/lib/{useFeatureEnabled-g8eZoiLM.js.map → useFeatureEnabled-4qCpV_mX.js.map} +1 -1
- package/lib/{useFieldActions-BV_qfe65.js → useFieldActions-uDe2qh98.js} +2 -2
- package/lib/{useFieldActions-BV_qfe65.js.map → useFieldActions-uDe2qh98.js.map} +1 -1
- package/lib/{useReleasesToolAvailable-Duu10qV0.js → useReleasesToolAvailable-DDuNc6HV.js} +3 -3
- package/lib/{useReleasesToolAvailable-Duu10qV0.js.map → useReleasesToolAvailable-DDuNc6HV.js.map} +1 -1
- package/lib/{useScheduledDraftMenuActions-Byiy3-k3.js → useScheduledDraftMenuActions-DqkHlC0c.js} +5 -5
- package/lib/{useScheduledDraftMenuActions-Byiy3-k3.js.map → useScheduledDraftMenuActions-DqkHlC0c.js.map} +1 -1
- package/lib/{useStudioUrl-BEb30_UK.js → useStudioUrl-B4w58A2i.js} +5 -5
- package/lib/{useStudioUrl-BEb30_UK.js.map → useStudioUrl-B4w58A2i.js.map} +1 -1
- package/lib/{useTimeZone-zs0ybzXu.js → useTimeZone-8Wd1UR4j.js} +2 -2
- package/lib/{useTimeZone-zs0ybzXu.js.map → useTimeZone-8Wd1UR4j.js.map} +1 -1
- package/lib/{validationUtils-LdwtMTh5.js → validationUtils-Cuk0jhWJ.js} +4 -4
- package/lib/{validationUtils-LdwtMTh5.js.map → validationUtils-Cuk0jhWJ.js.map} +1 -1
- package/lib/{version-XEmBTnIh.js → version-BVcB_xWL.js} +2 -2
- package/lib/{version-XEmBTnIh.js.map → version-BVcB_xWL.js.map} +1 -1
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentsInput-D_EM-t5a.js","names":["useEffect","useMemo","useState","createDomRectFromElements","elements","Element","DOMRect","length","rects","map","el","getBoundingClientRect","minX","Math","min","r","x","minY","y","maxRight","max","right","maxBottom","bottom","width","height","top","left","RectFromElementsHookOptions","scrollElement","HTMLElement","disabled","selector","useRectFromElements","props","$","_c","rect","setRect","t0","t1","handleSetRect","document","querySelectorAll","nextRect","Array","from","addEventListener","removeEventListener","ReferenceElementHookOptions","useAuthoringReferenceElement","bb0","t2","element","getSelectionBoundingRect","selection","window","getSelection","range","rangeCount","getRangeAt","AddCommentIcon","useClickOutsideEvent","motion","Variants","useRef","styled","Button","Popover","PopoverProps","useTranslation","CommentDisabledIcon","commentsLocaleNamespace","MotionPopover","create","POPOVER_FALLBACK_PLACEMENTS","VARIANTS","hidden","opacity","y","visible","FloatingButtonPopoverProps","disabled","onClick","onClickOutside","e","MouseEvent","referenceElement","FloatingButtonPopover","props","$","_c","buttonRef","t","t0","Symbol","for","current","t1","disabledText","t2","enabledText","text","t3","t4","content","t5","CurrentUser","BoundaryElementProvider","Stack","useClickOutsideEvent","usePortal","useCallback","useRef","styled","Popover","PopoverProps","CommentInput","CommentInputHandle","CommentInputProps","hasCommentMessageValue","POPOVER_FALLBACK_PLACEMENTS","RootStack","InlineCommentInputPopoverProps","currentUser","mentionOptions","onChange","onClickOutside","onDiscardConfirm","onSubmit","referenceElement","HTMLElement","value","InlineCommentInputPopover","props","$","_c","commentInputRef","contentElementRef","portal","boundaryElement","elements","documentScrollElement","t0","current","discardDialogController","close","handleDiscardConfirm","t1","Symbol","for","handleDiscardCancel","t2","hasValue","open","t3","t4","t5","content","t6","EditorSelection","PortableTextBlock","PortableTextEditor","RangeDecoration","RangeDecorationOnMovedDetails","isPortableTextTextBlock","BoundaryElementProvider","Stack","usePortal","PathUtils","uuid","debounce","isEqual","AnimatePresence","memo","startTransition","useCallback","useEffect","useLayoutEffect","useMemo","useRef","useState","useFormValue","useFieldActions","EditorChange","PortableTextInputProps","useCurrentUser","useAddonDataset","CommentInlineHighlightSpan","isTextSelectionComment","parseCommentFieldPath","useComments","useCommentsEnabled","useCommentsScroll","useCommentsSelectedPath","useCommentsUpsell","CommentDocument","CommentMessage","CommentsTextSelectionItem","CommentsUIMode","CommentUpdatePayload","buildCommentRangeDecorations","buildRangeDecorationSelectionsFromComments","buildTextSelectionFromFragment","getCommentFieldPath","getSelectionBoundingRect","useAuthoringReferenceElement","FloatingButtonPopover","InlineCommentInputPopover","EMPTY_ARRAY","AI_ASSIST_TYPE","CommentsPortableTextInput","props","$","_c","enabled","mode","fieldActions","isAiAssist","schemaType","name","isCommentsEnabledInField","Boolean","__internal_comments","t0","renderDefault","CommentsPortableTextInputInner","currentUser","portal","comments","getComment","mentionOptions","onCommentsOpen","operation","setStatus","status","error","addonDatasetError","setSelectedPath","selectedPath","scrollToComment","scrollToGroup","handleOpenDialog","mousePressed","setMousePressed","editorRef","Symbol","for","documentValue","documentValueRef","t1","t2","current","authoringDecorationElement","setAuthoringDecorationElement","nextCommentValue","setNextCommentValue","nextCommentSelection","setNextCommentSelection","currentSelection","setCurrentSelection","currentSelectionRect","setCurrenSelectionRect","currentHoveredCommentId","setCurrentHoveredCommentId","canSubmit","setCanSubmit","rootElement","setRootElement","isFullScreen","setIsFullScreen","addedCommentsDecorations","setAddedCommentsDecorations","fragment","setFragment","t3","getFragment","t4","rect","handleSetCurrentSelectionRect","t5","resetStates","t6","currentFragment","handleSelectCurrentSelection","t7","handleCommentDiscardConfirm","t8","data","open","path","t9","c_0","fieldPath","c","startsWith","filter","_temp","map","_temp2","textComments","nextValue","normalizedSelection","backward","anchor","focus","fieldPath_0","textSelection","selection","basePath","threadId","create","type","contentSnapshot","message","parentCommentId","undefined","reactions","origin","handleSubmit","t10","commentId","comment","target","field","_id","handleDecoratorClick","blurred","t11","isRangeSelected","offset","selectedFragment","isValidSelection","every","handleSelectionChange","debounceSelectionChange","useDebounceSelectionChange","t12","handleMouseDown","t13","handleMouseUp","t14","details","rangeDecoration","newSelection","commentId_0","payload","prev","next","p","nextDecoration","dirty","handleRangeDecorationMoved","t15","decoratorsToUpdate","_temp3","length","forEach","decorator_0","commentId_1","decorator","comment_0","editorValue","getValue","updatedDecoration","value","nextRange","range","nextValue_0","r","_key","concat","flat","sort","_temp4","nextComment","hasChanged","update","prev_0","next_0","p_0","isDirty","find","d","nextDecoration_0","_temp5","updateCommentRange","t16","commentsToDecorate","editorValue_0","onDecorationClick","onDecorationHoverEnd","onDecorationHoverStart","onDecorationMoved","selectedThreadId","handleBuildRangeDecorations","t17","change","onEditorChange","t18","bb0","t19","t20","children","component","authoringDecoration","rangeDecorations","currentSelectionIsOverlapping","setCurrentSelectionIsOverlapping","t21","t22","some","d_0","testA","isSelectionsOverlapping","testB","scrollElement","document","body","elements","documentScrollElement","boundaryElement","t23","t24","disabled","selector","popoverAuthoringReferenceElement","t25","bb1","t26","getBoundingClientRect","HTMLElement","selectionReferenceElement","t27","addEventListener","removeEventListener","t28","t29","nextDecorations","nextDecoration_1","prevDecoration","p_2","showFloatingButton","showFloatingInput","t30","t31","t32","t33","t34","t35","RenderDefaultCommentsPortableTextInputInner","React","ComponentProps","parentComment","c_1","a","b","localeCompare","p_1","isArrayOfBlocksSchemaType","InputProps","PortableTextInputProps","CommentsPortableTextInput","isPortableTextInputProps","inputProps","Omit","schemaType","CommentsInput","props","$","_c","t0","renderDefault"],"sources":["../src/core/comments/plugin/input/helpers.ts","../src/core/comments/plugin/input/components/FloatingButtonPopover.tsx","../src/core/comments/plugin/input/components/InlineCommentInputPopover.tsx","../src/core/comments/plugin/input/components/CommentsPortableTextInput.tsx","../src/core/comments/plugin/input/CommentsInput.tsx"],"sourcesContent":["import {useEffect, useMemo, useState} from 'react'\n\n/**\n * A function that creates a DOMRect from an array of elements.\n */\nfunction createDomRectFromElements(elements: Element[]): DOMRect | null {\n if (!elements || !elements.length) return null\n\n const rects = elements.map((el) => el.getBoundingClientRect())\n\n const minX = Math.min(...rects.map((r) => r.x)) || 0\n const minY = Math.min(...rects.map((r) => r.y)) || 0\n const maxRight = Math.max(...rects.map((r) => r.right)) || 0\n const maxBottom = Math.max(...rects.map((r) => r.bottom)) || 0\n\n return {\n x: minX,\n y: minY,\n width: maxRight - minX,\n height: maxBottom - minY,\n top: minY,\n right: maxRight,\n bottom: maxBottom,\n left: minX,\n } as DOMRect\n}\n\ninterface RectFromElementsHookOptions {\n scrollElement: HTMLElement | null\n disabled: boolean\n selector: string\n}\n\n/**\n * A hook that returns a DOMRect from an array of elements.\n * This is needed because the Range Decoration API might render se\n */\nfunction useRectFromElements(props: RectFromElementsHookOptions): DOMRect | null {\n const {scrollElement, disabled, selector} = props\n const [rect, setRect] = useState<DOMRect | null>(null)\n\n useEffect(() => {\n if (disabled) return undefined\n\n const handleSetRect = () => {\n const elements = document?.querySelectorAll(selector)\n if (!elements) return\n\n const nextRect = createDomRectFromElements(Array.from(elements))\n\n setRect(nextRect)\n }\n\n handleSetRect()\n\n if (!scrollElement) return undefined\n\n scrollElement.addEventListener('wheel', handleSetRect)\n\n return () => {\n scrollElement.removeEventListener('wheel', handleSetRect)\n }\n }, [scrollElement, disabled, selector])\n\n return rect\n}\n\nexport interface ReferenceElementHookOptions {\n scrollElement: HTMLElement | null\n disabled: boolean\n selector: string\n}\n\n/**\n * A hook that returns a reference element that can be used to position a popover.\n */\nexport function useAuthoringReferenceElement(\n props: ReferenceElementHookOptions,\n): HTMLElement | null {\n const {scrollElement, disabled, selector} = props\n\n const rect = useRectFromElements({\n scrollElement,\n disabled,\n selector,\n })\n\n const element = useMemo((): HTMLElement | null => {\n if (!rect) return null\n\n return {\n getBoundingClientRect: () => rect,\n } as HTMLElement\n }, [rect])\n\n return element\n}\n\nexport function getSelectionBoundingRect(): DOMRect | null {\n const selection = window.getSelection()\n let range = null\n\n if (selection && selection.rangeCount > 0) {\n range = selection.getRangeAt(0)\n }\n const rect = range?.getBoundingClientRect()\n\n return rect || null\n}\n","import {AddCommentIcon} from '@sanity/icons/AddComment'\nimport {useClickOutsideEvent} from '@sanity/ui'\nimport {motion, type Variants} from 'motion/react'\nimport {useRef} from 'react'\nimport {styled} from 'styled-components'\n\nimport {Button} from '../../../../../ui-components/button/Button'\nimport {Popover, type PopoverProps} from '../../../../../ui-components/popover/Popover'\nimport {useTranslation} from '../../../../i18n/hooks/useTranslation'\nimport {CommentDisabledIcon} from '../../../components/icons/CommentDisabledIcon'\nimport {commentsLocaleNamespace} from '../../../i18n'\n\nconst MotionPopover = styled(motion.create(Popover))`\n user-select: none;\n`\n\nconst POPOVER_FALLBACK_PLACEMENTS: PopoverProps['fallbackPlacements'] = ['bottom', 'top']\n\nconst VARIANTS: Variants = {\n hidden: {opacity: 0, y: -4},\n visible: {opacity: 1, y: 0},\n}\n\ninterface FloatingButtonPopoverProps {\n disabled: boolean\n onClick: () => void\n onClickOutside: (e: MouseEvent) => void\n referenceElement: PopoverProps['referenceElement']\n}\n\nexport function FloatingButtonPopover(props: FloatingButtonPopoverProps) {\n const {disabled, onClick, onClickOutside, referenceElement} = props\n const buttonRef = useRef<HTMLButtonElement | null>(null)\n const {t} = useTranslation(commentsLocaleNamespace)\n\n useClickOutsideEvent(onClickOutside, () => [buttonRef.current])\n\n const disabledText = t('inline-add-comment-button.disabled-overlap-title')\n const enabledText = t('inline-add-comment-button.title')\n const text = disabled ? disabledText : enabledText\n\n const content = (\n <Button\n data-testid=\"inline-comment-button\"\n disabled={disabled}\n icon={disabled ? CommentDisabledIcon : AddCommentIcon}\n mode=\"bleed\"\n onClick={onClick}\n ref={buttonRef}\n text={text}\n />\n )\n\n return (\n <MotionPopover\n animate=\"visible\"\n content={content}\n contentEditable={false}\n fallbackPlacements={POPOVER_FALLBACK_PLACEMENTS}\n initial=\"hidden\"\n open\n padding={1}\n placement=\"bottom\"\n portal\n referenceElement={referenceElement}\n variants={VARIANTS}\n />\n )\n}\n","import {type CurrentUser} from '@sanity/types'\nimport {BoundaryElementProvider, Stack, useClickOutsideEvent, usePortal} from '@sanity/ui'\nimport {useCallback, useRef} from 'react'\nimport {styled} from 'styled-components'\n\nimport {Popover, type PopoverProps} from '../../../../../ui-components/popover/Popover'\nimport {\n CommentInput,\n type CommentInputHandle,\n type CommentInputProps,\n} from '../../../components/pte/comment-input/CommentInput'\nimport {hasCommentMessageValue} from '../../../helpers'\n\nconst POPOVER_FALLBACK_PLACEMENTS: PopoverProps['fallbackPlacements'] = ['bottom', 'top']\n\nconst RootStack = styled(Stack)`\n width: 250px;\n`\n\ninterface InlineCommentInputPopoverProps {\n currentUser: CurrentUser\n mentionOptions: CommentInputProps['mentionOptions']\n onChange: CommentInputProps['onChange']\n onClickOutside: () => void\n onDiscardConfirm: CommentInputProps['onDiscardConfirm']\n onSubmit: CommentInputProps['onSubmit']\n referenceElement?: HTMLElement | null\n value: CommentInputProps['value']\n}\n\nexport function InlineCommentInputPopover(props: InlineCommentInputPopoverProps) {\n const {\n currentUser,\n mentionOptions,\n onChange,\n onClickOutside,\n onDiscardConfirm,\n onSubmit,\n referenceElement,\n value,\n } = props\n\n const commentInputRef = useRef<CommentInputHandle | null>(null)\n const contentElementRef = useRef<HTMLDivElement | null>(null)\n const portal = usePortal()\n\n // Popovers opened from the composer (the mentions menu) are measured against the\n // nearest boundary element. Inherited from the field, that is the Portable Text\n // field root — a single line tall in `oneLine` fields, which left the mentions\n // menu with a max height of ~0 and collapsed it (SAPP-4093). The composer floats\n // above the field, so its popovers should use the scroll area for room instead.\n const boundaryElement = portal.elements?.documentScrollElement || null\n\n const handleDiscardConfirm = useCallback(() => {\n commentInputRef.current?.discardDialogController.close()\n onDiscardConfirm()\n }, [onDiscardConfirm])\n\n const handleDiscardCancel = useCallback(() => {\n commentInputRef.current?.discardDialogController.close()\n }, [])\n\n useClickOutsideEvent(\n () => {\n const hasValue = hasCommentMessageValue(value)\n\n if (hasValue) {\n commentInputRef.current?.discardDialogController.open()\n return\n }\n\n onClickOutside()\n },\n () => [contentElementRef.current],\n )\n\n const content = (\n <BoundaryElementProvider element={boundaryElement}>\n <RootStack padding={2} ref={contentElementRef}>\n <CommentInput\n currentUser={currentUser}\n focusLock\n focusOnMount\n mentionOptions={mentionOptions}\n onChange={onChange}\n onDiscardCancel={handleDiscardCancel}\n onDiscardConfirm={handleDiscardConfirm}\n onSubmit={onSubmit}\n ref={commentInputRef}\n value={value}\n />\n </RootStack>\n </BoundaryElementProvider>\n )\n\n return (\n <Popover\n content={content}\n data-ui=\"InlineCommentInputPopover\"\n fallbackPlacements={POPOVER_FALLBACK_PLACEMENTS}\n open\n placement=\"bottom\"\n portal\n referenceElement={referenceElement}\n />\n )\n}\n","import {\n type EditorSelection,\n type PortableTextBlock,\n PortableTextEditor,\n type RangeDecoration,\n type RangeDecorationOnMovedDetails,\n} from '@portabletext/editor'\nimport {isPortableTextTextBlock} from '@sanity/types'\nimport {BoundaryElementProvider, Stack, usePortal} from '@sanity/ui'\nimport * as PathUtils from '@sanity/util/paths'\nimport {uuid} from '@sanity/uuid'\nimport debounce from 'lodash-es/debounce.js'\nimport isEqual from 'lodash-es/isEqual.js'\nimport {AnimatePresence} from 'motion/react'\nimport {\n memo,\n startTransition,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react'\n\nimport {useFormValue} from '../../../../form/contexts/FormValue'\nimport {useFieldActions} from '../../../../form/field/actions/useFieldActions'\nimport {type EditorChange, type PortableTextInputProps} from '../../../../form/types/inputProps'\nimport {useCurrentUser} from '../../../../store/user/hooks'\nimport {useAddonDataset} from '../../../../studio/addonDataset/useAddonDataset'\nimport {CommentInlineHighlightSpan} from '../../../components/pte/CommentInlineHighlightSpan'\nimport {isTextSelectionComment, parseCommentFieldPath} from '../../../helpers'\nimport {useComments} from '../../../hooks/useComments'\nimport {useCommentsEnabled} from '../../../hooks/useCommentsEnabled'\nimport {useCommentsScroll} from '../../../hooks/useCommentsScroll'\nimport {useCommentsSelectedPath} from '../../../hooks/useCommentsSelectedPath'\nimport {useCommentsUpsell} from '../../../hooks/useCommentsUpsell'\nimport {\n type CommentDocument,\n type CommentMessage,\n type CommentsTextSelectionItem,\n type CommentsUIMode,\n type CommentUpdatePayload,\n} from '../../../types'\nimport {buildCommentRangeDecorations} from '../../../utils/inline-comments/buildCommentRangeDecorations'\nimport {buildRangeDecorationSelectionsFromComments} from '../../../utils/inline-comments/buildRangeDecorationSelectionsFromComments'\nimport {\n buildTextSelectionFromFragment,\n getCommentFieldPath,\n} from '../../../utils/inline-comments/buildTextSelectionFromFragment'\nimport {getSelectionBoundingRect, useAuthoringReferenceElement} from '../helpers'\nimport {FloatingButtonPopover} from './FloatingButtonPopover'\nimport {InlineCommentInputPopover} from './InlineCommentInputPopover'\n\nconst EMPTY_ARRAY: [] = []\n\nconst AI_ASSIST_TYPE = 'sanity.assist.instruction.prompt'\n\nexport function CommentsPortableTextInput(props: PortableTextInputProps) {\n const {enabled, mode} = useCommentsEnabled()\n const fieldActions = useFieldActions()\n\n // This is a workaround solution to disable comments for the AI assist type.\n // The AI assist uses the official PTE input which is composed from the\n // Form Components API for the authoring of the prompt. Consequently, the input\n // will get the comments functionality as well, which we don't want.\n // Therefore we disable the comments for the AI assist type.\n const isAiAssist = props.schemaType.name === AI_ASSIST_TYPE\n /**\n * Comments can be disabled at field level by passing the `__internal_comments: undefined` prop to the field.\n * Even though is not recommended and tagged as internal, it works for all type of fields.\n * This adds the same ability to disable inline comments in the Portable Text editor.\n */\n const isCommentsEnabledInField = Boolean(fieldActions.__internal_comments)\n if (!enabled || isAiAssist || !isCommentsEnabledInField) {\n return props.renderDefault(props)\n }\n\n return <CommentsPortableTextInputInner {...props} mode={mode} />\n}\n\nconst CommentsPortableTextInputInner = memo(function CommentsPortableTextInputInner(\n props: PortableTextInputProps & {mode: CommentsUIMode},\n) {\n const {mode} = props\n const currentUser = useCurrentUser()\n const portal = usePortal()\n\n const {comments, getComment, mentionOptions, onCommentsOpen, operation, setStatus, status} =\n useComments()\n const {error: addonDatasetError} = useAddonDataset()\n const {setSelectedPath, selectedPath} = useCommentsSelectedPath()\n const {scrollToComment, scrollToGroup} = useCommentsScroll()\n const {handleOpenDialog} = useCommentsUpsell()\n const [mousePressed, setMousePressed] = useState<boolean>(false)\n\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const editorRef = useRef<PortableTextEditor | null>(null)\n\n // Read through a ref because `useFormValue([])` changes identity on every\n // keystroke: keeping it out of dependency arrays keeps decoration rebuilds\n // keyed on comment changes. The layout effect updates the ref synchronously\n // with the commit, so event handlers never observe a stale value.\n const documentValue = useFormValue([])\n const documentValueRef = useRef(documentValue)\n useLayoutEffect(() => {\n documentValueRef.current = documentValue\n }, [documentValue])\n\n // A reference to the authoring decoration element that highlights the selected text\n // when starting to author a comment.\n const [authoringDecorationElement, setAuthoringDecorationElement] =\n useState<HTMLSpanElement | null>(null)\n\n const [nextCommentValue, setNextCommentValue] = useState<CommentMessage | null>(null)\n const [nextCommentSelection, setNextCommentSelection] = useState<EditorSelection | null>(null)\n\n const [currentSelection, setCurrentSelection] = useState<EditorSelection | null>(null)\n const [currentSelectionRect, setCurrenSelectionRect] = useState<DOMRect | null>(null)\n\n const [currentHoveredCommentId, setCurrentHoveredCommentId] = useState<string | null>(null)\n\n const [canSubmit, setCanSubmit] = useState<boolean>(false)\n\n const [rootElement, setRootElement] = useState<HTMLDivElement | null>(null)\n const [isFullScreen, setIsFullScreen] = useState<boolean>(false)\n const [addedCommentsDecorations, setAddedCommentsDecorations] =\n useState<RangeDecoration[]>(EMPTY_ARRAY)\n\n const [fragment, setFragment] = useState<PortableTextBlock[] | null>(null)\n\n const getFragment = useCallback(() => {\n if (!editorRef.current) return EMPTY_ARRAY\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n return PortableTextEditor.getFragment(editorRef.current)\n }, [])\n\n const handleSetCurrentSelectionRect = useCallback(() => {\n const rect = getSelectionBoundingRect()\n setCurrenSelectionRect(rect)\n }, [])\n\n const resetStates = useCallback(() => {\n setCurrentSelection(null)\n setCurrenSelectionRect(null)\n setNextCommentSelection(null)\n setNextCommentValue(null)\n setCanSubmit(false)\n setAuthoringDecorationElement(null)\n setFragment(null)\n }, [])\n\n // Set the next comment selection to the current selection so that we can\n // render the comment input popover on the current selection using a range decoration.\n const handleSelectCurrentSelection = useCallback(() => {\n // When trying to add a comment in \"upsell\" mode, we want to\n // display the upsell dialog instead of the comment input popover.\n if (mode === 'upsell') {\n handleOpenDialog('pte')\n return\n }\n const currentFragment = getFragment() || null\n setFragment(currentFragment)\n setNextCommentSelection(currentSelection)\n }, [currentSelection, getFragment, handleOpenDialog, mode])\n\n // Clear the selection and close the popover when discarding the comment\n const handleCommentDiscardConfirm = useCallback(() => {\n resetStates()\n }, [resetStates])\n\n const textComments = useMemo(() => {\n return comments.data.open\n .filter((c) => isTextSelectionComment(c.parentComment))\n .filter((c) => {\n // Keep the per-editor work proportional to the editor's own comments.\n const fieldPath = parseCommentFieldPath(c.fieldPath)\n return fieldPath ? PathUtils.startsWith(props.path, fieldPath) : false\n })\n .map((c) => c.parentComment)\n }, [comments.data.open, props.path])\n\n const handleSubmit = useCallback(\n (nextValue: CommentMessage) => {\n if (!nextCommentSelection || !editorRef.current) return\n\n const normalizedSelection = nextCommentSelection.backward\n ? {backward: false, anchor: nextCommentSelection.focus, focus: nextCommentSelection.anchor}\n : nextCommentSelection\n\n const fieldPath = getCommentFieldPath(\n documentValueRef.current,\n props.path,\n normalizedSelection.focus.path,\n )\n if (!fieldPath) return\n\n const textSelection = buildTextSelectionFromFragment({\n fragment: fragment || EMPTY_ARRAY,\n selection: normalizedSelection,\n documentValue: documentValueRef.current,\n basePath: props.path,\n })\n\n const threadId = uuid()\n\n void operation.create({\n type: 'field',\n contentSnapshot: fragment,\n fieldPath,\n message: nextValue,\n parentCommentId: undefined,\n reactions: EMPTY_ARRAY,\n selection: textSelection,\n status: 'open',\n threadId,\n })\n\n // Open the inspector when a new comment is added\n onCommentsOpen?.()\n\n // Set the status to 'open' so that the comment is visible\n if (status === 'resolved') {\n setStatus('open')\n }\n\n // Set the selected path to the new comment\n setSelectedPath({\n fieldPath,\n threadId,\n origin: 'form',\n })\n\n // Scroll to the comment\n scrollToGroup(threadId)\n\n resetStates()\n },\n [\n nextCommentSelection,\n operation,\n props.path,\n onCommentsOpen,\n status,\n setSelectedPath,\n scrollToGroup,\n resetStates,\n setStatus,\n fragment,\n ],\n )\n\n const handleDecoratorClick = useCallback(\n (commentId: string) => {\n const comment = getComment(commentId)\n if (!comment) return\n\n setSelectedPath({\n fieldPath: comment.target.path?.field || '',\n threadId: comment.threadId,\n origin: 'form',\n })\n\n onCommentsOpen?.()\n\n scrollToComment(comment._id)\n },\n [getComment, onCommentsOpen, scrollToComment, setSelectedPath],\n )\n\n const blurred = useRef<boolean>(false)\n\n const handleSelectionChange = useCallback(\n (selection: EditorSelection | null) => {\n const isRangeSelected = selection?.anchor.offset !== selection?.focus.offset\n\n const selectedFragment = getFragment()\n const isValidSelection = selectedFragment?.every(isPortableTextTextBlock)\n\n if (!isValidSelection || !isRangeSelected) {\n setCanSubmit(false)\n return\n }\n /**\n * When the portable text editor loses focus we will save the blurred.current to true.\n * Later, when it restores focus the editor will emit a selection change event, but we don't want to immediately show the comment input\n * instead, we want to wait until the user selects a new range.\n */\n if (blurred.current) {\n blurred.current = false\n return\n }\n // If the mouse is not down, we want to set the current selection rect\n // when the selection changes. Otherwise, we want to wait until the mouse\n // is up to set the current selection rect (see `handleMouseUp`).\n if (!mousePressed) {\n handleSetCurrentSelectionRect()\n }\n\n setCurrentSelection(selection)\n setCanSubmit(true)\n },\n [getFragment, handleSetCurrentSelectionRect, mousePressed],\n )\n\n const debounceSelectionChange = useDebounceSelectionChange(handleSelectionChange)\n\n const handleMouseDown = useCallback(() => {\n // A mouse press inside the editor means the selection that follows is\n // made by the user, not restored by a re-focus, so the `blurred` guard\n // in `handleSelectionChange` must not swallow it.\n blurred.current = false\n startTransition(() => setMousePressed(true))\n }, [])\n\n const handleMouseUp = useCallback(() => {\n startTransition(() => setMousePressed(false))\n\n // When the mouse is up, we want to set the current selection rect.\n handleSetCurrentSelectionRect()\n }, [handleSetCurrentSelectionRect])\n\n const handleRangeDecorationMoved = useCallback((details: RangeDecorationOnMovedDetails) => {\n const {rangeDecoration, newSelection} = details\n\n const commentId = rangeDecoration.payload?.commentId as undefined | string\n\n // Update the range decoration with the new selection.\n setAddedCommentsDecorations((prev) => {\n const next = prev.map((p) => {\n if (p.payload?.commentId === commentId) {\n const nextDecoration: RangeDecoration = {\n ...rangeDecoration,\n selection: newSelection,\n payload: {...rangeDecoration.payload, dirty: true},\n }\n return nextDecoration\n }\n return p\n })\n return next\n })\n }, [])\n\n const updateCommentRange = useCallback(() => {\n const decoratorsToUpdate = addedCommentsDecorations.filter(\n (decorator) => decorator.payload?.dirty,\n )\n if (decoratorsToUpdate.length === 0) return\n\n decoratorsToUpdate.forEach((decorator) => {\n const commentId = decorator.payload?.commentId as undefined | string\n const comment = getComment(commentId || '')\n\n // If the comment no longer exists, remove the range decoration.\n if (!comment) {\n return\n }\n\n // The below code will update the comment object to reflect the new selection\n if (!editorRef.current) return\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const editorValue = PortableTextEditor.getValue(editorRef.current) || EMPTY_ARRAY\n\n const [updatedDecoration] = buildRangeDecorationSelectionsFromComments({\n comments: [comment],\n value: editorValue,\n documentValue: documentValueRef.current,\n basePath: props.path,\n })\n\n const nextRange = updatedDecoration?.range ? [updatedDecoration.range] : EMPTY_ARRAY\n\n const nextValue: CommentsTextSelectionItem[] = updatedDecoration\n ? [\n ...(comment.target.path?.selection?.value\n .filter((r) => r._key !== nextRange[0]?._key)\n .concat(nextRange)\n .flat()\n .sort((a, b) => a._key.localeCompare(b._key)) || EMPTY_ARRAY),\n ]\n : EMPTY_ARRAY\n\n const nextComment: CommentUpdatePayload = {\n target: {\n ...comment.target,\n path: {\n ...comment.target?.path,\n field: comment.target.path?.field || '',\n selection: {\n type: 'text',\n value: nextValue,\n },\n },\n },\n }\n\n const hasChanged = !isEqual(comment.target, nextComment.target)\n\n if (hasChanged) {\n void operation.update(comment._id, nextComment)\n }\n })\n\n // Mark the range decorations as not dirty\n setAddedCommentsDecorations((prev) => {\n const next = prev.map((p) => {\n const isDirty = decoratorsToUpdate.find(\n (d) => d.payload?.commentId === p.payload?.commentId,\n )?.payload?.dirty\n\n if (isDirty) {\n const nextDecoration: RangeDecoration = {\n ...p,\n payload: {...p.payload, dirty: false},\n }\n return nextDecoration\n }\n return p\n })\n return next.filter((p) => p.selection !== null)\n })\n }, [addedCommentsDecorations, getComment, operation, props.path])\n\n const handleBuildRangeDecorations = useCallback(\n (commentsToDecorate: CommentDocument[]) => {\n if (!editorRef.current) return EMPTY_ARRAY\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const editorValue = PortableTextEditor.getValue(editorRef.current) || EMPTY_ARRAY\n\n return buildCommentRangeDecorations({\n comments: commentsToDecorate,\n currentHoveredCommentId,\n onDecorationClick: handleDecoratorClick,\n onDecorationHoverEnd: setCurrentHoveredCommentId,\n onDecorationHoverStart: setCurrentHoveredCommentId,\n onDecorationMoved: handleRangeDecorationMoved,\n selectedThreadId: selectedPath?.threadId || null,\n value: editorValue,\n documentValue: documentValueRef.current,\n basePath: props.path,\n })\n },\n [\n currentHoveredCommentId,\n handleDecoratorClick,\n handleRangeDecorationMoved,\n props.path,\n selectedPath?.threadId,\n ],\n )\n\n const onEditorChange = useCallback(\n (change: EditorChange) => {\n if (change.type === 'mutation') {\n updateCommentRange()\n }\n if (change.type === 'blur') {\n blurred.current = true\n }\n if (change.type === 'selection') {\n debounceSelectionChange(change.selection)\n }\n },\n [debounceSelectionChange, updateCommentRange],\n )\n\n // The range decoration for the comment input. This is used to position the\n // comment input popover on the current selection and to highlight the\n // selected text.\n const authoringDecoration = useMemo((): RangeDecoration | null => {\n if (!nextCommentSelection) return null\n\n return {\n component: ({children}) => (\n <CommentInlineHighlightSpan isAuthoring ref={setAuthoringDecorationElement}>\n {children}\n </CommentInlineHighlightSpan>\n ),\n selection: nextCommentSelection,\n }\n }, [nextCommentSelection])\n\n // All the range decorations\n const rangeDecorations: RangeDecoration[] = [\n // Existing range decorations\n ...(props?.rangeDecorations || EMPTY_ARRAY),\n // The range decoration when adding a comment\n ...(authoringDecoration ? [authoringDecoration] : EMPTY_ARRAY),\n // The range decorations for existing comments\n ...addedCommentsDecorations,\n ]\n\n const [currentSelectionIsOverlapping, setCurrentSelectionIsOverlapping] = useState<boolean>(false)\n useEffect(() => {\n startTransition(() =>\n setCurrentSelectionIsOverlapping(() => {\n if (!currentSelection || addedCommentsDecorations.length === 0) return false\n\n return addedCommentsDecorations.some((d) => {\n if (!editorRef.current) return false\n\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const testA = PortableTextEditor.isSelectionsOverlapping(\n editorRef.current,\n currentSelection,\n d.selection,\n )\n\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const testB = PortableTextEditor.isSelectionsOverlapping(\n editorRef.current,\n d.selection,\n currentSelection,\n )\n\n return testA || testB\n })\n }),\n )\n }, [addedCommentsDecorations, currentSelection])\n\n // The scroll element used to update the reference element for the\n // popover on scroll.\n const scrollElement = isFullScreen\n ? document.body\n : portal.elements?.documentScrollElement || document.body\n\n // The boundary element used to position the popover properly\n // inside the editor.\n const boundaryElement = isFullScreen\n ? portal.elements?.documentScrollElement || document.body\n : rootElement\n\n const popoverAuthoringReferenceElement = useAuthoringReferenceElement({\n scrollElement,\n disabled: !nextCommentSelection || !authoringDecorationElement,\n selector: '[data-inline-comment-state=\"authoring\"]',\n })\n\n const selectionReferenceElement = useMemo(() => {\n if (!currentSelectionRect) return null\n\n return {\n getBoundingClientRect: () => currentSelectionRect,\n } as HTMLElement\n }, [currentSelectionRect])\n\n // This effect is needed to update the reference element for the popover\n // when the current selection changes so that it is always positioned\n // on the current selection.\n useEffect(() => {\n if (!currentSelection) return undefined\n scrollElement?.addEventListener('wheel', handleSetCurrentSelectionRect)\n\n return () => {\n scrollElement?.removeEventListener('wheel', handleSetCurrentSelectionRect)\n }\n }, [currentSelection, scrollElement, handleSetCurrentSelectionRect])\n\n // This is effect is needed to handle remote changes to the comments.\n // That is, when another user adds, updates or deletes a comment, we need\n // to update the range decorations to reflect these changes in the UI.\n useEffect(() => {\n const nextDecorations = handleBuildRangeDecorations(textComments)\n\n // The `dirty` flag is used to keep track of range decorations that\n // have been moved. When a range decoration is moved, we need to update\n // the comment document. However, when receiving updates from the server,\n // the `dirty` flag will be removed. Therefore, we need to make sure\n // that the `dirty` flag is preserved so that we can update the comment.\n startTransition(() =>\n setAddedCommentsDecorations((current) => {\n return nextDecorations.map((nextDecoration) => {\n const prevDecoration = current.find(\n (p) => p.payload?.commentId === nextDecoration.payload?.commentId,\n )\n\n if (prevDecoration?.payload?.dirty) {\n return {\n ...nextDecoration,\n payload: {...nextDecoration.payload, dirty: prevDecoration.payload.dirty},\n }\n }\n\n return nextDecoration\n })\n }),\n )\n }, [handleBuildRangeDecorations, textComments])\n\n const showFloatingButton = Boolean(\n currentSelection && canSubmit && selectionReferenceElement && !mousePressed,\n )\n const showFloatingInput = Boolean(nextCommentSelection && popoverAuthoringReferenceElement)\n\n return (\n <>\n <BoundaryElementProvider element={boundaryElement}>\n {showFloatingInput && currentUser && (\n <InlineCommentInputPopover\n currentUser={currentUser}\n mentionOptions={mentionOptions}\n onChange={setNextCommentValue}\n onClickOutside={resetStates}\n onDiscardConfirm={handleCommentDiscardConfirm}\n onSubmit={handleSubmit}\n referenceElement={popoverAuthoringReferenceElement}\n value={nextCommentValue}\n />\n )}\n <AnimatePresence>\n {showFloatingButton && !showFloatingInput && (\n <FloatingButtonPopover\n disabled={currentSelectionIsOverlapping || Boolean(addonDatasetError)}\n onClick={handleSelectCurrentSelection}\n onClickOutside={resetStates}\n referenceElement={selectionReferenceElement}\n />\n )}\n </AnimatePresence>\n </BoundaryElementProvider>\n\n <Stack ref={setRootElement} onMouseDown={handleMouseDown} onMouseUp={handleMouseUp}>\n <RenderDefaultCommentsPortableTextInputInner\n {...props}\n onEditorChange={onEditorChange}\n editorRef={editorRef}\n rangeDecorations={rangeDecorations}\n onFullScreenChange={setIsFullScreen}\n />\n </Stack>\n </>\n )\n})\n\n// Workaround for react compiler restrictions on refs triggered by the debounce wrapper\nfunction useDebounceSelectionChange(\n handleSelectionChange: (selection: EditorSelection | null) => void,\n) {\n return useMemo(() => debounce(handleSelectionChange, 200), [handleSelectionChange])\n}\n// Used to workaround restrictions on passing refs to functions in react compiler\nfunction RenderDefaultCommentsPortableTextInputInner(\n props: React.ComponentProps<typeof CommentsPortableTextInputInner>,\n) {\n return props.renderDefault(props)\n}\n","import {isArrayOfBlocksSchemaType} from '@sanity/types'\n\nimport {type InputProps, type PortableTextInputProps} from '../../../form/types/inputProps'\nimport {CommentsPortableTextInput} from './components/CommentsPortableTextInput'\n\nfunction isPortableTextInputProps(\n inputProps: InputProps | Omit<InputProps, 'renderDefault'>,\n): inputProps is PortableTextInputProps {\n return isArrayOfBlocksSchemaType(inputProps.schemaType)\n}\n\nexport function CommentsInput(props: InputProps) {\n if (isPortableTextInputProps(props)) {\n return <CommentsPortableTextInput {...props} />\n }\n\n return props.renderDefault(props)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,SAASG,0BAA0BC,UAAqC;CACtE,IAAI,CAACA,YAAY,CAACA,SAASG,QAAQ,OAAO;CAE1C,IAAMC,QAAQJ,SAASK,KAAKC,OAAOA,GAAGC,sBAAsB,CAAC,GAEvDC,OAAOC,KAAKC,IAAI,GAAGN,MAAMC,KAAKM,MAAMA,EAAEC,CAAC,CAAC,KAAK,GAC7CC,OAAOJ,KAAKC,IAAI,GAAGN,MAAMC,KAAKM,MAAMA,EAAEG,CAAC,CAAC,KAAK,GAC7CC,WAAWN,KAAKO,IAAI,GAAGZ,MAAMC,KAAKM,MAAMA,EAAEM,KAAK,CAAC,KAAK,GACrDC,YAAYT,KAAKO,IAAI,GAAGZ,MAAMC,KAAKM,MAAMA,EAAEQ,MAAM,CAAC,KAAK;CAE7D,OAAO;EACLP,GAAGJ;EACHM,GAAGD;EACHO,OAAOL,WAAWP;EAClBa,QAAQH,YAAYL;EACpBS,KAAKT;EACLI,OAAOF;EACPI,QAAQD;EACRK,MAAMf;CACR;AACF;;;;;AAYA,SAAAqB,oBAAAC,OAAA;CAAA,IAAAC,IAAAC,EAAA,CAAA,GACE,EAAAP,eAAAE,UAAAC,aAA4CE,OAC5C,CAAAG,MAAAC,WAAwBpC,SAAyB,IAAI,GAACqC,IAAAC;CAuBf,OAvBeL,EAAA,OAAAJ,YAAAI,EAAA,OAAAN,iBAAAM,EAAA,OAAAH,YAE5CO,WAAA;EACR,IAAIR,UAAQ;EAEZ,IAAAU,sBAAsB;GACpB,IAAArC,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AA,OAkG1BhK,IAAC+J;AAAc;AAlGW,SAAAlG,OAAAK,WAAA;CAAA,OAyQvBA,UAASd,SAAeK;AAAA;AAzQD,SAAAuB,OAAAiF,GAAAC,GAAA;CAAA,OA0SdD,EAACrF,KAAKuF,cAAeD,EAACtF,IAAK;AAAC;AA1Sd,SAAAe,OAAAyE,KAAA;CAAA,OAmVZ7G,IAACzC,cAAe;AAAI;AC/ZpD,SAAS2J,yBACPC,YACsC;CACtC,OAAOL,0BAA0BK,WAAWE,UAAU;AACxD;AAEA,SAAOC,cAAAC,OAAA;CAAA,IAAAC,IAAAC,EAAA,CAAA;CACL,IAAIP,yBAAyBK,KAAK,GAAC;EAAA,IAAAG;EACc,OADdF,EAAA,OAAAD,QACcG,KAAAF,EAAA,MAAxCE,KAAA,oBAAC,2BAAD,EAA0B,GAAKH,MAAK,CAAA,GAAIC,EAAA,KAAAD,OAAAC,EAAA,KAAAE,KAAxCA;CAAwC;CAChD,IAAAA;CAEgC,OAFhCF,EAAA,OAAAD,QAEgCG,KAAAF,EAAA,MAA1BE,KAAAH,MAAKI,cAAeJ,KAAK,GAACC,EAAA,KAAAD,OAAAC,EAAA,KAAAE,KAA1BA;AAA0B"}
|
|
1
|
+
{"version":3,"file":"CommentsInput-B3rd8HlF.js","names":["useEffect","useMemo","useState","createDomRectFromElements","elements","Element","DOMRect","length","rects","map","el","getBoundingClientRect","minX","Math","min","r","x","minY","y","maxRight","max","right","maxBottom","bottom","width","height","top","left","RectFromElementsHookOptions","scrollElement","HTMLElement","disabled","selector","useRectFromElements","props","$","_c","rect","setRect","t0","t1","handleSetRect","document","querySelectorAll","nextRect","Array","from","addEventListener","removeEventListener","ReferenceElementHookOptions","useAuthoringReferenceElement","bb0","t2","element","getSelectionBoundingRect","selection","window","getSelection","range","rangeCount","getRangeAt","AddCommentIcon","useClickOutsideEvent","motion","Variants","useRef","styled","Button","Popover","PopoverProps","useTranslation","CommentDisabledIcon","commentsLocaleNamespace","MotionPopover","create","POPOVER_FALLBACK_PLACEMENTS","VARIANTS","hidden","opacity","y","visible","FloatingButtonPopoverProps","disabled","onClick","onClickOutside","e","MouseEvent","referenceElement","FloatingButtonPopover","props","$","_c","buttonRef","t","t0","Symbol","for","current","t1","disabledText","t2","enabledText","text","t3","t4","content","t5","CurrentUser","BoundaryElementProvider","Stack","useClickOutsideEvent","usePortal","useCallback","useRef","styled","Popover","PopoverProps","CommentInput","CommentInputHandle","CommentInputProps","hasCommentMessageValue","POPOVER_FALLBACK_PLACEMENTS","RootStack","InlineCommentInputPopoverProps","currentUser","mentionOptions","onChange","onClickOutside","onDiscardConfirm","onSubmit","referenceElement","HTMLElement","value","InlineCommentInputPopover","props","$","_c","commentInputRef","contentElementRef","portal","boundaryElement","elements","documentScrollElement","t0","current","discardDialogController","close","handleDiscardConfirm","t1","Symbol","for","handleDiscardCancel","t2","hasValue","open","t3","t4","t5","content","t6","EditorSelection","PortableTextBlock","PortableTextEditor","RangeDecoration","RangeDecorationOnMovedDetails","isPortableTextTextBlock","BoundaryElementProvider","Stack","usePortal","PathUtils","uuid","debounce","isEqual","AnimatePresence","memo","startTransition","useCallback","useEffect","useLayoutEffect","useMemo","useRef","useState","useFormValue","useFieldActions","EditorChange","PortableTextInputProps","useCurrentUser","useAddonDataset","CommentInlineHighlightSpan","isTextSelectionComment","parseCommentFieldPath","useComments","useCommentsEnabled","useCommentsScroll","useCommentsSelectedPath","useCommentsUpsell","CommentDocument","CommentMessage","CommentsTextSelectionItem","CommentsUIMode","CommentUpdatePayload","buildCommentRangeDecorations","buildRangeDecorationSelectionsFromComments","buildTextSelectionFromFragment","getCommentFieldPath","getSelectionBoundingRect","useAuthoringReferenceElement","FloatingButtonPopover","InlineCommentInputPopover","EMPTY_ARRAY","AI_ASSIST_TYPE","CommentsPortableTextInput","props","$","_c","enabled","mode","fieldActions","isAiAssist","schemaType","name","isCommentsEnabledInField","Boolean","__internal_comments","t0","renderDefault","CommentsPortableTextInputInner","currentUser","portal","comments","getComment","mentionOptions","onCommentsOpen","operation","setStatus","status","error","addonDatasetError","setSelectedPath","selectedPath","scrollToComment","scrollToGroup","handleOpenDialog","mousePressed","setMousePressed","editorRef","Symbol","for","documentValue","documentValueRef","t1","t2","current","authoringDecorationElement","setAuthoringDecorationElement","nextCommentValue","setNextCommentValue","nextCommentSelection","setNextCommentSelection","currentSelection","setCurrentSelection","currentSelectionRect","setCurrenSelectionRect","currentHoveredCommentId","setCurrentHoveredCommentId","canSubmit","setCanSubmit","rootElement","setRootElement","isFullScreen","setIsFullScreen","addedCommentsDecorations","setAddedCommentsDecorations","fragment","setFragment","t3","getFragment","t4","rect","handleSetCurrentSelectionRect","t5","resetStates","t6","currentFragment","handleSelectCurrentSelection","t7","handleCommentDiscardConfirm","t8","data","open","path","t9","c_0","fieldPath","c","startsWith","filter","_temp","map","_temp2","textComments","nextValue","normalizedSelection","backward","anchor","focus","fieldPath_0","textSelection","selection","basePath","threadId","create","type","contentSnapshot","message","parentCommentId","undefined","reactions","origin","handleSubmit","t10","commentId","comment","target","field","_id","handleDecoratorClick","blurred","t11","isRangeSelected","offset","selectedFragment","isValidSelection","every","handleSelectionChange","debounceSelectionChange","useDebounceSelectionChange","t12","handleMouseDown","t13","handleMouseUp","t14","details","rangeDecoration","newSelection","commentId_0","payload","prev","next","p","nextDecoration","dirty","handleRangeDecorationMoved","t15","decoratorsToUpdate","_temp3","length","forEach","decorator_0","commentId_1","decorator","comment_0","editorValue","getValue","updatedDecoration","value","nextRange","range","nextValue_0","r","_key","concat","flat","sort","_temp4","nextComment","hasChanged","update","prev_0","next_0","p_0","isDirty","find","d","nextDecoration_0","_temp5","updateCommentRange","t16","commentsToDecorate","editorValue_0","onDecorationClick","onDecorationHoverEnd","onDecorationHoverStart","onDecorationMoved","selectedThreadId","handleBuildRangeDecorations","t17","change","onEditorChange","t18","bb0","t19","t20","children","component","authoringDecoration","rangeDecorations","currentSelectionIsOverlapping","setCurrentSelectionIsOverlapping","t21","t22","some","d_0","testA","isSelectionsOverlapping","testB","scrollElement","document","body","elements","documentScrollElement","boundaryElement","t23","t24","disabled","selector","popoverAuthoringReferenceElement","t25","bb1","t26","getBoundingClientRect","HTMLElement","selectionReferenceElement","t27","addEventListener","removeEventListener","t28","t29","nextDecorations","nextDecoration_1","prevDecoration","p_2","showFloatingButton","showFloatingInput","t30","t31","t32","t33","t34","t35","RenderDefaultCommentsPortableTextInputInner","React","ComponentProps","parentComment","c_1","a","b","localeCompare","p_1","isArrayOfBlocksSchemaType","InputProps","PortableTextInputProps","CommentsPortableTextInput","isPortableTextInputProps","inputProps","Omit","schemaType","CommentsInput","props","$","_c","t0","renderDefault"],"sources":["../src/core/comments/plugin/input/helpers.ts","../src/core/comments/plugin/input/components/FloatingButtonPopover.tsx","../src/core/comments/plugin/input/components/InlineCommentInputPopover.tsx","../src/core/comments/plugin/input/components/CommentsPortableTextInput.tsx","../src/core/comments/plugin/input/CommentsInput.tsx"],"sourcesContent":["import {useEffect, useMemo, useState} from 'react'\n\n/**\n * A function that creates a DOMRect from an array of elements.\n */\nfunction createDomRectFromElements(elements: Element[]): DOMRect | null {\n if (!elements || !elements.length) return null\n\n const rects = elements.map((el) => el.getBoundingClientRect())\n\n const minX = Math.min(...rects.map((r) => r.x)) || 0\n const minY = Math.min(...rects.map((r) => r.y)) || 0\n const maxRight = Math.max(...rects.map((r) => r.right)) || 0\n const maxBottom = Math.max(...rects.map((r) => r.bottom)) || 0\n\n return {\n x: minX,\n y: minY,\n width: maxRight - minX,\n height: maxBottom - minY,\n top: minY,\n right: maxRight,\n bottom: maxBottom,\n left: minX,\n } as DOMRect\n}\n\ninterface RectFromElementsHookOptions {\n scrollElement: HTMLElement | null\n disabled: boolean\n selector: string\n}\n\n/**\n * A hook that returns a DOMRect from an array of elements.\n * This is needed because the Range Decoration API might render se\n */\nfunction useRectFromElements(props: RectFromElementsHookOptions): DOMRect | null {\n const {scrollElement, disabled, selector} = props\n const [rect, setRect] = useState<DOMRect | null>(null)\n\n useEffect(() => {\n if (disabled) return undefined\n\n const handleSetRect = () => {\n const elements = document?.querySelectorAll(selector)\n if (!elements) return\n\n const nextRect = createDomRectFromElements(Array.from(elements))\n\n setRect(nextRect)\n }\n\n handleSetRect()\n\n if (!scrollElement) return undefined\n\n scrollElement.addEventListener('wheel', handleSetRect)\n\n return () => {\n scrollElement.removeEventListener('wheel', handleSetRect)\n }\n }, [scrollElement, disabled, selector])\n\n return rect\n}\n\nexport interface ReferenceElementHookOptions {\n scrollElement: HTMLElement | null\n disabled: boolean\n selector: string\n}\n\n/**\n * A hook that returns a reference element that can be used to position a popover.\n */\nexport function useAuthoringReferenceElement(\n props: ReferenceElementHookOptions,\n): HTMLElement | null {\n const {scrollElement, disabled, selector} = props\n\n const rect = useRectFromElements({\n scrollElement,\n disabled,\n selector,\n })\n\n const element = useMemo((): HTMLElement | null => {\n if (!rect) return null\n\n return {\n getBoundingClientRect: () => rect,\n } as HTMLElement\n }, [rect])\n\n return element\n}\n\nexport function getSelectionBoundingRect(): DOMRect | null {\n const selection = window.getSelection()\n let range = null\n\n if (selection && selection.rangeCount > 0) {\n range = selection.getRangeAt(0)\n }\n const rect = range?.getBoundingClientRect()\n\n return rect || null\n}\n","import {AddCommentIcon} from '@sanity/icons/AddComment'\nimport {useClickOutsideEvent} from '@sanity/ui'\nimport {motion, type Variants} from 'motion/react'\nimport {useRef} from 'react'\nimport {styled} from 'styled-components'\n\nimport {Button} from '../../../../../ui-components/button/Button'\nimport {Popover, type PopoverProps} from '../../../../../ui-components/popover/Popover'\nimport {useTranslation} from '../../../../i18n/hooks/useTranslation'\nimport {CommentDisabledIcon} from '../../../components/icons/CommentDisabledIcon'\nimport {commentsLocaleNamespace} from '../../../i18n'\n\nconst MotionPopover = styled(motion.create(Popover))`\n user-select: none;\n`\n\nconst POPOVER_FALLBACK_PLACEMENTS: PopoverProps['fallbackPlacements'] = ['bottom', 'top']\n\nconst VARIANTS: Variants = {\n hidden: {opacity: 0, y: -4},\n visible: {opacity: 1, y: 0},\n}\n\ninterface FloatingButtonPopoverProps {\n disabled: boolean\n onClick: () => void\n onClickOutside: (e: MouseEvent) => void\n referenceElement: PopoverProps['referenceElement']\n}\n\nexport function FloatingButtonPopover(props: FloatingButtonPopoverProps) {\n const {disabled, onClick, onClickOutside, referenceElement} = props\n const buttonRef = useRef<HTMLButtonElement | null>(null)\n const {t} = useTranslation(commentsLocaleNamespace)\n\n useClickOutsideEvent(onClickOutside, () => [buttonRef.current])\n\n const disabledText = t('inline-add-comment-button.disabled-overlap-title')\n const enabledText = t('inline-add-comment-button.title')\n const text = disabled ? disabledText : enabledText\n\n const content = (\n <Button\n data-testid=\"inline-comment-button\"\n disabled={disabled}\n icon={disabled ? CommentDisabledIcon : AddCommentIcon}\n mode=\"bleed\"\n onClick={onClick}\n ref={buttonRef}\n text={text}\n />\n )\n\n return (\n <MotionPopover\n animate=\"visible\"\n content={content}\n contentEditable={false}\n fallbackPlacements={POPOVER_FALLBACK_PLACEMENTS}\n initial=\"hidden\"\n open\n padding={1}\n placement=\"bottom\"\n portal\n referenceElement={referenceElement}\n variants={VARIANTS}\n />\n )\n}\n","import {type CurrentUser} from '@sanity/types'\nimport {BoundaryElementProvider, Stack, useClickOutsideEvent, usePortal} from '@sanity/ui'\nimport {useCallback, useRef} from 'react'\nimport {styled} from 'styled-components'\n\nimport {Popover, type PopoverProps} from '../../../../../ui-components/popover/Popover'\nimport {\n CommentInput,\n type CommentInputHandle,\n type CommentInputProps,\n} from '../../../components/pte/comment-input/CommentInput'\nimport {hasCommentMessageValue} from '../../../helpers'\n\nconst POPOVER_FALLBACK_PLACEMENTS: PopoverProps['fallbackPlacements'] = ['bottom', 'top']\n\nconst RootStack = styled(Stack)`\n width: 250px;\n`\n\ninterface InlineCommentInputPopoverProps {\n currentUser: CurrentUser\n mentionOptions: CommentInputProps['mentionOptions']\n onChange: CommentInputProps['onChange']\n onClickOutside: () => void\n onDiscardConfirm: CommentInputProps['onDiscardConfirm']\n onSubmit: CommentInputProps['onSubmit']\n referenceElement?: HTMLElement | null\n value: CommentInputProps['value']\n}\n\nexport function InlineCommentInputPopover(props: InlineCommentInputPopoverProps) {\n const {\n currentUser,\n mentionOptions,\n onChange,\n onClickOutside,\n onDiscardConfirm,\n onSubmit,\n referenceElement,\n value,\n } = props\n\n const commentInputRef = useRef<CommentInputHandle | null>(null)\n const contentElementRef = useRef<HTMLDivElement | null>(null)\n const portal = usePortal()\n\n // Popovers opened from the composer (the mentions menu) are measured against the\n // nearest boundary element. Inherited from the field, that is the Portable Text\n // field root — a single line tall in `oneLine` fields, which left the mentions\n // menu with a max height of ~0 and collapsed it (SAPP-4093). The composer floats\n // above the field, so its popovers should use the scroll area for room instead.\n const boundaryElement = portal.elements?.documentScrollElement || null\n\n const handleDiscardConfirm = useCallback(() => {\n commentInputRef.current?.discardDialogController.close()\n onDiscardConfirm()\n }, [onDiscardConfirm])\n\n const handleDiscardCancel = useCallback(() => {\n commentInputRef.current?.discardDialogController.close()\n }, [])\n\n useClickOutsideEvent(\n () => {\n const hasValue = hasCommentMessageValue(value)\n\n if (hasValue) {\n commentInputRef.current?.discardDialogController.open()\n return\n }\n\n onClickOutside()\n },\n () => [contentElementRef.current],\n )\n\n const content = (\n <BoundaryElementProvider element={boundaryElement}>\n <RootStack padding={2} ref={contentElementRef}>\n <CommentInput\n currentUser={currentUser}\n focusLock\n focusOnMount\n mentionOptions={mentionOptions}\n onChange={onChange}\n onDiscardCancel={handleDiscardCancel}\n onDiscardConfirm={handleDiscardConfirm}\n onSubmit={onSubmit}\n ref={commentInputRef}\n value={value}\n />\n </RootStack>\n </BoundaryElementProvider>\n )\n\n return (\n <Popover\n content={content}\n data-ui=\"InlineCommentInputPopover\"\n fallbackPlacements={POPOVER_FALLBACK_PLACEMENTS}\n open\n placement=\"bottom\"\n portal\n referenceElement={referenceElement}\n />\n )\n}\n","import {\n type EditorSelection,\n type PortableTextBlock,\n PortableTextEditor,\n type RangeDecoration,\n type RangeDecorationOnMovedDetails,\n} from '@portabletext/editor'\nimport {isPortableTextTextBlock} from '@sanity/types'\nimport {BoundaryElementProvider, Stack, usePortal} from '@sanity/ui'\nimport * as PathUtils from '@sanity/util/paths'\nimport {uuid} from '@sanity/uuid'\nimport debounce from 'lodash-es/debounce.js'\nimport isEqual from 'lodash-es/isEqual.js'\nimport {AnimatePresence} from 'motion/react'\nimport {\n memo,\n startTransition,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react'\n\nimport {useFormValue} from '../../../../form/contexts/FormValue'\nimport {useFieldActions} from '../../../../form/field/actions/useFieldActions'\nimport {type EditorChange, type PortableTextInputProps} from '../../../../form/types/inputProps'\nimport {useCurrentUser} from '../../../../store/user/hooks'\nimport {useAddonDataset} from '../../../../studio/addonDataset/useAddonDataset'\nimport {CommentInlineHighlightSpan} from '../../../components/pte/CommentInlineHighlightSpan'\nimport {isTextSelectionComment, parseCommentFieldPath} from '../../../helpers'\nimport {useComments} from '../../../hooks/useComments'\nimport {useCommentsEnabled} from '../../../hooks/useCommentsEnabled'\nimport {useCommentsScroll} from '../../../hooks/useCommentsScroll'\nimport {useCommentsSelectedPath} from '../../../hooks/useCommentsSelectedPath'\nimport {useCommentsUpsell} from '../../../hooks/useCommentsUpsell'\nimport {\n type CommentDocument,\n type CommentMessage,\n type CommentsTextSelectionItem,\n type CommentsUIMode,\n type CommentUpdatePayload,\n} from '../../../types'\nimport {buildCommentRangeDecorations} from '../../../utils/inline-comments/buildCommentRangeDecorations'\nimport {buildRangeDecorationSelectionsFromComments} from '../../../utils/inline-comments/buildRangeDecorationSelectionsFromComments'\nimport {\n buildTextSelectionFromFragment,\n getCommentFieldPath,\n} from '../../../utils/inline-comments/buildTextSelectionFromFragment'\nimport {getSelectionBoundingRect, useAuthoringReferenceElement} from '../helpers'\nimport {FloatingButtonPopover} from './FloatingButtonPopover'\nimport {InlineCommentInputPopover} from './InlineCommentInputPopover'\n\nconst EMPTY_ARRAY: [] = []\n\nconst AI_ASSIST_TYPE = 'sanity.assist.instruction.prompt'\n\nexport function CommentsPortableTextInput(props: PortableTextInputProps) {\n const {enabled, mode} = useCommentsEnabled()\n const fieldActions = useFieldActions()\n\n // This is a workaround solution to disable comments for the AI assist type.\n // The AI assist uses the official PTE input which is composed from the\n // Form Components API for the authoring of the prompt. Consequently, the input\n // will get the comments functionality as well, which we don't want.\n // Therefore we disable the comments for the AI assist type.\n const isAiAssist = props.schemaType.name === AI_ASSIST_TYPE\n /**\n * Comments can be disabled at field level by passing the `__internal_comments: undefined` prop to the field.\n * Even though is not recommended and tagged as internal, it works for all type of fields.\n * This adds the same ability to disable inline comments in the Portable Text editor.\n */\n const isCommentsEnabledInField = Boolean(fieldActions.__internal_comments)\n if (!enabled || isAiAssist || !isCommentsEnabledInField) {\n return props.renderDefault(props)\n }\n\n return <CommentsPortableTextInputInner {...props} mode={mode} />\n}\n\nconst CommentsPortableTextInputInner = memo(function CommentsPortableTextInputInner(\n props: PortableTextInputProps & {mode: CommentsUIMode},\n) {\n const {mode} = props\n const currentUser = useCurrentUser()\n const portal = usePortal()\n\n const {comments, getComment, mentionOptions, onCommentsOpen, operation, setStatus, status} =\n useComments()\n const {error: addonDatasetError} = useAddonDataset()\n const {setSelectedPath, selectedPath} = useCommentsSelectedPath()\n const {scrollToComment, scrollToGroup} = useCommentsScroll()\n const {handleOpenDialog} = useCommentsUpsell()\n const [mousePressed, setMousePressed] = useState<boolean>(false)\n\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const editorRef = useRef<PortableTextEditor | null>(null)\n\n // Read through a ref because `useFormValue([])` changes identity on every\n // keystroke: keeping it out of dependency arrays keeps decoration rebuilds\n // keyed on comment changes. The layout effect updates the ref synchronously\n // with the commit, so event handlers never observe a stale value.\n const documentValue = useFormValue([])\n const documentValueRef = useRef(documentValue)\n useLayoutEffect(() => {\n documentValueRef.current = documentValue\n }, [documentValue])\n\n // A reference to the authoring decoration element that highlights the selected text\n // when starting to author a comment.\n const [authoringDecorationElement, setAuthoringDecorationElement] =\n useState<HTMLSpanElement | null>(null)\n\n const [nextCommentValue, setNextCommentValue] = useState<CommentMessage | null>(null)\n const [nextCommentSelection, setNextCommentSelection] = useState<EditorSelection | null>(null)\n\n const [currentSelection, setCurrentSelection] = useState<EditorSelection | null>(null)\n const [currentSelectionRect, setCurrenSelectionRect] = useState<DOMRect | null>(null)\n\n const [currentHoveredCommentId, setCurrentHoveredCommentId] = useState<string | null>(null)\n\n const [canSubmit, setCanSubmit] = useState<boolean>(false)\n\n const [rootElement, setRootElement] = useState<HTMLDivElement | null>(null)\n const [isFullScreen, setIsFullScreen] = useState<boolean>(false)\n const [addedCommentsDecorations, setAddedCommentsDecorations] =\n useState<RangeDecoration[]>(EMPTY_ARRAY)\n\n const [fragment, setFragment] = useState<PortableTextBlock[] | null>(null)\n\n const getFragment = useCallback(() => {\n if (!editorRef.current) return EMPTY_ARRAY\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n return PortableTextEditor.getFragment(editorRef.current)\n }, [])\n\n const handleSetCurrentSelectionRect = useCallback(() => {\n const rect = getSelectionBoundingRect()\n setCurrenSelectionRect(rect)\n }, [])\n\n const resetStates = useCallback(() => {\n setCurrentSelection(null)\n setCurrenSelectionRect(null)\n setNextCommentSelection(null)\n setNextCommentValue(null)\n setCanSubmit(false)\n setAuthoringDecorationElement(null)\n setFragment(null)\n }, [])\n\n // Set the next comment selection to the current selection so that we can\n // render the comment input popover on the current selection using a range decoration.\n const handleSelectCurrentSelection = useCallback(() => {\n // When trying to add a comment in \"upsell\" mode, we want to\n // display the upsell dialog instead of the comment input popover.\n if (mode === 'upsell') {\n handleOpenDialog('pte')\n return\n }\n const currentFragment = getFragment() || null\n setFragment(currentFragment)\n setNextCommentSelection(currentSelection)\n }, [currentSelection, getFragment, handleOpenDialog, mode])\n\n // Clear the selection and close the popover when discarding the comment\n const handleCommentDiscardConfirm = useCallback(() => {\n resetStates()\n }, [resetStates])\n\n const textComments = useMemo(() => {\n return comments.data.open\n .filter((c) => isTextSelectionComment(c.parentComment))\n .filter((c) => {\n // Keep the per-editor work proportional to the editor's own comments.\n const fieldPath = parseCommentFieldPath(c.fieldPath)\n return fieldPath ? PathUtils.startsWith(props.path, fieldPath) : false\n })\n .map((c) => c.parentComment)\n }, [comments.data.open, props.path])\n\n const handleSubmit = useCallback(\n (nextValue: CommentMessage) => {\n if (!nextCommentSelection || !editorRef.current) return\n\n const normalizedSelection = nextCommentSelection.backward\n ? {backward: false, anchor: nextCommentSelection.focus, focus: nextCommentSelection.anchor}\n : nextCommentSelection\n\n const fieldPath = getCommentFieldPath(\n documentValueRef.current,\n props.path,\n normalizedSelection.focus.path,\n )\n if (!fieldPath) return\n\n const textSelection = buildTextSelectionFromFragment({\n fragment: fragment || EMPTY_ARRAY,\n selection: normalizedSelection,\n documentValue: documentValueRef.current,\n basePath: props.path,\n })\n\n const threadId = uuid()\n\n void operation.create({\n type: 'field',\n contentSnapshot: fragment,\n fieldPath,\n message: nextValue,\n parentCommentId: undefined,\n reactions: EMPTY_ARRAY,\n selection: textSelection,\n status: 'open',\n threadId,\n })\n\n // Open the inspector when a new comment is added\n onCommentsOpen?.()\n\n // Set the status to 'open' so that the comment is visible\n if (status === 'resolved') {\n setStatus('open')\n }\n\n // Set the selected path to the new comment\n setSelectedPath({\n fieldPath,\n threadId,\n origin: 'form',\n })\n\n // Scroll to the comment\n scrollToGroup(threadId)\n\n resetStates()\n },\n [\n nextCommentSelection,\n operation,\n props.path,\n onCommentsOpen,\n status,\n setSelectedPath,\n scrollToGroup,\n resetStates,\n setStatus,\n fragment,\n ],\n )\n\n const handleDecoratorClick = useCallback(\n (commentId: string) => {\n const comment = getComment(commentId)\n if (!comment) return\n\n setSelectedPath({\n fieldPath: comment.target.path?.field || '',\n threadId: comment.threadId,\n origin: 'form',\n })\n\n onCommentsOpen?.()\n\n scrollToComment(comment._id)\n },\n [getComment, onCommentsOpen, scrollToComment, setSelectedPath],\n )\n\n const blurred = useRef<boolean>(false)\n\n const handleSelectionChange = useCallback(\n (selection: EditorSelection | null) => {\n const isRangeSelected = selection?.anchor.offset !== selection?.focus.offset\n\n const selectedFragment = getFragment()\n const isValidSelection = selectedFragment?.every(isPortableTextTextBlock)\n\n if (!isValidSelection || !isRangeSelected) {\n setCanSubmit(false)\n return\n }\n /**\n * When the portable text editor loses focus we will save the blurred.current to true.\n * Later, when it restores focus the editor will emit a selection change event, but we don't want to immediately show the comment input\n * instead, we want to wait until the user selects a new range.\n */\n if (blurred.current) {\n blurred.current = false\n return\n }\n // If the mouse is not down, we want to set the current selection rect\n // when the selection changes. Otherwise, we want to wait until the mouse\n // is up to set the current selection rect (see `handleMouseUp`).\n if (!mousePressed) {\n handleSetCurrentSelectionRect()\n }\n\n setCurrentSelection(selection)\n setCanSubmit(true)\n },\n [getFragment, handleSetCurrentSelectionRect, mousePressed],\n )\n\n const debounceSelectionChange = useDebounceSelectionChange(handleSelectionChange)\n\n const handleMouseDown = useCallback(() => {\n // A mouse press inside the editor means the selection that follows is\n // made by the user, not restored by a re-focus, so the `blurred` guard\n // in `handleSelectionChange` must not swallow it.\n blurred.current = false\n startTransition(() => setMousePressed(true))\n }, [])\n\n const handleMouseUp = useCallback(() => {\n startTransition(() => setMousePressed(false))\n\n // When the mouse is up, we want to set the current selection rect.\n handleSetCurrentSelectionRect()\n }, [handleSetCurrentSelectionRect])\n\n const handleRangeDecorationMoved = useCallback((details: RangeDecorationOnMovedDetails) => {\n const {rangeDecoration, newSelection} = details\n\n const commentId = rangeDecoration.payload?.commentId as undefined | string\n\n // Update the range decoration with the new selection.\n setAddedCommentsDecorations((prev) => {\n const next = prev.map((p) => {\n if (p.payload?.commentId === commentId) {\n const nextDecoration: RangeDecoration = {\n ...rangeDecoration,\n selection: newSelection,\n payload: {...rangeDecoration.payload, dirty: true},\n }\n return nextDecoration\n }\n return p\n })\n return next\n })\n }, [])\n\n const updateCommentRange = useCallback(() => {\n const decoratorsToUpdate = addedCommentsDecorations.filter(\n (decorator) => decorator.payload?.dirty,\n )\n if (decoratorsToUpdate.length === 0) return\n\n decoratorsToUpdate.forEach((decorator) => {\n const commentId = decorator.payload?.commentId as undefined | string\n const comment = getComment(commentId || '')\n\n // If the comment no longer exists, remove the range decoration.\n if (!comment) {\n return\n }\n\n // The below code will update the comment object to reflect the new selection\n if (!editorRef.current) return\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const editorValue = PortableTextEditor.getValue(editorRef.current) || EMPTY_ARRAY\n\n const [updatedDecoration] = buildRangeDecorationSelectionsFromComments({\n comments: [comment],\n value: editorValue,\n documentValue: documentValueRef.current,\n basePath: props.path,\n })\n\n const nextRange = updatedDecoration?.range ? [updatedDecoration.range] : EMPTY_ARRAY\n\n const nextValue: CommentsTextSelectionItem[] = updatedDecoration\n ? [\n ...(comment.target.path?.selection?.value\n .filter((r) => r._key !== nextRange[0]?._key)\n .concat(nextRange)\n .flat()\n .sort((a, b) => a._key.localeCompare(b._key)) || EMPTY_ARRAY),\n ]\n : EMPTY_ARRAY\n\n const nextComment: CommentUpdatePayload = {\n target: {\n ...comment.target,\n path: {\n ...comment.target?.path,\n field: comment.target.path?.field || '',\n selection: {\n type: 'text',\n value: nextValue,\n },\n },\n },\n }\n\n const hasChanged = !isEqual(comment.target, nextComment.target)\n\n if (hasChanged) {\n void operation.update(comment._id, nextComment)\n }\n })\n\n // Mark the range decorations as not dirty\n setAddedCommentsDecorations((prev) => {\n const next = prev.map((p) => {\n const isDirty = decoratorsToUpdate.find(\n (d) => d.payload?.commentId === p.payload?.commentId,\n )?.payload?.dirty\n\n if (isDirty) {\n const nextDecoration: RangeDecoration = {\n ...p,\n payload: {...p.payload, dirty: false},\n }\n return nextDecoration\n }\n return p\n })\n return next.filter((p) => p.selection !== null)\n })\n }, [addedCommentsDecorations, getComment, operation, props.path])\n\n const handleBuildRangeDecorations = useCallback(\n (commentsToDecorate: CommentDocument[]) => {\n if (!editorRef.current) return EMPTY_ARRAY\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const editorValue = PortableTextEditor.getValue(editorRef.current) || EMPTY_ARRAY\n\n return buildCommentRangeDecorations({\n comments: commentsToDecorate,\n currentHoveredCommentId,\n onDecorationClick: handleDecoratorClick,\n onDecorationHoverEnd: setCurrentHoveredCommentId,\n onDecorationHoverStart: setCurrentHoveredCommentId,\n onDecorationMoved: handleRangeDecorationMoved,\n selectedThreadId: selectedPath?.threadId || null,\n value: editorValue,\n documentValue: documentValueRef.current,\n basePath: props.path,\n })\n },\n [\n currentHoveredCommentId,\n handleDecoratorClick,\n handleRangeDecorationMoved,\n props.path,\n selectedPath?.threadId,\n ],\n )\n\n const onEditorChange = useCallback(\n (change: EditorChange) => {\n if (change.type === 'mutation') {\n updateCommentRange()\n }\n if (change.type === 'blur') {\n blurred.current = true\n }\n if (change.type === 'selection') {\n debounceSelectionChange(change.selection)\n }\n },\n [debounceSelectionChange, updateCommentRange],\n )\n\n // The range decoration for the comment input. This is used to position the\n // comment input popover on the current selection and to highlight the\n // selected text.\n const authoringDecoration = useMemo((): RangeDecoration | null => {\n if (!nextCommentSelection) return null\n\n return {\n component: ({children}) => (\n <CommentInlineHighlightSpan isAuthoring ref={setAuthoringDecorationElement}>\n {children}\n </CommentInlineHighlightSpan>\n ),\n selection: nextCommentSelection,\n }\n }, [nextCommentSelection])\n\n // All the range decorations\n const rangeDecorations: RangeDecoration[] = [\n // Existing range decorations\n ...(props?.rangeDecorations || EMPTY_ARRAY),\n // The range decoration when adding a comment\n ...(authoringDecoration ? [authoringDecoration] : EMPTY_ARRAY),\n // The range decorations for existing comments\n ...addedCommentsDecorations,\n ]\n\n const [currentSelectionIsOverlapping, setCurrentSelectionIsOverlapping] = useState<boolean>(false)\n useEffect(() => {\n startTransition(() =>\n setCurrentSelectionIsOverlapping(() => {\n if (!currentSelection || addedCommentsDecorations.length === 0) return false\n\n return addedCommentsDecorations.some((d) => {\n if (!editorRef.current) return false\n\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const testA = PortableTextEditor.isSelectionsOverlapping(\n editorRef.current,\n currentSelection,\n d.selection,\n )\n\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const testB = PortableTextEditor.isSelectionsOverlapping(\n editorRef.current,\n d.selection,\n currentSelection,\n )\n\n return testA || testB\n })\n }),\n )\n }, [addedCommentsDecorations, currentSelection])\n\n // The scroll element used to update the reference element for the\n // popover on scroll.\n const scrollElement = isFullScreen\n ? document.body\n : portal.elements?.documentScrollElement || document.body\n\n // The boundary element used to position the popover properly\n // inside the editor.\n const boundaryElement = isFullScreen\n ? portal.elements?.documentScrollElement || document.body\n : rootElement\n\n const popoverAuthoringReferenceElement = useAuthoringReferenceElement({\n scrollElement,\n disabled: !nextCommentSelection || !authoringDecorationElement,\n selector: '[data-inline-comment-state=\"authoring\"]',\n })\n\n const selectionReferenceElement = useMemo(() => {\n if (!currentSelectionRect) return null\n\n return {\n getBoundingClientRect: () => currentSelectionRect,\n } as HTMLElement\n }, [currentSelectionRect])\n\n // This effect is needed to update the reference element for the popover\n // when the current selection changes so that it is always positioned\n // on the current selection.\n useEffect(() => {\n if (!currentSelection) return undefined\n scrollElement?.addEventListener('wheel', handleSetCurrentSelectionRect)\n\n return () => {\n scrollElement?.removeEventListener('wheel', handleSetCurrentSelectionRect)\n }\n }, [currentSelection, scrollElement, handleSetCurrentSelectionRect])\n\n // This is effect is needed to handle remote changes to the comments.\n // That is, when another user adds, updates or deletes a comment, we need\n // to update the range decorations to reflect these changes in the UI.\n useEffect(() => {\n const nextDecorations = handleBuildRangeDecorations(textComments)\n\n // The `dirty` flag is used to keep track of range decorations that\n // have been moved. When a range decoration is moved, we need to update\n // the comment document. However, when receiving updates from the server,\n // the `dirty` flag will be removed. Therefore, we need to make sure\n // that the `dirty` flag is preserved so that we can update the comment.\n startTransition(() =>\n setAddedCommentsDecorations((current) => {\n return nextDecorations.map((nextDecoration) => {\n const prevDecoration = current.find(\n (p) => p.payload?.commentId === nextDecoration.payload?.commentId,\n )\n\n if (prevDecoration?.payload?.dirty) {\n return {\n ...nextDecoration,\n payload: {...nextDecoration.payload, dirty: prevDecoration.payload.dirty},\n }\n }\n\n return nextDecoration\n })\n }),\n )\n }, [handleBuildRangeDecorations, textComments])\n\n const showFloatingButton = Boolean(\n currentSelection && canSubmit && selectionReferenceElement && !mousePressed,\n )\n const showFloatingInput = Boolean(nextCommentSelection && popoverAuthoringReferenceElement)\n\n return (\n <>\n <BoundaryElementProvider element={boundaryElement}>\n {showFloatingInput && currentUser && (\n <InlineCommentInputPopover\n currentUser={currentUser}\n mentionOptions={mentionOptions}\n onChange={setNextCommentValue}\n onClickOutside={resetStates}\n onDiscardConfirm={handleCommentDiscardConfirm}\n onSubmit={handleSubmit}\n referenceElement={popoverAuthoringReferenceElement}\n value={nextCommentValue}\n />\n )}\n <AnimatePresence>\n {showFloatingButton && !showFloatingInput && (\n <FloatingButtonPopover\n disabled={currentSelectionIsOverlapping || Boolean(addonDatasetError)}\n onClick={handleSelectCurrentSelection}\n onClickOutside={resetStates}\n referenceElement={selectionReferenceElement}\n />\n )}\n </AnimatePresence>\n </BoundaryElementProvider>\n\n <Stack ref={setRootElement} onMouseDown={handleMouseDown} onMouseUp={handleMouseUp}>\n <RenderDefaultCommentsPortableTextInputInner\n {...props}\n onEditorChange={onEditorChange}\n editorRef={editorRef}\n rangeDecorations={rangeDecorations}\n onFullScreenChange={setIsFullScreen}\n />\n </Stack>\n </>\n )\n})\n\n// Workaround for react compiler restrictions on refs triggered by the debounce wrapper\nfunction useDebounceSelectionChange(\n handleSelectionChange: (selection: EditorSelection | null) => void,\n) {\n return useMemo(() => debounce(handleSelectionChange, 200), [handleSelectionChange])\n}\n// Used to workaround restrictions on passing refs to functions in react compiler\nfunction RenderDefaultCommentsPortableTextInputInner(\n props: React.ComponentProps<typeof CommentsPortableTextInputInner>,\n) {\n return props.renderDefault(props)\n}\n","import {isArrayOfBlocksSchemaType} from '@sanity/types'\n\nimport {type InputProps, type PortableTextInputProps} from '../../../form/types/inputProps'\nimport {CommentsPortableTextInput} from './components/CommentsPortableTextInput'\n\nfunction isPortableTextInputProps(\n inputProps: InputProps | Omit<InputProps, 'renderDefault'>,\n): inputProps is PortableTextInputProps {\n return isArrayOfBlocksSchemaType(inputProps.schemaType)\n}\n\nexport function CommentsInput(props: InputProps) {\n if (isPortableTextInputProps(props)) {\n return <CommentsPortableTextInput {...props} />\n }\n\n return props.renderDefault(props)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,SAASG,0BAA0BC,UAAqC;CACtE,IAAI,CAACA,YAAY,CAACA,SAASG,QAAQ,OAAO;CAE1C,IAAMC,QAAQJ,SAASK,KAAKC,OAAOA,GAAGC,sBAAsB,CAAC,GAEvDC,OAAOC,KAAKC,IAAI,GAAGN,MAAMC,KAAKM,MAAMA,EAAEC,CAAC,CAAC,KAAK,GAC7CC,OAAOJ,KAAKC,IAAI,GAAGN,MAAMC,KAAKM,MAAMA,EAAEG,CAAC,CAAC,KAAK,GAC7CC,WAAWN,KAAKO,IAAI,GAAGZ,MAAMC,KAAKM,MAAMA,EAAEM,KAAK,CAAC,KAAK,GACrDC,YAAYT,KAAKO,IAAI,GAAGZ,MAAMC,KAAKM,MAAMA,EAAEQ,MAAM,CAAC,KAAK;CAE7D,OAAO;EACLP,GAAGJ;EACHM,GAAGD;EACHO,OAAOL,WAAWP;EAClBa,QAAQH,YAAYL;EACpBS,KAAKT;EACLI,OAAOF;EACPI,QAAQD;EACRK,MAAMf;CACR;AACF;;;;;AAYA,SAAAqB,oBAAAC,OAAA;CAAA,IAAAC,IAAAC,EAAA,CAAA,GACE,EAAAP,eAAAE,UAAAC,aAA4CE,OAC5C,CAAAG,MAAAC,WAAwBpC,SAAyB,IAAI,GAACqC,IAAAC;CAuBf,OAvBeL,EAAA,OAAAJ,YAAAI,EAAA,OAAAN,iBAAAM,EAAA,OAAAH,YAE5CO,WAAA;EACR,IAAIR,UAAQ;EAEZ,IAAAU,sBAAsB;GACpB,IAAArC,WAAiBsC,UAAQC,iB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+J;AAAc;AAlGW,SAAAlG,OAAAK,WAAA;CAAA,OAyQvBA,UAASd,SAAeK;AAAA;AAzQD,SAAAuB,OAAAiF,GAAAC,GAAA;CAAA,OA0SdD,EAACrF,KAAKuF,cAAeD,EAACtF,IAAK;AAAC;AA1Sd,SAAAe,OAAAyE,KAAA;CAAA,OAmVZ7G,IAACzC,cAAe;AAAI;AC/ZpD,SAAS2J,yBACPC,YACsC;CACtC,OAAOL,0BAA0BK,WAAWE,UAAU;AACxD;AAEA,SAAOC,cAAAC,OAAA;CAAA,IAAAC,IAAAC,EAAA,CAAA;CACL,IAAIP,yBAAyBK,KAAK,GAAC;EAAA,IAAAG;EACc,OADdF,EAAA,OAAAD,QACcG,KAAAF,EAAA,MAAxCE,KAAA,oBAAC,2BAAD,EAA0B,GAAKH,MAAK,CAAA,GAAIC,EAAA,KAAAD,OAAAC,EAAA,KAAAE,KAAxCA;CAAwC;CAChD,IAAAA;CAEgC,OAFhCF,EAAA,OAAAD,QAEgCG,KAAAF,EAAA,MAA1BE,KAAAH,MAAKI,cAAeJ,KAAK,GAACC,EAAA,KAAAD,OAAAC,EAAA,KAAAE,KAA1BA;AAA0B"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { r as Popover$1 } from "./ConfirmPopover-CD1rDyuk.js";
|
|
2
2
|
import { a as Button$1, r as MenuButton$1, t as MenuItem$1 } from "./MenuItem-BWdL61CI.js";
|
|
3
|
-
import { p as useCurrentUser } from "./datastores-
|
|
3
|
+
import { p as useCurrentUser } from "./datastores-DpJ5Y313.js";
|
|
4
4
|
import { t as useTranslation } from "./useTranslation-Cqs6Itwv.js";
|
|
5
|
-
import { b as commentsLocaleNamespace, f as isTextSelectionComment, t as useComments, y as useCommentsScroll } from "./useComments-
|
|
6
|
-
import { r as CommentDeleteDialog } from "./CommentsListItem-
|
|
7
|
-
import { n as CommentsList, t as useCommentsTelemetry } from "./useCommentsTelemetry-
|
|
5
|
+
import { b as commentsLocaleNamespace, f as isTextSelectionComment, t as useComments, y as useCommentsScroll } from "./useComments-DuEOnDkA.js";
|
|
6
|
+
import { r as CommentDeleteDialog } from "./CommentsListItem-C2Ac0esL.js";
|
|
7
|
+
import { n as CommentsList, t as useCommentsTelemetry } from "./useCommentsTelemetry-BgNdQdz5.js";
|
|
8
8
|
import { t as useAddonDataset } from "./useAddonDataset-BvCgByG6.js";
|
|
9
9
|
import { t as useCommentsEnabled } from "./useCommentsEnabled-BPc3788v.js";
|
|
10
10
|
import { t as useCommentsSelectedPath } from "./useCommentsSelectedPath-D5HXM3NF.js";
|
|
@@ -488,4 +488,4 @@ function _temp(x) {
|
|
|
488
488
|
}
|
|
489
489
|
export { CommentsInspector };
|
|
490
490
|
|
|
491
|
-
//# sourceMappingURL=CommentsInspector-
|
|
491
|
+
//# sourceMappingURL=CommentsInspector-DTHmjTFc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentsInspector-DtBIUadl.js","names":["Box","Flex","Stack","Text","keyframes","styled","Button","Popover","PopoverProps","useTranslation","commentsLocaleNamespace","Root","fadeInKeyFrame","StyledPopover","CommentsOnboardingPopoverProps","Omit","onDismiss","CommentsOnboardingPopover","props","$","_c","rest","t","t0","t1","t2","t3","t4","t5","t6","t7","Box","Container","UpsellData","UpsellPanel","CommentsUpsellPanelProps","data","onPrimaryClick","onSecondaryClick","CommentsUpsellPanel","props","$","_c","t0","useContext","CommentsOnboardingContext","CommentsOnboardingContextValue","useCommentsOnboarding","ctx","Error","Box","Card","Stack","Text","useTranslation","commentsLocaleNamespace","CommentsInspectorError","t0","$","_c","error","t","t1","t2","t3","message","t4","CheckmarkIcon","ChevronDownIcon","CloseIcon","Card","Flex","Menu","Text","useCallback","RefAttributes","styled","Button","MenuButton","MenuItem","useTranslation","commentsLocaleNamespace","CommentStatus","CommentsUIMode","Root","position","zIndex","lineHeight","CommentsInspectorHeaderProps","onClose","onViewChange","view","mode","CommentsInspectorHeader","props","$","_c","t","ref","t0","handleSetOpenView","t1","handleSetResolvedView","t2","t3","t4","t5","t6","Symbol","for","width","t7","undefined","t8","t9","t10","t11","t12","content","t13","t14","t15","t16","placement","t17","t18","t19","t20","t21","t22","t23","t24","Flex","Layer","useClickOutsideEvent","useLayer","useToast","PathUtils","Fragment","useCallback","useEffect","useMemo","useRef","useState","styled","DocumentInspectorProps","useTranslation","useCurrentUser","useAddonDataset","CommentDeleteDialog","CommentsList","CommentsOnboardingPopover","CommentsUpsellPanel","CommentsSelectedPath","isTextSelectionComment","useComments","useCommentsEnabled","useCommentsOnboarding","useCommentsScroll","useCommentsSelectedPath","useCommentsTelemetry","useCommentsUpsell","commentsLocaleNamespace","CommentBaseCreatePayload","CommentReactionOption","CommentStatus","CommentsUIMode","CommentUpdatePayload","CommentsInspectorError","CommentsInspectorHeader","CommentToDelete","commentId","isParent","RootLayer","CommentsInspector","props","$","_c","enabled","mode","t0","CommentsInspectorInner","t","onClose","showDeleteDialog","setShowDeleteDialog","commentToDelete","setCommentToDelete","deleteLoading","setDeleteLoading","deleteError","setDeleteError","rootRef","rootElement","setRootElement","currentUser","comments","getComment","isCreatingDataset","mentionOptions","setStatus","status","operation","selectedCommentId","getCommentLink","onClearSelectedComment","onPathOpen","commentIdParamRef","error","addonDatasetError","didScrollToCommentFromParam","pushToast","push","isTopLayer","boundaryElement","scrollToComment","scrollToField","scrollToInlineComment","selectedPath","setSelectedPath","isDismissed","setDismissed","telemetry","upsellData","telemetryLogs","upsellTelemetryLogs","currentComments","data","loading","t1","nextView","commentListViewChanged","handleChangeView","t2","handleCloseInspector","t3","bb0","undefined","t4","id","navigator","clipboard","writeText","catch","closable","title","commentLinkCopied","copyLink","handleCopyLink","id_0","comment","create","type","fieldPath","target","path","field","_id","message","parentCommentId","reactions","threadId","handleCreateRetry","t5","closeDeleteDialog","t6","open","nextPath","fromString","isInlineComment","filter","c","some","_temp","handlePathSelect","t7","nextComment","payload","origin","handleNewThreadCreate","t8","nextComment_0","handleReply","t9","id_1","nextComment_1","update","handleEdit","t10","id_2","parent","find","c_0","parentComment","Boolean","replies","length","onDeleteStart","t11","id_3","remove","t12","err","handleDeleteConfirm","id_4","nextStatus","comment_0","handleStatusChange","t13","id_5","reaction","react","handleReactionSelect","t14","handleDeselectPath","t15","Symbol","for","element","current","setRootRef","t16","event","isPTETarget","HTMLElement","hasAttribute","t17","loggedTelemetry","setLoggedTelemetry","t18","panelViewed","panelDismissed","t19","t20","t21","t22","commentToScrollTo","requestAnimationFrame","commentViewedFromLink","t23","bb1","t24","panelPrimaryClicked","panelSecondaryClicked","beforeListNode","t25","t26","t27","t28","t29","t30","t31","x"],"sources":["../src/core/comments/components/onboarding/CommentsOnboardingPopover.tsx","../src/core/comments/components/upsell/CommentsUpsellPanel.tsx","../src/core/comments/hooks/useCommentsOnboarding.ts","../src/core/comments/plugin/inspector/CommentsInspectorError.tsx","../src/core/comments/plugin/inspector/CommentsInspectorHeader.tsx","../src/core/comments/plugin/inspector/CommentsInspector.tsx"],"sourcesContent":["import {Box, Flex, Stack, Text} from '@sanity/ui'\nimport {keyframes, styled} from 'styled-components'\n\nimport {Button} from '../../../../ui-components/button/Button'\nimport {Popover, type PopoverProps} from '../../../../ui-components/popover/Popover'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {commentsLocaleNamespace} from '../../i18n'\n\nconst Root = styled(Box)`\n max-width: 280px;\n`\n\nconst fadeInKeyFrame = keyframes`\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n`\n\nconst StyledPopover = styled(Popover)`\n opacity: 0;\n // Fade in the popover after 500ms\n animation: ${fadeInKeyFrame} 200ms 500ms forwards;\n`\n\ninterface CommentsOnboardingPopoverProps extends Omit<PopoverProps, 'content'> {\n // ...\n onDismiss: () => void\n}\n\nexport function CommentsOnboardingPopover(props: CommentsOnboardingPopoverProps) {\n const {onDismiss, ...rest} = props\n const {t} = useTranslation(commentsLocaleNamespace)\n\n return (\n <StyledPopover\n content={\n <Root padding={4}>\n <Stack gap={3}>\n <Text weight=\"medium\" size={1}>\n {t('onboarding.header')}\n </Text>\n\n <Text size={1}>{t('onboarding.body')}</Text>\n\n <Flex justify=\"flex-end\" marginTop={2}>\n <Button text={t('onboarding.dismiss')} tone=\"primary\" onClick={onDismiss} />\n </Flex>\n </Stack>\n </Root>\n }\n open\n portal\n {...rest}\n />\n )\n}\n","import {Box, Container} from '@sanity/ui'\n\nimport {type UpsellData} from '../../../studio/upsell/types'\nimport {UpsellPanel} from '../../../studio/upsell/UpsellPanel'\n\ninterface CommentsUpsellPanelProps {\n data: UpsellData\n onPrimaryClick: () => void\n onSecondaryClick: () => void\n}\n\nexport function CommentsUpsellPanel(props: CommentsUpsellPanelProps) {\n const {data, onPrimaryClick, onSecondaryClick} = props\n return (\n <Container width={1}>\n <Box marginBottom={6}>\n <UpsellPanel\n data={data}\n onPrimaryClick={onPrimaryClick}\n onSecondaryClick={onSecondaryClick}\n />\n </Box>\n </Container>\n )\n}\n","import {useContext} from 'react'\nimport {CommentsOnboardingContext} from 'sanity/_singletons'\n\nimport {type CommentsOnboardingContextValue} from '../context/onboarding/types'\n\nexport function useCommentsOnboarding(): CommentsOnboardingContextValue {\n const ctx = useContext(CommentsOnboardingContext)\n\n if (!ctx) {\n throw new Error('useCommentsOnboarding: missing context value')\n }\n\n return ctx\n}\n","import {Box, Card, Stack, Text} from '@sanity/ui'\n\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {commentsLocaleNamespace} from '../../i18n'\n\nexport function CommentsInspectorError({error}: {error: Error}) {\n const {t} = useTranslation(commentsLocaleNamespace)\n\n return (\n <Box padding={2}>\n <Card paddingX={2} paddingY={3} tone=\"critical\" border radius={3}>\n <Stack gap={3}>\n <Text size={1} weight=\"medium\">\n {t('inspector-error.title')}\n </Text>\n <Text size={1} muted>\n {error.message}\n </Text>\n </Stack>\n </Card>\n </Box>\n )\n}\n","import {CheckmarkIcon} from '@sanity/icons/Checkmark'\nimport {ChevronDownIcon} from '@sanity/icons/ChevronDown'\nimport {CloseIcon} from '@sanity/icons/Close'\nimport {Card, Flex, Menu, Text} from '@sanity/ui'\nimport {useCallback, type RefAttributes} from 'react'\nimport {styled} from 'styled-components'\n\nimport {Button} from '../../../../ui-components/button/Button'\nimport {MenuButton} from '../../../../ui-components/menuButton/MenuButton'\nimport {MenuItem} from '../../../../ui-components/menuItem/MenuItem'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {type CommentStatus, type CommentsUIMode} from '../../types'\n\nconst Root = styled(Card)({\n position: 'relative',\n zIndex: '1',\n lineHeight: '0',\n})\n\ninterface CommentsInspectorHeaderProps {\n onClose: () => void\n onViewChange: (view: CommentStatus) => void\n view: CommentStatus\n mode: CommentsUIMode\n}\n\nexport function CommentsInspectorHeader(\n props: CommentsInspectorHeaderProps & RefAttributes<HTMLDivElement>,\n) {\n const {t} = useTranslation(commentsLocaleNamespace)\n const {ref, onClose, onViewChange, view, mode} = props\n\n const handleSetOpenView = useCallback(() => onViewChange('open'), [onViewChange])\n const handleSetResolvedView = useCallback(() => onViewChange('resolved'), [onViewChange])\n\n return (\n <Root ref={ref}>\n <Flex padding={2}>\n <Flex align=\"center\" flex={1} gap={2} paddingY={2} padding={3}>\n <Text as=\"h1\" size={1} weight=\"medium\">\n {t('feature-name')}\n </Text>\n </Flex>\n\n <Flex flex=\"none\" padding={1} gap={2}>\n <MenuButton\n id=\"comment-status-menu-button\"\n button={\n <Button\n text={\n view === 'open'\n ? t('status-filter.status-open')\n : t('status-filter.status-resolved')\n }\n mode=\"bleed\"\n iconRight={ChevronDownIcon}\n />\n }\n menu={\n <Menu style={{width: '180px'}}>\n <MenuItem\n iconRight={view === 'open' ? CheckmarkIcon : undefined}\n onClick={handleSetOpenView}\n text={t('status-filter.status-open-full')}\n />\n <MenuItem\n iconRight={view === 'resolved' ? CheckmarkIcon : undefined}\n onClick={handleSetResolvedView}\n text={t('status-filter.status-resolved-full')}\n tooltipProps={\n mode === 'upsell'\n ? {content: t('status-filter.status-resolved-full-upsell')}\n : undefined\n }\n disabled={mode === 'upsell'}\n />\n </Menu>\n }\n popover={{placement: 'bottom-end'}}\n />\n\n <Button\n aria-label={t('close-pane-button-text-aria-label')}\n icon={CloseIcon}\n mode=\"bleed\"\n onClick={onClose}\n tooltipProps={{content: t('close-pane-button-text')}}\n />\n </Flex>\n </Flex>\n </Root>\n )\n}\n","import {Flex, Layer, useClickOutsideEvent, useLayer, useToast} from '@sanity/ui'\nimport * as PathUtils from '@sanity/util/paths'\nimport {Fragment, useCallback, useEffect, useMemo, useRef, useState} from 'react'\nimport {styled} from 'styled-components'\n\nimport {type DocumentInspectorProps} from '../../../config/document/inspector'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {useCurrentUser} from '../../../store/user/hooks'\nimport {useAddonDataset} from '../../../studio/addonDataset/useAddonDataset'\nimport {CommentDeleteDialog} from '../../components/CommentDeleteDialog'\nimport {CommentsList} from '../../components/list/CommentsList'\nimport {CommentsOnboardingPopover} from '../../components/onboarding/CommentsOnboardingPopover'\nimport {CommentsUpsellPanel} from '../../components/upsell/CommentsUpsellPanel'\nimport {type CommentsSelectedPath} from '../../context/selected-path/types'\nimport {isTextSelectionComment} from '../../helpers'\nimport {useComments} from '../../hooks/useComments'\nimport {useCommentsEnabled} from '../../hooks/useCommentsEnabled'\nimport {useCommentsOnboarding} from '../../hooks/useCommentsOnboarding'\nimport {useCommentsScroll} from '../../hooks/useCommentsScroll'\nimport {useCommentsSelectedPath} from '../../hooks/useCommentsSelectedPath'\nimport {useCommentsTelemetry} from '../../hooks/useCommentsTelemetry'\nimport {useCommentsUpsell} from '../../hooks/useCommentsUpsell'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {\n type CommentBaseCreatePayload,\n type CommentReactionOption,\n type CommentStatus,\n type CommentsUIMode,\n type CommentUpdatePayload,\n} from '../../types'\nimport {CommentsInspectorError} from './CommentsInspectorError'\nimport {CommentsInspectorHeader} from './CommentsInspectorHeader'\n\ninterface CommentToDelete {\n commentId: string\n isParent: boolean\n}\n\nconst RootLayer = styled(Layer)`\n display: flex;\n flex-direction: column;\n height: 100%;\n overflow: hidden;\n`\n\nexport function CommentsInspector(props: DocumentInspectorProps) {\n const {enabled, mode} = useCommentsEnabled()\n\n if (!enabled) return null\n\n // We wrap the comments inspector in a Layer in order to know when the comments inspector\n // is the top layer (that is, if there is e.g. a popover open). This is used to determine\n // if we should deselect the selected path when clicking outside the comments inspector.\n return (\n <RootLayer>\n <CommentsInspectorInner {...props} mode={mode} />\n </RootLayer>\n )\n}\n\nfunction CommentsInspectorInner(\n props: DocumentInspectorProps & {\n mode: CommentsUIMode\n },\n) {\n const {t} = useTranslation(commentsLocaleNamespace)\n const {onClose, mode} = props\n const [showDeleteDialog, setShowDeleteDialog] = useState<boolean>(false)\n const [commentToDelete, setCommentToDelete] = useState<CommentToDelete | null>(null)\n const [deleteLoading, setDeleteLoading] = useState<boolean>(false)\n const [deleteError, setDeleteError] = useState<Error | null>(null)\n\n const rootRef = useRef<HTMLDivElement | null>(null)\n const [rootElement, setRootElement] = useState<HTMLDivElement | null>(null)\n\n const currentUser = useCurrentUser()\n const {\n comments,\n getComment,\n isCreatingDataset,\n mentionOptions,\n setStatus,\n status,\n operation,\n selectedCommentId,\n getCommentLink,\n onClearSelectedComment,\n onPathOpen,\n } = useComments()\n const commentIdParamRef = useRef<string | undefined>(selectedCommentId)\n const {error: addonDatasetError} = useAddonDataset()\n const didScrollToCommentFromParam = useRef<boolean>(false)\n\n const pushToast = useToast().push\n const {isTopLayer} = useLayer()\n\n const {scrollToComment, scrollToField, scrollToInlineComment} = useCommentsScroll({\n boundaryElement: rootElement,\n })\n const {selectedPath, setSelectedPath} = useCommentsSelectedPath()\n const {isDismissed, setDismissed} = useCommentsOnboarding()\n const telemetry = useCommentsTelemetry()\n\n const {upsellData, telemetryLogs: upsellTelemetryLogs} = useCommentsUpsell()\n\n const currentComments = useMemo(() => comments.data[status], [comments, status])\n\n const {loading} = comments\n\n const handleChangeView = useCallback(\n (nextView: CommentStatus) => {\n setStatus(nextView)\n setSelectedPath(null)\n\n telemetry.commentListViewChanged(nextView)\n },\n [setSelectedPath, setStatus, telemetry],\n )\n\n const handleCloseInspector = useCallback(() => {\n onClose()\n setSelectedPath(null)\n }, [onClose, setSelectedPath])\n\n const handleCopyLink = useMemo(() => {\n if (!getCommentLink) return undefined\n\n const copyLink = (id: string) => {\n navigator.clipboard.writeText(getCommentLink(id)).catch(() => {\n pushToast({\n closable: true,\n status: 'error',\n title: t('copy-link-error-message'),\n })\n })\n\n telemetry.commentLinkCopied()\n }\n\n return copyLink\n }, [getCommentLink, pushToast, t, telemetry])\n\n const handleCreateRetry = useCallback(\n (id: string) => {\n const comment = getComment(id)\n if (!comment) return\n\n void operation.create({\n type: 'field',\n fieldPath: comment.target.path?.field || '',\n id: comment._id,\n message: comment.message,\n parentCommentId: comment.parentCommentId,\n reactions: comment.reactions || [],\n status: comment.status,\n threadId: comment.threadId,\n })\n },\n [getComment, operation],\n )\n\n const closeDeleteDialog = useCallback(() => {\n if (deleteLoading) return\n setShowDeleteDialog(false)\n setCommentToDelete(null)\n }, [deleteLoading])\n\n const handlePathSelect = useCallback(\n (nextPath: CommentsSelectedPath) => {\n setSelectedPath(nextPath)\n\n if (nextPath?.fieldPath) {\n const path = PathUtils.fromString(nextPath.fieldPath)\n onPathOpen?.(path)\n\n scrollToField(nextPath.fieldPath)\n\n const isInlineComment = comments.data.open\n .filter((c) => c.threadId === nextPath?.threadId)\n .some((x) => isTextSelectionComment(x.parentComment))\n\n if (isInlineComment && nextPath.threadId) {\n scrollToInlineComment(nextPath.threadId)\n }\n }\n },\n [comments.data.open, onPathOpen, scrollToField, scrollToInlineComment, setSelectedPath],\n )\n\n const handleNewThreadCreate = useCallback(\n (nextComment: CommentBaseCreatePayload) => {\n const fieldPath = nextComment?.payload?.fieldPath || ''\n\n void operation.create({\n type: 'field',\n fieldPath,\n message: nextComment.message,\n parentCommentId: nextComment.parentCommentId,\n reactions: nextComment.reactions,\n status: nextComment.status,\n threadId: nextComment.threadId,\n })\n\n setSelectedPath({\n fieldPath,\n origin: 'inspector',\n threadId: nextComment.threadId,\n })\n },\n [operation, setSelectedPath],\n )\n\n const handleReply = useCallback(\n (nextComment: CommentBaseCreatePayload) => {\n void operation.create({\n ...nextComment,\n type: 'field',\n fieldPath: nextComment?.payload?.fieldPath || '',\n })\n },\n [operation],\n )\n\n const handleEdit = useCallback(\n (id: string, nextComment: CommentUpdatePayload) => {\n void operation.update(id, nextComment)\n },\n [operation],\n )\n\n const onDeleteStart = useCallback(\n (id: string) => {\n const parent = currentComments.find((c) => c.parentComment?._id === id)\n const isParent = Boolean(parent && parent?.replies?.length > 0)\n\n setShowDeleteDialog(true)\n setCommentToDelete({\n commentId: id,\n isParent,\n })\n },\n\n [currentComments],\n )\n\n const handleDeleteConfirm = useCallback(\n async (id: string) => {\n try {\n setDeleteLoading(true)\n await operation.remove(id)\n closeDeleteDialog()\n } catch (err) {\n setDeleteError(err)\n }\n setDeleteLoading(false)\n },\n [closeDeleteDialog, operation],\n )\n\n const handleStatusChange = useCallback(\n (id: string, nextStatus: CommentStatus) => {\n void operation.update(id, {\n status: nextStatus,\n })\n\n // If the comment is being opened, we want to change to the \"open\" view\n // and scroll to the comment\n if (nextStatus === 'open') {\n setStatus('open')\n\n const comment = getComment(id)\n\n if (!comment) return\n\n setSelectedPath({\n fieldPath: comment.target.path?.field || null,\n origin: 'inspector',\n threadId: comment.threadId || null,\n })\n\n scrollToComment(id)\n }\n },\n [getComment, operation, scrollToComment, setSelectedPath, setStatus],\n )\n\n const handleReactionSelect = useCallback(\n (id: string, reaction: CommentReactionOption) => {\n void operation.react(id, reaction)\n },\n [operation],\n )\n\n const handleDeselectPath = useCallback(() => {\n // Clear the selected path when:\n // - Clicking outside the inspector when it's the top layer\n // - The target is not a slate editor string. This is needed because we do not want to\n // frequently deselect the selected path when clicking inside the editor.\n if (selectedPath && isTopLayer) {\n setSelectedPath(null)\n }\n }, [isTopLayer, selectedPath, setSelectedPath])\n\n const setRootRef = useCallback((element: HTMLDivElement | null) => {\n rootRef.current = element\n setRootElement(element)\n }, [])\n\n useClickOutsideEvent(\n (event) => {\n // Clear the selected path when clicking outside the comments inspector.\n // We do this only when the comments inspector is the top layer.\n const isPTETarget =\n event.target instanceof HTMLElement && event.target?.hasAttribute('data-pt-text')\n\n if (!isPTETarget) {\n handleDeselectPath()\n }\n },\n () => [rootRef.current],\n )\n\n const [loggedTelemetry, setLoggedTelemetry] = useState(false)\n useEffect(() => {\n if (loggedTelemetry || mode !== 'upsell') return undefined\n // oxlint-disable-next-line react/react-compiler\n setLoggedTelemetry(true)\n if (selectedPath?.origin === 'form') {\n upsellTelemetryLogs.panelViewed('field_action')\n } else if (commentIdParamRef.current) {\n upsellTelemetryLogs.panelViewed('link')\n } else {\n upsellTelemetryLogs.panelViewed('document_action')\n }\n return () => {\n upsellTelemetryLogs.panelDismissed()\n }\n }, [loggedTelemetry, mode, selectedPath?.origin, upsellTelemetryLogs])\n\n // Handle scroll to comment from URL param\n useEffect(() => {\n // Make sure that the comment exists before we try to scroll to it.\n // We can't solely rely on the comment id from the url since the comment might not be loaded yet.\n const commentToScrollTo = getComment(commentIdParamRef.current || '')\n\n if (!loading && commentToScrollTo && !didScrollToCommentFromParam.current) {\n // Make sure we have the correct status set before we scroll to the comment\n setStatus(commentToScrollTo.status || 'open')\n\n handlePathSelect({\n fieldPath: commentToScrollTo.target.path?.field || null,\n origin: 'url',\n threadId: commentToScrollTo.threadId || null,\n })\n\n // Defer the comment scroll to prevent React batching from overwriting the field scroll\n requestAnimationFrame(() => {\n scrollToComment(commentToScrollTo._id)\n })\n\n didScrollToCommentFromParam.current = true\n commentIdParamRef.current = undefined\n\n onClearSelectedComment?.()\n\n telemetry.commentViewedFromLink()\n }\n }, [\n getComment,\n handlePathSelect,\n loading,\n onClearSelectedComment,\n scrollToComment,\n setStatus,\n telemetry,\n ])\n\n const beforeListNode = useMemo(() => {\n if (mode === 'upsell' && upsellData) {\n return (\n <CommentsUpsellPanel\n data={upsellData}\n onPrimaryClick={upsellTelemetryLogs.panelPrimaryClicked}\n onSecondaryClick={upsellTelemetryLogs.panelSecondaryClicked}\n />\n )\n }\n\n return null\n }, [\n mode,\n upsellTelemetryLogs.panelPrimaryClicked,\n upsellTelemetryLogs.panelSecondaryClicked,\n upsellData,\n ])\n\n return (\n <Fragment>\n {commentToDelete && showDeleteDialog && (\n <CommentDeleteDialog\n {...commentToDelete}\n error={deleteError}\n loading={deleteLoading}\n onClose={closeDeleteDialog}\n onConfirm={handleDeleteConfirm}\n />\n )}\n\n <Flex\n direction=\"column\"\n flex={1}\n height=\"fill\"\n onClick={handleDeselectPath}\n overflow=\"hidden\"\n ref={setRootRef}\n >\n <CommentsOnboardingPopover\n onDismiss={setDismissed}\n open={!isDismissed}\n placement=\"left-start\"\n >\n <CommentsInspectorHeader\n onClose={handleCloseInspector}\n onViewChange={handleChangeView}\n view={status}\n mode={mode}\n />\n </CommentsOnboardingPopover>\n {addonDatasetError && <CommentsInspectorError error={addonDatasetError} />}\n {currentUser && (\n <CommentsList\n beforeListNode={beforeListNode}\n comments={currentComments}\n currentUser={currentUser}\n error={comments.error}\n loading={loading}\n mentionOptions={mentionOptions}\n mode={mode}\n onCopyLink={handleCopyLink}\n onCreateRetry={handleCreateRetry}\n onDelete={onDeleteStart}\n onEdit={handleEdit}\n onNewThreadCreate={handleNewThreadCreate}\n onPathSelect={handlePathSelect}\n onReactionSelect={handleReactionSelect}\n onReply={handleReply}\n onStatusChange={handleStatusChange}\n readOnly={isCreatingDataset}\n selectedPath={selectedPath}\n status={status}\n />\n )}\n </Flex>\n </Fragment>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAQA,MAAMW,SAAON,OAAOL,GAAG,CAAC,CAAA,WAAA;;;sBAIlBY,iBAAiBR,SAAS,kCAS1BS,gBAAgBR,OAAOE,SAAO,CAAC,CAAA,WAAA;;;AAGtBK,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AAA1I,EAAA,SAAA2K,OAAA3K,EAAA,SAAA4K,OAAA5K,EAAA,SAAA6K,OA3CHC,MAAA,qBAAC,MAAD;EACY,WAAA;EACJ,MAAA;EACC,QAAA;EACEpC,SAAAA;EACA,UAAA;EACJM,KAAAA;EANP,UAAA;GAQE2B;GAYCC;GACAC;EArBE;KA4CE7K,EAAA,OAAA0I,oBAAA1I,EAAA,OAAA2K,KAAA3K,EAAA,OAAA4K,KAAA5K,EAAA,OAAA6K,KAAA7K,EAAA,OAAA8K,OAAAA,MAAA9K,EAAA;CAAA,IAAA+K;CACE,OADF/K,EAAA,SAAAqK,OAAArK,EAAA,SAAA8K,OAvDTC,MAAA,qBAAC,UAAD,EAAA,UAAA,CACGV,KAUDS,GAXO,EAAA,CAAA,GAwDE9K,EAAA,OAAAqK,KAAArK,EAAA,OAAA8K,KAAA9K,EAAA,OAAA+K,OAAAA,MAAA/K,EAAA,MAxDX+K;AAwDW;AAzYf,SAAA9E,MAAA+E,GAAA;CAAA,OAuHuBtM,uBAAuBsM,EAAC3D,aAAc;AAAC"}
|
|
1
|
+
{"version":3,"file":"CommentsInspector-DTHmjTFc.js","names":["Box","Flex","Stack","Text","keyframes","styled","Button","Popover","PopoverProps","useTranslation","commentsLocaleNamespace","Root","fadeInKeyFrame","StyledPopover","CommentsOnboardingPopoverProps","Omit","onDismiss","CommentsOnboardingPopover","props","$","_c","rest","t","t0","t1","t2","t3","t4","t5","t6","t7","Box","Container","UpsellData","UpsellPanel","CommentsUpsellPanelProps","data","onPrimaryClick","onSecondaryClick","CommentsUpsellPanel","props","$","_c","t0","useContext","CommentsOnboardingContext","CommentsOnboardingContextValue","useCommentsOnboarding","ctx","Error","Box","Card","Stack","Text","useTranslation","commentsLocaleNamespace","CommentsInspectorError","t0","$","_c","error","t","t1","t2","t3","message","t4","CheckmarkIcon","ChevronDownIcon","CloseIcon","Card","Flex","Menu","Text","useCallback","RefAttributes","styled","Button","MenuButton","MenuItem","useTranslation","commentsLocaleNamespace","CommentStatus","CommentsUIMode","Root","position","zIndex","lineHeight","CommentsInspectorHeaderProps","onClose","onViewChange","view","mode","CommentsInspectorHeader","props","$","_c","t","ref","t0","handleSetOpenView","t1","handleSetResolvedView","t2","t3","t4","t5","t6","Symbol","for","width","t7","undefined","t8","t9","t10","t11","t12","content","t13","t14","t15","t16","placement","t17","t18","t19","t20","t21","t22","t23","t24","Flex","Layer","useClickOutsideEvent","useLayer","useToast","PathUtils","Fragment","useCallback","useEffect","useMemo","useRef","useState","styled","DocumentInspectorProps","useTranslation","useCurrentUser","useAddonDataset","CommentDeleteDialog","CommentsList","CommentsOnboardingPopover","CommentsUpsellPanel","CommentsSelectedPath","isTextSelectionComment","useComments","useCommentsEnabled","useCommentsOnboarding","useCommentsScroll","useCommentsSelectedPath","useCommentsTelemetry","useCommentsUpsell","commentsLocaleNamespace","CommentBaseCreatePayload","CommentReactionOption","CommentStatus","CommentsUIMode","CommentUpdatePayload","CommentsInspectorError","CommentsInspectorHeader","CommentToDelete","commentId","isParent","RootLayer","CommentsInspector","props","$","_c","enabled","mode","t0","CommentsInspectorInner","t","onClose","showDeleteDialog","setShowDeleteDialog","commentToDelete","setCommentToDelete","deleteLoading","setDeleteLoading","deleteError","setDeleteError","rootRef","rootElement","setRootElement","currentUser","comments","getComment","isCreatingDataset","mentionOptions","setStatus","status","operation","selectedCommentId","getCommentLink","onClearSelectedComment","onPathOpen","commentIdParamRef","error","addonDatasetError","didScrollToCommentFromParam","pushToast","push","isTopLayer","boundaryElement","scrollToComment","scrollToField","scrollToInlineComment","selectedPath","setSelectedPath","isDismissed","setDismissed","telemetry","upsellData","telemetryLogs","upsellTelemetryLogs","currentComments","data","loading","t1","nextView","commentListViewChanged","handleChangeView","t2","handleCloseInspector","t3","bb0","undefined","t4","id","navigator","clipboard","writeText","catch","closable","title","commentLinkCopied","copyLink","handleCopyLink","id_0","comment","create","type","fieldPath","target","path","field","_id","message","parentCommentId","reactions","threadId","handleCreateRetry","t5","closeDeleteDialog","t6","open","nextPath","fromString","isInlineComment","filter","c","some","_temp","handlePathSelect","t7","nextComment","payload","origin","handleNewThreadCreate","t8","nextComment_0","handleReply","t9","id_1","nextComment_1","update","handleEdit","t10","id_2","parent","find","c_0","parentComment","Boolean","replies","length","onDeleteStart","t11","id_3","remove","t12","err","handleDeleteConfirm","id_4","nextStatus","comment_0","handleStatusChange","t13","id_5","reaction","react","handleReactionSelect","t14","handleDeselectPath","t15","Symbol","for","element","current","setRootRef","t16","event","isPTETarget","HTMLElement","hasAttribute","t17","loggedTelemetry","setLoggedTelemetry","t18","panelViewed","panelDismissed","t19","t20","t21","t22","commentToScrollTo","requestAnimationFrame","commentViewedFromLink","t23","bb1","t24","panelPrimaryClicked","panelSecondaryClicked","beforeListNode","t25","t26","t27","t28","t29","t30","t31","x"],"sources":["../src/core/comments/components/onboarding/CommentsOnboardingPopover.tsx","../src/core/comments/components/upsell/CommentsUpsellPanel.tsx","../src/core/comments/hooks/useCommentsOnboarding.ts","../src/core/comments/plugin/inspector/CommentsInspectorError.tsx","../src/core/comments/plugin/inspector/CommentsInspectorHeader.tsx","../src/core/comments/plugin/inspector/CommentsInspector.tsx"],"sourcesContent":["import {Box, Flex, Stack, Text} from '@sanity/ui'\nimport {keyframes, styled} from 'styled-components'\n\nimport {Button} from '../../../../ui-components/button/Button'\nimport {Popover, type PopoverProps} from '../../../../ui-components/popover/Popover'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {commentsLocaleNamespace} from '../../i18n'\n\nconst Root = styled(Box)`\n max-width: 280px;\n`\n\nconst fadeInKeyFrame = keyframes`\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n`\n\nconst StyledPopover = styled(Popover)`\n opacity: 0;\n // Fade in the popover after 500ms\n animation: ${fadeInKeyFrame} 200ms 500ms forwards;\n`\n\ninterface CommentsOnboardingPopoverProps extends Omit<PopoverProps, 'content'> {\n // ...\n onDismiss: () => void\n}\n\nexport function CommentsOnboardingPopover(props: CommentsOnboardingPopoverProps) {\n const {onDismiss, ...rest} = props\n const {t} = useTranslation(commentsLocaleNamespace)\n\n return (\n <StyledPopover\n content={\n <Root padding={4}>\n <Stack gap={3}>\n <Text weight=\"medium\" size={1}>\n {t('onboarding.header')}\n </Text>\n\n <Text size={1}>{t('onboarding.body')}</Text>\n\n <Flex justify=\"flex-end\" marginTop={2}>\n <Button text={t('onboarding.dismiss')} tone=\"primary\" onClick={onDismiss} />\n </Flex>\n </Stack>\n </Root>\n }\n open\n portal\n {...rest}\n />\n )\n}\n","import {Box, Container} from '@sanity/ui'\n\nimport {type UpsellData} from '../../../studio/upsell/types'\nimport {UpsellPanel} from '../../../studio/upsell/UpsellPanel'\n\ninterface CommentsUpsellPanelProps {\n data: UpsellData\n onPrimaryClick: () => void\n onSecondaryClick: () => void\n}\n\nexport function CommentsUpsellPanel(props: CommentsUpsellPanelProps) {\n const {data, onPrimaryClick, onSecondaryClick} = props\n return (\n <Container width={1}>\n <Box marginBottom={6}>\n <UpsellPanel\n data={data}\n onPrimaryClick={onPrimaryClick}\n onSecondaryClick={onSecondaryClick}\n />\n </Box>\n </Container>\n )\n}\n","import {useContext} from 'react'\nimport {CommentsOnboardingContext} from 'sanity/_singletons'\n\nimport {type CommentsOnboardingContextValue} from '../context/onboarding/types'\n\nexport function useCommentsOnboarding(): CommentsOnboardingContextValue {\n const ctx = useContext(CommentsOnboardingContext)\n\n if (!ctx) {\n throw new Error('useCommentsOnboarding: missing context value')\n }\n\n return ctx\n}\n","import {Box, Card, Stack, Text} from '@sanity/ui'\n\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {commentsLocaleNamespace} from '../../i18n'\n\nexport function CommentsInspectorError({error}: {error: Error}) {\n const {t} = useTranslation(commentsLocaleNamespace)\n\n return (\n <Box padding={2}>\n <Card paddingX={2} paddingY={3} tone=\"critical\" border radius={3}>\n <Stack gap={3}>\n <Text size={1} weight=\"medium\">\n {t('inspector-error.title')}\n </Text>\n <Text size={1} muted>\n {error.message}\n </Text>\n </Stack>\n </Card>\n </Box>\n )\n}\n","import {CheckmarkIcon} from '@sanity/icons/Checkmark'\nimport {ChevronDownIcon} from '@sanity/icons/ChevronDown'\nimport {CloseIcon} from '@sanity/icons/Close'\nimport {Card, Flex, Menu, Text} from '@sanity/ui'\nimport {useCallback, type RefAttributes} from 'react'\nimport {styled} from 'styled-components'\n\nimport {Button} from '../../../../ui-components/button/Button'\nimport {MenuButton} from '../../../../ui-components/menuButton/MenuButton'\nimport {MenuItem} from '../../../../ui-components/menuItem/MenuItem'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {type CommentStatus, type CommentsUIMode} from '../../types'\n\nconst Root = styled(Card)({\n position: 'relative',\n zIndex: '1',\n lineHeight: '0',\n})\n\ninterface CommentsInspectorHeaderProps {\n onClose: () => void\n onViewChange: (view: CommentStatus) => void\n view: CommentStatus\n mode: CommentsUIMode\n}\n\nexport function CommentsInspectorHeader(\n props: CommentsInspectorHeaderProps & RefAttributes<HTMLDivElement>,\n) {\n const {t} = useTranslation(commentsLocaleNamespace)\n const {ref, onClose, onViewChange, view, mode} = props\n\n const handleSetOpenView = useCallback(() => onViewChange('open'), [onViewChange])\n const handleSetResolvedView = useCallback(() => onViewChange('resolved'), [onViewChange])\n\n return (\n <Root ref={ref}>\n <Flex padding={2}>\n <Flex align=\"center\" flex={1} gap={2} paddingY={2} padding={3}>\n <Text as=\"h1\" size={1} weight=\"medium\">\n {t('feature-name')}\n </Text>\n </Flex>\n\n <Flex flex=\"none\" padding={1} gap={2}>\n <MenuButton\n id=\"comment-status-menu-button\"\n button={\n <Button\n text={\n view === 'open'\n ? t('status-filter.status-open')\n : t('status-filter.status-resolved')\n }\n mode=\"bleed\"\n iconRight={ChevronDownIcon}\n />\n }\n menu={\n <Menu style={{width: '180px'}}>\n <MenuItem\n iconRight={view === 'open' ? CheckmarkIcon : undefined}\n onClick={handleSetOpenView}\n text={t('status-filter.status-open-full')}\n />\n <MenuItem\n iconRight={view === 'resolved' ? CheckmarkIcon : undefined}\n onClick={handleSetResolvedView}\n text={t('status-filter.status-resolved-full')}\n tooltipProps={\n mode === 'upsell'\n ? {content: t('status-filter.status-resolved-full-upsell')}\n : undefined\n }\n disabled={mode === 'upsell'}\n />\n </Menu>\n }\n popover={{placement: 'bottom-end'}}\n />\n\n <Button\n aria-label={t('close-pane-button-text-aria-label')}\n icon={CloseIcon}\n mode=\"bleed\"\n onClick={onClose}\n tooltipProps={{content: t('close-pane-button-text')}}\n />\n </Flex>\n </Flex>\n </Root>\n )\n}\n","import {Flex, Layer, useClickOutsideEvent, useLayer, useToast} from '@sanity/ui'\nimport * as PathUtils from '@sanity/util/paths'\nimport {Fragment, useCallback, useEffect, useMemo, useRef, useState} from 'react'\nimport {styled} from 'styled-components'\n\nimport {type DocumentInspectorProps} from '../../../config/document/inspector'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {useCurrentUser} from '../../../store/user/hooks'\nimport {useAddonDataset} from '../../../studio/addonDataset/useAddonDataset'\nimport {CommentDeleteDialog} from '../../components/CommentDeleteDialog'\nimport {CommentsList} from '../../components/list/CommentsList'\nimport {CommentsOnboardingPopover} from '../../components/onboarding/CommentsOnboardingPopover'\nimport {CommentsUpsellPanel} from '../../components/upsell/CommentsUpsellPanel'\nimport {type CommentsSelectedPath} from '../../context/selected-path/types'\nimport {isTextSelectionComment} from '../../helpers'\nimport {useComments} from '../../hooks/useComments'\nimport {useCommentsEnabled} from '../../hooks/useCommentsEnabled'\nimport {useCommentsOnboarding} from '../../hooks/useCommentsOnboarding'\nimport {useCommentsScroll} from '../../hooks/useCommentsScroll'\nimport {useCommentsSelectedPath} from '../../hooks/useCommentsSelectedPath'\nimport {useCommentsTelemetry} from '../../hooks/useCommentsTelemetry'\nimport {useCommentsUpsell} from '../../hooks/useCommentsUpsell'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {\n type CommentBaseCreatePayload,\n type CommentReactionOption,\n type CommentStatus,\n type CommentsUIMode,\n type CommentUpdatePayload,\n} from '../../types'\nimport {CommentsInspectorError} from './CommentsInspectorError'\nimport {CommentsInspectorHeader} from './CommentsInspectorHeader'\n\ninterface CommentToDelete {\n commentId: string\n isParent: boolean\n}\n\nconst RootLayer = styled(Layer)`\n display: flex;\n flex-direction: column;\n height: 100%;\n overflow: hidden;\n`\n\nexport function CommentsInspector(props: DocumentInspectorProps) {\n const {enabled, mode} = useCommentsEnabled()\n\n if (!enabled) return null\n\n // We wrap the comments inspector in a Layer in order to know when the comments inspector\n // is the top layer (that is, if there is e.g. a popover open). This is used to determine\n // if we should deselect the selected path when clicking outside the comments inspector.\n return (\n <RootLayer>\n <CommentsInspectorInner {...props} mode={mode} />\n </RootLayer>\n )\n}\n\nfunction CommentsInspectorInner(\n props: DocumentInspectorProps & {\n mode: CommentsUIMode\n },\n) {\n const {t} = useTranslation(commentsLocaleNamespace)\n const {onClose, mode} = props\n const [showDeleteDialog, setShowDeleteDialog] = useState<boolean>(false)\n const [commentToDelete, setCommentToDelete] = useState<CommentToDelete | null>(null)\n const [deleteLoading, setDeleteLoading] = useState<boolean>(false)\n const [deleteError, setDeleteError] = useState<Error | null>(null)\n\n const rootRef = useRef<HTMLDivElement | null>(null)\n const [rootElement, setRootElement] = useState<HTMLDivElement | null>(null)\n\n const currentUser = useCurrentUser()\n const {\n comments,\n getComment,\n isCreatingDataset,\n mentionOptions,\n setStatus,\n status,\n operation,\n selectedCommentId,\n getCommentLink,\n onClearSelectedComment,\n onPathOpen,\n } = useComments()\n const commentIdParamRef = useRef<string | undefined>(selectedCommentId)\n const {error: addonDatasetError} = useAddonDataset()\n const didScrollToCommentFromParam = useRef<boolean>(false)\n\n const pushToast = useToast().push\n const {isTopLayer} = useLayer()\n\n const {scrollToComment, scrollToField, scrollToInlineComment} = useCommentsScroll({\n boundaryElement: rootElement,\n })\n const {selectedPath, setSelectedPath} = useCommentsSelectedPath()\n const {isDismissed, setDismissed} = useCommentsOnboarding()\n const telemetry = useCommentsTelemetry()\n\n const {upsellData, telemetryLogs: upsellTelemetryLogs} = useCommentsUpsell()\n\n const currentComments = useMemo(() => comments.data[status], [comments, status])\n\n const {loading} = comments\n\n const handleChangeView = useCallback(\n (nextView: CommentStatus) => {\n setStatus(nextView)\n setSelectedPath(null)\n\n telemetry.commentListViewChanged(nextView)\n },\n [setSelectedPath, setStatus, telemetry],\n )\n\n const handleCloseInspector = useCallback(() => {\n onClose()\n setSelectedPath(null)\n }, [onClose, setSelectedPath])\n\n const handleCopyLink = useMemo(() => {\n if (!getCommentLink) return undefined\n\n const copyLink = (id: string) => {\n navigator.clipboard.writeText(getCommentLink(id)).catch(() => {\n pushToast({\n closable: true,\n status: 'error',\n title: t('copy-link-error-message'),\n })\n })\n\n telemetry.commentLinkCopied()\n }\n\n return copyLink\n }, [getCommentLink, pushToast, t, telemetry])\n\n const handleCreateRetry = useCallback(\n (id: string) => {\n const comment = getComment(id)\n if (!comment) return\n\n void operation.create({\n type: 'field',\n fieldPath: comment.target.path?.field || '',\n id: comment._id,\n message: comment.message,\n parentCommentId: comment.parentCommentId,\n reactions: comment.reactions || [],\n status: comment.status,\n threadId: comment.threadId,\n })\n },\n [getComment, operation],\n )\n\n const closeDeleteDialog = useCallback(() => {\n if (deleteLoading) return\n setShowDeleteDialog(false)\n setCommentToDelete(null)\n }, [deleteLoading])\n\n const handlePathSelect = useCallback(\n (nextPath: CommentsSelectedPath) => {\n setSelectedPath(nextPath)\n\n if (nextPath?.fieldPath) {\n const path = PathUtils.fromString(nextPath.fieldPath)\n onPathOpen?.(path)\n\n scrollToField(nextPath.fieldPath)\n\n const isInlineComment = comments.data.open\n .filter((c) => c.threadId === nextPath?.threadId)\n .some((x) => isTextSelectionComment(x.parentComment))\n\n if (isInlineComment && nextPath.threadId) {\n scrollToInlineComment(nextPath.threadId)\n }\n }\n },\n [comments.data.open, onPathOpen, scrollToField, scrollToInlineComment, setSelectedPath],\n )\n\n const handleNewThreadCreate = useCallback(\n (nextComment: CommentBaseCreatePayload) => {\n const fieldPath = nextComment?.payload?.fieldPath || ''\n\n void operation.create({\n type: 'field',\n fieldPath,\n message: nextComment.message,\n parentCommentId: nextComment.parentCommentId,\n reactions: nextComment.reactions,\n status: nextComment.status,\n threadId: nextComment.threadId,\n })\n\n setSelectedPath({\n fieldPath,\n origin: 'inspector',\n threadId: nextComment.threadId,\n })\n },\n [operation, setSelectedPath],\n )\n\n const handleReply = useCallback(\n (nextComment: CommentBaseCreatePayload) => {\n void operation.create({\n ...nextComment,\n type: 'field',\n fieldPath: nextComment?.payload?.fieldPath || '',\n })\n },\n [operation],\n )\n\n const handleEdit = useCallback(\n (id: string, nextComment: CommentUpdatePayload) => {\n void operation.update(id, nextComment)\n },\n [operation],\n )\n\n const onDeleteStart = useCallback(\n (id: string) => {\n const parent = currentComments.find((c) => c.parentComment?._id === id)\n const isParent = Boolean(parent && parent?.replies?.length > 0)\n\n setShowDeleteDialog(true)\n setCommentToDelete({\n commentId: id,\n isParent,\n })\n },\n\n [currentComments],\n )\n\n const handleDeleteConfirm = useCallback(\n async (id: string) => {\n try {\n setDeleteLoading(true)\n await operation.remove(id)\n closeDeleteDialog()\n } catch (err) {\n setDeleteError(err)\n }\n setDeleteLoading(false)\n },\n [closeDeleteDialog, operation],\n )\n\n const handleStatusChange = useCallback(\n (id: string, nextStatus: CommentStatus) => {\n void operation.update(id, {\n status: nextStatus,\n })\n\n // If the comment is being opened, we want to change to the \"open\" view\n // and scroll to the comment\n if (nextStatus === 'open') {\n setStatus('open')\n\n const comment = getComment(id)\n\n if (!comment) return\n\n setSelectedPath({\n fieldPath: comment.target.path?.field || null,\n origin: 'inspector',\n threadId: comment.threadId || null,\n })\n\n scrollToComment(id)\n }\n },\n [getComment, operation, scrollToComment, setSelectedPath, setStatus],\n )\n\n const handleReactionSelect = useCallback(\n (id: string, reaction: CommentReactionOption) => {\n void operation.react(id, reaction)\n },\n [operation],\n )\n\n const handleDeselectPath = useCallback(() => {\n // Clear the selected path when:\n // - Clicking outside the inspector when it's the top layer\n // - The target is not a slate editor string. This is needed because we do not want to\n // frequently deselect the selected path when clicking inside the editor.\n if (selectedPath && isTopLayer) {\n setSelectedPath(null)\n }\n }, [isTopLayer, selectedPath, setSelectedPath])\n\n const setRootRef = useCallback((element: HTMLDivElement | null) => {\n rootRef.current = element\n setRootElement(element)\n }, [])\n\n useClickOutsideEvent(\n (event) => {\n // Clear the selected path when clicking outside the comments inspector.\n // We do this only when the comments inspector is the top layer.\n const isPTETarget =\n event.target instanceof HTMLElement && event.target?.hasAttribute('data-pt-text')\n\n if (!isPTETarget) {\n handleDeselectPath()\n }\n },\n () => [rootRef.current],\n )\n\n const [loggedTelemetry, setLoggedTelemetry] = useState(false)\n useEffect(() => {\n if (loggedTelemetry || mode !== 'upsell') return undefined\n // oxlint-disable-next-line react/react-compiler\n setLoggedTelemetry(true)\n if (selectedPath?.origin === 'form') {\n upsellTelemetryLogs.panelViewed('field_action')\n } else if (commentIdParamRef.current) {\n upsellTelemetryLogs.panelViewed('link')\n } else {\n upsellTelemetryLogs.panelViewed('document_action')\n }\n return () => {\n upsellTelemetryLogs.panelDismissed()\n }\n }, [loggedTelemetry, mode, selectedPath?.origin, upsellTelemetryLogs])\n\n // Handle scroll to comment from URL param\n useEffect(() => {\n // Make sure that the comment exists before we try to scroll to it.\n // We can't solely rely on the comment id from the url since the comment might not be loaded yet.\n const commentToScrollTo = getComment(commentIdParamRef.current || '')\n\n if (!loading && commentToScrollTo && !didScrollToCommentFromParam.current) {\n // Make sure we have the correct status set before we scroll to the comment\n setStatus(commentToScrollTo.status || 'open')\n\n handlePathSelect({\n fieldPath: commentToScrollTo.target.path?.field || null,\n origin: 'url',\n threadId: commentToScrollTo.threadId || null,\n })\n\n // Defer the comment scroll to prevent React batching from overwriting the field scroll\n requestAnimationFrame(() => {\n scrollToComment(commentToScrollTo._id)\n })\n\n didScrollToCommentFromParam.current = true\n commentIdParamRef.current = undefined\n\n onClearSelectedComment?.()\n\n telemetry.commentViewedFromLink()\n }\n }, [\n getComment,\n handlePathSelect,\n loading,\n onClearSelectedComment,\n scrollToComment,\n setStatus,\n telemetry,\n ])\n\n const beforeListNode = useMemo(() => {\n if (mode === 'upsell' && upsellData) {\n return (\n <CommentsUpsellPanel\n data={upsellData}\n onPrimaryClick={upsellTelemetryLogs.panelPrimaryClicked}\n onSecondaryClick={upsellTelemetryLogs.panelSecondaryClicked}\n />\n )\n }\n\n return null\n }, [\n mode,\n upsellTelemetryLogs.panelPrimaryClicked,\n upsellTelemetryLogs.panelSecondaryClicked,\n upsellData,\n ])\n\n return (\n <Fragment>\n {commentToDelete && showDeleteDialog && (\n <CommentDeleteDialog\n {...commentToDelete}\n error={deleteError}\n loading={deleteLoading}\n onClose={closeDeleteDialog}\n onConfirm={handleDeleteConfirm}\n />\n )}\n\n <Flex\n direction=\"column\"\n flex={1}\n height=\"fill\"\n onClick={handleDeselectPath}\n overflow=\"hidden\"\n ref={setRootRef}\n >\n <CommentsOnboardingPopover\n onDismiss={setDismissed}\n open={!isDismissed}\n placement=\"left-start\"\n >\n <CommentsInspectorHeader\n onClose={handleCloseInspector}\n onViewChange={handleChangeView}\n view={status}\n mode={mode}\n />\n </CommentsOnboardingPopover>\n {addonDatasetError && <CommentsInspectorError error={addonDatasetError} />}\n {currentUser && (\n <CommentsList\n beforeListNode={beforeListNode}\n comments={currentComments}\n currentUser={currentUser}\n error={comments.error}\n loading={loading}\n mentionOptions={mentionOptions}\n mode={mode}\n onCopyLink={handleCopyLink}\n onCreateRetry={handleCreateRetry}\n onDelete={onDeleteStart}\n onEdit={handleEdit}\n onNewThreadCreate={handleNewThreadCreate}\n onPathSelect={handlePathSelect}\n onReactionSelect={handleReactionSelect}\n onReply={handleReply}\n onStatusChange={handleStatusChange}\n readOnly={isCreatingDataset}\n selectedPath={selectedPath}\n status={status}\n />\n )}\n </Flex>\n </Fragment>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAQA,MAAMW,SAAON,OAA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0C,cAAA1C,EAAA,OAAAyB,QAAAzB,EAAA,OAAA6K,OAAAA,MAAA7K,EAAA;CAAA,IAAA8K;CAAA,AAAA9K,EAAA,SAAA0I,sBAAA1I,EAAA,SAAA2K,OAAA3K,EAAA,SAAA4K,OAAA5K,EAAA,SAAA6K,OA3CHC,MAAA,qBAAC,MAAD;EACY,WAAA;EACJ,MAAA;EACC,QAAA;EACEpC,SAAAA;EACA,UAAA;EACJM,KAAAA;EANP,UAAA;GAQE2B;GAYCC;GACAC;EArBE;KA4CE7K,EAAA,OAAA0I,oBAAA1I,EAAA,OAAA2K,KAAA3K,EAAA,OAAA4K,KAAA5K,EAAA,OAAA6K,KAAA7K,EAAA,OAAA8K,OAAAA,MAAA9K,EAAA;CAAA,IAAA+K;CACE,OADF/K,EAAA,SAAAqK,OAAArK,EAAA,SAAA8K,OAvDTC,MAAA,qBAAC,UAAD,EAAA,UAAA,CACGV,KAUDS,GAXO,EAAA,CAAA,GAwDE9K,EAAA,OAAAqK,KAAArK,EAAA,OAAA8K,KAAA9K,EAAA,OAAA+K,OAAAA,MAAA/K,EAAA,MAxDX+K;AAwDW;AAzYf,SAAA9E,MAAA+E,GAAA;CAAA,OAuHuBtM,uBAAuBsM,EAAC3D,aAAc;AAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { i as Dialog$1, r as Popover$1 } from "./ConfirmPopover-CD1rDyuk.js";
|
|
2
2
|
import { a as Button$1, i as TooltipDelayGroupProvider$1, o as Tooltip$1, r as MenuButton$1, t as MenuItem$1 } from "./MenuItem-BWdL61CI.js";
|
|
3
|
-
import { m as useUser } from "./datastores-
|
|
3
|
+
import { m as useUser } from "./datastores-DpJ5Y313.js";
|
|
4
4
|
import { t as useTranslation } from "./useTranslation-Cqs6Itwv.js";
|
|
5
5
|
import { n as useRelativeTime, o as TextWithTone, r as useDateTimeFormat, t as ContextMenuButton } from "./ContextMenuButton-i3QSjB9U.js";
|
|
6
|
-
import { a as COMMENT_REACTION_OPTIONS, b as commentsLocaleNamespace, c as CommentsAvatar, d as hasCommentMessageValue, f as isTextSelectionComment, h as applyCommentIdAttr, i as COMMENT_REACTION_EMOJIS, l as NormalBlock, m as useCommentHasChanged, n as COMMENTS_HIGHLIGHT_HUE_KEY, o as CommentInput, s as MentionInlineBlock, u as commentIntentIfDiffers } from "./useComments-
|
|
6
|
+
import { a as COMMENT_REACTION_OPTIONS, b as commentsLocaleNamespace, c as CommentsAvatar, d as hasCommentMessageValue, f as isTextSelectionComment, h as applyCommentIdAttr, i as COMMENT_REACTION_EMOJIS, l as NormalBlock, m as useCommentHasChanged, n as COMMENTS_HIGHLIGHT_HUE_KEY, o as CommentInput, s as MentionInlineBlock, u as commentIntentIfDiffers } from "./useComments-DuEOnDkA.js";
|
|
7
7
|
import { t as useDidUpdate } from "./useDidUpdate-Br1Dx-yJ.js";
|
|
8
8
|
import { n as useListFormat, t as Translate } from "./Translate-0HIWr1eF.js";
|
|
9
9
|
import { Fragment, cloneElement, memo, useEffect, useRef, useState } from "react";
|
|
@@ -1359,4 +1359,4 @@ const ThreadCard = /* @__PURE__ */ styled(Card).attrs({
|
|
|
1359
1359
|
CommentsListItem.displayName = "Memo(CommentsListItem)";
|
|
1360
1360
|
export { ThreadCard as n, CommentDeleteDialog as r, CommentsListItem as t };
|
|
1361
1361
|
|
|
1362
|
-
//# sourceMappingURL=CommentsListItem-
|
|
1362
|
+
//# sourceMappingURL=CommentsListItem-C2Ac0esL.js.map
|