@wordpress/editor
Version:
Enhanced block editor for WordPress posts.
8 lines (7 loc) • 1.52 kB
Source Map (JSON)
{
"version": 3,
"sources": ["../../../src/components/revision-created-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';\nimport { unlock } from '../../lock-unlock';\n\nexport default function RevisionCreatedPanel() {\n\tconst date = useSelect( ( select ) => {\n\t\tconst { getCurrentRevision } = unlock( select( editorStore ) );\n\t\treturn getCurrentRevision()?.date;\n\t}, [] );\n\n\tif ( ! date ) {\n\t\treturn null;\n\t}\n\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__( 'Created %s.' ),\n\t\t\t\t\thumanTimeDiff( date )\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;AACrC,SAAS,cAAc;AAcpB;AAZY,SAAR,uBAAwC;AAC9C,QAAM,OAAO,UAAW,CAAE,WAAY;AACrC,UAAM,EAAE,mBAAmB,IAAI,OAAQ,OAAQ,WAAY,CAAE;AAC7D,WAAO,mBAAmB,GAAG;AAAA,EAC9B,GAAG,CAAC,CAAE;AAEN,MAAK,CAAE,MAAO;AACb,WAAO;AAAA,EACR;AAEA,SACC,oBAAC,SAAI,WAAU,iCACd,8BAAC,QACE;AAAA;AAAA,IAED,GAAI,aAAc;AAAA,IAClB,cAAe,IAAK;AAAA,EACrB,GACD,GACD;AAEF;",
"names": []
}