@wordpress/editor
Version:
Enhanced block editor for WordPress posts.
8 lines (7 loc) • 1.4 kB
Source Map (JSON)
{
"version": 3,
"sources": ["../../../src/components/post-last-edited-panel/index.js"],
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __experimentalText as Text } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { humanTimeDiff } from '@wordpress/date';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function PostLastEditedPanel() {\n\tconst modified = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'modified' ),\n\t\t[]\n\t);\n\tif ( ! modified ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<div className=\"editor-post-last-edited-panel\">\n\t\t\t<Text>\n\t\t\t\t{ sprintf(\n\t\t\t\t\t// translators: %s: Human-readable time difference, e.g. \"2 days ago\".\n\t\t\t\t\t__( 'Last edited %s.' ),\n\t\t\t\t\thumanTimeDiff( modified )\n\t\t\t\t) }\n\t\t\t</Text>\n\t\t</div>\n\t);\n}\n"],
"mappings": ";AAGA,SAAS,sBAAsB,YAAY;AAC3C,SAAS,iBAAiB;AAC1B,SAAS,IAAI,eAAe;AAC5B,SAAS,qBAAqB;AAK9B,SAAS,SAAS,mBAAmB;AAalC;AAXY,SAAR,sBAAuC;AAC7C,QAAM,WAAW;AAAA,IAChB,CAAE,WACD,OAAQ,WAAY,EAAE,uBAAwB,UAAW;AAAA,IAC1D,CAAC;AAAA,EACF;AACA,MAAK,CAAE,UAAW;AACjB,WAAO;AAAA,EACR;AACA,SACC,oBAAC,SAAI,WAAU,iCACd,8BAAC,QACE;AAAA;AAAA,IAED,GAAI,iBAAkB;AAAA,IACtB,cAAe,QAAS;AAAA,EACzB,GACD,GACD;AAEF;",
"names": []
}