@wordpress/block-library 7.15.0 → 7.16.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/CHANGELOG.md +3 -0
- package/build/code/utils.js +3 -3
- package/build/code/utils.js.map +1 -1
- package/build/comments-pagination-numbers/index.js +7 -0
- package/build/comments-pagination-numbers/index.js.map +1 -1
- package/build/gallery/gallery.js +2 -28
- package/build/gallery/gallery.js.map +1 -1
- package/build/group/edit.js +1 -1
- package/build/group/edit.js.map +1 -1
- package/build/navigation/edit/index.js +12 -12
- package/build/navigation/edit/index.js.map +1 -1
- package/build/paragraph/deprecated.js +49 -10
- package/build/paragraph/deprecated.js.map +1 -1
- package/build/paragraph/drop-zone.js +99 -0
- package/build/paragraph/drop-zone.js.map +1 -0
- package/build/paragraph/edit.js +30 -6
- package/build/paragraph/edit.js.map +1 -1
- package/build/paragraph/save.js +3 -1
- package/build/paragraph/save.js.map +1 -1
- package/build/post-author/edit.js +20 -2
- package/build/post-author/edit.js.map +1 -1
- package/build/post-author/index.js +8 -0
- package/build/post-author/index.js.map +1 -1
- package/build/post-content/edit.js +6 -1
- package/build/post-content/edit.js.map +1 -1
- package/build/post-featured-image/index.js +1 -1
- package/build/post-featured-image/overlay.js +2 -2
- package/build/post-featured-image/overlay.js.map +1 -1
- package/build/post-terms/index.js +4 -0
- package/build/post-terms/index.js.map +1 -1
- package/build/query/edit/inspector-controls/author-control.js +2 -1
- package/build/query/edit/inspector-controls/author-control.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +1 -1
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/inspector-controls/parent-control.js +2 -1
- package/build/query/edit/inspector-controls/parent-control.js.map +1 -1
- package/build/query/edit/inspector-controls/taxonomy-controls.js +2 -1
- package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build/query/utils.js +1 -1
- package/build/query/utils.js.map +1 -1
- package/build/quote/index.js +0 -1
- package/build/quote/index.js.map +1 -1
- package/build/site-title/index.js +2 -1
- package/build/site-title/index.js.map +1 -1
- package/build/template-part/index.js +2 -2
- package/build/template-part/index.js.map +1 -1
- package/build/video/edit.js +13 -1
- package/build/video/edit.js.map +1 -1
- package/build-module/code/utils.js +3 -3
- package/build-module/code/utils.js.map +1 -1
- package/build-module/comments-pagination-numbers/index.js +7 -0
- package/build-module/comments-pagination-numbers/index.js.map +1 -1
- package/build-module/gallery/gallery.js +2 -29
- package/build-module/gallery/gallery.js.map +1 -1
- package/build-module/group/edit.js +1 -1
- package/build-module/group/edit.js.map +1 -1
- package/build-module/navigation/edit/index.js +12 -12
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/paragraph/deprecated.js +49 -11
- package/build-module/paragraph/deprecated.js.map +1 -1
- package/build-module/paragraph/drop-zone.js +88 -0
- package/build-module/paragraph/drop-zone.js.map +1 -0
- package/build-module/paragraph/edit.js +29 -6
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/paragraph/save.js +2 -1
- package/build-module/paragraph/save.js.map +1 -1
- package/build-module/post-author/edit.js +21 -2
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-author/index.js +8 -0
- package/build-module/post-author/index.js.map +1 -1
- package/build-module/post-content/edit.js +6 -1
- package/build-module/post-content/edit.js.map +1 -1
- package/build-module/post-featured-image/index.js +1 -1
- package/build-module/post-featured-image/overlay.js +2 -2
- package/build-module/post-featured-image/overlay.js.map +1 -1
- package/build-module/post-terms/index.js +4 -0
- package/build-module/post-terms/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/author-control.js +2 -1
- package/build-module/query/edit/inspector-controls/author-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +1 -1
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/parent-control.js +2 -1
- package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js +2 -1
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build-module/query/utils.js +1 -1
- package/build-module/query/utils.js.map +1 -1
- package/build-module/quote/index.js +0 -1
- package/build-module/quote/index.js.map +1 -1
- package/build-module/site-title/index.js +2 -1
- package/build-module/site-title/index.js.map +1 -1
- package/build-module/template-part/index.js +2 -2
- package/build-module/template-part/index.js.map +1 -1
- package/build-module/video/edit.js +15 -3
- package/build-module/video/edit.js.map +1 -1
- package/build-style/classic-rtl.css +85 -0
- package/build-style/classic.css +85 -0
- package/build-style/code/style-rtl.css +3 -0
- package/build-style/code/style.css +3 -0
- package/build-style/editor-rtl.css +110 -31
- package/build-style/editor.css +110 -31
- package/build-style/group/editor-rtl.css +11 -1
- package/build-style/group/editor.css +11 -1
- package/build-style/image/editor-rtl.css +3 -0
- package/build-style/image/editor.css +3 -0
- package/build-style/navigation/editor-rtl.css +15 -1
- package/build-style/navigation/editor.css +15 -1
- package/build-style/navigation/style-rtl.css +3 -0
- package/build-style/navigation/style.css +3 -0
- package/build-style/paragraph/editor-rtl.css +16 -0
- package/build-style/paragraph/editor.css +16 -0
- package/build-style/paragraph/style-rtl.css +5 -0
- package/build-style/paragraph/style.css +5 -0
- package/build-style/post-featured-image/editor-rtl.css +39 -29
- package/build-style/post-featured-image/editor.css +39 -29
- package/build-style/post-terms/style-rtl.css +4 -1
- package/build-style/post-terms/style.css +4 -1
- package/build-style/site-title/editor-rtl.css +4 -0
- package/build-style/site-title/editor.css +4 -0
- package/build-style/site-title/style-rtl.css +79 -0
- package/build-style/site-title/style.css +79 -0
- package/build-style/style-rtl.css +19 -1
- package/build-style/style.css +19 -1
- package/build-style/video/editor-rtl.css +22 -0
- package/build-style/video/editor.css +22 -0
- package/package.json +28 -28
- package/src/archives/index.php +4 -7
- package/src/categories/index.php +1 -1
- package/src/classic.scss +15 -0
- package/src/code/style.scss +12 -7
- package/src/code/utils.js +3 -3
- package/src/comment-author-name/index.php +1 -1
- package/src/comment-reply-link/index.php +1 -1
- package/src/comment-template/index.php +18 -9
- package/src/comments-pagination-numbers/block.json +7 -0
- package/src/cover/index.php +1 -1
- package/src/gallery/gallery.js +1 -31
- package/src/group/edit.js +1 -1
- package/src/image/editor.scss +4 -0
- package/src/latest-posts/index.php +1 -1
- package/src/navigation/edit/index.js +12 -10
- package/src/navigation/editor.scss +6 -0
- package/src/navigation/style.scss +8 -0
- package/src/navigation-submenu/index.php +11 -2
- package/src/page-list/index.php +3 -3
- package/src/paragraph/deprecated.js +36 -0
- package/src/paragraph/drop-zone.js +105 -0
- package/src/paragraph/edit.js +37 -9
- package/src/paragraph/editor.scss +20 -0
- package/src/paragraph/save.js +5 -1
- package/src/paragraph/style.scss +5 -0
- package/src/post-author/block.json +8 -0
- package/src/post-author/edit.js +29 -3
- package/src/post-author/index.php +7 -1
- package/src/post-content/edit.js +3 -1
- package/src/post-featured-image/block.json +1 -1
- package/src/post-featured-image/editor.scss +79 -72
- package/src/post-featured-image/index.php +18 -24
- package/src/post-featured-image/overlay.js +17 -14
- package/src/post-terms/block.json +4 -0
- package/src/post-terms/style.scss +7 -2
- package/src/query/edit/inspector-controls/author-control.js +1 -0
- package/src/query/edit/inspector-controls/index.js +1 -4
- package/src/query/edit/inspector-controls/parent-control.js +1 -0
- package/src/query/edit/inspector-controls/taxonomy-controls.js +1 -0
- package/src/query/utils.js +1 -1
- package/src/quote/block.json +0 -1
- package/src/site-title/block.json +2 -1
- package/src/site-title/editor.scss +6 -0
- package/src/site-title/style.scss +5 -0
- package/src/style.scss +1 -0
- package/src/tag-cloud/index.php +1 -8
- package/src/template-part/index.js +2 -2
- package/src/video/edit.js +19 -0
- package/src/video/editor.scss +37 -0
- package/build/navigation-submenu/view.js +0 -56
- package/build/navigation-submenu/view.js.map +0 -1
- package/build-module/navigation-submenu/view.js +0 -54
- package/build-module/navigation-submenu/view.js.map +0 -1
- package/src/navigation-submenu/view.js +0 -67
|
@@ -9,7 +9,7 @@ import classnames from 'classnames';
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { getBlobByURL, isBlobURL } from '@wordpress/blob';
|
|
12
|
-
import { BaseControl, Button, Disabled, PanelBody, Spinner } from '@wordpress/components';
|
|
12
|
+
import { BaseControl, Button, Disabled, PanelBody, Spinner, Placeholder } from '@wordpress/components';
|
|
13
13
|
import { BlockControls, BlockIcon, InspectorControls, MediaPlaceholder, MediaUpload, MediaUploadCheck, MediaReplaceFlow, RichText, useBlockProps, store as blockEditorStore, __experimentalGetElementClassName } from '@wordpress/block-editor';
|
|
14
14
|
import { useRef, useEffect } from '@wordpress/element';
|
|
15
15
|
import { __, sprintf } from '@wordpress/i18n';
|
|
@@ -25,7 +25,18 @@ import { store as noticesStore } from '@wordpress/notices';
|
|
|
25
25
|
import { createUpgradedEmbedBlock } from '../embed/util';
|
|
26
26
|
import VideoCommonSettings from './edit-common-settings';
|
|
27
27
|
import TracksEditor from './tracks-editor';
|
|
28
|
-
import Tracks from './tracks';
|
|
28
|
+
import Tracks from './tracks'; // Much of this description is duplicated from MediaPlaceholder.
|
|
29
|
+
|
|
30
|
+
const placeholder = content => {
|
|
31
|
+
return createElement(Placeholder, {
|
|
32
|
+
className: "block-editor-media-placeholder",
|
|
33
|
+
withIllustration: true,
|
|
34
|
+
icon: icon,
|
|
35
|
+
label: __('Video'),
|
|
36
|
+
instructions: __('Upload a video file, pick one from your media library, or add one with a URL.')
|
|
37
|
+
}, content);
|
|
38
|
+
};
|
|
39
|
+
|
|
29
40
|
const ALLOWED_MEDIA_TYPES = ['video'];
|
|
30
41
|
const VIDEO_POSTER_ALLOWED_MEDIA_TYPES = ['image'];
|
|
31
42
|
|
|
@@ -148,7 +159,8 @@ function VideoEdit(_ref) {
|
|
|
148
159
|
accept: "video/*",
|
|
149
160
|
allowedTypes: ALLOWED_MEDIA_TYPES,
|
|
150
161
|
value: attributes,
|
|
151
|
-
onError: onUploadError
|
|
162
|
+
onError: onUploadError,
|
|
163
|
+
placeholder: placeholder
|
|
152
164
|
}));
|
|
153
165
|
}
|
|
154
166
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/video/edit.js"],"names":["classnames","getBlobByURL","isBlobURL","BaseControl","Button","Disabled","PanelBody","Spinner","BlockControls","BlockIcon","InspectorControls","MediaPlaceholder","MediaUpload","MediaUploadCheck","MediaReplaceFlow","RichText","useBlockProps","store","blockEditorStore","__experimentalGetElementClassName","useRef","useEffect","__","sprintf","useInstanceId","useDispatch","useSelect","video","icon","createBlock","getDefaultBlockName","noticesStore","createUpgradedEmbedBlock","VideoCommonSettings","TracksEditor","Tracks","ALLOWED_MEDIA_TYPES","VIDEO_POSTER_ALLOWED_MEDIA_TYPES","VideoEdit","isSelected","attributes","className","setAttributes","insertBlocksAfter","onReplace","instanceId","videoPlayer","posterImageButton","id","caption","controls","poster","src","tracks","isTemporaryVideo","mediaUpload","select","getSettings","file","filesList","onFileChange","media","onSelectVideo","onError","onUploadError","allowedTypes","current","load","url","undefined","image","onSelectURL","newSrc","embedBlock","createErrorNotice","message","type","classes","blockProps","onSelectPoster","onRemovePoster","focus","videoPosterDescription","newTracks","open","isEmpty","value"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,YAAT,EAAuBC,SAAvB,QAAwC,iBAAxC;AACA,SACCC,WADD,EAECC,MAFD,EAGCC,QAHD,EAICC,SAJD,EAKCC,OALD,QAMO,uBANP;AAOA,SACCC,aADD,EAECC,SAFD,EAGCC,iBAHD,EAICC,gBAJD,EAKCC,WALD,EAMCC,gBAND,EAOCC,gBAPD,EAQCC,QARD,EASCC,aATD,EAUCC,KAAK,IAAIC,gBAVV,EAWCC,iCAXD,QAYO,yBAZP;AAaA,SAASC,MAAT,EAAiBC,SAAjB,QAAkC,oBAAlC;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,aAAT,QAA8B,oBAA9B;AACA,SAASC,WAAT,EAAsBC,SAA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,IAAA,KAAK,EAAG2B,OAPT;AAQC,IAAA,QAAQ,EAAKqC,KAAF,IACV5C,aAAa,CAAE;AAAEO,MAAAA,OAAO,EAAEqC;AAAX,KAAF,CATf;AAWC,IAAA,aAAa,MAXd;AAYC,IAAA,sBAAsB,EAAG,MACxB3C,iBAAiB,CAChBd,WAAW,CAAEC,mBAAmB,EAArB,CADK;AAbnB,IAlBF,CA7ED,CADD;AAsHA;;AAED,eAAeQ,SAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { getBlobByURL, isBlobURL } from '@wordpress/blob';\nimport {\n\tBaseControl,\n\tButton,\n\tDisabled,\n\tPanelBody,\n\tSpinner,\n} from '@wordpress/components';\nimport {\n\tBlockControls,\n\tBlockIcon,\n\tInspectorControls,\n\tMediaPlaceholder,\n\tMediaUpload,\n\tMediaUploadCheck,\n\tMediaReplaceFlow,\n\tRichText,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\t__experimentalGetElementClassName,\n} from '@wordpress/block-editor';\nimport { useRef, useEffect } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { video as icon } from '@wordpress/icons';\nimport { createBlock, getDefaultBlockName } from '@wordpress/blocks';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { createUpgradedEmbedBlock } from '../embed/util';\nimport VideoCommonSettings from './edit-common-settings';\nimport TracksEditor from './tracks-editor';\nimport Tracks from './tracks';\n\nconst ALLOWED_MEDIA_TYPES = [ 'video' ];\nconst VIDEO_POSTER_ALLOWED_MEDIA_TYPES = [ 'image' ];\n\nfunction VideoEdit( {\n\tisSelected,\n\tattributes,\n\tclassName,\n\tsetAttributes,\n\tinsertBlocksAfter,\n\tonReplace,\n} ) {\n\tconst instanceId = useInstanceId( VideoEdit );\n\tconst videoPlayer = useRef();\n\tconst posterImageButton = useRef();\n\tconst { id, caption, controls, poster, src, tracks } = attributes;\n\tconst isTemporaryVideo = ! id && isBlobURL( src );\n\tconst mediaUpload = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings().mediaUpload,\n\t\t[]\n\t);\n\n\tuseEffect( () => {\n\t\tif ( ! id && isBlobURL( src ) ) {\n\t\t\tconst file = getBlobByURL( src );\n\t\t\tif ( file ) {\n\t\t\t\tmediaUpload( {\n\t\t\t\t\tfilesList: [ file ],\n\t\t\t\t\tonFileChange: ( [ media ] ) => onSelectVideo( media ),\n\t\t\t\t\tonError: onUploadError,\n\t\t\t\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\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} );\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\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} );\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 ) {\n\t\t\t\tonReplace( embedBlock );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetAttributes( { src: newSrc, id: undefined, poster: undefined } );\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\tconst classes = classnames( className, {\n\t\t'is-transient': isTemporaryVideo,\n\t} );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classes,\n\t} );\n\n\tif ( ! src ) {\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/>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tfunction onSelectPoster( image ) {\n\t\tsetAttributes( { poster: image.url } );\n\t}\n\n\tfunction onRemovePoster() {\n\t\tsetAttributes( { poster: undefined } );\n\n\t\t// Move focus back to the Media Upload button.\n\t\tposterImageButton.current.focus();\n\t}\n\n\tconst videoPosterDescription = `video-block__poster-image-description-${ instanceId }`;\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<TracksEditor\n\t\t\t\t\ttracks={ tracks }\n\t\t\t\t\tonChange={ ( newTracks ) => {\n\t\t\t\t\t\tsetAttributes( { tracks: newTracks } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<BlockControls group=\"other\">\n\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\tmediaId={ id }\n\t\t\t\t\tmediaURL={ src }\n\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\taccept=\"video/*\"\n\t\t\t\t\tonSelect={ onSelectVideo }\n\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\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<MediaUploadCheck>\n\t\t\t\t\t\t<BaseControl className=\"editor-video-poster-control\">\n\t\t\t\t\t\t\t<BaseControl.VisualLabel>\n\t\t\t\t\t\t\t\t{ __( 'Poster image' ) }\n\t\t\t\t\t\t\t</BaseControl.VisualLabel>\n\t\t\t\t\t\t\t<MediaUpload\n\t\t\t\t\t\t\t\ttitle={ __( 'Select poster image' ) }\n\t\t\t\t\t\t\t\tonSelect={ onSelectPoster }\n\t\t\t\t\t\t\t\tallowedTypes={\n\t\t\t\t\t\t\t\t\tVIDEO_POSTER_ALLOWED_MEDIA_TYPES\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\trender={ ( { open } ) => (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\t\tonClick={ open }\n\t\t\t\t\t\t\t\t\t\tref={ posterImageButton }\n\t\t\t\t\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\t\t\t\t\tvideoPosterDescription\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\t\t{ ! poster\n\t\t\t\t\t\t\t\t\t\t\t? __( 'Select' )\n\t\t\t\t\t\t\t\t\t\t\t: __( 'Replace' ) }\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<p id={ videoPosterDescription } hidden>\n\t\t\t\t\t\t\t\t{ poster\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: poster image URL. */\n\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t'The current poster image url is %s'\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tposter\n\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\t\t\t'There is no poster image currently selected'\n\t\t\t\t\t\t\t\t\t ) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t{ !! poster && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tonClick={ onRemovePoster }\n\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Remove' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</BaseControl>\n\t\t\t\t\t</MediaUploadCheck>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<figure { ...blockProps }>\n\t\t\t\t{ /*\n\t\t\t\t\tDisable the video tag if the block is not selected\n\t\t\t\t\tso the user clicking on it won't play the\n\t\t\t\t\tvideo when the controls are enabled.\n\t\t\t\t*/ }\n\t\t\t\t<Disabled isDisabled={ ! isSelected }>\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 }\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{ isTemporaryVideo && <Spinner /> }\n\t\t\t\t{ ( ! RichText.isEmpty( caption ) || isSelected ) && (\n\t\t\t\t\t<RichText\n\t\t\t\t\t\ttagName=\"figcaption\"\n\t\t\t\t\t\tclassName={ __experimentalGetElementClassName(\n\t\t\t\t\t\t\t'caption'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\taria-label={ __( 'Video caption text' ) }\n\t\t\t\t\t\tplaceholder={ __( 'Add caption' ) }\n\t\t\t\t\t\tvalue={ caption }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( { caption: value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinlineToolbar\n\t\t\t\t\t\t__unstableOnSplitAtEnd={ () =>\n\t\t\t\t\t\t\tinsertBlocksAfter(\n\t\t\t\t\t\t\t\tcreateBlock( getDefaultBlockName() )\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) }\n\t\t\t</figure>\n\t\t</>\n\t);\n}\n\nexport default VideoEdit;\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/video/edit.js"],"names":["classnames","getBlobByURL","isBlobURL","BaseControl","Button","Disabled","PanelBody","Spinner","Placeholder","BlockControls","BlockIcon","InspectorControls","MediaPlaceholder","MediaUpload","MediaUploadCheck","MediaReplaceFlow","RichText","useBlockProps","store","blockEditorStore","__experimentalGetElementClassName","useRef","useEffect","__","sprintf","useInstanceId","useDispatch","useSelect","video","icon","createBlock","getDefaultBlockName","noticesStore","createUpgradedEmbedBlock","VideoCommonSettings","TracksEditor","Tracks","placeholder","content","ALLOWED_MEDIA_TYPES","VIDEO_POSTER_ALLOWED_MEDIA_TYPES","VideoEdit","isSelected","attributes","className","setAttributes","insertBlocksAfter","onReplace","instanceId","videoPlayer","posterImageButton","id","caption","controls","poster","src","tracks","isTemporaryVideo","mediaUpload","select","getSettings","file","filesList","onFileChange","media","onSelectVideo","onError","onUploadError","allowedTypes","current","load","url","undefined","image","onSelectURL","newSrc","embedBlock","createErrorNotice","message","type","classes","blockProps","onSelectPoster","onRemovePoster","focus","videoPosterDescription","newTracks","open","isEmpty","value"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,Y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,EAKP+B,MALO,CADF,GAQL/B,EAAE,CACF,6CADE,CATN,CAzBD,EAsCG,CAAC,CAAE+B,MAAH,IACD,cAAC,MAAD;AACC,IAAA,OAAO,EAAG6B,cADX;AAEC,IAAA,OAAO,EAAC;AAFT,KAIG5D,EAAE,CAAE,QAAF,CAJL,CAvCF,CADD,CALD,CADD,CApBD,EA6EC,wBAAa0D,UAAb,EAMC,cAAC,QAAD;AAAU,IAAA,UAAU,EAAG,CAAEvC;AAAzB,KACC;AACC,IAAA,QAAQ,EAAGW,QADZ;AAEC,IAAA,MAAM,EAAGC,MAFV;AAGC,IAAA,GAAG,EAAGC,GAHP;AAIC,IAAA,GAAG,EAAGN;AAJP,KAMC,cAAC,MAAD;AAAQ,IAAA,MAAM,EAAGO;AAAjB,IAND,CADD,CAND,EAgBGC,gBAAgB,IAAI,cAAC,OAAD,OAhBvB,EAiBG,CAAE,CAAEzC,QAAQ,CAACwE,OAAT,CAAkBpC,OAAlB,CAAF,IAAiCV,UAAnC,KACD,cAAC,QAAD;AACC,IAAA,OAAO,EAAC,YADT;AAEC,IAAA,SAAS,EAAGtB,iCAAiC,CAC5C,SAD4C,CAF9C;AAKC,kBAAaG,EAAE,CAAE,oBAAF,CALhB;AAMC,IAAA,WAAW,EAAGA,EAAE,CAAE,aAAF,CANjB;AAOC,IAAA,KAAK,EAAG6B,OAPT;AAQC,IAAA,QAAQ,EAAKqC,KAAF,IACV5C,aAAa,CAAE;AAAEO,MAAAA,OAAO,EAAEqC;AAAX,KAAF,CATf;AAWC,IAAA,aAAa,MAXd;AAYC,IAAA,sBAAsB,EAAG,MACxB3C,iBAAiB,CAChBhB,WAAW,CAAEC,mBAAmB,EAArB,CADK;AAbnB,IAlBF,CA7ED,CADD;AAsHA;;AAED,eAAeU,SAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { getBlobByURL, isBlobURL } from '@wordpress/blob';\nimport {\n\tBaseControl,\n\tButton,\n\tDisabled,\n\tPanelBody,\n\tSpinner,\n\tPlaceholder,\n} from '@wordpress/components';\nimport {\n\tBlockControls,\n\tBlockIcon,\n\tInspectorControls,\n\tMediaPlaceholder,\n\tMediaUpload,\n\tMediaUploadCheck,\n\tMediaReplaceFlow,\n\tRichText,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\t__experimentalGetElementClassName,\n} from '@wordpress/block-editor';\nimport { useRef, useEffect } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { video as icon } from '@wordpress/icons';\nimport { createBlock, getDefaultBlockName } from '@wordpress/blocks';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { createUpgradedEmbedBlock } from '../embed/util';\nimport VideoCommonSettings from './edit-common-settings';\nimport TracksEditor from './tracks-editor';\nimport Tracks from './tracks';\n\n// Much of this description is duplicated from MediaPlaceholder.\nconst placeholder = ( content ) => {\n\treturn (\n\t\t<Placeholder\n\t\t\tclassName=\"block-editor-media-placeholder\"\n\t\t\twithIllustration={ true }\n\t\t\ticon={ icon }\n\t\t\tlabel={ __( 'Video' ) }\n\t\t\tinstructions={ __(\n\t\t\t\t'Upload a video file, pick one from your media library, or add one with a URL.'\n\t\t\t) }\n\t\t>\n\t\t\t{ content }\n\t\t</Placeholder>\n\t);\n};\n\nconst ALLOWED_MEDIA_TYPES = [ 'video' ];\nconst VIDEO_POSTER_ALLOWED_MEDIA_TYPES = [ 'image' ];\n\nfunction VideoEdit( {\n\tisSelected,\n\tattributes,\n\tclassName,\n\tsetAttributes,\n\tinsertBlocksAfter,\n\tonReplace,\n} ) {\n\tconst instanceId = useInstanceId( VideoEdit );\n\tconst videoPlayer = useRef();\n\tconst posterImageButton = useRef();\n\tconst { id, caption, controls, poster, src, tracks } = attributes;\n\tconst isTemporaryVideo = ! id && isBlobURL( src );\n\tconst mediaUpload = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings().mediaUpload,\n\t\t[]\n\t);\n\n\tuseEffect( () => {\n\t\tif ( ! id && isBlobURL( src ) ) {\n\t\t\tconst file = getBlobByURL( src );\n\t\t\tif ( file ) {\n\t\t\t\tmediaUpload( {\n\t\t\t\t\tfilesList: [ file ],\n\t\t\t\t\tonFileChange: ( [ media ] ) => onSelectVideo( media ),\n\t\t\t\t\tonError: onUploadError,\n\t\t\t\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\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} );\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\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} );\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 ) {\n\t\t\t\tonReplace( embedBlock );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetAttributes( { src: newSrc, id: undefined, poster: undefined } );\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\tconst classes = classnames( className, {\n\t\t'is-transient': isTemporaryVideo,\n\t} );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classes,\n\t} );\n\n\tif ( ! src ) {\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\tfunction onSelectPoster( image ) {\n\t\tsetAttributes( { poster: image.url } );\n\t}\n\n\tfunction onRemovePoster() {\n\t\tsetAttributes( { poster: undefined } );\n\n\t\t// Move focus back to the Media Upload button.\n\t\tposterImageButton.current.focus();\n\t}\n\n\tconst videoPosterDescription = `video-block__poster-image-description-${ instanceId }`;\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<TracksEditor\n\t\t\t\t\ttracks={ tracks }\n\t\t\t\t\tonChange={ ( newTracks ) => {\n\t\t\t\t\t\tsetAttributes( { tracks: newTracks } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<BlockControls group=\"other\">\n\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\tmediaId={ id }\n\t\t\t\t\tmediaURL={ src }\n\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\taccept=\"video/*\"\n\t\t\t\t\tonSelect={ onSelectVideo }\n\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\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<MediaUploadCheck>\n\t\t\t\t\t\t<BaseControl className=\"editor-video-poster-control\">\n\t\t\t\t\t\t\t<BaseControl.VisualLabel>\n\t\t\t\t\t\t\t\t{ __( 'Poster image' ) }\n\t\t\t\t\t\t\t</BaseControl.VisualLabel>\n\t\t\t\t\t\t\t<MediaUpload\n\t\t\t\t\t\t\t\ttitle={ __( 'Select poster image' ) }\n\t\t\t\t\t\t\t\tonSelect={ onSelectPoster }\n\t\t\t\t\t\t\t\tallowedTypes={\n\t\t\t\t\t\t\t\t\tVIDEO_POSTER_ALLOWED_MEDIA_TYPES\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\trender={ ( { open } ) => (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\t\tonClick={ open }\n\t\t\t\t\t\t\t\t\t\tref={ posterImageButton }\n\t\t\t\t\t\t\t\t\t\taria-describedby={\n\t\t\t\t\t\t\t\t\t\t\tvideoPosterDescription\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\t\t{ ! poster\n\t\t\t\t\t\t\t\t\t\t\t? __( 'Select' )\n\t\t\t\t\t\t\t\t\t\t\t: __( 'Replace' ) }\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<p id={ videoPosterDescription } hidden>\n\t\t\t\t\t\t\t\t{ poster\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: poster image URL. */\n\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t'The current poster image url is %s'\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tposter\n\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\t\t\t'There is no poster image currently selected'\n\t\t\t\t\t\t\t\t\t ) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t{ !! poster && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tonClick={ onRemovePoster }\n\t\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Remove' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</BaseControl>\n\t\t\t\t\t</MediaUploadCheck>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<figure { ...blockProps }>\n\t\t\t\t{ /*\n\t\t\t\t\tDisable the video tag if the block is not selected\n\t\t\t\t\tso the user clicking on it won't play the\n\t\t\t\t\tvideo when the controls are enabled.\n\t\t\t\t*/ }\n\t\t\t\t<Disabled isDisabled={ ! isSelected }>\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 }\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{ isTemporaryVideo && <Spinner /> }\n\t\t\t\t{ ( ! RichText.isEmpty( caption ) || isSelected ) && (\n\t\t\t\t\t<RichText\n\t\t\t\t\t\ttagName=\"figcaption\"\n\t\t\t\t\t\tclassName={ __experimentalGetElementClassName(\n\t\t\t\t\t\t\t'caption'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\taria-label={ __( 'Video caption text' ) }\n\t\t\t\t\t\tplaceholder={ __( 'Add caption' ) }\n\t\t\t\t\t\tvalue={ caption }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( { caption: value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinlineToolbar\n\t\t\t\t\t\t__unstableOnSplitAtEnd={ () =>\n\t\t\t\t\t\t\tinsertBlocksAfter(\n\t\t\t\t\t\t\t\tcreateBlock( getDefaultBlockName() )\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) }\n\t\t\t</figure>\n\t\t</>\n\t);\n}\n\nexport default VideoEdit;\n"]}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Colors
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Breakpoints & Media Queries
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* SCSS Variables.
|
|
9
|
+
*
|
|
10
|
+
* Please use variables from this sheet to ensure consistency across the UI.
|
|
11
|
+
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
|
12
|
+
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Colors
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Fonts & basic variables.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Grid System.
|
|
22
|
+
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Dimensions.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* Shadows.
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Editor widths.
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* Block & Editor UI.
|
|
35
|
+
*/
|
|
36
|
+
/**
|
|
37
|
+
* Block paddings.
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* React Native specific.
|
|
41
|
+
* These variables do not appear to be used anywhere else.
|
|
42
|
+
*/
|
|
43
|
+
/**
|
|
44
|
+
* Converts a hex value into the rgb equivalent.
|
|
45
|
+
*
|
|
46
|
+
* @param {string} hex - the hexadecimal value to convert
|
|
47
|
+
* @return {string} comma separated rgb values
|
|
48
|
+
*/
|
|
49
|
+
/**
|
|
50
|
+
* Breakpoint mixins
|
|
51
|
+
*/
|
|
52
|
+
/**
|
|
53
|
+
* Long content fade mixin
|
|
54
|
+
*
|
|
55
|
+
* Creates a fading overlay to signify that the content is longer
|
|
56
|
+
* than the space allows.
|
|
57
|
+
*/
|
|
58
|
+
/**
|
|
59
|
+
* Focus styles.
|
|
60
|
+
*/
|
|
61
|
+
/**
|
|
62
|
+
* Applies editor left position to the selector passed as argument
|
|
63
|
+
*/
|
|
64
|
+
/**
|
|
65
|
+
* Styles that are reused verbatim in a few places
|
|
66
|
+
*/
|
|
67
|
+
/**
|
|
68
|
+
* Allows users to opt-out of animations via OS-level preferences.
|
|
69
|
+
*/
|
|
70
|
+
/**
|
|
71
|
+
* Reset default styles for JavaScript UI based pages.
|
|
72
|
+
* This is a WP-admin agnostic reset
|
|
73
|
+
*/
|
|
74
|
+
/**
|
|
75
|
+
* Reset the WP Admin page styles for Gutenberg-like pages.
|
|
76
|
+
*/
|
|
77
|
+
.wp-block-button__link {
|
|
78
|
+
color: #fff;
|
|
79
|
+
background-color: #32373c;
|
|
80
|
+
border-radius: 9999px;
|
|
81
|
+
box-shadow: none;
|
|
82
|
+
text-decoration: none;
|
|
83
|
+
padding: calc(0.667em + 2px) calc(1.333em + 2px);
|
|
84
|
+
font-size: 1.125em;
|
|
85
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Colors
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Breakpoints & Media Queries
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* SCSS Variables.
|
|
9
|
+
*
|
|
10
|
+
* Please use variables from this sheet to ensure consistency across the UI.
|
|
11
|
+
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
|
12
|
+
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Colors
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Fonts & basic variables.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Grid System.
|
|
22
|
+
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Dimensions.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* Shadows.
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Editor widths.
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* Block & Editor UI.
|
|
35
|
+
*/
|
|
36
|
+
/**
|
|
37
|
+
* Block paddings.
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* React Native specific.
|
|
41
|
+
* These variables do not appear to be used anywhere else.
|
|
42
|
+
*/
|
|
43
|
+
/**
|
|
44
|
+
* Converts a hex value into the rgb equivalent.
|
|
45
|
+
*
|
|
46
|
+
* @param {string} hex - the hexadecimal value to convert
|
|
47
|
+
* @return {string} comma separated rgb values
|
|
48
|
+
*/
|
|
49
|
+
/**
|
|
50
|
+
* Breakpoint mixins
|
|
51
|
+
*/
|
|
52
|
+
/**
|
|
53
|
+
* Long content fade mixin
|
|
54
|
+
*
|
|
55
|
+
* Creates a fading overlay to signify that the content is longer
|
|
56
|
+
* than the space allows.
|
|
57
|
+
*/
|
|
58
|
+
/**
|
|
59
|
+
* Focus styles.
|
|
60
|
+
*/
|
|
61
|
+
/**
|
|
62
|
+
* Applies editor left position to the selector passed as argument
|
|
63
|
+
*/
|
|
64
|
+
/**
|
|
65
|
+
* Styles that are reused verbatim in a few places
|
|
66
|
+
*/
|
|
67
|
+
/**
|
|
68
|
+
* Allows users to opt-out of animations via OS-level preferences.
|
|
69
|
+
*/
|
|
70
|
+
/**
|
|
71
|
+
* Reset default styles for JavaScript UI based pages.
|
|
72
|
+
* This is a WP-admin agnostic reset
|
|
73
|
+
*/
|
|
74
|
+
/**
|
|
75
|
+
* Reset the WP Admin page styles for Gutenberg-like pages.
|
|
76
|
+
*/
|
|
77
|
+
.wp-block-button__link {
|
|
78
|
+
color: #fff;
|
|
79
|
+
background-color: #32373c;
|
|
80
|
+
border-radius: 9999px;
|
|
81
|
+
box-shadow: none;
|
|
82
|
+
text-decoration: none;
|
|
83
|
+
padding: calc(0.667em + 2px) calc(1.333em + 2px);
|
|
84
|
+
font-size: 1.125em;
|
|
85
|
+
}
|
|
@@ -1104,9 +1104,19 @@ figure.wp-block-gallery .components-spinner {
|
|
|
1104
1104
|
flex: 1 0 48px;
|
|
1105
1105
|
pointer-events: none;
|
|
1106
1106
|
min-height: 46px;
|
|
1107
|
-
border: 1px dashed currentColor;
|
|
1108
1107
|
border-radius: 2px;
|
|
1109
1108
|
}
|
|
1109
|
+
.wp-block-group.is-layout-flex.block-editor-block-list__block > .block-list-appender:only-child::after::before {
|
|
1110
|
+
content: "";
|
|
1111
|
+
position: absolute;
|
|
1112
|
+
top: 0;
|
|
1113
|
+
left: 0;
|
|
1114
|
+
bottom: 0;
|
|
1115
|
+
right: 0;
|
|
1116
|
+
pointer-events: none;
|
|
1117
|
+
background: currentColor;
|
|
1118
|
+
opacity: 0.1;
|
|
1119
|
+
}
|
|
1110
1120
|
.wp-block-group.is-layout-flex.block-editor-block-list__block > .block-list-appender:only-child .block-editor-inserter {
|
|
1111
1121
|
pointer-events: all;
|
|
1112
1122
|
}
|
|
@@ -1155,6 +1165,9 @@ figure.wp-block-gallery .components-spinner {
|
|
|
1155
1165
|
.wp-block-image.wp-block-image.is-selected .components-placeholder .components-placeholder__illustration {
|
|
1156
1166
|
display: none;
|
|
1157
1167
|
}
|
|
1168
|
+
.wp-block-image.wp-block-image.is-selected .components-placeholder::before {
|
|
1169
|
+
opacity: 0;
|
|
1170
|
+
}
|
|
1158
1171
|
.wp-block-image.wp-block-image .components-placeholder__label,
|
|
1159
1172
|
.wp-block-image.wp-block-image .components-placeholder__instructions,
|
|
1160
1173
|
.wp-block-image.wp-block-image .components-button {
|
|
@@ -1592,10 +1605,20 @@ figure.wp-block-image:not(.wp-block) {
|
|
|
1592
1605
|
bottom: 0;
|
|
1593
1606
|
right: 0;
|
|
1594
1607
|
pointer-events: none;
|
|
1595
|
-
border: 1px dashed currentColor;
|
|
1596
1608
|
border-radius: 2px;
|
|
1597
1609
|
border-radius: inherit;
|
|
1598
1610
|
}
|
|
1611
|
+
.wp-block-navigation-placeholder__preview::before::before {
|
|
1612
|
+
content: "";
|
|
1613
|
+
position: absolute;
|
|
1614
|
+
top: 0;
|
|
1615
|
+
left: 0;
|
|
1616
|
+
bottom: 0;
|
|
1617
|
+
right: 0;
|
|
1618
|
+
pointer-events: none;
|
|
1619
|
+
background: currentColor;
|
|
1620
|
+
opacity: 0.1;
|
|
1621
|
+
}
|
|
1599
1622
|
.wp-block-navigation-placeholder__preview > svg {
|
|
1600
1623
|
fill: currentColor;
|
|
1601
1624
|
}
|
|
@@ -1854,6 +1877,10 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
|
|
1854
1877
|
width: 100%;
|
|
1855
1878
|
}
|
|
1856
1879
|
|
|
1880
|
+
.wp-block-navigation__responsive-container-open.components-button {
|
|
1881
|
+
opacity: 1;
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1857
1884
|
/**
|
|
1858
1885
|
* Submenus.
|
|
1859
1886
|
*/
|
|
@@ -2074,6 +2101,22 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
|
|
2074
2101
|
opacity: 0;
|
|
2075
2102
|
}
|
|
2076
2103
|
|
|
2104
|
+
.components-popover.wp-block-paragraph__drop-zone .components-popover__content {
|
|
2105
|
+
border: none;
|
|
2106
|
+
outline: none;
|
|
2107
|
+
box-shadow: none;
|
|
2108
|
+
}
|
|
2109
|
+
.components-popover.wp-block-paragraph__drop-zone .wp-block-paragraph__drop-zone-backdrop {
|
|
2110
|
+
position: absolute;
|
|
2111
|
+
}
|
|
2112
|
+
.components-popover.wp-block-paragraph__drop-zone .wp-block-paragraph__drop-zone-foreground {
|
|
2113
|
+
position: absolute;
|
|
2114
|
+
inset: 0;
|
|
2115
|
+
pointer-events: none;
|
|
2116
|
+
background-color: var(--wp-admin-theme-color);
|
|
2117
|
+
border-radius: 2px;
|
|
2118
|
+
}
|
|
2119
|
+
|
|
2077
2120
|
.wp-block-post-excerpt .wp-block-post-excerpt__excerpt.is-inline {
|
|
2078
2121
|
display: inline-block;
|
|
2079
2122
|
}
|
|
@@ -2268,6 +2311,10 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
|
|
2268
2311
|
border: 1px dashed;
|
|
2269
2312
|
}
|
|
2270
2313
|
|
|
2314
|
+
.editor-styles-wrapper .wp-block-site-title a {
|
|
2315
|
+
color: inherit;
|
|
2316
|
+
}
|
|
2317
|
+
|
|
2271
2318
|
.wp-block-social-links .wp-social-link {
|
|
2272
2319
|
line-height: 0;
|
|
2273
2320
|
}
|
|
@@ -2523,6 +2570,28 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
|
|
2523
2570
|
outline: 1px solid #ddd;
|
|
2524
2571
|
}
|
|
2525
2572
|
|
|
2573
|
+
.wp-block-video.wp-block-video.is-selected .components-placeholder {
|
|
2574
|
+
color: #1e1e1e;
|
|
2575
|
+
background-color: #fff;
|
|
2576
|
+
box-shadow: inset 0 0 0 1px #1e1e1e;
|
|
2577
|
+
border: none;
|
|
2578
|
+
border-radius: 2px;
|
|
2579
|
+
}
|
|
2580
|
+
.wp-block-video.wp-block-video.is-selected .components-placeholder > svg {
|
|
2581
|
+
opacity: 0;
|
|
2582
|
+
}
|
|
2583
|
+
.wp-block-video.wp-block-video.is-selected .components-placeholder .components-placeholder__illustration {
|
|
2584
|
+
display: none;
|
|
2585
|
+
}
|
|
2586
|
+
.wp-block-video.wp-block-video.is-selected .components-placeholder::before {
|
|
2587
|
+
opacity: 0;
|
|
2588
|
+
}
|
|
2589
|
+
.wp-block-video.wp-block-video .components-placeholder__label,
|
|
2590
|
+
.wp-block-video.wp-block-video .components-placeholder__instructions,
|
|
2591
|
+
.wp-block-video.wp-block-video .components-button {
|
|
2592
|
+
transition: none;
|
|
2593
|
+
}
|
|
2594
|
+
|
|
2526
2595
|
.wp-block[data-align=center] > .wp-block-video {
|
|
2527
2596
|
text-align: center;
|
|
2528
2597
|
}
|
|
@@ -2719,19 +2788,19 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
|
|
2719
2788
|
-webkit-backdrop-filter: none;
|
|
2720
2789
|
backdrop-filter: none;
|
|
2721
2790
|
}
|
|
2722
|
-
.wp-block-post-featured-image
|
|
2723
|
-
.wp-block-post-featured-image
|
|
2791
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder,
|
|
2792
|
+
.wp-block-post-featured-image .components-placeholder {
|
|
2724
2793
|
justify-content: center;
|
|
2725
2794
|
align-items: center;
|
|
2726
2795
|
padding: 0;
|
|
2727
2796
|
min-height: 200px;
|
|
2728
2797
|
}
|
|
2729
|
-
.wp-block-post-featured-image
|
|
2730
|
-
.wp-block-post-featured-image
|
|
2798
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-form-file-upload,
|
|
2799
|
+
.wp-block-post-featured-image .components-placeholder .components-form-file-upload {
|
|
2731
2800
|
display: none;
|
|
2732
2801
|
}
|
|
2733
|
-
.wp-block-post-featured-image
|
|
2734
|
-
.wp-block-post-featured-image
|
|
2802
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-button,
|
|
2803
|
+
.wp-block-post-featured-image .components-placeholder .components-button {
|
|
2735
2804
|
padding: 0;
|
|
2736
2805
|
display: flex;
|
|
2737
2806
|
justify-content: center;
|
|
@@ -2745,51 +2814,61 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
|
|
2745
2814
|
border-style: solid;
|
|
2746
2815
|
color: #fff;
|
|
2747
2816
|
}
|
|
2748
|
-
.wp-block-post-featured-image
|
|
2749
|
-
.wp-block-post-featured-image
|
|
2817
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder .components-button > svg,
|
|
2818
|
+
.wp-block-post-featured-image .components-placeholder .components-button > svg {
|
|
2750
2819
|
color: inherit;
|
|
2751
2820
|
}
|
|
2752
|
-
.wp-block-post-featured-image
|
|
2753
|
-
.wp-block-post-featured-image
|
|
2821
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where(.has-border-color),
|
|
2822
|
+
.wp-block-post-featured-image .components-placeholder:where(.has-border-color),
|
|
2823
|
+
.wp-block-post-featured-image img:where(.has-border-color) {
|
|
2754
2824
|
border-style: solid;
|
|
2755
2825
|
}
|
|
2756
|
-
.wp-block-post-featured-image
|
|
2757
|
-
.wp-block-post-featured-image
|
|
2826
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-top-color"]),
|
|
2827
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-top-color"]),
|
|
2828
|
+
.wp-block-post-featured-image img:where([style*="border-top-color"]) {
|
|
2758
2829
|
border-top-style: solid;
|
|
2759
2830
|
}
|
|
2760
|
-
.wp-block-post-featured-image
|
|
2761
|
-
.wp-block-post-featured-image
|
|
2831
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-right-color"]),
|
|
2832
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-right-color"]),
|
|
2833
|
+
.wp-block-post-featured-image img:where([style*="border-right-color"]) {
|
|
2762
2834
|
border-left-style: solid;
|
|
2763
2835
|
}
|
|
2764
|
-
.wp-block-post-featured-image
|
|
2765
|
-
.wp-block-post-featured-image
|
|
2836
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-bottom-color"]),
|
|
2837
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-bottom-color"]),
|
|
2838
|
+
.wp-block-post-featured-image img:where([style*="border-bottom-color"]) {
|
|
2766
2839
|
border-bottom-style: solid;
|
|
2767
2840
|
}
|
|
2768
|
-
.wp-block-post-featured-image
|
|
2769
|
-
.wp-block-post-featured-image
|
|
2841
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-left-color"]),
|
|
2842
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-left-color"]),
|
|
2843
|
+
.wp-block-post-featured-image img:where([style*="border-left-color"]) {
|
|
2770
2844
|
border-right-style: solid;
|
|
2771
2845
|
}
|
|
2772
|
-
.wp-block-post-featured-image
|
|
2773
|
-
.wp-block-post-featured-image
|
|
2846
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-width"]),
|
|
2847
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-width"]),
|
|
2848
|
+
.wp-block-post-featured-image img:where([style*="border-width"]) {
|
|
2774
2849
|
border-style: solid;
|
|
2775
2850
|
}
|
|
2776
|
-
.wp-block-post-featured-image
|
|
2777
|
-
.wp-block-post-featured-image
|
|
2851
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-top-width"]),
|
|
2852
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-top-width"]),
|
|
2853
|
+
.wp-block-post-featured-image img:where([style*="border-top-width"]) {
|
|
2778
2854
|
border-top-style: solid;
|
|
2779
2855
|
}
|
|
2780
|
-
.wp-block-post-featured-image
|
|
2781
|
-
.wp-block-post-featured-image
|
|
2856
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-right-width"]),
|
|
2857
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-right-width"]),
|
|
2858
|
+
.wp-block-post-featured-image img:where([style*="border-right-width"]) {
|
|
2782
2859
|
border-left-style: solid;
|
|
2783
2860
|
}
|
|
2784
|
-
.wp-block-post-featured-image
|
|
2785
|
-
.wp-block-post-featured-image
|
|
2861
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-bottom-width"]),
|
|
2862
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-bottom-width"]),
|
|
2863
|
+
.wp-block-post-featured-image img:where([style*="border-bottom-width"]) {
|
|
2786
2864
|
border-bottom-style: solid;
|
|
2787
2865
|
}
|
|
2788
|
-
.wp-block-post-featured-image
|
|
2789
|
-
.wp-block-post-featured-image
|
|
2866
|
+
.wp-block-post-featured-image .wp-block-post-featured-image__placeholder:where([style*="border-left-width"]),
|
|
2867
|
+
.wp-block-post-featured-image .components-placeholder:where([style*="border-left-width"]),
|
|
2868
|
+
.wp-block-post-featured-image img:where([style*="border-left-width"]) {
|
|
2790
2869
|
border-right-style: solid;
|
|
2791
2870
|
}
|
|
2792
|
-
.wp-block-post-featured-image
|
|
2871
|
+
.wp-block-post-featured-image[style*=height] .components-placeholder {
|
|
2793
2872
|
min-height: 48px;
|
|
2794
2873
|
min-width: 48px;
|
|
2795
2874
|
height: 100%;
|