UNPKG

@wordpress/block-library

Version:
1 lines • 2.06 kB
{"version":3,"file":"variations.mjs","names":[],"sources":["../../src/post-date/variations.js"],"sourcesContent":["import { __ } from '@wordpress/i18n';\n\nconst variations = [\n\t{\n\t\tname: 'post-date',\n\t\ttitle: __( 'Post Date' ),\n\t\tdescription: __( \"Display a post's publish date.\" ),\n\t\tattributes: {\n\t\t\tmetadata: {\n\t\t\t\tbindings: {\n\t\t\t\t\tdatetime: {\n\t\t\t\t\t\tsource: 'core/post-data',\n\t\t\t\t\t\targs: { field: 'date' },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tscope: [ 'inserter', 'transform' ],\n\t\tisActive: ( blockAttributes ) =>\n\t\t\tblockAttributes?.metadata?.bindings?.datetime?.source ===\n\t\t\t\t'core/post-data' &&\n\t\t\tblockAttributes?.metadata?.bindings?.datetime?.args?.field ===\n\t\t\t\t'date',\n\t},\n\t{\n\t\tname: 'post-date-modified',\n\t\ttitle: __( 'Modified Date' ),\n\t\tdescription: __( \"Display a post's last updated date.\" ),\n\t\tattributes: {\n\t\t\tmetadata: {\n\t\t\t\tbindings: {\n\t\t\t\t\tdatetime: {\n\t\t\t\t\t\tsource: 'core/post-data',\n\t\t\t\t\t\targs: { field: 'modified' },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tclassName: 'wp-block-post-date__modified-date',\n\t\t},\n\t\tscope: [ 'inserter', 'transform' ],\n\t\tisActive: ( blockAttributes ) =>\n\t\t\tblockAttributes?.metadata?.bindings?.datetime?.source ===\n\t\t\t\t'core/post-data' &&\n\t\t\tblockAttributes?.metadata?.bindings?.datetime?.args?.field ===\n\t\t\t\t'modified',\n\t},\n];\n\nexport default variations;\n"],"mappings":";;AAEA,MAAM,aAAa,CAClB;CACC,MAAM;CACN,OAAO,GAAI,WAAY;CACvB,aAAa,GAAI,gCAAiC;CAClD,YAAY,EACX,UAAU,EACT,UAAU,EACT,UAAU;EACT,QAAQ;EACR,MAAM,EAAE,OAAO,OAAO;CACvB,EACD,EACD,EACD;CACA,OAAO,CAAE,YAAY,WAAY;CACjC,WAAY,oBACX,iBAAiB,UAAU,UAAU,UAAU,WAC9C,oBACD,iBAAiB,UAAU,UAAU,UAAU,MAAM,UACpD;AACH,GACA;CACC,MAAM;CACN,OAAO,GAAI,eAAgB;CAC3B,aAAa,GAAI,qCAAsC;CACvD,YAAY;EACX,UAAU,EACT,UAAU,EACT,UAAU;GACT,QAAQ;GACR,MAAM,EAAE,OAAO,WAAW;EAC3B,EACD,EACD;EACA,WAAW;CACZ;CACA,OAAO,CAAE,YAAY,WAAY;CACjC,WAAY,oBACX,iBAAiB,UAAU,UAAU,UAAU,WAC9C,oBACD,iBAAiB,UAAU,UAAU,UAAU,MAAM,UACpD;AACH,CACD"}