Merge pull request #86 from cmanon/feature/85-block-json

Add `block.json`
This commit is contained in:
Justin Foell
2021-02-26 16:01:05 -06:00
committed by GitHub
6 changed files with 82 additions and 53 deletions
+2 -1
View File
@@ -4,7 +4,7 @@ Contributors: cmanon, jrfoell, lancewillett, dlintott, sebastianerb
Tags: strava, activity, bicycle, cycling, biking, running, run, swimming, swim, paddle, kayak, gps, shortcode, widget, plugin
Requires at least: 4.6
Tested up to: 5.6
Stable tag: 2.6.0
Stable tag: 2.7.0
Requires PHP: 5.3
License: GPLv2 or later
@@ -120,6 +120,7 @@ On the WP-Strava settings page you cannot currently remove and add another athle
= 2.7.0 =
Add setting to choose API cache interval (1 hour / 15 minutes) https://wordpress.org/support/topic/decrease-update-time-for-group-recent-activities/
Move block type metadata to `block.json` for future discoverability.
= 2.6.0 =
+31
View File
@@ -0,0 +1,31 @@
{
"apiVersion": 2,
"name": "wp-strava/activity",
"title": "Strava Activity",
"category": "embed",
"icon": "chart-line",
"description": "Embed a Strava Activity",
"keywords": [ "activity", "ride", "map" ],
"textdomain": "wp-strava",
"attributes": {
"url": {
"type": "string",
"default": ""
},
"imageOnly": {
"type": "boolean",
"default": false
},
"displayMarkers": {
"type": "boolean",
"default": false
},
"som": {
"type": "string",
"default": null
}
},
"editorScript": "wp-strava-block",
"editorStyle": "wp-strava-block-editor",
"style": "wp-strava-block"
}
+8 -25
View File
@@ -1,29 +1,12 @@
/* global wp, wpStrava */
import { registerBlockType } from '@wordpress/blocks';
import edit from './edit';
import metadata from './block.json';
registerBlockType( 'wp-strava/activity', {
title: 'Strava Activity',
icon: 'chart-line',
category: 'embed',
attributes: {
url: {
type: 'string',
default: '',
},
imageOnly: {
type: 'boolean',
default: false,
},
displayMarkers: {
type: 'boolean',
default: false,
},
som: {
type: 'string',
default: null,
},
},
edit,
save: () => null,
} );
metadata.edit = edit;
metadata.save = () => null;
// Leaving this in place causes problems with the toolbar.
delete metadata.apiVersion;
registerBlockType( metadata.name, metadata );
+31
View File
@@ -0,0 +1,31 @@
{
"apiVersion": 2,
"name": "wp-strava/route",
"title": "Strava Route",
"category": "embed",
"icon": "location-alt",
"description": "Embed a Strava Route",
"keywords": [ "route", "map" ],
"textdomain": "wp-strava",
"attributes": {
"url": {
"type": "string",
"default": ""
},
"imageOnly": {
"type": "boolean",
"default": false
},
"displayMarkers": {
"type": "boolean",
"default": false
},
"som": {
"type": "string",
"default": null
}
},
"editorScript": "wp-strava-block",
"editorStyle": "wp-strava-block-editor",
"style": "wp-strava-block"
}
+8 -25
View File
@@ -1,29 +1,12 @@
/* global wp, wpStrava */
import { registerBlockType } from '@wordpress/blocks';
import edit from './edit';
import metadata from './block.json';
registerBlockType( 'wp-strava/route', {
title: 'Strava Route',
icon: 'location-alt',
category: 'embed',
attributes: {
url: {
type: 'string',
default: '',
},
imageOnly: {
type: 'boolean',
default: false,
},
displayMarkers: {
type: 'boolean',
default: false,
},
som: {
type: 'string',
default: null,
},
},
edit,
save: () => null,
} );
metadata.edit = edit;
metadata.save = () => null;
// Leaving this in place causes problems with the toolbar.
delete metadata.apiVersion;
registerBlockType( metadata.name, metadata );
+2 -2
View File
@@ -3,7 +3,7 @@
* Plugin Name: WP Strava
* Plugin URI: https://wordpress.org/plugins/wp-strava/
* Description: Show your strava.com activity on your WordPress site. Some Icons are Copyright © Yusuke Kamiyamane. All rights reserved. Licensed under a Creative Commons Attribution 3.0 license.
* Version: 2.6.0
* Version: 2.7.0
* Author: Carlos Santa Cruz, Justin Foell, Lance Willett, Daniel Lintott, Sebastian Erb
* License: GPL2
* Text Domain: wp-strava
@@ -27,7 +27,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
define( 'WPSTRAVA_PLUGIN_VERSION', '2.6.0' );
define( 'WPSTRAVA_PLUGIN_VERSION', '2.7.0' );
define( 'WPSTRAVA_PLUGIN_FILE', __FILE__ );
define( 'WPSTRAVA_PLUGIN_DIR', trailingslashit( dirname( __FILE__ ) ) );
define( 'WPSTRAVA_PLUGIN_URL', plugins_url( '/', __FILE__ ) );