mirror of
https://github.com/10h30/wp-strava.git
synced 2026-07-15 20:53:49 +09:00
Add block.json
This commit is contained in:
@@ -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"
|
||||
}
|
||||
@@ -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 );
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user