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":"useComments-Bm-0CwNH.js","names":["LocaleResourceBundle","commentsLocaleNamespace","const","commentsUsEnglishLocaleBundle","locale","namespace","resources","useCallback","useEffect","useMemo","useState","scrollIntoViewIfNeeded","StandardBehaviorOptions","BASE_SCROLL_OPTIONS","behavior","inline","scrollMode","GROUP_SCROLL_OPTIONS","block","INLINE_COMMENT_SCROLL_OPTIONS","SCROLL_TO_FIELD_OPTIONS","SCROLL_TO_COMMENT_OPTIONS","SCROLL_OPTIONS_BY_TYPE","Record","ScrollTargetTypes","generateValidAttrValue","id","symbolsToRemove","result","replace","applyCommentIdAttr","applyCommentsFieldAttr","applyCommentsGroupAttr","applyInlineCommentIdAttr","CommentsScrollHookValue","scrollToComment","commentId","scrollToField","fieldId","scrollToGroup","groupId","scrollToInlineComment","CommentsScrollHookOptions","boundaryElement","HTMLElement","ScrollTarget","type","useCommentsScroll","opts","$","_c","t0","scrollTarget","setScrollTarget","options","shouldApplyBoundary","t1","undefined","t2","boundary","scrollOpts","t3","Symbol","for","handleScrollToComment","t4","threadId","handleScrollToGroup","t5","fieldPath","handleScrollToField","t6","commentId_0","handleScrollToInlineComment","t7","t8","raf","requestAnimationFrame","element","document","querySelector","cancelAnimationFrame","t9","value","isPortableTextSpan","isPortableTextTextBlock","Path","PathUtils","isEqual","useMemo","useState","CommentContext","CommentDocument","CommentMessage","useCommentHasChanged","message","$","_c","prevMessage","t0","hasCommentMessageValue","value","some","block","children","c","text","userId","commentIntentIfDiffers","parent","comment","parentIntent","context","intent","undefined","params","preview","parseCommentFieldPath","fieldPath","fromString","isTextSelectionComment","Boolean","target","path","selection","type","Schema","defineArrayMember","defineField","mentionObject","name","type","fields","blockType","of","marks","annotations","styles","title","value","lists","portableTextType","schema","compile","types","editorSchemaType","get","Text","ReactNode","styled","NormalText","NormalBlockProps","children","NormalBlock","props","$","_c","t0","RenderBlockFunction","NormalBlock","renderBlock","blockProps","children","DialogProvider","Text","ThemeColorProvider","MouseEvent","useCallback","Dialog","useTranslation","commentsLocaleNamespace","Z_OFFSET","CommentInputDiscardDialogProps","onClose","onConfirm","CommentInputDiscardDialog","props","$","_c","t","t0","e","stopPropagation","handleCancelClick","t1","e_0","handleConfirmClick","t2","t3","onClick","t4","t5","text","tone","t6","cancelButton","confirmButton","t7","t8","t9","User","Avatar","AvatarProps","useMemo","styled","StyledAvatar","SYMBOLS","WHITESPACE","nameToInitials","fullName","namesArray","replace","split","length","charAt","toUpperCase","CommentsAvatarProps","user","CommentsAvatar","props","$","_c","restProps","userProp","displayName","t0","t1","initials","t2","imageUrl","t3","t4","RefAttributes","SVGProps","MentionIcon","props","$","_c","ref","rest","t0","t1","Symbol","for","t2","RefAttributes","SVGProps","SendIcon","props","$","_c","ref","rest","t0","Symbol","for","t1","Badge","Box","Card","Flex","Text","TextSkeleton","CSSProperties","useCallback","styled","UserWithPermission","useTranslation","useUser","commentsLocaleNamespace","CommentsAvatar","InnerFlex","SKELETON_INLINE_STYLE","width","MentionsItemProps","user","onSelect","userId","MentionsMenuItem","props","$","_c","loadedUser","id","t","t0","granted","undefined","t1","avatar","t2","displayName","text","t3","handleSelect","t4","t5","t6","t7","t8","t9","Box","Flex","Stack","Text","deburr","Ref","useCallback","useImperativeHandle","useMemo","useRef","useState","RefAttributes","styled","CommandList","CommandListHandle","LoadingBlock","UserWithPermission","useTranslation","commentsLocaleNamespace","MentionsMenuItem","EMPTY_ARRAY","Root","maxWidth","ITEM_HEIGHT","LIST_PADDING","MAX_ITEMS","FlexWrap","maxHeight","MentionsMenuHandle","setSearchTerm","term","MentionsMenuProps","loading","inputElement","HTMLDivElement","onSelect","userId","options","MentionsMenu","props","$","_c","t","ref","t0","t1","undefined","searchTerm","commandListRef","t2","t3","Symbol","for","t4","itemProps","renderItem","t5","index","granted","getItemDisabled","t6","bb0","t7","deburredSearchTerm","toLocaleLowerCase","deburredOptions","map","_temp","filter","option_0","option","displayName","includes","sort","a","b","matchA","startsWith","matchB","filtered","filteredOptions","_inputElement","HTMLInputElement","length","t8","t9","Flex","Text","TextSkeleton","css","styled","Tooltip","useCurrentUser","useUser","CommentsAvatar","Span","span","theme","regular","sanity","fonts","text","weights","hovered","color","card","bg","selectable","caution","pressed","MentionInlineBlockProps","userId","selected","MentionInlineBlock","props","$","_c","user","loading","currentUser","t0","Symbol","for","width","t1","displayName","t2","t3","id","t4","t5","BlockChildRenderProps","RenderChildFunction","MentionInlineBlock","renderChild","childProps","children","value","selected","isMention","_type","userId","useContext","CommentInputContext","CommentInputContextValue","useCommentInput","ctx","Error","useCallback","useEffect","useMemo","useState","EVENT_LISTENER_OPTIONS","AddEventListenerOptions","passive","CursorElementHookOptions","disabled","rootElement","HTMLElement","useCursorElement","opts","$","_c","cursorRect","setCursorRect","t0","bb0","t1","getBoundingClientRect","cursorElement","sel","window","getSelection","isCollapsed","rangeCount","range","getRangeAt","isWithinRoot","contains","commonAncestorContainer","rect","handleSelectionChange","t2","t3","document","addEventListener","removeEventListener","EditorSelection","PortableTextEditable","RenderBlockFunction","usePortableTextEditorSelection","isPortableTextSpan","isPortableTextTextBlock","useClickOutsideEvent","getTheme_v2","isEqual","KeyboardEvent","useCallback","useEffect","useMemo","useRef","useState","css","styled","Popover","PopoverProps","useTranslation","commentsLocaleNamespace","MentionsMenu","MentionsMenuHandle","renderChild","useCommentInput","useCursorElement","POPOVER_FALLBACK_PLACEMENTS","INLINE_STYLE","React","CSSProperties","outline","EMPTY_ARRAY","PlaceholderWrapper","span","props","color","theme","input","default","enabled","placeholder","StyledPopover","space","radius","sanity","EditableProps","focusLock","onBlur","e","FormEvent","HTMLDivElement","onFocus","onKeyDown","onSubmit","ReactNode","renderBlock","EditableHandle","setShowMentionOptions","show","Editable","$","_c","t","t0","t1","undefined","popoverRef","rootElement","setRootElement","inputElement","setInputElement","mentionsMenuRef","selection","canSubmit","closeMentions","insertMention","mentionOptions","mentionsMenuOpen","mentionsSearchTerm","onBeforeInput","value","t2","t3","disabled","cursorElement","t4","renderPlaceholder","t5","Symbol","for","current","t6","event","bb14","key","shiftKey","preventDefault","stopPropagation","handleKeyDown","t7","bb0","lastBlock","slice","lastChild","children","point","path","_key","offset","text","length","t8","focus","anchor","initialSelectionAtEndOfContent","t9","setSearchTerm","t10","t11","t12","data","t13","loading","popoverContent","t14","t15","t16","t17","t18","displayName","RenderBlockFunction","CurrentUser","AvatarSize","Box","Card","Flex","MenuDivider","Stack","getTheme_v2","useCallback","css","styled","Button","TooltipDelayGroupProvider","useTranslation","useUser","commentsLocaleNamespace","CommentsAvatar","MentionIcon","SendIcon","Editable","useCommentInput","EditableWrap","ButtonDivider","height","width","focusRingBorderStyle","border","color","RootCard","theme","input","radius","radii","default","enabled","hovered","AvatarContainer","div","props","avatar","sizes","size","CommentInputInnerProps","avatarSize","currentUser","focusLock","onBlur","e","React","FormEvent","HTMLDivElement","onFocus","onKeyDown","KeyboardEvent","onSubmit","placeholder","ReactNode","renderBlock","withAvatar","CommentInputInner","$","_c","t0","undefined","user","id","canSubmit","expandOnFocus","focused","hasChanges","insertAtChar","openMentions","readOnly","mentionOptions","t","t1","t2","stopPropagation","handleMentionButtonClicked","t3","t4","t5","t6","t7","disabled","content","t8","t9","t10","t11","t12","EditorSelection","PortableTextEditor","usePortableTextEditor","isPortableTextSpan","Path","ReactNode","useCallback","useMemo","useState","CommentInputContext","useDidUpdate","UserListWithPermissionsHookValue","hasCommentMessageValue","useCommentHasChanged","CommentMessage","CommentInputContextValue","canSubmit","closeMentions","editor","expandOnFocus","focused","focusEditor","focusOnMount","hasChanges","insertAtChar","insertMention","userId","mentionOptions","mentionsMenuOpen","mentionsSearchTerm","onBeforeInput","event","InputEvent","openMentions","readOnly","value","CommentInputProviderProps","children","onMentionMenuOpenChange","open","CommentInputProvider","props","$","_c","t0","t1","undefined","setMentionsMenuOpen","setMentionsSearchTerm","selectionAtMentionInsert","setSelectionAtMentionInsert","t2","t3","focus","t4","Symbol","for","t5","disabled","getSelection","t6","selection","cursorOffset","offset","focusChild","focusSpan","isInsertText","inputType","isDeleteText","isInsertingAtChar","data","lastIndexOfAt","text","slice","Math","max","lastIndexOf","isWhitespaceCharBeforeCursorPosition","filterStartsWithSpaceChar","length","term","t7","insertChild","schemaTypes","span","t8","t9","mentionSchemaType","inlineObjects","find","_temp","spanPath","findByPath","path","delete","anchor","mode","t10","Boolean","t11","ctxValue","t12","t","name","Editor","EditorEmittedEvent","EditorProvider","keyGenerator","RenderBlockFunction","useEditor","EventListenerPlugin","getValue","OneLinePlugin","sanitySchemaToPortableTextSchema","CurrentUser","PortableTextBlock","AvatarSize","focusFirstDescendant","focusLastDescendant","Stack","FocusEvent","FormEvent","KeyboardEvent","ReactNode","useCallback","useEffect","useImperativeHandle","useMemo","useRef","useState","RefAttributes","UserListWithPermissionsHookValue","editorSchemaType","renderBlock","defaultRenderBlock","CommentInputDiscardDialog","CommentInputInner","CommentInputProvider","EditorRefPlugin","props","$","_c","ref","editor","t0","t1","displayName","EMPTY_ARRAY","SCROLL_INTO_VIEW_OPTIONS","ScrollIntoViewOptions","behavior","block","inline","CommentInputProps","currentUser","expandOnFocus","focusLock","focusOnMount","mentionOptions","onBlur","e","HTMLDivElement","onChange","value","onDiscardCancel","onDiscardConfirm","onFocus","onKeyDown","onMentionMenuOpenChange","open","onSubmit","placeholder","readOnly","withAvatar","avatarSize","CommentDiscardDialogController","close","CommentInputHandle","blur","discardDialogController","focus","scrollTo","reset","CommentInput","t2","t3","undefined","focused","setFocused","editorRef","editorContainerRef","resetInstanceRef","showDiscardDialog","setShowDiscardDialog","preDivRef","postDivRef","innerRef","t4","Symbol","for","editorInstanceKey","setEditorInstanceKey","t5","requestAnimationFrame","current","send","type","requestFocus","t6","resetEditorInstance","t7","event","handleEvent","t8","scrollIntoView","scrollToEditor","t9","currentValue","getSnapshot","handleSubmit","t10","handleDiscardConfirm","t11","t12","t13","t14","event_0","target","innerEl","handleFocus","t15","t16","t17","t18","schemaDefinition","initialValue","t19","t20","t21","t22","t23","t24","t25","t26","t27","t28","t29","t30","t31","t32","t33","UpdateReadOnlyPlugin","UpdateValuePlugin","ColorHueKey","CommentReactionOption","CommentReactionShortNames","COMMENTS_INSPECTOR_NAME","COMMENTS_HIGHLIGHT_HUE_KEY","COMMENT_REACTION_OPTIONS","shortName","title","COMMENT_REACTION_EMOJIS","Record","useContext","CommentsContext","CommentsContextValue","useComments","value","Error"],"sources":["../src/core/comments/i18n/index.ts","../src/core/comments/hooks/useCommentsScroll.ts","../src/core/comments/helpers.ts","../src/core/comments/components/pte/config.ts","../src/core/comments/components/pte/blocks/NormalBlock.tsx","../src/core/comments/components/pte/render/renderBlock.tsx","../src/core/comments/components/pte/comment-input/CommentInputDiscardDialog.tsx","../src/core/comments/components/avatars/CommentsAvatar.tsx","../src/core/comments/components/icons/MentionIcon.tsx","../src/core/comments/components/icons/SendIcon.tsx","../src/core/comments/components/mentions/MentionsMenuItem.tsx","../src/core/comments/components/mentions/MentionsMenu.tsx","../src/core/comments/components/pte/blocks/MentionInlineBlock.tsx","../src/core/comments/components/pte/render/renderChild.tsx","../src/core/comments/components/pte/comment-input/useCommentInput.ts","../src/core/comments/components/pte/comment-input/useCursorElement.ts","../src/core/comments/components/pte/comment-input/Editable.tsx","../src/core/comments/components/pte/comment-input/CommentInputInner.tsx","../src/core/comments/components/pte/comment-input/CommentInputProvider.tsx","../src/core/comments/components/pte/comment-input/CommentInput.tsx","../src/core/comments/constants.ts","../src/core/comments/hooks/useComments.ts"],"sourcesContent":["import {type LocaleResourceBundle} from '../../i18n/types'\n\n/**\n * The locale namespace for the comments plugin\n *\n * @public\n */\nexport const commentsLocaleNamespace = 'comments' as const\n\n/**\n * The default locale bundle for the comments plugin, which is US English.\n *\n * @internal\n */\nexport const commentsUsEnglishLocaleBundle: LocaleResourceBundle = {\n locale: 'en-US',\n namespace: commentsLocaleNamespace,\n resources: () => import('./resources'),\n}\n","import {useCallback, useEffect, useMemo, useState} from 'react'\nimport scrollIntoViewIfNeeded, {type StandardBehaviorOptions} from 'scroll-into-view-if-needed'\n\nconst BASE_SCROLL_OPTIONS: StandardBehaviorOptions = {\n behavior: 'smooth',\n inline: 'center',\n scrollMode: 'if-needed',\n}\n\nconst GROUP_SCROLL_OPTIONS: StandardBehaviorOptions = {\n ...BASE_SCROLL_OPTIONS,\n block: 'start',\n}\n\nconst INLINE_COMMENT_SCROLL_OPTIONS: StandardBehaviorOptions = {\n ...BASE_SCROLL_OPTIONS,\n block: 'center',\n}\n\nconst SCROLL_TO_FIELD_OPTIONS: StandardBehaviorOptions = {\n ...BASE_SCROLL_OPTIONS,\n block: 'center',\n}\n\nconst SCROLL_TO_COMMENT_OPTIONS: StandardBehaviorOptions = {\n ...BASE_SCROLL_OPTIONS,\n block: 'center',\n}\n\nconst SCROLL_OPTIONS_BY_TYPE: Record<ScrollTargetTypes, StandardBehaviorOptions> = {\n 'comment': SCROLL_TO_COMMENT_OPTIONS,\n 'field': SCROLL_TO_FIELD_OPTIONS,\n 'group': GROUP_SCROLL_OPTIONS,\n 'inline-comment': INLINE_COMMENT_SCROLL_OPTIONS,\n}\n\n/**\n * A utility function that can be used to generate a valid attribute value\n * based on the given ID.\n *\n * Generate a value that can be used as an attribute value in HTML based\n * on the given ID. This is needed because, when we use the path of a field\n * as a data attribute value, we need to escape the value so that it can be\n * queried using `querySelector`.\n *\n * Example:\n *\n * ```js\n * const validId = generateValidAttrValue('[field[_key==\"title\"]')\n *\n * return <div data-field-id={validId}>...</div>\n * ```\n */\nfunction generateValidAttrValue(id: string): string {\n const symbolsToRemove = /[[\\]_\"_=.]/g\n\n const result = id.replace(symbolsToRemove, '')\n\n return result\n}\n\nexport function applyCommentIdAttr(id: string): Record<'data-comments-comment-id', string> {\n return {\n 'data-comments-comment-id': generateValidAttrValue(id),\n }\n}\n\nexport function applyCommentsFieldAttr(id: string): Record<'data-comments-field-id', string> {\n return {\n 'data-comments-field-id': generateValidAttrValue(id),\n }\n}\n\nexport function applyCommentsGroupAttr(id: string): Record<'data-comments-group-id', string> {\n return {\n 'data-comments-group-id': generateValidAttrValue(id),\n }\n}\n\nexport function applyInlineCommentIdAttr(\n id: string,\n): Record<'data-comments-inline-comment-id', string> {\n return {\n 'data-comments-inline-comment-id': generateValidAttrValue(id),\n }\n}\n\ninterface CommentsScrollHookValue {\n /**\n * Scroll to the comment with the given ID.\n */\n scrollToComment: (commentId: string) => void\n /**\n * Scroll to the field with the given ID.\n */\n scrollToField: (fieldId: string) => void\n /**\n * Scroll to the group with the given ID.\n */\n scrollToGroup: (groupId: string) => void\n /**\n * Scroll to the inline comment with the given ID.\n */\n scrollToInlineComment: (commentId: string) => void\n}\n\ninterface CommentsScrollHookOptions {\n boundaryElement?: HTMLElement | null\n}\n\ntype ScrollTargetTypes = 'comment' | 'field' | 'group' | 'inline-comment'\ninterface ScrollTarget {\n type: ScrollTargetTypes\n id: string\n}\n\nexport function useCommentsScroll(opts?: CommentsScrollHookOptions): CommentsScrollHookValue {\n const {boundaryElement} = opts || {}\n const [scrollTarget, setScrollTarget] = useState<ScrollTarget | null>(null)\n\n const scrollOpts: StandardBehaviorOptions = useMemo(() => {\n const options = SCROLL_OPTIONS_BY_TYPE[scrollTarget?.type || 'comment']\n\n // Only apply boundary for 'comment' type scrolls (scrolling within inspector panel)\n // Field, group, and inline-comment scrolls target the document pane and shouldn't be bounded\n const shouldApplyBoundary = scrollTarget?.type === 'comment'\n\n return {\n ...options,\n boundary: shouldApplyBoundary ? boundaryElement : undefined,\n }\n }, [boundaryElement, scrollTarget?.type])\n\n const handleScrollToComment = useCallback((commentId: string) => {\n setScrollTarget({type: 'comment', id: commentId})\n }, [])\n\n const handleScrollToGroup = useCallback((threadId: string) => {\n setScrollTarget({type: 'group', id: threadId})\n }, [])\n\n const handleScrollToField = useCallback((fieldPath: string) => {\n setScrollTarget({type: 'field', id: fieldPath})\n }, [])\n\n const handleScrollToInlineComment = useCallback((commentId: string) => {\n setScrollTarget({type: 'inline-comment', id: commentId})\n }, [])\n\n useEffect(() => {\n const raf = requestAnimationFrame(() => {\n if (!scrollTarget) return\n\n const {type, id} = scrollTarget\n\n const element = document?.querySelector(\n `[data-comments-${type}-id=\"${generateValidAttrValue(id)}\"]`,\n )\n\n if (element) {\n scrollIntoViewIfNeeded(element, scrollOpts)\n }\n })\n\n return () => {\n cancelAnimationFrame(raf)\n }\n }, [scrollOpts, scrollTarget])\n\n const value = useMemo(\n (): CommentsScrollHookValue => ({\n scrollToComment: handleScrollToComment,\n scrollToField: handleScrollToField,\n scrollToGroup: handleScrollToGroup,\n scrollToInlineComment: handleScrollToInlineComment,\n }),\n [handleScrollToComment, handleScrollToField, handleScrollToGroup, handleScrollToInlineComment],\n )\n\n return value\n}\n","import {isPortableTextSpan, isPortableTextTextBlock, type Path} from '@sanity/types'\nimport * as PathUtils from '@sanity/util/paths'\nimport isEqual from 'lodash-es/isEqual.js'\nimport {useMemo, useState} from 'react'\n\nimport {type CommentContext, type CommentDocument, type CommentMessage} from './types'\n\nexport function useCommentHasChanged(message: CommentMessage): boolean {\n const [prevMessage] = useState<CommentMessage>(message)\n\n return useMemo(() => !isEqual(prevMessage, message), [prevMessage, message])\n}\n\n/**\n * @internal\n */\nexport function hasCommentMessageValue(value: CommentMessage): boolean {\n if (!value) return false\n\n return value?.some(\n (block) =>\n isPortableTextTextBlock(block) &&\n (block?.children || [])?.some((c) => (isPortableTextSpan(c) ? c.text : c.userId)),\n )\n}\n\nexport function commentIntentIfDiffers(\n parent?: CommentDocument,\n comment?: CommentDocument,\n): CommentContext['intent'] | undefined {\n const parentIntent = parent?.context?.intent\n const intent = comment?.context?.intent\n // If no intent, nothing to return\n if (!intent) return undefined\n // If no parent intent, no comparison necessary\n if (!parentIntent) return intent\n // If the preview param differs, return the intent\n if (\n 'preview' in intent.params &&\n 'preview' in parentIntent.params &&\n intent.params.preview !== parentIntent.params.preview\n ) {\n return intent\n }\n return undefined\n}\n\n/**\n * Parse a comment's persisted `fieldPath` string. Returns `undefined` for\n * empty or unparseable values: `fieldPath` is stored data, and a corrupt\n * comment must not crash rendering.\n * @internal\n */\nexport function parseCommentFieldPath(fieldPath: string | null | undefined): Path | undefined {\n if (!fieldPath) return undefined\n try {\n return PathUtils.fromString(fieldPath)\n } catch {\n return undefined\n }\n}\n\n/**\n * A function that checks whether a comment is a text selection comment\n * @internal\n */\nexport function isTextSelectionComment(comment: CommentDocument): boolean {\n if (!comment) return false\n\n return Boolean(\n comment?.target?.path?.selection?.type === 'text' && comment?.target?.path?.selection?.value,\n )\n}\n","import {Schema} from '@sanity/schema'\nimport {defineArrayMember, defineField} from '@sanity/types'\n\nconst mentionObject = defineField({\n name: 'mention',\n type: 'object',\n fields: [\n {\n name: 'userId',\n type: 'string',\n },\n ],\n})\n\nconst blockType = defineField({\n type: 'block',\n name: 'block',\n of: [mentionObject],\n marks: {\n annotations: [],\n },\n styles: [{title: 'Normal', value: 'normal'}],\n lists: [],\n})\n\nconst portableTextType = defineArrayMember({\n type: 'array',\n name: 'body',\n of: [blockType],\n})\n\nconst schema = Schema.compile({\n name: 'comments',\n types: [portableTextType],\n})\n\nexport const editorSchemaType = schema.get('body')\n","import {Text} from '@sanity/ui'\nimport {type ReactNode} from 'react'\nimport {styled} from 'styled-components'\n\nconst NormalText = styled(Text)`\n word-break: break-word;\n`\n\ninterface NormalBlockProps {\n children: ReactNode\n}\n\nexport function NormalBlock(props: NormalBlockProps): React.JSX.Element {\n const {children} = props\n\n return <NormalText size={1}>{children}</NormalText>\n}\n","import {type RenderBlockFunction} from '@portabletext/editor'\n\nimport {NormalBlock} from '../blocks/NormalBlock'\n\nexport const renderBlock: RenderBlockFunction = (blockProps) => {\n const {children} = blockProps\n\n return <NormalBlock>{children}</NormalBlock>\n}\n","import {DialogProvider, Text, ThemeColorProvider} from '@sanity/ui'\nimport {type MouseEvent, useCallback} from 'react'\n\nimport {Dialog} from '../../../../../ui-components/dialog/Dialog'\nimport {useTranslation} from '../../../../i18n/hooks/useTranslation'\nimport {commentsLocaleNamespace} from '../../../i18n'\n\nconst Z_OFFSET = 9999999 // Change to appropriate z-offset\n\n/**\n * @beta\n * @hidden\n */\nexport interface CommentInputDiscardDialogProps {\n onClose: () => void\n onConfirm: () => void\n}\n\n/**\n * @beta\n * @hidden\n */\nexport function CommentInputDiscardDialog(props: CommentInputDiscardDialogProps) {\n const {t} = useTranslation(commentsLocaleNamespace)\n const {onClose, onConfirm} = props\n\n const handleCancelClick = useCallback(\n (e: MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation()\n onClose()\n },\n [onClose],\n )\n\n const handleConfirmClick = useCallback(\n (e: MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation()\n onConfirm()\n },\n [onConfirm],\n )\n\n // The ThemeColorProvider is needed to make sure that the backdrop of the dialog not\n // inherits the tone of parent color providers.\n // The PortalProvider and DialogProvider is needed to make sure that the dialog is\n // rendered fullscreen and not scoped to the form view.\n return (\n <ThemeColorProvider tone=\"default\">\n <DialogProvider zOffset={Z_OFFSET}>\n <Dialog\n header={t('discard.header')}\n id=\"discard-comment-dialog\"\n onClose={onClose}\n width={0}\n onClickOutside={onClose}\n footer={{\n cancelButton: {\n onClick: handleCancelClick,\n },\n confirmButton: {\n onClick: handleConfirmClick,\n text: t('discard.button-confirm'),\n tone: 'critical',\n },\n }}\n >\n <Text size={1}>{t('discard.text')}</Text>\n </Dialog>\n </DialogProvider>\n </ThemeColorProvider>\n )\n}\n","import {type User} from '@sanity/types'\nimport {Avatar, type AvatarProps} from '@sanity/ui'\nimport {useMemo} from 'react'\nimport {styled} from 'styled-components'\n\nconst StyledAvatar = styled(Avatar)`\n svg > ellipse {\n stroke: transparent;\n }\n`\n\nconst SYMBOLS = /[^\\p{Alpha}\\p{White_Space}]/gu\nconst WHITESPACE = /\\p{White_Space}+/u\n\nfunction nameToInitials(fullName: string) {\n const namesArray = fullName.replace(SYMBOLS, '').split(WHITESPACE)\n\n if (namesArray.length === 1) {\n return `${namesArray[0].charAt(0)}`.toUpperCase()\n }\n\n return `${namesArray[0].charAt(0)}${namesArray[namesArray.length - 1].charAt(0)}`\n}\n\ninterface CommentsAvatarProps extends AvatarProps {\n user: User | undefined | null\n}\n\nexport function CommentsAvatar(props: CommentsAvatarProps) {\n const {user: userProp, ...restProps} = props\n const user = userProp as User\n const initials = useMemo(() => nameToInitials(user?.displayName || ''), [user?.displayName])\n\n if (!user) return <StyledAvatar {...restProps} />\n\n return (\n <StyledAvatar\n initials={initials}\n src={user?.imageUrl}\n title={user?.displayName}\n {...restProps}\n />\n )\n}\n","import {type RefAttributes, type SVGProps} from 'react'\n\nexport function MentionIcon(props: SVGProps<SVGSVGElement> & RefAttributes<SVGSVGElement>) {\n const {ref, ...rest} = props\n return (\n <svg\n data-sanity-icon=\"mention\"\n fill=\"none\"\n height=\"1em\"\n ref={ref}\n viewBox=\"0 0 25 25\"\n width=\"1em\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...rest}\n >\n <path\n d=\"M16.6633 18.9383C15.539 19.6562 14.2034 20.0723 12.7705 20.0723C8.77022 20.0723 5.52734 16.8294 5.52734 12.8291C5.52734 8.82881 8.77022 5.58594 12.7705 5.58594C16.7708 5.58594 20.0137 8.82881 20.0137 12.8291C20.0137 13.6623 19.8249 14.7093 19.6141 15.2077C19.5578 15.3408 19.479 15.4845 19.3936 15.6238C19.0955 16.1106 18.5507 16.3721 17.9807 16.4018V16.4018C16.8271 16.462 15.8588 15.5428 15.8588 14.3877V9.27302\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n strokeLinejoin=\"round\"\n />\n <circle cx=\"12.5732\" cy=\"12.8291\" r=\"3.08691\" stroke=\"currentColor\" strokeWidth={1.2} />\n </svg>\n )\n}\n","import {type RefAttributes, type SVGProps} from 'react'\n\nexport function SendIcon(props: SVGProps<SVGSVGElement> & RefAttributes<SVGSVGElement>) {\n const {ref, ...rest} = props\n return (\n <svg\n data-sanity-icon=\"send\"\n fill=\"none\"\n height=\"1em\"\n ref={ref}\n viewBox=\"0 0 25 25\"\n width=\"1em\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...rest}\n >\n <path\n clipRule=\"evenodd\"\n d=\"M21.1602 12.5L7.16016 19.5V14.8765L13.6656 12.4989L7.16016 9.97149L7.16016 5.5L21.1602 12.5Z\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n strokeLinejoin=\"round\"\n />\n </svg>\n )\n}\n","import {Badge, Box, Card, Flex, Text, TextSkeleton} from '@sanity/ui'\nimport {type CSSProperties, useCallback} from 'react'\nimport {styled} from 'styled-components'\n\nimport {type UserWithPermission} from '../../../hooks/useUserListWithPermissions'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {useUser} from '../../../store/user/hooks'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {CommentsAvatar} from '../avatars/CommentsAvatar'\n\nconst InnerFlex = styled(Flex)``\n\nconst SKELETON_INLINE_STYLE: CSSProperties = {width: '50%'}\n\ninterface MentionsItemProps {\n user: UserWithPermission\n onSelect: (userId: string) => void\n}\n\nexport function MentionsMenuItem(props: MentionsItemProps) {\n const {user, onSelect} = props\n const [loadedUser] = useUser(user.id)\n const {t} = useTranslation(commentsLocaleNamespace)\n\n const avatar = <CommentsAvatar user={loadedUser} status={user.granted ? undefined : 'inactive'} />\n\n const text = loadedUser ? (\n <Text size={1} textOverflow=\"ellipsis\" title={loadedUser.displayName}>\n {loadedUser.displayName}\n </Text>\n ) : (\n <TextSkeleton size={1} style={SKELETON_INLINE_STYLE} />\n )\n\n const handleSelect = useCallback(() => {\n onSelect(user.id)\n }, [onSelect, user.id])\n\n return (\n <Card as=\"button\" disabled={!user.granted} onClick={handleSelect} padding={2} radius={2}>\n <Flex align=\"center\" gap={3}>\n <InnerFlex align=\"center\" gap={2} flex={1}>\n {avatar}\n <Box>{text}</Box>\n </InnerFlex>\n\n {!user.granted && <Badge fontSize={1}>{t('mentions.unauthorized-user')}</Badge>}\n </Flex>\n </Card>\n )\n}\n","import {Box, Flex, Stack, Text} from '@sanity/ui'\nimport deburr from 'lodash-es/deburr.js'\nimport {\n type Ref,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type RefAttributes,\n} from 'react'\nimport {styled} from 'styled-components'\n\nimport {CommandList} from '../../../components/commandList/CommandList'\nimport {type CommandListHandle} from '../../../components/commandList/types'\nimport {LoadingBlock} from '../../../components/loadingBlock/LoadingBlock'\nimport {type UserWithPermission} from '../../../hooks/useUserListWithPermissions'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {MentionsMenuItem} from './MentionsMenuItem'\n\nconst EMPTY_ARRAY: UserWithPermission[] = []\n\nconst Root = styled(Stack)({\n maxWidth: '220px', // todo: improve\n})\n\nconst ITEM_HEIGHT = 41\nconst LIST_PADDING = 4\nconst MAX_ITEMS = 7\n\nconst FlexWrap = styled(Flex)({\n maxHeight: ITEM_HEIGHT * MAX_ITEMS + LIST_PADDING * 2 + ITEM_HEIGHT / 2,\n})\n\nexport interface MentionsMenuHandle {\n setSearchTerm: (term: string) => void\n}\ninterface MentionsMenuProps {\n loading: boolean\n inputElement?: HTMLDivElement | null\n onSelect: (userId: string) => void\n options: UserWithPermission[] | null\n}\n\nexport function MentionsMenu(props: MentionsMenuProps & RefAttributes<MentionsMenuHandle>) {\n const {t} = useTranslation(commentsLocaleNamespace)\n const {ref, loading, onSelect, options = [], inputElement} = props\n const [searchTerm, setSearchTerm] = useState<string>('')\n const commandListRef = useRef<CommandListHandle>(null)\n\n useImperativeHandle(ref, () => {\n return {\n setSearchTerm(term: string) {\n setSearchTerm(term)\n },\n }\n }, [])\n\n const renderItem = useCallback(\n (itemProps: UserWithPermission) => {\n return <MentionsMenuItem user={itemProps} onSelect={onSelect} />\n },\n [onSelect],\n )\n\n const getItemDisabled = useCallback(\n (index: number) => {\n return !options?.[index]?.granted\n },\n [options],\n )\n\n const filteredOptions = useMemo(() => {\n if (!searchTerm) return options || EMPTY_ARRAY\n\n // We deburr the search term and the display names so that when searching\n // for e.g \"bjorge\" we also get results for \"bjørge\"\n const deburredSearchTerm = deburr(searchTerm).toLocaleLowerCase()\n\n const deburredOptions = options?.map((option) => ({\n ...option,\n displayName: deburr(option.displayName || '').toLocaleLowerCase(),\n }))\n\n const filtered = deburredOptions\n ?.filter((option) => {\n return option?.displayName?.includes(deburredSearchTerm)\n })\n // Sort by whether the displayName starts with the search term to get more relevant results first\n ?.sort((a, b) => {\n const matchA = a.displayName?.startsWith(deburredSearchTerm)\n const matchB = b.displayName?.startsWith(deburredSearchTerm)\n\n if (matchA && !matchB) return -1\n if (!matchA && matchB) return 1\n\n return 0\n })\n\n return filtered || EMPTY_ARRAY\n }, [options, searchTerm])\n\n if (loading) {\n return (\n <Root>\n <LoadingBlock showText />\n </Root>\n )\n }\n\n // In this case the input element is the actual content editable HTMLDivElement from the PTE.\n // Typecast it to an input element to make the CommandList component happy.\n const _inputElement = inputElement ? (inputElement as HTMLInputElement) : undefined\n\n return (\n <Flex direction=\"column\" height=\"fill\" data-testid=\"comments-mentions-menu\">\n {filteredOptions.length === 0 && (\n <Box padding={5}>\n <Text align=\"center\" size={1} muted>\n {t('mentions.no-users-found')}\n </Text>\n </Box>\n )}\n\n {filteredOptions.length > 0 && (\n <FlexWrap direction=\"column\" flex={1} overflow=\"hidden\">\n <CommandList\n activeItemDataAttr=\"data-hovered\"\n ariaLabel={t('mentions.user-list-aria-label')}\n fixedHeight\n getItemDisabled={getItemDisabled}\n inputElement={_inputElement}\n itemHeight={41}\n items={filteredOptions}\n padding={1}\n ref={commandListRef}\n renderItem={renderItem}\n />\n </FlexWrap>\n )}\n </Flex>\n )\n}\n","import {Flex, Text, TextSkeleton} from '@sanity/ui'\nimport {css, styled} from 'styled-components'\n\nimport {Tooltip} from '../../../../../ui-components/tooltip/Tooltip'\nimport {useCurrentUser, useUser} from '../../../../store/user/hooks'\nimport {CommentsAvatar} from '../../avatars/CommentsAvatar'\n\nconst Span = styled.span(({theme}) => {\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const {regular} = theme.sanity.fonts?.text.weights || {}\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const {hovered} = theme.sanity.color?.card || {}\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const {bg} = theme.sanity.color.selectable?.caution.pressed || {}\n\n return css`\n font-weight: ${regular};\n color: var(--card-link-fg-color);\n border-radius: 2px;\n background-color: ${hovered.bg};\n padding: 1px;\n box-sizing: border-box;\n\n &[data-active='true'] {\n background-color: ${bg};\n }\n `\n})\n\ninterface MentionInlineBlockProps {\n userId: string\n selected: boolean\n}\n\nexport function MentionInlineBlock(props: MentionInlineBlockProps) {\n const {selected, userId} = props\n const [user, loading] = useUser(userId)\n const currentUser = useCurrentUser()\n\n if (!user || loading)\n return (\n <TextSkeleton\n data-testid=\"comment-mentions-loading-skeleton\"\n style={{width: '10ch'}}\n size={0}\n muted\n radius={1}\n animated\n />\n )\n\n return (\n <Tooltip\n portal\n content={\n <Flex align=\"center\" gap={2}>\n <Flex>\n <CommentsAvatar user={user} />\n </Flex>\n\n <Text size={1}>{user.displayName}</Text>\n </Flex>\n }\n >\n <Span data-selected={selected} data-active={currentUser?.id === userId}>\n @{user.displayName}\n </Span>\n </Tooltip>\n )\n}\n","import {type BlockChildRenderProps, type RenderChildFunction} from '@portabletext/editor'\n\nimport {MentionInlineBlock} from '../blocks/MentionInlineBlock'\n\nexport const renderChild: RenderChildFunction = (childProps: BlockChildRenderProps) => {\n const {children, value, selected} = childProps\n\n const isMention = value._type === 'mention' && value.userId\n\n if (isMention) {\n return <MentionInlineBlock selected={selected} userId={value?.userId as string} />\n }\n\n return children\n}\n","import {useContext} from 'react'\nimport {CommentInputContext} from 'sanity/_singletons'\n\nimport {type CommentInputContextValue} from './CommentInputProvider'\n\nexport function useCommentInput(): CommentInputContextValue {\n const ctx = useContext(CommentInputContext)\n\n if (!ctx) {\n throw new Error('useCommentInputContext must be used within a CommentInputProvider')\n }\n\n return ctx\n}\n","import {useCallback, useEffect, useMemo, useState} from 'react'\n\nconst EVENT_LISTENER_OPTIONS: AddEventListenerOptions = {passive: true}\n\ninterface CursorElementHookOptions {\n disabled: boolean\n rootElement: HTMLElement | null\n}\n\nexport function useCursorElement(opts: CursorElementHookOptions): HTMLElement | null {\n const {disabled, rootElement} = opts\n const [cursorRect, setCursorRect] = useState<DOMRect | null>(null)\n\n const cursorElement = useMemo(() => {\n if (!cursorRect) {\n return null\n }\n return {\n getBoundingClientRect: () => {\n return cursorRect\n },\n } as HTMLElement\n }, [cursorRect])\n\n const handleSelectionChange = useCallback(() => {\n if (disabled) {\n setCursorRect(null)\n return\n }\n\n const sel = window.getSelection()\n\n if (!sel || !sel.isCollapsed || sel.rangeCount === 0) return\n\n const range = sel.getRangeAt(0)\n const isWithinRoot = rootElement?.contains(range.commonAncestorContainer)\n\n if (!isWithinRoot) {\n setCursorRect(null)\n return\n }\n const rect = range?.getBoundingClientRect()\n if (rect) {\n setCursorRect(rect)\n }\n }, [disabled, rootElement])\n\n useEffect(() => {\n document.addEventListener('selectionchange', handleSelectionChange, EVENT_LISTENER_OPTIONS)\n\n return () => {\n document.removeEventListener('selectionchange', handleSelectionChange)\n }\n }, [handleSelectionChange])\n\n return cursorElement\n}\n","import {\n type EditorSelection,\n PortableTextEditable,\n type RenderBlockFunction,\n usePortableTextEditorSelection,\n} from '@portabletext/editor'\nimport {isPortableTextSpan, isPortableTextTextBlock} from '@sanity/types'\nimport {useClickOutsideEvent} from '@sanity/ui'\nimport {getTheme_v2} from '@sanity/ui/theme'\nimport isEqual from 'lodash-es/isEqual.js'\nimport {type KeyboardEvent, useCallback, useEffect, useMemo, useRef, useState} from 'react'\nimport {css, styled} from 'styled-components'\n\nimport {Popover, type PopoverProps} from '../../../../../ui-components/popover/Popover'\nimport {useTranslation} from '../../../../i18n/hooks/useTranslation'\nimport {commentsLocaleNamespace} from '../../../i18n'\nimport {MentionsMenu, type MentionsMenuHandle} from '../../mentions/MentionsMenu'\nimport {renderChild} from '../render/renderChild'\nimport {useCommentInput} from './useCommentInput'\nimport {useCursorElement} from './useCursorElement'\n\nconst POPOVER_FALLBACK_PLACEMENTS: PopoverProps['fallbackPlacements'] = ['bottom', 'top']\nconst INLINE_STYLE: React.CSSProperties = {outline: 'none'}\nconst EMPTY_ARRAY: [] = []\n\nconst PlaceholderWrapper = styled.span((props) => {\n const {color} = getTheme_v2(props.theme)\n return css`\n color: ${color.input.default.enabled.placeholder};\n overflow: hidden;\n text-overflow: ellipsis;\n text-wrap: nowrap;\n display: block;\n `\n})\n\nconst StyledPopover = styled(Popover)(({theme}) => {\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const {space, radius} = theme.sanity\n\n return css`\n &[data-placement='bottom'] {\n transform: translateY(${space[1]}px);\n }\n\n &[data-placement='top'] {\n transform: translateY(-${space[1]}px);\n }\n\n [data-ui='Popover__wrapper'] {\n border-radius: ${radius[3]}px;\n display: flex;\n flex-direction: column;\n overflow: clip;\n overflow: hidden;\n position: relative;\n width: 300px; // todo: improve\n }\n `\n})\n\ninterface EditableProps {\n focusLock?: boolean\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n onBlur?: (e: React.FormEvent<HTMLDivElement>) => void\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n onFocus?: (e: React.FormEvent<HTMLDivElement>) => void\n onKeyDown?: (e: React.KeyboardEvent) => void\n onSubmit?: () => void\n placeholder?: React.ReactNode\n renderBlock: RenderBlockFunction\n}\n\ninterface EditableHandle {\n setShowMentionOptions: (show: boolean) => void\n}\n\nexport function Editable(props: EditableProps) {\n const {t} = useTranslation(commentsLocaleNamespace)\n const {\n focusLock,\n onFocus,\n onBlur,\n onKeyDown,\n onSubmit,\n placeholder = t('compose.create-comment-placeholder'),\n renderBlock,\n } = props\n const popoverRef = useRef<HTMLDivElement | null>(null)\n const [rootElement, setRootElement] = useState<HTMLDivElement | null>(null)\n const [inputElement, setInputElement] = useState<HTMLDivElement | null>(null)\n const mentionsMenuRef = useRef<MentionsMenuHandle | null>(null)\n\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const selection = usePortableTextEditorSelection()\n\n const {\n canSubmit,\n closeMentions,\n insertMention,\n mentionOptions,\n mentionsMenuOpen,\n mentionsSearchTerm,\n onBeforeInput,\n value,\n } = useCommentInput()\n\n const cursorElement = useCursorElement({\n disabled: !mentionsMenuOpen,\n rootElement: rootElement,\n })\n\n const renderPlaceholder = useCallback(\n () => <PlaceholderWrapper>{placeholder}</PlaceholderWrapper>,\n [placeholder],\n )\n\n useClickOutsideEvent(mentionsMenuOpen && closeMentions, () => [popoverRef.current])\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n switch (event.key) {\n case 'Enter':\n // Shift enter is used to insert a new line,\n // keep the default behavior\n if (event.shiftKey) {\n break\n }\n\n // If the mention menu is open close it, but don't submit.\n if (mentionsMenuOpen) {\n // Enter is being used both to select something from the mentionsMenu, prevent the default behavior.\n event.preventDefault()\n event.stopPropagation()\n closeMentions()\n break\n }\n\n // Submit the comment if eligible for submission\n if (onSubmit && canSubmit) {\n // Enter is being used to submit the comment, prevent the default behavior.\n event.preventDefault()\n event.stopPropagation()\n onSubmit()\n }\n break\n\n case 'Escape':\n case 'ArrowLeft':\n case 'ArrowRight':\n if (mentionsMenuOpen) {\n // stop these events if the menu is open\n event.preventDefault()\n event.stopPropagation()\n closeMentions()\n }\n break\n default:\n }\n // Call parent key handler\n if (onKeyDown) onKeyDown(event)\n },\n [canSubmit, closeMentions, mentionsMenuOpen, onKeyDown, onSubmit],\n )\n\n const initialSelectionAtEndOfContent: EditorSelection | undefined = useMemo(() => {\n if (selection) {\n return undefined\n }\n const lastBlock = (value || EMPTY_ARRAY).slice(-1)[0]\n const lastChild = isPortableTextTextBlock(lastBlock)\n ? lastBlock.children.slice(-1)[0]\n : undefined\n if (!lastChild) {\n return undefined\n }\n const point = {\n path: [{_key: lastBlock._key}, 'children', {_key: lastChild._key}],\n offset: isPortableTextSpan(lastChild) ? lastChild.text.length : 0,\n }\n return {\n focus: point,\n anchor: point,\n }\n }, [value, selection])\n\n // Update the mentions search term in the mentions menu\n useEffect(() => {\n mentionsMenuRef.current?.setSearchTerm(mentionsSearchTerm)\n }, [mentionsSearchTerm])\n\n // Close mentions if the user selects text\n useEffect(() => {\n if (mentionsMenuOpen && selection && !isEqual(selection.anchor, selection.focus)) {\n closeMentions()\n }\n }, [mentionsMenuOpen, closeMentions, selection])\n\n const popoverContent = (\n <MentionsMenu\n inputElement={inputElement}\n loading={mentionOptions.loading}\n onSelect={insertMention}\n options={mentionOptions.data || EMPTY_ARRAY}\n ref={mentionsMenuRef}\n />\n )\n\n return (\n <div ref={setRootElement}>\n <StyledPopover\n arrow={false}\n constrainSize\n content={popoverContent}\n disabled={!mentionsMenuOpen}\n fallbackPlacements={POPOVER_FALLBACK_PLACEMENTS}\n open={mentionsMenuOpen}\n placement=\"bottom\"\n ref={popoverRef}\n referenceElement={cursorElement}\n />\n <PortableTextEditable\n data-testid=\"comment-input-editable\"\n data-ui=\"EditableElement\"\n onBeforeInput={onBeforeInput}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={handleKeyDown}\n ref={setInputElement}\n renderBlock={renderBlock}\n renderChild={renderChild}\n renderPlaceholder={renderPlaceholder}\n selection={initialSelectionAtEndOfContent}\n style={INLINE_STYLE}\n tabIndex={focusLock ? 0 : undefined}\n />\n </div>\n )\n}\nEditable.displayName = 'Editable'\n","import {type RenderBlockFunction} from '@portabletext/editor'\nimport {type CurrentUser} from '@sanity/types'\nimport {type AvatarSize, Box, Card, Flex, MenuDivider, Stack} from '@sanity/ui'\nimport {getTheme_v2} from '@sanity/ui/theme'\nimport {useCallback} from 'react'\nimport {css, styled} from 'styled-components'\n\nimport {Button} from '../../../../../ui-components/button/Button'\nimport {TooltipDelayGroupProvider} from '../../../../../ui-components/tooltipDelayGroupProvider/TooltipDelayGroupProvider'\nimport {useTranslation} from '../../../../i18n/hooks/useTranslation'\nimport {useUser} from '../../../../store/user/hooks'\nimport {commentsLocaleNamespace} from '../../../i18n'\nimport {CommentsAvatar} from '../../avatars/CommentsAvatar'\nimport {MentionIcon} from '../../icons/MentionIcon'\nimport {SendIcon} from '../../icons/SendIcon'\nimport {Editable} from './Editable'\nimport {useCommentInput} from './useCommentInput'\n\nconst EditableWrap = styled(Box)`\n max-height: 20vh;\n overflow-y: auto;\n`\n\nconst ButtonDivider = styled(MenuDivider)({\n height: 20,\n width: 1,\n})\n\nfunction focusRingBorderStyle(border: {color: string; width: number}): string {\n return `inset 0 0 0 ${border.width}px ${border.color}`\n}\n\nconst RootCard = styled(Card)(({theme}) => {\n const {color, input, radius} = getTheme_v2(theme)\n const radii = radius[2]\n\n return css`\n border-radius: ${radii}px;\n box-shadow: var(--input-box-shadow);\n\n --input-box-shadow: ${focusRingBorderStyle({\n color: color.input.default.enabled.border,\n width: input.border.width,\n })};\n\n &:not([data-expand-on-focus='false'], :focus-within) {\n background: transparent;\n box-shadow: unset;\n }\n\n &[data-focused='true']:focus-within {\n ${EditableWrap} {\n min-height: 1em;\n }\n\n /* box-shadow: inset 0 0 0 1px var(--card-focus-ring-color); */\n --input-box-shadow: ${focusRingBorderStyle({\n color: 'var(--card-focus-ring-color)',\n width: input.border.width,\n })};\n }\n\n &:focus-within {\n ${EditableWrap} {\n min-height: 1em;\n }\n }\n\n &[data-expand-on-focus='false'] {\n ${EditableWrap} {\n min-height: 1em;\n }\n }\n\n &[data-expand-on-focus='true'] {\n [data-ui='CommentInputActions']:not([hidden]) {\n display: none;\n }\n\n &:focus-within {\n [data-ui='CommentInputActions'] {\n display: flex;\n }\n }\n }\n &:hover {\n --input-box-shadow: ${focusRingBorderStyle({\n color: color.input.default.hovered.border,\n width: input.border.width,\n })};\n }\n `\n})\n\nconst AvatarContainer = styled.div((props) => {\n const theme = getTheme_v2(props.theme)\n return `\n min-height: ${theme.avatar.sizes[1]?.size}px;\n display: flex;\n align-items: center;\n `\n})\n\ninterface CommentInputInnerProps {\n avatarSize?: AvatarSize\n currentUser: CurrentUser\n focusLock?: boolean\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n onBlur?: (e: React.FormEvent<HTMLDivElement>) => void\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n onFocus?: (e: React.FormEvent<HTMLDivElement>) => void\n onKeyDown?: (e: React.KeyboardEvent) => void\n onSubmit?: () => void\n placeholder?: React.ReactNode\n renderBlock: RenderBlockFunction\n withAvatar?: boolean\n}\n\nexport function CommentInputInner(props: CommentInputInnerProps) {\n const {\n avatarSize = 1,\n currentUser,\n focusLock,\n onBlur,\n onFocus,\n onKeyDown,\n onSubmit,\n placeholder,\n renderBlock,\n withAvatar,\n } = props\n\n const [user] = useUser(currentUser.id)\n const {\n canSubmit,\n expandOnFocus,\n focused,\n hasChanges,\n insertAtChar,\n openMentions,\n readOnly,\n mentionOptions,\n } = useCommentInput()\n\n const {t} = useTranslation(commentsLocaleNamespace)\n const avatar = withAvatar ? (\n <AvatarContainer>\n <CommentsAvatar user={user} size={avatarSize} />\n </AvatarContainer>\n ) : null\n\n const handleMentionButtonClicked = useCallback(\n (e: React.MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation()\n insertAtChar()\n openMentions()\n },\n [insertAtChar, openMentions],\n )\n\n return (\n <Flex align=\"flex-start\" gap={2}>\n {avatar}\n\n <RootCard\n id=\"comment-input-root\"\n data-expand-on-focus={expandOnFocus && !canSubmit ? 'true' : 'false'}\n data-focused={focused ? 'true' : 'false'}\n flex={1}\n sizing=\"border\"\n tone={readOnly ? 'transparent' : 'default'}\n >\n <Stack>\n <EditableWrap\n data-ui=\"CommentInputEditableWrap\"\n paddingX={1}\n paddingY={2}\n sizing=\"border\"\n >\n <Editable\n focusLock={focusLock}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n onSubmit={onSubmit}\n placeholder={placeholder}\n renderBlock={renderBlock}\n />\n </EditableWrap>\n\n <Flex align=\"center\" data-ui=\"CommentInputActions\" gap={1} justify=\"flex-end\" padding={1}>\n <TooltipDelayGroupProvider>\n {!mentionOptions.disabled && (\n <Button\n aria-label={t('compose.mention-user-aria-label')}\n data-testid=\"comment-input-mention-button\"\n disabled={readOnly}\n icon={MentionIcon}\n mode=\"bleed\"\n type=\"button\"\n onClick={handleMentionButtonClicked}\n tooltipProps={{content: t('compose.mention-user-tooltip')}}\n />\n )}\n {onSubmit && (\n <>\n {!mentionOptions.disabled && <ButtonDivider />}\n\n <Button\n aria-label={t('compose.send-comment-aria-label')}\n data-testid=\"comment-input-send-button\"\n disabled={!canSubmit || !hasChanges || readOnly}\n icon={SendIcon}\n mode={hasChanges && canSubmit ? 'default' : 'bleed'}\n onClick={onSubmit}\n tone={hasChanges && canSubmit ? 'primary' : 'default'}\n tooltipProps={{content: t('compose.send-comment-tooltip')}}\n />\n </>\n )}\n </TooltipDelayGroupProvider>\n </Flex>\n </Stack>\n </RootCard>\n </Flex>\n )\n}\n","import {type EditorSelection, PortableTextEditor, usePortableTextEditor} from '@portabletext/editor'\nimport {isPortableTextSpan, type Path} from '@sanity/types'\nimport {type ReactNode, useCallback, useMemo, useState} from 'react'\nimport {CommentInputContext} from 'sanity/_singletons'\n\nimport {useDidUpdate} from '../../../../form/hooks/useDidUpdate'\nimport {type UserListWithPermissionsHookValue} from '../../../../hooks/useUserListWithPermissions'\nimport {hasCommentMessageValue, useCommentHasChanged} from '../../../helpers'\nimport {type CommentMessage} from '../../../types'\n\nexport interface CommentInputContextValue {\n canSubmit?: boolean\n closeMentions: () => void\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n editor: PortableTextEditor\n expandOnFocus?: boolean\n focused: boolean\n focusEditor: () => void\n focusOnMount?: boolean\n hasChanges: boolean\n insertAtChar: () => void\n insertMention: (userId: string) => void\n mentionOptions: UserListWithPermissionsHookValue\n mentionsMenuOpen: boolean\n mentionsSearchTerm: string\n onBeforeInput: (event: InputEvent) => void\n openMentions: () => void\n readOnly: boolean\n value: CommentMessage\n}\n\ninterface CommentInputProviderProps {\n children: ReactNode\n expandOnFocus?: boolean\n focused: boolean\n focusOnMount?: boolean\n mentionOptions: UserListWithPermissionsHookValue\n onMentionMenuOpenChange?: (open: boolean) => void\n readOnly?: boolean\n value: CommentMessage\n}\n\nexport function CommentInputProvider(props: CommentInputProviderProps) {\n const {\n children,\n expandOnFocus = false,\n focused,\n focusOnMount = false,\n mentionOptions,\n onMentionMenuOpenChange,\n value,\n readOnly,\n } = props\n\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const editor = usePortableTextEditor()\n\n const [mentionsMenuOpen, setMentionsMenuOpen] = useState<boolean>(false)\n const [mentionsSearchTerm, setMentionsSearchTerm] = useState<string>('')\n const [selectionAtMentionInsert, setSelectionAtMentionInsert] = useState<EditorSelection>(null)\n\n const canSubmit = useMemo(() => hasCommentMessageValue(value), [value])\n\n const hasChanges = useCommentHasChanged(value)\n\n const focusEditor = useCallback(() => {\n if (readOnly) return\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n PortableTextEditor.focus(editor)\n }, [editor, readOnly])\n\n const closeMentions = useCallback(() => {\n setMentionsMenuOpen(false)\n setMentionsSearchTerm('')\n setSelectionAtMentionInsert(null)\n }, [])\n\n const openMentions = useCallback(() => {\n if (mentionOptions?.disabled) {\n return\n }\n setMentionsMenuOpen(true)\n setMentionsSearchTerm('')\n setMentionsMenuOpen(true)\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n setSelectionAtMentionInsert(PortableTextEditor.getSelection(editor))\n }, [editor, mentionOptions?.disabled])\n\n // This function activates or deactivates the mentions menu and updates\n // the mention search term when the user types into the Portable Text Editor.\n const onBeforeInput = useCallback(\n (event: InputEvent): void => {\n if (mentionOptions?.disabled) {\n return\n }\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const selection = PortableTextEditor.getSelection(editor)\n const cursorOffset = selection ? selection.focus.offset : 0\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const focusChild = PortableTextEditor.focusChild(editor)\n const focusSpan = (isPortableTextSpan(focusChild) && focusChild) || undefined\n\n const isInsertText = event.inputType === 'insertText'\n const isDeleteText = event.inputType === 'deleteContentBackward'\n const isInsertingAtChar = isInsertText && event.data === '@'\n\n const lastIndexOfAt =\n focusSpan?.text.slice(0, Math.max(0, cursorOffset)).lastIndexOf('@') || 0\n\n const isWhitespaceCharBeforeCursorPosition =\n focusSpan?.text.slice(cursorOffset - 1, cursorOffset) === ' '\n\n const filterStartsWithSpaceChar = isInsertText && event.data === ' ' && !mentionsSearchTerm\n\n // If we are inserting a '@' character - open the mentions menu and reset the search term.\n // Only do this if it is in the start of the text, or if '@' is inserted when following a whitespace char.\n if (isInsertingAtChar && (cursorOffset < 1 || isWhitespaceCharBeforeCursorPosition)) {\n openMentions()\n return\n }\n\n // If the user begins typing their filter with a space, or if they are deleting\n // characters after activation and the '@' is no longer there,\n // clear the search term and close the mentions menu.\n if (\n filterStartsWithSpaceChar ||\n (isDeleteText &&\n (focusSpan?.text.length === 1 || lastIndexOfAt === (focusSpan?.text.length || 0) - 1))\n ) {\n closeMentions()\n return\n }\n\n // Update the search term\n if (isPortableTextSpan(focusChild)) {\n // Term starts with the @ char in the value until the cursor offset\n let term = focusChild.text.slice(lastIndexOfAt + 1, cursorOffset)\n // Add the char to the mentions search term\n if (isInsertText) {\n term += event.data\n }\n // Exclude the char from the mentions search term\n if (isDeleteText) {\n term = term.slice(0, Math.max(0, term.length - 1))\n }\n // Set the updated mentions search term\n setMentionsSearchTerm(term)\n }\n },\n [closeMentions, editor, mentionsSearchTerm, openMentions, mentionOptions?.disabled],\n )\n\n const insertAtChar = useCallback(() => {\n setMentionsMenuOpen(true)\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n PortableTextEditor.focus(editor)\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n PortableTextEditor.insertChild(editor, editor.schemaTypes.span, {text: '@'})\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n setSelectionAtMentionInsert(PortableTextEditor.getSelection(editor))\n }, [editor])\n\n useDidUpdate(mentionsMenuOpen, () => onMentionMenuOpenChange?.(mentionsMenuOpen))\n\n const insertMention = useCallback(\n (userId: string) => {\n const mentionSchemaType = editor.schemaTypes.inlineObjects.find((t) => t.name === 'mention')\n let mentionPath: Path | undefined\n\n const [span, spanPath] =\n (selectionAtMentionInsert &&\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n PortableTextEditor.findByPath(editor, selectionAtMentionInsert.focus.path)) ||\n []\n if (span && isPortableTextSpan(span) && spanPath && mentionSchemaType) {\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n PortableTextEditor.focus(editor)\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const offset = PortableTextEditor.getSelection(editor)?.focus.offset\n if (typeof offset !== 'undefined') {\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n PortableTextEditor.delete(\n editor,\n {\n anchor: {path: spanPath, offset: span.text.lastIndexOf('@')},\n focus: {path: spanPath, offset},\n },\n {mode: 'selected'},\n )\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n PortableTextEditor.insertChild(editor, mentionSchemaType, {\n userId: userId,\n })\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n PortableTextEditor.insertChild(editor, editor.schemaTypes.span, {text: ' '})\n }\n }\n },\n [editor, selectionAtMentionInsert],\n )\n\n const ctxValue = useMemo(\n (): CommentInputContextValue => ({\n canSubmit,\n closeMentions,\n editor,\n expandOnFocus,\n focused,\n focusEditor,\n focusOnMount,\n hasChanges,\n insertAtChar,\n insertMention,\n mentionOptions,\n mentionsMenuOpen,\n mentionsSearchTerm,\n onBeforeInput,\n openMentions,\n readOnly: Boolean(readOnly),\n value,\n }),\n [\n canSubmit,\n closeMentions,\n editor,\n expandOnFocus,\n focused,\n focusEditor,\n focusOnMount,\n hasChanges,\n insertAtChar,\n insertMention,\n mentionOptions,\n mentionsMenuOpen,\n mentionsSearchTerm,\n onBeforeInput,\n openMentions,\n readOnly,\n value,\n ],\n )\n\n return <CommentInputContext.Provider value={ctxValue}>{children}</CommentInputContext.Provider>\n}\n","import {\n type Editor,\n type EditorEmittedEvent,\n EditorProvider,\n keyGenerator,\n type RenderBlockFunction,\n useEditor,\n} from '@portabletext/editor'\nimport {EventListenerPlugin} from '@portabletext/editor/plugins'\nimport {getValue} from '@portabletext/editor/selectors'\nimport {OneLinePlugin} from '@portabletext/plugin-one-line'\nimport {sanitySchemaToPortableTextSchema} from '@portabletext/sanity-bridge'\nimport {type CurrentUser, type PortableTextBlock} from '@sanity/types'\nimport {type AvatarSize, focusFirstDescendant, focusLastDescendant, Stack} from '@sanity/ui'\nimport {\n type FocusEvent,\n type FormEvent,\n type KeyboardEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type RefAttributes,\n} from 'react'\n\nimport {type UserListWithPermissionsHookValue} from '../../../../hooks/useUserListWithPermissions'\nimport {editorSchemaType} from '../config'\nimport {renderBlock as defaultRenderBlock} from '../render/renderBlock'\nimport {CommentInputDiscardDialog} from './CommentInputDiscardDialog'\nimport {CommentInputInner} from './CommentInputInner'\nimport {CommentInputProvider} from './CommentInputProvider'\n\n/**\n * `EditorProvider` doesn't have a `ref` prop. This plugin takes care of\n * imperatively forwarding the editor instance.\n */\nfunction EditorRefPlugin(props: RefAttributes<Editor | null>) {\n const {ref} = props\n const editor = useEditor()\n\n useImperativeHandle(ref, () => editor, [editor])\n\n return null\n}\nEditorRefPlugin.displayName = 'EditorRefPlugin'\n\nconst EMPTY_ARRAY: [] = []\n\nconst SCROLL_INTO_VIEW_OPTIONS: ScrollIntoViewOptions = {\n behavior: 'smooth',\n block: 'center',\n inline: 'center',\n}\n\n/**\n * @internal\n */\nexport interface CommentInputProps {\n currentUser: CurrentUser\n expandOnFocus?: boolean\n focusLock?: boolean\n focusOnMount?: boolean\n mentionOptions: UserListWithPermissionsHookValue\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n onBlur?: (e: FormEvent<HTMLDivElement>) => void\n onChange: (value: PortableTextBlock[]) => void\n onDiscardCancel?: () => void\n onDiscardConfirm: () => void\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n onFocus?: (e: FormEvent<HTMLDivElement>) => void\n onKeyDown?: (e: KeyboardEvent) => void\n onMentionMenuOpenChange?: (open: boolean) => void\n onSubmit?: (value: PortableTextBlock[]) => void\n placeholder?: ReactNode\n readOnly?: boolean\n renderBlock?: RenderBlockFunction\n value: PortableTextBlock[] | null\n withAvatar?: boolean\n avatarSize?: AvatarSize\n}\n\ninterface CommentDiscardDialogController {\n open: () => void\n close: () => void\n}\n\n/**\n * @internal\n */\nexport interface CommentInputHandle {\n blur: () => void\n discardDialogController: CommentDiscardDialogController\n focus: () => void\n scrollTo: () => void\n reset: () => void\n}\n\n/**\n * @internal\n * @hidden\n */\nexport function CommentInput(props: CommentInputProps & RefAttributes<CommentInputHandle>) {\n const {\n ref,\n avatarSize,\n currentUser,\n expandOnFocus,\n focusLock = false,\n focusOnMount,\n mentionOptions,\n onBlur,\n onChange,\n onDiscardCancel,\n onDiscardConfirm,\n onFocus,\n onKeyDown,\n onMentionMenuOpenChange,\n onSubmit,\n placeholder,\n readOnly,\n renderBlock = defaultRenderBlock,\n value = EMPTY_ARRAY,\n withAvatar = true,\n } = props\n const [focused, setFocused] = useState<boolean>(false)\n const editorRef = useRef<Editor | null>(null)\n const editorContainerRef = useRef<HTMLDivElement | null>(null)\n const resetInstanceRef = useRef(false)\n const [showDiscardDialog, setShowDiscardDialog] = useState<boolean>(false)\n\n const preDivRef = useRef<HTMLDivElement | null>(null)\n const postDivRef = useRef<HTMLDivElement | null>(null)\n const innerRef = useRef<HTMLDivElement | null>(null)\n\n // A unique (React) key for the editor instance.\n const [editorInstanceKey, setEditorInstanceKey] = useState(keyGenerator())\n\n const requestFocus = useCallback(() => {\n requestAnimationFrame(() => {\n editorRef.current?.send({type: 'focus'})\n })\n }, [])\n\n const resetEditorInstance = useCallback(() => {\n // The discarded instance flushes pending mutations during teardown; drop\n // them in `handleEvent` so a finished draft cannot overwrite the\n // consumer's cleared draft state.\n resetInstanceRef.current = true\n setEditorInstanceKey(keyGenerator())\n }, [])\n\n const handleEvent = useCallback(\n (event: EditorEmittedEvent) => {\n // Focus the editor when ready if focusOnMount is true\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n if (event.type === 'ready') {\n resetInstanceRef.current = false\n if (focusOnMount) {\n requestFocus()\n }\n }\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n if (event.type === 'focused') {\n setFocused(true)\n }\n\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n if (event.type === 'blurred') {\n setFocused(false)\n }\n\n // Update the comment value whenever the comment is edited by the user.\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n if (event.type === 'mutation' && !resetInstanceRef.current) {\n onChange(event.value || EMPTY_ARRAY)\n }\n },\n [focusOnMount, onChange, requestFocus],\n )\n\n const scrollToEditor = useCallback(() => {\n editorContainerRef.current?.scrollIntoView(SCROLL_INTO_VIEW_OPTIONS)\n }, [])\n\n const handleSubmit = useCallback(() => {\n // Read the editor's live value directly rather than the value mirrored\n // through the debounced `mutation` event, which can lag the latest\n // keystrokes by up to the flush interval and truncate the comment when\n // the user submits without pausing.\n const currentValue = editorRef.current ? getValue(editorRef.current.getSnapshot()) : EMPTY_ARRAY\n onSubmit?.(currentValue)\n resetEditorInstance()\n requestFocus()\n scrollToEditor()\n }, [onSubmit, requestFocus, resetEditorInstance, scrollToEditor])\n\n const handleDiscardConfirm = useCallback(() => {\n onDiscardConfirm()\n resetEditorInstance()\n }, [onDiscardConfirm, resetEditorInstance])\n\n // The way a user a comment can be discarded varies from the context it is used in.\n // This controller is used to take care of the main logic of the discard process, while\n // specific behavior is handled by the consumer.\n const discardDialogController = useMemo((): CommentDiscardDialogController => {\n return {\n open: () => {\n setShowDiscardDialog(true)\n },\n close: () => {\n setShowDiscardDialog(false)\n requestFocus()\n },\n }\n }, [requestFocus])\n\n useImperativeHandle(ref, () => {\n return {\n focus: requestFocus,\n blur() {\n editorRef.current?.send({type: 'blur'})\n },\n scrollTo: scrollToEditor,\n reset: resetEditorInstance,\n\n discardDialogController,\n }\n }, [discardDialogController, requestFocus, resetEditorInstance, scrollToEditor])\n\n const handleFocus = useCallback(\n (event: FocusEvent<HTMLDivElement>) => {\n if (!focusLock) return\n\n const target = event.target\n const innerEl = innerRef.current\n\n if (innerEl && target === preDivRef.current) {\n focusLastDescendant(innerEl)\n return\n }\n\n if (innerEl && target === postDivRef.current) {\n focusFirstDescendant(innerEl)\n }\n },\n [focusLock],\n )\n\n return (\n <>\n {showDiscardDialog && onDiscardCancel && (\n <CommentInputDiscardDialog onClose={onDiscardCancel} onConfirm={handleDiscardConfirm} />\n )}\n\n <Stack ref={editorContainerRef} data-testid=\"comment-input\" onFocus={handleFocus}>\n <EditorProvider\n key={editorInstanceKey}\n initialConfig={{\n schemaDefinition: sanitySchemaToPortableTextSchema(editorSchemaType),\n initialValue: value || EMPTY_ARRAY,\n readOnly,\n }}\n >\n <EditorRefPlugin ref={editorRef} />\n <EventListenerPlugin on={handleEvent} />\n <OneLinePlugin />\n <UpdateReadOnlyPlugin readOnly={readOnly ?? false} />\n <UpdateValuePlugin value={value ?? undefined} />\n <CommentInputProvider\n expandOnFocus={expandOnFocus}\n focused={focused}\n focusOnMount={focusOnMount}\n mentionOptions={mentionOptions}\n onMentionMenuOpenChange={onMentionMenuOpenChange}\n readOnly={readOnly}\n value={value}\n >\n {focusLock && <div ref={preDivRef} tabIndex={0} />}\n\n <Stack ref={innerRef}>\n <CommentInputInner\n avatarSize={avatarSize}\n currentUser={currentUser}\n focusLock={focusLock}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n onSubmit={onSubmit && handleSubmit}\n placeholder={placeholder}\n renderBlock={renderBlock}\n withAvatar={withAvatar}\n />\n </Stack>\n\n {focusLock && <div ref={postDivRef} tabIndex={0} />}\n </CommentInputProvider>\n </EditorProvider>\n </Stack>\n </>\n )\n}\n\n/**\n * `EditorProvider` doesn't have a `readOnly` prop. This plugin listens for the\n * prop change and sends an `update readOnly` event to the editor.\n */\nfunction UpdateReadOnlyPlugin(props: {readOnly: boolean}) {\n const editor = useEditor()\n\n useEffect(() => {\n editor.send({\n type: 'update readOnly',\n readOnly: props.readOnly,\n })\n }, [editor, props.readOnly])\n\n return null\n}\n\n/**\n * `EditorProvider` doesn't have a `value` prop. This plugin listens for the\n * prop change and sends an `update value` event to the editor.\n */\nfunction UpdateValuePlugin(props: {value: Array<PortableTextBlock> | undefined}) {\n const editor = useEditor()\n\n useEffect(() => {\n editor.send({\n type: 'update value',\n value: props.value,\n })\n }, [editor, props.value])\n\n return null\n}\n","import {type ColorHueKey} from '@sanity/color'\n\nimport {type CommentReactionOption, type CommentReactionShortNames} from './types'\n\n/**\n * @internal\n * @hidden\n */\nexport const COMMENTS_INSPECTOR_NAME = 'sanity/comments'\n\nexport const COMMENTS_HIGHLIGHT_HUE_KEY: ColorHueKey = 'yellow'\n\n// These should not be alphabetized as the current order is intentional\nexport const COMMENT_REACTION_OPTIONS: CommentReactionOption[] = [\n {\n shortName: ':+1:',\n title: 'Thumbs up',\n },\n {\n shortName: ':-1:',\n title: 'Thumbs down',\n },\n {\n shortName: ':heart:',\n title: 'Heart',\n },\n {\n shortName: ':rocket:',\n title: 'Rocket',\n },\n {\n shortName: ':heavy_plus_sign:',\n title: 'Heavy plus sign',\n },\n {\n shortName: ':eyes:',\n title: 'Eyes',\n },\n]\n\nexport const COMMENT_REACTION_EMOJIS: Record<CommentReactionShortNames, string> = {\n ':-1:': '👎',\n ':+1:': '👍',\n ':eyes:': '👀',\n ':heart:': '❤️',\n ':heavy_plus_sign:': '➕',\n ':rocket:': '🚀',\n}\n","import {useContext} from 'react'\nimport {CommentsContext} from 'sanity/_singletons'\n\nimport {type CommentsContextValue} from '../context/comments/types'\n\n/**\n * @beta\n * @hidden\n */\nexport function useComments(): CommentsContextValue {\n const value = useContext(CommentsContext)\n\n if (!value) {\n throw new Error('useComments must be used within a CommentsProvider')\n }\n\n return value\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAaC,0BAA0B,YAO1BE,gCAAsD;CACjEC,QAAQ;CACRC,WAAWJ;CACXK,iBAAiB,OAAO;AAC1B,GCfMO,sBAA+C;CACnDC,UAAU;CACVC,QAAQ;CACRC,YAAY;AACd,GAEMC,uBAAgD;CACpD,GAAGJ;CACHK,OAAO;AACT,GAEMC,gCAAyD;CAC7D,GAAGN;CACHK,OAAO;AACT,GAEME,0BAAmD;CACvD,GAAGP;CACHK,OAAO;AACT,GAOMI,yBAA6E;CACjF,SAAWD;EALX,GAAGR;EACHK,OAAO;CAIIG;CACX,OAASD;CACT,OAASH;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,KAAM;GAAAC,MACJ;GAAc3C,OACbxB,MAAKwB;EACd,CAAC;CAAC,GACDlB,KAAA,CAACF,QAAQJ,MAAKwB,KAAM,GAACvB,EAAA,KAAAG,QAAAH,EAAA,KAAAD,MAAAwB,OAAAvB,EAAA,KAAAI,IAAAJ,EAAA,KAAAK,OAAAD,KAAAJ,EAAA,IAAAK,KAAAL,EAAA,KALxBf,UAAUmB,IAKPC,EAAqB,GAEjB;AAAI;;;;;ACxUb,MAAa+G,0BAA0B,mBAE1BC,6BAA0C,UAG1CC,2BAAoD;CAC/D;EACEC,WAAW;EACXC,OAAO;CACT;CACA;EACED,WAAW;EACXC,OAAO;CACT;CACA;EACED,WAAW;EACXC,OAAO;CACT;CACA;EACED,WAAW;EACXC,OAAO;CACT;CACA;EACED,WAAW;EACXC,OAAO;CACT;CACA;EACED,WAAW;EACXC,OAAO;CACT;AAAC,GAGUC,0BAAqE;CAChF,QAAQ;CACR,QAAQ;CACR,UAAU;CACV,WAAW;CACX,qBAAqB;CACrB,YAAY;AACd;;;;;ACtCA,SAAOK,cAAA;CACL,IAAAC,QAAcJ,WAAWC,eAAe;CAExC,IAAI,CAACG,OACH,MAAUC,MAAM,oDAAoD;CACrE,OAEMD;AAAK"}
|
|
1
|
+
{"version":3,"file":"useComments-DuEOnDkA.js","names":["LocaleResourceBundle","commentsLocaleNamespace","const","commentsUsEnglishLocaleBundle","locale","namespace","resources","useCallback","useEffect","useMemo","useState","scrollIntoViewIfNeeded","StandardBehaviorOptions","BASE_SCROLL_OPTIONS","behavior","inline","scrollMode","GROUP_SCROLL_OPTIONS","block","INLINE_COMMENT_SCROLL_OPTIONS","SCROLL_TO_FIELD_OPTIONS","SCROLL_TO_COMMENT_OPTIONS","SCROLL_OPTIONS_BY_TYPE","Record","ScrollTargetTypes","generateValidAttrValue","id","symbolsToRemove","result","replace","applyCommentIdAttr","applyCommentsFieldAttr","applyCommentsGroupAttr","applyInlineCommentIdAttr","CommentsScrollHookValue","scrollToComment","commentId","scrollToField","fieldId","scrollToGroup","groupId","scrollToInlineComment","CommentsScrollHookOptions","boundaryElement","HTMLElement","ScrollTarget","type","useCommentsScroll","opts","$","_c","t0","scrollTarget","setScrollTarget","options","shouldApplyBoundary","t1","undefined","t2","boundary","scrollOpts","t3","Symbol","for","handleScrollToComment","t4","threadId","handleScrollToGroup","t5","fieldPath","handleScrollToField","t6","commentId_0","handleScrollToInlineComment","t7","t8","raf","requestAnimationFrame","element","document","querySelector","cancelAnimationFrame","t9","value","isPortableTextSpan","isPortableTextTextBlock","Path","PathUtils","isEqual","useMemo","useState","CommentContext","CommentDocument","CommentMessage","useCommentHasChanged","message","$","_c","prevMessage","t0","hasCommentMessageValue","value","some","block","children","c","text","userId","commentIntentIfDiffers","parent","comment","parentIntent","context","intent","undefined","params","preview","parseCommentFieldPath","fieldPath","fromString","isTextSelectionComment","Boolean","target","path","selection","type","Schema","defineArrayMember","defineField","mentionObject","name","type","fields","blockType","of","marks","annotations","styles","title","value","lists","portableTextType","schema","compile","types","editorSchemaType","get","Text","ReactNode","styled","NormalText","NormalBlockProps","children","NormalBlock","props","$","_c","t0","RenderBlockFunction","NormalBlock","renderBlock","blockProps","children","DialogProvider","Text","ThemeColorProvider","MouseEvent","useCallback","Dialog","useTranslation","commentsLocaleNamespace","Z_OFFSET","CommentInputDiscardDialogProps","onClose","onConfirm","CommentInputDiscardDialog","props","$","_c","t","t0","e","stopPropagation","handleCancelClick","t1","e_0","handleConfirmClick","t2","t3","onClick","t4","t5","text","tone","t6","cancelButton","confirmButton","t7","t8","t9","User","Avatar","AvatarProps","useMemo","styled","StyledAvatar","SYMBOLS","WHITESPACE","nameToInitials","fullName","namesArray","replace","split","length","charAt","toUpperCase","CommentsAvatarProps","user","CommentsAvatar","props","$","_c","restProps","userProp","displayName","t0","t1","initials","t2","imageUrl","t3","t4","RefAttributes","SVGProps","MentionIcon","props","$","_c","ref","rest","t0","t1","Symbol","for","t2","RefAttributes","SVGProps","SendIcon","props","$","_c","ref","rest","t0","Symbol","for","t1","Badge","Box","Card","Flex","Text","TextSkeleton","CSSProperties","useCallback","styled","UserWithPermission","useTranslation","useUser","commentsLocaleNamespace","CommentsAvatar","InnerFlex","SKELETON_INLINE_STYLE","width","MentionsItemProps","user","onSelect","userId","MentionsMenuItem","props","$","_c","loadedUser","id","t","t0","granted","undefined","t1","avatar","t2","displayName","text","t3","handleSelect","t4","t5","t6","t7","t8","t9","Box","Flex","Stack","Text","deburr","Ref","useCallback","useImperativeHandle","useMemo","useRef","useState","RefAttributes","styled","CommandList","CommandListHandle","LoadingBlock","UserWithPermission","useTranslation","commentsLocaleNamespace","MentionsMenuItem","EMPTY_ARRAY","Root","maxWidth","ITEM_HEIGHT","LIST_PADDING","MAX_ITEMS","FlexWrap","maxHeight","MentionsMenuHandle","setSearchTerm","term","MentionsMenuProps","loading","inputElement","HTMLDivElement","onSelect","userId","options","MentionsMenu","props","$","_c","t","ref","t0","t1","undefined","searchTerm","commandListRef","t2","t3","Symbol","for","t4","itemProps","renderItem","t5","index","granted","getItemDisabled","t6","bb0","t7","deburredSearchTerm","toLocaleLowerCase","deburredOptions","map","_temp","filter","option_0","option","displayName","includes","sort","a","b","matchA","startsWith","matchB","filtered","filteredOptions","_inputElement","HTMLInputElement","length","t8","t9","Flex","Text","TextSkeleton","css","styled","Tooltip","useCurrentUser","useUser","CommentsAvatar","Span","span","theme","regular","sanity","fonts","text","weights","hovered","color","card","bg","selectable","caution","pressed","MentionInlineBlockProps","userId","selected","MentionInlineBlock","props","$","_c","user","loading","currentUser","t0","Symbol","for","width","t1","displayName","t2","t3","id","t4","t5","BlockChildRenderProps","RenderChildFunction","MentionInlineBlock","renderChild","childProps","children","value","selected","isMention","_type","userId","useContext","CommentInputContext","CommentInputContextValue","useCommentInput","ctx","Error","useCallback","useEffect","useMemo","useState","EVENT_LISTENER_OPTIONS","AddEventListenerOptions","passive","CursorElementHookOptions","disabled","rootElement","HTMLElement","useCursorElement","opts","$","_c","cursorRect","setCursorRect","t0","bb0","t1","getBoundingClientRect","cursorElement","sel","window","getSelection","isCollapsed","rangeCount","range","getRangeAt","isWithinRoot","contains","commonAncestorContainer","rect","handleSelectionChange","t2","t3","document","addEventListener","removeEventListener","EditorSelection","PortableTextEditable","RenderBlockFunction","usePortableTextEditorSelection","isPortableTextSpan","isPortableTextTextBlock","useClickOutsideEvent","getTheme_v2","isEqual","KeyboardEvent","useCallback","useEffect","useMemo","useRef","useState","css","styled","Popover","PopoverProps","useTranslation","commentsLocaleNamespace","MentionsMenu","MentionsMenuHandle","renderChild","useCommentInput","useCursorElement","POPOVER_FALLBACK_PLACEMENTS","INLINE_STYLE","React","CSSProperties","outline","EMPTY_ARRAY","PlaceholderWrapper","span","props","color","theme","input","default","enabled","placeholder","StyledPopover","space","radius","sanity","EditableProps","focusLock","onBlur","e","FormEvent","HTMLDivElement","onFocus","onKeyDown","onSubmit","ReactNode","renderBlock","EditableHandle","setShowMentionOptions","show","Editable","$","_c","t","t0","t1","undefined","popoverRef","rootElement","setRootElement","inputElement","setInputElement","mentionsMenuRef","selection","canSubmit","closeMentions","insertMention","mentionOptions","mentionsMenuOpen","mentionsSearchTerm","onBeforeInput","value","t2","t3","disabled","cursorElement","t4","renderPlaceholder","t5","Symbol","for","current","t6","event","bb14","key","shiftKey","preventDefault","stopPropagation","handleKeyDown","t7","bb0","lastBlock","slice","lastChild","children","point","path","_key","offset","text","length","t8","focus","anchor","initialSelectionAtEndOfContent","t9","setSearchTerm","t10","t11","t12","data","t13","loading","popoverContent","t14","t15","t16","t17","t18","displayName","RenderBlockFunction","CurrentUser","AvatarSize","Box","Card","Flex","MenuDivider","Stack","getTheme_v2","useCallback","css","styled","Button","TooltipDelayGroupProvider","useTranslation","useUser","commentsLocaleNamespace","CommentsAvatar","MentionIcon","SendIcon","Editable","useCommentInput","EditableWrap","ButtonDivider","height","width","focusRingBorderStyle","border","color","RootCard","theme","input","radius","radii","default","enabled","hovered","AvatarContainer","div","props","avatar","sizes","size","CommentInputInnerProps","avatarSize","currentUser","focusLock","onBlur","e","React","FormEvent","HTMLDivElement","onFocus","onKeyDown","KeyboardEvent","onSubmit","placeholder","ReactNode","renderBlock","withAvatar","CommentInputInner","$","_c","t0","undefined","user","id","canSubmit","expandOnFocus","focused","hasChanges","insertAtChar","openMentions","readOnly","mentionOptions","t","t1","t2","stopPropagation","handleMentionButtonClicked","t3","t4","t5","t6","t7","disabled","content","t8","t9","t10","t11","t12","EditorSelection","PortableTextEditor","usePortableTextEditor","isPortableTextSpan","Path","ReactNode","useCallback","useMemo","useState","CommentInputContext","useDidUpdate","UserListWithPermissionsHookValue","hasCommentMessageValue","useCommentHasChanged","CommentMessage","CommentInputContextValue","canSubmit","closeMentions","editor","expandOnFocus","focused","focusEditor","focusOnMount","hasChanges","insertAtChar","insertMention","userId","mentionOptions","mentionsMenuOpen","mentionsSearchTerm","onBeforeInput","event","InputEvent","openMentions","readOnly","value","CommentInputProviderProps","children","onMentionMenuOpenChange","open","CommentInputProvider","props","$","_c","t0","t1","undefined","setMentionsMenuOpen","setMentionsSearchTerm","selectionAtMentionInsert","setSelectionAtMentionInsert","t2","t3","focus","t4","Symbol","for","t5","disabled","getSelection","t6","selection","cursorOffset","offset","focusChild","focusSpan","isInsertText","inputType","isDeleteText","isInsertingAtChar","data","lastIndexOfAt","text","slice","Math","max","lastIndexOf","isWhitespaceCharBeforeCursorPosition","filterStartsWithSpaceChar","length","term","t7","insertChild","schemaTypes","span","t8","t9","mentionSchemaType","inlineObjects","find","_temp","spanPath","findByPath","path","delete","anchor","mode","t10","Boolean","t11","ctxValue","t12","t","name","Editor","EditorEmittedEvent","EditorProvider","keyGenerator","RenderBlockFunction","useEditor","EventListenerPlugin","getValue","OneLinePlugin","sanitySchemaToPortableTextSchema","CurrentUser","PortableTextBlock","AvatarSize","focusFirstDescendant","focusLastDescendant","Stack","FocusEvent","FormEvent","KeyboardEvent","ReactNode","useCallback","useEffect","useImperativeHandle","useMemo","useRef","useState","RefAttributes","UserListWithPermissionsHookValue","editorSchemaType","renderBlock","defaultRenderBlock","CommentInputDiscardDialog","CommentInputInner","CommentInputProvider","EditorRefPlugin","props","$","_c","ref","editor","t0","t1","displayName","EMPTY_ARRAY","SCROLL_INTO_VIEW_OPTIONS","ScrollIntoViewOptions","behavior","block","inline","CommentInputProps","currentUser","expandOnFocus","focusLock","focusOnMount","mentionOptions","onBlur","e","HTMLDivElement","onChange","value","onDiscardCancel","onDiscardConfirm","onFocus","onKeyDown","onMentionMenuOpenChange","open","onSubmit","placeholder","readOnly","withAvatar","avatarSize","CommentDiscardDialogController","close","CommentInputHandle","blur","discardDialogController","focus","scrollTo","reset","CommentInput","t2","t3","undefined","focused","setFocused","editorRef","editorContainerRef","resetInstanceRef","showDiscardDialog","setShowDiscardDialog","preDivRef","postDivRef","innerRef","t4","Symbol","for","editorInstanceKey","setEditorInstanceKey","t5","requestAnimationFrame","current","send","type","requestFocus","t6","resetEditorInstance","t7","event","handleEvent","t8","scrollIntoView","scrollToEditor","t9","currentValue","getSnapshot","handleSubmit","t10","handleDiscardConfirm","t11","t12","t13","t14","event_0","target","innerEl","handleFocus","t15","t16","t17","t18","schemaDefinition","initialValue","t19","t20","t21","t22","t23","t24","t25","t26","t27","t28","t29","t30","t31","t32","t33","UpdateReadOnlyPlugin","UpdateValuePlugin","ColorHueKey","CommentReactionOption","CommentReactionShortNames","COMMENTS_INSPECTOR_NAME","COMMENTS_HIGHLIGHT_HUE_KEY","COMMENT_REACTION_OPTIONS","shortName","title","COMMENT_REACTION_EMOJIS","Record","useContext","CommentsContext","CommentsContextValue","useComments","value","Error"],"sources":["../src/core/comments/i18n/index.ts","../src/core/comments/hooks/useCommentsScroll.ts","../src/core/comments/helpers.ts","../src/core/comments/components/pte/config.ts","../src/core/comments/components/pte/blocks/NormalBlock.tsx","../src/core/comments/components/pte/render/renderBlock.tsx","../src/core/comments/components/pte/comment-input/CommentInputDiscardDialog.tsx","../src/core/comments/components/avatars/CommentsAvatar.tsx","../src/core/comments/components/icons/MentionIcon.tsx","../src/core/comments/components/icons/SendIcon.tsx","../src/core/comments/components/mentions/MentionsMenuItem.tsx","../src/core/comments/components/mentions/MentionsMenu.tsx","../src/core/comments/components/pte/blocks/MentionInlineBlock.tsx","../src/core/comments/components/pte/render/renderChild.tsx","../src/core/comments/components/pte/comment-input/useCommentInput.ts","../src/core/comments/components/pte/comment-input/useCursorElement.ts","../src/core/comments/components/pte/comment-input/Editable.tsx","../src/core/comments/components/pte/comment-input/CommentInputInner.tsx","../src/core/comments/components/pte/comment-input/CommentInputProvider.tsx","../src/core/comments/components/pte/comment-input/CommentInput.tsx","../src/core/comments/constants.ts","../src/core/comments/hooks/useComments.ts"],"sourcesContent":["import {type LocaleResourceBundle} from '../../i18n/types'\n\n/**\n * The locale namespace for the comments plugin\n *\n * @public\n */\nexport const commentsLocaleNamespace = 'comments' as const\n\n/**\n * The default locale bundle for the comments plugin, which is US English.\n *\n * @internal\n */\nexport const commentsUsEnglishLocaleBundle: LocaleResourceBundle = {\n locale: 'en-US',\n namespace: commentsLocaleNamespace,\n resources: () => import('./resources'),\n}\n","import {useCallback, useEffect, useMemo, useState} from 'react'\nimport scrollIntoViewIfNeeded, {type StandardBehaviorOptions} from 'scroll-into-view-if-needed'\n\nconst BASE_SCROLL_OPTIONS: StandardBehaviorOptions = {\n behavior: 'smooth',\n inline: 'center',\n scrollMode: 'if-needed',\n}\n\nconst GROUP_SCROLL_OPTIONS: StandardBehaviorOptions = {\n ...BASE_SCROLL_OPTIONS,\n block: 'start',\n}\n\nconst INLINE_COMMENT_SCROLL_OPTIONS: StandardBehaviorOptions = {\n ...BASE_SCROLL_OPTIONS,\n block: 'center',\n}\n\nconst SCROLL_TO_FIELD_OPTIONS: StandardBehaviorOptions = {\n ...BASE_SCROLL_OPTIONS,\n block: 'center',\n}\n\nconst SCROLL_TO_COMMENT_OPTIONS: StandardBehaviorOptions = {\n ...BASE_SCROLL_OPTIONS,\n block: 'center',\n}\n\nconst SCROLL_OPTIONS_BY_TYPE: Record<ScrollTargetTypes, StandardBehaviorOptions> = {\n 'comment': SCROLL_TO_COMMENT_OPTIONS,\n 'field': SCROLL_TO_FIELD_OPTIONS,\n 'group': GROUP_SCROLL_OPTIONS,\n 'inline-comment': INLINE_COMMENT_SCROLL_OPTIONS,\n}\n\n/**\n * A utility function that can be used to generate a valid attribute value\n * based on the given ID.\n *\n * Generate a value that can be used as an attribute value in HTML based\n * on the given ID. This is needed because, when we use the path of a field\n * as a data attribute value, we need to escape the value so that it can be\n * queried using `querySelector`.\n *\n * Example:\n *\n * ```js\n * const validId = generateValidAttrValue('[field[_key==\"title\"]')\n *\n * return <div data-field-id={validId}>...</div>\n * ```\n */\nfunction generateValidAttrValue(id: string): string {\n const symbolsToRemove = /[[\\]_\"_=.]/g\n\n const result = id.replace(symbolsToRemove, '')\n\n return result\n}\n\nexport function applyCommentIdAttr(id: string): Record<'data-comments-comment-id', string> {\n return {\n 'data-comments-comment-id': generateValidAttrValue(id),\n }\n}\n\nexport function applyCommentsFieldAttr(id: string): Record<'data-comments-field-id', string> {\n return {\n 'data-comments-field-id': generateValidAttrValue(id),\n }\n}\n\nexport function applyCommentsGroupAttr(id: string): Record<'data-comments-group-id', string> {\n return {\n 'data-comments-group-id': generateValidAttrValue(id),\n }\n}\n\nexport function applyInlineCommentIdAttr(\n id: string,\n): Record<'data-comments-inline-comment-id', string> {\n return {\n 'data-comments-inline-comment-id': generateValidAttrValue(id),\n }\n}\n\ninterface CommentsScrollHookValue {\n /**\n * Scroll to the comment with the given ID.\n */\n scrollToComment: (commentId: string) => void\n /**\n * Scroll to the field with the given ID.\n */\n scrollToField: (fieldId: string) => void\n /**\n * Scroll to the group with the given ID.\n */\n scrollToGroup: (groupId: string) => void\n /**\n * Scroll to the inline comment with the given ID.\n */\n scrollToInlineComment: (commentId: string) => void\n}\n\ninterface CommentsScrollHookOptions {\n boundaryElement?: HTMLElement | null\n}\n\ntype ScrollTargetTypes = 'comment' | 'field' | 'group' | 'inline-comment'\ninterface ScrollTarget {\n type: ScrollTargetTypes\n id: string\n}\n\nexport function useCommentsScroll(opts?: CommentsScrollHookOptions): CommentsScrollHookValue {\n const {boundaryElement} = opts || {}\n const [scrollTarget, setScrollTarget] = useState<ScrollTarget | null>(null)\n\n const scrollOpts: StandardBehaviorOptions = useMemo(() => {\n const options = SCROLL_OPTIONS_BY_TYPE[scrollTarget?.type || 'comment']\n\n // Only apply boundary for 'comment' type scrolls (scrolling within inspector panel)\n // Field, group, and inline-comment scrolls target the document pane and shouldn't be bounded\n const shouldApplyBoundary = scrollTarget?.type === 'comment'\n\n return {\n ...options,\n boundary: shouldApplyBoundary ? boundaryElement : undefined,\n }\n }, [boundaryElement, scrollTarget?.type])\n\n const handleScrollToComment = useCallback((commentId: string) => {\n setScrollTarget({type: 'comment', id: commentId})\n }, [])\n\n const handleScrollToGroup = useCallback((threadId: string) => {\n setScrollTarget({type: 'group', id: threadId})\n }, [])\n\n const handleScrollToField = useCallback((fieldPath: string) => {\n setScrollTarget({type: 'field', id: fieldPath})\n }, [])\n\n const handleScrollToInlineComment = useCallback((commentId: string) => {\n setScrollTarget({type: 'inline-comment', id: commentId})\n }, [])\n\n useEffect(() => {\n const raf = requestAnimationFrame(() => {\n if (!scrollTarget) return\n\n const {type, id} = scrollTarget\n\n const element = document?.querySelector(\n `[data-comments-${type}-id=\"${generateValidAttrValue(id)}\"]`,\n )\n\n if (element) {\n scrollIntoViewIfNeeded(element, scrollOpts)\n }\n })\n\n return () => {\n cancelAnimationFrame(raf)\n }\n }, [scrollOpts, scrollTarget])\n\n const value = useMemo(\n (): CommentsScrollHookValue => ({\n scrollToComment: handleScrollToComment,\n scrollToField: handleScrollToField,\n scrollToGroup: handleScrollToGroup,\n scrollToInlineComment: handleScrollToInlineComment,\n }),\n [handleScrollToComment, handleScrollToField, handleScrollToGroup, handleScrollToInlineComment],\n )\n\n return value\n}\n","import {isPortableTextSpan, isPortableTextTextBlock, type Path} from '@sanity/types'\nimport * as PathUtils from '@sanity/util/paths'\nimport isEqual from 'lodash-es/isEqual.js'\nimport {useMemo, useState} from 'react'\n\nimport {type CommentContext, type CommentDocument, type CommentMessage} from './types'\n\nexport function useCommentHasChanged(message: CommentMessage): boolean {\n const [prevMessage] = useState<CommentMessage>(message)\n\n return useMemo(() => !isEqual(prevMessage, message), [prevMessage, message])\n}\n\n/**\n * @internal\n */\nexport function hasCommentMessageValue(value: CommentMessage): boolean {\n if (!value) return false\n\n return value?.some(\n (block) =>\n isPortableTextTextBlock(block) &&\n (block?.children || [])?.some((c) => (isPortableTextSpan(c) ? c.text : c.userId)),\n )\n}\n\nexport function commentIntentIfDiffers(\n parent?: CommentDocument,\n comment?: CommentDocument,\n): CommentContext['intent'] | undefined {\n const parentIntent = parent?.context?.intent\n const intent = comment?.context?.intent\n // If no intent, nothing to return\n if (!intent) return undefined\n // If no parent intent, no comparison necessary\n if (!parentIntent) return intent\n // If the preview param differs, return the intent\n if (\n 'preview' in intent.params &&\n 'preview' in parentIntent.params &&\n intent.params.preview !== parentIntent.params.preview\n ) {\n return intent\n }\n return undefined\n}\n\n/**\n * Parse a comment's persisted `fieldPath` string. Returns `undefined` for\n * empty or unparseable values: `fieldPath` is stored data, and a corrupt\n * comment must not crash rendering.\n * @internal\n */\nexport function parseCommentFieldPath(fieldPath: string | null | undefined): Path | undefined {\n if (!fieldPath) return undefined\n try {\n return PathUtils.fromString(fieldPath)\n } catch {\n return undefined\n }\n}\n\n/**\n * A function that checks whether a comment is a text selection comment\n * @internal\n */\nexport function isTextSelectionComment(comment: CommentDocument): boolean {\n if (!comment) return false\n\n return Boolean(\n comment?.target?.path?.selection?.type === 'text' && comment?.target?.path?.selection?.value,\n )\n}\n","import {Schema} from '@sanity/schema'\nimport {defineArrayMember, defineField} from '@sanity/types'\n\nconst mentionObject = defineField({\n name: 'mention',\n type: 'object',\n fields: [\n {\n name: 'userId',\n type: 'string',\n },\n ],\n})\n\nconst blockType = defineField({\n type: 'block',\n name: 'block',\n of: [mentionObject],\n marks: {\n annotations: [],\n },\n styles: [{title: 'Normal', value: 'normal'}],\n lists: [],\n})\n\nconst portableTextType = defineArrayMember({\n type: 'array',\n name: 'body',\n of: [blockType],\n})\n\nconst schema = Schema.compile({\n name: 'comments',\n types: [portableTextType],\n})\n\nexport const editorSchemaType = schema.get('body')\n","import {Text} from '@sanity/ui'\nimport {type ReactNode} from 'react'\nimport {styled} from 'styled-components'\n\nconst NormalText = styled(Text)`\n word-break: break-word;\n`\n\ninterface NormalBlockProps {\n children: ReactNode\n}\n\nexport function NormalBlock(props: NormalBlockProps): React.JSX.Element {\n const {children} = props\n\n return <NormalText size={1}>{children}</NormalText>\n}\n","import {type RenderBlockFunction} from '@portabletext/editor'\n\nimport {NormalBlock} from '../blocks/NormalBlock'\n\nexport const renderBlock: RenderBlockFunction = (blockProps) => {\n const {children} = blockProps\n\n return <NormalBlock>{children}</NormalBlock>\n}\n","import {DialogProvider, Text, ThemeColorProvider} from '@sanity/ui'\nimport {type MouseEvent, useCallback} from 'react'\n\nimport {Dialog} from '../../../../../ui-components/dialog/Dialog'\nimport {useTranslation} from '../../../../i18n/hooks/useTranslation'\nimport {commentsLocaleNamespace} from '../../../i18n'\n\nconst Z_OFFSET = 9999999 // Change to appropriate z-offset\n\n/**\n * @beta\n * @hidden\n */\nexport interface CommentInputDiscardDialogProps {\n onClose: () => void\n onConfirm: () => void\n}\n\n/**\n * @beta\n * @hidden\n */\nexport function CommentInputDiscardDialog(props: CommentInputDiscardDialogProps) {\n const {t} = useTranslation(commentsLocaleNamespace)\n const {onClose, onConfirm} = props\n\n const handleCancelClick = useCallback(\n (e: MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation()\n onClose()\n },\n [onClose],\n )\n\n const handleConfirmClick = useCallback(\n (e: MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation()\n onConfirm()\n },\n [onConfirm],\n )\n\n // The ThemeColorProvider is needed to make sure that the backdrop of the dialog not\n // inherits the tone of parent color providers.\n // The PortalProvider and DialogProvider is needed to make sure that the dialog is\n // rendered fullscreen and not scoped to the form view.\n return (\n <ThemeColorProvider tone=\"default\">\n <DialogProvider zOffset={Z_OFFSET}>\n <Dialog\n header={t('discard.header')}\n id=\"discard-comment-dialog\"\n onClose={onClose}\n width={0}\n onClickOutside={onClose}\n footer={{\n cancelButton: {\n onClick: handleCancelClick,\n },\n confirmButton: {\n onClick: handleConfirmClick,\n text: t('discard.button-confirm'),\n tone: 'critical',\n },\n }}\n >\n <Text size={1}>{t('discard.text')}</Text>\n </Dialog>\n </DialogProvider>\n </ThemeColorProvider>\n )\n}\n","import {type User} from '@sanity/types'\nimport {Avatar, type AvatarProps} from '@sanity/ui'\nimport {useMemo} from 'react'\nimport {styled} from 'styled-components'\n\nconst StyledAvatar = styled(Avatar)`\n svg > ellipse {\n stroke: transparent;\n }\n`\n\nconst SYMBOLS = /[^\\p{Alpha}\\p{White_Space}]/gu\nconst WHITESPACE = /\\p{White_Space}+/u\n\nfunction nameToInitials(fullName: string) {\n const namesArray = fullName.replace(SYMBOLS, '').split(WHITESPACE)\n\n if (namesArray.length === 1) {\n return `${namesArray[0].charAt(0)}`.toUpperCase()\n }\n\n return `${namesArray[0].charAt(0)}${namesArray[namesArray.length - 1].charAt(0)}`\n}\n\ninterface CommentsAvatarProps extends AvatarProps {\n user: User | undefined | null\n}\n\nexport function CommentsAvatar(props: CommentsAvatarProps) {\n const {user: userProp, ...restProps} = props\n const user = userProp as User\n const initials = useMemo(() => nameToInitials(user?.displayName || ''), [user?.displayName])\n\n if (!user) return <StyledAvatar {...restProps} />\n\n return (\n <StyledAvatar\n initials={initials}\n src={user?.imageUrl}\n title={user?.displayName}\n {...restProps}\n />\n )\n}\n","import {type RefAttributes, type SVGProps} from 'react'\n\nexport function MentionIcon(props: SVGProps<SVGSVGElement> & RefAttributes<SVGSVGElement>) {\n const {ref, ...rest} = props\n return (\n <svg\n data-sanity-icon=\"mention\"\n fill=\"none\"\n height=\"1em\"\n ref={ref}\n viewBox=\"0 0 25 25\"\n width=\"1em\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...rest}\n >\n <path\n d=\"M16.6633 18.9383C15.539 19.6562 14.2034 20.0723 12.7705 20.0723C8.77022 20.0723 5.52734 16.8294 5.52734 12.8291C5.52734 8.82881 8.77022 5.58594 12.7705 5.58594C16.7708 5.58594 20.0137 8.82881 20.0137 12.8291C20.0137 13.6623 19.8249 14.7093 19.6141 15.2077C19.5578 15.3408 19.479 15.4845 19.3936 15.6238C19.0955 16.1106 18.5507 16.3721 17.9807 16.4018V16.4018C16.8271 16.462 15.8588 15.5428 15.8588 14.3877V9.27302\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n strokeLinejoin=\"round\"\n />\n <circle cx=\"12.5732\" cy=\"12.8291\" r=\"3.08691\" stroke=\"currentColor\" strokeWidth={1.2} />\n </svg>\n )\n}\n","import {type RefAttributes, type SVGProps} from 'react'\n\nexport function SendIcon(props: SVGProps<SVGSVGElement> & RefAttributes<SVGSVGElement>) {\n const {ref, ...rest} = props\n return (\n <svg\n data-sanity-icon=\"send\"\n fill=\"none\"\n height=\"1em\"\n ref={ref}\n viewBox=\"0 0 25 25\"\n width=\"1em\"\n xmlns=\"http://www.w3.org/2000/svg\"\n {...rest}\n >\n <path\n clipRule=\"evenodd\"\n d=\"M21.1602 12.5L7.16016 19.5V14.8765L13.6656 12.4989L7.16016 9.97149L7.16016 5.5L21.1602 12.5Z\"\n stroke=\"currentColor\"\n strokeWidth={1.2}\n strokeLinejoin=\"round\"\n />\n </svg>\n )\n}\n","import {Badge, Box, Card, Flex, Text, TextSkeleton} from '@sanity/ui'\nimport {type CSSProperties, useCallback} from 'react'\nimport {styled} from 'styled-components'\n\nimport {type UserWithPermission} from '../../../hooks/useUserListWithPermissions'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {useUser} from '../../../store/user/hooks'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {CommentsAvatar} from '../avatars/CommentsAvatar'\n\nconst InnerFlex = styled(Flex)``\n\nconst SKELETON_INLINE_STYLE: CSSProperties = {width: '50%'}\n\ninterface MentionsItemProps {\n user: UserWithPermission\n onSelect: (userId: string) => void\n}\n\nexport function MentionsMenuItem(props: MentionsItemProps) {\n const {user, onSelect} = props\n const [loadedUser] = useUser(user.id)\n const {t} = useTranslation(commentsLocaleNamespace)\n\n const avatar = <CommentsAvatar user={loadedUser} status={user.granted ? undefined : 'inactive'} />\n\n const text = loadedUser ? (\n <Text size={1} textOverflow=\"ellipsis\" title={loadedUser.displayName}>\n {loadedUser.displayName}\n </Text>\n ) : (\n <TextSkeleton size={1} style={SKELETON_INLINE_STYLE} />\n )\n\n const handleSelect = useCallback(() => {\n onSelect(user.id)\n }, [onSelect, user.id])\n\n return (\n <Card as=\"button\" disabled={!user.granted} onClick={handleSelect} padding={2} radius={2}>\n <Flex align=\"center\" gap={3}>\n <InnerFlex align=\"center\" gap={2} flex={1}>\n {avatar}\n <Box>{text}</Box>\n </InnerFlex>\n\n {!user.granted && <Badge fontSize={1}>{t('mentions.unauthorized-user')}</Badge>}\n </Flex>\n </Card>\n )\n}\n","import {Box, Flex, Stack, Text} from '@sanity/ui'\nimport deburr from 'lodash-es/deburr.js'\nimport {\n type Ref,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type RefAttributes,\n} from 'react'\nimport {styled} from 'styled-components'\n\nimport {CommandList} from '../../../components/commandList/CommandList'\nimport {type CommandListHandle} from '../../../components/commandList/types'\nimport {LoadingBlock} from '../../../components/loadingBlock/LoadingBlock'\nimport {type UserWithPermission} from '../../../hooks/useUserListWithPermissions'\nimport {useTranslation} from '../../../i18n/hooks/useTranslation'\nimport {commentsLocaleNamespace} from '../../i18n'\nimport {MentionsMenuItem} from './MentionsMenuItem'\n\nconst EMPTY_ARRAY: UserWithPermission[] = []\n\nconst Root = styled(Stack)({\n maxWidth: '220px', // todo: improve\n})\n\nconst ITEM_HEIGHT = 41\nconst LIST_PADDING = 4\nconst MAX_ITEMS = 7\n\nconst FlexWrap = styled(Flex)({\n maxHeight: ITEM_HEIGHT * MAX_ITEMS + LIST_PADDING * 2 + ITEM_HEIGHT / 2,\n})\n\nexport interface MentionsMenuHandle {\n setSearchTerm: (term: string) => void\n}\ninterface MentionsMenuProps {\n loading: boolean\n inputElement?: HTMLDivElement | null\n onSelect: (userId: string) => void\n options: UserWithPermission[] | null\n}\n\nexport function MentionsMenu(props: MentionsMenuProps & RefAttributes<MentionsMenuHandle>) {\n const {t} = useTranslation(commentsLocaleNamespace)\n const {ref, loading, onSelect, options = [], inputElement} = props\n const [searchTerm, setSearchTerm] = useState<string>('')\n const commandListRef = useRef<CommandListHandle>(null)\n\n useImperativeHandle(ref, () => {\n return {\n setSearchTerm(term: string) {\n setSearchTerm(term)\n },\n }\n }, [])\n\n const renderItem = useCallback(\n (itemProps: UserWithPermission) => {\n return <MentionsMenuItem user={itemProps} onSelect={onSelect} />\n },\n [onSelect],\n )\n\n const getItemDisabled = useCallback(\n (index: number) => {\n return !options?.[index]?.granted\n },\n [options],\n )\n\n const filteredOptions = useMemo(() => {\n if (!searchTerm) return options || EMPTY_ARRAY\n\n // We deburr the search term and the display names so that when searching\n // for e.g \"bjorge\" we also get results for \"bjørge\"\n const deburredSearchTerm = deburr(searchTerm).toLocaleLowerCase()\n\n const deburredOptions = options?.map((option) => ({\n ...option,\n displayName: deburr(option.displayName || '').toLocaleLowerCase(),\n }))\n\n const filtered = deburredOptions\n ?.filter((option) => {\n return option?.displayName?.includes(deburredSearchTerm)\n })\n // Sort by whether the displayName starts with the search term to get more relevant results first\n ?.sort((a, b) => {\n const matchA = a.displayName?.startsWith(deburredSearchTerm)\n const matchB = b.displayName?.startsWith(deburredSearchTerm)\n\n if (matchA && !matchB) return -1\n if (!matchA && matchB) return 1\n\n return 0\n })\n\n return filtered || EMPTY_ARRAY\n }, [options, searchTerm])\n\n if (loading) {\n return (\n <Root>\n <LoadingBlock showText />\n </Root>\n )\n }\n\n // In this case the input element is the actual content editable HTMLDivElement from the PTE.\n // Typecast it to an input element to make the CommandList component happy.\n const _inputElement = inputElement ? (inputElement as HTMLInputElement) : undefined\n\n return (\n <Flex direction=\"column\" height=\"fill\" data-testid=\"comments-mentions-menu\">\n {filteredOptions.length === 0 && (\n <Box padding={5}>\n <Text align=\"center\" size={1} muted>\n {t('mentions.no-users-found')}\n </Text>\n </Box>\n )}\n\n {filteredOptions.length > 0 && (\n <FlexWrap direction=\"column\" flex={1} overflow=\"hidden\">\n <CommandList\n activeItemDataAttr=\"data-hovered\"\n ariaLabel={t('mentions.user-list-aria-label')}\n fixedHeight\n getItemDisabled={getItemDisabled}\n inputElement={_inputElement}\n itemHeight={41}\n items={filteredOptions}\n padding={1}\n ref={commandListRef}\n renderItem={renderItem}\n />\n </FlexWrap>\n )}\n </Flex>\n )\n}\n","import {Flex, Text, TextSkeleton} from '@sanity/ui'\nimport {css, styled} from 'styled-components'\n\nimport {Tooltip} from '../../../../../ui-components/tooltip/Tooltip'\nimport {useCurrentUser, useUser} from '../../../../store/user/hooks'\nimport {CommentsAvatar} from '../../avatars/CommentsAvatar'\n\nconst Span = styled.span(({theme}) => {\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const {regular} = theme.sanity.fonts?.text.weights || {}\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const {hovered} = theme.sanity.color?.card || {}\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const {bg} = theme.sanity.color.selectable?.caution.pressed || {}\n\n return css`\n font-weight: ${regular};\n color: var(--card-link-fg-color);\n border-radius: 2px;\n background-color: ${hovered.bg};\n padding: 1px;\n box-sizing: border-box;\n\n &[data-active='true'] {\n background-color: ${bg};\n }\n `\n})\n\ninterface MentionInlineBlockProps {\n userId: string\n selected: boolean\n}\n\nexport function MentionInlineBlock(props: MentionInlineBlockProps) {\n const {selected, userId} = props\n const [user, loading] = useUser(userId)\n const currentUser = useCurrentUser()\n\n if (!user || loading)\n return (\n <TextSkeleton\n data-testid=\"comment-mentions-loading-skeleton\"\n style={{width: '10ch'}}\n size={0}\n muted\n radius={1}\n animated\n />\n )\n\n return (\n <Tooltip\n portal\n content={\n <Flex align=\"center\" gap={2}>\n <Flex>\n <CommentsAvatar user={user} />\n </Flex>\n\n <Text size={1}>{user.displayName}</Text>\n </Flex>\n }\n >\n <Span data-selected={selected} data-active={currentUser?.id === userId}>\n @{user.displayName}\n </Span>\n </Tooltip>\n )\n}\n","import {type BlockChildRenderProps, type RenderChildFunction} from '@portabletext/editor'\n\nimport {MentionInlineBlock} from '../blocks/MentionInlineBlock'\n\nexport const renderChild: RenderChildFunction = (childProps: BlockChildRenderProps) => {\n const {children, value, selected} = childProps\n\n const isMention = value._type === 'mention' && value.userId\n\n if (isMention) {\n return <MentionInlineBlock selected={selected} userId={value?.userId as string} />\n }\n\n return children\n}\n","import {useContext} from 'react'\nimport {CommentInputContext} from 'sanity/_singletons'\n\nimport {type CommentInputContextValue} from './CommentInputProvider'\n\nexport function useCommentInput(): CommentInputContextValue {\n const ctx = useContext(CommentInputContext)\n\n if (!ctx) {\n throw new Error('useCommentInputContext must be used within a CommentInputProvider')\n }\n\n return ctx\n}\n","import {useCallback, useEffect, useMemo, useState} from 'react'\n\nconst EVENT_LISTENER_OPTIONS: AddEventListenerOptions = {passive: true}\n\ninterface CursorElementHookOptions {\n disabled: boolean\n rootElement: HTMLElement | null\n}\n\nexport function useCursorElement(opts: CursorElementHookOptions): HTMLElement | null {\n const {disabled, rootElement} = opts\n const [cursorRect, setCursorRect] = useState<DOMRect | null>(null)\n\n const cursorElement = useMemo(() => {\n if (!cursorRect) {\n return null\n }\n return {\n getBoundingClientRect: () => {\n return cursorRect\n },\n } as HTMLElement\n }, [cursorRect])\n\n const handleSelectionChange = useCallback(() => {\n if (disabled) {\n setCursorRect(null)\n return\n }\n\n const sel = window.getSelection()\n\n if (!sel || !sel.isCollapsed || sel.rangeCount === 0) return\n\n const range = sel.getRangeAt(0)\n const isWithinRoot = rootElement?.contains(range.commonAncestorContainer)\n\n if (!isWithinRoot) {\n setCursorRect(null)\n return\n }\n const rect = range?.getBoundingClientRect()\n if (rect) {\n setCursorRect(rect)\n }\n }, [disabled, rootElement])\n\n useEffect(() => {\n document.addEventListener('selectionchange', handleSelectionChange, EVENT_LISTENER_OPTIONS)\n\n return () => {\n document.removeEventListener('selectionchange', handleSelectionChange)\n }\n }, [handleSelectionChange])\n\n return cursorElement\n}\n","import {\n type EditorSelection,\n PortableTextEditable,\n type RenderBlockFunction,\n usePortableTextEditorSelection,\n} from '@portabletext/editor'\nimport {isPortableTextSpan, isPortableTextTextBlock} from '@sanity/types'\nimport {useClickOutsideEvent} from '@sanity/ui'\nimport {getTheme_v2} from '@sanity/ui/theme'\nimport isEqual from 'lodash-es/isEqual.js'\nimport {type KeyboardEvent, useCallback, useEffect, useMemo, useRef, useState} from 'react'\nimport {css, styled} from 'styled-components'\n\nimport {Popover, type PopoverProps} from '../../../../../ui-components/popover/Popover'\nimport {useTranslation} from '../../../../i18n/hooks/useTranslation'\nimport {commentsLocaleNamespace} from '../../../i18n'\nimport {MentionsMenu, type MentionsMenuHandle} from '../../mentions/MentionsMenu'\nimport {renderChild} from '../render/renderChild'\nimport {useCommentInput} from './useCommentInput'\nimport {useCursorElement} from './useCursorElement'\n\nconst POPOVER_FALLBACK_PLACEMENTS: PopoverProps['fallbackPlacements'] = ['bottom', 'top']\nconst INLINE_STYLE: React.CSSProperties = {outline: 'none'}\nconst EMPTY_ARRAY: [] = []\n\nconst PlaceholderWrapper = styled.span((props) => {\n const {color} = getTheme_v2(props.theme)\n return css`\n color: ${color.input.default.enabled.placeholder};\n overflow: hidden;\n text-overflow: ellipsis;\n text-wrap: nowrap;\n display: block;\n `\n})\n\nconst StyledPopover = styled(Popover)(({theme}) => {\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const {space, radius} = theme.sanity\n\n return css`\n &[data-placement='bottom'] {\n transform: translateY(${space[1]}px);\n }\n\n &[data-placement='top'] {\n transform: translateY(-${space[1]}px);\n }\n\n [data-ui='Popover__wrapper'] {\n border-radius: ${radius[3]}px;\n display: flex;\n flex-direction: column;\n overflow: clip;\n overflow: hidden;\n position: relative;\n width: 300px; // todo: improve\n }\n `\n})\n\ninterface EditableProps {\n focusLock?: boolean\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n onBlur?: (e: React.FormEvent<HTMLDivElement>) => void\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n onFocus?: (e: React.FormEvent<HTMLDivElement>) => void\n onKeyDown?: (e: React.KeyboardEvent) => void\n onSubmit?: () => void\n placeholder?: React.ReactNode\n renderBlock: RenderBlockFunction\n}\n\ninterface EditableHandle {\n setShowMentionOptions: (show: boolean) => void\n}\n\nexport function Editable(props: EditableProps) {\n const {t} = useTranslation(commentsLocaleNamespace)\n const {\n focusLock,\n onFocus,\n onBlur,\n onKeyDown,\n onSubmit,\n placeholder = t('compose.create-comment-placeholder'),\n renderBlock,\n } = props\n const popoverRef = useRef<HTMLDivElement | null>(null)\n const [rootElement, setRootElement] = useState<HTMLDivElement | null>(null)\n const [inputElement, setInputElement] = useState<HTMLDivElement | null>(null)\n const mentionsMenuRef = useRef<MentionsMenuHandle | null>(null)\n\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const selection = usePortableTextEditorSelection()\n\n const {\n canSubmit,\n closeMentions,\n insertMention,\n mentionOptions,\n mentionsMenuOpen,\n mentionsSearchTerm,\n onBeforeInput,\n value,\n } = useCommentInput()\n\n const cursorElement = useCursorElement({\n disabled: !mentionsMenuOpen,\n rootElement: rootElement,\n })\n\n const renderPlaceholder = useCallback(\n () => <PlaceholderWrapper>{placeholder}</PlaceholderWrapper>,\n [placeholder],\n )\n\n useClickOutsideEvent(mentionsMenuOpen && closeMentions, () => [popoverRef.current])\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent) => {\n switch (event.key) {\n case 'Enter':\n // Shift enter is used to insert a new line,\n // keep the default behavior\n if (event.shiftKey) {\n break\n }\n\n // If the mention menu is open close it, but don't submit.\n if (mentionsMenuOpen) {\n // Enter is being used both to select something from the mentionsMenu, prevent the default behavior.\n event.preventDefault()\n event.stopPropagation()\n closeMentions()\n break\n }\n\n // Submit the comment if eligible for submission\n if (onSubmit && canSubmit) {\n // Enter is being used to submit the comment, prevent the default behavior.\n event.preventDefault()\n event.stopPropagation()\n onSubmit()\n }\n break\n\n case 'Escape':\n case 'ArrowLeft':\n case 'ArrowRight':\n if (mentionsMenuOpen) {\n // stop these events if the menu is open\n event.preventDefault()\n event.stopPropagation()\n closeMentions()\n }\n break\n default:\n }\n // Call parent key handler\n if (onKeyDown) onKeyDown(event)\n },\n [canSubmit, closeMentions, mentionsMenuOpen, onKeyDown, onSubmit],\n )\n\n const initialSelectionAtEndOfContent: EditorSelection | undefined = useMemo(() => {\n if (selection) {\n return undefined\n }\n const lastBlock = (value || EMPTY_ARRAY).slice(-1)[0]\n const lastChild = isPortableTextTextBlock(lastBlock)\n ? lastBlock.children.slice(-1)[0]\n : undefined\n if (!lastChild) {\n return undefined\n }\n const point = {\n path: [{_key: lastBlock._key}, 'children', {_key: lastChild._key}],\n offset: isPortableTextSpan(lastChild) ? lastChild.text.length : 0,\n }\n return {\n focus: point,\n anchor: point,\n }\n }, [value, selection])\n\n // Update the mentions search term in the mentions menu\n useEffect(() => {\n mentionsMenuRef.current?.setSearchTerm(mentionsSearchTerm)\n }, [mentionsSearchTerm])\n\n // Close mentions if the user selects text\n useEffect(() => {\n if (mentionsMenuOpen && selection && !isEqual(selection.anchor, selection.focus)) {\n closeMentions()\n }\n }, [mentionsMenuOpen, closeMentions, selection])\n\n const popoverContent = (\n <MentionsMenu\n inputElement={inputElement}\n loading={mentionOptions.loading}\n onSelect={insertMention}\n options={mentionOptions.data || EMPTY_ARRAY}\n ref={mentionsMenuRef}\n />\n )\n\n return (\n <div ref={setRootElement}>\n <StyledPopover\n arrow={false}\n constrainSize\n content={popoverContent}\n disabled={!mentionsMenuOpen}\n fallbackPlacements={POPOVER_FALLBACK_PLACEMENTS}\n open={mentionsMenuOpen}\n placement=\"bottom\"\n ref={popoverRef}\n referenceElement={cursorElement}\n />\n <PortableTextEditable\n data-testid=\"comment-input-editable\"\n data-ui=\"EditableElement\"\n onBeforeInput={onBeforeInput}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={handleKeyDown}\n ref={setInputElement}\n renderBlock={renderBlock}\n renderChild={renderChild}\n renderPlaceholder={renderPlaceholder}\n selection={initialSelectionAtEndOfContent}\n style={INLINE_STYLE}\n tabIndex={focusLock ? 0 : undefined}\n />\n </div>\n )\n}\nEditable.displayName = 'Editable'\n","import {type RenderBlockFunction} from '@portabletext/editor'\nimport {type CurrentUser} from '@sanity/types'\nimport {type AvatarSize, Box, Card, Flex, MenuDivider, Stack} from '@sanity/ui'\nimport {getTheme_v2} from '@sanity/ui/theme'\nimport {useCallback} from 'react'\nimport {css, styled} from 'styled-components'\n\nimport {Button} from '../../../../../ui-components/button/Button'\nimport {TooltipDelayGroupProvider} from '../../../../../ui-components/tooltipDelayGroupProvider/TooltipDelayGroupProvider'\nimport {useTranslation} from '../../../../i18n/hooks/useTranslation'\nimport {useUser} from '../../../../store/user/hooks'\nimport {commentsLocaleNamespace} from '../../../i18n'\nimport {CommentsAvatar} from '../../avatars/CommentsAvatar'\nimport {MentionIcon} from '../../icons/MentionIcon'\nimport {SendIcon} from '../../icons/SendIcon'\nimport {Editable} from './Editable'\nimport {useCommentInput} from './useCommentInput'\n\nconst EditableWrap = styled(Box)`\n max-height: 20vh;\n overflow-y: auto;\n`\n\nconst ButtonDivider = styled(MenuDivider)({\n height: 20,\n width: 1,\n})\n\nfunction focusRingBorderStyle(border: {color: string; width: number}): string {\n return `inset 0 0 0 ${border.width}px ${border.color}`\n}\n\nconst RootCard = styled(Card)(({theme}) => {\n const {color, input, radius} = getTheme_v2(theme)\n const radii = radius[2]\n\n return css`\n border-radius: ${radii}px;\n box-shadow: var(--input-box-shadow);\n\n --input-box-shadow: ${focusRingBorderStyle({\n color: color.input.default.enabled.border,\n width: input.border.width,\n })};\n\n &:not([data-expand-on-focus='false'], :focus-within) {\n background: transparent;\n box-shadow: unset;\n }\n\n &[data-focused='true']:focus-within {\n ${EditableWrap} {\n min-height: 1em;\n }\n\n /* box-shadow: inset 0 0 0 1px var(--card-focus-ring-color); */\n --input-box-shadow: ${focusRingBorderStyle({\n color: 'var(--card-focus-ring-color)',\n width: input.border.width,\n })};\n }\n\n &:focus-within {\n ${EditableWrap} {\n min-height: 1em;\n }\n }\n\n &[data-expand-on-focus='false'] {\n ${EditableWrap} {\n min-height: 1em;\n }\n }\n\n &[data-expand-on-focus='true'] {\n [data-ui='CommentInputActions']:not([hidden]) {\n display: none;\n }\n\n &:focus-within {\n [data-ui='CommentInputActions'] {\n display: flex;\n }\n }\n }\n &:hover {\n --input-box-shadow: ${focusRingBorderStyle({\n color: color.input.default.hovered.border,\n width: input.border.width,\n })};\n }\n `\n})\n\nconst AvatarContainer = styled.div((props) => {\n const theme = getTheme_v2(props.theme)\n return `\n min-height: ${theme.avatar.sizes[1]?.size}px;\n display: flex;\n align-items: center;\n `\n})\n\ninterface CommentInputInnerProps {\n avatarSize?: AvatarSize\n currentUser: CurrentUser\n focusLock?: boolean\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n onBlur?: (e: React.FormEvent<HTMLDivElement>) => void\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n onFocus?: (e: React.FormEvent<HTMLDivElement>) => void\n onKeyDown?: (e: React.KeyboardEvent) => void\n onSubmit?: () => void\n placeholder?: React.ReactNode\n renderBlock: RenderBlockFunction\n withAvatar?: boolean\n}\n\nexport function CommentInputInner(props: CommentInputInnerProps) {\n const {\n avatarSize = 1,\n currentUser,\n focusLock,\n onBlur,\n onFocus,\n onKeyDown,\n onSubmit,\n placeholder,\n renderBlock,\n withAvatar,\n } = props\n\n const [user] = useUser(currentUser.id)\n const {\n canSubmit,\n expandOnFocus,\n focused,\n hasChanges,\n insertAtChar,\n openMentions,\n readOnly,\n mentionOptions,\n } = useCommentInput()\n\n const {t} = useTranslation(commentsLocaleNamespace)\n const avatar = withAvatar ? (\n <AvatarContainer>\n <CommentsAvatar user={user} size={avatarSize} />\n </AvatarContainer>\n ) : null\n\n const handleMentionButtonClicked = useCallback(\n (e: React.MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation()\n insertAtChar()\n openMentions()\n },\n [insertAtChar, openMentions],\n )\n\n return (\n <Flex align=\"flex-start\" gap={2}>\n {avatar}\n\n <RootCard\n id=\"comment-input-root\"\n data-expand-on-focus={expandOnFocus && !canSubmit ? 'true' : 'false'}\n data-focused={focused ? 'true' : 'false'}\n flex={1}\n sizing=\"border\"\n tone={readOnly ? 'transparent' : 'default'}\n >\n <Stack>\n <EditableWrap\n data-ui=\"CommentInputEditableWrap\"\n paddingX={1}\n paddingY={2}\n sizing=\"border\"\n >\n <Editable\n focusLock={focusLock}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n onSubmit={onSubmit}\n placeholder={placeholder}\n renderBlock={renderBlock}\n />\n </EditableWrap>\n\n <Flex align=\"center\" data-ui=\"CommentInputActions\" gap={1} justify=\"flex-end\" padding={1}>\n <TooltipDelayGroupProvider>\n {!mentionOptions.disabled && (\n <Button\n aria-label={t('compose.mention-user-aria-label')}\n data-testid=\"comment-input-mention-button\"\n disabled={readOnly}\n icon={MentionIcon}\n mode=\"bleed\"\n type=\"button\"\n onClick={handleMentionButtonClicked}\n tooltipProps={{content: t('compose.mention-user-tooltip')}}\n />\n )}\n {onSubmit && (\n <>\n {!mentionOptions.disabled && <ButtonDivider />}\n\n <Button\n aria-label={t('compose.send-comment-aria-label')}\n data-testid=\"comment-input-send-button\"\n disabled={!canSubmit || !hasChanges || readOnly}\n icon={SendIcon}\n mode={hasChanges && canSubmit ? 'default' : 'bleed'}\n onClick={onSubmit}\n tone={hasChanges && canSubmit ? 'primary' : 'default'}\n tooltipProps={{content: t('compose.send-comment-tooltip')}}\n />\n </>\n )}\n </TooltipDelayGroupProvider>\n </Flex>\n </Stack>\n </RootCard>\n </Flex>\n )\n}\n","import {type EditorSelection, PortableTextEditor, usePortableTextEditor} from '@portabletext/editor'\nimport {isPortableTextSpan, type Path} from '@sanity/types'\nimport {type ReactNode, useCallback, useMemo, useState} from 'react'\nimport {CommentInputContext} from 'sanity/_singletons'\n\nimport {useDidUpdate} from '../../../../form/hooks/useDidUpdate'\nimport {type UserListWithPermissionsHookValue} from '../../../../hooks/useUserListWithPermissions'\nimport {hasCommentMessageValue, useCommentHasChanged} from '../../../helpers'\nimport {type CommentMessage} from '../../../types'\n\nexport interface CommentInputContextValue {\n canSubmit?: boolean\n closeMentions: () => void\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n editor: PortableTextEditor\n expandOnFocus?: boolean\n focused: boolean\n focusEditor: () => void\n focusOnMount?: boolean\n hasChanges: boolean\n insertAtChar: () => void\n insertMention: (userId: string) => void\n mentionOptions: UserListWithPermissionsHookValue\n mentionsMenuOpen: boolean\n mentionsSearchTerm: string\n onBeforeInput: (event: InputEvent) => void\n openMentions: () => void\n readOnly: boolean\n value: CommentMessage\n}\n\ninterface CommentInputProviderProps {\n children: ReactNode\n expandOnFocus?: boolean\n focused: boolean\n focusOnMount?: boolean\n mentionOptions: UserListWithPermissionsHookValue\n onMentionMenuOpenChange?: (open: boolean) => void\n readOnly?: boolean\n value: CommentMessage\n}\n\nexport function CommentInputProvider(props: CommentInputProviderProps) {\n const {\n children,\n expandOnFocus = false,\n focused,\n focusOnMount = false,\n mentionOptions,\n onMentionMenuOpenChange,\n value,\n readOnly,\n } = props\n\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const editor = usePortableTextEditor()\n\n const [mentionsMenuOpen, setMentionsMenuOpen] = useState<boolean>(false)\n const [mentionsSearchTerm, setMentionsSearchTerm] = useState<string>('')\n const [selectionAtMentionInsert, setSelectionAtMentionInsert] = useState<EditorSelection>(null)\n\n const canSubmit = useMemo(() => hasCommentMessageValue(value), [value])\n\n const hasChanges = useCommentHasChanged(value)\n\n const focusEditor = useCallback(() => {\n if (readOnly) return\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n PortableTextEditor.focus(editor)\n }, [editor, readOnly])\n\n const closeMentions = useCallback(() => {\n setMentionsMenuOpen(false)\n setMentionsSearchTerm('')\n setSelectionAtMentionInsert(null)\n }, [])\n\n const openMentions = useCallback(() => {\n if (mentionOptions?.disabled) {\n return\n }\n setMentionsMenuOpen(true)\n setMentionsSearchTerm('')\n setMentionsMenuOpen(true)\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n setSelectionAtMentionInsert(PortableTextEditor.getSelection(editor))\n }, [editor, mentionOptions?.disabled])\n\n // This function activates or deactivates the mentions menu and updates\n // the mention search term when the user types into the Portable Text Editor.\n const onBeforeInput = useCallback(\n (event: InputEvent): void => {\n if (mentionOptions?.disabled) {\n return\n }\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const selection = PortableTextEditor.getSelection(editor)\n const cursorOffset = selection ? selection.focus.offset : 0\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const focusChild = PortableTextEditor.focusChild(editor)\n const focusSpan = (isPortableTextSpan(focusChild) && focusChild) || undefined\n\n const isInsertText = event.inputType === 'insertText'\n const isDeleteText = event.inputType === 'deleteContentBackward'\n const isInsertingAtChar = isInsertText && event.data === '@'\n\n const lastIndexOfAt =\n focusSpan?.text.slice(0, Math.max(0, cursorOffset)).lastIndexOf('@') || 0\n\n const isWhitespaceCharBeforeCursorPosition =\n focusSpan?.text.slice(cursorOffset - 1, cursorOffset) === ' '\n\n const filterStartsWithSpaceChar = isInsertText && event.data === ' ' && !mentionsSearchTerm\n\n // If we are inserting a '@' character - open the mentions menu and reset the search term.\n // Only do this if it is in the start of the text, or if '@' is inserted when following a whitespace char.\n if (isInsertingAtChar && (cursorOffset < 1 || isWhitespaceCharBeforeCursorPosition)) {\n openMentions()\n return\n }\n\n // If the user begins typing their filter with a space, or if they are deleting\n // characters after activation and the '@' is no longer there,\n // clear the search term and close the mentions menu.\n if (\n filterStartsWithSpaceChar ||\n (isDeleteText &&\n (focusSpan?.text.length === 1 || lastIndexOfAt === (focusSpan?.text.length || 0) - 1))\n ) {\n closeMentions()\n return\n }\n\n // Update the search term\n if (isPortableTextSpan(focusChild)) {\n // Term starts with the @ char in the value until the cursor offset\n let term = focusChild.text.slice(lastIndexOfAt + 1, cursorOffset)\n // Add the char to the mentions search term\n if (isInsertText) {\n term += event.data\n }\n // Exclude the char from the mentions search term\n if (isDeleteText) {\n term = term.slice(0, Math.max(0, term.length - 1))\n }\n // Set the updated mentions search term\n setMentionsSearchTerm(term)\n }\n },\n [closeMentions, editor, mentionsSearchTerm, openMentions, mentionOptions?.disabled],\n )\n\n const insertAtChar = useCallback(() => {\n setMentionsMenuOpen(true)\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n PortableTextEditor.focus(editor)\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n PortableTextEditor.insertChild(editor, editor.schemaTypes.span, {text: '@'})\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n setSelectionAtMentionInsert(PortableTextEditor.getSelection(editor))\n }, [editor])\n\n useDidUpdate(mentionsMenuOpen, () => onMentionMenuOpenChange?.(mentionsMenuOpen))\n\n const insertMention = useCallback(\n (userId: string) => {\n const mentionSchemaType = editor.schemaTypes.inlineObjects.find((t) => t.name === 'mention')\n let mentionPath: Path | undefined\n\n const [span, spanPath] =\n (selectionAtMentionInsert &&\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n PortableTextEditor.findByPath(editor, selectionAtMentionInsert.focus.path)) ||\n []\n if (span && isPortableTextSpan(span) && spanPath && mentionSchemaType) {\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n PortableTextEditor.focus(editor)\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n const offset = PortableTextEditor.getSelection(editor)?.focus.offset\n if (typeof offset !== 'undefined') {\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n PortableTextEditor.delete(\n editor,\n {\n anchor: {path: spanPath, offset: span.text.lastIndexOf('@')},\n focus: {path: spanPath, offset},\n },\n {mode: 'selected'},\n )\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n PortableTextEditor.insertChild(editor, mentionSchemaType, {\n userId: userId,\n })\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n PortableTextEditor.insertChild(editor, editor.schemaTypes.span, {text: ' '})\n }\n }\n },\n [editor, selectionAtMentionInsert],\n )\n\n const ctxValue = useMemo(\n (): CommentInputContextValue => ({\n canSubmit,\n closeMentions,\n editor,\n expandOnFocus,\n focused,\n focusEditor,\n focusOnMount,\n hasChanges,\n insertAtChar,\n insertMention,\n mentionOptions,\n mentionsMenuOpen,\n mentionsSearchTerm,\n onBeforeInput,\n openMentions,\n readOnly: Boolean(readOnly),\n value,\n }),\n [\n canSubmit,\n closeMentions,\n editor,\n expandOnFocus,\n focused,\n focusEditor,\n focusOnMount,\n hasChanges,\n insertAtChar,\n insertMention,\n mentionOptions,\n mentionsMenuOpen,\n mentionsSearchTerm,\n onBeforeInput,\n openMentions,\n readOnly,\n value,\n ],\n )\n\n return <CommentInputContext.Provider value={ctxValue}>{children}</CommentInputContext.Provider>\n}\n","import {\n type Editor,\n type EditorEmittedEvent,\n EditorProvider,\n keyGenerator,\n type RenderBlockFunction,\n useEditor,\n} from '@portabletext/editor'\nimport {EventListenerPlugin} from '@portabletext/editor/plugins'\nimport {getValue} from '@portabletext/editor/selectors'\nimport {OneLinePlugin} from '@portabletext/plugin-one-line'\nimport {sanitySchemaToPortableTextSchema} from '@portabletext/sanity-bridge'\nimport {type CurrentUser, type PortableTextBlock} from '@sanity/types'\nimport {type AvatarSize, focusFirstDescendant, focusLastDescendant, Stack} from '@sanity/ui'\nimport {\n type FocusEvent,\n type FormEvent,\n type KeyboardEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type RefAttributes,\n} from 'react'\n\nimport {type UserListWithPermissionsHookValue} from '../../../../hooks/useUserListWithPermissions'\nimport {editorSchemaType} from '../config'\nimport {renderBlock as defaultRenderBlock} from '../render/renderBlock'\nimport {CommentInputDiscardDialog} from './CommentInputDiscardDialog'\nimport {CommentInputInner} from './CommentInputInner'\nimport {CommentInputProvider} from './CommentInputProvider'\n\n/**\n * `EditorProvider` doesn't have a `ref` prop. This plugin takes care of\n * imperatively forwarding the editor instance.\n */\nfunction EditorRefPlugin(props: RefAttributes<Editor | null>) {\n const {ref} = props\n const editor = useEditor()\n\n useImperativeHandle(ref, () => editor, [editor])\n\n return null\n}\nEditorRefPlugin.displayName = 'EditorRefPlugin'\n\nconst EMPTY_ARRAY: [] = []\n\nconst SCROLL_INTO_VIEW_OPTIONS: ScrollIntoViewOptions = {\n behavior: 'smooth',\n block: 'center',\n inline: 'center',\n}\n\n/**\n * @internal\n */\nexport interface CommentInputProps {\n currentUser: CurrentUser\n expandOnFocus?: boolean\n focusLock?: boolean\n focusOnMount?: boolean\n mentionOptions: UserListWithPermissionsHookValue\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n onBlur?: (e: FormEvent<HTMLDivElement>) => void\n onChange: (value: PortableTextBlock[]) => void\n onDiscardCancel?: () => void\n onDiscardConfirm: () => void\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n onFocus?: (e: FormEvent<HTMLDivElement>) => void\n onKeyDown?: (e: KeyboardEvent) => void\n onMentionMenuOpenChange?: (open: boolean) => void\n onSubmit?: (value: PortableTextBlock[]) => void\n placeholder?: ReactNode\n readOnly?: boolean\n renderBlock?: RenderBlockFunction\n value: PortableTextBlock[] | null\n withAvatar?: boolean\n avatarSize?: AvatarSize\n}\n\ninterface CommentDiscardDialogController {\n open: () => void\n close: () => void\n}\n\n/**\n * @internal\n */\nexport interface CommentInputHandle {\n blur: () => void\n discardDialogController: CommentDiscardDialogController\n focus: () => void\n scrollTo: () => void\n reset: () => void\n}\n\n/**\n * @internal\n * @hidden\n */\nexport function CommentInput(props: CommentInputProps & RefAttributes<CommentInputHandle>) {\n const {\n ref,\n avatarSize,\n currentUser,\n expandOnFocus,\n focusLock = false,\n focusOnMount,\n mentionOptions,\n onBlur,\n onChange,\n onDiscardCancel,\n onDiscardConfirm,\n onFocus,\n onKeyDown,\n onMentionMenuOpenChange,\n onSubmit,\n placeholder,\n readOnly,\n renderBlock = defaultRenderBlock,\n value = EMPTY_ARRAY,\n withAvatar = true,\n } = props\n const [focused, setFocused] = useState<boolean>(false)\n const editorRef = useRef<Editor | null>(null)\n const editorContainerRef = useRef<HTMLDivElement | null>(null)\n const resetInstanceRef = useRef(false)\n const [showDiscardDialog, setShowDiscardDialog] = useState<boolean>(false)\n\n const preDivRef = useRef<HTMLDivElement | null>(null)\n const postDivRef = useRef<HTMLDivElement | null>(null)\n const innerRef = useRef<HTMLDivElement | null>(null)\n\n // A unique (React) key for the editor instance.\n const [editorInstanceKey, setEditorInstanceKey] = useState(keyGenerator())\n\n const requestFocus = useCallback(() => {\n requestAnimationFrame(() => {\n editorRef.current?.send({type: 'focus'})\n })\n }, [])\n\n const resetEditorInstance = useCallback(() => {\n // The discarded instance flushes pending mutations during teardown; drop\n // them in `handleEvent` so a finished draft cannot overwrite the\n // consumer's cleared draft state.\n resetInstanceRef.current = true\n setEditorInstanceKey(keyGenerator())\n }, [])\n\n const handleEvent = useCallback(\n (event: EditorEmittedEvent) => {\n // Focus the editor when ready if focusOnMount is true\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n if (event.type === 'ready') {\n resetInstanceRef.current = false\n if (focusOnMount) {\n requestFocus()\n }\n }\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n if (event.type === 'focused') {\n setFocused(true)\n }\n\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n if (event.type === 'blurred') {\n setFocused(false)\n }\n\n // Update the comment value whenever the comment is edited by the user.\n // oxlint-disable-next-line no-deprecated -- will fix in follow up PR\n if (event.type === 'mutation' && !resetInstanceRef.current) {\n onChange(event.value || EMPTY_ARRAY)\n }\n },\n [focusOnMount, onChange, requestFocus],\n )\n\n const scrollToEditor = useCallback(() => {\n editorContainerRef.current?.scrollIntoView(SCROLL_INTO_VIEW_OPTIONS)\n }, [])\n\n const handleSubmit = useCallback(() => {\n // Read the editor's live value directly rather than the value mirrored\n // through the debounced `mutation` event, which can lag the latest\n // keystrokes by up to the flush interval and truncate the comment when\n // the user submits without pausing.\n const currentValue = editorRef.current ? getValue(editorRef.current.getSnapshot()) : EMPTY_ARRAY\n onSubmit?.(currentValue)\n resetEditorInstance()\n requestFocus()\n scrollToEditor()\n }, [onSubmit, requestFocus, resetEditorInstance, scrollToEditor])\n\n const handleDiscardConfirm = useCallback(() => {\n onDiscardConfirm()\n resetEditorInstance()\n }, [onDiscardConfirm, resetEditorInstance])\n\n // The way a user a comment can be discarded varies from the context it is used in.\n // This controller is used to take care of the main logic of the discard process, while\n // specific behavior is handled by the consumer.\n const discardDialogController = useMemo((): CommentDiscardDialogController => {\n return {\n open: () => {\n setShowDiscardDialog(true)\n },\n close: () => {\n setShowDiscardDialog(false)\n requestFocus()\n },\n }\n }, [requestFocus])\n\n useImperativeHandle(ref, () => {\n return {\n focus: requestFocus,\n blur() {\n editorRef.current?.send({type: 'blur'})\n },\n scrollTo: scrollToEditor,\n reset: resetEditorInstance,\n\n discardDialogController,\n }\n }, [discardDialogController, requestFocus, resetEditorInstance, scrollToEditor])\n\n const handleFocus = useCallback(\n (event: FocusEvent<HTMLDivElement>) => {\n if (!focusLock) return\n\n const target = event.target\n const innerEl = innerRef.current\n\n if (innerEl && target === preDivRef.current) {\n focusLastDescendant(innerEl)\n return\n }\n\n if (innerEl && target === postDivRef.current) {\n focusFirstDescendant(innerEl)\n }\n },\n [focusLock],\n )\n\n return (\n <>\n {showDiscardDialog && onDiscardCancel && (\n <CommentInputDiscardDialog onClose={onDiscardCancel} onConfirm={handleDiscardConfirm} />\n )}\n\n <Stack ref={editorContainerRef} data-testid=\"comment-input\" onFocus={handleFocus}>\n <EditorProvider\n key={editorInstanceKey}\n initialConfig={{\n schemaDefinition: sanitySchemaToPortableTextSchema(editorSchemaType),\n initialValue: value || EMPTY_ARRAY,\n readOnly,\n }}\n >\n <EditorRefPlugin ref={editorRef} />\n <EventListenerPlugin on={handleEvent} />\n <OneLinePlugin />\n <UpdateReadOnlyPlugin readOnly={readOnly ?? false} />\n <UpdateValuePlugin value={value ?? undefined} />\n <CommentInputProvider\n expandOnFocus={expandOnFocus}\n focused={focused}\n focusOnMount={focusOnMount}\n mentionOptions={mentionOptions}\n onMentionMenuOpenChange={onMentionMenuOpenChange}\n readOnly={readOnly}\n value={value}\n >\n {focusLock && <div ref={preDivRef} tabIndex={0} />}\n\n <Stack ref={innerRef}>\n <CommentInputInner\n avatarSize={avatarSize}\n currentUser={currentUser}\n focusLock={focusLock}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n onSubmit={onSubmit && handleSubmit}\n placeholder={placeholder}\n renderBlock={renderBlock}\n withAvatar={withAvatar}\n />\n </Stack>\n\n {focusLock && <div ref={postDivRef} tabIndex={0} />}\n </CommentInputProvider>\n </EditorProvider>\n </Stack>\n </>\n )\n}\n\n/**\n * `EditorProvider` doesn't have a `readOnly` prop. This plugin listens for the\n * prop change and sends an `update readOnly` event to the editor.\n */\nfunction UpdateReadOnlyPlugin(props: {readOnly: boolean}) {\n const editor = useEditor()\n\n useEffect(() => {\n editor.send({\n type: 'update readOnly',\n readOnly: props.readOnly,\n })\n }, [editor, props.readOnly])\n\n return null\n}\n\n/**\n * `EditorProvider` doesn't have a `value` prop. This plugin listens for the\n * prop change and sends an `update value` event to the editor.\n */\nfunction UpdateValuePlugin(props: {value: Array<PortableTextBlock> | undefined}) {\n const editor = useEditor()\n\n useEffect(() => {\n editor.send({\n type: 'update value',\n value: props.value,\n })\n }, [editor, props.value])\n\n return null\n}\n","import {type ColorHueKey} from '@sanity/color'\n\nimport {type CommentReactionOption, type CommentReactionShortNames} from './types'\n\n/**\n * @internal\n * @hidden\n */\nexport const COMMENTS_INSPECTOR_NAME = 'sanity/comments'\n\nexport const COMMENTS_HIGHLIGHT_HUE_KEY: ColorHueKey = 'yellow'\n\n// These should not be alphabetized as the current order is intentional\nexport const COMMENT_REACTION_OPTIONS: CommentReactionOption[] = [\n {\n shortName: ':+1:',\n title: 'Thumbs up',\n },\n {\n shortName: ':-1:',\n title: 'Thumbs down',\n },\n {\n shortName: ':heart:',\n title: 'Heart',\n },\n {\n shortName: ':rocket:',\n title: 'Rocket',\n },\n {\n shortName: ':heavy_plus_sign:',\n title: 'Heavy plus sign',\n },\n {\n shortName: ':eyes:',\n title: 'Eyes',\n },\n]\n\nexport const COMMENT_REACTION_EMOJIS: Record<CommentReactionShortNames, string> = {\n ':-1:': '👎',\n ':+1:': '👍',\n ':eyes:': '👀',\n ':heart:': '❤️',\n ':heavy_plus_sign:': '➕',\n ':rocket:': '🚀',\n}\n","import {useContext} from 'react'\nimport {CommentsContext} from 'sanity/_singletons'\n\nimport {type CommentsContextValue} from '../context/comments/types'\n\n/**\n * @beta\n * @hidden\n */\nexport function useComments(): CommentsContextValue {\n const value = useContext(CommentsContext)\n\n if (!value) {\n throw new Error('useComments must be used within a CommentsProvider')\n }\n\n return value\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAaC,0BAA0B,YAO1BE,gCAAsD;CACjEC,QAAQ;CACRC,WAAWJ;CACXK,iBAAiB,OAAO;AAC1B,GCfMO,sBAA+C;CACnDC,UAAU;CACVC,QAAQ;CACRC,YAAY;AACd,GAEMC,uBAAgD;CACpD,GAAGJ;CACHK,OAAO;AACT,GAEMC,gCAAyD;CAC7D,GAAGN;CACHK,OAAO;AACT,GAEME,0BAAmD;CACvD,GAAGP;CACHK,OAAO;AACT,GAOMI,yBAA6E;CACjF,SAAWD;EALX,GAAGR;EACHK,OAAO;CAIIG;CACX,OAASD;CACT,OAASH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