{
  "version": 3,
  "sources": ["../../../src/components/collaborators-overlay/use-block-highlighting.ts"],
  "sourcesContent": ["import {\n\tprivateApis as coreDataPrivateApis,\n\ttype CoreDataPrivateApis,\n\ttype PostEditorAwarenessState as ActiveCollaborator,\n\ttype SelectionEndpoint,\n} from '@wordpress/core-data';\n// @ts-expect-error - No type declarations available for @wordpress/block-editor\n// prettier-ignore\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { unlock } from '../../lock-unlock';\nimport { getAvatarBorderColor } from '../collab-sidebar/utils';\nimport { getAvatarUrl } from './get-avatar-url';\nimport {\n\tuseDebouncedRecompute,\n\tuseRequestAnimationFrameRecompute,\n} from './use-debounced-recompute';\nimport {\n\tgetNearestVisibleBlockAncestor,\n\tgetOrderedBlockRange,\n} from './cursor-dom-utils';\nimport { resolveTargetElement } from './compute-selection';\nimport { resolveStartPosition } from './resolve-start-position';\nimport { getCollaboratorDisplayName } from '../../utils/get-collaborator-display-name';\n\nconst { useActiveCollaborators, useResolvedSelection } =\n\tunlock( coreDataPrivateApis );\nconst { isElementVisible } = unlock( blockEditorPrivateApis );\nconst { SelectionType } = unlock( coreDataPrivateApis ) as Pick<\n\tCoreDataPrivateApis,\n\t'SelectionType'\n>;\n\nexport interface BlockHighlightData {\n\tblockId: string;\n\tclientId: number;\n\tuserName: string;\n\tavatarUrl?: string;\n\tcolor: string;\n\tx: number;\n\ty: number;\n}\n\n/**\n * Custom hook for highlighting selected blocks in the editor and computing\n * their positions for rendering avatar labels in the overlay.\n *\n * @param overlayElement      - The overlay element used as position reference.\n * @param blockEditorDocument - Ref to the block editor document.\n * @param postId              - The ID of the post.\n * @param postType            - The type of the post.\n * @param delayMs             - Milliseconds to wait before recomputing highlight positions.\n * @return Highlight data for rendering and a delayed recompute function.\n */\nexport function useBlockHighlighting(\n\toverlayElement: HTMLElement | null,\n\tblockEditorDocument: Document | null,\n\tpostId: number | null,\n\tpostType: string | null,\n\tdelayMs: number\n): {\n\thighlights: BlockHighlightData[];\n\trerenderHighlightsAfterDelay: () => () => void;\n\trerenderHighlightsOnResize: () => void;\n} {\n\tconst highlightedBlockIds = useRef< Set< string > >( new Set() );\n\tconst userStates: ActiveCollaborator[] = useActiveCollaborators(\n\t\tpostId ?? null,\n\t\tpostType ?? null\n\t);\n\tconst resolveSelection = useResolvedSelection(\n\t\tpostId ?? null,\n\t\tpostType ?? null\n\t);\n\n\tconst [ highlights, setHighlights ] = useState< BlockHighlightData[] >(\n\t\t[]\n\t);\n\n\t// Bump this counter to force the effect to re-run (e.g. after a layout shift).\n\tconst [ recomputeToken, rerenderHighlightsAfterDelay ] =\n\t\tuseDebouncedRecompute( delayMs );\n\t// Separate token for resize events: fires on the next animation frame so\n\t// getBoundingClientRect() reflects the post-resize layout immediately.\n\tconst [ resizeToken, rerenderHighlightsOnResize ] =\n\t\tuseRequestAnimationFrameRecompute();\n\n\t// All DOM mutations and position computations live inside useEffect.\n\tuseEffect( () => {\n\t\tif ( ! blockEditorDocument ) {\n\t\t\tsetHighlights( [] );\n\t\t\treturn;\n\t\t}\n\n\t\t// Capture the ref value so the cleanup closure sees the same Set\n\t\t// even if a later render replaces it.\n\t\tconst currentHighlightedIds = highlightedBlockIds.current;\n\n\t\ttype BlockEntry = {\n\t\t\tblockId: string;\n\t\t\tclientId: number;\n\t\t\tuserId: number;\n\t\t\tcolor: string;\n\t\t\tuserName: string;\n\t\t\tavatarUrl: string | undefined;\n\t\t\t// true for WholeBlock (always outline); false for\n\t\t\t// SelectionInMultipleBlocks (outline only on non-text blocks).\n\t\t\talwaysOutline: boolean;\n\t\t};\n\n\t\t// Deduplicate by blockId — when multiple collaborators select the\n\t\t// same block, only the first one gets the highlight and avatar label.\n\t\tconst seen = new Set< string >();\n\t\tconst blocksToHighlight = userStates\n\t\t\t.filter( ( userState: ActiveCollaborator ) => {\n\t\t\t\tif ( userState.isMe ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tconst selType = userState.editorState?.selection?.type;\n\t\t\t\treturn (\n\t\t\t\t\tselType === SelectionType.WholeBlock ||\n\t\t\t\t\tselType === SelectionType.SelectionInMultipleBlocks ||\n\t\t\t\t\tselType === SelectionType.Cursor ||\n\t\t\t\t\tselType === SelectionType.SelectionInOneBlock\n\t\t\t\t);\n\t\t\t} )\n\t\t\t.flatMap< BlockEntry >( ( userState ) => {\n\t\t\t\t// Cast to any: the selection union type is narrowed by the\n\t\t\t\t// filter above, but TypeScript cannot infer that after .flatMap.\n\t\t\t\tconst selection = userState.editorState?.selection as any;\n\n\t\t\t\tif ( selection.type === SelectionType.WholeBlock ) {\n\t\t\t\t\tlet localClientId: string | null;\n\t\t\t\t\ttry {\n\t\t\t\t\t\t( { localClientId } = resolveSelection( selection ) );\n\t\t\t\t\t} catch {\n\t\t\t\t\t\treturn [];\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! localClientId ) {\n\t\t\t\t\t\treturn [];\n\t\t\t\t\t}\n\n\t\t\t\t\t// The selected block may be hidden inside collapsed\n\t\t\t\t\t// content (e.g. a closed core/details or an inactive\n\t\t\t\t\t// core/accordion panel). Fall back to outlining the\n\t\t\t\t\t// nearest *visible* ancestor instead, same as the\n\t\t\t\t\t// Cursor/SelectionInOneBlock case below, so the\n\t\t\t\t\t// collaborator still has a findable presence indicator\n\t\t\t\t\t// rather than silently getting no highlight at all.\n\t\t\t\t\tlet blockId = localClientId;\n\t\t\t\t\tconst blockElement = getBlockElementById(\n\t\t\t\t\t\tblockEditorDocument,\n\t\t\t\t\t\tlocalClientId\n\t\t\t\t\t);\n\t\t\t\t\tif ( blockElement && ! isElementVisible( blockElement ) ) {\n\t\t\t\t\t\tconst container =\n\t\t\t\t\t\t\tgetNearestVisibleBlockAncestor( blockElement );\n\t\t\t\t\t\tconst containerId =\n\t\t\t\t\t\t\tcontainer?.getAttribute( 'data-block' );\n\t\t\t\t\t\tif ( ! containerId ) {\n\t\t\t\t\t\t\treturn [];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tblockId = containerId;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tblockId,\n\t\t\t\t\t\t\tclientId: userState.clientId,\n\t\t\t\t\t\t\tuserId:\n\t\t\t\t\t\t\t\tuserState.collaboratorInfo.id ??\n\t\t\t\t\t\t\t\tuserState.clientId,\n\t\t\t\t\t\t\tcolor: getAvatarBorderColor(\n\t\t\t\t\t\t\t\tuserState.collaboratorInfo.id ??\n\t\t\t\t\t\t\t\t\tuserState.clientId\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tuserName: getCollaboratorDisplayName(\n\t\t\t\t\t\t\t\tuserState.collaboratorInfo\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tavatarUrl: getAvatarUrl(\n\t\t\t\t\t\t\t\tuserState.collaboratorInfo.avatar_urls\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\talwaysOutline: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t];\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tselection.type === SelectionType.Cursor ||\n\t\t\t\t\tselection.type === SelectionType.SelectionInOneBlock\n\t\t\t\t) {\n\t\t\t\t\t// These normally render as a real cursor/selection via\n\t\t\t\t\t// use-render-cursors — this hook only needs to step in\n\t\t\t\t\t// when the target is hidden inside collapsed content\n\t\t\t\t\t// (e.g. a closed core/details or an inactive\n\t\t\t\t\t// core/accordion panel), where a real cursor has nowhere\n\t\t\t\t\t// valid to draw. In that case, fall back to outlining\n\t\t\t\t\t// and placing an avatar on the nearest *visible*\n\t\t\t\t\t// ancestor block, so collaborators still have a\n\t\t\t\t\t// findable presence indicator.\n\t\t\t\t\tconst resolved = resolveStartPosition(\n\t\t\t\t\t\tselection,\n\t\t\t\t\t\tresolveSelection\n\t\t\t\t\t);\n\t\t\t\t\tif ( ! resolved?.localClientId ) {\n\t\t\t\t\t\treturn [];\n\t\t\t\t\t}\n\t\t\t\t\tconst targetElement = resolveTargetElement(\n\t\t\t\t\t\tblockEditorDocument,\n\t\t\t\t\t\tresolved\n\t\t\t\t\t);\n\t\t\t\t\tif (\n\t\t\t\t\t\t! targetElement ||\n\t\t\t\t\t\tisElementVisible( targetElement )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn [];\n\t\t\t\t\t}\n\t\t\t\t\tconst container =\n\t\t\t\t\t\tgetNearestVisibleBlockAncestor( targetElement );\n\t\t\t\t\tconst containerId = container?.getAttribute( 'data-block' );\n\t\t\t\t\tif ( ! containerId ) {\n\t\t\t\t\t\treturn [];\n\t\t\t\t\t}\n\t\t\t\t\treturn [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tblockId: containerId,\n\t\t\t\t\t\t\tclientId: userState.clientId,\n\t\t\t\t\t\t\tuserId:\n\t\t\t\t\t\t\t\tuserState.collaboratorInfo.id ??\n\t\t\t\t\t\t\t\tuserState.clientId,\n\t\t\t\t\t\t\tcolor: getAvatarBorderColor(\n\t\t\t\t\t\t\t\tuserState.collaboratorInfo.id ??\n\t\t\t\t\t\t\t\t\tuserState.clientId\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tuserName: getCollaboratorDisplayName(\n\t\t\t\t\t\t\t\tuserState.collaboratorInfo\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tavatarUrl: getAvatarUrl(\n\t\t\t\t\t\t\t\tuserState.collaboratorInfo.avatar_urls\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\talwaysOutline: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t];\n\t\t\t\t}\n\n\t\t\t\t// SelectionInMultipleBlocks: resolve each endpoint independently.\n\t\t\t\tconst resolveEndpointId = (\n\t\t\t\t\tendpoint: SelectionEndpoint\n\t\t\t\t): string | null => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn resolveSelection( endpoint ).localClientId;\n\t\t\t\t\t} catch {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tconst startId = resolveEndpointId( selection.startEndpoint );\n\t\t\t\tconst endId = resolveEndpointId( selection.endEndpoint );\n\t\t\t\tif ( ! startId || ! endId ) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\n\t\t\t\tconst range = getOrderedBlockRange(\n\t\t\t\t\tstartId,\n\t\t\t\t\tendId,\n\t\t\t\t\tblockEditorDocument\n\t\t\t\t);\n\t\t\t\tif ( ! range ) {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\n\t\t\t\tconst { firstId, lastId, middleEls, sameContainer } = range;\n\t\t\t\tconst color = getAvatarBorderColor(\n\t\t\t\t\tuserState.collaboratorInfo.id ?? userState.clientId\n\t\t\t\t);\n\t\t\t\tconst userName = getCollaboratorDisplayName(\n\t\t\t\t\tuserState.collaboratorInfo\n\t\t\t\t);\n\t\t\t\tconst avatarUrl = getAvatarUrl(\n\t\t\t\t\tuserState.collaboratorInfo.avatar_urls\n\t\t\t\t);\n\n\t\t\t\t// Both endpoints in the same container (e.g. two list-items in one list).\n\t\t\t\tif ( sameContainer ) {\n\t\t\t\t\treturn [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tblockId: firstId,\n\t\t\t\t\t\t\tclientId: userState.clientId,\n\t\t\t\t\t\t\tuserId:\n\t\t\t\t\t\t\t\tuserState.collaboratorInfo.id ??\n\t\t\t\t\t\t\t\tuserState.clientId,\n\t\t\t\t\t\t\tcolor,\n\t\t\t\t\t\t\tuserName,\n\t\t\t\t\t\t\tavatarUrl,\n\t\t\t\t\t\t\talwaysOutline: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t];\n\t\t\t\t}\n\n\t\t\t\tconst intermediateIds = middleEls\n\t\t\t\t\t.map( ( el ) => el.getAttribute( 'data-block' ) )\n\t\t\t\t\t.filter( ( id ): id is string => Boolean( id ) );\n\n\t\t\t\treturn [ firstId, ...intermediateIds, lastId ].map(\n\t\t\t\t\t( blockId ) => ( {\n\t\t\t\t\t\tblockId,\n\t\t\t\t\t\tclientId: userState.clientId,\n\t\t\t\t\t\tuserId:\n\t\t\t\t\t\t\tuserState.collaboratorInfo.id ?? userState.clientId,\n\t\t\t\t\t\tcolor,\n\t\t\t\t\t\tuserName,\n\t\t\t\t\t\tavatarUrl,\n\t\t\t\t\t\talwaysOutline: false,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t} )\n\t\t\t.filter( ( block ) => {\n\t\t\t\tif ( seen.has( block.blockId ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tseen.add( block.blockId );\n\t\t\t\treturn true;\n\t\t\t} );\n\n\t\t// Unhighlight blocks that are no longer selected.\n\t\tconst selectedBlockIds = new Set(\n\t\t\tblocksToHighlight.map( ( block ) => block.blockId )\n\t\t);\n\n\t\tfor ( const blockId of currentHighlightedIds ) {\n\t\t\tif ( ! selectedBlockIds.has( blockId ) ) {\n\t\t\t\tconst blockElement = getBlockElementById(\n\t\t\t\t\tblockEditorDocument,\n\t\t\t\t\tblockId\n\t\t\t\t);\n\n\t\t\t\tif ( blockElement ) {\n\t\t\t\t\tblockElement.classList.remove( 'is-collaborator-selected' );\n\t\t\t\t\tblockElement.style.removeProperty(\n\t\t\t\t\t\t'--collaborator-outline-color'\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tcurrentHighlightedIds.delete( blockId );\n\t\t\t}\n\t\t}\n\n\t\t// Highlight blocks and compute positions for avatar labels.\n\t\tconst results: BlockHighlightData[] = [];\n\t\tconst overlayRect = overlayElement?.getBoundingClientRect() ?? null;\n\n\t\t// Track which users already have an avatar placed. Fallback collaborators\n\t\t// use their Yjs client ID, so anonymous sessions remain distinct while\n\t\t// multiple sessions for a named user stay grouped.\n\t\tconst usersWithAvatar = new Set< number >();\n\n\t\tblocksToHighlight.forEach( ( block ) => {\n\t\t\tconst { color, blockId, userName, avatarUrl } = block;\n\t\t\tconst blockElement = getBlockElementById(\n\t\t\t\tblockEditorDocument,\n\t\t\t\tblockId\n\t\t\t);\n\n\t\t\tif ( ! blockElement ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Reset any stale outline class first. Without this, a block that\n\t\t\t// transitions from a WholeBlock selection (always outlined) to being\n\t\t\t// a text block inside a SelectionInMultipleBlocks range would keep\n\t\t\t// the class indefinitely — the cleanup loop only removes blocks that\n\t\t\t// leave the selection entirely.\n\t\t\tblockElement.classList.remove( 'is-collaborator-selected' );\n\t\t\tblockElement.style.removeProperty( '--collaborator-outline-color' );\n\t\t\tcurrentHighlightedIds.delete( blockId );\n\n\t\t\t// The block may be hidden inside collapsed content (e.g. a closed\n\t\t\t// core/details or an inactive core/accordion panel). Skip drawing\n\t\t\t// a new outline or avatar for it rather than misplacing them at\n\t\t\t// the collapsed wrapper's position — the reset above still runs so\n\t\t\t// a block that was outlined before collapsing doesn't keep a\n\t\t\t// stale outline class or dangling entry in currentHighlightedIds.\n\t\t\tif ( ! isElementVisible( blockElement ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// WholeBlock (single block entirely selected): always outline.\n\t\t\t// SelectionInMultipleBlocks: outline only on non-text blocks\n\t\t\t// (image, spacer, etc.) — text blocks are highlighted via text\n\t\t\t// rects from compute-selection so their content stays visible.\n\t\t\tconst isNonTextBlock = ! blockElement.innerText?.trim();\n\t\t\tif ( block.alwaysOutline || isNonTextBlock ) {\n\t\t\t\tblockElement.classList.add( 'is-collaborator-selected' );\n\t\t\t\tblockElement.style.setProperty(\n\t\t\t\t\t'--collaborator-outline-color',\n\t\t\t\t\tcolor\n\t\t\t\t);\n\t\t\t\tcurrentHighlightedIds.add( blockId );\n\t\t\t}\n\n\t\t\tif ( overlayRect && ! usersWithAvatar.has( block.userId ) ) {\n\t\t\t\tusersWithAvatar.add( block.userId );\n\t\t\t\tconst blockRect = blockElement.getBoundingClientRect();\n\t\t\t\tresults.push( {\n\t\t\t\t\tblockId,\n\t\t\t\t\tclientId: block.clientId,\n\t\t\t\t\tuserName,\n\t\t\t\t\tavatarUrl,\n\t\t\t\t\tcolor,\n\t\t\t\t\tx: blockRect.left - overlayRect.left,\n\t\t\t\t\ty: blockRect.top - overlayRect.top,\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\tsetHighlights( results );\n\n\t\t// Clean up all highlights on unmount.\n\t\treturn () => {\n\t\t\tfor ( const blockId of currentHighlightedIds ) {\n\t\t\t\tconst el = getBlockElementById( blockEditorDocument, blockId );\n\t\t\t\tif ( el ) {\n\t\t\t\t\tel.classList.remove( 'is-collaborator-selected' );\n\t\t\t\t\tel.style.removeProperty( '--collaborator-outline-color' );\n\t\t\t\t}\n\t\t\t}\n\t\t\tcurrentHighlightedIds.clear();\n\t\t};\n\t}, [\n\t\tuserStates,\n\t\tblockEditorDocument,\n\t\toverlayElement,\n\t\trecomputeToken,\n\t\tresizeToken,\n\t\tresolveSelection,\n\t] );\n\n\treturn {\n\t\thighlights,\n\t\trerenderHighlightsAfterDelay,\n\t\trerenderHighlightsOnResize,\n\t};\n}\n\nconst getBlockElementById = (\n\tblockEditorDocument: Document,\n\tblockId: string\n): HTMLElement | null => {\n\treturn blockEditorDocument.querySelector( `[data-block=\"${ blockId }\"]` );\n};\n"],
  "mappings": ";AAAA;AAAA,EACC,eAAe;AAAA,OAIT;AAGP,SAAS,eAAe,8BAA8B;AACtD,SAAS,WAAW,QAAQ,gBAAgB;AAC5C,SAAS,cAAc;AACvB,SAAS,4BAA4B;AACrC,SAAS,oBAAoB;AAC7B;AAAA,EACC;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA;AAAA,OACM;AACP,SAAS,4BAA4B;AACrC,SAAS,4BAA4B;AACrC,SAAS,kCAAkC;AAE3C,IAAM,EAAE,wBAAwB,qBAAqB,IACpD,OAAQ,mBAAoB;AAC7B,IAAM,EAAE,iBAAiB,IAAI,OAAQ,sBAAuB;AAC5D,IAAM,EAAE,cAAc,IAAI,OAAQ,mBAAoB;AA0B/C,SAAS,qBACf,gBACA,qBACA,QAC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