@wordpress/block-library 9.27.0 → 9.27.1-next.46f643fa0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/build/categories/edit.js +15 -3
  2. package/build/categories/edit.js.map +1 -1
  3. package/build/cover/edit/inspector-controls.js +4 -2
  4. package/build/cover/edit/inspector-controls.js.map +1 -1
  5. package/build/file/edit.js +2 -1
  6. package/build/file/edit.js.map +1 -1
  7. package/build/latest-posts/edit.js +0 -2
  8. package/build/latest-posts/edit.js.map +1 -1
  9. package/build/paragraph/edit.js +2 -2
  10. package/build/paragraph/edit.js.map +1 -1
  11. package/build/post-date/deprecated.js +104 -1
  12. package/build/post-date/deprecated.js.map +1 -1
  13. package/build/post-date/edit.js +32 -32
  14. package/build/post-date/edit.js.map +1 -1
  15. package/build/post-date/index.js +4 -4
  16. package/build/post-date/index.js.map +1 -1
  17. package/build/post-date/variations.js +32 -3
  18. package/build/post-date/variations.js.map +1 -1
  19. package/build/social-link/variations.js +51 -49
  20. package/build/social-link/variations.js.map +1 -1
  21. package/build/utils/poster-image.js +93 -0
  22. package/build/utils/poster-image.js.map +1 -0
  23. package/build/video/edit.js +6 -2
  24. package/build/video/edit.js.map +1 -1
  25. package/build-module/categories/edit.js +15 -3
  26. package/build-module/categories/edit.js.map +1 -1
  27. package/build-module/cover/edit/inspector-controls.js +4 -2
  28. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  29. package/build-module/file/edit.js +2 -1
  30. package/build-module/file/edit.js.map +1 -1
  31. package/build-module/latest-posts/edit.js +0 -2
  32. package/build-module/latest-posts/edit.js.map +1 -1
  33. package/build-module/paragraph/edit.js +2 -2
  34. package/build-module/paragraph/edit.js.map +1 -1
  35. package/build-module/post-date/deprecated.js +104 -1
  36. package/build-module/post-date/deprecated.js.map +1 -1
  37. package/build-module/post-date/edit.js +35 -35
  38. package/build-module/post-date/edit.js.map +1 -1
  39. package/build-module/post-date/index.js +4 -4
  40. package/build-module/post-date/index.js.map +1 -1
  41. package/build-module/post-date/variations.js +32 -3
  42. package/build-module/post-date/variations.js.map +1 -1
  43. package/build-module/social-link/variations.js +52 -50
  44. package/build-module/social-link/variations.js.map +1 -1
  45. package/build-module/utils/poster-image.js +85 -0
  46. package/build-module/utils/poster-image.js.map +1 -0
  47. package/build-module/video/edit.js +6 -2
  48. package/build-module/video/edit.js.map +1 -1
  49. package/build-style/editor-rtl.css +67 -10
  50. package/build-style/editor.css +67 -10
  51. package/build-style/navigation/editor-rtl.css +6 -6
  52. package/build-style/navigation/editor.css +6 -6
  53. package/build-style/page-list/editor-rtl.css +0 -4
  54. package/build-style/page-list/editor.css +0 -4
  55. package/build-style/style-rtl.css +1 -0
  56. package/build-style/style.css +1 -0
  57. package/build-style/video/style-rtl.css +1 -0
  58. package/build-style/video/style.css +1 -0
  59. package/package.json +35 -35
  60. package/src/categories/edit.js +13 -1
  61. package/src/cover/edit/inspector-controls.js +6 -2
  62. package/src/editor.scss +1 -0
  63. package/src/file/edit.js +4 -1
  64. package/src/latest-posts/edit.js +0 -2
  65. package/src/page-list/editor.scss +0 -6
  66. package/src/paragraph/edit.js +2 -2
  67. package/src/post-date/block.json +4 -4
  68. package/src/post-date/deprecated.js +104 -1
  69. package/src/post-date/edit.js +74 -86
  70. package/src/post-date/index.php +55 -28
  71. package/src/post-date/variations.js +37 -3
  72. package/src/social-link/README.md +21 -0
  73. package/src/social-link/index.php +49 -49
  74. package/src/social-link/variations.js +51 -49
  75. package/src/utils/poster-image.js +131 -0
  76. package/src/utils/poster-image.scss +75 -0
  77. package/src/video/edit.js +7 -2
  78. package/src/video/index.php +91 -0
  79. package/src/video/style.native.scss +1 -0
  80. package/src/video/style.scss +1 -0
  81. package/build/cover/edit/poster-image.js +0 -81
  82. package/build/cover/edit/poster-image.js.map +0 -1
  83. package/build/video/poster-image.js +0 -81
  84. package/build/video/poster-image.js.map +0 -1
  85. package/build-module/cover/edit/poster-image.js +0 -74
  86. package/build-module/cover/edit/poster-image.js.map +0 -1
  87. package/build-module/video/poster-image.js +0 -74
  88. package/build-module/video/poster-image.js.map +0 -1
  89. package/src/cover/edit/poster-image.js +0 -91
  90. package/src/video/poster-image.js +0 -91
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_coreData","_element","_date","_blockEditor","_components","_i18n","_icons","_keycodes","_data","_hooks","_jsxRuntime","PostDateEdit","attributes","textAlign","format","isLink","displayType","context","postId","postType","postTypeSlug","queryId","setAttributes","blockProps","useBlockProps","className","clsx","dropdownMenuProps","useToolsPanelDropdownMenuProps","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","anchor","isDescendentOfQueryLoop","Number","isFinite","dateSettings","getDateSettings","siteFormat","formats","date","useEntityProp","siteTimeFormat","time","setDate","useSelect","select","coreStore","getPostType","dateLabel","__","postDate","jsx","dateTime","dateI18n","ref","children","humanTimeDiff","href","onClick","event","preventDefault","jsxs","Fragment","BlockControls","group","AlignmentControl","value","onChange","nextAlign","ToolbarGroup","Dropdown","renderContent","onClose","__experimentalPublishDateTimePicker","currentDate","is12Hour","is12HourFormat","dateOrder","_x","renderToggle","isOpen","onToggle","openOnArrowDown","keyCode","DOWN","ToolbarButton","icon","edit","title","onKeyDown","InspectorControls","__experimentalToolsPanel","label","resetAll","undefined","__experimentalToolsPanelItem","hasValue","onDeselect","isShownByDefault","__experimentalDateFormatPicker","defaultFormat","nextFormat","labels","singular_name","sprintf","toLowerCase","ToggleControl","__nextHasNoMarginBottom","checked","help","test"],"sources":["@wordpress/block-library/src/post-date/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useMemo, useState } from '@wordpress/element';\nimport {\n\tdateI18n,\n\thumanTimeDiff,\n\tgetSettings as getDateSettings,\n} from '@wordpress/date';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n\t__experimentalDateFormatPicker as DateFormatPicker,\n\t__experimentalPublishDateTimePicker as PublishDateTimePicker,\n} from '@wordpress/block-editor';\nimport {\n\tDropdown,\n\tToolbarGroup,\n\tToolbarButton,\n\tToggleControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { edit } from '@wordpress/icons';\nimport { DOWN } from '@wordpress/keycodes';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nexport default function PostDateEdit( {\n\tattributes: { textAlign, format, isLink, displayType },\n\tcontext: { postId, postType: postTypeSlug, queryId },\n\tsetAttributes,\n} ) {\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t\t[ `wp-block-post-date__modified-date` ]: displayType === 'modified',\n\t\t} ),\n\t} );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( { anchor: popoverAnchor } ),\n\t\t[ popoverAnchor ]\n\t);\n\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst dateSettings = getDateSettings();\n\tconst [ siteFormat = dateSettings.formats.date ] = useEntityProp(\n\t\t'root',\n\t\t'site',\n\t\t'date_format'\n\t);\n\tconst [ siteTimeFormat = dateSettings.formats.time ] = useEntityProp(\n\t\t'root',\n\t\t'site',\n\t\t'time_format'\n\t);\n\tconst [ date, setDate ] = useEntityProp(\n\t\t'postType',\n\t\tpostTypeSlug,\n\t\tdisplayType,\n\t\tpostId\n\t);\n\n\tconst postType = useSelect(\n\t\t( select ) =>\n\t\t\tpostTypeSlug\n\t\t\t\t? select( coreStore ).getPostType( postTypeSlug )\n\t\t\t\t: null,\n\t\t[ postTypeSlug ]\n\t);\n\n\tconst dateLabel =\n\t\tdisplayType === 'date' ? __( 'Post Date' ) : __( 'Post Modified Date' );\n\n\tlet postDate = date ? (\n\t\t<time dateTime={ dateI18n( 'c', date ) } ref={ setPopoverAnchor }>\n\t\t\t{ format === 'human-diff'\n\t\t\t\t? humanTimeDiff( date )\n\t\t\t\t: dateI18n( format || siteFormat, date ) }\n\t\t</time>\n\t) : (\n\t\tdateLabel\n\t);\n\n\tif ( isLink && date ) {\n\t\tpostDate = (\n\t\t\t<a\n\t\t\t\thref=\"#post-date-pseudo-link\"\n\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t>\n\t\t\t\t{ postDate }\n\t\t\t</a>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t\t{ date &&\n\t\t\t\t\tdisplayType === 'date' &&\n\t\t\t\t\t! isDescendentOfQueryLoop && (\n\t\t\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t\t\t\t<PublishDateTimePicker\n\t\t\t\t\t\t\t\t\t\tcurrentDate={ date }\n\t\t\t\t\t\t\t\t\t\tonChange={ setDate }\n\t\t\t\t\t\t\t\t\t\tis12Hour={ is12HourFormat(\n\t\t\t\t\t\t\t\t\t\t\tsiteTimeFormat\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t\t\t\tdateOrder={\n\t\t\t\t\t\t\t\t\t\t\t/* translators: Order of day, month, and year. Available formats are 'dmy', 'mdy', and 'ymd'. */\n\t\t\t\t\t\t\t\t\t\t\t_x( 'dmy', 'date order' )\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => {\n\t\t\t\t\t\t\t\t\tconst openOnArrowDown = ( event ) => {\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\t! isOpen &&\n\t\t\t\t\t\t\t\t\t\t\tevent.keyCode === DOWN\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\t\tonToggle();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t\t\t\t\t\ticon={ edit }\n\t\t\t\t\t\t\t\t\t\t\ttitle={ __( 'Change Date' ) }\n\t\t\t\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\t\t\t\tonKeyDown={ openOnArrowDown }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t\t) }\n\t\t\t</BlockControls>\n\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tformat: undefined,\n\t\t\t\t\t\t\tisLink: false,\n\t\t\t\t\t\t\tdisplayType: 'date',\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => !! format }\n\t\t\t\t\t\tlabel={ __( 'Date Format' ) }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { format: undefined } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<DateFormatPicker\n\t\t\t\t\t\t\tformat={ format }\n\t\t\t\t\t\t\tdefaultFormat={ siteFormat }\n\t\t\t\t\t\t\tonChange={ ( nextFormat ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { format: nextFormat } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => isLink !== false }\n\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\tpostType?.labels.singular_name\n\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: Name of the post type e.g: \"post\".\n\t\t\t\t\t\t\t\t\t\t__( 'Link to %s' ),\n\t\t\t\t\t\t\t\t\t\tpostType.labels.singular_name.toLowerCase()\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: __( 'Link to post' )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { isLink: false } ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tpostType?.labels.singular_name\n\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t// translators: %s: Name of the post type e.g: \"post\".\n\t\t\t\t\t\t\t\t\t\t\t__( 'Link to %s' ),\n\t\t\t\t\t\t\t\t\t\t\tpostType.labels.singular_name.toLowerCase()\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: __( 'Link to post' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { isLink: ! isLink } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => displayType !== 'date' }\n\t\t\t\t\t\tlabel={ __( 'Display last modified date' ) }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { displayType: 'date' } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Display last modified date' ) }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tdisplayType: value ? 'modified' : 'date',\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ displayType === 'modified' }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Only shows if the post has been modified'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\n\t\t\t<div { ...blockProps }>{ postDate }</div>\n\t\t</>\n\t);\n}\n\nexport function is12HourFormat( format ) {\n\t// To know if the time format is a 12 hour time, look for any of the 12 hour\n\t// format characters: 'a', 'A', 'g', and 'h'. The character must be\n\t// unescaped, i.e. not preceded by a '\\'. Coincidentally, 'aAgh' is how I\n\t// feel when working with regular expressions.\n\t// https://www.php.net/manual/en/datetime.format.php\n\treturn /(?:^|[^\\\\])[aAgh]/.test( format );\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,YAAA,GAAAJ,OAAA;AAQA,IAAAK,WAAA,GAAAL,OAAA;AAQA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AAKA,IAAAU,MAAA,GAAAV,OAAA;AAAgE,IAAAW,WAAA,GAAAX,OAAA;AAvChE;AACA;AACA;;AAGA;AACA;AACA;;AA6BA;AACA;AACA;;AAGe,SAASY,YAAYA,CAAE;EACrCC,UAAU,EAAE;IAAEC,SAAS;IAAEC,MAAM;IAAEC,MAAM;IAAEC;EAAY,CAAC;EACtDC,OAAO,EAAE;IAAEC,MAAM;IAAEC,QAAQ,EAAEC,YAAY;IAAEC;EAAQ,CAAC;EACpDC;AACD,CAAC,EAAG;EACH,MAAMC,UAAU,GAAG,IAAAC,0BAAa,EAAE;IACjCC,SAAS,EAAE,IAAAC,aAAI,EAAE;MAChB,CAAE,kBAAmBb,SAAS,EAAG,GAAIA,SAAS;MAC9C,CAAE,mCAAmC,GAAIG,WAAW,KAAK;IAC1D,CAAE;EACH,CAAE,CAAC;EACH,MAAMW,iBAAiB,GAAG,IAAAC,qCAA8B,EAAC,CAAC;;EAE1D;EACA;EACA,MAAM,CAAEC,aAAa,EAAEC,gBAAgB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,IAAK,CAAC;EAC5D;EACA,MAAMC,YAAY,GAAG,IAAAC,gBAAO,EAC3B,OAAQ;IAAEC,MAAM,EAAEL;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,CAAA,KACZ9E,aAAa,CAAE;YAAEN,WAAW,EAAE;UAAO,CAAE,CACvC;UACDqF,gBAAgB;UAAA3C,QAAA,eAEhB,IAAAhD,WAAA,CAAA4C,GAAA,EAAClD,WAAA,CAAAyG,aAAa;YACbC,uBAAuB;YACvBf,KAAK,EAAG,IAAA3C,QAAE,EAAE,4BAA6B,CAAG;YAC5CkB,QAAQ,EAAKD,KAAK,IACjB/C,aAAa,CAAE;cACdN,WAAW,EAAEqD,KAAK,GAAG,UAAU,GAAG;YACnC,CAAE,CACF;YACD0C,OAAO,EAAG/F,WAAW,KAAK,UAAY;YACtCgG,IAAI,EAAG,IAAA5D,QAAE,EACR,0CACD;UAAG,CACH;QAAC,CACa,CAAC;MAAA,CACN;IAAC,CACK,CAAC,eAEpB,IAAA1C,WAAA,CAAA4C,GAAA;MAAA,GAAU/B,UAAU;MAAAmC,QAAA,EAAKL;IAAQ,CAAO,CAAC;EAAA,CACxC,CAAC;AAEL;AAEO,SAAS0B,cAAcA,CAAEjE,MAAM,EAAG;EACxC;EACA;EACA;EACA;EACA;EACA,OAAO,mBAAmB,CAACmG,IAAI,CAAEnG,MAAO,CAAC;AAC1C","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_coreData","_element","_date","_blockEditor","_components","_i18n","_icons","_keycodes","_data","_hooks","_jsxRuntime","PostDateEdit","attributes","datetime","textAlign","format","isLink","metadata","context","postType","postTypeSlug","queryId","setAttributes","displayType","bindings","source","args","key","blockProps","useBlockProps","className","clsx","dropdownMenuProps","useToolsPanelDropdownMenuProps","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","anchor","__unstableMarkNextChangeAsNotPersistent","useDispatch","blockEditorStore","useEffect","undefined","Date","isDescendentOfQueryLoop","Number","isFinite","dateSettings","getDateSettings","siteFormat","formats","date","useEntityProp","siteTimeFormat","time","useSelect","select","coreStore","getPostType","postDate","jsx","dateTime","dateI18n","ref","children","humanTimeDiff","href","onClick","event","preventDefault","jsxs","Fragment","BlockControls","group","AlignmentControl","value","onChange","nextAlign","ToolbarGroup","Dropdown","renderContent","onClose","__experimentalPublishDateTimePicker","title","__","currentDate","newDatetime","is12Hour","is12HourFormat","dateOrder","_x","renderToggle","isOpen","onToggle","openOnArrowDown","keyCode","DOWN","ToolbarButton","icon","edit","onKeyDown","InspectorControls","__experimentalToolsPanel","label","resetAll","__experimentalToolsPanelItem","hasValue","onDeselect","isShownByDefault","__experimentalDateFormatPicker","defaultFormat","nextFormat","labels","singular_name","sprintf","toLowerCase","ToggleControl","__nextHasNoMarginBottom","checked","test"],"sources":["@wordpress/block-library/src/post-date/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useEffect, useMemo, useState } from '@wordpress/element';\nimport {\n\tdateI18n,\n\thumanTimeDiff,\n\tgetSettings as getDateSettings,\n} from '@wordpress/date';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tstore as blockEditorStore,\n\tuseBlockProps,\n\t__experimentalDateFormatPicker as DateFormatPicker,\n\t__experimentalPublishDateTimePicker as PublishDateTimePicker,\n} from '@wordpress/block-editor';\nimport {\n\tDropdown,\n\tToolbarGroup,\n\tToolbarButton,\n\tToggleControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { edit } from '@wordpress/icons';\nimport { DOWN } from '@wordpress/keycodes';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nexport default function PostDateEdit( {\n\tattributes: { datetime, textAlign, format, isLink, metadata },\n\tcontext: { postType: postTypeSlug, queryId },\n\tsetAttributes,\n} ) {\n\tconst displayType =\n\t\tmetadata?.bindings?.datetime?.source === 'core/post-data' &&\n\t\tmetadata?.bindings?.datetime?.args?.key;\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( { anchor: popoverAnchor } ),\n\t\t[ popoverAnchor ]\n\t);\n\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\t// We need to set the datetime to a default value upon first loading\n\t// to discern the block from its legacy version (which would default\n\t// to the containing post's publish date).\n\tuseEffect( () => {\n\t\tif ( datetime === undefined ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( { datetime: new Date() } );\n\t\t}\n\t}, [ datetime ] );\n\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst dateSettings = getDateSettings();\n\tconst [ siteFormat = dateSettings.formats.date ] = useEntityProp(\n\t\t'root',\n\t\t'site',\n\t\t'date_format'\n\t);\n\tconst [ siteTimeFormat = dateSettings.formats.time ] = useEntityProp(\n\t\t'root',\n\t\t'site',\n\t\t'time_format'\n\t);\n\n\tconst postType = useSelect(\n\t\t( select ) =>\n\t\t\tpostTypeSlug\n\t\t\t\t? select( coreStore ).getPostType( postTypeSlug )\n\t\t\t\t: null,\n\t\t[ postTypeSlug ]\n\t);\n\n\tlet postDate = (\n\t\t<time dateTime={ dateI18n( 'c', datetime ) } ref={ setPopoverAnchor }>\n\t\t\t{ format === 'human-diff'\n\t\t\t\t? humanTimeDiff( datetime )\n\t\t\t\t: dateI18n( format || siteFormat, datetime ) }\n\t\t</time>\n\t);\n\n\tif ( isLink && datetime ) {\n\t\tpostDate = (\n\t\t\t<a\n\t\t\t\thref=\"#post-date-pseudo-link\"\n\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t>\n\t\t\t\t{ postDate }\n\t\t\t</a>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t\t{ displayType !== 'modified' && ! isDescendentOfQueryLoop && (\n\t\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t\t\t<PublishDateTimePicker\n\t\t\t\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\t\t\t\tdisplayType === 'date'\n\t\t\t\t\t\t\t\t\t\t\t? __( 'Publish Date' )\n\t\t\t\t\t\t\t\t\t\t\t: __( 'Date' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcurrentDate={ datetime }\n\t\t\t\t\t\t\t\t\tonChange={ ( newDatetime ) =>\n\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\tdatetime: newDatetime,\n\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tis12Hour={ is12HourFormat(\n\t\t\t\t\t\t\t\t\t\tsiteTimeFormat\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t\t\tdateOrder={\n\t\t\t\t\t\t\t\t\t\t/* translators: Order of day, month, and year. Available formats are 'dmy', 'mdy', and 'ymd'. */\n\t\t\t\t\t\t\t\t\t\t_x( 'dmy', 'date order' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => {\n\t\t\t\t\t\t\t\tconst openOnArrowDown = ( event ) => {\n\t\t\t\t\t\t\t\t\tif ( ! isOpen && event.keyCode === DOWN ) {\n\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\tonToggle();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t\t\t\t\ticon={ edit }\n\t\t\t\t\t\t\t\t\t\ttitle={ __( 'Change Date' ) }\n\t\t\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\t\t\tonKeyDown={ openOnArrowDown }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t) }\n\t\t\t</BlockControls>\n\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tdatetime: undefined,\n\t\t\t\t\t\t\tformat: undefined,\n\t\t\t\t\t\t\tisLink: false,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => !! format }\n\t\t\t\t\t\tlabel={ __( 'Date Format' ) }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { format: undefined } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<DateFormatPicker\n\t\t\t\t\t\t\tformat={ format }\n\t\t\t\t\t\t\tdefaultFormat={ siteFormat }\n\t\t\t\t\t\t\tonChange={ ( nextFormat ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { format: nextFormat } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => isLink !== false }\n\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\tpostType?.labels.singular_name\n\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: Name of the post type e.g: \"post\".\n\t\t\t\t\t\t\t\t\t\t__( 'Link to %s' ),\n\t\t\t\t\t\t\t\t\t\tpostType.labels.singular_name.toLowerCase()\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: __( 'Link to post' )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { isLink: false } ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tpostType?.labels.singular_name\n\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t// translators: %s: Name of the post type e.g: \"post\".\n\t\t\t\t\t\t\t\t\t\t\t__( 'Link to %s' ),\n\t\t\t\t\t\t\t\t\t\t\tpostType.labels.singular_name.toLowerCase()\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: __( 'Link to post' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { isLink: ! isLink } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\n\t\t\t<div { ...blockProps }>{ postDate }</div>\n\t\t</>\n\t);\n}\n\nexport function is12HourFormat( format ) {\n\t// To know if the time format is a 12 hour time, look for any of the 12 hour\n\t// format characters: 'a', 'A', 'g', and 'h'. The character must be\n\t// unescaped, i.e. not preceded by a '\\'. Coincidentally, 'aAgh' is how I\n\t// feel when working with regular expressions.\n\t// https://www.php.net/manual/en/datetime.format.php\n\treturn /(?:^|[^\\\\])[aAgh]/.test( format );\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,YAAA,GAAAJ,OAAA;AASA,IAAAK,WAAA,GAAAL,OAAA;AAQA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AAKA,IAAAU,MAAA,GAAAV,OAAA;AAAgE,IAAAW,WAAA,GAAAX,OAAA;AAxChE;AACA;AACA;;AAGA;AACA;AACA;;AA8BA;AACA;AACA;;AAGe,SAASY,YAAYA,CAAE;EACrCC,UAAU,EAAE;IAAEC,QAAQ;IAAEC,SAAS;IAAEC,MAAM;IAAEC,MAAM;IAAEC;EAAS,CAAC;EAC7DC,OAAO,EAAE;IAAEC,QAAQ,EAAEC,YAAY;IAAEC;EAAQ,CAAC;EAC5CC;AACD,CAAC,EAAG;EACH,MAAMC,WAAW,GAChBN,QAAQ,EAAEO,QAAQ,EAAEX,QAAQ,EAAEY,MAAM,KAAK,gBAAgB,IACzDR,QAAQ,EAAEO,QAAQ,EAAEX,QAAQ,EAAEa,IAAI,EAAEC,GAAG;EAExC,MA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,CAAAoD,GAAA,EAAC1D,WAAA,CAAAkH,aAAa;YACbC,uBAAuB;YACvBd,KAAK,EACJtF,QAAQ,EAAE+F,MAAM,CAACC,aAAa,GAC3B,IAAAC,aAAO;YACP;YACA,IAAA9B,QAAE,EAAE,YAAa,CAAC,EAClBnE,QAAQ,CAAC+F,MAAM,CAACC,aAAa,CAACE,WAAW,CAAC,CAC1C,CAAC,GACD,IAAA/B,QAAE,EAAE,cAAe,CACtB;YACDR,QAAQ,EAAGA,CAAA,KACVxD,aAAa,CAAE;cAAEN,MAAM,EAAE,CAAEA;YAAO,CAAE,CACpC;YACDwG,OAAO,EAAGxG;UAAQ,CAClB;QAAC,CACa,CAAC;MAAA,CACN;IAAC,CACK,CAAC,eAEpB,IAAAN,WAAA,CAAAoD,GAAA;MAAA,GAAUlC,UAAU;MAAAsC,QAAA,EAAKL;IAAQ,CAAO,CAAC;EAAA,CACxC,CAAC;AAEL;AAEO,SAAS6B,cAAcA,CAAE3E,MAAM,EAAG;EACxC;EACA;EACA;EACA;EACA;EACA,OAAO,mBAAmB,CAAC0G,IAAI,CAAE1G,MAAO,CAAC;AAC1C","ignoreList":[]}
@@ -25,6 +25,10 @@ const metadata = exports.metadata = {
25
25
  description: "Display the publish date for an entry such as a post or page.",
26
26
  textdomain: "default",
27
27
  attributes: {
28
+ datetime: {
29
+ type: "string",
30
+ role: "content"
31
+ },
28
32
  textAlign: {
29
33
  type: "string"
30
34
  },
@@ -35,10 +39,6 @@ const metadata = exports.metadata = {
35
39
  type: "boolean",
36
40
  "default": false,
37
41
  role: "content"
38
- },
39
- displayType: {
40
- type: "string",
41
- "default": "date"
42
42
  }
43
43
  },
44
44
  usesContext: ["postId", "postType", "queryId"],
@@ -1 +1 @@
1
- {"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_edit","_deprecated","_variations","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","attributes","textAlign","type","format","isLink","role","displayType","usesContext","example","viewportWidth","supports","html","color","gradients","link","__experimentalDefaultControls","background","text","spacing","margin","padding","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","interactivity","clientNavigation","__experimentalBorder","radius","width","style","settings","icon","edit","deprecated","variations","init","initBlock"],"sources":["@wordpress/block-library/src/post-date/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postDate as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport deprecated from './deprecated';\nimport variations from './variations';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tdeprecated,\n\tvariations,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,WAAA,GAAAH,sBAAA,CAAAF,OAAA;AAZA;AACA;AACA;AAGA;AACA;AACA;AAFA,MAAAM,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,SAAA;MAAAC,IAAA;IAAA;IAAAC,MAAA;MAAAD,IAAA;IAAA;IAAAE,MAAA;MAAAF,IAAA;MAAA;MAAAG,IAAA;IAAA;IAAAC,WAAA;MAAAJ,IAAA;MAAA;IAAA;EAAA;EAAAK,WAAA;EAAAC,OAAA;IAAAC,aAAA;EAAA;EAAAC,QAAA;IAAAC,IAAA;IAAAC,KAAA;MAAAC,SAAA;MAAAC,IAAA;MAAAC,6BAAA;QAAAC,UAAA;QAAAC,IAAA;QAAAH,IAAA;MAAA;IAAA;IAAAI,OAAA;MAAAC,MAAA;MAAAC,OAAA;IAAA;IAAAC,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;MAAAd,6BAAA;QAAAO,QAAA;MAAA;IAAA;IAAAQ,aAAA;MAAAC,gBAAA;IAAA;IAAAC,oBAAA;MAAAC,MAAA;MAAArB,KAAA;MAAAsB,KAAA;MAAAC,KAAA;MAAApB,6BAAA;QAAAkB,MAAA;QAAArB,KAAA;QAAAsB,KAAA;QAAAC,KAAA;MAAA;IAAA;EAAA;AAAA;AASA,MAAM;EAAExC;AAAK,CAAC,GAAGJ,QAAQ;AAACC,OAAA,CAAAG,IAAA,GAAAA,IAAA;AAGnB,MAAMyC,QAAQ,GAAA5C,OAAA,CAAA4C,QAAA,GAAG;EACvBC,IAAI,EAAJA,eAAI;EACJC,IAAI,EAAJA,aAAI;EACJC,UAAU,EAAVA,mBAAU;EACVC,UAAU,EAAVA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAE/C,IAAI;EAAEJ,QAAQ;EAAE6C;AAAS,CAAE,CAAC;AAAC5C,OAAA,CAAAiD,IAAA,GAAAA,IAAA","ignoreList":[]}
1
+ {"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_edit","_deprecated","_variations","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","attributes","datetime","type","role","textAlign","format","isLink","usesContext","example","viewportWidth","supports","html","color","gradients","link","__experimentalDefaultControls","background","text","spacing","margin","padding","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","interactivity","clientNavigation","__experimentalBorder","radius","width","style","settings","icon","edit","deprecated","variations","init","initBlock"],"sources":["@wordpress/block-library/src/post-date/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postDate as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport deprecated from './deprecated';\nimport variations from './variations';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tdeprecated,\n\tvariations,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,WAAA,GAAAH,sBAAA,CAAAF,OAAA;AAZA;AACA;AACA;AAGA;AACA;AACA;AAFA,MAAAM,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,QAAA;MAAAC,IAAA;MAAAC,IAAA;IAAA;IAAAC,SAAA;MAAAF,IAAA;IAAA;IAAAG,MAAA;MAAAH,IAAA;IAAA;IAAAI,MAAA;MAAAJ,IAAA;MAAA;MAAAC,IAAA;IAAA;EAAA;EAAAI,WAAA;EAAAC,OAAA;IAAAC,aAAA;EAAA;EAAAC,QAAA;IAAAC,IAAA;IAAAC,KAAA;MAAAC,SAAA;MAAAC,IAAA;MAAAC,6BAAA;QAAAC,UAAA;QAAAC,IAAA;QAAAH,IAAA;MAAA;IAAA;IAAAI,OAAA;MAAAC,MAAA;MAAAC,OAAA;IAAA;IAAAC,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;MAAAd,6BAAA;QAAAO,QAAA;MAAA;IAAA;IAAAQ,aAAA;MAAAC,gBAAA;IAAA;IAAAC,oBAAA;MAAAC,MAAA;MAAArB,KAAA;MAAAsB,KAAA;MAAAC,KAAA;MAAApB,6BAAA;QAAAkB,MAAA;QAAArB,KAAA;QAAAsB,KAAA;QAAAC,KAAA;MAAA;IAAA;EAAA;AAAA;AASA,MAAM;EAAExC;AAAK,CAAC,GAAGJ,QAAQ;AAACC,OAAA,CAAAG,IAAA,GAAAA,IAAA;AAGnB,MAAMyC,QAAQ,GAAA5C,OAAA,CAAA4C,QAAA,GAAG;EACvBC,IAAI,EAAJA,eAAI;EACJC,IAAI,EAAJA,aAAI;EACJC,UAAU,EAAVA,mBAAU;EACVC,UAAU,EAAVA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAE/C,IAAI;EAAEJ,QAAQ;EAAE6C;AAAS,CAAE,CAAC;AAAC5C,OAAA,CAAAiD,IAAA,GAAAA,IAAA","ignoreList":[]}
@@ -11,14 +11,43 @@ var _icons = require("@wordpress/icons");
11
11
  */
12
12
 
13
13
  const variations = [{
14
+ name: 'post-date',
15
+ title: (0, _i18n.__)('Post Date'),
16
+ description: (0, _i18n.__)("Display a post's publish date."),
17
+ attributes: {
18
+ metadata: {
19
+ bindings: {
20
+ datetime: {
21
+ source: 'core/post-data',
22
+ args: {
23
+ key: 'date'
24
+ }
25
+ }
26
+ }
27
+ }
28
+ },
29
+ scope: ['block', 'inserter', 'transform'],
30
+ isActive: blockAttributes => blockAttributes?.metadata?.bindings?.datetime?.source === 'core/post-data' && blockAttributes?.metadata?.bindings?.datetime?.args?.key === 'date',
31
+ icon: _icons.postDate
32
+ }, {
14
33
  name: 'post-date-modified',
15
34
  title: (0, _i18n.__)('Modified Date'),
16
35
  description: (0, _i18n.__)("Display a post's last updated date."),
17
36
  attributes: {
18
- displayType: 'modified'
37
+ metadata: {
38
+ bindings: {
39
+ datetime: {
40
+ source: 'core/post-data',
41
+ args: {
42
+ key: 'modified'
43
+ }
44
+ }
45
+ }
46
+ },
47
+ className: 'wp-block-post-date__modified-date'
19
48
  },
20
- scope: ['block', 'inserter'],
21
- isActive: blockAttributes => blockAttributes.displayType === 'modified',
49
+ scope: ['block', 'inserter', 'transform'],
50
+ isActive: blockAttributes => blockAttributes?.metadata?.bindings?.datetime?.source === 'core/post-data' && blockAttributes?.metadata?.bindings?.datetime?.args?.key === 'modified',
22
51
  icon: _icons.postDate
23
52
  }];
24
53
  var _default = exports.default = variations;
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_icons","variations","name","title","__","description","attributes","displayType","scope","isActive","blockAttributes","icon","postDate","_default","exports","default"],"sources":["@wordpress/block-library/src/post-date/variations.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { postDate } from '@wordpress/icons';\n\nconst variations = [\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: { displayType: 'modified' },\n\t\tscope: [ 'block', 'inserter' ],\n\t\tisActive: ( blockAttributes ) =>\n\t\t\tblockAttributes.displayType === 'modified',\n\t\ticon: postDate,\n\t},\n];\n\nexport default variations;\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA,MAAME,UAAU,GAAG,CAClB;EACCC,IAAI,EAAE,oBAAoB;EAC1BC,KAAK,EAAE,IAAAC,QAAE,EAAE,eAAgB,CAAC;EAC5BC,WAAW,EAAE,IAAAD,QAAE,EAAE,qCAAsC,CAAC;EACxDE,UAAU,EAAE;IAAEC,WAAW,EAAE;EAAW,CAAC;EACvCC,KAAK,EAAE,CAAE,OAAO,EAAE,UAAU,CAAE;EAC9BC,QAAQ,EAAIC,eAAe,IAC1BA,eAAe,CAACH,WAAW,KAAK,UAAU;EAC3CI,IAAI,EAAEC;AACP,CAAC,CACD;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEad,UAAU","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_icons","variations","name","title","__","description","attributes","metadata","bindings","datetime","source","args","key","scope","isActive","blockAttributes","icon","postDate","className","_default","exports","default"],"sources":["@wordpress/block-library/src/post-date/variations.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { postDate } from '@wordpress/icons';\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: { key: 'date' },\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tscope: [ 'block', '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?.key === 'date',\n\t\ticon: postDate,\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: { key: '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: [ 'block', '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\tblockA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IC,eAAe,IAC1BA,eAAe,EAAER,QAAQ,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,MAAM,KACpD,gBAAgB,IACjBK,eAAe,EAAER,QAAQ,EAAEC,QAAQ,EAAEC,QAAQ,EAAEE,IAAI,EAAEC,GAAG,KACvD,UAAU;EACZI,IAAI,EAAEC;AACP,CAAC,CACD;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEapB,UAAU","ignoreList":[]}
@@ -20,175 +20,175 @@ const variations = [{
20
20
  attributes: {
21
21
  service: 'wordpress'
22
22
  },
23
- title: (0, _i18n.__)('WordPress'),
23
+ title: (0, _i18n._x)('WordPress', 'social link block variation name'),
24
24
  icon: _icons.WordPressIcon
25
25
  }, {
26
26
  name: 'fivehundredpx',
27
27
  attributes: {
28
28
  service: 'fivehundredpx'
29
29
  },
30
- title: (0, _i18n.__)('500px'),
30
+ title: (0, _i18n._x)('500px', 'social link block variation name'),
31
31
  icon: _icons.FivehundredpxIcon
32
32
  }, {
33
33
  name: 'amazon',
34
34
  attributes: {
35
35
  service: 'amazon'
36
36
  },
37
- title: (0, _i18n.__)('Amazon'),
37
+ title: (0, _i18n._x)('Amazon', 'social link block variation name'),
38
38
  icon: _icons.AmazonIcon
39
39
  }, {
40
40
  name: 'bandcamp',
41
41
  attributes: {
42
42
  service: 'bandcamp'
43
43
  },
44
- title: (0, _i18n.__)('Bandcamp'),
44
+ title: (0, _i18n._x)('Bandcamp', 'social link block variation name'),
45
45
  icon: _icons.BandcampIcon
46
46
  }, {
47
47
  name: 'behance',
48
48
  attributes: {
49
49
  service: 'behance'
50
50
  },
51
- title: (0, _i18n.__)('Behance'),
51
+ title: (0, _i18n._x)('Behance', 'social link block variation name'),
52
52
  icon: _icons.BehanceIcon
53
53
  }, {
54
54
  name: 'bluesky',
55
55
  attributes: {
56
56
  service: 'bluesky'
57
57
  },
58
- title: (0, _i18n.__)('Bluesky'),
58
+ title: (0, _i18n._x)('Bluesky', 'social link block variation name'),
59
59
  icon: _icons.BlueskyIcon
60
60
  }, {
61
61
  name: 'chain',
62
62
  attributes: {
63
63
  service: 'chain'
64
64
  },
65
- title: (0, _i18n.__)('Link'),
65
+ title: (0, _i18n._x)('Link', 'social link block variation name'),
66
66
  icon: _icons.ChainIcon
67
67
  }, {
68
68
  name: 'codepen',
69
69
  attributes: {
70
70
  service: 'codepen'
71
71
  },
72
- title: (0, _i18n.__)('CodePen'),
72
+ title: (0, _i18n._x)('CodePen', 'social link block variation name'),
73
73
  icon: _icons.CodepenIcon
74
74
  }, {
75
75
  name: 'deviantart',
76
76
  attributes: {
77
77
  service: 'deviantart'
78
78
  },
79
- title: (0, _i18n.__)('DeviantArt'),
79
+ title: (0, _i18n._x)('DeviantArt', 'social link block variation name'),
80
80
  icon: _icons.DeviantArtIcon
81
81
  }, {
82
82
  name: 'discord',
83
83
  attributes: {
84
84
  service: 'discord'
85
85
  },
86
- title: (0, _i18n.__)('Discord'),
86
+ title: (0, _i18n._x)('Discord', 'social link block variation name'),
87
87
  icon: _icons.DiscordIcon
88
88
  }, {
89
89
  name: 'dribbble',
90
90
  attributes: {
91
91
  service: 'dribbble'
92
92
  },
93
- title: (0, _i18n.__)('Dribbble'),
93
+ title: (0, _i18n._x)('Dribbble', 'social link block variation name'),
94
94
  icon: _icons.DribbbleIcon
95
95
  }, {
96
96
  name: 'dropbox',
97
97
  attributes: {
98
98
  service: 'dropbox'
99
99
  },
100
- title: (0, _i18n.__)('Dropbox'),
100
+ title: (0, _i18n._x)('Dropbox', 'social link block variation name'),
101
101
  icon: _icons.DropboxIcon
102
102
  }, {
103
103
  name: 'etsy',
104
104
  attributes: {
105
105
  service: 'etsy'
106
106
  },
107
- title: (0, _i18n.__)('Etsy'),
107
+ title: (0, _i18n._x)('Etsy', 'social link block variation name'),
108
108
  icon: _icons.EtsyIcon
109
109
  }, {
110
110
  name: 'facebook',
111
111
  attributes: {
112
112
  service: 'facebook'
113
113
  },
114
- title: (0, _i18n.__)('Facebook'),
114
+ title: (0, _i18n._x)('Facebook', 'social link block variation name'),
115
115
  icon: _icons.FacebookIcon
116
116
  }, {
117
117
  name: 'feed',
118
118
  attributes: {
119
119
  service: 'feed'
120
120
  },
121
- title: (0, _i18n.__)('RSS Feed'),
121
+ title: (0, _i18n._x)('RSS Feed', 'social link block variation name'),
122
122
  icon: _icons.FeedIcon
123
123
  }, {
124
124
  name: 'flickr',
125
125
  attributes: {
126
126
  service: 'flickr'
127
127
  },
128
- title: (0, _i18n.__)('Flickr'),
128
+ title: (0, _i18n._x)('Flickr', 'social link block variation name'),
129
129
  icon: _icons.FlickrIcon
130
130
  }, {
131
131
  name: 'foursquare',
132
132
  attributes: {
133
133
  service: 'foursquare'
134
134
  },
135
- title: (0, _i18n.__)('Foursquare'),
135
+ title: (0, _i18n._x)('Foursquare', 'social link block variation name'),
136
136
  icon: _icons.FoursquareIcon
137
137
  }, {
138
138
  name: 'goodreads',
139
139
  attributes: {
140
140
  service: 'goodreads'
141
141
  },
142
- title: (0, _i18n.__)('Goodreads'),
142
+ title: (0, _i18n._x)('Goodreads', 'social link block variation name'),
143
143
  icon: _icons.GoodreadsIcon
144
144
  }, {
145
145
  name: 'google',
146
146
  attributes: {
147
147
  service: 'google'
148
148
  },
149
- title: (0, _i18n.__)('Google'),
149
+ title: (0, _i18n._x)('Google', 'social link block variation name'),
150
150
  icon: _icons.GoogleIcon
151
151
  }, {
152
152
  name: 'github',
153
153
  attributes: {
154
154
  service: 'github'
155
155
  },
156
- title: (0, _i18n.__)('GitHub'),
156
+ title: (0, _i18n._x)('GitHub', 'social link block variation name'),
157
157
  icon: _icons.GitHubIcon
158
158
  }, {
159
159
  name: 'gravatar',
160
160
  attributes: {
161
161
  service: 'gravatar'
162
162
  },
163
- title: (0, _i18n.__)('Gravatar'),
163
+ title: (0, _i18n._x)('Gravatar', 'social link block variation name'),
164
164
  icon: _icons.GravatarIcon
165
165
  }, {
166
166
  name: 'instagram',
167
167
  attributes: {
168
168
  service: 'instagram'
169
169
  },
170
- title: (0, _i18n.__)('Instagram'),
170
+ title: (0, _i18n._x)('Instagram', 'social link block variation name'),
171
171
  icon: _icons.InstagramIcon
172
172
  }, {
173
173
  name: 'lastfm',
174
174
  attributes: {
175
175
  service: 'lastfm'
176
176
  },
177
- title: (0, _i18n.__)('Last.fm'),
177
+ title: (0, _i18n._x)('Last.fm', 'social link block variation name'),
178
178
  icon: _icons.LastfmIcon
179
179
  }, {
180
180
  name: 'linkedin',
181
181
  attributes: {
182
182
  service: 'linkedin'
183
183
  },
184
- title: (0, _i18n.__)('LinkedIn'),
184
+ title: (0, _i18n._x)('LinkedIn', 'social link block variation name'),
185
185
  icon: _icons.LinkedInIcon
186
186
  }, {
187
187
  name: 'mail',
188
188
  attributes: {
189
189
  service: 'mail'
190
190
  },
191
- title: (0, _i18n.__)('Mail'),
191
+ title: (0, _i18n._x)('Mail', 'social link block variation name'),
192
192
  keywords: ['email', 'e-mail'],
193
193
  icon: _icons.MailIcon
194
194
  }, {
@@ -196,140 +196,142 @@ const variations = [{
196
196
  attributes: {
197
197
  service: 'mastodon'
198
198
  },
199
- title: (0, _i18n.__)('Mastodon'),
199
+ title: (0, _i18n._x)('Mastodon', 'social link block variation name'),
200
200
  icon: _icons.MastodonIcon
201
201
  }, {
202
202
  name: 'meetup',
203
203
  attributes: {
204
204
  service: 'meetup'
205
205
  },
206
- title: (0, _i18n.__)('Meetup'),
206
+ title: (0, _i18n._x)('Meetup', 'social link block variation name'),
207
207
  icon: _icons.MeetupIcon
208
208
  }, {
209
209
  name: 'medium',
210
210
  attributes: {
211
211
  service: 'medium'
212
212
  },
213
- title: (0, _i18n.__)('Medium'),
213
+ title: (0, _i18n._x)('Medium', 'social link block variation name'),
214
214
  icon: _icons.MediumIcon
215
215
  }, {
216
216
  name: 'patreon',
217
217
  attributes: {
218
218
  service: 'patreon'
219
219
  },
220
- title: (0, _i18n.__)('Patreon'),
220
+ title: (0, _i18n._x)('Patreon', 'social link block variation name'),
221
221
  icon: _icons.PatreonIcon
222
222
  }, {
223
223
  name: 'pinterest',
224
224
  attributes: {
225
225
  service: 'pinterest'
226
226
  },
227
- title: (0, _i18n.__)('Pinterest'),
227
+ title: (0, _i18n._x)('Pinterest', 'social link block variation name'),
228
228
  icon: _icons.PinterestIcon
229
229
  }, {
230
230
  name: 'pocket',
231
231
  attributes: {
232
232
  service: 'pocket'
233
233
  },
234
- title: (0, _i18n.__)('Pocket'),
234
+ title: (0, _i18n._x)('Pocket', 'social link block variation name'),
235
235
  icon: _icons.PocketIcon
236
236
  }, {
237
237
  name: 'reddit',
238
238
  attributes: {
239
239
  service: 'reddit'
240
240
  },
241
- title: (0, _i18n.__)('Reddit'),
241
+ title: (0, _i18n._x)('Reddit', 'social link block variation name'),
242
242
  icon: _icons.RedditIcon
243
243
  }, {
244
244
  name: 'skype',
245
245
  attributes: {
246
246
  service: 'skype'
247
247
  },
248
- title: (0, _i18n.__)('Skype'),
249
- icon: _icons.SkypeIcon
248
+ title: (0, _i18n._x)('Skype', 'social link block variation name'),
249
+ icon: _icons.SkypeIcon,
250
+ // Deprecated: Skype service is no longer available.
251
+ scope: []
250
252
  }, {
251
253
  name: 'snapchat',
252
254
  attributes: {
253
255
  service: 'snapchat'
254
256
  },
255
- title: (0, _i18n.__)('Snapchat'),
257
+ title: (0, _i18n._x)('Snapchat', 'social link block variation name'),
256
258
  icon: _icons.SnapchatIcon
257
259
  }, {
258
260
  name: 'soundcloud',
259
261
  attributes: {
260
262
  service: 'soundcloud'
261
263
  },
262
- title: (0, _i18n.__)('SoundCloud'),
264
+ title: (0, _i18n._x)('SoundCloud', 'social link block variation name'),
263
265
  icon: _icons.SoundCloudIcon
264
266
  }, {
265
267
  name: 'spotify',
266
268
  attributes: {
267
269
  service: 'spotify'
268
270
  },
269
- title: (0, _i18n.__)('Spotify'),
271
+ title: (0, _i18n._x)('Spotify', 'social link block variation name'),
270
272
  icon: _icons.SpotifyIcon
271
273
  }, {
272
274
  name: 'telegram',
273
275
  attributes: {
274
276
  service: 'telegram'
275
277
  },
276
- title: (0, _i18n.__)('Telegram'),
278
+ title: (0, _i18n._x)('Telegram', 'social link block variation name'),
277
279
  icon: _icons.TelegramIcon
278
280
  }, {
279
281
  name: 'threads',
280
282
  attributes: {
281
283
  service: 'threads'
282
284
  },
283
- title: (0, _i18n.__)('Threads'),
285
+ title: (0, _i18n._x)('Threads', 'social link block variation name'),
284
286
  icon: _icons.ThreadsIcon
285
287
  }, {
286
288
  name: 'tiktok',
287
289
  attributes: {
288
290
  service: 'tiktok'
289
291
  },
290
- title: (0, _i18n.__)('TikTok'),
292
+ title: (0, _i18n._x)('TikTok', 'social link block variation name'),
291
293
  icon: _icons.TiktokIcon
292
294
  }, {
293
295
  name: 'tumblr',
294
296
  attributes: {
295
297
  service: 'tumblr'
296
298
  },
297
- title: (0, _i18n.__)('Tumblr'),
299
+ title: (0, _i18n._x)('Tumblr', 'social link block variation name'),
298
300
  icon: _icons.TumblrIcon
299
301
  }, {
300
302
  name: 'twitch',
301
303
  attributes: {
302
304
  service: 'twitch'
303
305
  },
304
- title: (0, _i18n.__)('Twitch'),
306
+ title: (0, _i18n._x)('Twitch', 'social link block variation name'),
305
307
  icon: _icons.TwitchIcon
306
308
  }, {
307
309
  name: 'twitter',
308
310
  attributes: {
309
311
  service: 'twitter'
310
312
  },
311
- title: (0, _i18n.__)('Twitter'),
313
+ title: (0, _i18n._x)('Twitter', 'social link block variation name'),
312
314
  icon: _icons.TwitterIcon
313
315
  }, {
314
316
  name: 'vimeo',
315
317
  attributes: {
316
318
  service: 'vimeo'
317
319
  },
318
- title: (0, _i18n.__)('Vimeo'),
320
+ title: (0, _i18n._x)('Vimeo', 'social link block variation name'),
319
321
  icon: _icons.VimeoIcon
320
322
  }, {
321
323
  name: 'vk',
322
324
  attributes: {
323
325
  service: 'vk'
324
326
  },
325
- title: (0, _i18n.__)('VK'),
327
+ title: (0, _i18n._x)('VK', 'social link block variation name'),
326
328
  icon: _icons.VkIcon
327
329
  }, {
328
330
  name: 'whatsapp',
329
331
  attributes: {
330
332
  service: 'whatsapp'
331
333
  },
332
- title: (0, _i18n.__)('WhatsApp'),
334
+ title: (0, _i18n._x)('WhatsApp', 'social link block variation name'),
333
335
  icon: _icons.WhatsAppIcon
334
336
  }, {
335
337
  name: 'x',
@@ -337,21 +339,21 @@ const variations = [{
337
339
  service: 'x'
338
340
  },
339
341
  keywords: ['twitter'],
340
- title: (0, _i18n.__)('X'),
342
+ title: (0, _i18n._x)('X', 'social link block variation name'),
341
343
  icon: _icons.XIcon
342
344
  }, {
343
345
  name: 'yelp',
344
346
  attributes: {
345
347
  service: 'yelp'
346
348
  },
347
- title: (0, _i18n.__)('Yelp'),
349
+ title: (0, _i18n._x)('Yelp', 'social link block variation name'),
348
350
  icon: _icons.YelpIcon
349
351
  }, {
350
352
  name: 'youtube',
351
353
  attributes: {
352
354
  service: 'youtube'
353
355
  },
354
- title: (0, _i18n.__)('YouTube'),
356
+ title: (0, _i18n._x)('YouTube', 'social link block variation name'),
355
357
  icon: _icons.YouTubeIcon
356
358
  }];
357
359