@automattic/newspack-blocks 1.53.0 → 1.54.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/.cache/babel/1783de595f21d427355e559781275222.json.gz +0 -0
- package/.cache/babel/2a75259638488d555bb07fb4f54ddde6.json.gz +0 -0
- package/.cache/babel/{64cb5afd808420a679c0d56e7bdb7949.json.gz → 2dfe70bf8fa9218857f45826e2386a32.json.gz} +0 -0
- package/.cache/babel/2ef414e63685642b486b71a962a5cc09.json.gz +0 -0
- package/.cache/babel/5a94cdb1154d1770a8b0e8cd3145825b.json.gz +0 -0
- package/.cache/babel/678cc0f373236434bf692c16d26ba22f.json.gz +0 -0
- package/.cache/babel/71371fcf9db60a3a1e024991cb3b4bf3.json.gz +0 -0
- package/.cache/babel/725e695c6992a4d01573b83867255ea9.json.gz +0 -0
- package/.cache/babel/94ee8f45c55ecf01005a435ab588333b.json.gz +0 -0
- package/.cache/babel/a5759fe1915229088160b7f5eb8a2e75.json.gz +0 -0
- package/.cache/babel/{bdebf548c146fe858685d50dd0ebd031.json.gz → be383af4530fd3521ee3db177be1bbf4.json.gz} +0 -0
- package/.cache/babel/d298f58c94d221b643c4c009ea0d8002.json.gz +0 -0
- package/.cache/babel/dc7e2d653dbbdbd1939aa281435afa5d.json.gz +0 -0
- package/.cache/babel/f50f27ba4b367318e30e91dbe003e5c8.json.gz +0 -0
- package/CHANGELOG.md +35 -0
- package/dist/author-profile/view.asset.php +1 -1
- package/dist/author-profile/view.css +1 -1
- package/dist/author-profile/view.rtl.css +1 -1
- package/dist/carousel/view.asset.php +1 -1
- package/dist/carousel/view.css +1 -1
- package/dist/carousel/view.js +1 -1
- package/dist/carousel/view.rtl.css +1 -1
- package/dist/donate/view.asset.php +1 -1
- package/dist/donate/view.css +1 -1
- package/dist/donate/view.rtl.css +1 -1
- package/dist/donateStreamlined.asset.php +1 -1
- package/dist/donateStreamlined.js +1 -1
- package/dist/editor.asset.php +1 -1
- package/dist/editor.css +1 -1
- package/dist/editor.js +5 -5
- package/dist/editor.rtl.css +1 -1
- package/dist/homepage-articles/view.asset.php +1 -1
- package/dist/homepage-articles/view.css +1 -1
- package/dist/homepage-articles/view.rtl.css +1 -1
- package/dist/placeholder_blocks.asset.php +1 -0
- package/dist/placeholder_blocks.js +1 -0
- package/includes/class-newspack-blocks-api.php +14 -12
- package/includes/class-newspack-blocks-patterns.php +3 -2
- package/includes/class-newspack-blocks.php +64 -1
- package/newspack-blocks.php +3 -2
- package/package.json +17 -16
- package/src/block-patterns/homepage-posts-14.php +1 -1
- package/src/block-patterns/homepage-posts-2.php +1 -1
- package/src/block-patterns/homepage-posts-26.php +1 -1
- package/src/block-patterns/homepage-posts-31.php +13 -0
- package/src/block-patterns/homepage-posts-7.php +1 -1
- package/src/block-styles/core/columns/editor.scss +10 -10
- package/src/block-styles/core/columns/view.scss +8 -8
- package/src/block-styles/core/group/editor.scss +3 -3
- package/src/block-styles/core/group/view.scss +3 -3
- package/src/blocks/author-list/editor.scss +1 -1
- package/src/blocks/author-profile/edit.js +29 -6
- package/src/blocks/author-profile/editor.scss +4 -3
- package/src/blocks/author-profile/view.scss +9 -9
- package/src/blocks/carousel/edit.js +31 -15
- package/src/blocks/carousel/editor.scss +1 -1
- package/src/blocks/carousel/view.php +94 -87
- package/src/blocks/carousel/view.scss +52 -13
- package/src/blocks/donate/block.json +49 -0
- package/src/blocks/donate/edit.tsx +569 -0
- package/src/blocks/donate/editor.scss +68 -8
- package/src/blocks/donate/index.js +8 -41
- package/src/blocks/donate/streamlined/style.scss +17 -17
- package/src/blocks/donate/view.php +226 -174
- package/src/blocks/donate/view.scss +97 -114
- package/src/blocks/homepage-articles/edit.js +28 -22
- package/src/blocks/homepage-articles/editor.scss +5 -5
- package/src/blocks/homepage-articles/templates/article.php +78 -73
- package/src/blocks/homepage-articles/utils.ts +1 -3
- package/src/blocks/homepage-articles/view.scss +68 -40
- package/src/blocks/iframe/edit.js +18 -14
- package/src/blocks/iframe/editor.scss +3 -3
- package/src/blocks/video-playlist/editor.scss +2 -2
- package/src/setup/editor.scss +46 -4
- package/src/setup/placeholder-blocks.js +83 -0
- package/src/shared/sass/_mixins.scss +7 -5
- package/src/types/@wordpress/block-editor.d.ts +1 -0
- package/src/types/@wordpress/components.d.ts +1 -0
- package/src/types/{index.ts → index.d.ts} +5 -1
- package/src/types/newspack-components.d.ts +7 -0
- package/vendor/autoload.php +1 -1
- package/vendor/composer/autoload_real.php +4 -4
- package/vendor/composer/autoload_static.php +2 -2
- package/vendor/composer/installed.php +2 -2
- package/webpack.config.js +4 -0
- package/.cache/babel/07169c73863508b392f15022920bd0b6.json.gz +0 -0
- package/.cache/babel/10faf7c74a89e9aa4d8b9528a654913e.json.gz +0 -0
- package/.cache/babel/3fc03f1e35bc1fde55a903cf25d74d3d.json.gz +0 -0
- package/.cache/babel/553094e2be86910f765ad110c8da1ba1.json.gz +0 -0
- package/.cache/babel/55dd64fbb5126117016b9edff26ca5ee.json.gz +0 -0
- package/.cache/babel/7cbfe1b298fdc2a21add34363b2a6046.json.gz +0 -0
- package/.cache/babel/95c79f7af2e88cb1c48e88f304b1a1fd.json.gz +0 -0
- package/.cache/babel/ac3be6086bb961d3a94ba6ba7728901c.json.gz +0 -0
- package/.cache/babel/c9354785521531ea2b4a9a8c2f526abf.json.gz +0 -0
- package/.cache/babel/ca34d0586d4fbcd06c357ff72bda9a19.json.gz +0 -0
- package/.cache/babel/edb4dcd474dbafd6ea1655b24469e261.json.gz +0 -0
- package/src/blocks/donate/edit.js +0 -587
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies.
|
|
3
|
+
*/
|
|
4
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
5
|
+
import { useBlockProps } from '@wordpress/block-editor';
|
|
6
|
+
import { getBlockType, registerBlockType } from '@wordpress/blocks';
|
|
7
|
+
import { Button } from '@wordpress/components';
|
|
8
|
+
import { withDispatch } from '@wordpress/data';
|
|
9
|
+
import { Icon, pullquote } from '@wordpress/icons';
|
|
10
|
+
|
|
11
|
+
const placeholderBlocks = {
|
|
12
|
+
'newspack-ads/ad-unit': {
|
|
13
|
+
title: __( 'Ad Unit', 'newspack-blocks' ),
|
|
14
|
+
description: __( 'Render an ad unit from your inventory.', 'newspack-blocks' ),
|
|
15
|
+
icon: pullquote,
|
|
16
|
+
message: __( 'Place ad units inside your page by installing Newspack Ads.', 'newspack-blocks' ),
|
|
17
|
+
url: 'https://newspack.pub/support/advertising/',
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
function registerPlaceholderBlock( blockName, { title, description, icon, message, url } ) {
|
|
22
|
+
if ( getBlockType( blockName ) ) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
title = title || blockName.split( '/' ).pop();
|
|
26
|
+
const edit = ( { clientId, removeBlocks } ) => {
|
|
27
|
+
const blockProps = useBlockProps(); // eslint-disable-line
|
|
28
|
+
return (
|
|
29
|
+
<div { ...blockProps }>
|
|
30
|
+
<div className="newspack-blocks-placeholder-block">
|
|
31
|
+
<div className="newspack-blocks-placeholder-block__label">
|
|
32
|
+
{ icon && <Icon icon={ icon } /> }
|
|
33
|
+
{ title }
|
|
34
|
+
</div>
|
|
35
|
+
<p>
|
|
36
|
+
<strong>
|
|
37
|
+
{ sprintf(
|
|
38
|
+
// translators: %s is the block name.
|
|
39
|
+
__( 'The "%s" block is currently not available.', 'newspack-blocks' ),
|
|
40
|
+
title
|
|
41
|
+
) }
|
|
42
|
+
</strong>
|
|
43
|
+
</p>
|
|
44
|
+
{ message && <p>{ message }</p> }
|
|
45
|
+
<div className="newspack-blocks-placeholder-block__buttons">
|
|
46
|
+
{ url && (
|
|
47
|
+
<Button variant="primary" target="_blank" rel="external" href={ url }>
|
|
48
|
+
{ __( 'Visit Plugin Page', 'newspack-blocks' ) }
|
|
49
|
+
</Button>
|
|
50
|
+
) }
|
|
51
|
+
<Button variant="secondary" isDestructive onClick={ () => removeBlocks( clientId ) }>
|
|
52
|
+
{ __( 'Remove Block', 'newspack-blocks' ) }
|
|
53
|
+
</Button>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
registerBlockType( blockName, {
|
|
60
|
+
title,
|
|
61
|
+
description,
|
|
62
|
+
icon,
|
|
63
|
+
edit: withDispatch( dispatch => ( {
|
|
64
|
+
removeBlocks: dispatch( 'core/block-editor' ).removeBlocks,
|
|
65
|
+
} ) )( edit ),
|
|
66
|
+
supports: {
|
|
67
|
+
html: false,
|
|
68
|
+
lock: false,
|
|
69
|
+
reusable: false,
|
|
70
|
+
inserter: false,
|
|
71
|
+
defaultStylePicker: false,
|
|
72
|
+
customClassName: false,
|
|
73
|
+
className: false,
|
|
74
|
+
alignWide: false,
|
|
75
|
+
align: false,
|
|
76
|
+
anchor: false,
|
|
77
|
+
},
|
|
78
|
+
} );
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
for ( const blockName in placeholderBlocks ) {
|
|
82
|
+
registerPlaceholderBlock( blockName, placeholderBlocks[ blockName ] );
|
|
83
|
+
}
|
|
@@ -1,30 +1,32 @@
|
|
|
1
|
+
@use './variables';
|
|
2
|
+
|
|
1
3
|
@mixin media( $res ) {
|
|
2
4
|
@if mobile == $res {
|
|
3
|
-
@media only screen and ( min-width:
|
|
5
|
+
@media only screen and ( min-width: variables.$mobile_width ) {
|
|
4
6
|
@content;
|
|
5
7
|
}
|
|
6
8
|
}
|
|
7
9
|
|
|
8
10
|
@if tabletonly == $res {
|
|
9
|
-
@media only screen and ( max-width: #{
|
|
11
|
+
@media only screen and ( max-width: #{ variables.$tablet_width - 1 } ) {
|
|
10
12
|
@content;
|
|
11
13
|
}
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
@if tablet == $res {
|
|
15
|
-
@media only screen and ( min-width:
|
|
17
|
+
@media only screen and ( min-width: variables.$tablet_width ) {
|
|
16
18
|
@content;
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
@if desktop == $res {
|
|
21
|
-
@media only screen and ( min-width:
|
|
23
|
+
@media only screen and ( min-width: variables.$desktop_width ) {
|
|
22
24
|
@content;
|
|
23
25
|
}
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
@if wide == $res {
|
|
27
|
-
@media only screen and ( min-width:
|
|
29
|
+
@media only screen and ( min-width: variables.$wide_width ) {
|
|
28
30
|
@content;
|
|
29
31
|
}
|
|
30
32
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module '@wordpress/block-editor'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module '@wordpress/components'
|
|
@@ -3,7 +3,11 @@ declare global {
|
|
|
3
3
|
wpcomGutenberg: {
|
|
4
4
|
blogPublic: string;
|
|
5
5
|
};
|
|
6
|
-
newspack_blocks_data: {
|
|
6
|
+
newspack_blocks_data: {
|
|
7
|
+
assets_path: string;
|
|
8
|
+
is_rendering_streamlined_block?: boolean;
|
|
9
|
+
streamlined_block_stripe_badge?: string;
|
|
10
|
+
};
|
|
7
11
|
}
|
|
8
12
|
|
|
9
13
|
type PostId = number;
|
package/vendor/autoload.php
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// autoload_real.php @generated by Composer
|
|
4
4
|
|
|
5
|
-
class
|
|
5
|
+
class ComposerAutoloaderInit49fbd6ec7deee2cfafc0623f87888fe4
|
|
6
6
|
{
|
|
7
7
|
private static $loader;
|
|
8
8
|
|
|
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit23e7353bf7a8e11d2c7c2cc21cce61d6
|
|
|
22
22
|
return self::$loader;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
spl_autoload_register(array('
|
|
25
|
+
spl_autoload_register(array('ComposerAutoloaderInit49fbd6ec7deee2cfafc0623f87888fe4', 'loadClassLoader'), true, true);
|
|
26
26
|
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
|
27
|
-
spl_autoload_unregister(array('
|
|
27
|
+
spl_autoload_unregister(array('ComposerAutoloaderInit49fbd6ec7deee2cfafc0623f87888fe4', 'loadClassLoader'));
|
|
28
28
|
|
|
29
29
|
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
|
30
30
|
if ($useStaticLoader) {
|
|
31
31
|
require __DIR__ . '/autoload_static.php';
|
|
32
32
|
|
|
33
|
-
call_user_func(\Composer\Autoload\
|
|
33
|
+
call_user_func(\Composer\Autoload\ComposerStaticInit49fbd6ec7deee2cfafc0623f87888fe4::getInitializer($loader));
|
|
34
34
|
} else {
|
|
35
35
|
$map = require __DIR__ . '/autoload_namespaces.php';
|
|
36
36
|
foreach ($map as $namespace => $path) {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
namespace Composer\Autoload;
|
|
6
6
|
|
|
7
|
-
class
|
|
7
|
+
class ComposerStaticInit49fbd6ec7deee2cfafc0623f87888fe4
|
|
8
8
|
{
|
|
9
9
|
public static $classMap = array (
|
|
10
10
|
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
|
@@ -13,7 +13,7 @@ class ComposerStaticInit23e7353bf7a8e11d2c7c2cc21cce61d6
|
|
|
13
13
|
public static function getInitializer(ClassLoader $loader)
|
|
14
14
|
{
|
|
15
15
|
return \Closure::bind(function () use ($loader) {
|
|
16
|
-
$loader->classMap =
|
|
16
|
+
$loader->classMap = ComposerStaticInit49fbd6ec7deee2cfafc0623f87888fe4::$classMap;
|
|
17
17
|
|
|
18
18
|
}, null, ClassLoader::class);
|
|
19
19
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
'type' => 'wordpress-plugin',
|
|
6
6
|
'install_path' => __DIR__ . '/../../',
|
|
7
7
|
'aliases' => array(),
|
|
8
|
-
'reference' => '
|
|
8
|
+
'reference' => 'd0c5ef37143589ab35d9926bda95d6de2e196b63',
|
|
9
9
|
'name' => 'automattic/newspack-blocks',
|
|
10
10
|
'dev' => false,
|
|
11
11
|
),
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
'type' => 'wordpress-plugin',
|
|
17
17
|
'install_path' => __DIR__ . '/../../',
|
|
18
18
|
'aliases' => array(),
|
|
19
|
-
'reference' => '
|
|
19
|
+
'reference' => 'd0c5ef37143589ab35d9926bda95d6de2e196b63',
|
|
20
20
|
'dev_requirement' => false,
|
|
21
21
|
),
|
|
22
22
|
),
|
package/webpack.config.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
**** WARNING: No ES6 modules here. Not transpiled! ****
|
|
3
3
|
*/
|
|
4
4
|
/* eslint-disable import/no-nodejs-modules */
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* External dependencies
|
|
@@ -45,12 +46,15 @@ const editorScript = [
|
|
|
45
46
|
...blockScripts( 'editor', path.join( __dirname, 'src' ), blocks ),
|
|
46
47
|
];
|
|
47
48
|
|
|
49
|
+
const placeholderBlocksScript = path.join( __dirname, 'src', 'setup', 'placeholder-blocks' );
|
|
50
|
+
|
|
48
51
|
const blockStylesScript = [ path.join( __dirname, 'src', 'block-styles', 'view' ) ];
|
|
49
52
|
|
|
50
53
|
const webpackConfig = getBaseWebpackConfig(
|
|
51
54
|
{ WP: true },
|
|
52
55
|
{
|
|
53
56
|
entry: {
|
|
57
|
+
placeholder_blocks: placeholderBlocksScript,
|
|
54
58
|
editor: editorScript,
|
|
55
59
|
block_styles: blockStylesScript,
|
|
56
60
|
donateStreamlined: path.join( __dirname, 'src/blocks/donate/streamlined' ),
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|