@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.
- package/build/categories/edit.js +15 -3
- package/build/categories/edit.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +4 -2
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/file/edit.js +2 -1
- package/build/file/edit.js.map +1 -1
- package/build/latest-posts/edit.js +0 -2
- package/build/latest-posts/edit.js.map +1 -1
- package/build/paragraph/edit.js +2 -2
- package/build/paragraph/edit.js.map +1 -1
- package/build/post-date/deprecated.js +104 -1
- package/build/post-date/deprecated.js.map +1 -1
- package/build/post-date/edit.js +32 -32
- package/build/post-date/edit.js.map +1 -1
- package/build/post-date/index.js +4 -4
- package/build/post-date/index.js.map +1 -1
- package/build/post-date/variations.js +32 -3
- package/build/post-date/variations.js.map +1 -1
- package/build/social-link/variations.js +51 -49
- package/build/social-link/variations.js.map +1 -1
- package/build/utils/poster-image.js +93 -0
- package/build/utils/poster-image.js.map +1 -0
- package/build/video/edit.js +6 -2
- package/build/video/edit.js.map +1 -1
- package/build-module/categories/edit.js +15 -3
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +4 -2
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/file/edit.js +2 -1
- package/build-module/file/edit.js.map +1 -1
- package/build-module/latest-posts/edit.js +0 -2
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/paragraph/edit.js +2 -2
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/post-date/deprecated.js +104 -1
- package/build-module/post-date/deprecated.js.map +1 -1
- package/build-module/post-date/edit.js +35 -35
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-date/index.js +4 -4
- package/build-module/post-date/index.js.map +1 -1
- package/build-module/post-date/variations.js +32 -3
- package/build-module/post-date/variations.js.map +1 -1
- package/build-module/social-link/variations.js +52 -50
- package/build-module/social-link/variations.js.map +1 -1
- package/build-module/utils/poster-image.js +85 -0
- package/build-module/utils/poster-image.js.map +1 -0
- package/build-module/video/edit.js +6 -2
- package/build-module/video/edit.js.map +1 -1
- package/build-style/editor-rtl.css +67 -10
- package/build-style/editor.css +67 -10
- package/build-style/navigation/editor-rtl.css +6 -6
- package/build-style/navigation/editor.css +6 -6
- package/build-style/page-list/editor-rtl.css +0 -4
- package/build-style/page-list/editor.css +0 -4
- package/build-style/style-rtl.css +1 -0
- package/build-style/style.css +1 -0
- package/build-style/video/style-rtl.css +1 -0
- package/build-style/video/style.css +1 -0
- package/package.json +35 -35
- package/src/categories/edit.js +13 -1
- package/src/cover/edit/inspector-controls.js +6 -2
- package/src/editor.scss +1 -0
- package/src/file/edit.js +4 -1
- package/src/latest-posts/edit.js +0 -2
- package/src/page-list/editor.scss +0 -6
- package/src/paragraph/edit.js +2 -2
- package/src/post-date/block.json +4 -4
- package/src/post-date/deprecated.js +104 -1
- package/src/post-date/edit.js +74 -86
- package/src/post-date/index.php +55 -28
- package/src/post-date/variations.js +37 -3
- package/src/social-link/README.md +21 -0
- package/src/social-link/index.php +49 -49
- package/src/social-link/variations.js +51 -49
- package/src/utils/poster-image.js +131 -0
- package/src/utils/poster-image.scss +75 -0
- package/src/video/edit.js +7 -2
- package/src/video/index.php +91 -0
- package/src/video/style.native.scss +1 -0
- package/src/video/style.scss +1 -0
- package/build/cover/edit/poster-image.js +0 -81
- package/build/cover/edit/poster-image.js.map +0 -1
- package/build/video/poster-image.js +0 -81
- package/build/video/poster-image.js.map +0 -1
- package/build-module/cover/edit/poster-image.js +0 -74
- package/build-module/cover/edit/poster-image.js.map +0 -1
- package/build-module/video/poster-image.js +0 -74
- package/build-module/video/poster-image.js.map +0 -1
- package/src/cover/edit/poster-image.js +0 -91
- package/src/video/poster-image.js +0 -91
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","isBlobURL","Disabled","Spinner","Placeholder","__experimentalToolsPanel","ToolsPanel","BlockControls","BlockIcon","InspectorControls","MediaPlaceholder","MediaReplaceFlow","useBlockProps","useRef","useEffect","useState","__","useDispatch","video","icon","store","noticesStore","PosterImage","createUpgradedEmbedBlock","useUploadMediaFromBlobURL","useToolsPanelDropdownMenuProps","VideoCommonSettings","TracksEditor","Tracks","Caption","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ALLOWED_MEDIA_TYPES","VideoEdit","isSelected","isSingleSelected","attributes","className","setAttributes","insertBlocksAfter","onReplace","videoPlayer","id","controls","poster","src","tracks","temporaryURL","setTemporaryURL","blob","dropdownMenuProps","url","allowedTypes","onChange","onSelectVideo","onError","onUploadError","current","load","media","undefined","caption","image","onSelectURL","newSrc","embedBlock","createErrorNotice","message","type","placeholder","content","withIllustration","label","instructions","children","classes","blockProps","onSelect","accept","value","newTracks","group","mediaId","mediaURL","onReset","resetAll","autoplay","loop","muted","playsInline","preload","isDisabled","ref","showToolbarButton"],"sources":["@wordpress/block-library/src/video/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { isBlobURL } from '@wordpress/blob';\nimport {\n\tDisabled,\n\tSpinner,\n\tPlaceholder,\n\t__experimentalToolsPanel as ToolsPanel,\n} from '@wordpress/components';\nimport {\n\tBlockControls,\n\tBlockIcon,\n\tInspectorControls,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { useRef, useEffect, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { video as icon } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport PosterImage from './poster-image';\nimport { createUpgradedEmbedBlock } from '../embed/util';\nimport {\n\tuseUploadMediaFromBlobURL,\n\tuseToolsPanelDropdownMenuProps,\n} from '../utils/hooks';\nimport VideoCommonSettings from './edit-common-settings';\nimport TracksEditor from './tracks-editor';\nimport Tracks from './tracks';\nimport { Caption } from '../utils/caption';\n\nconst ALLOWED_MEDIA_TYPES = [ 'video' ];\n\nfunction VideoEdit( {\n\tisSelected: isSingleSelected,\n\tattributes,\n\tclassName,\n\tsetAttributes,\n\tinsertBlocksAfter,\n\tonReplace,\n} ) {\n\tconst videoPlayer = useRef();\n\tconst { id, controls, poster, src, tracks } = attributes;\n\tconst [ temporaryURL, setTemporaryURL ] = useState( attributes.blob );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tuseUploadMediaFromBlobURL( {\n\t\turl: temporaryURL,\n\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\tonChange: onSelectVideo,\n\t\tonError: onUploadError,\n\t} );\n\n\tuseEffect( () => {\n\t\t// Placeholder may be rendered.\n\t\tif ( videoPlayer.current ) {\n\t\t\tvideoPlayer.current.load();\n\t\t}\n\t}, [ poster ] );\n\n\tfunction onSelectVideo( media ) {\n\t\tif ( ! media || ! media.url ) {\n\t\t\t// In this case there was an error\n\t\t\t// previous attributes should be removed\n\t\t\t// because they may be temporary blob urls.\n\t\t\tsetAttributes( {\n\t\t\t\tsrc: undefined,\n\t\t\t\tid: undefined,\n\t\t\t\tposter: undefined,\n\t\t\t\tcaption: undefined,\n\t\t\t\tblob: undefined,\n\t\t\t} );\n\t\t\tsetTemporaryURL();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isBlobURL( media.url ) ) {\n\t\t\tsetTemporaryURL( media.url );\n\t\t\treturn;\n\t\t}\n\n\t\t// Sets the block's attribute and updates the edit component from the\n\t\t// selected media.\n\t\tsetAttributes( {\n\t\t\tblob: undefined,\n\t\t\tsrc: media.url,\n\t\t\tid: media.id,\n\t\t\tposter:\n\t\t\t\tmedia.image?.src !== media.icon ? media.image?.src : undefined,\n\t\t\tcaption: media.caption,\n\t\t} );\n\t\tsetTemporaryURL();\n\t}\n\n\tfunction onSelectURL( newSrc ) {\n\t\tif ( newSrc !== src ) {\n\t\t\t// Check if there's an embed block that handles this URL.\n\t\t\tconst embedBlock = createUpgradedEmbedBlock( {\n\t\t\t\tattributes: { url: newSrc },\n\t\t\t} );\n\t\t\tif ( undefined !== embedBlock && onReplace ) {\n\t\t\t\tonReplace( embedBlock );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetAttributes( {\n\t\t\t\tblob: undefined,\n\t\t\t\tsrc: newSrc,\n\t\t\t\tid: undefined,\n\t\t\t\tposter: undefined,\n\t\t\t} );\n\t\t\tsetTemporaryURL();\n\t\t}\n\t}\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tfunction onUploadError( message ) {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t}\n\n\t// Much of this description is duplicated from MediaPlaceholder.\n\tconst placeholder = ( content ) => {\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\tclassName=\"block-editor-media-placeholder\"\n\t\t\t\twithIllustration={ ! isSingleSelected }\n\t\t\t\ticon={ icon }\n\t\t\t\tlabel={ __( 'Video' ) }\n\t\t\t\tinstructions={ __(\n\t\t\t\t\t'Drag and drop a video, upload, or choose from your library.'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ content }\n\t\t\t</Placeholder>\n\t\t);\n\t};\n\n\tconst classes = clsx( className, {\n\t\t'is-transient': !! temporaryURL,\n\t} );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classes,\n\t} );\n\n\tif ( ! src && ! temporaryURL ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<MediaPlaceholder\n\t\t\t\t\ticon={ <BlockIcon icon={ icon } /> }\n\t\t\t\t\tonSelect={ onSelectVideo }\n\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\taccept=\"video/*\"\n\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\tvalue={ attributes }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ isSingleSelected && (\n\t\t\t\t<>\n\t\t\t\t\t<BlockControls>\n\t\t\t\t\t\t<TracksEditor\n\t\t\t\t\t\t\ttracks={ tracks }\n\t\t\t\t\t\t\tonChange={ ( newTracks ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { tracks: newTracks } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\t\t\tmediaId={ id }\n\t\t\t\t\t\t\tmediaURL={ src }\n\t\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\t\taccept=\"video/*\"\n\t\t\t\t\t\t\tonSelect={ onSelectVideo }\n\t\t\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t\t\tonReset={ () => onSelectVideo( undefined ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t</>\n\t\t\t) }\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\tautoplay: false,\n\t\t\t\t\t\t\tcontrols: true,\n\t\t\t\t\t\t\tloop: false,\n\t\t\t\t\t\t\tmuted: false,\n\t\t\t\t\t\t\tplaysInline: false,\n\t\t\t\t\t\t\tpreload: 'metadata',\n\t\t\t\t\t\t\tposter: undefined,\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<VideoCommonSettings\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t/>\n\t\t\t\t\t<PosterImage\n\t\t\t\t\t\tposter={ poster }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<figure { ...blockProps }>\n\t\t\t\t{ /*\n Disable the video tag if the block is not selected\n so the user clicking on it won't play the\n video when the controls are enabled.\n */ }\n\t\t\t\t<Disabled isDisabled={ ! isSingleSelected }>\n\t\t\t\t\t<video\n\t\t\t\t\t\tcontrols={ controls }\n\t\t\t\t\t\tposter={ poster }\n\t\t\t\t\t\tsrc={ src || temporaryURL }\n\t\t\t\t\t\tref={ videoPlayer }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Tracks tracks={ tracks } />\n\t\t\t\t\t</video>\n\t\t\t\t</Disabled>\n\t\t\t\t{ !! temporaryURL && <Spinner /> }\n\t\t\t\t<Caption\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisSelected={ isSingleSelected }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tlabel={ __( 'Video caption text' ) }\n\t\t\t\t\tshowToolbarButton={ isSingleSelected }\n\t\t\t\t/>\n\t\t\t</figure>\n\t\t</>\n\t);\n}\n\nexport default VideoEdit;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,QAAQ,EACRC,OAAO,EACPC,WAAW,EACXC,wBAAwB,IAAIC,UAAU,QAChC,uBAAuB;AAC9B,SACCC,aAAa,EACbC,SAAS,EACTC,iBAAiB,EACjBC,gBAAgB,EAChBC,gBAAgB,EAChBC,aAAa,QACP,yBAAyB;AAChC,SAASC,MAAM,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,oBAAoB;AAChE,SAASC,EAAE,QAAQ,iBAAiB;AACpC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X0B,MAAM,EAAGA,MAAQ;UACjBN,aAAa,EAAGA;QAAe,CAC/B,CAAC;MAAA,CACS;IAAC,CACK,CAAC,eACpBP,KAAA;MAAA,GAAa6C,UAAU;MAAAF,QAAA,gBAMtB/C,IAAA,CAAC7B,QAAQ;QAAC6F,UAAU,EAAG,CAAExD,gBAAkB;QAAAuC,QAAA,eAC1C/C,IAAA;UACCgB,QAAQ,EAAGA,QAAU;UACrBC,MAAM,EAAGA,MAAQ;UACjBC,GAAG,EAAGA,GAAG,IAAIE,YAAc;UAC3B6C,GAAG,EAAGnD,WAAa;UAAAiC,QAAA,eAEnB/C,IAAA,CAACH,MAAM;YAACsB,MAAM,EAAGA;UAAQ,CAAE;QAAC,CACtB;MAAC,CACC,CAAC,EACT,CAAC,CAAEC,YAAY,iBAAIpB,IAAA,CAAC5B,OAAO,IAAE,CAAC,eAChC4B,IAAA,CAACF,OAAO;QACPW,UAAU,EAAGA,UAAY;QACzBE,aAAa,EAAGA,aAAe;QAC/BJ,UAAU,EAAGC,gBAAkB;QAC/BI,iBAAiB,EAAGA,iBAAmB;QACvCiC,KAAK,EAAG5D,EAAE,CAAE,oBAAqB,CAAG;QACpCiF,iBAAiB,EAAG1D;MAAkB,CACtC,CAAC;IAAA,CACK,CAAC;EAAA,CACR,CAAC;AAEL;AAEA,eAAeF,SAAS","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["clsx","isBlobURL","Disabled","Spinner","Placeholder","__experimentalToolsPanel","ToolsPanel","BlockControls","BlockIcon","InspectorControls","MediaPlaceholder","MediaReplaceFlow","useBlockProps","useRef","useEffect","useState","__","useDispatch","video","icon","store","noticesStore","createUpgradedEmbedBlock","useUploadMediaFromBlobURL","useToolsPanelDropdownMenuProps","VideoCommonSettings","TracksEditor","Tracks","Caption","PosterImage","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ALLOWED_MEDIA_TYPES","VideoEdit","isSelected","isSingleSelected","attributes","className","setAttributes","insertBlocksAfter","onReplace","videoPlayer","id","controls","poster","src","tracks","temporaryURL","setTemporaryURL","blob","dropdownMenuProps","url","allowedTypes","onChange","onSelectVideo","onError","onUploadError","current","load","media","undefined","caption","image","onSelectURL","newSrc","embedBlock","createErrorNotice","message","type","placeholder","content","withIllustration","label","instructions","children","classes","blockProps","onSelect","accept","value","newTracks","group","mediaId","mediaURL","onReset","resetAll","autoplay","loop","muted","playsInline","preload","posterImage","isDisabled","ref","showToolbarButton"],"sources":["@wordpress/block-library/src/video/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { isBlobURL } from '@wordpress/blob';\nimport {\n\tDisabled,\n\tSpinner,\n\tPlaceholder,\n\t__experimentalToolsPanel as ToolsPanel,\n} from '@wordpress/components';\nimport {\n\tBlockControls,\n\tBlockIcon,\n\tInspectorControls,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { useRef, useEffect, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { video as icon } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { createUpgradedEmbedBlock } from '../embed/util';\nimport {\n\tuseUploadMediaFromBlobURL,\n\tuseToolsPanelDropdownMenuProps,\n} from '../utils/hooks';\nimport VideoCommonSettings from './edit-common-settings';\nimport TracksEditor from './tracks-editor';\nimport Tracks from './tracks';\nimport { Caption } from '../utils/caption';\nimport PosterImage from '../utils/poster-image';\n\nconst ALLOWED_MEDIA_TYPES = [ 'video' ];\n\nfunction VideoEdit( {\n\tisSelected: isSingleSelected,\n\tattributes,\n\tclassName,\n\tsetAttributes,\n\tinsertBlocksAfter,\n\tonReplace,\n} ) {\n\tconst videoPlayer = useRef();\n\tconst { id, controls, poster, src, tracks } = attributes;\n\tconst [ temporaryURL, setTemporaryURL ] = useState( attributes.blob );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tuseUploadMediaFromBlobURL( {\n\t\turl: temporaryURL,\n\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\tonChange: onSelectVideo,\n\t\tonError: onUploadError,\n\t} );\n\n\tuseEffect( () => {\n\t\t// Placeholder may be rendered.\n\t\tif ( videoPlayer.current ) {\n\t\t\tvideoPlayer.current.load();\n\t\t}\n\t}, [ poster ] );\n\n\t// TODO: Whether the video was obtained from the media library or was provided by URL, obtain the `videoWidth` and `videoHeight` of the video once its metadata has loaded and persist in the block attributes.\n\tfunction onSelectVideo( media ) {\n\t\tif ( ! media || ! media.url ) {\n\t\t\t// In this case there was an error\n\t\t\t// previous attributes should be removed\n\t\t\t// because they may be temporary blob urls.\n\t\t\tsetAttributes( {\n\t\t\t\tsrc: undefined,\n\t\t\t\tid: undefined,\n\t\t\t\tposter: undefined,\n\t\t\t\tcaption: undefined,\n\t\t\t\tblob: undefined,\n\t\t\t} );\n\t\t\tsetTemporaryURL();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isBlobURL( media.url ) ) {\n\t\t\tsetTemporaryURL( media.url );\n\t\t\treturn;\n\t\t}\n\n\t\t// Sets the block's attribute and updates the edit component from the\n\t\t// selected media.\n\t\tsetAttributes( {\n\t\t\tblob: undefined,\n\t\t\tsrc: media.url,\n\t\t\tid: media.id,\n\t\t\tposter:\n\t\t\t\tmedia.image?.src !== media.icon ? media.image?.src : undefined,\n\t\t\tcaption: media.caption,\n\t\t} );\n\t\tsetTemporaryURL();\n\t}\n\n\tfunction onSelectURL( newSrc ) {\n\t\tif ( newSrc !== src ) {\n\t\t\t// Check if there's an embed block that handles this URL.\n\t\t\tconst embedBlock = createUpgradedEmbedBlock( {\n\t\t\t\tattributes: { url: newSrc },\n\t\t\t} );\n\t\t\tif ( undefined !== embedBlock && onReplace ) {\n\t\t\t\tonReplace( embedBlock );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetAttributes( {\n\t\t\t\tblob: undefined,\n\t\t\t\tsrc: newSrc,\n\t\t\t\tid: undefined,\n\t\t\t\tposter: undefined,\n\t\t\t} );\n\t\t\tsetTemporaryURL();\n\t\t}\n\t}\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tfunction onUploadError( message ) {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t}\n\n\t// Much of this description is duplicated from MediaPlaceholder.\n\tconst placeholder = ( content ) => {\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\tclassName=\"block-editor-media-placeholder\"\n\t\t\t\twithIllustration={ ! isSingleSelected }\n\t\t\t\ticon={ icon }\n\t\t\t\tlabel={ __( 'Video' ) }\n\t\t\t\tinstructions={ __(\n\t\t\t\t\t'Drag and drop a video, upload, or choose from your library.'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ content }\n\t\t\t</Placeholder>\n\t\t);\n\t};\n\n\tconst classes = clsx( className, {\n\t\t'is-transient': !! temporaryURL,\n\t} );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classes,\n\t} );\n\n\tif ( ! src && ! temporaryURL ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<MediaPlaceholder\n\t\t\t\t\ticon={ <BlockIcon icon={ icon } /> }\n\t\t\t\t\tonSelect={ onSelectVideo }\n\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\taccept=\"video/*\"\n\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\tvalue={ attributes }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ isSingleSelected && (\n\t\t\t\t<>\n\t\t\t\t\t<BlockControls>\n\t\t\t\t\t\t<TracksEditor\n\t\t\t\t\t\t\ttracks={ tracks }\n\t\t\t\t\t\t\tonChange={ ( newTracks ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { tracks: newTracks } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\t\t\tmediaId={ id }\n\t\t\t\t\t\t\tmediaURL={ src }\n\t\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\t\taccept=\"video/*\"\n\t\t\t\t\t\t\tonSelect={ onSelectVideo }\n\t\t\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t\t\tonReset={ () => onSelectVideo( undefined ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t</>\n\t\t\t) }\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\tautoplay: false,\n\t\t\t\t\t\t\tcontrols: true,\n\t\t\t\t\t\t\tloop: false,\n\t\t\t\t\t\t\tmuted: false,\n\t\t\t\t\t\t\tplaysInline: false,\n\t\t\t\t\t\t\tpreload: 'metadata',\n\t\t\t\t\t\t\tposter: undefined,\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<VideoCommonSettings\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t/>\n\t\t\t\t\t<PosterImage\n\t\t\t\t\t\tposter={ poster }\n\t\t\t\t\t\tonChange={ ( posterImage ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tposter: posterImage?.url,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<figure { ...blockProps }>\n\t\t\t\t{ /*\n Disable the video tag if the block is not selected\n so the user clicking on it won't play the\n video when the controls are enabled.\n */ }\n\t\t\t\t<Disabled isDisabled={ ! isSingleSelected }>\n\t\t\t\t\t<video\n\t\t\t\t\t\tcontrols={ controls }\n\t\t\t\t\t\tposter={ poster }\n\t\t\t\t\t\tsrc={ src || temporaryURL }\n\t\t\t\t\t\tref={ videoPlayer }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Tracks tracks={ tracks } />\n\t\t\t\t\t</video>\n\t\t\t\t</Disabled>\n\t\t\t\t{ !! temporaryURL && <Spinner /> }\n\t\t\t\t<Caption\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisSelected={ isSingleSelected }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tlabel={ __( 'Video caption text' ) }\n\t\t\t\t\tshowToolbarButton={ isSingleSelected }\n\t\t\t\t/>\n\t\t\t</figure>\n\t\t</>\n\t);\n}\n\nexport default VideoEdit;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,QAAQ,EACRC,OAAO,EACPC,WAAW,EACXC,wBAAwB,IAAIC,UAAU,QAChC,uBAAuB;AAC9B,SACCC,aAAa,EACbC,SAAS,EACTC,iBAAiB,EACjBC,gBAAgB,EAChBC,gBAAgB,EAChBC,aAAa,QACP,yBAAyB;AAChC,SAASC,MAAM,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,oBAAoB;AAChE,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,IAAI,QAAQ,kBAAkB;AAChD,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;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E;QACF,CACD,CAAC;MAAA,CACS;IAAC,CACK,CAAC,eACpBpB,KAAA;MAAA,GAAa6C,UAAU;MAAAF,QAAA,gBAMtB/C,IAAA,CAAC7B,QAAQ;QAAC8F,UAAU,EAAG,CAAEzD,gBAAkB;QAAAuC,QAAA,eAC1C/C,IAAA;UACCgB,QAAQ,EAAGA,QAAU;UACrBC,MAAM,EAAGA,MAAQ;UACjBC,GAAG,EAAGA,GAAG,IAAIE,YAAc;UAC3B8C,GAAG,EAAGpD,WAAa;UAAAiC,QAAA,eAEnB/C,IAAA,CAACJ,MAAM;YAACuB,MAAM,EAAGA;UAAQ,CAAE;QAAC,CACtB;MAAC,CACC,CAAC,EACT,CAAC,CAAEC,YAAY,iBAAIpB,IAAA,CAAC5B,OAAO,IAAE,CAAC,eAChC4B,IAAA,CAACH,OAAO;QACPY,UAAU,EAAGA,UAAY;QACzBE,aAAa,EAAGA,aAAe;QAC/BJ,UAAU,EAAGC,gBAAkB;QAC/BI,iBAAiB,EAAGA,iBAAmB;QACvCiC,KAAK,EAAG5D,EAAE,CAAE,oBAAqB,CAAG;QACpCkF,iBAAiB,EAAG3D;MAAkB,CACtC,CAAC;IAAA,CACK,CAAC;EAAA,CACR,CAAC;AAEL;AAEA,eAAeF,SAAS","ignoreList":[]}
|
|
@@ -1705,11 +1705,11 @@ figure.wp-block-image:not(.wp-block) {
|
|
|
1705
1705
|
|
|
1706
1706
|
.wp-block-navigation__responsive-container.is-menu-open {
|
|
1707
1707
|
position: fixed;
|
|
1708
|
-
top:
|
|
1708
|
+
top: 159px;
|
|
1709
1709
|
}
|
|
1710
1710
|
@media (min-width: 782px) {
|
|
1711
1711
|
.wp-block-navigation__responsive-container.is-menu-open {
|
|
1712
|
-
top:
|
|
1712
|
+
top: 97px;
|
|
1713
1713
|
}
|
|
1714
1714
|
}
|
|
1715
1715
|
@media (min-width: 782px) {
|
|
@@ -1725,21 +1725,21 @@ figure.wp-block-image:not(.wp-block) {
|
|
|
1725
1725
|
|
|
1726
1726
|
.is-mobile-preview .wp-block-navigation__responsive-container.is-menu-open,
|
|
1727
1727
|
.is-tablet-preview .wp-block-navigation__responsive-container.is-menu-open {
|
|
1728
|
-
top:
|
|
1728
|
+
top: 145px;
|
|
1729
1729
|
}
|
|
1730
1730
|
|
|
1731
1731
|
.is-fullscreen-mode .wp-block-navigation__responsive-container.is-menu-open {
|
|
1732
1732
|
right: 0;
|
|
1733
|
-
top:
|
|
1733
|
+
top: 159px;
|
|
1734
1734
|
}
|
|
1735
1735
|
@media (min-width: 782px) {
|
|
1736
1736
|
.is-fullscreen-mode .wp-block-navigation__responsive-container.is-menu-open {
|
|
1737
|
-
top:
|
|
1737
|
+
top: 65px;
|
|
1738
1738
|
}
|
|
1739
1739
|
}
|
|
1740
1740
|
.is-fullscreen-mode .is-mobile-preview .wp-block-navigation__responsive-container.is-menu-open,
|
|
1741
1741
|
.is-fullscreen-mode .is-tablet-preview .wp-block-navigation__responsive-container.is-menu-open {
|
|
1742
|
-
top:
|
|
1742
|
+
top: 113px;
|
|
1743
1743
|
}
|
|
1744
1744
|
|
|
1745
1745
|
body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-open {
|
|
@@ -2067,10 +2067,6 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
|
|
2067
2067
|
border-top: 3px dashed #ccc;
|
|
2068
2068
|
}
|
|
2069
2069
|
|
|
2070
|
-
.wp-block-navigation .wp-block-page-list > div,
|
|
2071
|
-
.wp-block-navigation .wp-block-page-list {
|
|
2072
|
-
background-color: inherit;
|
|
2073
|
-
}
|
|
2074
2070
|
.wp-block-navigation.items-justified-space-between .wp-block-page-list > div,
|
|
2075
2071
|
.wp-block-navigation.items-justified-space-between .wp-block-page-list {
|
|
2076
2072
|
display: contents;
|
|
@@ -2831,6 +2827,67 @@ div[data-type="core/post-featured-image"] img {
|
|
|
2831
2827
|
cursor: text;
|
|
2832
2828
|
}
|
|
2833
2829
|
|
|
2830
|
+
.block-library-poster-image__container {
|
|
2831
|
+
position: relative;
|
|
2832
|
+
}
|
|
2833
|
+
.block-library-poster-image__container:hover .block-library-poster-image__actions, .block-library-poster-image__container:focus .block-library-poster-image__actions, .block-library-poster-image__container:focus-within .block-library-poster-image__actions {
|
|
2834
|
+
opacity: 1;
|
|
2835
|
+
}
|
|
2836
|
+
.block-library-poster-image__container .block-library-poster-image__actions.block-library-poster-image__actions-select {
|
|
2837
|
+
opacity: 1;
|
|
2838
|
+
margin-top: 16px;
|
|
2839
|
+
}
|
|
2840
|
+
|
|
2841
|
+
.block-library-poster-image__toggle,
|
|
2842
|
+
.block-library-poster-image__preview {
|
|
2843
|
+
width: 100%;
|
|
2844
|
+
padding: 0;
|
|
2845
|
+
overflow: hidden;
|
|
2846
|
+
outline-offset: -1px;
|
|
2847
|
+
min-height: 40px;
|
|
2848
|
+
display: flex;
|
|
2849
|
+
justify-content: center;
|
|
2850
|
+
}
|
|
2851
|
+
|
|
2852
|
+
.block-library-poster-image__preview {
|
|
2853
|
+
height: auto !important;
|
|
2854
|
+
outline: 1px solid rgba(0, 0, 0, 0.1);
|
|
2855
|
+
}
|
|
2856
|
+
.block-library-poster-image__preview .block-library-poster-image__preview-image {
|
|
2857
|
+
object-fit: cover;
|
|
2858
|
+
width: 100%;
|
|
2859
|
+
object-position: 50% 50%;
|
|
2860
|
+
aspect-ratio: 2/1;
|
|
2861
|
+
}
|
|
2862
|
+
|
|
2863
|
+
.block-library-poster-image__toggle {
|
|
2864
|
+
box-shadow: inset 0 0 0 1px #ccc;
|
|
2865
|
+
}
|
|
2866
|
+
.block-library-poster-image__toggle:focus:not(:disabled) {
|
|
2867
|
+
box-shadow: 0 0 0 currentColor inset, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
2868
|
+
}
|
|
2869
|
+
|
|
2870
|
+
.block-library-poster-image__actions:not(.block-library-poster-image__actions-select) {
|
|
2871
|
+
bottom: 0;
|
|
2872
|
+
opacity: 0;
|
|
2873
|
+
padding: 8px;
|
|
2874
|
+
position: absolute;
|
|
2875
|
+
}
|
|
2876
|
+
@media not (prefers-reduced-motion) {
|
|
2877
|
+
.block-library-poster-image__actions:not(.block-library-poster-image__actions-select) {
|
|
2878
|
+
transition: opacity 50ms ease-out;
|
|
2879
|
+
}
|
|
2880
|
+
}
|
|
2881
|
+
.block-library-poster-image__actions:not(.block-library-poster-image__actions-select) .block-library-poster-image__action {
|
|
2882
|
+
-webkit-backdrop-filter: blur(16px) saturate(180%);
|
|
2883
|
+
backdrop-filter: blur(16px) saturate(180%);
|
|
2884
|
+
background: rgba(255, 255, 255, 0.75);
|
|
2885
|
+
}
|
|
2886
|
+
.block-library-poster-image__actions .block-library-poster-image__action {
|
|
2887
|
+
flex-grow: 1;
|
|
2888
|
+
justify-content: center;
|
|
2889
|
+
}
|
|
2890
|
+
|
|
2834
2891
|
:root .editor-styles-wrapper {
|
|
2835
2892
|
/* stylelint-disable @stylistic/function-comma-space-after -- We can not use spacing because of WP multi site kses rule. */
|
|
2836
2893
|
/* stylelint-enable @stylistic/function-comma-space-after */
|
package/build-style/editor.css
CHANGED
|
@@ -1712,11 +1712,11 @@ figure.wp-block-image:not(.wp-block) {
|
|
|
1712
1712
|
|
|
1713
1713
|
.wp-block-navigation__responsive-container.is-menu-open {
|
|
1714
1714
|
position: fixed;
|
|
1715
|
-
top:
|
|
1715
|
+
top: 159px;
|
|
1716
1716
|
}
|
|
1717
1717
|
@media (min-width: 782px) {
|
|
1718
1718
|
.wp-block-navigation__responsive-container.is-menu-open {
|
|
1719
|
-
top:
|
|
1719
|
+
top: 97px;
|
|
1720
1720
|
}
|
|
1721
1721
|
}
|
|
1722
1722
|
@media (min-width: 782px) {
|
|
@@ -1732,21 +1732,21 @@ figure.wp-block-image:not(.wp-block) {
|
|
|
1732
1732
|
|
|
1733
1733
|
.is-mobile-preview .wp-block-navigation__responsive-container.is-menu-open,
|
|
1734
1734
|
.is-tablet-preview .wp-block-navigation__responsive-container.is-menu-open {
|
|
1735
|
-
top:
|
|
1735
|
+
top: 145px;
|
|
1736
1736
|
}
|
|
1737
1737
|
|
|
1738
1738
|
.is-fullscreen-mode .wp-block-navigation__responsive-container.is-menu-open {
|
|
1739
1739
|
left: 0;
|
|
1740
|
-
top:
|
|
1740
|
+
top: 159px;
|
|
1741
1741
|
}
|
|
1742
1742
|
@media (min-width: 782px) {
|
|
1743
1743
|
.is-fullscreen-mode .wp-block-navigation__responsive-container.is-menu-open {
|
|
1744
|
-
top:
|
|
1744
|
+
top: 65px;
|
|
1745
1745
|
}
|
|
1746
1746
|
}
|
|
1747
1747
|
.is-fullscreen-mode .is-mobile-preview .wp-block-navigation__responsive-container.is-menu-open,
|
|
1748
1748
|
.is-fullscreen-mode .is-tablet-preview .wp-block-navigation__responsive-container.is-menu-open {
|
|
1749
|
-
top:
|
|
1749
|
+
top: 113px;
|
|
1750
1750
|
}
|
|
1751
1751
|
|
|
1752
1752
|
body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-open {
|
|
@@ -2074,10 +2074,6 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
|
|
2074
2074
|
border-top: 3px dashed #ccc;
|
|
2075
2075
|
}
|
|
2076
2076
|
|
|
2077
|
-
.wp-block-navigation .wp-block-page-list > div,
|
|
2078
|
-
.wp-block-navigation .wp-block-page-list {
|
|
2079
|
-
background-color: inherit;
|
|
2080
|
-
}
|
|
2081
2077
|
.wp-block-navigation.items-justified-space-between .wp-block-page-list > div,
|
|
2082
2078
|
.wp-block-navigation.items-justified-space-between .wp-block-page-list {
|
|
2083
2079
|
display: contents;
|
|
@@ -2839,6 +2835,67 @@ div[data-type="core/post-featured-image"] img {
|
|
|
2839
2835
|
cursor: text;
|
|
2840
2836
|
}
|
|
2841
2837
|
|
|
2838
|
+
.block-library-poster-image__container {
|
|
2839
|
+
position: relative;
|
|
2840
|
+
}
|
|
2841
|
+
.block-library-poster-image__container:hover .block-library-poster-image__actions, .block-library-poster-image__container:focus .block-library-poster-image__actions, .block-library-poster-image__container:focus-within .block-library-poster-image__actions {
|
|
2842
|
+
opacity: 1;
|
|
2843
|
+
}
|
|
2844
|
+
.block-library-poster-image__container .block-library-poster-image__actions.block-library-poster-image__actions-select {
|
|
2845
|
+
opacity: 1;
|
|
2846
|
+
margin-top: 16px;
|
|
2847
|
+
}
|
|
2848
|
+
|
|
2849
|
+
.block-library-poster-image__toggle,
|
|
2850
|
+
.block-library-poster-image__preview {
|
|
2851
|
+
width: 100%;
|
|
2852
|
+
padding: 0;
|
|
2853
|
+
overflow: hidden;
|
|
2854
|
+
outline-offset: -1px;
|
|
2855
|
+
min-height: 40px;
|
|
2856
|
+
display: flex;
|
|
2857
|
+
justify-content: center;
|
|
2858
|
+
}
|
|
2859
|
+
|
|
2860
|
+
.block-library-poster-image__preview {
|
|
2861
|
+
height: auto !important;
|
|
2862
|
+
outline: 1px solid rgba(0, 0, 0, 0.1);
|
|
2863
|
+
}
|
|
2864
|
+
.block-library-poster-image__preview .block-library-poster-image__preview-image {
|
|
2865
|
+
object-fit: cover;
|
|
2866
|
+
width: 100%;
|
|
2867
|
+
object-position: 50% 50%;
|
|
2868
|
+
aspect-ratio: 2/1;
|
|
2869
|
+
}
|
|
2870
|
+
|
|
2871
|
+
.block-library-poster-image__toggle {
|
|
2872
|
+
box-shadow: inset 0 0 0 1px #ccc;
|
|
2873
|
+
}
|
|
2874
|
+
.block-library-poster-image__toggle:focus:not(:disabled) {
|
|
2875
|
+
box-shadow: 0 0 0 currentColor inset, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
2876
|
+
}
|
|
2877
|
+
|
|
2878
|
+
.block-library-poster-image__actions:not(.block-library-poster-image__actions-select) {
|
|
2879
|
+
bottom: 0;
|
|
2880
|
+
opacity: 0;
|
|
2881
|
+
padding: 8px;
|
|
2882
|
+
position: absolute;
|
|
2883
|
+
}
|
|
2884
|
+
@media not (prefers-reduced-motion) {
|
|
2885
|
+
.block-library-poster-image__actions:not(.block-library-poster-image__actions-select) {
|
|
2886
|
+
transition: opacity 50ms ease-out;
|
|
2887
|
+
}
|
|
2888
|
+
}
|
|
2889
|
+
.block-library-poster-image__actions:not(.block-library-poster-image__actions-select) .block-library-poster-image__action {
|
|
2890
|
+
-webkit-backdrop-filter: blur(16px) saturate(180%);
|
|
2891
|
+
backdrop-filter: blur(16px) saturate(180%);
|
|
2892
|
+
background: rgba(255, 255, 255, 0.75);
|
|
2893
|
+
}
|
|
2894
|
+
.block-library-poster-image__actions .block-library-poster-image__action {
|
|
2895
|
+
flex-grow: 1;
|
|
2896
|
+
justify-content: center;
|
|
2897
|
+
}
|
|
2898
|
+
|
|
2842
2899
|
:root .editor-styles-wrapper {
|
|
2843
2900
|
/* stylelint-disable @stylistic/function-comma-space-after -- We can not use spacing because of WP multi site kses rule. */
|
|
2844
2901
|
/* stylelint-enable @stylistic/function-comma-space-after */
|
|
@@ -435,11 +435,11 @@
|
|
|
435
435
|
|
|
436
436
|
.wp-block-navigation__responsive-container.is-menu-open {
|
|
437
437
|
position: fixed;
|
|
438
|
-
top:
|
|
438
|
+
top: 159px;
|
|
439
439
|
}
|
|
440
440
|
@media (min-width: 782px) {
|
|
441
441
|
.wp-block-navigation__responsive-container.is-menu-open {
|
|
442
|
-
top:
|
|
442
|
+
top: 97px;
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
@media (min-width: 782px) {
|
|
@@ -455,21 +455,21 @@
|
|
|
455
455
|
|
|
456
456
|
.is-mobile-preview .wp-block-navigation__responsive-container.is-menu-open,
|
|
457
457
|
.is-tablet-preview .wp-block-navigation__responsive-container.is-menu-open {
|
|
458
|
-
top:
|
|
458
|
+
top: 145px;
|
|
459
459
|
}
|
|
460
460
|
|
|
461
461
|
.is-fullscreen-mode .wp-block-navigation__responsive-container.is-menu-open {
|
|
462
462
|
right: 0;
|
|
463
|
-
top:
|
|
463
|
+
top: 159px;
|
|
464
464
|
}
|
|
465
465
|
@media (min-width: 782px) {
|
|
466
466
|
.is-fullscreen-mode .wp-block-navigation__responsive-container.is-menu-open {
|
|
467
|
-
top:
|
|
467
|
+
top: 65px;
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
470
|
.is-fullscreen-mode .is-mobile-preview .wp-block-navigation__responsive-container.is-menu-open,
|
|
471
471
|
.is-fullscreen-mode .is-tablet-preview .wp-block-navigation__responsive-container.is-menu-open {
|
|
472
|
-
top:
|
|
472
|
+
top: 113px;
|
|
473
473
|
}
|
|
474
474
|
|
|
475
475
|
body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-open {
|
|
@@ -435,11 +435,11 @@
|
|
|
435
435
|
|
|
436
436
|
.wp-block-navigation__responsive-container.is-menu-open {
|
|
437
437
|
position: fixed;
|
|
438
|
-
top:
|
|
438
|
+
top: 159px;
|
|
439
439
|
}
|
|
440
440
|
@media (min-width: 782px) {
|
|
441
441
|
.wp-block-navigation__responsive-container.is-menu-open {
|
|
442
|
-
top:
|
|
442
|
+
top: 97px;
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
@media (min-width: 782px) {
|
|
@@ -455,21 +455,21 @@
|
|
|
455
455
|
|
|
456
456
|
.is-mobile-preview .wp-block-navigation__responsive-container.is-menu-open,
|
|
457
457
|
.is-tablet-preview .wp-block-navigation__responsive-container.is-menu-open {
|
|
458
|
-
top:
|
|
458
|
+
top: 145px;
|
|
459
459
|
}
|
|
460
460
|
|
|
461
461
|
.is-fullscreen-mode .wp-block-navigation__responsive-container.is-menu-open {
|
|
462
462
|
left: 0;
|
|
463
|
-
top:
|
|
463
|
+
top: 159px;
|
|
464
464
|
}
|
|
465
465
|
@media (min-width: 782px) {
|
|
466
466
|
.is-fullscreen-mode .wp-block-navigation__responsive-container.is-menu-open {
|
|
467
|
-
top:
|
|
467
|
+
top: 65px;
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
470
|
.is-fullscreen-mode .is-mobile-preview .wp-block-navigation__responsive-container.is-menu-open,
|
|
471
471
|
.is-fullscreen-mode .is-tablet-preview .wp-block-navigation__responsive-container.is-menu-open {
|
|
472
|
-
top:
|
|
472
|
+
top: 113px;
|
|
473
473
|
}
|
|
474
474
|
|
|
475
475
|
body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-open {
|
|
@@ -134,10 +134,6 @@
|
|
|
134
134
|
/**
|
|
135
135
|
* Reset the WP Admin page styles for Gutenberg-like pages.
|
|
136
136
|
*/
|
|
137
|
-
.wp-block-navigation .wp-block-page-list > div,
|
|
138
|
-
.wp-block-navigation .wp-block-page-list {
|
|
139
|
-
background-color: inherit;
|
|
140
|
-
}
|
|
141
137
|
.wp-block-navigation.items-justified-space-between .wp-block-page-list > div,
|
|
142
138
|
.wp-block-navigation.items-justified-space-between .wp-block-page-list {
|
|
143
139
|
display: contents;
|
|
@@ -134,10 +134,6 @@
|
|
|
134
134
|
/**
|
|
135
135
|
* Reset the WP Admin page styles for Gutenberg-like pages.
|
|
136
136
|
*/
|
|
137
|
-
.wp-block-navigation .wp-block-page-list > div,
|
|
138
|
-
.wp-block-navigation .wp-block-page-list {
|
|
139
|
-
background-color: inherit;
|
|
140
|
-
}
|
|
141
137
|
.wp-block-navigation.items-justified-space-between .wp-block-page-list > div,
|
|
142
138
|
.wp-block-navigation.items-justified-space-between .wp-block-page-list {
|
|
143
139
|
display: contents;
|
package/build-style/style.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "9.27.0",
|
|
3
|
+
"version": "9.27.1-next.46f643fa0.0",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -41,39 +41,39 @@
|
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@babel/runtime": "7.25.7",
|
|
44
|
-
"@wordpress/a11y": "^4.27.0",
|
|
45
|
-
"@wordpress/api-fetch": "^7.27.0",
|
|
46
|
-
"@wordpress/autop": "^4.27.0",
|
|
47
|
-
"@wordpress/blob": "^4.27.0",
|
|
48
|
-
"@wordpress/block-editor": "^15.0.0",
|
|
49
|
-
"@wordpress/blocks": "^15.0.0",
|
|
50
|
-
"@wordpress/components": "^30.
|
|
51
|
-
"@wordpress/compose": "^7.27.0",
|
|
52
|
-
"@wordpress/core-data": "^7.27.0",
|
|
53
|
-
"@wordpress/data": "^10.27.0",
|
|
54
|
-
"@wordpress/date": "^5.27.0",
|
|
55
|
-
"@wordpress/deprecated": "^4.27.0",
|
|
56
|
-
"@wordpress/dom": "^4.27.0",
|
|
57
|
-
"@wordpress/element": "^6.27.0",
|
|
58
|
-
"@wordpress/escape-html": "^3.27.0",
|
|
59
|
-
"@wordpress/hooks": "^4.27.0",
|
|
60
|
-
"@wordpress/html-entities": "^4.27.0",
|
|
61
|
-
"@wordpress/i18n": "^6.0.0",
|
|
62
|
-
"@wordpress/icons": "^10.27.0",
|
|
63
|
-
"@wordpress/interactivity": "^6.
|
|
64
|
-
"@wordpress/interactivity-router": "^2.27.0",
|
|
65
|
-
"@wordpress/keyboard-shortcuts": "^5.27.0",
|
|
66
|
-
"@wordpress/keycodes": "^4.27.0",
|
|
67
|
-
"@wordpress/notices": "^5.27.0",
|
|
68
|
-
"@wordpress/patterns": "^2.27.0",
|
|
69
|
-
"@wordpress/primitives": "^4.27.0",
|
|
70
|
-
"@wordpress/private-apis": "^1.27.0",
|
|
71
|
-
"@wordpress/reusable-blocks": "^5.27.0",
|
|
72
|
-
"@wordpress/rich-text": "^7.27.0",
|
|
73
|
-
"@wordpress/server-side-render": "^6.
|
|
74
|
-
"@wordpress/url": "^4.27.0",
|
|
75
|
-
"@wordpress/viewport": "^6.27.0",
|
|
76
|
-
"@wordpress/wordcount": "^4.27.0",
|
|
44
|
+
"@wordpress/a11y": "^4.27.1-next.46f643fa0.0",
|
|
45
|
+
"@wordpress/api-fetch": "^7.27.1-next.46f643fa0.0",
|
|
46
|
+
"@wordpress/autop": "^4.27.1-next.46f643fa0.0",
|
|
47
|
+
"@wordpress/blob": "^4.27.1-next.46f643fa0.0",
|
|
48
|
+
"@wordpress/block-editor": "^15.0.1-next.46f643fa0.0",
|
|
49
|
+
"@wordpress/blocks": "^15.0.1-next.46f643fa0.0",
|
|
50
|
+
"@wordpress/components": "^30.1.1-next.46f643fa0.0",
|
|
51
|
+
"@wordpress/compose": "^7.27.1-next.46f643fa0.0",
|
|
52
|
+
"@wordpress/core-data": "^7.27.1-next.46f643fa0.0",
|
|
53
|
+
"@wordpress/data": "^10.27.1-next.46f643fa0.0",
|
|
54
|
+
"@wordpress/date": "^5.27.1-next.46f643fa0.0",
|
|
55
|
+
"@wordpress/deprecated": "^4.27.1-next.46f643fa0.0",
|
|
56
|
+
"@wordpress/dom": "^4.27.1-next.46f643fa0.0",
|
|
57
|
+
"@wordpress/element": "^6.27.1-next.46f643fa0.0",
|
|
58
|
+
"@wordpress/escape-html": "^3.27.1-next.46f643fa0.0",
|
|
59
|
+
"@wordpress/hooks": "^4.27.1-next.46f643fa0.0",
|
|
60
|
+
"@wordpress/html-entities": "^4.27.1-next.46f643fa0.0",
|
|
61
|
+
"@wordpress/i18n": "^6.0.1-next.46f643fa0.0",
|
|
62
|
+
"@wordpress/icons": "^10.27.2-next.46f643fa0.0",
|
|
63
|
+
"@wordpress/interactivity": "^6.28.1-next.46f643fa0.0",
|
|
64
|
+
"@wordpress/interactivity-router": "^2.27.1-next.46f643fa0.0",
|
|
65
|
+
"@wordpress/keyboard-shortcuts": "^5.27.1-next.46f643fa0.0",
|
|
66
|
+
"@wordpress/keycodes": "^4.27.1-next.46f643fa0.0",
|
|
67
|
+
"@wordpress/notices": "^5.27.1-next.46f643fa0.0",
|
|
68
|
+
"@wordpress/patterns": "^2.27.1-next.46f643fa0.0",
|
|
69
|
+
"@wordpress/primitives": "^4.27.1-next.46f643fa0.0",
|
|
70
|
+
"@wordpress/private-apis": "^1.27.1-next.46f643fa0.0",
|
|
71
|
+
"@wordpress/reusable-blocks": "^5.27.1-next.46f643fa0.0",
|
|
72
|
+
"@wordpress/rich-text": "^7.27.1-next.46f643fa0.0",
|
|
73
|
+
"@wordpress/server-side-render": "^6.4.1-next.46f643fa0.0",
|
|
74
|
+
"@wordpress/url": "^4.27.1-next.46f643fa0.0",
|
|
75
|
+
"@wordpress/viewport": "^6.27.1-next.46f643fa0.0",
|
|
76
|
+
"@wordpress/wordcount": "^4.27.1-next.46f643fa0.0",
|
|
77
77
|
"change-case": "^4.1.2",
|
|
78
78
|
"clsx": "^2.1.1",
|
|
79
79
|
"colord": "^2.7.0",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"publishConfig": {
|
|
92
92
|
"access": "public"
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "17e600e091675c5e3d809adfea23ac456bbeae19"
|
|
95
95
|
}
|
package/src/categories/edit.js
CHANGED
|
@@ -25,6 +25,8 @@ import { decodeEntities } from '@wordpress/html-entities';
|
|
|
25
25
|
import { __, sprintf } from '@wordpress/i18n';
|
|
26
26
|
import { pin } from '@wordpress/icons';
|
|
27
27
|
import { useEntityRecords } from '@wordpress/core-data';
|
|
28
|
+
import { useDispatch } from '@wordpress/data';
|
|
29
|
+
import { store as noticeStore } from '@wordpress/notices';
|
|
28
30
|
|
|
29
31
|
/**
|
|
30
32
|
* Internal dependencies
|
|
@@ -44,6 +46,7 @@ export default function CategoriesEdit( {
|
|
|
44
46
|
},
|
|
45
47
|
setAttributes,
|
|
46
48
|
className,
|
|
49
|
+
clientId,
|
|
47
50
|
} ) {
|
|
48
51
|
const selectId = useInstanceId( CategoriesEdit, 'blocks-category-select' );
|
|
49
52
|
|
|
@@ -70,6 +73,15 @@ export default function CategoriesEdit( {
|
|
|
70
73
|
query
|
|
71
74
|
);
|
|
72
75
|
|
|
76
|
+
const { createWarningNotice } = useDispatch( noticeStore );
|
|
77
|
+
const showRedirectionPreventedNotice = ( event ) => {
|
|
78
|
+
event.preventDefault();
|
|
79
|
+
createWarningNotice( __( 'Links are disabled in the editor.' ), {
|
|
80
|
+
id: `block-library/core/categories/redirection-prevented/${ clientId }`,
|
|
81
|
+
type: 'snackbar',
|
|
82
|
+
} );
|
|
83
|
+
};
|
|
84
|
+
|
|
73
85
|
const getCategoriesList = ( parentId ) => {
|
|
74
86
|
if ( ! categories?.length ) {
|
|
75
87
|
return [];
|
|
@@ -99,7 +111,7 @@ export default function CategoriesEdit( {
|
|
|
99
111
|
const { id, link, count, name } = category;
|
|
100
112
|
return (
|
|
101
113
|
<li key={ id } className={ `cat-item cat-item-${ id }` }>
|
|
102
|
-
<a href={ link }
|
|
114
|
+
<a href={ link } onClick={ showRedirectionPreventedNotice }>
|
|
103
115
|
{ renderCategoryName( name ) }
|
|
104
116
|
</a>
|
|
105
117
|
{ showPostCounts && ` (${ count })` }
|
|
@@ -35,7 +35,7 @@ import { COVER_MIN_HEIGHT, mediaPosition } from '../shared';
|
|
|
35
35
|
import { unlock } from '../../lock-unlock';
|
|
36
36
|
import { useToolsPanelDropdownMenuProps } from '../../utils/hooks';
|
|
37
37
|
import { DEFAULT_MEDIA_SIZE_SLUG } from '../constants';
|
|
38
|
-
import PosterImage from '
|
|
38
|
+
import PosterImage from '../../utils/poster-image';
|
|
39
39
|
|
|
40
40
|
const { cleanEmptyObject, ResolutionTool, HTMLElementControl } = unlock(
|
|
41
41
|
blockEditorPrivateApis
|
|
@@ -275,7 +275,11 @@ export default function CoverInspectorControls( {
|
|
|
275
275
|
{ isVideoBackground && (
|
|
276
276
|
<PosterImage
|
|
277
277
|
poster={ poster }
|
|
278
|
-
|
|
278
|
+
onChange={ ( posterImage ) =>
|
|
279
|
+
setAttributes( {
|
|
280
|
+
poster: posterImage?.url,
|
|
281
|
+
} )
|
|
282
|
+
}
|
|
279
283
|
/>
|
|
280
284
|
) }
|
|
281
285
|
{ ! useFeaturedImage && url && ! isVideoBackground && (
|
package/src/editor.scss
CHANGED
package/src/file/edit.js
CHANGED
|
@@ -29,6 +29,7 @@ import { __, _x } from '@wordpress/i18n';
|
|
|
29
29
|
import { file as icon } from '@wordpress/icons';
|
|
30
30
|
import { store as coreStore } from '@wordpress/core-data';
|
|
31
31
|
import { store as noticesStore } from '@wordpress/notices';
|
|
32
|
+
import { getFilename } from '@wordpress/url';
|
|
32
33
|
|
|
33
34
|
/**
|
|
34
35
|
* Internal dependencies
|
|
@@ -127,7 +128,9 @@ function FileEdit( { attributes, isSelected, setAttributes, clientId } ) {
|
|
|
127
128
|
return;
|
|
128
129
|
}
|
|
129
130
|
|
|
130
|
-
const isPdf = newMedia.url
|
|
131
|
+
const isPdf = getFilename( newMedia.url )
|
|
132
|
+
.toLowerCase()
|
|
133
|
+
.endsWith( '.pdf' );
|
|
131
134
|
const pdfAttributes = {
|
|
132
135
|
displayPreview: isPdf
|
|
133
136
|
? attributes.displayPreview ?? true
|
package/src/latest-posts/edit.js
CHANGED
|
@@ -774,7 +774,6 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
|
774
774
|
{ addLinkToFeaturedImage ? (
|
|
775
775
|
<a
|
|
776
776
|
href={ post.link }
|
|
777
|
-
rel="noreferrer noopener"
|
|
778
777
|
onClick={
|
|
779
778
|
showRedirectionPreventedNotice
|
|
780
779
|
}
|
|
@@ -789,7 +788,6 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
|
789
788
|
<a
|
|
790
789
|
className="wp-block-latest-posts__post-title"
|
|
791
790
|
href={ post.link }
|
|
792
|
-
rel="noreferrer noopener"
|
|
793
791
|
dangerouslySetInnerHTML={
|
|
794
792
|
!! titleTrimmed
|
|
795
793
|
? {
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
.wp-block-navigation {
|
|
2
|
-
// Block wrapper gets the classes in the editor, and there's an extra div wrapper for now, so background styles need to be inherited.
|
|
3
|
-
.wp-block-page-list > div,
|
|
4
|
-
.wp-block-page-list {
|
|
5
|
-
background-color: inherit;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
2
|
// space-between justification.
|
|
9
3
|
&.items-justified-space-between {
|
|
10
4
|
.wp-block-page-list > div,
|