@wordpress/create-block 3.7.0 → 3.8.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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Retrieves the translation of text.
|
|
3
3
|
*
|
|
4
|
-
* @see https://developer.wordpress.org/block-editor/packages/packages-i18n/
|
|
4
|
+
* @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/
|
|
5
5
|
*/
|
|
6
6
|
import { __ } from '@wordpress/i18n';
|
|
7
7
|
|
|
@@ -9,7 +9,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
9
9
|
* React hook that is used to mark the block wrapper element.
|
|
10
10
|
* It provides all the necessary props like the class name.
|
|
11
11
|
*
|
|
12
|
-
* @see https://developer.wordpress.org/block-editor/packages/packages-block-editor/#
|
|
12
|
+
* @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops
|
|
13
13
|
*/
|
|
14
14
|
import { useBlockProps } from '@wordpress/block-editor';
|
|
15
15
|
|
|
@@ -25,7 +25,7 @@ import './editor.scss';
|
|
|
25
25
|
* The edit function describes the structure of your block in the context of the
|
|
26
26
|
* editor. This represents what the editor will render when the block is used.
|
|
27
27
|
*
|
|
28
|
-
* @see https://developer.wordpress.org/block-editor/
|
|
28
|
+
* @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit
|
|
29
29
|
*
|
|
30
30
|
* @return {WPElement} Element to render.
|
|
31
31
|
*/
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Retrieves the translation of text.
|
|
3
|
-
*
|
|
4
|
-
* @see https://developer.wordpress.org/block-editor/packages/packages-i18n/
|
|
5
|
-
*/
|
|
6
|
-
import { __ } from '@wordpress/i18n';
|
|
7
|
-
|
|
8
1
|
/**
|
|
9
2
|
* React hook that is used to mark the block wrapper element.
|
|
10
3
|
* It provides all the necessary props like the class name.
|
|
11
4
|
*
|
|
12
|
-
* @see https://developer.wordpress.org/block-editor/packages/packages-block-editor/#
|
|
5
|
+
* @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops
|
|
13
6
|
*/
|
|
14
7
|
import { useBlockProps } from '@wordpress/block-editor';
|
|
15
8
|
|
|
@@ -18,17 +11,14 @@ import { useBlockProps } from '@wordpress/block-editor';
|
|
|
18
11
|
* be combined into the final markup, which is then serialized by the block
|
|
19
12
|
* editor into `post_content`.
|
|
20
13
|
*
|
|
21
|
-
* @see https://developer.wordpress.org/block-editor/
|
|
14
|
+
* @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save
|
|
22
15
|
*
|
|
23
16
|
* @return {WPElement} Element to render.
|
|
24
17
|
*/
|
|
25
18
|
export default function save() {
|
|
26
19
|
return (
|
|
27
20
|
<p { ...useBlockProps.save() }>
|
|
28
|
-
{
|
|
29
|
-
'{{title}} – hello from the saved content!',
|
|
30
|
-
'{{textdomain}}'
|
|
31
|
-
) }
|
|
21
|
+
{ '{{title}} – hello from the saved content!' }
|
|
32
22
|
</p>
|
|
33
23
|
);
|
|
34
24
|
}
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
/**
|
|
17
17
|
* Retrieves the translation of text.
|
|
18
18
|
*
|
|
19
|
-
* @see https://developer.wordpress.org/block-editor/packages/packages-i18n/
|
|
19
|
+
* @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/
|
|
20
20
|
*/
|
|
21
21
|
var __ = wp.i18n.__;
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* This hook is used to mark the block wrapper element.
|
|
25
25
|
*
|
|
26
|
-
* @see https://developer.wordpress.org/block-editor/packages/packages-block-editor/#
|
|
26
|
+
* @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops
|
|
27
27
|
*/
|
|
28
28
|
var useBlockProps = wp.blockEditor.useBlockProps;
|
|
29
29
|
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
* The edit function describes the structure of your block in the context of the editor.
|
|
85
85
|
* This represents what the editor will render when the block is used.
|
|
86
86
|
*
|
|
87
|
-
* @see https://developer.wordpress.org/block-editor/
|
|
87
|
+
* @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#edit
|
|
88
88
|
*
|
|
89
89
|
* @return {WPElement} Element to render.
|
|
90
90
|
*/
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
* The save function defines the way in which the different attributes should be combined
|
|
101
101
|
* into the final markup, which is then serialized by the block editor into `post_content`.
|
|
102
102
|
*
|
|
103
|
-
* @see https://developer.wordpress.org/block-editor/
|
|
103
|
+
* @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save
|
|
104
104
|
*
|
|
105
105
|
* @return {WPElement} Element to render.
|
|
106
106
|
*/
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
return el(
|
|
109
109
|
'p',
|
|
110
110
|
useBlockProps.save(),
|
|
111
|
-
|
|
111
|
+
'{{title}} – hello from the saved content!',
|
|
112
112
|
);
|
|
113
113
|
},
|
|
114
114
|
} );
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/create-block",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.0",
|
|
4
4
|
"description": "Generates PHP, JS and CSS code for registering a block for a WordPress plugin.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"publishConfig": {
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "08358f53b627a15148c3a3e433cdf58cf8714aa4"
|
|
53
53
|
}
|