Skip to content

Commit

Permalink
Merge branch 'feature/blockjson'
Browse files Browse the repository at this point in the history
  • Loading branch information
ronaldhuereca committed Jan 3, 2023
2 parents be5365a + df0d812 commit ec1e80b
Show file tree
Hide file tree
Showing 55 changed files with 12,652 additions and 15,237 deletions.
21 changes: 0 additions & 21 deletions .editorconfig

This file was deleted.

2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
**/node_modules/**
**/vendor/**
build
dist
coverage
cypress
node_modules
vendor
google-fonts.js
18 changes: 16 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
{
"extends": [ "plugin:@wordpress/eslint-plugin/recommended" ]
}
"extends": [ "plugin:@wordpress/eslint-plugin/recommended" ],
"parserOptions": {
"ecmaVersion": 2017
},

"globals": {
"$": true,
"wp":true,
"console":true,
"$uifm":true
},
"rules": {
"camelcase": "off",
"no-console": "off"
}
}
51 changes: 27 additions & 24 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
{
"root": true,
"parser": "babel-eslint",
"extends": [ "plugin:@wordpress/eslint-plugin/recommended" ],
"parser": "@babel/eslint-parser",
"globals": {
"wp": true,
"wpApiSettings": true,
"window": true,
"document": true,
"hasSettingsAdmin": "readonly",
"hasAppearanceAdmin": "readonly",
"hasBlockEditorAdmin": "readonly",
"hasEmailsAdmin":"readonly",
"has_gutenberg": "readonly",
"highlight_and_share": "readonly",
"React": "readonly"
},
"env": {
"browser": false,
"es6": true,
"browser": true,
"node": true,
"mocha": true,
"jest/globals": true
"es6": true
},
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"globals": {
"wp": true,
"wpApiSettings": true,
"window": true,
"document": true
"jsx": true,
"experimentalObjectRestSpread": true
},
"requireConfigFile": false
},
"extends": ["plugin:@wordpress/eslint-plugin/recommended-with-formatting"],
"plugins": ["react", "jsx-a11y", "jest"],
"settings": {
"react": {
Expand All @@ -30,7 +37,7 @@
"rules": {
"array-bracket-spacing": ["error", "always"],
"brace-style": ["error", "1tbs"],
"camelcase": ["error", { "properties": "never" }],
"camelcase": 0,
"comma-dangle": ["error", "always-multiline"],
"comma-spacing": "error",
"comma-style": "error",
Expand Down Expand Up @@ -81,8 +88,7 @@
"no-restricted-syntax": [
"error",
{
"selector":
"ImportDeclaration[source.value=/^@wordpress\\u002F.+\\u002F/]",
"selector": "ImportDeclaration[source.value=/^@wordpress\\u002F.+\\u002F/]",
"message": "Path access on WordPress dependencies is not allowed."
},
{
Expand Down Expand Up @@ -118,18 +124,15 @@
"message": "Use @wordpress/utils as import path instead."
},
{
"selector":
"CallExpression[callee.name=/^__|_n|_x$/]:not([arguments.0.type=/^Literal|BinaryExpression$/])",
"selector": "CallExpression[callee.name=/^__|_n|_x$/]:not([arguments.0.type=/^Literal|BinaryExpression$/])",
"message": "Translate function arguments must be string literals."
},
{
"selector":
"CallExpression[callee.name=/^_n|_x$/]:not([arguments.1.type=/^Literal|BinaryExpression$/])",
"selector": "CallExpression[callee.name=/^_n|_x$/]:not([arguments.1.type=/^Literal|BinaryExpression$/])",
"message": "Translate function arguments must be string literals."
},
{
"selector":
"CallExpression[callee.name=_nx]:not([arguments.2.type=/^Literal|BinaryExpression$/])",
"selector": "CallExpression[callee.name=_nx]:not([arguments.2.type=/^Literal|BinaryExpression$/])",
"message": "Translate function arguments must be string literals."
}
],
Expand Down
1 change: 1 addition & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = function (grunt) {
files: [
{src: ['readme.txt'], dest: '/', filter: 'isFile'},
{src: ['wp-plugin-info-card.php'], dest: '/', filter: 'isFile'},
{src: ['build/**'], dest: '/'},
{src: ['dist/**'], dest: '/'},
{src: ['langs/**'], dest: '/'},
{src: ['src/**'], dest: '/'},
Expand Down
116 changes: 116 additions & 0 deletions build/blocks/PluginInfoCard/block.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"title": "WP Plugin Info Card",
"apiVersion": 2,
"name": "wp-plugin-info-card/wp-plugin-info-card",
"category": "text",
"icon": "<svg version='1.1' id='Calque_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='850.39px' height='850.39px' viewBox='0 0 850.39 850.39' enable-background='new 0 0 850.39 850.39' xml:space='preserve'><path fill='#DB3939' d='M425.195,2C190.366,2,0,191.918,0,426.195C0,660.472,190.366,850.39,425.195,850.39 c234.828,0,425.195-189.918,425.195-424.195C850.39,191.918,660.023,2,425.195,2z M662.409,476.302l-2.624,4.533L559.296,654.451 l78.654,45.525l-228.108,105.9L388.046,555.33l78.653,45.523l69.391-119.887l-239.354-0.303l-94.925-0.337l-28.75-0.032l-0.041-0.07 h0l-24.361-42.303l28.111-48.563l109.635-189.419l-78.653-45.524L435.859,48.514l21.797,250.546l-78.654-45.525l-69.391,119.887 l239.353,0.303l123.676,0.37l16.571,28.772l7.831,13.596L662.409,476.302z'/></svg>",
"description": "Add a beautiful plugin or theme info card to your site.",
"keywords": [
"wp plugin",
"plugin",
"card",
"theme"
],
"version": "1.0.0",
"textdomain": "wp-plugin-info-card",
"attributes": {
"assetData": {
"type": "array",
"default": []
},
"type": {
"type": "string",
"default": "plugin"
},
"slug": {
"type": "string",
"default": "wp-plugin-info-card"
},
"loading": {
"type": "boolean",
"default": true
},
"html": {
"type": "string",
"default": ""
},
"align": {
"type": "string",
"default": "full"
},
"image": {
"type": "string",
"default": ""
},
"containerid": {
"type": "string",
"default": ""
},
"margin": {
"type": "string",
"default": ""
},
"clear": {
"type": "string",
"default": "none"
},
"expiration": {
"type": "number",
"default": 0
},
"ajax": {
"type": "string",
"default": "false"
},
"scheme": {
"type": "string",
"default": "default"
},
"layout": {
"type": "string",
"default": "card"
},
"custom": {
"type": "string",
"default": ""
},
"width": {
"type": "string",
"default": ""
},
"preview": {
"type": "boolean",
"default": false
},
"multi": {
"type": "boolean",
"default": false
},
"defaultsApplied": {
"type": "boolean",
"default": false
}
},
"example": {
"attributes": {
"preview": true
}
},
"supports": {
"anchor": true,
"align": [
"left",
"center",
"right",
"full"
],
"className": true
},
"editorScript": "wp_plugin_info_card-cgb-block-js",
"editorStyle": [
"wp_plugin_info_card-cgb-block-editor-css",
"wp_plugin_info_card-cgb-style-css"
],
"style": "has-style-frontend-css"
}
Loading

0 comments on commit ec1e80b

Please sign in to comment.