@wordpress/editor
Version:
Enhanced block editor for WordPress posts.
8 lines (7 loc) • 971 B
Source Map (JSON)
{
"version": 3,
"sources": ["../../src/utils/get-collaborator-display-name.ts"],
"sourcesContent": ["import type { CollaboratorInfo } from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Return a collaborator name localized for the current viewer.\n *\n * Fallback names are stored untranslated in shared awareness state so peers\n * with different profile languages do not receive another user's translation.\n *\n * @param collaboratorInfo Collaborator information from awareness state.\n * @return The collaborator name to display.\n */\nexport function getCollaboratorDisplayName(\n\tcollaboratorInfo: Pick< CollaboratorInfo, 'id' | 'name' >\n): string {\n\treturn null === collaboratorInfo.id\n\t\t? __( 'Anonymous User' )\n\t\t: collaboratorInfo.name;\n}\n"],
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAAmB;AAWZ,SAAS,2BACf,kBACS;AACT,SAAO,SAAS,iBAAiB,SAC9B,gBAAI,gBAAiB,IACrB,iBAAiB;AACrB;",
"names": []
}